diff --git a/asset-manifest.json b/asset-manifest.json index 89627aa9..9f77c039 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "/strudel-kit/static/css/main.d44b4b23.css", - "main.js": "/strudel-kit/static/js/main.438cf806.js", + "main.js": "/strudel-kit/static/js/main.2469dfc3.js", "static/js/787.666d7345.chunk.js": "/strudel-kit/static/js/787.666d7345.chunk.js", "static/media/roboto-latin-500-normal.woff2": "/strudel-kit/static/media/roboto-latin-500-normal.f25d774ecfe0996f8eb5.woff2", "static/media/roboto-latin-700-normal.woff2": "/strudel-kit/static/media/roboto-latin-700-normal.227c93190fe7f82de3f8.woff2", @@ -61,11 +61,11 @@ "static/media/roboto-greek-ext-700-normal.woff": "/strudel-kit/static/media/roboto-greek-ext-700-normal.249853776d22a271b2b5.woff", "index.html": "/strudel-kit/index.html", "main.d44b4b23.css.map": "/strudel-kit/static/css/main.d44b4b23.css.map", - "main.438cf806.js.map": "/strudel-kit/static/js/main.438cf806.js.map", + "main.2469dfc3.js.map": "/strudel-kit/static/js/main.2469dfc3.js.map", "787.666d7345.chunk.js.map": "/strudel-kit/static/js/787.666d7345.chunk.js.map" }, "entrypoints": [ "static/css/main.d44b4b23.css", - "static/js/main.438cf806.js" + "static/js/main.2469dfc3.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 592a65e5..a4e692c4 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Scientific Design System Templates | STRUDEL
\ No newline at end of file +Scientific Design System Templates | STRUDEL
\ No newline at end of file diff --git a/static/js/main.438cf806.js b/static/js/main.2469dfc3.js similarity index 99% rename from static/js/main.438cf806.js rename to static/js/main.2469dfc3.js index 9d2472b4..bd893d6e 100644 --- a/static/js/main.438cf806.js +++ b/static/js/main.2469dfc3.js @@ -1,3 +1,3 @@ -/*! For license information please see main.438cf806.js.LICENSE.txt */ -!function(){var e={3361:function(e,t,r){"use strict";r.d(t,{Z:function(){return ie}});var n=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?c(b,--y):0,m--,10===x&&(m=1,v--),x}function T(){return x=y2||C(x)>3?"":" "}function R(e,t){for(;--t&&T()&&!(x<48||x>102||x>57&&x<65||x>70&&x<97););return A(e,S()+(t<6&&32==M()&&32==T()))}function O(e){for(;T();)switch(x){case e:return y;case 34:case 39:34!==e&&39!==e&&O(x);break;case 40:41===e&&O(e);break;case 92:T()}return y}function D(e,t){for(;T()&&e+x!==57&&(e+x!==84||47!==M()););return"/*"+A(t,y-1)+"*"+a(47===e?e:T())}function z(e){for(;!C(M());)T();return A(e,y)}var F="-ms-",j="-moz-",N="-webkit-",Z="comm",B="rule",V="decl",U="@keyframes";function H(e,t){for(var r="",n=p(e),i=0;i0&&d(j)-g&&h(x>32?K(j+";",n,r,g-1):K(l(j," ","")+";",n,r,g-2),p);break;case 59:j+=";";default:if(h(F=Y(j,t,r,v,m,i,f,E,P=[],O=[],g),o),123===C)if(0===m)q(j,t,F,F,P,o,g,f,O);else switch(99===y&&110===c(j,3)?100:y){case 100:case 108:case 109:case 115:q(e,F,F,n&&h(Y(e,F,F,0,0,i,f,E,i,P=[],g),O),i,O,g,f,n?P:O);break;default:q(j,F,F,F,[""],O,0,f,O)}}v=m=x=0,_=A=1,E=j="",g=s;break;case 58:g=1+d(j),x=b;default:if(_<1)if(123==C)--_;else if(125==C&&0==_++&&125==k())continue;switch(j+=a(C),C*_){case 38:A=m>0?1:(j+="\f",-1);break;case 44:f[v++]=(d(j)-1)*A,A=1;break;case 64:45===M()&&(j+=L(T())),y=M(),m=g=d(E=j+=z(S())),C++;break;case 45:45===b&&2==d(j)&&(_=0)}}return o}function Y(e,t,r,n,a,o,u,c,d,h,v){for(var m=a-1,g=0===a?o:[""],y=p(g),x=0,b=0,w=0;x0?g[k]+" "+T:l(T,/&\f/g,g[k])))&&(d[w++]=M);return _(e,t,r,0===a?B:c,d,h,v)}function X(e,t,r){return _(e,t,r,Z,a(x),f(e,2,-2),0)}function K(e,t,r,n){return _(e,t,r,V,f(e,0,n),f(e,n+1,-1),n)}var $=function(e,t,r){for(var n=0,i=0;n=i,i=M(),38===n&&12===i&&(t[r]=1),!C(i);)T();return A(e,y)},J=function(e,t){return P(function(e,t){var r=-1,n=44;do{switch(C(n)){case 0:38===n&&12===M()&&(t[r]=1),e[r]+=$(y-1,t,r);break;case 2:e[r]+=L(n);break;case 4:if(44===n){e[++r]=58===M()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=a(n)}}while(n=T());return e}(E(e),t))},Q=new WeakMap,ee=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Q.get(r))&&!n){Q.set(e,!0);for(var i=[],a=J(t,i),o=r.props,s=0,l=0;s6)switch(c(e,t+1)){case 109:if(45!==c(e,t+4))break;case 102:return l(e,/(.+:)(.+)-([^]+)/,"$1"+N+"$2-$3$1"+j+(108==c(e,t+3)?"$3":"$2-$3"))+e;case 115:return~u(e,"stretch")?re(l(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==c(e,t+1))break;case 6444:switch(c(e,d(e)-3-(~u(e,"!important")&&10))){case 107:return l(e,":",":"+N)+e;case 101:return l(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+N+(45===c(e,14)?"inline-":"")+"box$3$1"+N+"$2$3$1"+F+"$2box$3")+e}break;case 5936:switch(c(e,t+11)){case 114:return N+e+F+l(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return N+e+F+l(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return N+e+F+l(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return N+e+F+e+e}return e}var ne=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case V:e.return=re(e.value,e.length);break;case U:return H([w(e,{value:l(e.value,"@","@"+N)})],n);case B:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return H([w(e,{props:[l(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return H([w(e,{props:[l(t,/:(plac\w+)/,":"+N+"input-$1")]}),w(e,{props:[l(t,/:(plac\w+)/,":-moz-$1")]}),w(e,{props:[l(t,/:(plac\w+)/,F+"input-$1")]})],n)}return""}))}}],ie=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i=e.stylisPlugins||ne;var a,o,s={},l=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+l;return{name:u,styles:i,next:d}}},2561:function(e,t,r){"use strict";var n;r.d(t,{L:function(){return o},j:function(){return s}});var i=r(2791),a=!!(n||(n=r.t(i,2))).useInsertionEffect&&(n||(n=r.t(i,2))).useInsertionEffect,o=a||function(e){return e()},s=a||i.useLayoutEffect},5438:function(e,t,r){"use strict";r.d(t,{My:function(){return a},fp:function(){return n},hC:function(){return i}});function n(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "})),n}var i=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},a=function(e,t,r){i(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+n:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}}},5545:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20z"}),"AccountCircle");t.Z=o},2419:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");t.Z=o},7394:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}),"ArrowBack");t.Z=o},8996:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");t.Z=o},9823:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");t.Z=o},194:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}),"ContentCopy");t.Z=o},7247:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");t.Z=o},3518:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}),"Download");t.Z=o},1286:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Edit");t.Z=o},585:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"}),"FilterAlt");t.Z=o},1903:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList");t.Z=o},7541:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home");t.Z=o},5172:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");t.Z=o},5397:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight");t.Z=o},8008:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");t.Z=o},4897:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"}),"Sort");t.Z=o},3746:function(e,t,r){"use strict";var n=r(4836);t.Z=void 0;var i=n(r(5649)),a=r(184),o=(0,i.default)((0,a.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}),"Visibility");t.Z=o},5649:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.createSvgIcon}});var n=r(4421)},9259:function(e,t,r){"use strict";r.d(t,{Z:function(){return y}});var n=r(7462),i=r(3366),a=r(2791),o=r(8182),s=r(4419),l=r(4036),u=r(1402),c=r(6934),f=r(5878),d=r(1217);function p(e){return(0,d.Z)("MuiSvgIcon",e)}(0,f.Z)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var h=r(184),v=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],m=(0,c.ZP)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:function(e,t){var r=e.ownerState;return[t.root,"inherit"!==r.color&&t["color".concat((0,l.Z)(r.color))],t["fontSize".concat((0,l.Z)(r.fontSize))]]}})((function(e){var t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m,g,y=e.theme,x=e.ownerState;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:x.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(t=y.transitions)||null==(r=t.create)?void 0:r.call(t,"fill",{duration:null==(n=y.transitions)||null==(i=n.duration)?void 0:i.shorter}),fontSize:{inherit:"inherit",small:(null==(a=y.typography)||null==(o=a.pxToRem)?void 0:o.call(a,20))||"1.25rem",medium:(null==(s=y.typography)||null==(l=s.pxToRem)?void 0:l.call(s,24))||"1.5rem",large:(null==(u=y.typography)||null==(c=u.pxToRem)?void 0:c.call(u,35))||"2.1875rem"}[x.fontSize],color:null!=(f=null==(d=(y.vars||y).palette)||null==(p=d[x.color])?void 0:p.main)?f:{action:null==(h=(y.vars||y).palette)||null==(v=h.action)?void 0:v.active,disabled:null==(m=(y.vars||y).palette)||null==(g=m.action)?void 0:g.disabled,inherit:void 0}[x.color]}})),g=a.forwardRef((function(e,t){var r=(0,u.Z)({props:e,name:"MuiSvgIcon"}),c=r.children,f=r.className,d=r.color,g=void 0===d?"inherit":d,y=r.component,x=void 0===y?"svg":y,b=r.fontSize,_=void 0===b?"medium":b,w=r.htmlColor,k=r.inheritViewBox,T=void 0!==k&&k,M=r.titleAccess,S=r.viewBox,A=void 0===S?"0 0 24 24":S,C=(0,i.Z)(r,v),E=a.isValidElement(c)&&"svg"===c.type,P=(0,n.Z)({},r,{color:g,component:x,fontSize:_,instanceFontSize:e.fontSize,inheritViewBox:T,viewBox:A,hasSvgAsChild:E}),L={};T||(L.viewBox=A);var I=function(e){var t=e.color,r=e.fontSize,n=e.classes,i={root:["root","inherit"!==t&&"color".concat((0,l.Z)(t)),"fontSize".concat((0,l.Z)(r))]};return(0,s.Z)(i,p,n)}(P);return(0,h.jsxs)(m,(0,n.Z)({as:x,className:(0,o.Z)(I.root,f),focusable:"false",color:w,"aria-hidden":!M||void 0,role:M?"img":void 0,ref:t},L,C,E&&c.props,{ownerState:P,children:[E?c.props.children:c,M?(0,h.jsx)("title",{children:M}):null]}))}));g.muiName="SvgIcon";var y=g},427:function(e,t){"use strict";t.Z={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"}},6532:function(e,t){"use strict";var r,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function g(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case a:case s:case o:case d:case p:return e;default:switch(e=e&&e.$$typeof){case c:case u:case f:case v:case h:case l:return e;default:return t}}case i:return t}}}r=Symbol.for("react.module.reference")},8457:function(e,t,r){"use strict";r(6532)},6920:function(e,t,r){"use strict";r.d(t,{Z:function(){return z}});var n=r(7462),i=r(3366),a=r(6189),o=r(2466),s=r(5080),l=r(7416),u=r(104),c=r(4942);function f(e,t){var r;return(0,n.Z)({toolbar:(r={minHeight:56},(0,c.Z)(r,e.up("xs"),{"@media (orientation: landscape)":{minHeight:48}}),(0,c.Z)(r,e.up("sm"),{minHeight:64}),r)},t)}var d=r(2065),p={black:"#000",white:"#fff"},h={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},v={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},m={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},g={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},y=r(427),x={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},b={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},_=["mode","contrastThreshold","tonalOffset"],w={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:p.white,default:p.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},k={text:{primary:p.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:p.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function T(e,t,r,n){var i=n.light||n,a=n.dark||1.5*n;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:"light"===t?e.light=(0,d.$n)(e.main,i):"dark"===t&&(e.dark=(0,d._j)(e.main,a)))}function M(e){var t=e.mode,r=void 0===t?"light":t,s=e.contrastThreshold,l=void 0===s?3:s,u=e.tonalOffset,c=void 0===u?.2:u,f=(0,i.Z)(e,_),M=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:y.Z[200],light:y.Z[50],dark:y.Z[400]}:{main:y.Z[700],light:y.Z[400],dark:y.Z[800]}}(r),S=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:v[200],light:v[50],dark:v[400]}:{main:v[500],light:v[300],dark:v[700]}}(r),A=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m[500],light:m[300],dark:m[700]}:{main:m[700],light:m[400],dark:m[800]}}(r),C=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:x[400],light:x[300],dark:x[700]}:{main:x[700],light:x[500],dark:x[900]}}(r),E=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:b[400],light:b[300],dark:b[700]}:{main:b[800],light:b[500],dark:b[900]}}(r),P=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:g[400],light:g[300],dark:g[700]}:{main:"#ed6c02",light:g[500],dark:g[900]}}(r);function L(e){return(0,d.mi)(e,k.text.primary)>=l?k.text.primary:w.text.primary}var I=function(e){var t=e.color,r=e.name,i=e.mainShade,o=void 0===i?500:i,s=e.lightShade,l=void 0===s?300:s,u=e.darkShade,f=void 0===u?700:u;if(!(t=(0,n.Z)({},t)).main&&t[o]&&(t.main=t[o]),!t.hasOwnProperty("main"))throw new Error((0,a.Z)(11,r?" (".concat(r,")"):"",o));if("string"!==typeof t.main)throw new Error((0,a.Z)(12,r?" (".concat(r,")"):"",JSON.stringify(t.main)));return T(t,"light",l,c),T(t,"dark",f,c),t.contrastText||(t.contrastText=L(t.main)),t},R={dark:k,light:w};return(0,o.Z)((0,n.Z)({common:(0,n.Z)({},p),mode:r,primary:I({color:M,name:"primary"}),secondary:I({color:S,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:I({color:A,name:"error"}),warning:I({color:P,name:"warning"}),info:I({color:C,name:"info"}),success:I({color:E,name:"success"}),grey:h,contrastThreshold:l,getContrastText:L,augmentColor:I,tonalOffset:c},R[r]),f)}var S=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];var A={textTransform:"uppercase"},C='"Roboto", "Helvetica", "Arial", sans-serif';function E(e,t){var r="function"===typeof t?t(e):t,a=r.fontFamily,s=void 0===a?C:a,l=r.fontSize,u=void 0===l?14:l,c=r.fontWeightLight,f=void 0===c?300:c,d=r.fontWeightRegular,p=void 0===d?400:d,h=r.fontWeightMedium,v=void 0===h?500:h,m=r.fontWeightBold,g=void 0===m?700:m,y=r.htmlFontSize,x=void 0===y?16:y,b=r.allVariants,_=r.pxToRem,w=(0,i.Z)(r,S);var k=u/14,T=_||function(e){return"".concat(e/x*k,"rem")},M=function(e,t,r,i,a){return(0,n.Z)({fontFamily:s,fontWeight:e,fontSize:T(t),lineHeight:r},s===C?{letterSpacing:"".concat((o=i/t,Math.round(1e5*o)/1e5),"em")}:{},a,b);var o},E={h1:M(f,96,1.167,-1.5),h2:M(f,60,1.2,-.5),h3:M(p,48,1.167,0),h4:M(p,34,1.235,.25),h5:M(p,24,1.334,0),h6:M(v,20,1.6,.15),subtitle1:M(p,16,1.75,.15),subtitle2:M(v,14,1.57,.1),body1:M(p,16,1.5,.15),body2:M(p,14,1.43,.15),button:M(v,14,1.75,.4,A),caption:M(p,12,1.66,.4),overline:M(p,12,2.66,1,A),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,o.Z)((0,n.Z)({htmlFontSize:x,pxToRem:T,fontFamily:s,fontSize:u,fontWeightLight:f,fontWeightRegular:p,fontWeightMedium:v,fontWeightBold:g},E),w,{clone:!1})}function P(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var L=["none",P(0,2,1,-1,0,1,1,0,0,1,3,0),P(0,3,1,-2,0,2,2,0,0,1,5,0),P(0,3,3,-2,0,3,4,0,0,1,8,0),P(0,2,4,-1,0,4,5,0,0,1,10,0),P(0,3,5,-1,0,5,8,0,0,1,14,0),P(0,3,5,-1,0,6,10,0,0,1,18,0),P(0,4,5,-2,0,7,10,1,0,2,16,1),P(0,5,5,-3,0,8,10,1,0,3,14,2),P(0,5,6,-3,0,9,12,1,0,3,16,2),P(0,6,6,-3,0,10,14,1,0,4,18,3),P(0,6,7,-4,0,11,15,1,0,4,20,3),P(0,7,8,-4,0,12,17,2,0,5,22,4),P(0,7,8,-4,0,13,19,2,0,5,24,4),P(0,7,9,-4,0,14,21,2,0,5,26,4),P(0,8,9,-5,0,15,22,2,0,6,28,5),P(0,8,10,-5,0,16,24,2,0,6,30,5),P(0,8,11,-5,0,17,26,2,0,6,32,5),P(0,9,11,-5,0,18,28,2,0,7,34,6),P(0,9,12,-6,0,19,29,2,0,7,36,6),P(0,10,13,-6,0,20,31,3,0,8,38,7),P(0,10,13,-6,0,21,33,3,0,8,40,7),P(0,10,14,-6,0,22,35,3,0,8,42,7),P(0,11,14,-7,0,23,36,3,0,9,44,8),P(0,11,15,-7,0,24,38,3,0,9,46,8)],I=r(1314),R={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},O=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mixins,r=void 0===t?{}:t,c=e.palette,d=void 0===c?{}:c,p=e.transitions,h=void 0===p?{}:p,v=e.typography,m=void 0===v?{}:v,g=(0,i.Z)(e,O);if(e.vars)throw new Error((0,a.Z)(18));var y=M(d),x=(0,s.Z)(e),b=(0,o.Z)(x,{mixins:f(x.breakpoints,r),palette:y,shadows:L.slice(),typography:E(y,m),transitions:(0,I.ZP)(h),zIndex:(0,n.Z)({},R)});b=(0,o.Z)(b,g);for(var _=arguments.length,w=new Array(_>1?_-1:0),k=1;k<_;k++)w[k-1]=arguments[k];return(b=w.reduce((function(e,t){return(0,o.Z)(e,t)}),b)).unstable_sxConfig=(0,n.Z)({},l.Z,null==g?void 0:g.unstable_sxConfig),b.unstable_sx=function(e){return(0,u.Z)({sx:e,theme:this})},b}var z=D},1314:function(e,t,r){"use strict";r.d(t,{ZP:function(){return c},x9:function(){return s}});var n=r(3366),i=r(7462),a=["duration","easing","delay"],o={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},s={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function l(e){return"".concat(Math.round(e),"ms")}function u(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}function c(e){var t=(0,i.Z)({},o,e.easing),r=(0,i.Z)({},s,e.duration);return(0,i.Z)({getAutoHeightDuration:u,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.duration,s=void 0===o?r.standard:o,u=i.easing,c=void 0===u?t.easeInOut:u,f=i.delay,d=void 0===f?0:f;(0,n.Z)(i,a);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof s?s:l(s)," ").concat(c," ").concat("string"===typeof d?d:l(d))})).join(",")}},e,{easing:t,duration:r})}},6482:function(e,t,r){"use strict";var n=(0,r(6920).Z)();t.Z=n},988:function(e,t){"use strict";t.Z="$$material"},6934:function(e,t,r){"use strict";r.d(t,{Dz:function(){return s},FO:function(){return o}});var n=r(4046),i=r(6482),a=r(988),o=function(e){return(0,n.x9)(e)&&"classes"!==e},s=n.x9,l=(0,n.ZP)({themeId:a.Z,defaultTheme:i.Z,rootShouldForwardProp:o});t.ZP=l},1402:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(6083),i=r(6482),a=r(988);function o(e){var t=e.props,r=e.name;return(0,n.Z)({props:t,name:r,defaultTheme:i.Z,themeId:a.Z})}},4036:function(e,t,r){"use strict";var n=r(1122);t.Z=n.Z},4223:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(7462),i=r(2791),a=r(9259),o=r(184);function s(e,t){function r(r,i){return(0,o.jsx)(a.Z,(0,n.Z)({"data-testid":"".concat(t,"Icon"),ref:i},r,{children:e}))}return r.muiName=a.Z.muiName,i.memo(i.forwardRef(r))}},3199:function(e,t,r){"use strict";var n=r(2254);t.Z=n.Z},4421:function(e,t,r){"use strict";r.r(t),r.d(t,{capitalize:function(){return i.Z},createChainedFunction:function(){return a},createSvgIcon:function(){return o.Z},debounce:function(){return s.Z},deprecatedPropType:function(){return l},isMuiElement:function(){return u.Z},ownerDocument:function(){return c.Z},ownerWindow:function(){return f.Z},requirePropFactory:function(){return d},setRef:function(){return p},unstable_ClassNameGenerator:function(){return _},unstable_useEnhancedEffect:function(){return h.Z},unstable_useId:function(){return v.Z},unsupportedProp:function(){return m},useControlled:function(){return g.Z},useEventCallback:function(){return y.Z},useForkRef:function(){return x.Z},useIsFocusVisible:function(){return b.Z}});var n=r(5902),i=r(4036),a=r(8949).Z,o=r(4223),s=r(3199);var l=function(e,t){return function(){return null}},u=r(9103),c=r(8301),f=r(7602);r(7462);var d=function(e,t){return function(){return null}},p=r(2971).Z,h=r(162),v=r(7384);var m=function(e,t,r,n,i){return null},g=r(8278),y=r(9683),x=r(2071),b=r(8221),_={configure:function(e){n.Z.configure(e)}}},9103:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(2791);var i=function(e,t){var r,i;return n.isValidElement(e)&&-1!==t.indexOf(null!=(r=e.type.muiName)?r:null==(i=e.type)||null==(i=i._payload)||null==(i=i.value)?void 0:i.muiName)}},8301:function(e,t,r){"use strict";var n=r(4913);t.Z=n.Z},7602:function(e,t,r){"use strict";var n=r(5202);t.Z=n.Z},8278:function(e,t,r){"use strict";var n=r(8637);t.Z=n.Z},162:function(e,t,r){"use strict";var n=r(2876);t.Z=n.Z},9683:function(e,t,r){"use strict";var n=r(7054);t.Z=n.Z},2071:function(e,t,r){"use strict";var n=r(6117);t.Z=n.Z},7384:function(e,t,r){"use strict";var n=r(8252);t.Z=n.Z},8221:function(e,t,r){"use strict";var n=r(5372);t.Z=n.Z},2421:function(e,t,r){"use strict";r.d(t,{ZP:function(){return y},Co:function(){return x}});var n=r(7462),i=r(2791),a=r(9797),o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,s=(0,a.Z)((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),l=r(2564),u=r(5438),c=r(9140),f=r(2561),d=s,p=function(e){return"theme"!==e},h=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?d:p},v=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!==typeof n&&r&&(n=e.__emotion_forwardProp),n},m=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return(0,u.hC)(t,r,n),(0,f.L)((function(){return(0,u.My)(t,r,n)})),null},g=function e(t,r){var a,o,s=t.__emotion_real===t,f=s&&t.__emotion_base||t;void 0!==r&&(a=r.label,o=r.target);var d=v(t,r,s),p=d||h(f),g=!p("as");return function(){var y=arguments,x=s&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==a&&x.push("label:"+a+";"),null==y[0]||void 0===y[0].raw)x.push.apply(x,y);else{0,x.push(y[0][0]);for(var b=y.length,_=1;_0&&void 0!==arguments[0]?arguments[0]:{};return(null==(e=t.keys)?void 0:e.reduce((function(e,r){return e[t.up(r)]={},e}),{}))||{}}function l(e,t){return e.reduce((function(e,t){var r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e}),t)}function u(e){for(var t=s(e),r=arguments.length,i=new Array(r>1?r-1:0),a=1;a1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),r)}function a(e){if(e.type)return e;if("#"===e.charAt(0))return a(function(e){e=e.slice(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),r=e.match(t);return r&&1===r[0].length&&(r=r.map((function(e){return e+e}))),r?"rgb".concat(4===r.length?"a":"","(").concat(r.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),r=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(r))throw new Error((0,n.Z)(9,e));var i,o=e.substring(t+1,e.length-1);if("color"===r){if(i=(o=o.split(" ")).shift(),4===o.length&&"/"===o[3].charAt(0)&&(o[3]=o[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i))throw new Error((0,n.Z)(10,i))}else o=o.split(",");return{type:r,values:o=o.map((function(e){return parseFloat(e)})),colorSpace:i}}function o(e){var t=e.type,r=e.colorSpace,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),n=-1!==t.indexOf("color")?"".concat(r," ").concat(n.join(" ")):"".concat(n.join(", ")),"".concat(t,"(").concat(n,")")}function s(e){var t="hsl"===(e=a(e)).type||"hsla"===e.type?a(function(e){var t=(e=a(e)).values,r=t[0],n=t[1]/100,i=t[2]/100,s=n*Math.min(i,1-i),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+r/30)%12;return i-s*Math.max(Math.min(t-3,9-t,1),-1)},u="rgb",c=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(u+="a",c.push(t[3])),o({type:u,values:c})}(e)).values:e.values;return t=t.map((function(t){return"color"!==e.type&&(t/=255),t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function l(e,t){var r=s(e),n=s(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function u(e,t){return e=a(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]="/".concat(t):e.values[3]=t,o(e)}function c(e,t){if(e=a(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(var r=0;r<3;r+=1)e.values[r]*=1-t;return o(e)}function f(e,t){if(e=a(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(-1!==e.type.indexOf("color"))for(var n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return o(e)}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return s(e)>.5?c(e,t):f(e,t)}},4046:function(e,t,r){"use strict";r.d(t,{ZP:function(){return S},x9:function(){return _}});var n=r(9439),i=r(3433),a=r(3366),o=r(7462),s=r(2421),l=r(2466),u=r(5080),c=r(1122),f=["variant"];function d(e){return 0===e.length}function p(e){var t=e.variant,r=(0,a.Z)(e,f),n=t||"";return Object.keys(r).sort().forEach((function(t){n+="color"===t?d(n)?e[t]:(0,c.Z)(e[t]):"".concat(d(n)?t:(0,c.Z)(t)).concat((0,c.Z)(e[t].toString()))})),n}var h=r(104),v=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];var m=function(e,t){return t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null},g=function(e){var t={};return e&&e.forEach((function(e){var r=p(e.props);t[r]=e.style})),t},y=function(e,t){var r=[];return t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants),g(r)},x=function(e,t,r){var n=e.ownerState,i=void 0===n?{}:n,a=[];return r&&r.forEach((function(r){var n=!0;Object.keys(r.props).forEach((function(t){i[t]!==r.props[t]&&e[t]!==r.props[t]&&(n=!1)})),n&&a.push(t[p(r.props)])})),a},b=function(e,t,r,n){var i,a=null==r||null==(i=r.components)||null==(i=i[n])?void 0:i.variants;return x(e,t,a)};function _(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}var w=(0,u.Z)(),k=function(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e};function T(e){var t,r=e.defaultTheme,n=e.theme,i=e.themeId;return t=n,0===Object.keys(t).length?r:n[i]||n}var M=function(e){var t,r=e.styledArg,n=e.props,a=e.defaultTheme,s=e.themeId,l=r((0,o.Z)({},n,{theme:T((0,o.Z)({},n,{defaultTheme:a,themeId:s}))}));if(l&&l.variants&&(t=l.variants,delete l.variants),t){var u=x(n,g(t),t);return[l].concat((0,i.Z)(u))}return l};function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.themeId,r=e.defaultTheme,u=void 0===r?w:r,c=e.rootShouldForwardProp,f=void 0===c?_:c,d=e.slotShouldForwardProp,p=void 0===d?_:d,S=function(e){return(0,h.Z)((0,o.Z)({},e,{theme:T((0,o.Z)({},e,{defaultTheme:u,themeId:t}))}))};return S.__mui_systemSx=!0,function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,s.Co)(e,(function(e){return e.filter((function(e){return!(null!=e&&e.__mui_systemSx)}))}));var c,d=r.name,h=r.slot,w=r.skipVariantsResolver,A=r.skipSx,C=r.overridesResolver,E=void 0===C?(c=k(h))?function(e,t){return t[c]}:null:C,P=(0,a.Z)(r,v),L=void 0!==w?w:h&&"Root"!==h&&"root"!==h||!1,I=A||!1;var R=_;"Root"===h||"root"===h?R=f:h?R=p:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(R=void 0);var O=(0,s.ZP)(e,(0,o.Z)({shouldForwardProp:R,label:undefined},P)),D=function(r){for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c0){var _=new Array(v).fill("");(h=[].concat((0,i.Z)(r),(0,i.Z)(_))).raw=[].concat((0,i.Z)(r.raw),(0,i.Z)(_))}var w=O.apply(void 0,[h].concat((0,i.Z)(p)));return e.muiName&&(w.muiName=e.muiName),w};return O.withConfig&&(D.withConfig=O.withConfig),D}}},5080:function(e,t,r){"use strict";r.d(t,{Z:function(){return h}});var n=r(7462),i=r(3366),a=r(2466),o=r(4942),s=["values","unit","step"],l=function(e){var t=Object.keys(e).map((function(t){return{key:t,val:e[t]}}))||[];return t.sort((function(e,t){return e.val-t.val})),t.reduce((function(e,t){return(0,n.Z)({},e,(0,o.Z)({},t.key,t.val))}),{})};var u={borderRadius:4},c=r(5682);var f=r(104),d=r(7416),p=["breakpoints","palette","spacing","shape"];var h=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,r=void 0===t?{}:t,o=e.palette,h=void 0===o?{}:o,v=e.spacing,m=e.shape,g=void 0===m?{}:m,y=(0,i.Z)(e,p),x=function(e){var t=e.values,r=void 0===t?{xs:0,sm:600,md:900,lg:1200,xl:1536}:t,a=e.unit,o=void 0===a?"px":a,u=e.step,c=void 0===u?5:u,f=(0,i.Z)(e,s),d=l(r),p=Object.keys(d);function h(e){var t="number"===typeof r[e]?r[e]:e;return"@media (min-width:".concat(t).concat(o,")")}function v(e){var t="number"===typeof r[e]?r[e]:e;return"@media (max-width:".concat(t-c/100).concat(o,")")}function m(e,t){var n=p.indexOf(t);return"@media (min-width:".concat("number"===typeof r[e]?r[e]:e).concat(o,") and ")+"(max-width:".concat((-1!==n&&"number"===typeof r[p[n]]?r[p[n]]:t)-c/100).concat(o,")")}return(0,n.Z)({keys:p,values:d,up:h,down:v,between:m,only:function(e){return p.indexOf(e)+10&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=(0,c.hB)({spacing:e}),r=function(){for(var e=arguments.length,r=new Array(e),n=0;n1?w-1:0),T=1;T2){if(!u[e])return[e];e=u[e]}var t=e.split(""),r=(0,n.Z)(t,2),i=r[0],a=r[1],o=s[i],c=l[a]||"";return Array.isArray(c)?c.map((function(e){return o+e})):[o+c]})),f=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],d=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],p=[].concat(f,d);function h(e,t,r,n){var i,o=null!=(i=(0,a.DW)(e,t,!1))?i:r;return"number"===typeof o?function(e){return"string"===typeof e?e:o*e}:Array.isArray(o)?function(e){return"string"===typeof e?e:o[e]}:"function"===typeof o?o:function(){}}function v(e){return h(e,"spacing",8)}function m(e,t){if("string"===typeof t||null==t)return t;var r=e(Math.abs(t));return t>=0?r:"number"===typeof r?-r:"-".concat(r)}function g(e,t,r,n){if(-1===t.indexOf(r))return null;var a=function(e,t){return function(r){return e.reduce((function(e,n){return e[n]=m(t,r),e}),{})}}(c(r),n),o=e[r];return(0,i.k9)(e,o,a)}function y(e,t){var r=v(e.theme);return Object.keys(e).map((function(n){return g(e,t,n,r)})).reduce(o.Z,{})}function x(e){return y(e,f)}function b(e){return y(e,d)}function _(e){return y(e,p)}x.propTypes={},x.filterProps=f,b.propTypes={},b.filterProps=d,_.propTypes={},_.filterProps=p},8529:function(e,t,r){"use strict";r.d(t,{DW:function(){return o},Jq:function(){return s}});var n=r(4942),i=r(1122),a=r(1184);function o(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&r){var n="vars.".concat(t).split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e);if(null!=n)return n}return t.split(".").reduce((function(e,t){return e&&null!=e[t]?e[t]:null}),e)}function s(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;return n="function"===typeof e?e(r):Array.isArray(e)?e[r]||i:o(e,r)||i,t&&(n=t(n,i,e)),n}t.ZP=function(e){var t=e.prop,r=e.cssProperty,l=void 0===r?e.prop:r,u=e.themeKey,c=e.transform,f=function(e){if(null==e[t])return null;var r=e[t],f=o(e.theme,u)||{};return(0,a.k9)(e,r,(function(e){var r=s(f,c,e);return e===r&&"string"===typeof e&&(r=s(f,c,"".concat(t).concat("default"===e?"":(0,i.Z)(e)),e)),!1===l?r:(0,n.Z)({},l,r)}))};return f.propTypes={},f.filterProps=[t],f}},7416:function(e,t,r){"use strict";r.d(t,{Z:function(){return L}});var n=r(5682),i=r(8529),a=r(8247);var o=function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:a;return(0,i.Z)(e)}},3073:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(5735);function i(e){var t=e.theme,r=e.name,i=e.props;return t&&t.components&&t.components[r]&&t.components[r].defaultProps?(0,n.Z)(t.components[r].defaultProps,i):i}},6083:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(3073),i=r(418);function a(e){var t=e.props,r=e.name,a=e.defaultTheme,o=e.themeId,s=(0,i.Z)(a);return o&&(s=s[o]||s),(0,n.Z)({theme:s,name:r,props:t})}},9120:function(e,t,r){"use strict";var n=r(2791),i=r(2564);t.Z=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=n.useContext(i.T);return r&&(e=r,0!==Object.keys(e).length)?r:t}},5902:function(e,t){"use strict";var r=function(e){return e},n=function(){var e=r;return{configure:function(t){e=t},generate:function(t){return e(t)},reset:function(){e=r}}}();t.Z=n},1122:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(6189);function i(e){if("string"!==typeof e)throw new Error((0,n.Z)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},4419:function(e,t,r){"use strict";function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n={};return Object.keys(e).forEach((function(i){n[i]=e[i].reduce((function(e,n){if(n){var i=t(n);""!==i&&e.push(i),r&&r[n]&&e.push(r[n])}return e}),[]).join(" ")})),n}r.d(t,{Z:function(){return n}})},8949:function(e,t,r){"use strict";function n(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:166;function n(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o2&&void 0!==arguments[2]?arguments[2]:{clone:!0},s=r.clone?(0,n.Z)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((function(n){"__proto__"!==n&&(i(t[n])&&n in e&&i(e[n])?s[n]=o(e[n],t[n],r):r.clone?s[n]=i(t[n])?a(t[n]):t[n]:s[n]=t[n])})),s}},6189:function(e,t,r){"use strict";function n(e){for(var t="https://mui.com/production-error/?code="+e,r=1;r2&&void 0!==arguments[2]?arguments[2]:"Mui",a=i[t];return a?"".concat(r,"-").concat(a):"".concat(n.Z.generate(e),"-").concat(t)}},5878:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1217);function i(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",i={};return t.forEach((function(t){i[t]=(0,n.Z)(e,t,r)})),i}},4913:function(e,t,r){"use strict";function n(e){return e&&e.ownerDocument||document}r.d(t,{Z:function(){return n}})},5202:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(4913);function i(e){return(0,n.Z)(e).defaultView||window}},5735:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(7462);function i(e,t){var r=(0,n.Z)({},t);return Object.keys(e).forEach((function(a){if(a.toString().match(/^(components|slots)$/))r[a]=(0,n.Z)({},e[a],r[a]);else if(a.toString().match(/^(componentsProps|slotProps)$/)){var o=e[a]||{},s=t[a];r[a]={},s&&Object.keys(s)?o&&Object.keys(o)?(r[a]=(0,n.Z)({},s),Object.keys(o).forEach((function(e){r[a][e]=i(o[e],s[e])}))):r[a]=s:r[a]=o}else void 0===r[a]&&(r[a]=e[a])})),r}},2971:function(e,t,r){"use strict";function n(e,t){"function"===typeof e?e(t):e&&(e.current=t)}r.d(t,{Z:function(){return n}})},8637:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(9439),i=r(2791);function a(e){var t=e.controlled,r=e.default,a=(e.name,e.state,i.useRef(void 0!==t).current),o=i.useState(r),s=(0,n.Z)(o,2),l=s[0],u=s[1];return[a?t:l,i.useCallback((function(e){a||u(e)}),[])]}},2876:function(e,t,r){"use strict";var n=r(2791),i="undefined"!==typeof window?n.useLayoutEffect:n.useEffect;t.Z=i},7054:function(e,t,r){"use strict";var n=r(2791),i=r(2876);t.Z=function(e){var t=n.useRef(e);return(0,i.Z)((function(){t.current=e})),n.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},6117:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(2791),i=r(2971);function a(){for(var e=arguments.length,t=new Array(e),r=0;r=t?e:""+Array(t+1-n.length).join(r)+e},y={s:g,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),i=r%60;return(t<=0?"+":"-")+g(n,2,"0")+":"+g(i,2,"0")},m:function e(t,r){if(t.date()1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!n&&i&&(x=i),i||!n&&x},T=function(e,t){if(w(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new S(r)},M=y;M.l=k,M.i=w,M.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function m(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[_]=!0}var g=m.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(M.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return M},g.isValid=function(){return!(this.$d.toString()===p)},g.isSame=function(e,t){var r=T(e);return this.startOf(t)<=r&&r<=this.endOf(t)},g.isAfter=function(e,t){return T(e)68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),r=60*t[1]+(+t[2]||0);return 0===r?0:"+"===t[0]?-r:r}(e)}],u=function(e){var t=a[e];return t&&(t.indexOf?t:t.s.concat(t.f))},c=function(e,t){var r,n=a.meridiem;if(n){for(var i=1;i<=24;i+=1)if(e.indexOf(n(i,0,t))>-1){r=i>12;break}}else r=e===(t?"pm":"PM");return r},f={A:[i,function(e){this.afternoon=c(e,!1)}],a:[i,function(e){this.afternoon=c(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[n,s("seconds")],ss:[n,s("seconds")],m:[n,s("minutes")],mm:[n,s("minutes")],H:[n,s("hours")],h:[n,s("hours")],HH:[n,s("hours")],hh:[n,s("hours")],D:[n,s("day")],DD:[r,s("day")],Do:[i,function(e){var t=a.ordinal,r=e.match(/\d+/);if(this.day=r[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],M:[n,s("month")],MM:[r,s("month")],MMM:[i,function(e){var t=u("months"),r=(u("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(r<1)throw new Error;this.month=r%12||r}],MMMM:[i,function(e){var t=u("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[r,function(e){this.year=o(e)}],YYYY:[/\d{4}/,s("year")],Z:l,ZZ:l};function d(r){var n,i;n=r,i=a&&a.formats;for(var o=(r=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,n){var a=n&&n.toUpperCase();return r||i[n]||e[n]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,r){return t||r.slice(1)}))}))).match(t),s=o.length,l=0;l-1)return new Date(("X"===t?1e3:1)*e);var n=d(t)(e),i=n.year,a=n.month,o=n.day,s=n.hours,l=n.minutes,u=n.seconds,c=n.milliseconds,f=n.zone,p=new Date,h=o||(i||a?1:p.getDate()),v=i||p.getFullYear(),m=0;i&&!a||(m=a>0?a-1:p.getMonth());var g=s||0,y=l||0,x=u||0,b=c||0;return f?new Date(Date.UTC(v,m,h,g,y,x,b+60*f.offset*1e3)):r?new Date(Date.UTC(v,m,h,g,y,x,b)):new Date(v,m,h,g,y,x,b)}catch(e){return new Date("")}}(t,s,n),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),c&&t!=this.format(s)&&(this.$d=new Date("")),a={}}else if(s instanceof Array)for(var p=s.length,h=1;h<=p;h+=1){o[1]=s[h-1];var v=r.apply(this,o);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}h===p&&(this.$d=new Date(""))}else i.call(this,e)}}}()},6818:function(e){e.exports=function(){"use strict";return function(e,t,r){t.prototype.isBetween=function(e,t,n,i){var a=r(e),o=r(t),s="("===(i=i||"()")[0],l=")"===i[1];return(s?this.isAfter(a,n):!this.isBefore(a,n))&&(l?this.isBefore(o,n):!this.isAfter(o,n))||(s?this.isBefore(a,n):!this.isAfter(a,n))&&(l?this.isAfter(o,n):!this.isBefore(o,n))}}}()},9893:function(e){e.exports=function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,r,n){var i=r.prototype,a=i.format;n.en.formats=e,i.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var r=this.$locale().formats,n=function(t,r){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,i){var a=i&&i.toUpperCase();return n||r[i]||e[i]||r[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,r){return t||r.slice(1)}))}))}(t,void 0===r?{}:r);return a.call(this,n)}}}()},9216:function(e){e.exports=function(){"use strict";var e="week",t="year";return function(r,n,i){var a=n.prototype;a.week=function(r){if(void 0===r&&(r=null),null!==r)return this.add(7*(r-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var a=i(this).startOf(t).add(1,t).date(n),o=i(this).endOf(e);if(a.isBefore(o))return 1}var s=i(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),l=this.diff(s,e,!0);return l<0?i(this).startOf("week").week():Math.ceil(l)},a.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}}()},2110:function(e,t,r){"use strict";var n=r(8309),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return n.isMemo(e)?o:s[e.$$typeof]||i}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=o;var u=Object.defineProperty,c=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,r,n){if("string"!==typeof r){if(h){var i=p(r);i&&i!==h&&e(t,i,n)}var o=c(r);f&&(o=o.concat(f(r)));for(var s=l(t),v=l(r),m=0;m:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var a in i){var o=a.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,i[a])}},98222:function(e,t,r){"use strict";e.exports=r(82887)},27206:function(e,t,r){"use strict";e.exports=r(60822)},59893:function(e,t,r){"use strict";e.exports=r(23381)},5224:function(e,t,r){"use strict";e.exports=r(83832)},59509:function(e,t,r){"use strict";e.exports=r(72201)},75557:function(e,t,r){"use strict";e.exports=r(91815)},40338:function(e,t,r){"use strict";e.exports=r(21462)},35080:function(e,t,r){"use strict";e.exports=r(51319)},61396:function(e,t,r){"use strict";e.exports=r(57516)},40549:function(e,t,r){"use strict";e.exports=r(98128)},49866:function(e,t,r){"use strict";e.exports=r(99442)},36089:function(e,t,r){"use strict";e.exports=r(93740)},19548:function(e,t,r){"use strict";e.exports=r(8729)},35831:function(e,t,r){"use strict";e.exports=r(93814)},61039:function(e,t,r){"use strict";e.exports=r(14382)},97040:function(e,t,r){"use strict";e.exports=r(51759)},77986:function(e,t,r){"use strict";e.exports=r(10421)},24296:function(e,t,r){"use strict";e.exports=r(43102)},58872:function(e,t,r){"use strict";e.exports=r(92165)},29626:function(e,t,r){"use strict";e.exports=r(3325)},65591:function(e,t,r){"use strict";e.exports=r(36071)},69738:function(e,t,r){"use strict";e.exports=r(43905)},92650:function(e,t,r){"use strict";e.exports=r(35902)},35630:function(e,t,r){"use strict";e.exports=r(69816)},73434:function(e,t,r){"use strict";e.exports=r(94507)},27909:function(e,t,r){"use strict";var n=r(19548);n.register([r(27206),r(5224),r(58872),r(65591),r(69738),r(92650),r(49866),r(25743),r(6197),r(97040),r(85461),r(73434),r(54201),r(81299),r(47645),r(35630),r(77986),r(83043),r(93005),r(96881),r(4534),r(50581),r(40549),r(77900),r(47582),r(35080),r(21641),r(17280),r(5861),r(29626),r(10021),r(65317),r(96268),r(61396),r(35831),r(16122),r(46163),r(40344),r(40338),r(48131),r(36089),r(55334),r(75557),r(19440),r(99488),r(59893),r(97393),r(98222),r(61039),r(24296),r(66398),r(59509)]),e.exports=n},46163:function(e,t,r){"use strict";e.exports=r(15154)},96881:function(e,t,r){"use strict";e.exports=r(64943)},50581:function(e,t,r){"use strict";e.exports=r(21164)},55334:function(e,t,r){"use strict";e.exports=r(54186)},65317:function(e,t,r){"use strict";e.exports=r(94873)},10021:function(e,t,r){"use strict";e.exports=r(67618)},54201:function(e,t,r){"use strict";e.exports=r(58810)},5861:function(e,t,r){"use strict";e.exports=r(20593)},16122:function(e,t,r){"use strict";e.exports=r(29396)},83043:function(e,t,r){"use strict";e.exports=r(13551)},48131:function(e,t,r){"use strict";e.exports=r(46858)},47582:function(e,t,r){"use strict";e.exports=r(17988)},21641:function(e,t,r){"use strict";e.exports=r(68868)},96268:function(e,t,r){"use strict";e.exports=r(20467)},19440:function(e,t,r){"use strict";e.exports=r(91271)},99488:function(e,t,r){"use strict";e.exports=r(21461)},97393:function(e,t,r){"use strict";e.exports=r(85956)},25743:function(e,t,r){"use strict";e.exports=r(52979)},66398:function(e,t,r){"use strict";e.exports=r(32275)},17280:function(e,t,r){"use strict";e.exports=r(6419)},77900:function(e,t,r){"use strict";e.exports=r(61510)},81299:function(e,t,r){"use strict";e.exports=r(87619)},93005:function(e,t,r){"use strict";e.exports=r(93601)},40344:function(e,t,r){"use strict";e.exports=r(96595)},47645:function(e,t,r){"use strict";e.exports=r(70954)},6197:function(e,t,r){"use strict";e.exports=r(47462)},4534:function(e,t,r){"use strict";e.exports=r(17659)},85461:function(e,t,r){"use strict";e.exports=r(19990)},82884:function(e){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},50215:function(e,t,r){"use strict";var n=r(82884),i=r(41940),a=r(85555),o=r(44467).templatedArray;r(24695),e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},3749:function(e,t,r){"use strict";var n=r(71828),i=r(89298),a=r(92605).draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=i.getFromId(e,t.xref),n=i.getFromId(e,t.yref),a=i.getRefType(t.xref),o=i.getRefType(t.yref);t._extremes={},"range"===a&&s(t,r),"range"===o&&s(t,n)}))}function s(e,t){var r,n=t._id,a=n.charAt(0),o=e[a],s=e["a"+a],l=e[a+"ref"],u=e["a"+a+"ref"],c=e["_"+a+"padplus"],f=e["_"+a+"padminus"],d={x:1,y:-1}[a]*e[a+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,v=p-d,m=3*e.startarrowsize*e.arrowwidth||0,g=m+d,y=m-d;if(u===l){var x=i.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:v}),b=i.findExtremes(t,[t.r2c(s)],{ppadplus:Math.max(c,g),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else g=s?g+s:g,y=s?y-s:y,r=i.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(c,h,g),ppadminus:Math.max(f,v,y)});e._extremes[n]=r}e.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([a,o],e)}},44317:function(e,t,r){"use strict";var n=r(71828),i=r(73972),a=r(44467).arrayEditor;function o(e,t){var r,n,i,a,o,l,u,c=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,s,l=o(e,t),u=l.on,c=l.off.concat(l.explicitOff),f={},d=e._fullLayout.annotations;if(u.length||c.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var q=!1,Y=["x","y"],X=0;X1)&&(ne===re?((pe=ie.r2fraction(t["a"+te]))<0||pe>1)&&(q=!0):q=!0),K=ie._offset+ie.r2p(t[te]),Q=.5}else{var he="domain"===de;"x"===te?(J=t[te],K=he?ie._offset+ie._length*J:K=k.l+k.w*J):(J=1-t[te],K=he?ie._offset+ie._length*J:K=k.t+k.h*J),Q=t.showarrow?.5:J}if(t.showarrow){fe.head=K;var ve=t["a"+te];if(ee=oe*H(.5,t.xanchor)-se*H(.5,t.yanchor),ne===re){var me=l.getRefType(ne);"domain"===me?("y"===te&&(ve=1-ve),fe.tail=ie._offset+ie._length*ve):"paper"===me?"y"===te?(ve=1-ve,fe.tail=k.t+k.h*ve):fe.tail=k.l+k.w*ve:fe.tail=ie._offset+ie.r2p(ve),$=ee}else fe.tail=K+ve,$=ee+ve;fe.text=fe.tail+ee;var ge=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,ge-1)),"pixel"===ne){var ye=-Math.max(fe.tail-3,fe.text),xe=Math.min(fe.tail+3,fe.text)-ge;ye>0?(fe.tail+=ye,fe.text+=ye):xe>0&&(fe.tail-=xe,fe.text-=xe)}fe.tail+=ce,fe.head+=ce}else $=ee=le*H(Q,ue),fe.text=K+ee;fe.text+=ce,ee+=ce,$+=ce,t["_"+te+"padplus"]=le/2+$,t["_"+te+"padminus"]=le/2-$,t["_"+te+"size"]=le,t["_"+te+"shift"]=ee}if(q)z.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(M-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(D-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:N+be-1,y:N+_e}).call(c.setClipUrl,B?E:null,e);else{var we=N+_e-v.top,ke=N+be-v.left;W.call(d.positionText,ke,we).call(c.setClipUrl,B?E:null,e)}V.select("rect").call(c.setRect,N,N,M,D),Z.call(c.setRect,F/2,F/2,j-F,U-F),z.call(c.setTranslate,Math.round(P.x.text-j/2),Math.round(P.y.text-U/2)),R.attr({transform:"rotate("+L+","+P.x.text+","+P.y.text+")"});var Te,Me=function(r,n){I.selectAll(".annotation-arrow-g").remove();var l=P.x.head,f=P.y.head,d=P.x.tail+r,p=P.y.tail+n,v=P.x.text+r,b=P.y.text+n,_=o.rotationXYMatrix(L,v,b),w=o.apply2DTransform(_),M=o.apply2DTransform2(_),E=+Z.attr("width"),O=+Z.attr("height"),D=v-.5*E,F=D+E,j=b-.5*O,N=j+O,B=[[D,j,D,N],[D,N,F,N],[F,N,F,j],[F,j,D,j]].map(M);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(d,p,l,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var V=t.arrowwidth,U=t.arrowcolor,H=t.arrowside,W=I.append("g").style({opacity:u.opacity(U)}).classed("annotation-arrow-g",!0),G=W.append("path").attr("d","M"+d+","+p+"L"+l+","+f).style("stroke-width",V+"px").call(u.stroke,u.rgb(U));if(m(G,H,t),T.annotationPosition&&G.node().parentNode&&!a){var q=l,Y=f;if(t.standoff){var X=Math.sqrt(Math.pow(l-d,2)+Math.pow(f-p,2));q+=t.standoff*(d-l)/X,Y+=t.standoff*(p-f)/X}var K,$,J=W.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-q)+","+(p-Y),transform:s(q,Y)}).style("stroke-width",V+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");h.init({element:J.node(),gd:e,prepFn:function(){var e=c.getTranslate(z);K=e.x,$=e.y,g&&g.autorange&&S(g._name+".autorange",!0),x&&x.autorange&&S(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(K,$),i=n[0]+e,a=n[1]+r;z.call(c.setTranslate,i,a),A("x",y(g,e,"x",k,t)),A("y",y(x,r,"y",k,t)),t.axref===t.xref&&A("ax",y(g,e,"ax",k,t)),t.ayref===t.yref&&A("ay",y(x,r,"ay",k,t)),W.attr("transform",s(e,r)),R.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",e,C());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};t.showarrow&&Me(0,0),O&&h.init({element:z.node(),gd:e,prepFn:function(){Te=R.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?A("ax",y(g,e,"ax",k,t)):A("ax",t.ax+e),t.ayref===t.yref?A("ay",y(x,r,"ay",k.w,t)):A("ay",t.ay+r),Me(e,r);else{if(a)return;var i,o;if(g)i=y(g,e,"x",k,t);else{var l=t._xsize/k.w,u=t.x+(t._xshift-t.xshift)/k.w-l/2;i=h.align(u+e/k.w,l,0,1,t.xanchor)}if(x)o=y(x,r,"y",k,t);else{var c=t._ysize/k.h,f=t.y-(t._yshift+t.yshift)/k.h-c/2;o=h.align(f-r/k.h,c,0,1,t.yanchor)}A("x",i),A("y",o),g&&x||(n=h.getCursor(g?.5:i,x?.5:o,t.xanchor,t.yanchor))}R.attr({transform:s(e,r)+Te}),p(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",G(n))},doneFn:function(){p(z),i.call("_guiRelayout",e,C());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}e.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*m+r.standoff,_=v.backoff*g+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},c={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-c.x,k=o.y-c.y;if(d=(f=Math.atan2(k,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+k*k))return void O();if(b){if(b*b>w*w+k*k)return void O();var T=b*Math.cos(f),M=b*Math.sin(f);c.x+=T,c.y+=M,e.attr({x2:c.x,y2:c.y})}if(_){if(_*_>w*w+k*k)return void O();var S=_*Math.cos(f),A=_*Math.sin(f);o.x-=S,o.y-=A,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var C=p.getTotalLength(),E="";if(C1){u=!0;break}}u?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+s+'"]').remove():(l._pdata=i(e.glplot.cameraParams,[t.xaxis.r2l(l.x)*r[0],t.yaxis.r2l(l.y)*r[1],t.zaxis.r2l(l.z)*r[2]]),n(e.graphDiv,l,s,e.id,l._xa,l._ya))}}},2468:function(e,t,r){"use strict";var n=r(73972),i=r(71828);e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:r(26997)}}},layoutAttributes:r(26997),handleDefaults:r(20226),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(r)for(var a=r.attrRegex,o=Object.keys(e),s=0;s=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var i=n(t||u).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(e,t,r){var i=n(e);return 1!==i.getAlpha()&&(i=n(o.combine(e,u))),(i.isDark()?t?i.lighten(t):u:r?i.darken(r):l).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"===typeof e){var t,r,n,i,s=Object.keys(e);for(t=0;t0?n>=l:n<=l));i++)n>c&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var pe=Math.pow(10,Math.floor(Math.log(de)/Math.LN10));ce*=pe*u.roundUp(de/pe,[2,5,10]),(Math.abs(G.start)/G.size+1e-6)%1<2e-6&&(le.tick0=0)}le.dtick=ce}le.domain=o?[oe+I/j.h,oe+Q-I/j.h]:[oe+L/j.w,oe+Q-L/j.w],le.setScale(),e.attr("transform",c(Math.round(j.l),Math.round(j.t)));var he,ve=e.select("."+M.cbtitleunshift).attr("transform",c(-Math.round(j.l),-Math.round(j.t))),me=le.ticklabelposition,ge=le.title.font.size,ye=e.select("."+M.cbaxis),xe=0,be=0;function _e(n,i){var a={propContainer:le,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:F._dfltTitle.colorbar,containerGroup:e.select("."+M.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+o+",."+o+"-math-group").remove(),v.draw(r,n,f(a,i||{}))}function we(){var e,t;(o&&ue||!o&&!ue)&&("top"===V&&(e=L+j.l+ee*R,t=I+j.t+te*(1-oe-Q)+3+.75*ge),"bottom"===V&&(e=L+j.l+ee*R,t=I+j.t+te*(1-oe)-3-.25*ge),"right"===V&&(t=I+j.t+te*O+3+.75*ge,e=L+j.l+ee*oe),_e(le._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}}))}function ke(){if(o&&!ue||!o&&ue){var e,i,a=le.position||0,s=le._offset+le._length/2;if("right"===V)i=s,e=j.l+ee*a+10+ge*(le.showticklabels?1:.5);else if(e=s,"bottom"===V&&(i=j.t+te*a+10+(-1===me.indexOf("inside")?le.tickfont.size:0)+("intside"!==le.ticks&&t.ticklen||0)),"top"===V){var l=B.text.split("
").length;i=j.t+te*a+10-K-w*ge*l}_e((o?"h":"v")+le._id+"title",{avoid:{selection:n.select(r).selectAll("g."+le._id+"tick"),side:V,offsetTop:o?0:j.t,offsetLeft:o?j.l:0,maxShift:o?F.width:F.height},attributes:{x:e,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}}function Te(){if(!o&&!ue||o&&ue){var a,l=e.select("."+M.cbtitle),f=l.select("text"),d=[-S/2,S/2],h=l.select(".h"+le._id+"title-math-group").node(),v=15.6;if(f.node()&&(v=parseInt(f.node().style.fontSize,10)*w),h?(a=p.bBox(h),be=a.width,(xe=a.height)>v&&(d[1]-=(xe-v)/2)):f.node()&&!f.classed(M.jsPlaceholder)&&(a=p.bBox(f.node()),be=a.width,xe=a.height),o){if(xe){if(xe+=5,"top"===V)le.domain[1]-=xe/j.h,d[1]*=-1;else{le.domain[0]+=xe/j.h;var g=m.lineCount(f);d[1]+=(1-g)*v}l.attr("transform",c(d[0],d[1])),le.setScale()}}else be&&("right"===V&&(le.domain[0]+=(be+ge/2)/j.w),l.attr("transform",c(d[0],d[1])),le.setScale())}e.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",o?c(0,Math.round(j.h*(1-le.domain[1]))):c(Math.round(j.w*le.domain[0]),0)),ye.attr("transform",o?c(0,Math.round(-j.t)):c(Math.round(-j.l),0));var y=e.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(Y);y.enter().append("rect").classed(M.cbfill,!0).attr("style",""),y.exit().remove();var x=U.map(le.c2p).map(Math.round).sort((function(e,t){return e-t}));y.each((function(e,a){var s=[0===a?U[0]:(Y[a]+Y[a-1])/2,a===Y.length-1?U[1]:(Y[a]+Y[a+1])/2].map(le.c2p).map(Math.round);o&&(s[1]=u.constrain(s[1]+(s[1]>s[0])?1:-1,x[0],x[1]));var l=n.select(this).attr(o?"x":"y",re).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(K,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(t._fillgradient)p.gradient(l,r,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var c=W(e).replace("e-","");l.attr("fill",i(c).toHexString())}}));var b=e.select("."+M.cblines).selectAll("path."+M.cbline).data(Z.color&&Z.width?X:[]);b.enter().append("path").classed(M.cbline,!0),b.exit().remove(),b.each((function(e){var t=re,r=Math.round(le.c2p(e))+Z.width/2%1;n.select(this).attr("d","M"+(o?t+","+r:r+","+t)+(o?"h":"v")+K).call(p.lineGroupStyle,Z.width,H(e),Z.dash)})),ye.selectAll("g."+le._id+"tick,path").remove();var _=re+K+(S||0)/2-("outside"===t.ticks?1:0),k=s.calcTicks(le),T=s.getTickSigns(le)[2];return s.drawTicks(r,le,{vals:"inside"===le.ticks?s.clipEnds(le,k):k,layer:ye,path:s.makeTickPath(le,_,T),transFn:s.makeTransTickFn(le)}),s.drawLabels(r,le,{vals:k,layer:ye,transFn:s.makeTransTickLabelFn(le),labelFns:s.makeLabelFns(le,_)})}function Me(){var n,s=K+S/2;-1===me.indexOf("inside")&&(n=p.bBox(ye.node()),s+=o?n.width:n.height),he=ve.select("text");var u=0,f=o&&"top"===V,v=!o&&"right"===V,m=0;if(he.node()&&!he.classed(M.jsPlaceholder)){var y,x=ve.select(".h"+le._id+"title-math-group").node();x&&(o&&ue||!o&&!ue)?(u=(n=p.bBox(x)).width,y=n.height):(u=(n=p.bBox(ve.node())).right-j.l-(o?re:se),y=n.bottom-j.t-(o?se:re),o||"top"!==V||(s+=n.height,m=n.height)),v&&(he.attr("transform",c(u/2+ge/2,0)),u*=2),s=Math.max(s,o?u:y)}var b=2*(o?L:I)+s+A+S/2,w=0;!o&&B.text&&"bottom"===P&&O<=0&&(b+=w=b/2,m+=w),F._hColorbarMoveTitle=w,F._hColorbarMoveCBTitle=m;var N=A+S,Z=(o?re:se)-N/2-(o?L:0),U=(o?se:re)-(o?J:I+m-w);e.select("."+M.cbbg).attr("x",Z).attr("y",U).attr(o?"width":"height",Math.max(b-w,2)).attr(o?"height":"width",Math.max(J+N,2)).call(h.fill,C).call(h.stroke,t.bordercolor).style("stroke-width",A);var H=v?Math.max(u-10,0):0;e.selectAll("."+M.cboutline).attr("x",(o?re:se+L)+H).attr("y",(o?se+I-J:re)+(f?xe:0)).attr(o?"width":"height",Math.max(K,2)).attr(o?"height":"width",Math.max(J-(o?2*I+xe:2*L+H),2)).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":S});var W=o?ne*b:0,G=o?0:(1-ie)*b-m;if(W=z?j.l-W:-W,G=D?j.t-G:-G,e.attr("transform",c(W,G)),!o&&(A||i(C).getAlpha()&&!i.equals(F.paper_bgcolor,C))){var q=ye.selectAll("text"),Y=q[0].length,X=e.select("."+M.cbbg).node(),$=p.bBox(X),Q=p.getTranslate(e),ee=2;q.each((function(e,t){var r=0,n=Y-1;if(t===r||t===n){var i,a=p.bBox(this),o=p.getTranslate(this);if(t===n){var s=a.right+o.x;(i=$.right+Q.x+se-A-ee+R-s)>0&&(i=0)}else if(t===r){var l=a.left+o.x;(i=$.left+Q.x+se+A+ee-l)<0&&(i=0)}i&&(Y<3?this.setAttribute("transform","translate("+i+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var te={},ae=k[E],oe=T[E],ce=k[P],fe=T[P],de=b-K;o?("pixels"===d?(te.y=O,te.t=J*ce,te.b=J*fe):(te.t=te.b=0,te.yt=O+l*ce,te.yb=O-l*fe),"pixels"===_?(te.x=R,te.l=b*ae,te.r=b*oe):(te.l=de*ae,te.r=de*oe,te.xl=R-g*ae,te.xr=R+g*oe)):("pixels"===d?(te.x=R,te.l=J*ae,te.r=J*oe):(te.l=te.r=0,te.xl=R+l*ae,te.xr=R-l*oe),"pixels"===_?(te.y=1-O,te.t=b*ce,te.b=b*fe):(te.t=de*ce,te.b=de*fe,te.yt=O-g*ce,te.yb=O+g*fe));var pe=t.y<.5?"b":"t",be=t.x<.5?"l":"r";r._fullLayout._reservedMargin[t._id]={};var _e={r:F.width-Z-W,l:Z+te.r,b:F.height-U-G,t:U+te.b};z&&D?a.autoMargin(r,t._id,te):z?r._fullLayout._reservedMargin[t._id][pe]=_e[pe]:D||o?r._fullLayout._reservedMargin[t._id][be]=_e[be]:r._fullLayout._reservedMargin[t._id][pe]=_e[pe]}return u.syncOrAsync([a.previousPromises,we,Te,ke,a.previousPromises,Me],r)}(r,t,e);g&&g.then&&(e._promises||[]).push(g),e._context.edits.colorbarPosition&&function(e,t,r){var n,i,a,s="v"===t.orientation,u=r._fullLayout,f=u._size;l.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),d(e)},moveFn:function(r,o){e.attr("transform",n+c(r,o)),i=l.align((s?t._uFrac:t._vFrac)+r/f.w,s?t._thickFrac:t._lenFrac,0,1,t.xanchor),a=l.align((s?t._vFrac:1-t._uFrac)-o/f.h,s?t._lenFrac:t._thickFrac,0,1,t.yanchor);var u=l.getCursor(i,a,t.xanchor,t.yanchor);d(e,u)},doneFn:function(){if(d(e),void 0!==i&&void 0!==a){var n={};n[t._propPrefix+"x"]=i,n[t._propPrefix+"y"]=a,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){a.autoMargin(e,t._id)})).remove(),t.order()}}},76228:function(e,t,r){"use strict";var n=r(71828);e.exports=function(e){return n.isPlainObject(e.colorbar)}},12311:function(e,t,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:r(63583),supplyDefaults:r(62499),draw:r(98981).draw,hasColorbar:r(76228)}},50693:function(e,t,r){"use strict";var n=r(63583),i=r(30587).counter,a=r(78607),o=r(63282).scales;function s(e){return"`"+e+"`"}a(o),e.exports=function(e,t){e=e||"";var r,a=(t=t||{}).cLetter||"c",l=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),u="showScaleDflt"in t?t.showScaleDflt:"z"===a,c="string"===typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):s(d+(r={z:"z",c:"color"}[a]));var p=a+"auto",h=a+"min",v=a+"max",m=a+"mid",g=(s(d+p),s(d+h),s(d+v),{});g[h]=g[v]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},x.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:u,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),x}},78803:function(e,t,r){"use strict";var n=r(92770),i=r(71828),a=r(52075).extractOpts;e.exports=function(e,t,r){var o,s=e._fullLayout,l=r.vals,u=r.containerStr,c=u?i.nestedProperty(t,u).get():t,f=a(c),d=!1!==f.auto,p=f.min,h=f.max,v=f.mid,m=function(){return i.aggNums(Math.min,null,l)},g=function(){return i.aggNums(Math.max,null,l)};void 0===p?p=m():d&&(p=c._colorAx&&n(p)?Math.min(p,m()):m()),void 0===h?h=g():d&&(h=c._colorAx&&n(h)?Math.max(h,g()):g()),d&&void 0!==v&&(h-v>v-p?p=v-(h-v):h-v=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},33046:function(e,t,r){"use strict";var n=r(71828),i=r(52075).hasColorscale,a=r(52075).extractOpts;e.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,i){var o=i.container?n.nestedProperty(e,i.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=e[n];r[i]=[1-a[0],a[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},70461:function(e,t,r){"use strict";var n=r(71828),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(e,t,r,a){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*t),0,2),i[t][e]}},64505:function(e,t){"use strict";t.selectMode=function(e){return"lasso"===e||"select"===e},t.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},t.openMode=function(e){return"drawline"===e||"drawopenpath"===e},t.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},t.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},t.selectingOrDrawing=function(e){return t.freeMode(e)||t.rectMode(e)}},28569:function(e,t,r){"use strict";var n=r(48956),i=r(57035),a=r(38520),o=r(71828).removeElement,s=r(85555),l=e.exports={};l.align=r(92807),l.getCursor=r(70461);var u=r(26041);function c(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(e){var t,r,n,u,d,p,h,v,m=e.gd,g=1,y=m._context.doubleClickDelay,x=e.element;m._mouseDownTime||(m._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,a?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(g=Math.max(g-1,1)),m._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(g,p),!v){var r;try{r=new MouseEvent("click",t)}catch(a){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}m._dragging=!1,m._dragged=!1}else m._dragged=!1}},l.coverSlip=c},26041:function(e,t,r){"use strict";var n=r(11086),i=r(79990),a=r(24401).getGraphDiv,o=r(26675),s=e.exports={};s.wrapped=function(e,t,r){(e=a(e))._fullLayout&&i.clear(e._fullLayout._uid+o.HOVERID),s.raw(e,t,r)},s.raw=function(e,t){var r=e._fullLayout,i=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&i&&e.emit("plotly_unhover",{event:t,points:i}))}},79952:function(e,t){"use strict";t.P={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},t.u={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},91424:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=i.numberFormat,o=r(92770),s=r(84267),l=r(73972),u=r(7901),c=r(21081),f=i.strTranslate,d=r(63893),p=r(77922),h=r(18783).LINE_SPACING,v=r(37822).DESELECTDIM,m=r(34098),g=r(39984),y=r(23469).appendArrayPointValue,x=e.exports={};function b(e,t,r){var n=t.fillpattern,i=n&&x.getPatternAttr(n.shape,0,"");if(i){var a=x.getPatternAttr(n.bgcolor,0,null),o=x.getPatternAttr(n.fgcolor,0,null),s=n.fgopacity,l=x.getPatternAttr(n.size,0,8),c=x.getPatternAttr(n.solidity,0,.3),f=t.uid;x.pattern(e,"point",r,f,i,l,c,void 0,n.fillmode,a,o,s)}else t.fillcolor&&e.call(u.fill,t.fillcolor)}x.font=function(e,t,r,n){i.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(u.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,i){e.call(x.setPosition,t,r).call(x.setSize,n,i)},x.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),a=n.c2p(e.y);return!!(o(i)&&o(a)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",a):t.attr("transform",f(i,a)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var i=n.select(this);x.translatePoint(e,i,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,i,a){t.attr("display",r.isPtWithinRange(e,i)&&n.isPtWithinRange(e,a)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,i=t.yaxis;e.each((function(t){var a=t[0].trace,o=a.xcalendar,s=a.ycalendar,u=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";e.selectAll(u).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,i,o,s)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,i){t.style("fill","none");var a=(((e||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";u.stroke(t,n||a.color),x.dashLine(t,s,o)},x.lineGroupStyle=function(e,t,r,i){e.style("fill","none").each((function(e){var a=(((e||[])[0]||{}).trace||{}).line||{},o=t||a.width||0,s=i||a.dash||"";n.select(this).call(u.stroke,r||a.color).call(x.dashLine,s,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e,t){var r=n.select(e.node());b(e,((r.data()[0]||[])[0]||{}).trace||{},t)},x.fillGroupStyle=function(e,t){e.style("stroke-width",0).each((function(e){var r=n.select(this);e[0].trace&&b(r,e[0].trace,t)}))};var _=r(90998);x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(_).forEach((function(e){var t=_[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,x.symbolBackOffs[r]=t.backoff||0,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var w=x.symbolNames.length;function k(e,t,r,n){var i=e%100;return x.symbolFuncs[i](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"===typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=w||e>=400?0:Math.floor(Math.max(e,0))};var T={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0},S=a("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:M},verticalreversed:{node:"linearGradient",attrs:M,reversed:!0}};x.gradient=function(e,t,r,a,o,l){for(var c=o.length,f=A[a],d=new Array(c),p=0;p=0&&void 0===e.i&&(e.i=o.i),t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?s.opacity:e.mo),n.ms2mrc){var c;c="various"===e.ms||"various"===s.size?3:n.ms2mrc(e.ms),e.mrc=c,n.selectedSizeFn&&(c=e.mrc=n.selectedSizeFn(e));var f=x.symbolNumber(e.mx||s.symbol)||0;e.om=f%200>=100;var d=re(e,r),p=W(e,r);t.attr("d",k(f,c,d,p))}var h,v,m,g=!1;if(e.so)m=l.outlierwidth,v=l.outliercolor,h=s.outliercolor;else{var y=(l||{}).width;m=(e.mlw+1||y+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,v="mlc"in e?e.mlcc=n.lineScale(e.mlc):i.isArrayOrTypedArray(l.color)?u.defaultLine:l.color,i.isArrayOrTypedArray(s.color)&&(h=u.defaultLine,g=!0),h="mc"in e?e.mcc=n.markerScale(e.mc):s.color||s.colors||"rgba(0,0,0,0)",n.selectedColorFn&&(h=n.selectedColorFn(e))}if(e.om)t.call(u.stroke,h).style({"stroke-width":(m||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:m)+"px");var b=s.gradient,_=e.mgt;_?g=!0:_=b&&b.type,i.isArrayOrTypedArray(_)&&(_=_[0],A[_]||(_=0));var w=s.pattern,T=w&&x.getPatternAttr(w.shape,e.i,"");if(_&&"none"!==_){var M=e.mgc;M?g=!0:M=b.color;var S=r.uid;g&&(S+="-"+e.i),x.gradient(t,a,S,_,[[0,M],[1,h]],"fill")}else if(T){var C=!1,E=w.fgcolor;!E&&o&&o.color&&(E=o.color,C=!0);var P=x.getPatternAttr(E,e.i,o&&o.color||null),L=x.getPatternAttr(w.bgcolor,e.i,null),I=w.fgopacity,R=x.getPatternAttr(w.size,e.i,8),O=x.getPatternAttr(w.solidity,e.i,.3);C=C||e.mcc||i.isArrayOrTypedArray(w.shape)||i.isArrayOrTypedArray(w.bgcolor)||i.isArrayOrTypedArray(w.fgcolor)||i.isArrayOrTypedArray(w.size)||i.isArrayOrTypedArray(w.solidity);var D=r.uid;C&&(D+="-"+e.i),x.pattern(t,"point",a,D,T,R,O,e.mcc,w.fillmode,L,P,I)}else i.isArrayOrTypedArray(h)?u.fill(t,h[e.i]):u.fill(t,h);m&&u.stroke(t,v)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),l.traceIs(e,"symbols")&&(t.ms2mrc=m.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&i.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},o=r.marker||{},s=n.marker||{},u=a.opacity,c=o.opacity,f=s.opacity,d=void 0!==c,p=void 0!==f;(i.isArrayOrTypedArray(u)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?c:t:p?f:v*t});var h=a.color,m=o.color,g=s.color;(m||g)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?m||t:g||t});var y=a.size,x=o.size,b=s.size,_=void 0!==x,w=void 0!==b;return l.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,c=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?l||t:c||(l?t:u.addOpacity(t,v))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),i=t.marker||{},a=[];r.selectedOpacityFn&&a.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&a.push((function(e,t){u.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&a.push((function(e,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);e.attr("d",k(x.symbolNumber(a),o,re(n,t),W(n,t))),n.mrc2=o})),a.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}function R(e,t,r){return r&&(e=N(e)),t?D(e[1]):O(e[0])}function O(e){var t=n.round(e,2);return C=t,t}function D(e){var t=n.round(e,2);return E=t,t}function z(e,t,r,n){var i=e[0]-t[0],a=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],l=Math.pow(i*i+a*a,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*i-l*l*o)*n,f=(u*u*a-l*l*s)*n,d=3*u*(l+u),p=3*l*(l+u);return[[O(t[0]+(d&&c/d)),D(t[1]+(d&&f/d))],[O(t[0]-(p&&c/p)),D(t[1]-(p&&f/p))]]}x.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);a=o.selectedTextColorFn}var s=t.texttemplate,l=r._fullLayout;e.each((function(e){var o=n.select(this),u=s?i.extractOption(e,t,"txt","texttemplate"):i.extractOption(e,t,"tx","text");if(u||0===u){if(s){var c=t._module.formatLabels,f=c?c(e,t,l):{},p={};y(p,t,e.i);var h=t._meta||{};u=i.texttemplateString(u,f,l._d3locale,p,e,h)}var v=e.tp||t.textposition,m=I(e,t),g=a?a(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,m,g).text(u).call(d.convertToTspans,r).call(L,v,m,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var i=n.select(this),a=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=I(e,t);u.fill(i,a);var c=l.traceIs(t,"bar-like");L(i,o,s,e.mrc2||e.mrc,c)}))}},x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],i=[];for(r=1;r=u||w>=f&&w<=u)&&(k<=d&&k>=c||k>=d&&k<=c)&&(e=[w,k])}return e}x.steps=function(e){var t=F[e]||j;return function(e){for(var r="M"+O(e[0][0])+","+D(e[0][1]),n=e.length,i=1;i=1e4&&(x.savedBBoxes={},Z=0),r&&(x.savedBBoxes[r]=m),Z++,i.extendFlat({},m)},x.setClipUrl=function(e,t,r){e.attr("clip-path",V(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",a=e[n]("transform")||"";return t=t||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(t,r)).trim(),e[i]("transform",a),a},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",a=e[n]("transform")||"";return t=t||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+t+","+r+")").trim(),e[i]("transform",a),a};var U=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(U,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var H=/translate\([^)]*\)\s*$/;function W(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(H);e=1===t&&1===r?[]:[f(o,s),"scale("+t+","+r+")",f(-o,-s)],l&&e.push(l),i.attr("transform",e.join(""))}}))},x.getMarkerStandoff=W;var G,q,Y,X,K,$,J=Math.atan2,Q=Math.cos,ee=Math.sin;function te(e,t){var r=t[0],n=t[1];return[r*Q(e)-n*ee(e),r*ee(e)+n*Q(e)]}function re(e,t){var r,n,i=e.ma;void 0===i&&(i=t.marker.angle||0);var a=t.marker.angleref;if("previous"===a||"north"===a){if(t._geo){var s=t._geo.project(e.lonlat);r=s[0],n=s[1]}else{var l=t._xA,u=t._yA;if(!l||!u)return 90;r=l.c2p(e.x),n=u.c2p(e.y)}if(t._geo){var c,f=e.lonlat[0],d=e.lonlat[1],p=t._geo.project([f,d+1e-5]),h=t._geo.project([f+1e-5,d]),v=J(h[1]-n,h[0]-r),m=J(p[1]-n,p[0]-r);if("north"===a)c=i/180*Math.PI;else if("previous"===a){var g=f/180*Math.PI,y=d/180*Math.PI,x=G/180*Math.PI,b=q/180*Math.PI,_=x-g,w=Q(b)*ee(_),k=ee(b)*Q(y)-Q(b)*ee(y)*Q(_);c=-J(w,k)-Math.PI,G=f,q=d}var T=te(v,[Q(c),0]),M=te(m,[ee(c),0]);i=J(T[1]+M[1],T[0]+M[0])/Math.PI*180,"previous"!==a||$===t.uid&&e.i===K+1||(i=null)}if("previous"===a&&!t._geo)if($===t.uid&&e.i===K+1&&o(r)&&o(n)){var S=r-Y,A=n-X,C=t.line&&t.line.shape||"",E=C.slice(C.length-1);"h"===E&&(A=0),"v"===E&&(S=0),i+=J(A,S)/Math.PI*180+90}else i=null}return Y=r,X=n,K=e.i,$=t.uid,i}x.getMarkerAngle=re},90998:function(e,t,r){"use strict";var n,i,a,o,s=r(95616),l=r(39898).round,u="M0,0Z",c=Math.sqrt(2),f=Math.sqrt(3),d=Math.PI,p=Math.cos,h=Math.sin;function v(e){return null===e}function m(e,t,r){if((!e||e%360===0)&&!t)return r;if(a===e&&o===t&&n===r)return i;function l(e,r){var n=p(e),i=h(e),a=r[0],o=r[1]+(t||0);return[a*n-o*i,a*i+o*n]}a=e,o=t,n=r;for(var u=e/180*d,c=0,f=0,v=s(r),m="",g=0;g0,f=e._context.staticPlot;t.each((function(t){var d,p=t[0].trace,h=p.error_x||{},v=p.error_y||{};p.ids&&(d=function(e){return e.id});var m=o.hasMarkers(p)&&p.marker.maxdisplayed>0;v.visible||h.visible||(t=[]);var g=n.select(this).selectAll("g.errorbar").data(t,d);if(g.exit().remove(),t.length){h.visible||g.selectAll("path.xerror").remove(),v.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var y=g.enter().append("g").classed("errorbar",!0);c&&y.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(g,r.layerClipId,e),g.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};return void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0))),void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),i(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0))),n}(e,l,u);if(!m||e.vis){var a,o=t.select("path.yerror");if(v.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var d=v.width;a="M"+(r.x-d)+","+r.yh+"h"+2*d+"m-"+d+",0V"+r.ys,r.noYS||(a+="m-"+d+",0h"+2*d),o.size()?c&&(o=o.transition().duration(s.duration).ease(s.easing)):o=t.append("path").style("vector-effect",f?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var p=t.select("path.xerror");if(h.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var g=(h.copy_ystyle?v:h).width;a="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(a+="m0,-"+g+"v"+2*g),p.size()?c&&(p=p.transition().duration(s.duration).ease(s.easing)):p=t.append("path").style("vector-effect",f?"none":"non-scaling-stroke").classed("xerror",!0),p.attr("d",a)}else p.remove()}}))}}))}},62662:function(e,t,r){"use strict";var n=r(39898),i=r(7901);e.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},a=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},77914:function(e,t,r){"use strict";var n=r(41940),i=r(528).hoverlabel,a=r(1426).extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},30732:function(e,t,r){"use strict";var n=r(71828),i=r(73972);function a(e,t,r,i){i=i||n.identity,Array.isArray(e)&&(t[0][r]=i(e))}e.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var s=0;s=0&&r.index_[0]._length||le<0||le>w[0]._length)return h.unhoverRaw(e,t)}else se="xpx"in t?t.xpx:_[0]._length/2,le="ypx"in t?t.ypx:w[0]._length/2;if(t.pointerX=se+_[0]._offset,t.pointerY=le+w[0]._offset,H="xval"in t?g.flat(l,t.xval):g.p2c(_,se),W="yval"in t?g.flat(l,t.yval):g.p2c(w,le),!i(H[0])||!i(W[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var fe=1/0;function de(e,r){for(q=0;qre&&(ne.splice(0,re),fe=ne[0].distance),y&&0!==U&&0===ne.length){te.distance=U,te.index=!1;var f=X._module.hoverPoints(te,Q,ee,"closest",{hoverLayer:c._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=U}))),f&&f.length){var d,h=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];i(v.x0)&&i(v.y0)&&(d=he(v),(!ae.vLinePoint||ae.vLinePoint.spikeDistance>d.spikeDistance)&&(ae.vLinePoint=d))}var m=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(m.length){var x=m[0];i(x.x0)&&i(x.y0)&&(d=he(x),(!ae.hLinePoint||ae.hLinePoint.spikeDistance>d.spikeDistance)&&(ae.hLinePoint=d))}}}}}function pe(e,t,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(e.distance)Me-1;Se--)Pe(ne[Se]);ne=Ae,ye()}var Le=e._hoverdata,Ie=[],Re=B(e),Oe=V(e);for(G=0;G1||ne.length>1)||"closest"===R&&oe&&ne.length>1,qe=p.combine(c.plot_bgcolor||p.background,c.paper_bgcolor),Ye=I(ne,{gd:e,hovermode:R,rotateLabels:Ge,bgColor:qe,container:c._hoverlayer,outerContainer:c._paper.node(),commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance}),Xe=Ye.hoverLabels;if(g.isUnifiedHover(R)||(function(e,t,r,n){var i,a,o,s,l,u,c,f=t?"xa":"ya",d=t?"ya":"xa",p=0,h=1,v=e.size(),m=new Array(v),g=0,y=n.minX,x=n.maxX,b=n.minY,_=n.maxY,w=function(e){return e*r._invScaleX},T=function(e){return e*r._invScaleY};function M(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,o=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=o;i=!1}if(i){var n=0;for(s=0;st.pmax&&n++;for(s=e.length-1;s>=0&&!(n<=0);s--)(u=e[s]).pos>t.pmax-1&&(u.del=!0,n--);for(s=0;s=0;l--)e[l].dp-=o;for(s=e.length-1;s>=0&&!(n<=0);s--)(u=e[s]).pos+u.dp+u.size>t.pmax&&(u.del=!0,n--)}}}for(e.each((function(e){var n=e[f],i=e[d],a="x"===n._id.charAt(0),o=n.range;0===g&&o&&o[0]>o[1]!==a&&(h=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var u,c,p=O(e,t),v=e.anchor,M="end"===v?-1:1;if("middle"===v)c=(u=e.crossPos+(a?T(p.y-e.by/2):w(e.bx/2+e.tx2width/2)))+(a?T(e.by):w(e.bx));else if(a)c=(u=e.crossPos+T(S+p.y)-T(e.by/2-S))+T(e.by);else{var A=w(M*S+p.x),C=A+w(M*e.bx);u=e.crossPos+Math.min(A,C),c=e.crossPos+Math.max(A,C)}a?void 0!==b&&void 0!==_&&Math.min(c,_)-Math.max(u,b)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==y&&void 0!==x&&Math.min(c,x)-Math.max(u,y)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}m[g++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?k:1)/2,pmin:s,pmax:l}]})),m.sort((function(e,t){return e[0].posref-t[0].posref||h*(t[0].traceIndex-e[0].traceIndex)}));!i&&p<=v;){for(p++,i=!0,s=0;s.01&&E.pmin===P.pmin&&E.pmax===P.pmax){for(l=C.length-1;l>=0;l--)C[l].dp+=a;for(A.push.apply(A,C),m.splice(s+1,1),c=0,l=A.length-1;l>=0;l--)c+=A[l].dp;for(o=c/A.length,l=A.length-1;l>=0;l--)A[l].dp-=o;i=!1}else s++}m.forEach(M)}for(s=m.length-1;s>=0;s--){var L=m[s];for(l=L.length-1;l>=0;l--){var I=L[l],R=I.datum;R.offset=I.dp,R.del=I.del}}}(Xe,Ge,c,Ye.commonLabelBoundingBox),D(Xe,Ge,c._invScaleX,c._invScaleY)),s&&s.tagName){var Ke=m.getComponentMethod("annotations","hasClickToShow")(e,Ie);f(n.select(s),Ke?"pointer":"")}s&&!a&&function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=e._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(e,0,Le)&&(Le&&e.emit("plotly_unhover",{event:t,points:Le}),e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:_,yaxes:w,xvals:H,yvals:W}))}(e,t,r,a,s)}))},t.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var i=t.gd,a=B(i),o=V(i),s=I(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,s=e._y0||e.y0||e.y||0,l=e._y1||e.y1||e.y||0,u=e.eventData;if(u){var c=Math.min(r,n),f=Math.max(r,n),d=Math.min(s,l),h=Math.max(s,l),v=e.trace;if(m.traceIs(v,"gl3d")){var g=i._fullLayout[v.scene]._scene.container,y=g.offsetLeft,x=g.offsetTop;c+=y,f+=y,d+=x,h+=x}u.bbox={x0:c+o,x1:f+o,y0:d+a,y1:h+a},t.inOut_bbox&&t.inOut_bbox.push(u.bbox)}else u=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:u}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}).hoverLabels,l=0,u=0;return s.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function I(e,t){var r=t.gd,i=r._fullLayout,a=t.hovermode,u=t.rotateLabels,f=t.bgColor,h=t.container,v=t.outerContainer,w=t.commonLabelOpts||{};if(0===e.length)return[[]];var k=t.fontFamily||y.HOVERFONT,T=t.fontSize||y.HOVERFONTSIZE,M=e[0],C=M.xa,E=M.ya,L=a.charAt(0),I=L+"Label",O=M[I];if(void 0===O&&"multicategory"===C.type)for(var D=0;Di.width-b?(m=i.width-b,t.attr("d","M"+(b-S)+",0L"+b+","+x+S+"v"+x+(2*A+y.height)+"H-"+b+"V"+x+S+"H"+(b-2*S)+"Z")):t.attr("d","M0,0L"+S+","+x+S+"H"+b+"v"+x+(2*A+y.height)+"H-"+b+"V"+x+S+"H-"+S+"Z"),q.minX=m-b,q.maxX=m+b,"top"===C.side?(q.minY=g-(2*A+y.height),q.maxY=g-A):(q.minY=g+A,q.maxY=g+(2*A+y.height))}else{var _,P,L;"right"===E.side?(_="start",P=1,L="",m=C._offset+C._length):(_="end",P=-1,L="-",m=C._offset),g=E._offset+(M.y0+M.y1)/2,l.attr("text-anchor",_),t.attr("d","M0,0L"+L+S+","+S+"V"+(A+y.height/2)+"h"+L+(2*A+y.width)+"V-"+(A+y.height/2)+"H"+L+S+"V-"+S+"Z"),q.minY=g-(A+y.height/2),q.maxY=g+(A+y.height/2),"right"===E.side?(q.minX=m+S,q.maxX=m+S+(2*A+y.width)):(q.minX=m-S-(2*A+y.width),q.maxX=m-S);var I,R=y.height/2,D=F-y.top-R,z="clip"+i._uid+"commonlabel"+E._id;if(m=0?le:ue+de=0?ue:be+de=0?oe:se+pe=0?se:_e+pe=0,"top"!==e.idealAlign&&W||!G?W?(I+=z/2,e.anchor="start"):e.anchor="middle":(I-=z/2,e.anchor="end"),e.crossPos=I;else{if(e.pos=I,W=L+D/2+q<=j,G=L-D/2-q>=0,"left"!==e.idealAlign&&W||!G)if(W)L+=D/2,e.anchor="start";else{e.anchor="middle";var Y=q/2,X=L+Y-j,K=L-Y;X>0&&(L-=X),K<0&&(L+=-K)}else L-=D/2,e.anchor="end";e.crossPos=L}w.attr("text-anchor",e.anchor),C&&M.attr("text-anchor",e.anchor),t.attr("transform",s(L,I)+(u?l(_):""))})),{hoverLabels:we,commonLabelBoundingBox:q}}function R(e,t,r,n,i,a){var s="",l="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),s=N(e.name,e.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(l+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(l+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(l+=(l?"z: ":"")+e.zLabel)):t&&e[u+"Label"]===i?l=e[c+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(l=e.yLabel):l=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(l+=(l?"
":"")+e.text),void 0!==e.extraText&&(l+=(l?"
":"")+e.extraText),a&&""===l&&!e.hovertemplate&&(""===s&&a.remove(),l=s);var f=e.hovertemplate||!1;if(f){var d=e.hovertemplateLabels||e;e[u+"Label"]!==i&&(d[u+"other"]=d[u+"Val"],d[u+"otherLabel"]=d[u+"Label"]),l=(l=o.hovertemplateString(f,d,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(L,(function(t,r){return s=N(r,e.nameLength),""}))}return[l,s]}function O(e,t){var r=0,n=e.offset;return t&&(n*=-M,r=e.offset*T),{x:r,y:n}}function D(e,t,r,i){var a=function(e){return e*r},o=function(e){return e*i};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var i=r.select("text.nums"),s=e.anchor,l="end"===s?-1:1,u=function(e){var t={start:1,end:-1,middle:0}[e.anchor],r=t*(S+A),n=r+t*(e.txwidth+A);return"middle"===e.anchor&&(r-=e.tx2width/2,n+=e.txwidth/2+A),{alignShift:t,textShiftX:r,text2ShiftX:n}}(e),f=O(e,t),p=f.x,h=f.y,v="middle"===s;r.select("path").attr("d",v?"M-"+a(e.bx/2+e.tx2width/2)+","+o(h-e.by/2)+"h"+a(e.bx)+"v"+o(e.by)+"h-"+a(e.bx)+"Z":"M0,0L"+a(l*S+p)+","+o(S+h)+"v"+o(e.by/2-S)+"h"+a(l*e.bx)+"v-"+o(e.by)+"H"+a(l*S+p)+"V"+o(h-S)+"Z");var m=p+u.textShiftX,g=h+e.ty0-e.by/2+A,y=e.textAlign||"auto";"auto"!==y&&("left"===y&&"start"!==s?(i.attr("text-anchor","start"),m=v?-e.bx/2-e.tx2width/2+A:-e.bx-A):"right"===y&&"end"!==s&&(i.attr("text-anchor","end"),m=v?e.bx/2-e.tx2width/2-A:e.bx+A)),i.call(c.positionText,a(m),o(g)),e.tx2width&&(r.select("text.name").call(c.positionText,a(u.text2ShiftX+u.alignShift*A+p),o(h+e.ty0-e.by/2+A)),r.select("rect").call(d.setRect,a(u.text2ShiftX+(u.alignShift-1)*e.tx2width/2+p),o(h-e.by/2-1),a(e.tx2width),o(e.by+2)))}))}function z(e,t){var r=e.index,n=e.trace||{},a=e.cd[0],s=e.cd[r]||{};function l(e){return e||i(e)&&0===e}var u=Array.isArray(r)?function(e,t){var i=o.castOption(a,r,e);return l(i)?i:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(s,n,e,t)};function c(t,r,n){var i=u(r,n);l(i)&&(e[t]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:v.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:v.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!isNaN(e.xerr)&&!("log"===e.xa.type&&e.xerr<=0)){var f=v.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+v.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!isNaN(e.yerr)&&!("log"===e.ya.type&&e.yerr<=0)){var d=v.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+v.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function F(e,t,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||c){var h=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var m,g,y=t.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(m=u.pointerX,g=u.pointerY):(m=n._offset+y.x,g=i._offset+y.y);var x,b,_=a.readability(y.color,h)<1.5?p.contrast(h):y.color,w=i.spikemode,k=i.spikethickness,T=i.spikecolor||_,M=v.getPxPosition(e,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=m),-1!==w.indexOf("across")){var S=i._counterDomainMin,A=i._counterDomainMax;"free"===i.anchor&&(S=Math.min(S,i.position),A=Math.max(A,i.position)),x=l.l+S*l.w,b=l.l+A*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":k,stroke:T,"stroke-dasharray":d.dashStyle(i.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":k+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==i.side?k:-k),cy:g,r:k,fill:T}).classed("spikeline",!0)}if(f){var C,E,P=t.vLinePoint;n=P&&P.xa,i=P&&P.ya,"cursor"===n.spikesnap?(C=u.pointerX,E=u.pointerY):(C=n._offset+P.x,E=i._offset+P.y);var L,I,R=a.readability(P.color,h)<1.5?p.contrast(h):P.color,O=n.spikemode,D=n.spikethickness,z=n.spikecolor||R,F=v.getPxPosition(e,n);if(-1!==O.indexOf("toaxis")||-1!==O.indexOf("across")){if(-1!==O.indexOf("toaxis")&&(L=F,I=E),-1!==O.indexOf("across")){var j=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(j=Math.min(j,n.position),N=Math.max(N,n.position)),L=l.t+(1-N)*l.h,I=l.t+(1-j)*l.h}o.insert("line",":first-child").attr({x1:C,x2:C,y1:L,y2:I,"stroke-width":D,stroke:z,"stroke-dasharray":d.dashStyle(n.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:C,x2:C,y1:L,y2:I,"stroke-width":D+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==O.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:C,cy:F-("top"!==n.side?D:-D),r:D,fill:z}).classed("spikeline",!0)}}}function j(e,t){return!t||t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint}function N(e,t){return c.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function Z(e,t,r){var n=t[e+"a"],i=t[e+"Val"],a=t.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var s=t.cd[t.index],l=s[e+"Start"];void 0===l&&(l=s[e]);var u=s[e+"End"];void 0===u&&(u=s[e]);var c=u-l;"end"===o?i+=c:"middle"===o&&(i+=c/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function B(e){return e.offsetTop+e.clientTop}function V(e){return e.offsetLeft+e.clientLeft}function U(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),i=n.left,a=n.top,s=i+n.width,l=a+n.height,u=o.apply3DTransform(r._invTransform)(i,a),c=o.apply3DTransform(r._invTransform)(s,l),f=u[0],d=u[1],p=c[0],h=c[1];return{x:f,y:d,width:p-f,height:h-d,top:Math.min(d,h),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(d,h)}}},38048:function(e,t,r){"use strict";var n=r(71828),i=r(7901),a=r(23469).isUnifiedHover;e.exports=function(e,t,r,o){o=o||{};var s=t.legend;function l(e){o.font[e]||(o.font[e]=s?t.legend.font[e]:t.font[e])}t&&a(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(o.bgcolor||(o.bgcolor=i.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},98212:function(e,t,r){"use strict";var n=r(71828),i=r(528);e.exports=function(e,t){function r(r,a){return void 0!==t[r]?t[r]:n.coerce(e,t,i,r,a)}return r("clickmode"),r("hovermode")}},30211:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=r(28569),o=r(23469),s=r(528),l=r(88335);e.exports={moduleType:"component",name:"fx",constants:r(26675),schema:{layout:s},attributes:r(77914),layoutAttributes:s,supplyLayoutGlobalDefaults:r(22774),supplyDefaults:r(54268),supplyLayoutDefaults:r(34938),calc:r(30732),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return i.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return i.castOption(e,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(e){var t=i.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:r(75914)}},528:function(e,t,r){"use strict";var n=r(26675),i=r(41940),a=i({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:i({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},34938:function(e,t,r){"use strict";var n=r(71828),i=r(528),a=r(98212),o=r(38048);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}a(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=t._has("mapbox"),l=t._has("geo"),u=t._basePlotModules.length;"zoom"===t.dragmode&&((s||l)&&1===u||s&&l&&2===u)&&(t.dragmode="pan"),o(e,t,r),n.coerceFont(r,"hoverlabel.grouptitlefont",t.hoverlabel.font)}},22774:function(e,t,r){"use strict";var n=r(71828),i=r(38048),a=r(528);e.exports=function(e,t){i(e,t,(function(r,i){return n.coerce(e,t,a,r,i)}))}},83312:function(e,t,r){"use strict";var n=r(71828),i=r(30587).counter,a=r(27670).Y,o=r(85555).idRegex,s=r(44467),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:a({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(e,t,r){var n=t[r+"axes"],i=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function c(e,t,r,n,i,a){var o=t(e+"gap",r),s=t("domain."+e);t(e+"side",n);for(var l=new Array(i),u=s[0],c=(s[1]-u)/(i-o),f=c*(1-o),d=0;d1){d||p||h||"independent"===T("pattern")&&(d=!0),m._hasSubplotGrid=d;var x,b,_="top to bottom"===T("roworder"),w=d?.2:.1,k=d?.3:.1;v&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),m._domains={x:c("x",T,w,x,y),y:c("y",T,k,b,g,_)}}else delete t.grid}function T(e,t){return n.coerce(r,m,l,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,i,a,o,s,l,c,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,v=r.rows,m=r.columns,g="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];l=r.subplots=new Array(v);var b=1;for(n=0;n("legend"===e?1:0));if(!1===S&&(r[e]=void 0),(!1!==S||f.uirevision)&&(p("uirevision",r.uirevision),!1!==S)){p("borderwidth");var A,C,E,P="h"===p("orientation"),L="paper"===p("yref"),I="paper"===p("xref"),R="left";if(P?(A=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?L?(C=1.1,E="bottom"):(C=1,E="top"):L?(C=-.1,E="top"):(C=0,E="bottom")):(C=1,E="auto",I?A=1.02:(A=1,R="right")),i.coerce(f,d,{x:{valType:"number",editType:"legend",min:I?-2:0,max:I?3:1,dflt:A}},"x"),i.coerce(f,d,{y:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:C}},"y"),p("traceorder",_),u.isGrouped(r[e])&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("xanchor",R),p("yanchor",E),p("valign"),i.noneOrAll(f,d,["x","y"]),p("title.text")){p("title.side",P?"left":"top");var O=i.extendFlat({},h,{size:i.bigFont(h.size)});i.coerceFont(p,"title.font",O)}}}}e.exports=function(e,t,r){var n,a=r.slice(),o=t.shapes;if(o)for(n=0;n1)}var z=d.hiddenlabels||[];if(!v&&(!d.showlegend||!w.length))return s.selectAll("."+h).remove(),d._topdefs.select("#"+r).remove(),a.autoMargin(e,h);var F=i.ensureSingle(s,"g",h,(function(e){v||e.attr("pointer-events","all")})),j=i.ensureSingleById(d._topdefs,"clipPath",r,(function(e){e.append("rect")})),N=i.ensureSingle(F,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));N.call(c.stroke,f.bordercolor).call(c.fill,f.bgcolor).style("stroke-width",f.borderwidth+"px");var Z=i.ensureSingle(F,"g","scrollbox"),B=f.title;if(f._titleWidth=0,f._titleHeight=0,B.text){var V=i.ensureSingle(Z,"text",h+"titletext");V.attr("text-anchor","start").call(u.font,B.font).text(B.text),E(V,Z,e,f,_)}else Z.selectAll("."+h+"titletext").remove();var U=i.ensureSingle(F,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(c.fill,p.scrollBarColor)})),H=Z.selectAll("g.groups").data(w);H.enter().append("g").attr("class","groups"),H.exit().remove();var W=H.selectAll("g.traces").data(i.identity);W.enter().append("g").attr("class","traces"),W.exit().remove(),W.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==z.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(S,e,f)})).call(x,e,f).each((function(){v||n.select(this).call(C,e,h)})),i.syncOrAsync([a.previousPromises,function(){return function(e,t,r,i){var a=e._fullLayout,o=I(i);i||(i=a[o]);var s=a._size,l=b.isVertical(i),c=b.isGrouped(i),f="fraction"===i.entrywidthmode,d=i.borderwidth,h=2*d,v=p.itemGap,m=i.itemwidth+2*v,g=2*(d+v),y=L(i),x=i.y<0||0===i.y&&"top"===y,_=i.y>1||1===i.y&&"bottom"===y,w=i.tracegroupgap,k={};i._maxHeight=Math.max(x||_?a.height/2:s.h,30);var M=0;i._width=0,i._height=0;var S=function(e){var t=0,r=0,n=e.title.side;return n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight)),[t,r]}(i);if(l)r.each((function(e){var t=e[0].height;u.setTranslate(this,d+S[0],d+S[1]+i._height+t/2+v),i._height+=t,i._width=Math.max(i._width,e[0].width)})),M=m+i._width,i._width+=v+m+h,i._height+=g,c&&(t.each((function(e,t){u.setTranslate(this,0,t*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var A=P(i),C=i.x<0||0===i.x&&"right"===A,E=i.x>1||1===i.x&&"left"===A,R=_||x,O=a.width/2;i._maxWidth=Math.max(C?R&&"left"===A?s.l+s.w:O:E?R&&"right"===A?s.r+s.w:O:s.w,2*m);var D=0,z=0;r.each((function(e){var t=T(e,i,m);D=Math.max(D,t),z+=t})),M=null;var F=0;if(c){var j=0,N=0,Z=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=T(r,i,m),a=r[0].height;u.setTranslate(this,S[0],S[1]+d+v+a/2+t),t+=a,e=Math.max(e,n),k[r[0].trace.legendgroup]=e}));var r=e+v;N>0&&r+d+N>i._maxWidth?(F=Math.max(F,N),N=0,Z+=j+w,j=t):j=Math.max(j,t),u.setTranslate(this,N,Z),N+=r})),i._width=Math.max(F,N)+d,i._height=Z+j+g}else{var B=r.size(),V=z+h+(B-1)*v=i._maxWidth&&(F=Math.max(F,G),H=0,W+=U,i._height+=U,U=0),u.setTranslate(this,S[0]+d+H,S[1]+d+W+t/2+v),G=H+r+v,H+=n,U=Math.max(U,t)})),V?(i._width=H+h,i._height=U+g):(i._width=Math.max(F,G)+h,i._height+=U+g)}}i._width=Math.ceil(Math.max(i._width+S[0],i._titleWidth+2*(d+p.titlePad))),i._height=Math.ceil(Math.max(i._height+S[1],i._titleHeight+2*(d+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var q=e._context.edits,Y=q.legendText||q.legendPosition;r.each((function(e){var t=n.select(this).select("."+o+"toggle"),r=e[0].height,a=e[0].trace.legendgroup,s=T(e,i,m);c&&""!==a&&(s=k[a]);var d=Y?m:M||s;l||f||(d+=v/2),u.setRect(t,0,-r/2,d,r)}))}(e,H,W,f)},function(){var t,c,y,x,b=d._size,_=f.borderwidth,w="paper"===f.xref,k="paper"===f.yref;if(!v){var T,S;T=w?b.l+b.w*f.x-m[P(f)]*f._width:d.width*f.x-m[P(f)]*f._width,S=k?b.t+b.h*(1-f.y)-m[L(f)]*f._effHeight:d.height*(1-f.y)-m[L(f)]*f._effHeight;var A=function(e,t,r,n){var i=e._fullLayout,o=i[t],s=P(o),l=L(o),u="paper"===o.xref,c="paper"===o.yref;e._fullLayout._reservedMargin[t]={};var f=o.y<.5?"b":"t",d=o.x<.5?"l":"r",p={r:i.width-r,l:r+o._width,b:i.height-n,t:n+o._effHeight};if(u&&c)return a.autoMargin(e,t,{x:o.x,y:o.y,l:o._width*m[s],r:o._width*g[s],b:o._effHeight*g[l],t:o._effHeight*m[l]});u?e._fullLayout._reservedMargin[t][f]=p[f]:c||"v"===o.orientation?e._fullLayout._reservedMargin[t][d]=p[d]:e._fullLayout._reservedMargin[t][f]=p[f]}(e,h,T,S);if(A)return;if(d.margin.autoexpand){var C=T,E=S;T=w?i.constrain(T,0,d.width-f._width):C,S=k?i.constrain(S,0,d.height-f._effHeight):E,T!==C&&i.log("Constrain "+h+".x to make legend fit inside graph"),S!==E&&i.log("Constrain "+h+".y to make legend fit inside graph")}u.setTranslate(F,T,S)}if(U.on(".drag",null),F.on("wheel",null),v||f._height<=f._maxHeight||e._context.staticPlot){var I=f._effHeight;v&&(I=f._height),N.attr({width:f._width-_,height:I-_,x:_/2,y:_/2}),u.setTranslate(Z,0,0),j.select("rect").attr({width:f._width-2*_,height:I-2*_,x:_,y:_}),u.setClipUrl(Z,r,e),u.setRect(U,0,0,0,0),delete f._scrollY}else{var R,O,D,z=Math.max(p.scrollBarMinHeight,f._effHeight*f._effHeight/f._height),B=f._effHeight-z-2*p.scrollBarMargin,V=f._height-f._effHeight,H=B/V,W=Math.min(f._scrollY||0,V);N.attr({width:f._width-2*_+p.scrollBarWidth+p.scrollBarMargin,height:f._effHeight-_,x:_/2,y:_/2}),j.select("rect").attr({width:f._width-2*_+p.scrollBarWidth+p.scrollBarMargin,height:f._effHeight-2*_,x:_,y:_+W}),u.setClipUrl(Z,r,e),Y(W,z,H),F.on("wheel",(function(){Y(W=i.constrain(f._scrollY+n.event.deltaY/B*V,0,V),z,H),0!==W&&W!==V&&n.event.preventDefault()}));var G=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;R="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,D=W})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(O="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,W=function(e,t,r){var n=(r-t)/H+e;return i.constrain(n,0,V)}(D,R,O),Y(W,z,H))}));U.call(G);var q=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(R=e.changedTouches[0].clientY,D=W)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(O=e.changedTouches[0].clientY,W=function(e,t,r){var n=(t-r)/H+e;return i.constrain(n,0,V)}(D,R,O),Y(W,z,H))}));Z.call(q)}function Y(t,r,n){f._scrollY=e._fullLayout[h]._scrollY=t,u.setTranslate(Z,0,-t),u.setRect(U,f._width,p.scrollBarMargin+t*n,p.scrollBarWidth,r),j.select("rect").attr("y",_+t)}e._context.edits.legendPosition&&(F.classed("cursor-move",!0),l.init({element:F.node(),gd:e,prepFn:function(){var e=u.getTranslate(F);y=e.x,x=e.y},moveFn:function(e,r){var n=y+e,i=x+r;u.setTranslate(F,n,i),t=l.align(n,f._width,b.l,b.l+b.w,f.xanchor),c=l.align(i+f._height,-f._height,b.t+b.h,b.t,f.yanchor)},doneFn:function(){if(void 0!==t&&void 0!==c){var r={};r[h+".x"]=t,r[h+".y"]=c,o.call("_guiRelayout",e,r)}},clickFn:function(t,r){var n=s.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return r.clientX>=e.left&&r.clientX<=e.right&&r.clientY>=e.top&&r.clientY<=e.bottom}));n.size()>0&&M(e,F,n,t,r)}}))}],e)}}function T(e,t,r){var n=e[0],i=n.width,a=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===a?t._maxWidth*o:r+(o||i)}function M(e,t,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(e,"plotly_legendclick",l)&&(1===n?t._clickTimeout=setTimeout((function(){e._fullLayout&&d(r,e,n)}),e._context.doubleClickDelay):2===n&&(t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==s.triggerHandler(e,"plotly_legenddoubleclick",l)&&d(r,e,n)))}function S(e,t,r){var n,a,s=I(r),l=e.data()[0][0],c=l.trace,d=o.traceIs(c,"pie-like"),h=!r._inHover&&t._context.edits.legendText&&!d,v=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,a=l.groupTitle.font):(a=r.font,r.entries?n=l.text:(n=d?l.label:c.name,c._meta&&(n=i.templateString(n,c._meta))));var m=i.ensureSingle(e,"text",s+"text");m.attr("text-anchor","start").call(u.font,a).text(h?A(n,v):n);var g=r.itemwidth+2*p.itemGap;f.positionText(m,g,0),h?m.call(f.makeEditable,{gd:t,text:n}).call(E,e,t,r).on("edit",(function(n){this.text(A(n,v)).call(E,e,t,r);var a=l.trace._fullInput||{},s={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],d=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");d.set(l.trace._group,n),s=d.constructUpdate()}else s.name=n;return a._isShape?o.call("_guiRelayout",t,"shapes["+c.index+"].name",s.name):o.call("_guiRestyle",t,s,c.index)})):E(m,e,t,r)}function A(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function C(e,t,r){var a,o=t._context.doubleClickDelay,s=1,l=i.ensureSingle(e,"rect",r+"toggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(c.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(a=(new Date).getTime())-t._legendMouseDownTimeo&&(s=Math.max(s-1,1)),M(t,i,e,s,n.event)}})))}function E(e,t,r,n,i){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var i=e.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=e.select("g[class*=math-group]"),o=a.node(),s=I(r);r||(r=t._fullLayout[s]);var l,c,d=r.borderwidth,h=(n===_?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*v;if(o){var m=u.bBox(o);l=m.height,c=m.width,n===_?u.setTranslate(a,d,d+.75*l):u.setTranslate(a,0,.25*l)}else{var g="."+s+(n===_?"title":"")+"text",y=e.select(g),x=f.lineCount(y),b=y.node();if(l=h*x,c=b?u.bBox(b).width:0,n===_){var w=0;"left"===r.title.side?c+=2*p.itemGap:"top center"===r.title.side?r._width&&(w=.5*(r._width-2*d-2*p.titlePad-c)):"top right"===r.title.side&&r._width&&(w=r._width-2*d-2*p.titlePad-c),f.positionText(y,d+p.titlePad+w,d+h)}else{var k=2*p.itemGap+r.itemwidth;i.groupTitle&&(k=p.itemGap,c-=r.itemwidth),f.positionText(y,k,-h*((x-1)/2-.3))}}n===_?(r._titleWidth=c,r._titleHeight=l):(i.lineHeight=h,i.height=Math.max(l,16)+3,i.width=c)}else e.remove()}(t,r,n,i)}))}function P(e){return i.isRightAnchor(e)?"right":i.isCenterAnchor(e)?"center":"left"}function L(e){return i.isBottomAnchor(e)?"bottom":i.isMiddleAnchor(e)?"middle":"top"}function I(e){return e._id||"legend"}e.exports=function(e,t){if(t)k(e,t);else{var r=e._fullLayout,i=r._legends;r._infolayer.selectAll('[class^="legend"]').each((function(){var e=n.select(this),t=e.attr("class").split(" ")[0];t.match(w)&&-1===i.indexOf(t)&&e.remove()}));for(var a=0;aA&&(S=A)}T[a][0]._groupMinRank=S,T[a][0]._preGroupSort=a}var C=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(T.forEach((function(e,t){e[0]._preGroupSort=t})),T.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),a=0;ar?r:e}e.exports=function(e,t,r){var g=t._fullLayout;r||(r=g.legend);var y="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var i;if(e+1)i=e;else{if(!(t&&t.width>0))return 0;i=t.width}return y?n:Math.min(i,r)};function k(e,a,o){var c=e[0].trace,f=c.marker||{},d=f.line||{},p=o?c.visible&&c.type===o:i.traceIs(c,"bar"),h=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var i=n.select(this),a=e[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var p=a.mcc;if(!r._inHover&&"mc"in a){var h=u(f),v=h.mid;void 0===v&&(v=(h.max+h.min)/2),p=s.tryColorscale(f,"")(v)}var g=p||a.mc||f.color,y=f.pattern,x=y&&s.getPatternAttr(y.shape,0,"");if(x){var b=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),k=y.fgopacity,T=m(y.size,8,10),M=m(y.solidity,.5,1),S="legend-"+c.uid;i.call(s.pattern,"legend",t,S,x,T,M,p,y.fillmode,b,_,k)}else i.call(l.fill,g);o&&l.stroke(i,a.mlc||d.color)}))}function T(e,r,o){var s=e[0],l=s.trace,u=o?l.visible&&l.type===o:i.traceIs(l,o),c=n.select(r).select("g.legendpoints").selectAll("path.legend"+o).data(u?[e]:[]);if(c.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var p=l.marker||{},h=w(d(p.line.width,s.pts),p.line,5,2),v="pieLike",m=a.minExtend(l,{marker:{line:{width:h}}},v),g=a.minExtend(s,{trace:m},v);f(c,g,m,t)}}e.each((function(e){var t=n.select(this),i=a.ensureSingle(t,"g","layers");i.style("opacity",e[0].trace.opacity);var s=r.valign,l=e[0].lineHeight,u=e[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));i.attr("transform",o(0,c))}else i.attr("transform",null);i.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=i.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,i=e[0].trace,o=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(e,o){var c,f=n.select(this),d=u(i),p=d.colorscale,v=d.reversescale;if(p){if(!r){var m=p.length;c=0===o?p[v?m-1:0][1]:1===o?p[v?0:m-1][1]:p[Math.floor((m-1)/2)][1]}}else{var g=i.vertexcolor||i.facecolor||i.color;c=a.isArrayOrTypedArray(g)?g[o]||g[0]:g}f.attr("d",e[0]),c?f.call(l.fill,c):f.call((function(e){if(e.size()){var n="legendfill-"+i.uid;s.gradient(e,t,n,h(v,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var i=e[0].trace[e[0].dir].marker;return e[0].mc=i.color,e[0].mlw=i.line.width,e[0].mlc=i.line.color,k(e,this,"waterfall")}var a=[];t.visible&&r&&(a=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),i=t[e[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",e[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(e){k(e,this,"funnel")})).each((function(e){k(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);e.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(e,r.line.color)}else{var u=a.minExtend(r,{marker:{size:y?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,t)}}))})).each((function(e){T(e,this,"funnelarea")})).each((function(e){T(e,this,"pie")})).each((function(e){var r,i,o=v(e),l=o.showFill,f=o.showLine,d=o.showGradientLine,p=o.showGradientFill,m=o.anyFill,g=o.anyLine,y=e[0],b=y.trace,_=u(b),k=_.colorscale,T=_.reversescale,M=c.hasMarkers(b)||!m?"M5,0":g?"M5,-2":"M5,-3",S=n.select(this),A=S.select(".legendfill").selectAll("path").data(l||p?[e]:[]);if(A.enter().append("path").classed("js-fill",!0),A.exit().remove(),A.attr("d",M+"h"+x+"v6h-"+x+"z").call((function(e){if(e.size())if(l)s.fillGroupStyle(e,t);else{var r="legendfill-"+b.uid;s.gradient(e,t,r,h(T),k,"fill")}})),f||d){var C=w(void 0,b.line,10,5);i=a.minExtend(b,{line:{width:C}}),r=[a.minExtend(y,{trace:i})]}var E=S.select(".legendlines").selectAll("path").data(f||d?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",M+(d?"l"+x+",0.0001":"h"+x)).call(f?s.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;s.lineGroupStyle(e),s.gradient(e,t,r,h(T),k,"stroke")}})})).each((function(e){var r,i,o=v(e),l=o.anyFill,u=o.anyLine,f=o.showLine,d=o.showMarker,p=e[0],h=p.trace,m=!d&&!u&&!l&&c.hasText(h);function g(e,t,r,n){var i=a.nestedProperty(h,e).get(),o=a.isArrayOrTypedArray(i)&&t?t(i):i;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(d||m||f){var b={},w={};if(d){b.mc=g("marker.color",x),b.mx=g("marker.symbol",x),b.mo=g("marker.opacity",a.mean,[.2,1]),b.mlc=g("marker.line.color",x),b.mlw=g("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var k=g("marker.size",a.mean,[2,16],12);b.ms=k,w.marker.size=k}f&&(w.line={width:g("line.width",x,[0,10],5)}),m&&(b.tx="Aa",b.tp=g("textposition",x),b.ts=10,b.tc=g("textfont.color",x),b.tf=g("textfont.family",x)),r=[a.minExtend(p,b)],(i=a.minExtend(h,w)).selectedpoints=null,i.texttemplate=null}var T=n.select(this).select("g.legendpoints"),M=T.selectAll("path.scatterpts").data(d?r:[]);M.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),M.exit().remove(),M.call(s.pointStyle,i,t),d&&(r[0].mrc=3);var S=T.selectAll("g.pointtext").data(m?r:[]);S.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),S.exit().remove(),S.selectAll("text").call(s.textPointStyle,i,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var i=n.select(this),a=t[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var i=n.select(this),a=t[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},42068:function(e,t,r){"use strict";r(93348),e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},26023:function(e,t,r){"use strict";var n=r(73972),i=r(74875),a=r(41675),o=r(24255),s=r(34031).eraseActiveShape,l=r(71828),u=l._,c=e.exports={};function f(e,t){var r,i,o=t.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=e._fullLayout,c={},f=a.list(e,null,!0),d=u._cartesianSpikesEnabled;if("zoom"===s){var p,h="in"===l?.5:2,v=(1+h)/2,m=(1-h)/2;for(i=0;i1?(I=["toggleHover"],R=["resetViews"]):g?(L=["zoomInGeo","zoomOutGeo"],I=["hoverClosestGeo"],R=["resetGeo"]):m?(I=["hoverClosest3d"],R=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(L=["zoomInMapbox","zoomOutMapbox"],I=["toggleHover"],R=["resetViewMapbox"]):b?I=["hoverClosestGl2d"]:y?I=["hoverClosestPie"]:M?(I=["hoverClosestCartesian","hoverCompareCartesian"],R=["resetViewSankey"]):I=["toggleHover"],v&&(I=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]),(function(e){for(var t=0;t0)){var v=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),i=0,a=0;a=n.max)t=F[r+1];else if(e=n.pmax)t=F[r+1];else if(er._length||g+b<0)return;c=m+b,p=g+b;break;case l:if(x="col-resize",m+b>r._length)return;c=m+b,p=g;break;case u:if(x="col-resize",g+b<0)return;c=m,p=g+b;break;default:x="ew-resize",c=v,p=v+b}if(p=0;T--){var M=r.append("path").attr(m).style("opacity",T?.1:g).call(o.stroke,x).call(o.fill,y).call(s.dashLine,T?"solid":_,T?4+b:b);if(h(M,e,a),w){var S=l(e.layout,"selections",a);M.style({cursor:"move"});var A={element:M.node(),plotinfo:p,gd:e,editHelpers:S,isActiveSelection:!0},C=n(u,e);i(C,M,A)}else M.style("pointer-events",T?"all":"none");k[T]=M}var E=k[0];k[1].node().addEventListener("click",(function(){return function(e,t){if(d(e)){var r=t.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===e._fullLayout._activeSelectionIndex)return void v(e);e._fullLayout._activeSelectionIndex=n,e._fullLayout._deactivateSelection=v,f(e)}}}(e,E)}))}(e._fullLayout._selectionLayer)}function h(e,t,r){var n=r.xref+r.yref;s.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function v(e){d(e)&&e._fullLayout._activeSelectionIndex>=0&&(a(e),delete e._fullLayout._activeSelectionIndex,f(e))}e.exports={draw:f,drawOne:p,activateLastSelection:function(e){if(d(e)){var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=v,f(e)}}}},53777:function(e,t,r){"use strict";var n=r(79952).P,i=r(1426).extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},90849:function(e){"use strict";e.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},35855:function(e,t,r){"use strict";var n=r(64505).selectMode,i=r(51873).clearOutline,a=r(60165),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;e.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var a=r.getAttribute("d"),u=t.gd,c=u._fullLayout.newselection,f=t.plotinfo,d=f.xaxis,p=f.yaxis,h=t.isActiveSelection,v=t.dragmode,m=(u.layout||{}).selections||[];if(!n(v)&&void 0!==h){var g=u._fullLayout._activeSelectionIndex;if(g-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(g)){G(e,t,a);var _=function(e,t){var r,n,i=e[0],a=-1,o=[];for(n=0;n0?function(e,t){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(i=0;i1)return!1;if((n+=t.selectedpoints.length)>1)return!1}return 1===n}(s)&&(d=$(_))){for(o&&o.remove(),m=0;m=0})(i)&&i._fullLayout._deactivateShape(i),function(e){return e._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=p(r),l=v(r);if(s||l){var u,c,f=o.selectAll(".select-outline-"+n.id);f&&i._fullLayout._outlining&&(s&&(u=k(f,e)),u&&a.call("_guiRelayout",i,{shapes:u}),l&&!B(e)&&(c=T(f,e)),c&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:c}).then((function(){t&&M(i)}))),i._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function Y(e){return e._id}function X(e,t,r,n){if(!e.calcdata)return[];var i,a,o,s=[],l=t.map(Y),u=r.map(Y);for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(i)>-1}function J(e,t,r){var n,i;for(n=0;n-1&&t;if(!a&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,pe=te[0].yref;if(ne&&pe){var he=ue(te);ce([P(e,ne,"x"),P(e,pe,"y")])(Q,he)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&fe(e,Q),d._reselect=!1}if(!a&&d._deselect){var ve=d._deselect;(function(e,t,r){for(var n=0;n=0)T._fullLayout._deactivateShape(T);else if(!x){var r=M.clickmode;E.done(Se).then((function(){if(E.clear(Se),2===e){for(be.remove(),$=0;$-1&&V(t,T,n.xaxes,n.yaxes,n.subplot,n,be),"event"===r&&fe(T,void 0);l.click(T,t)})).catch(S.error)}},n.doneFn=function(){Te.remove(),E.done(Se).then((function(){E.clear(Se),!A&&K&&n.selectionDefs&&(K.subtract=xe,n.selectionDefs.push(K),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Y)),(A||x)&&q(n,A),n.doneFnCompleted&&n.doneFnCompleted(Ae),b&&fe(T,ae)})).catch(S.error)}},clearOutline:x,clearSelectionsCache:q,selectOnClick:V}},89827:function(e,t,r){"use strict";var n=r(50215),i=r(41940),a=r(82196).line,o=r(79952).P,s=r(1426).extendFlat,l=r(44467).templatedArray,u=(r(24695),r(9012)),c=r(5386).R,f=r(37281);e.exports=l("shape",{visible:s({},u.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:s({},u.legend,{editType:"calc+arraydraw"}),legendgroup:s({},u.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:s({},u.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:i({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:s({},u.legendrank,{editType:"calc+arraydraw"}),legendwidth:s({},u.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:s({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:s({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:s({},a.color,{editType:"arraydraw"}),width:s({},a.width,{editType:"calc+arraydraw"}),dash:s({},o,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:c({},{keys:Object.keys(f)}),font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})},5627:function(e,t,r){"use strict";var n=r(71828),i=r(89298),a=r(21459),o=r(30477);function s(e){return u(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function l(e){return u(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function u(e,t,r,i,s,l){var u=e/2,c=l;if("pixel"===t){var f=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+u:u,v=d>0?d+u:u;return{ppad:u,ppadplus:c?h:v,ppadminus:c?v:h}}return{ppad:u}}function c(e,t,r,n,i){var s="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[s(t),s(r)];if(n){var l,u,c,f,d=1/0,p=-1/0,h=n.match(a.segmentRE);for("date"===e.type&&(s=o.decodeDate(s)),l=0;lp&&(p=f)));return p>=d?[d,p]:void 0}}e.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o=e?t-n:n-t,-180/Math.PI*Math.atan2(i,a)}(x,_,b,w):0),M.call((function(t){return t.call(o.font,T).attr({}),a.convertToTspans(t,e),t}));var B=function(e,t,r,n,i,a,o){var s,l,u,c,d=i.label.textposition,p=i.label.textangle,h=i.label.padding,v=i.type,m=Math.PI/180*a,g=Math.sin(m),y=Math.cos(m),x=i.label.xanchor,b=i.label.yanchor;if("line"===v){"start"===d?(s=e,l=t):"end"===d?(s=r,l=n):(s=(e+r)/2,l=(t+n)/2),"auto"===x&&(x="start"===d?"auto"===p?r>e?"left":re?"right":re?"right":re?"left":r1&&(2!==e.length||"Z"!==e[1][0])&&(0===P&&(e[0][0]="M"),t[E]=e,M(),S())}}()}}function V(e,r){!function(e,r){if(t.length)for(var n=0;nz&&a>F&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";v(t,l),D=l.split("-")[0]}}function ne(n){b(e)||(j&&(w=Y(r.xanchor)),N&&(M=X(r.yanchor)),"path"===r.type?O=r.path:(f=j?r.x0:Y(r.x0),p=N?r.y0:X(r.y0),x=j?r.x1:Y(r.x1),_=N?r.y1:X(r.y1)),f_?(S=p,P="y0",A=_,L="y1"):(S=_,P="y1",A=p,L="y0"),re(n),le(l,r),ce(t,r,e),Q.moveFn="move"===D?oe:se,Q.altKey=n.altKey)}function ie(){b(e)||(v(t),ue(l),k(t,e,r),i.call("_guiRelayout",e,c.getUpdateObj()))}function ae(){b(e)||ue(l)}function oe(n,i){if("path"===r.type){var a=function(e){return e},o=a,c=a;j?V("xanchor",r.xanchor=K(w+n)):(o=function(e){return K(Y(e)+n)},H&&"date"===H.type&&(o=g.encodeDate(o))),N?V("yanchor",r.yanchor=$(M+i)):(c=function(e){return $(X(e)+i)},G&&"date"===G.type&&(c=g.encodeDate(c))),V("path",r.path=T(O,o,c))}else j?V("xanchor",r.xanchor=K(w+n)):(V("x0",r.x0=K(f+n)),V("x1",r.x1=K(x+n))),N?V("yanchor",r.yanchor=$(M+i)):(V("y0",r.y0=$(p+i)),V("y1",r.y1=$(_+i)));t.attr("d",y(e,r)),le(l,r),u(e,s,r,U)}function se(n,i){if(B){var a=function(e){return e},o=a,c=a;j?V("xanchor",r.xanchor=K(w+n)):(o=function(e){return K(Y(e)+n)},H&&"date"===H.type&&(o=g.encodeDate(o))),N?V("yanchor",r.yanchor=$(M+i)):(c=function(e){return $(X(e)+i)},G&&"date"===G.type&&(c=g.encodeDate(c))),V("path",r.path=T(O,o,c))}else if(Z){if("resize-over-start-point"===D){var d=f+n,h=N?p-i:p+i;V("x0",r.x0=j?d:K(d)),V("y0",r.y0=N?h:$(h))}else if("resize-over-end-point"===D){var v=x+n,m=N?_-i:_+i;V("x1",r.x1=j?v:K(v)),V("y1",r.y1=N?m:$(m))}}else{var b=function(e){return-1!==D.indexOf(e)},k=b("n"),W=b("s"),q=b("w"),J=b("e"),Q=k?S+i:S,ee=W?A+i:A,te=q?C+n:C,re=J?E+n:E;N&&(k&&(Q=S-i),W&&(ee=A-i)),(!N&&ee-Q>F||N&&Q-ee>F)&&(V(P,r[P]=N?Q:$(Q)),V(L,r[L]=N?ee:$(ee))),re-te>z&&(V(I,r[I]=j?te:K(te)),V(R,r[R]=j?re:K(re)))}t.attr("d",y(e,r)),le(l,r),u(e,s,r,U)}function le(e,t){function r(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]),i=1;n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":i}).classed("visual-cue",!0);var o=Y(j?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,m.paramIsX))),s=X(N?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,m.paramIsY)));if(o=g.roundPositionForSharpStrokeRendering(o,i),s=g.roundPositionForSharpStrokeRendering(s,i),j&&N){var l="M"+(o-1-i)+","+(s-1-i)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(j){var u="M"+(o-1-i)+","+(s-9-i)+"v18 h2 v-18 Z";n.attr("d",u)}else{var c="M"+(o-9-i)+","+(s-1-i)+"h18 v2 h-18 Z";n.attr("d",c)}}(j||N)&&r()}function ue(e){e.selectAll(".visual-cue").remove()}function ce(e,t,r){var n=t.xref,i=t.yref,a=o.getFromId(r,n),s=o.getFromId(r,i),l="";"paper"===n||a.autorange||(l+=n),"paper"===i||s.autorange||(l+=i),d.setClipUrl(e,l?"clip"+r._fullLayout._uid+l:null,r)}h.init(Q),J.node().onmousemove=re}(e,F,c,t,r,D):!0===c.editable&&F.style("pointer-events",R||f.opacity(E)*C<=.5?"stroke":"all");F.node().addEventListener("click",(function(){return function(e,t){if(_(e)){var r=t.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===e._fullLayout._activeShapeIndex)return void M(e);e._fullLayout._activeShapeIndex=n,e._fullLayout._deactivateShape=M,x(e)}}}(e,F)}))}c._input&&!0===c.visible&&("below"!==c.layer?S(e._fullLayout._shapeUpperLayer):"paper"===c.xref||"paper"===c.yref?S(e._fullLayout._shapeLowerLayer):w._hadPlotinfo?S((w.mainplotinfo||w).shapelayer):S(e._fullLayout._shapeLowerLayer))}function k(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");d.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function T(e,t,r){return e.replace(m.segmentRE,(function(e){var n=0,i=e.charAt(0),a=m.paramIsX[i],o=m.paramIsY[i],s=m.numParams[i];return i+e.substr(1).replace(m.paramRE,(function(e){return n>=s||(a[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function M(e){_(e)&&e._fullLayout._activeShapeIndex>=0&&(c(e),delete e._fullLayout._activeShapeIndex,x(e))}e.exports={draw:x,drawOne:w,eraseActiveShape:function(e){if(_(e)){c(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t0&&lp&&(e="X"),e}));return a>p&&(h=h.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+e)),c+h}))}(r,s,u);if("pixel"===r.xsizemode){var b=s(r.xanchor);c=b+r.x0,f=b+r.x1}else c=s(r.x0),f=s(r.x1);if("pixel"===r.ysizemode){var _=u(r.yanchor);d=_-r.y0,p=_-r.y1}else d=u(r.y0),p=u(r.y1);if("line"===h)return"M"+c+","+d+"L"+f+","+p;if("rect"===h)return"M"+c+","+d+"H"+f+"V"+p+"H"+c+"Z";var w=(c+f)/2,k=(d+p)/2,T=Math.abs(w-c),M=Math.abs(k-d),S="A"+T+","+M,A=w+T+","+k;return"M"+A+S+" 0 1,1 "+w+","+(k-M)+S+" 0 0,1 "+A+"Z"}},89853:function(e,t,r){"use strict";var n=r(34031);e.exports={moduleType:"component",name:"shapes",layoutAttributes:r(89827),supplyLayoutDefaults:r(84726),supplyDrawNewShapeDefaults:r(45547),includeBasePlot:r(76325)("shapes"),calcAutorange:r(5627),draw:n.draw,drawOne:n.drawOne}},37281:function(e){"use strict";function t(e,t){return t?t.d2l(e):e}function r(e,t){return t?t.l2d(e):e}function n(e,r){return t(e.x1,r)-t(e.x0,r)}function i(e,r,n){return t(e.y1,n)-t(e.y0,n)}e.exports={x0:function(e){return e.x0},x1:function(e){return e.x1},y0:function(e){return e.y0},y1:function(e){return e.y1},slope:function(e,t,r){return"line"!==e.type?void 0:i(e,0,r)/n(e,t)},dx:n,dy:i,width:function(e,t){return Math.abs(n(e,t))},height:function(e,t,r){return Math.abs(i(e,0,r))},length:function(e,t,r){return"line"!==e.type?void 0:Math.sqrt(Math.pow(n(e,t),2)+Math.pow(i(e,0,r),2))},xcenter:function(e,n){return r((t(e.x1,n)+t(e.x0,n))/2,n)},ycenter:function(e,n,i){return r((t(e.y1,i)+t(e.y0,i))/2,i)}}},75067:function(e,t,r){"use strict";var n=r(41940),i=r(35025),a=r(1426).extendDeepAll,o=r(30962).overrideAll,s=r(85594),l=r(44467).templatedArray,u=r(98292),c=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:u.gripBgActiveColor},bgcolor:{valType:"color",dflt:u.railBgColor},bordercolor:{valType:"color",dflt:u.railBorderColor},borderwidth:{valType:"number",min:0,dflt:u.railBorderWidth},ticklen:{valType:"number",min:0,dflt:u.tickLength},tickcolor:{valType:"color",dflt:u.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:u.minorTickLength}}),"arraydraw","from-root")},98292:function(e){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},12343:function(e,t,r){"use strict";var n=r(71828),i=r(85501),a=r(75067),o=r(98292).name,s=a.steps;function l(e,t,r){function o(r,i){return n.coerce(e,t,a,r,i)}for(var s=i(e,t,{name:"steps",handleItemDefaults:u}),l=0,c=0;c0&&(s=s.transition().duration(t.transition.duration).ease(t.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function C(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function E(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function P(e,t,r){var n=r._dims,i=s.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(M,t,e,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function L(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(e,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,t.bordercolor).call(a.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(i,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}e.exports=function(e){var t=e._context.staticPlot,r=e._fullLayout,a=function(e,t){for(var r=e[f.name],n=[],i=0;i0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),i.autoMargin(e,m(t))}if(s.enter().append("g").classed(f.containerClassName,!0).style("cursor",t?null:"ew-resize"),s.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(l)})).remove(),0!==a.length){var u=s.selectAll("g."+f.groupClassName).data(a,g);u.enter().append("g").classed(f.groupClassName,!0),u.exit().each(l).remove();for(var c=0;c0||_<0){var S={left:[-w,0],right:[w,0],top:[0,-w],bottom:[0,w]}[b.side];r.attr("transform",l(S[0],S[1]))}}}return z.call(F),R&&(C?z.on(".opacity",null):(M=0,S=!0,z.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(d.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(d.HIDE_PLACEHOLDER).style("opacity",0)}))),z.call(f.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,g,t,x):o.call("_guiRelayout",e,g,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),z.classed("js-placeholder",S),k}}},7163:function(e,t,r){"use strict";var n=r(41940),i=r(22399),a=r(1426).extendFlat,o=r(30962).overrideAll,s=r(35025),l=r(44467).templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},75909:function(e){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},64897:function(e,t,r){"use strict";var n=r(71828),i=r(85501),a=r(7163),o=r(75909).name,s=a.buttons;function l(e,t,r){function o(r,i){return n.coerce(e,t,a,r,i)}o("visible",i(e,t,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(e,t){function r(r,i){return n.coerce(e,t,s,r,i)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(e,t){i(e,t,{name:o,handleItemDefaults:l})}},13689:function(e,t,r){"use strict";var n=r(39898),i=r(74875),a=r(7901),o=r(91424),s=r(71828),l=r(63893),u=r(44467).arrayEditor,c=r(18783).LINE_SPACING,f=r(75909),d=r(25849);function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function v(e,t,r,n,i,a,o,s){t.active=o,u(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(i.attr(f.menuIndexAttrName,"-1"),m(e,n,i,a,t),s||g(e,n,i,a,t))}function m(e,t,r,n,i){var a=s.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),l=i._dims,u=i.active,c=i.buttons[u]||f.blankHeaderOpts,d={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};a.call(y,i,c,e).call(S,i,d,p),s.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(A,String(h(r,i)?-1:i._index)),g(e,t,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(k,i)})),o.setTranslate(t,l.lx,l.ly)}function g(e,t,r,a,o){r||(r=t).attr("pointer-events","all");var l=function(e){return-1===+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),d=c.enter().append("g").classed(u,!0),p=c.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,m=0,g=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?m=g.headerHeight+f.gapButtonHeader:h=g.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(m=-f.gapButtonHeader+f.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-g.openWidth);var b={x:g.lx+h+o.pad.l,y:g.ly+m+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:b.x+o.borderwidth,t:b.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(y,o,s,e).call(S,o,b),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(v(e,o,0,t,r,a,-1),i.executeAPICommand(e,s.method,s.args2)):(v(e,o,0,t,r,a,l),i.executeAPICommand(e,s.method,s.args))),e.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(k,o),c.call(_,o)}))})),c.call(_,o),x?(T.w=Math.max(g.openWidth,g.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(g.openHeight,g.headerHeight)),T.direction=o.direction,a&&(c.size()?function(e,t,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,d=i._dims,p=i.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,p);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),c=0;cw,M=s.barLength+2*s.barPad,S=s.barWidth+2*s.barPad,A=h,C=m+g;C+S>u&&(C=u-S);var E=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),T?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:A,y:C,width:M,height:S}),this._hbarXMin=A+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=g>k,L=s.barWidth+2*s.barPad,I=s.barLength+2*s.barPad,R=h+v,O=m;R+L>l&&(R=l-L);var D=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),P?(this.vbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:R,y:O,width:L,height:I}),this._vbarYMin=O+I/2,this._vbarTranslateMax=k-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,F=c-.5,j=P?f+L+.5:f+.5,N=d-.5,Z=T?p+S+.5:p+.5,B=o._topdefs.selectAll("#"+z).data(T||P?[0]:[]);if(B.exit().remove(),B.enter().append("clipPath").attr("id",z).append("rect"),T||P?(this._clipRect=B.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(Z)-Math.floor(N)}),this.container.call(a.setClipUrl,z,this.gd),this.bg.attr({x:h,y:m,width:v,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),T||P){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(U),P&&this.vbar.on(".drag",null).call(U)}this.setTranslate(t,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},s.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},s.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,i=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=t+this._vbarYMin,s=a+this._vbarTranslateMax;t=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(e,t)},s.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(a.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var i=e/r;this.hbar.call(a.setTranslate,e+i*this._hbarTranslateMax,t)}if(this.vbar){var s=t/n;this.vbar.call(a.setTranslate,e,t+s*this._vbarTranslateMax)}}},18783:function(e){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},24695:function(e){"use strict";e.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},22372:function(e){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},31562:function(e){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},74808:function(e){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},29659:function(e){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},87381:function(e){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},37822:function(e){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},50606:function(e){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},32396:function(e,t){"use strict";t.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],t.STYLE=t.CSS_DECLARATIONS.map((function(e){return e.join(": ")+"; "})).join("")},77922:function(e,t){"use strict";t.xmlns="http://www.w3.org/2000/xmlns/",t.svg="http://www.w3.org/2000/svg",t.xlink="http://www.w3.org/1999/xlink",t.svgAttrs={xmlns:t.svg,"xmlns:xlink":t.xlink}},8729:function(e,t,r){"use strict";t.version=r(11506).version,r(7417),r(98847);for(var n=r(73972),i=t.register=n.register,a=r(10641),o=Object.keys(a),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},99863:function(e,t){"use strict";t.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},t.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},t.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},t.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},t.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},t.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},26348:function(e,t,r){"use strict";var n=r(64872),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(e){return Math.abs(e[1]-e[0])>s-1e-14}function u(e,t){return a(t-e,s)}function c(e,t){if(l(t))return!0;var r,n;t[0](n=i(n,s))&&(n+=s);var a=i(e,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(e,t,r,n,i,a,u){i=i||0,a=a||0;var c,f,d,p,h,v=l([r,n]);function m(e,t){return[e*Math.cos(t)+i,a-e*Math.sin(t)]}v?(c=0,f=o,d=s):r=i&&e<=a);var i,a},pathArc:function(e,t,r,n,i){return f(null,e,t,r,n,i,0)},pathSector:function(e,t,r,n,i){return f(null,e,t,r,n,i,1)},pathAnnulus:function(e,t,r,n,i,a){return f(e,t,r,n,i,a,1)}}},73627:function(e,t){"use strict";var r=Array.isArray,n=ArrayBuffer,i=DataView;function a(e){return n.isView(e)&&!(e instanceof i)}function o(e){return r(e)||a(e)}function s(e,t,r){if(o(e)){if(o(e[0])){for(var n=r,i=0;ii.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,i){e%1||!n(e)||void 0!==i.min&&ei.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!==typeof e){var i="number"===typeof e;!0!==n.strict&&i?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){i(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return i(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var i=n.regex||c(r);"string"===typeof e&&i.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"===typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"===typeof e){for(var i=e.split("+"),a=0;a=n&&e<=i?e:c}if("string"!==typeof e&&"number"!==typeof e)return c;e=String(e);var u=_(r),g=e.charAt(0);!u||"G"!==g&&"g"!==g||(e=e.substr(1),r="");var w=u&&"chinese"===r.substr(0,7),k=e.match(w?x:y);if(!k)return c;var T=k[1],M=k[3]||"1",S=Number(k[5]||1),A=Number(k[7]||0),C=Number(k[9]||0),E=Number(k[11]||0);if(u){if(2===T.length)return c;var P;T=Number(T);try{var L=m.getComponentMethod("calendars","getCal")(r);if(w){var I="i"===M.charAt(M.length-1);M=parseInt(M,10),P=L.newDate(T,L.toMonthIndex(T,M,I),S)}else P=L.newDate(T,Number(M),S)}catch(O){return c}return P?(P.toJD()-v)*f+A*d+C*p+E*h:c}T=2===T.length?(Number(T)+2e3-b)%100+b:Number(T),M-=1;var R=new Date(Date.UTC(2e3,M,S,A,C));return R.setUTCFullYear(T),R.getUTCMonth()!==M||R.getUTCDate()!==S?c:R.getTime()+E*h},n=t.MIN_MS=t.dateTime2ms("-9999"),i=t.MAX_MS=t.dateTime2ms("9999-12-31 23:59:59.9999"),t.isDateTime=function(e,r){return t.dateTime2ms(e,r)!==c};var k=90*f,T=3*d,M=5*p;function S(e,t,r,n,i){if((t||r||n||i)&&(e+=" "+w(t,2)+":"+w(r,2),(n||i)&&(e+=":"+w(n,2),i))){for(var a=4;i%10===0;)a-=1,i/=10;e+="."+w(i,a)}return e}t.ms2DateTime=function(e,t,r){if("number"!==typeof e||!(e>=n&&e<=i))return c;t||(t=0);var a,o,s,u,y,x,b=Math.floor(10*l(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var A=Math.floor(w/f)+v,C=Math.floor(l(e,f));try{a=m.getComponentMethod("calendars","getCal")(r).fromJD(A).formatDate("yyyy-mm-dd")}catch(E){a=g("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=t=n+f&&e<=i-f))return c;var t=Math.floor(10*l(e+.05,1)),r=new Date(Math.round(e-t/10));return S(a("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},t.cleanDate=function(e,r,n){if(e===c)return r;if(t.isJSDate(e)||"number"===typeof e&&isFinite(e)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",e),r;if(!(e=t.ms2DateTimeLocal(+e))&&void 0!==r)return r}else if(!t.isDateTime(e,n))return s.error("unrecognized date",e),r;return e};var A=/%\d?f/g,C=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function P(e,t,r,n){e=e.replace(A,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(t+.05));if(e=e.replace(C,(function(){return E[r("%q")(i)]})),_(n))try{e=m.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(a){return"Invalid"}return r(e)(i)}var L=[59,59.9,59.99,59.999,59.9999];t.formatDate=function(e,t,r,n,i,a){if(i=_(i)&&i,!t)if("y"===r)t=a.year;else if("m"===r)t=a.month;else{if("d"!==r)return function(e,t){var r=l(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(l(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var i=(100+Math.min(l(e/h,60),L[t])).toFixed(t).substr(1);t>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(e,r)+"\n"+P(a.dayMonthYear,e,n,i);t=a.dayMonth+"\n"+a.year}return P(t,e,n,i)};var I=3*f;t.incrementMonth=function(e,t,r){r=_(r)&&r;var n=l(e,f);if(e=Math.round(e-n),r)try{var i=Math.round(e/f)+v,a=m.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return t%12?a.add(o,t,"m"):a.add(o,t/12,"y"),(o.toJD()-v)*f+n}catch(c){s.error("invalid ms "+e+" in calendar "+r)}var u=new Date(e+I);return u.setUTCMonth(u.getUTCMonth()+t)+n-I},t.findExactDates=function(e,t){for(var r,n,i=0,a=0,s=0,l=0,u=_(t)&&m.getComponentMethod("calendars","getCal")(t),c=0;c0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===s||"FJI"===s?function(e){var t;if(null===u(e))t=e;else for(t=new Array(e.length),i=0;it?r[n++]=[e[i][0]+360,e[i][1]]:i===t?(r[n++]=e[i],r[n++]=[e[i][0],-90]):r[n++]=e[i];var a=d.tester(r);a.pts.pop(),l.push(a)}:function(e){l.push(d.tester(e))},a.type){case"MultiPolygon":for(r=0;ri&&(i=u,t=l)}else t=r;return o.default(t).geometry.coordinates}(c),n.fIn=e,n.fOut=c,s.push(c)}else u.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var d=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+e)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},t.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},t.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r1||v<0||v>1?null:{x:e+l*v,y:t+f*v}}function l(e,t,r,n,i){var a=n*e+i*t;if(a<0)return n*n+i*i;if(a>r){var o=n-e,s=i-t;return o*o+s*s}var l=n*t-i*e;return l*l/r}t.segmentsIntersect=s,t.segmentDistance=function(e,t,r,n,i,a,o,u){if(s(e,t,r,n,i,a,o,u))return 0;var c=r-e,f=n-t,d=o-i,p=u-a,h=c*c+f*f,v=d*d+p*p,m=Math.min(l(c,f,h,i-e,a-t),l(c,f,h,o-e,u-t),l(d,p,v,e-i,t-a),l(d,p,v,r-i,n-a));return Math.sqrt(m)},t.getTextLocation=function(e,t,r,s){if(e===i&&s===a||(n={},i=e,a=s),n[r])return n[r];var l=e.getPointAtLength(o(r-s/2,t)),u=e.getPointAtLength(o(r+s/2,t)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=d,d},t.clearLocationCache=function(){i=null},t.getVisibleSegment=function(e,t,r){var n,i,a=t.left,o=t.right,s=t.top,l=t.bottom,u=0,c=e.getTotalLength(),f=c;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===c&&(i=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var p=d(u);p;){if((u+=p+r)>f)return;p=d(u)}for(p=d(f);p;){if(u>(f-=p+r))return;p=d(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},t.findPointOnPath=function(e,t,r,n){for(var i,a,o,s=(n=n||{}).pathLength||e.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=e.getPointAtLength(0)[r]>e.getPointAtLength(s)[r]?-1:1,f=0,d=0,p=s;f0?p=i:d=i,f++}return a}},81697:function(e,t,r){"use strict";var n=r(92770),i=r(84267),a=r(25075),o=r(21081),s=r(22399).defaultLine,l=r(73627).isArrayOrTypedArray,u=a(s),c=1;function f(e,t){var r=e;return r[3]*=t,r}function d(e){if(n(e))return u;var t=a(e);return t.length?t:u}function p(e){return n(e)?e:c}e.exports={formatColor:function(e,t,r){var n,i,s,h,v,m=e.color,g=l(m),y=l(t),x=o.extractOpts(e),b=[];if(n=void 0!==x.colorscale?o.makeColorScaleFuncFromTrace(e):d,i=g?function(e,t){return void 0===e[t]?u:a(n(e[t]))}:d,s=y?function(e,t){return void 0===e[t]?c:p(e[t])}:p,g||y)for(var _=0;_1?(r*e+r*t)/r:e+t,i=String(n).length;if(i>16){var a=String(t).length;if(i>=String(e).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},71828:function(e,t,r){"use strict";var n=r(39898),i=r(84096).g0,a=r(60721).WU,o=r(92770),s=r(50606),l=s.FP_SAFE,u=-l,c=s.BADNUM,f=e.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var d={};f.warnBadFormat=function(e){var t=String(e);d[t]||(d[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=a(f.adjustFormat(e))}catch(r){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=r(65487),f.keyedContainer=r(66636),f.relativeAttr=r(6962),f.isPlainObject=r(41965),f.toLogRange=r(58163),f.relinkPrivateKeys=r(51332);var p=r(73627);f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var h=r(64872);f.mod=h.mod,f.modHalf=h.modHalf;var v=r(96554);f.valObjectMeta=v.valObjectMeta,f.coerce=v.coerce,f.coerce2=v.coerce2,f.coerceFont=v.coerceFont,f.coercePattern=v.coercePattern,f.coerceHoverinfo=v.coerceHoverinfo,f.coerceSelectionMarkerOpacity=v.coerceSelectionMarkerOpacity,f.validate=v.validate;var m=r(41631);f.dateTime2ms=m.dateTime2ms,f.isDateTime=m.isDateTime,f.ms2DateTime=m.ms2DateTime,f.ms2DateTimeLocal=m.ms2DateTimeLocal,f.cleanDate=m.cleanDate,f.isJSDate=m.isJSDate,f.formatDate=m.formatDate,f.incrementMonth=m.incrementMonth,f.dateTick0=m.dateTick0,f.dfltRange=m.dfltRange,f.findExactDates=m.findExactDates,f.MIN_MS=m.MIN_MS,f.MAX_MS=m.MAX_MS;var g=r(65888);f.findBin=g.findBin,f.sorterAsc=g.sorterAsc,f.sorterDes=g.sorterDes,f.distinctVals=g.distinctVals,f.roundUp=g.roundUp,f.sort=g.sort,f.findIndexOfMin=g.findIndexOfMin,f.sortObjectKeys=r(78607);var y=r(80038);f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var x=r(35657);f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=r(26348);f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=r(99863);f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=r(87642);f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var k=r(1426);f.extendFlat=k.extendFlat,f.extendDeep=k.extendDeep,f.extendDeepAll=k.extendDeepAll,f.extendDeepNoArrays=k.extendDeepNoArrays;var T=r(47769);f.log=T.log,f.warn=T.warn,f.error=T.error;var M=r(30587);f.counterRegex=M.counter;var S=r(79990);f.throttle=S.throttle,f.throttleDone=S.done,f.clearThrottle=S.clear;var A=r(24401);function C(e){var t={};for(var r in e)for(var n=e[r],i=0;il||e=t)&&o(e)&&e>=0&&e%1===0},f.noop=r(64213),f.identity=r(23389),f.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,i){for(var a=e.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):e(t,r,n,(i||0)+1):l},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,i,a,o=e.length,s=2*o,l=2*t-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=e[i]*u[n];c[r]=a}return c},f.syncOrAsync=function(e,t,r){var n;function i(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(i);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,i,a=!1,o=!0;for(n=0;n0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var D=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var i;return D.test(n)?i=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var z={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return B.apply(z,arguments)};var F={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return B.apply(F,arguments)};var j=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,N={max:10,count:0,name:"texttemplate",parseMultDiv:!0};f.texttemplateStringForShapes=function(){return B.apply(N,arguments)};var Z=/^[:|\|]/;function B(e,t,r){var n=this,a=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,s,l){var u="_xother"===s||"_yother"===s,c="_xother_"===s||"_yother_"===s,d="xother_"===s||"yother_"===s,p="xother"===s||"yother"===s||u||d||c,h=s;(u||c)&&(h=h.substring(1)),(d||c)&&(h=h.substring(0,h.length-1));var v,m,g,y=null,x=null;if(n.parseMultDiv){var b=function(e){var t=e.match(j);return t?{key:t[1],op:t[2],number:Number(t[3])}:{key:e,op:null,number:null}}(h);h=b.key,y=b.op,x=b.number}if(p){if(void 0===(v=t[h]))return""}else for(g=3;g=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var V=2e9;f.seedPseudoRandom=function(){V=2e9},f.pseudoRandom=function(){var e=V;return V=(69069*V+1)%4294967296,Math.abs(V-e)<429496729?f.pseudoRandom():V/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},i=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(e,t,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(u=1):u=0,f.strTranslate(i-u*(r+o),a-u*(n+s))+f.strScale(u)+(l?"rotate("+l+(t?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(e,t){e.attr("transform",f.getTextTransform(t)),e.style("display",t.scale?null:"none")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var U=f.getFirefoxVersion(),H=null!==U&&U<86;f.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},41965:function(e){"use strict";e.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},66636:function(e,t,r){"use strict";var n=r(65487),i=/^\w*$/;e.exports=function(e,t,r,a){var o,s,l;r=r||"name",a=a||"value";var u={};t&&t.length?(l=n(e,t),s=l.get()):s=e,t=t||"";var c={};if(s)for(o=0;o2)return u[t]=2|u[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},a.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},a.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},77310:function(e,t,r){"use strict";var n=r(39898);e.exports=function(e,t,r){var i=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=e.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(e){e[0][a]=n.select(this)})),i}},35657:function(e,t,r){"use strict";var n=r(79576);t.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},65487:function(e,t,r){"use strict";var n=r(92770),i=r(73627).isArrayOrTypedArray;function a(e,t){return function(){var r,n,o,s,l,u=e;for(s=0;s/g),l=0;la||u===i||us)&&(!t||!l(e))}:function(e,t){var l=e[0],u=e[1];if(l===i||la||u===i||us)return!1;var c,f,d,p,h,v=r.length,m=r[0][0],g=r[0][1],y=0;for(c=1;cMath.max(f,m)||u>Math.max(d,g)))if(uc||Math.abs(n(o,d))>i)return!0;return!1},a.filter=function(e,t){var r=[e[0]],n=0,i=0;function o(o){e.push(o);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u1&&o(e.pop()),{addPt:o,raw:e,filtered:r}}},79749:function(e,t,r){"use strict";var n=r(58617),i=r(98580);e.exports=function(e,t,a){var o=e._fullLayout,s=!0;return o._glcanvas.each((function(n){if(n.regl)n.regl.preloadCachedCode(a);else if(!n.pick||o._has("parcoords")){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||r.g.devicePixelRatio,extensions:t||[],cachedCode:a||{}})}catch(l){s=!1}n.regl||(s=!1),s&&this.addEventListener("webglcontextlost",(function(t){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:t,layer:n.key})}),!1)}})),s||n({container:o._glcontainer.node()}),s}},45142:function(e,t,r){"use strict";var n=r(92770),i=r(35791);e.exports=function(e){var t;if("string"!==typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;return"undefined"!==typeof navigator&&(e=navigator.userAgent),e&&e.headers&&"string"===typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),e}()))return!0;var r=i({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var a=t.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}return r}},75138:function(e){"use strict";e.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;ni.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function f(e,t){return e>=t}t.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-s)-1:Math.floor((e-t.start)/t.size+s);var a,o,d=0,p=t.length,h=0,v=p>1?(t[p-1]-t[0])/(p-1):1;for(o=v>=0?r?l:u:r?f:c,e+=v*s*(r?-1:1)*(v>=0?1:-1);d90&&i.log("Long binary search..."),d-1},t.sorterAsc=function(e,t){return e-t},t.sorterDes=function(e,t){return t-e},t.distinctVals=function(e){var r,n=e.slice();for(n.sort(t.sorterAsc),r=n.length-1;r>-1&&n[r]===o;r--);for(var i,a=n[r]-n[0]||1,s=a/(r||1)/1e4,l=[],u=0;u<=r;u++){var c=n[u],f=c-i;void 0===i?(l.push(c),i=c):f>s&&(a=Math.min(a,f),l.push(c),i=c)}return{vals:l,minDiff:a}},t.roundUp=function(e,t,r){for(var n,i=0,a=t.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},t.findIndexOfMin=function(e,t){t=t||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(r)||(r=!1),i(a[0])){for(l=new Array(o),s=0;se.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},78614:function(e,t,r){"use strict";var n=r(25075);e.exports=function(e){return e?n(e):[0,0,0,1]}},3883:function(e,t,r){"use strict";var n=r(32396),i=r(91424),a=r(71828),o=null;e.exports=function(){if(null!==o)return o;o=!1;var e=a.isIE()||a.isSafari()||a.isIOS();if(window.navigator.userAgent&&!e){var t=Array.from(n.CSS_DECLARATIONS).reverse(),r=window.CSS&&window.CSS.supports||window.supportsCSS;if("function"===typeof r)o=t.some((function(e){return r.apply(null,e)}));else{var s=i.tester.append("image").attr("style",n.STYLE),l=window.getComputedStyle(s.node()).imageRendering;o=t.some((function(e){var t=e[1];return l===t||l===t.toLowerCase()})),s.remove()}}return o}},63893:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=i.strTranslate,o=r(77922),s=r(18783).LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;t.convertToTspans=function(e,r,m){var A=e.text(),C=!e.attr("data-notex")&&r&&r._context.typesetMath&&"undefined"!==typeof MathJax&&A.match(l),L=n.select(e.node().parentNode);if(!L.empty()){var I=e.attr("class")?e.attr("class").split(" ")[0]:"text";return I+="-math",L.selectAll("svg."+I).remove(),L.selectAll("g."+I+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),C?(r&&r._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var a,o,s,l,d=parseInt((MathJax.version||"").split(".")[0]);if(2===d||3===d){var p=function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:f},displayAlign:"left"})},h=function(){o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f},v=function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")},m=function(){"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg")},g=function(){var r="math-output-"+i.randstr({},64),a=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":t.fontSize+"px"}).text(e.replace(u,"\\lt ").replace(c,"\\gt "))).node();return 2===d?MathJax.Hub.Typeset(a):MathJax.typeset([a])},y=function(){var t=l.select(2===d?".MathJax_SVG":".MathJax"),a=!t.empty()&&l.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===d?n.select("body").select("#MathJax_SVG_glyphs"):t.select("defs"),r(t,o,s)}else i.log("There was an error in the tex syntax.",e),r();l.remove()},x=function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)},b=function(){"svg"!==a&&(MathJax.config.startup.output=a)},_=function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)},w=function(){MathJax.config=o};2===d?MathJax.Hub.Queue(p,v,g,y,x,_):3===d&&(h(),m(),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){g(),y(),b(),w()})))}else i.warn("No MathJax version:",MathJax.version)}(C[2],o,(function(n,i,o){L.selectAll("svg."+I).remove(),L.selectAll("g."+I+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return R(),void t();var l=L.append("g").classed(I+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var u=o.width,c=o.height;s.attr({class:I,height:c,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=e.node().style.fill||"black",d=s.select("g");d.attr({fill:f,stroke:f});var p=d.node().getBoundingClientRect(),h=p.width,v=p.height;(h>u||v>c)&&(s.style("overflow","hidden"),h=(p=s.node().getBoundingClientRect()).width,v=p.height);var g=+e.attr("x"),y=+e.attr("y"),x=-(r||e.node().getBoundingClientRect().height)/4;if("y"===I[0])l.attr({transform:"rotate("+[-90,g,y]+")"+a(-h/2,x-v/2)});else if("l"===I[0])y=x-v/2;else if("a"===I[0]&&0!==I.indexOf("atitle"))g=0,y=x;else{var b=e.attr("text-anchor");g-=h*("middle"===b?.5:"end"===b?1:0),y=y+x-v/2}s.attr({x:g,y:y}),m&&m.call(e,l),t(l)}))}))):R(),e}function R(){L.empty()||(I=e.attr("class")+"-math",L.select("svg."+I).remove()),e.text("").style("white-space","pre");var r=function(e,t){t=t.replace(g," ");var r,a=!1,l=[],u=-1;function c(){u++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:u*s+"em"}),e.appendChild(t),r=t;var i=l;if(l=[{node:t}],i.length>1)for(var a=1;a doesnt match end tag <"+e+">. Pretending it did match.",t),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",t)}var C=b.test(t);C?c():(r=e,l=[{node:e}]);for(var L=t.split(y),I=0;I|>|>)/g,f=[["$","$"],["\\(","\\)"]],d={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},v="\u200b",m=["http:","https:","mailto:","",void 0,":"],g=t.NEWLINES=/(\r\n?|\n)/g,y=/(<[^<>]*>)/,x=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;t.BR_TAG_ALL=//gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,w=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,k=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&E(n)}var S=/(^|;)\s*color:/;t.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],i=e.split(y),a=[],o="",s=0,l=0;l3?a.push(u.substr(0,p-3)+"..."):a.push(u.substr(0,p));break}o=""}}return a.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},C=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(e){return e.replace(C,(function(e,t){return("#"===t.charAt(0)?function(e){if(!(e>1114111)){var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function P(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var i=r.protocol,a=n.protocol;return-1!==m.indexOf(i)&&-1!==m.indexOf(a)?t:""}function L(e,t,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var e=o()-c.left,t=a()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(e,t);e=l[0],t=l[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}t.convertEntities=E,t.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,i=[],a=e.split(y),o=0;oa.ts+t?l():a.timer=setTimeout((function(){l(),a.timer=null}),t)},t.done=function(e){var t=r[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},t.clear=function(e){if(e)n(r[e]),delete r[e];else for(var i in r)t.clear(i)}},58163:function(e,t,r){"use strict";var n=r(92770);e.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},90973:function(e,t,r){"use strict";var n=e.exports={},i=r(78776).locationmodeToLayer,a=r(96892).zL;n.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(e,t){return e+t+".json"},n.getTopojsonFeatures=function(e,t){var r=i[e.locationmode],n=t.objects[r];return a(t,n).features}},37815:function(e){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},92177:function(e){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},14458:function(e,t,r){"use strict";var n=r(73972);e.exports=function(e){for(var t,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=e.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},t.cleanLayout=function(e){var r,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,d=(s.subplotsRegistry.gl3d||{}).attrRegex,v=Object.keys(e);for(r=0;r3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),u.clean(e),e.template&&e.template.layout&&t.cleanLayout(e.template.layout),e},t.cleanData=function(e){for(var r=0;r0)return e.substr(0,t)}t.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];t.clearAxisTypes=function(e,t,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))t.set(null);else{if(!Array.isArray(y))return a.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!v&&(d(m,g),p(e),!0)}var x,b,_,w,k,T,M,S,A=Object.keys(r).map(Number).sort(o),C=t.get(),E=C||[],P=c(g,f).get(),L=[],I=-1,R=E.length;for(x=0;xE.length-(M?0:1))a.warn("index out of range",f,_);else if(void 0!==T)k.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(T)?L.push(_):M?("add"===T&&(T={}),E.splice(_,0,T),P&&P.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,T),-1===I&&(I=_);else for(b=0;b=0;x--)E.splice(L[x],1),P&&P.splice(L[x],1);if(E.length?C||t.set(E):t.set(null),v)return!1;if(d(m,g),h!==i){var O;if(-1===I)O=A;else{for(R=Math.max(E.length,R),O=[],x=0;x=I);x++)O.push(_);for(x=I;x=e.data.length||i<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(i,n+1)>-1||i>=0&&t.indexOf(-e.data.length+i)>-1||i<0&&t.indexOf(e.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function I(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"===typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),L(e,t,"currentIndices"),"undefined"===typeof r||Array.isArray(r)||(r=[r]),"undefined"!==typeof r&&L(e,r,"newIndices"),"undefined"!==typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(e,t,r,n,a){!function(e,t,r,n){var i=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"===typeof r)throw new Error("indices must be an integer or array of integers");for(var a in L(e,r,"indices"),t){if(!Array.isArray(t[a])||t[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==t[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var l=function(e,t,r,n){var a,l,u,c,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=P(r,e.data.length-1),t)for(var v=0;v-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(t,r){e[r]=e[t],delete e[t]}}function B(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"===typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var i=q(e,n),a=i.flags;a.calc&&(e.calcdata=void 0);var s=[d.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(e,a,i)||d.supplyDefaults(e),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&U(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(S)),s.push(d.rehover,d.redrag,d.reselect),u.add(e,B,[e,i.undoit],B,[e,i.redoit]);var l=o.syncOrAsync(s,e);return l&&l.then||(l=Promise.resolve(e)),l.then((function(){return e.emit("plotly_relayout",i.eventData),e}))}function V(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var i in t)if("axrange"!==i&&t[i])return!1;for(var a in r.rangesAltered){var o=p.id2name(a),s=e.layout[o],l=n[o];l.autorange=s.autorange;var u=l._rangeInitial0,c=l._rangeInitial1;if(void 0===u&&void 0!==c||void 0!==u&&void 0===c)return!1;if(s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var f in l._matchGroup)if(f!==a){var d=n[p.id2name(f)];d.autorange=l.autorange,d.range=l.range.slice(),d._input.range=l.range.slice()}}return!0}function U(e,t){var r=t?function(e){var r=[];for(var n in t){var i=p.getFromId(e,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)t[a]||r.push(a)}return p.draw(e,r,{skipTitle:!0})}:function(e){return p.draw(e,"redraw")};e.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var H=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,W=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function q(e,t){var r,n,i,a=e.layout,l=e._fullLayout,u=l._guiEditing,d=F(l._preGUI,u),h=Object.keys(t),v=p.list(e),m=o.extendDeepAll({},t),g={};for(Z(t),h=Object.keys(t),n=0;n0&&"string"!==typeof R.parts[D];)D--;var j=R.parts[D],N=R.parts[D-1]+"."+j,B=R.parts.slice(0,D).join("."),V=s(e.layout,B).get(),U=s(l,B).get(),q=R.get();if(void 0!==O){S[I]=O,A[I]="reverse"===j?O:z(q);var X=f.getLayoutValObject(l,R.parts);if(X&&X.impliedEdits&&null!==O)for(var K in X.impliedEdits)C(o.relativeAttr(I,K),X.impliedEdits[K]);if(-1!==["width","height"].indexOf(I))if(O){C("autosize",null);var $="height"===I?"width":"height";C($,l[$])}else l[I]=e._initialAutoSize[I];else if("autosize"===I)C("width",O?null:l.width),C("height",O?null:l.height);else if(N.match(H))L(N),s(l,B+"._inputRange").set(null);else if(N.match(W)){L(N),s(l,B+"._inputRange").set(null);var J=s(l,B).get();J._inputDomain&&(J._input.domain=J._inputDomain.slice())}else N.match(G)&&s(l,B+"._inputDomain").set(null);if("type"===j){E=V;var Q="linear"===U.type&&"log"===O,ee="log"===U.type&&"linear"===O;if(Q||ee){if(E&&E.range)if(U.autorange)Q&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var te=E.range[0],re=E.range[1];Q?(te<=0&&re<=0&&C(B+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),C(B+".range[0]",Math.log(te)/Math.LN10),C(B+".range[1]",Math.log(re)/Math.LN10)):(C(B+".range[0]",Math.pow(10,te)),C(B+".range[1]",Math.pow(10,re)))}else C(B+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete l[R.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(e,U,O,C),c.getComponentMethod("images","convertCoords")(e,U,O,C)}else C(B+".autorange",!0),C(B+".range",null);s(l,B+"._inputRange").set(null)}else if(j.match(T)){var ne=s(l,I).get(),ie=(O||{}).type;ie&&"-"!==ie||(ie="linear"),c.getComponentMethod("annotations","convertCoords")(e,ne,ie,C),c.getComponentMethod("images","convertCoords")(e,ne,ie,C)}var ae=b.containerArrayMatch(I);if(ae){r=ae.array,n=ae.index;var oe=ae.property,se=X||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(O)?A[I]=null:b.isRemoveVal(O)?A[I]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",t)),k.update(M,se),g[r]||(g[r]={});var le=g[r][n];le||(le=g[r][n]={}),le[oe]=O,delete t[I]}else"reverse"===j?(V.range?V.range.reverse():(C(B+".autorange",!0),V.range=[1,0]),U.autorange?M.calc=!0:M.plot=!0):("dragmode"===I&&(!1===O&&!1!==q||!1!==O&&!1===q)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===O||"select"===O)&&"lasso"!==q&&"select"!==q||l._has("gl2d")?M.plot=!0:X?k.update(M,X):M.calc=!0,R.set(O))}}for(r in g)b.applyContainerArrayChanges(e,d(a,r),g[r],M,d)||(M.plot=!0);for(var ue in P){var ce=(E=p.getFromId(e,ue))&&E._constraintGroup;if(ce)for(var fe in M.calc=!0,ce)P[fe]||(p.getFromId(e,fe)._constraintShrinkable=!0)}(Y(e)||t.height||t.width)&&(M.plot=!0);var de=l.shapes;for(n=0;n1;)if(n.pop(),void 0!==(r=s(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=i.length?i[0]:i[e]:i}function l(e){return Array.isArray(a)?e>=a.length?a[0]:a[e]:a}function u(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null,function e(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()}()}var h,v,m=0;function g(e){return Array.isArray(i)?m>=i.length?e.transitionOpts=i[m]:e.transitionOpts=i[0]:e.transitionOpts=i,m++,e}var y=[],x=void 0===t||null===t,b=Array.isArray(t);if(x||b||!o.isPlainObject(t)){if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&TT)&&M.push(v);y=M}}y.length>0?function(t){if(0!==t.length){for(var i=0;i=0;n--)if(o.isPlainObject(t[n])){var v=t[n].name,m=(c[v]||h[v]||{}).name,g=t[n].name,y=c[m]||h[m];m&&g&&"number"===typeof g&&y&&M<5&&(M++,o.warn('addFrames: overwriting frame "'+(c[m]||h[m]).name+'" with a frame whose name of type "number" also equates to "'+m+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[v]={name:v},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"===typeof(i=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+e._transitionData._counter++];);if(c[i.name]){for(a=0;a=0;r--)n=t[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=d.modifyFrames,c=d.modifyFrames,f=[e,s],p=[e,a];return u&&u.add(e,l,f,c,p),d.modifyFrames(e,a)},t.addTraces=function e(r,n,i){r=o.getGraphDiv(r);var a,s,l=[],c=t.deleteTraces,f=e,d=[r,l],p=[r,n];for(function(e,t,r){var n,i;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"===typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!_(o))return!1;e=a[i][o]}else e=a[i]}else e=a}}return e}function _(e){return e===Math.round(e)&&e>=0}function w(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry)if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[t[2]],s=3}else{var c=e._module;if(c||(c=(n.modules[e.type||a.type.dflt]||{})._module),!c)return!1;if(!(i=(r=c.attributes)&&r[o])){var f=c.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return b(i,t,s)},t.getLayoutValObject=function(e,t){var r=function(e,t){var r,i,a,s,l=e._basePlotModules;if(l){var u;for(r=0;r=i&&(r._input||{})._templateitemname;s&&(o=i);var l,u=t+"["+o+"]";function c(){l={},s&&(l[u]={},l[u][a]=s)}function f(e,t){s?n.nestedProperty(l[u],e).set(t):l[u+"."+e]=t}function d(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:f,getUpdateObj:d,applyUpdate:function(t,r){t&&f(t,r);var i=d();for(var a in i)n.nestedProperty(e,a).set(i[a])}}}},61549:function(e,t,r){"use strict";var n=r(39898),i=r(73972),a=r(74875),o=r(71828),s=r(63893),l=r(33306),u=r(7901),c=r(91424),f=r(92998),d=r(64168),p=r(89298),h=r(18783),v=r(99082),m=v.enforce,g=v.clean,y=r(71739).doAutoRange,x="start",b="middle",_="end";function w(e,t,r){for(var n=0;n=e[1]||i[1]<=e[0])&&a[0]t[0])return!0}return!1}function k(e){var r,i,s,l,f,v,m=e._fullLayout,g=m._size,y=g.p,x=p.list(e,"",!0);if(m._paperdiv.style({width:e._context.responsive&&m.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":m.width+"px",height:e._context.responsive&&m.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":m.height+"px"}).selectAll(".main-svg").call(c.setSize,m.width,m.height),e._context.setBackground(e,m.paper_bgcolor),t.drawMainTitle(e),d.manage(e),!m._has("cartesian"))return a.previousPromises(e);function b(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-y-n:t._offset+t._length+y+n:g.t+g.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+y+n:t._offset-y-n:g.l+g.w*(e.position||0)+n%1}for(r=0;r.5?"t":"b",o=e._fullLayout.margin[a],s=0;return"paper"===t.yref?s=r+t.pad.t+t.pad.b:"container"===t.yref&&(s=function(e,t,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===e?("top"===r&&(a+=i),a+=n-t*n):("bottom"===r&&(a+=i),a+=t*n),a}(a,n,i,e._fullLayout.height,r)+t.pad.t+t.pad.b),s>o?s:0}(e,r,m);g>0&&(function(e,t,r,n){var i="title.automargin",s=e._fullLayout.title,l=s.y>.5?"t":"b",u={x:s.x,y:s.y,t:0,b:0},c={};"paper"===s.yref&&function(e,t,r,n,i){var a="paper"===t.yref?e._fullLayout._size.h:e._fullLayout.height,s=o.isTopAnchor(t)?n:n-i,l="b"===r?a-s:s;return!(o.isTopAnchor(t)&&"t"===r||o.isBottomAnchor(t)&&"b"===r)&&lk?c.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else c.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var a=t[n],o=v(t,n,r);i(a)?(Array.isArray(t)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),e(a,o)):Array.isArray(a)&&m(a)&&e(a,o)}}({data:p,layout:d},""),c.length)return c.map(g)}},403:function(e,t,r){"use strict";var n=r(92770),i=r(72391),a=r(74875),o=r(71828),s=r(25095),l=r(5900),u=r(70942),c=r(11506).version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(e,t){var r,d,p,h;function v(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!v("width")&&null!==t.width||!v("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!v("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var m={};function g(e,r){return o.coerce(t,m,f,e,r)}var y=g("format"),x=g("width"),b=g("height"),_=g("scale"),w=g("setBackground"),k=g("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var M=o.extendFlat({},d);x?M.width=x:null===t.width&&n(h.width)&&(M.width=h.width),b?M.height=b:null===t.height&&n(h.height)&&(M.height=h.height);var S=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),A=s.getRedrawFunc(T);function C(){return new Promise((function(e){setTimeout(e,s.getDelay(T._fullLayout))}))}function E(){return new Promise((function(e,t){var r=l(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function d(){i.purge(T),document.body.removeChild(T)}if("full-json"===y){var p=a.graphJson(T,!1,"keepdata","object",!0,!0);return p.version=c,p=JSON.stringify(p),d(),e(k?p:s.encodeJSON(p))}if(d(),"svg"===y)return e(k?r:s.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),u({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){i.newPlot(T,r,M,S).then(A).then(C).then(E).then((function(t){e(function(e){return k?e.replace(s.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},84936:function(e,t,r){"use strict";var n=r(71828),i=r(74875),a=r(86281),o=r(72075).dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(e,t,r,i,a,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&i.push(p("unused",a,g.concat(x.length)));var M,S,A,C,E,P=x.length,L=Array.isArray(T);if(L&&(P=Math.min(P,T.length)),2===b.dimensions)for(S=0;Sx[S].length&&i.push(p("unused",a,g.concat(S,x[S].length)));var I=x[S].length;for(M=0;M<(L?Math.min(I,T[S].length):I);M++)A=L?T[S][M]:T,C=y[S][M],E=x[S][M],n.validate(C,A)?E!==C&&E!==+C&&i.push(p("dynamic",a,g.concat(S,M),C,E)):i.push(p("value",a,g.concat(S,M),C))}else i.push(p("array",a,g.concat(S),y[S]));else for(S=0;S1&&d.push(p("object","layout"))),i.supplyDefaults(h);for(var v=h._fullData,m=r.length,g=0;g0&&Math.round(f)===f))return{vals:i};u=f}for(var d=t.calendar,p="start"===l,h="end"===l,v=e[r+"period0"],m=a(v,d)||0,g=[],y=[],x=[],b=i.length,_=0;_M;)T=o(T,-u,d);for(;T<=M;)T=o(T,u,d);k=o(T,-u,d)}else{for(T=m+(w=Math.round((M-m)/c))*c;T>M;)T-=c;for(;T<=M;)T+=c;k=T-c}g[_]=p?k:h?T:(k+T)/2,y[_]=k,x[_]=T}return{vals:g,starts:y,ends:x}}},89502:function(e){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},71739:function(e,t,r){"use strict";var n=r(39898),i=r(92770),a=r(71828),o=r(50606).FP_SAFE,s=r(73972),l=r(91424),u=r(41675),c=u.getFromId,f=u.isLinked;function d(e,t){var r,n,i=[],o=e._fullLayout,s=h(o,t,0),l=h(o,t,1),u=m(e,t),c=u.min,f=u.max;if(0===c.length||0===f.length)return a.simpleMap(t.range,t.r2l);var d=c[0].val,v=f[0].val;for(r=1;r0&&((M=P-s(b)-l(_))>L?S/M>I&&(w=b,k=_,I=S/M):S/P>I&&(w={val:b.val,nopad:1},k={val:_.val,nopad:1},I=S/P));if(d===v){var R=d-1,O=d+1;if(C)if(0===d)i=[0,1];else{var D=(d>0?f:c).reduce((function(e,t){return Math.max(e,l(t))}),0),z=d/(1-Math.min(.5,D/P));i=d>0?[0,z]:[z,0]}else i=E?[Math.max(0,R),Math.max(1,O)]:[R,O]}else C?(w.val>=0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:0,nopad:1})):E&&(w.val-I*s(w)<0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:1,nopad:1})),I=(k.val-w.val-p(t,b.val,_.val))/(P-s(w)-l(k)),i=[w.val-I*s(w),k.val+I*l(k)];return i=T(i,t),t.limitRange&&t.limitRange(),y&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var i=e.locateBreaks(t,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),A=M((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=M(r.vpadplus||r.vpad),E=M(r.vpadminus||r.vpad);if(!k){if(d=1/0,p=-1/0,w)for(n=0;n0&&(d=a),a>p&&a-o&&(d=a),a>p&&a=I;n--)L(n);return{min:h,max:v,opts:r}},concatExtremes:m};var v=3;function m(e,t,r){var n,i,a,o=t._id,s=e._fullData,l=e._fullLayout,u=[],f=[];function d(e,t){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}i(t,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(e.splice(l,1),l--)}if(s){var c=a&&0===t;e.push({val:t,pad:c?0:r,extrapad:!c&&o})}}function b(e){return i(e)&&Math.abs(e)=t}function k(e,t,r){return void 0===t||void 0===r||(t=e.d2l(t))<(r=e.d2l(r))}function T(e,t){if(!t||!t.autorangeoptions)return e;var r=e[0],n=e[1],i=t.autorangeoptions.include;if(void 0!==i){var o=t.d2l(r),s=t.d2l(n);a.isArrayOrTypedArray(i)||(i=[i]);for(var l=0;l=u&&(o=u,r=u),s<=u&&(s=u,n=u)}}return r=function(e,t){var r=t.autorangeoptions;return r&&void 0!==r.minallowed&&k(t,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&k(t,r.clipmin,r.clipmax)?Math.max(e,t.d2l(r.clipmin)):e}(r,t),n=function(e,t){var r=t.autorangeoptions;return r&&void 0!==r.maxallowed&&k(t,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&k(t,r.clipmin,r.clipmax)?Math.min(e,t.d2l(r.clipmax)):e}(n,t),[r,n]}},23074:function(e){"use strict";e.exports=function(e,t,r){var n,i;if(r){var a="reversed"===t||"min reversed"===t||"max reversed"===t;n=r[a?1:0],i=r[a?0:1]}var o=e("autorangeoptions.minallowed",null===i?n:void 0),s=e("autorangeoptions.maxallowed",null===n?i:void 0);void 0===o&&e("autorangeoptions.clipmin"),void 0===s&&e("autorangeoptions.clipmax"),e("autorangeoptions.include")}},89298:function(e,t,r){"use strict";var n=r(39898),i=r(92770),a=r(74875),o=r(73972),s=r(71828),l=s.strTranslate,u=r(63893),c=r(92998),f=r(7901),d=r(91424),p=r(13838),h=r(66287),v=r(50606),m=v.ONEMAXYEAR,g=v.ONEAVGYEAR,y=v.ONEMINYEAR,x=v.ONEMAXQUARTER,b=v.ONEAVGQUARTER,_=v.ONEMINQUARTER,w=v.ONEMAXMONTH,k=v.ONEAVGMONTH,T=v.ONEMINMONTH,M=v.ONEWEEK,S=v.ONEDAY,A=S/2,C=v.ONEHOUR,E=v.ONEMIN,P=v.ONESEC,L=v.MINUS_SIGN,I=v.BADNUM,R={K:"zeroline"},O={K:"gridline",L:"path"},D={K:"minor-gridline",L:"path"},z={K:"tick",L:"path"},F={K:"tick",L:"text"},j={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},N=r(18783),Z=N.MID_SHIFT,B=N.CAP_SHIFT,V=N.LINE_SPACING,U=N.OPPOSITE_SIDE,H=e.exports={};H.setConvert=r(21994);var W=r(4322),G=r(41675),q=G.idSort,Y=G.isLinked;H.id2name=G.id2name,H.name2id=G.name2id,H.cleanId=G.cleanId,H.list=G.list,H.listIds=G.listIds,H.getFromId=G.getFromId,H.getFromTrace=G.getFromTrace;var X=r(71739);H.getAutoRange=X.getAutoRange,H.findExtremes=X.findExtremes;var K=1e-4;function $(e){var t=(e[1]-e[0])*K;return[e[0]-t,e[1]+t]}H.coerceRef=function(e,t,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||("string"===typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(e){return e+" domain"}))),c[u]={valType:"enumerated",values:l.concat(a?"string"===typeof a?[a]:a:[]),dflt:i},s.coerce(e,t,c,u)},H.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},H.coercePosition=function(e,t,r,n,i,a){var o,l;if("range"!==H.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var u=H.getFromId(t,n);l=r(i,a=u.fraction2r(a)),o=u.cleanPos}e[i]=o(l)},H.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?s.ensureNumber:H.getFromId(t,r).cleanPos)(e)},H.redrawComponents=function(e,t){t=t||H.listIds(e);var r=e._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;cr&&f2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},H.saveRangeInitial=function(e,t){for(var r=H.list(e,"",!0),n=!1,i=0;i.3*d||c(n)||c(a))){var p=r.dtick/2;e+=e+po){var l=Number(r.substr(1));a.exactYears>o&&l%12===0?e=H.tickIncrement(e,"M6","reverse")+1.5*S:a.exactMonths>o?e=H.tickIncrement(e,"M1","reverse")+15.5*S:e-=A;var u=H.tickIncrement(e,r);if(u<=n)return u}return e}(y,e,g,u,a)),m=y;m<=c;)m=H.tickIncrement(m,g,!1,a);return{start:t.c2r(y,0,a),end:t.c2r(m,0,a),size:g,_dataSpan:c-u}},H.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var n,a=t.dtick&&i(t._tmin);if(a){var o=H.tickIncrement(t._tmin,t.dtick,!0);n=[t._tmin,.99*o+.01*t._tmin]}else{var l=s.simpleMap(t.range,t.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(e.range=s.simpleMap(n,t.l2r),e._isMinor=!0,H.prepTicks(e,r),a){var u=i(t.dtick),c=i(e.dtick),f=u?t.dtick:+t.dtick.substring(1),d=c?e.dtick:+e.dtick.substring(1);u&&c?te(f,d)?f===2*M&&d===2*S&&(e.dtick=M):f===2*M&&d===3*S?e.dtick=M:f!==M||(t._input.minor||{}).nticks?re(f/d,2.5)?e.dtick=f/2:e.dtick=f:e.dtick=S:"M"===String(t.dtick).charAt(0)?c?e.dtick="M1":te(f,d)?f>=12&&2===d&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?te(f,d)||(e.dtick=re(f/d,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},H.prepTicks=function(e,t){var r=s.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?s.bigFont(e.tickfont.size||12):15,a=e._length/n):(n="y"===e._id.charAt(0)?40:80,a=s.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(a*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(a*=100),e._roughDTick=Math.abs(r[1]-r[0])/a,H.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(i(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),a=H.getTickFormat(e);if(a){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(t=C,o&&!n&&e.dtick=(R?0:1);O--){var D=!O;O?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var z=O?e:s.extendFlat({},e,e.minor);if(D?H.prepMinorTicks(z,e,t):H.prepTicks(z,t),"array"!==z.tickmode)if("sync"!==z.tickmode){var F=$(c),j=F[0],N=F[1],Z=i(z.dtick),B="log"===a&&!(Z||"L"===z.dtick.charAt(0)),V=H.tickFirst(z,t);if(O){if(e._tmin=V,V=N:q<=N;q=H.tickIncrement(q,Y,f,o)){if(O&&U++,z.rangebreaks&&!f){if(q=p)break}if(P.length>h||q===G)break;G=q;var X={value:q};O?(B&&q!==(0|q)&&(X.simpleLabel=!0),l>1&&U%l&&(X.skipLabel=!0),P.push(X)):(X.minor=!0,L.push(X))}}else P=[],v=ae(e);else O?(P=[],v=oe(e)):(L=[],E=oe(e))}if(R&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var K=P.map((function(e){return e.value})),J=[],Q=0;Q0?(a=n-1,o=n):(a=n,o=n);var s,l=e[a].value,u=e[o].value,c=Math.abs(u-l),f=r||c,d=0;f>=y?d=c>=y&&c<=m?c:g:r===b&&f>=_?d=c>=_&&c<=x?c:b:f>=T?d=c>=T&&c<=w?c:k:r===M&&f>=M?d=M:f>=S?d=S:r===A&&f>=A?d=A:r===C&&f>=C&&(d=C),d>=c&&(d=c,s=!0);var p=i+d;if(t.rangebreaks&&d>0){for(var h=0,v=0;v<84;v++){var E=(v+.5)/84;t.maskBreaks(i*(1-E)+E*p)!==I&&h++}(d*=h/84)||(e[n].drop=!0),s&&c>M&&(d=c)}(d>0||0===n)&&(e[n].periodX=i+d/2)}}(P,e,e._definedDelta),e.rangebreaks){var ie="y"===e._id.charAt(0),se=1;"auto"===e.tickmode&&(se=e.tickfont?e.tickfont.size:12);var le=NaN;for(r=P.length-1;r>-1;r--)if(P[r].drop)P.splice(r,1);else{P[r].value=De(P[r].value,e);var ue=e.c2p(P[r].value);(ie?le>ue-se:lep||fep&&(ce.periodX=p),fe10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12===0?"y":"m";else if(t>=S&&a<=10||t>=15*S)e._tickround="d";else if(t>=E&&a<=16||t>=C)e._tickround="M";else if(t>=P&&a<=19||t>=E)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(a,o)-20,e._tickround<0&&(e._tickround=4)}}else if(i(t)||"L"===t.charAt(0)){var s=e.range.map(e.r2d||Number);i(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===e.minexponent?3:e.minexponent;Math.abs(u)>c&&(ye(e.exponentformat)&&!xe(u)?e._tickexponent=3*Math.round((u-1)/3):e._tickexponent=u)}else e._tickround=null}function me(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}H.autoTicks=function(e,t,r){var n;function a(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=s.dateTick0(e.calendar,0);var o=2*t;if(o>g)t/=g,n=a(10),e.dtick="M"+12*he(t,n,se);else if(o>k)t/=k,e.dtick="M"+he(t,1,le);else if(o>S){if(e.dtick=he(t,S,e._hasDayOfWeekBreaks?[1,2,7,14]:ce),!r){var l=H.getTickFormat(e),u="period"===e.ticklabelmode;u&&(e._rawTick0=e.tick0),/%[uVW]/.test(l)?e.tick0=s.dateTick0(e.calendar,2):e.tick0=s.dateTick0(e.calendar,1),u&&(e._dowTick0=e.tick0)}}else o>C?e.dtick=he(t,C,le):o>E?e.dtick=he(t,E,ue):o>P?e.dtick=he(t,P,ue):(n=a(10),e.dtick=he(t,n,se))}else if("log"===e.type){e.tick0=0;var c=s.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var f=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/f,n=a(10),e.dtick="L"+he(t,n,se)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Oe(e)?(e.tick0=0,n=1,e.dtick=he(t,n,pe)):(e.tick0=0,n=a(10),e.dtick=he(t,n,se));if(0===e.dtick&&(e.dtick=1),!i(e.dtick)&&"string"!==typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},H.tickIncrement=function(e,t,r,a){var o=r?-1:1;if(i(t))return s.increment(e,o*t);var l=t.charAt(0),u=o*Number(t.substr(1));if("M"===l)return s.incrementMonth(e,u,a);if("L"===l)return Math.log(Math.pow(10,e)+u)/Math.LN10;if("D"===l){var c="D2"===t?de:fe,f=e+.01*o,d=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},H.tickFirst=function(e,t){var r=e.r2l||Number,a=s.simpleMap(e.range,r,void 0,void 0,t),o=a[1] ")}else e._prevDateHead=l,u+="
"+l;t.text=u}(e,o,r,u):"log"===c?function(e,t,r,n,a){var o=e.dtick,l=t.x,u=e.tickformat,c="string"===typeof o&&o.charAt(0);if("never"===a&&(a=""),n&&"L"!==c&&(o="L3",c="L"),u||"L"===c)t.text=be(Math.pow(10,l),e,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),d=Math.abs(f),p=e.exponentformat;"power"===p||ye(p)&&xe(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":L)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":L)+d:(t.text=be(Math.pow(10,l),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,s.mod(l,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(l<0?.5:.25)))}}(e,o,0,u,v):"category"===c?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r=""),t.text=String(r)}(e,o):"multicategory"===c?function(e,t,r){var n=Math.round(t.x),i=e._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?t.text=o+" - "+a:(t.text=a,t.text2=o)}(e,o,r):Oe(e)?function(e,t,r,n,i){if("radians"!==e.thetaunit||r)t.text=be(t.x,e,i,n);else{var a=t.x/180;if(0===a)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}function r(e,n){return t(n,0)?e:r(n,e%n)}function n(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}var i=n(e),a=e*i,o=Math.abs(r(a,i));return[Math.round(a/o),Math.round(i/o)]}(a);if(o[1]>=100)t.text=be(s.deg2rad(t.x),e,i,n);else{var l=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(t.text=L+t.text)}}}}(e,o,r,u,v):function(e,t,r,n,i){"never"===i?i="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(i="hide"),t.text=be(t.x,e,i,n)}(e,o,0,u,v),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),e.labelalias&&e.labelalias.hasOwnProperty(o.text)){var m=e.labelalias[o.text];"string"===typeof m&&(o.text=m)}if("boundaries"===e.tickson||e.showdividers){var g=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[g(o.x-.5),g(o.x+e.dtick-.5)]}return o},H.hoverLabelText=function(e,t,r){r&&(e=s.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,i=Array.isArray(t)?t[1]:void 0;if(void 0!==i&&i!==n)return H.hoverLabelText(e,n,r)+" - "+H.hoverLabelText(e,i,r);var a="log"===e.type&&n<=0,o=H.tickText(e,e.c2l(a?-n:n),"hover").text;return a?0===n?"0":L+o:o};var ge=["f","p","n","\u03bc","m","","k","M","G","T"];function ye(e){return"SI"===e||"B"===e}function xe(e){return e>14||e<-15}function be(e,t,r,n){var a=e<0,o=t._tickround,l=r||t.exponentformat||"B",u=t._tickexponent,c=H.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:l,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:i(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};ve(d),o=(Number(d._tickround)||0)+4,u=d._tickexponent,t.hoverformat&&(c=t.hoverformat)}if(c)return t._numFormat(c)(e).replace(/-/g,L);var p,h=Math.pow(10,-o)/2;if("none"===l&&(u=0),(e=Math.abs(e))"+p+"":"B"===l&&9===u?e+="B":ye(l)&&(e+=ge[u/3+5])),a?L+e:e}function _e(e,t){if(e){var r=Object.keys(j).reduce((function(e,r){return-1!==t.indexOf(r)&&j[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function we(e,t){for(var r=[],n={},i=0;i1&&r=i.min&&e=n(e))}function s(e,t){var r=null===t[0],n=null===t[1],i=a(e,t[0])>=0,o=a(e,t[1])<=0;return(r||i)&&(n||o)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=0&&i.unshift(i.splice(n,1).shift())}}));var o={false:{left:0,right:0}};return s.syncOrAsync(i.map((function(t){return function(){if(t){var n=H.getFromId(e,t);r||(r={}),r.axShifts=o,r.overlayingShiftedAx=a;var i=H.drawOne(e,n,r);return n._shiftPusher&&je(n,n._fullDepth||0,o,!0),n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),i}}})))},H.drawOne=function(e,t,r){var n,i,l,u=(r=r||{}).axShifts||{},p=r.overlayingShiftedAx||[];t.setScale();var h=e._fullLayout,v=t._id,m=v.charAt(0),g=H.counterLetter(v),y=h._plots[t._mainSubplot];if(y){if(t._shiftPusher=t.autoshift||-1!==p.indexOf(t._id)||-1!==p.indexOf(t.overlaying),t._shiftPusher&"free"===t.anchor){var x=t.linewidth/2||0;"inside"===t.ticks&&(x+=t.ticklen),je(t,x,u,!0),je(t,t.shift||0,u,!1)}!0===r.skipTitle&&void 0!==t._shift||(t._shift=function(e,t){return e.autoshift?t[e.overlaying][e.side]:e.shift||0}(t,u));var b=y[m+"axislayer"],_=t._mainLinePosition,w=_+=t._shift,k=t._mainMirrorPosition,T=t._vals=H.calcTicks(t),M=[t.mirror,w,k].join("_");for(n=0;n0?r.bottom-c:0,f))));var d=0,p=0;if(t._shiftPusher&&(d=Math.max(f,r.height>0?"l"===l?c-r.left:r.right-c:0),t.title.text!==h._dfltTitle[m]&&(p=(t._titleStandoff||0)+(t._titleScoot||0),"l"===l&&(p+=Me(t))),t._fullDepth=Math.max(d,p)),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var v=[0,1],y="number"===typeof t._shift?t._shift:0;if("x"===m){if("b"===l?n[l]=t._depth:(n[l]=t._depth=Math.max(r.width>0?c-r.top:0,f),v.reverse()),r.width>0){var x=r.right-(t._offset+t._length);x>0&&(n.xr=1,n.r=x);var b=t._offset-r.left;b>0&&(n.xl=0,n.l=b)}}else if("l"===l?(t._depth=Math.max(r.height>0?c-r.left:0,f),n[l]=t._depth-y):(t._depth=Math.max(r.height>0?r.right-c:0,f),n[l]=t._depth+y,v.reverse()),r.height>0){var _=r.bottom-(t._offset+t._length);_>0&&(n.yb=0,n.b=_);var w=t._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[v[0]],t.title.text!==h._dfltTitle[m]&&(n[l]+=Me(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(i[u]+=f),!0===t.mirror||"ticks"===t.mirror?i[g]=t._anchorAxis.domain[v[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(i[g]=[t._counterDomainMin,t._counterDomainMax][v[1]]))}le&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"===typeof t.automargin&&(_e(n,t.automargin),_e(i,t.automargin)),a.autoMargin(e,Ce(t),n),a.autoMargin(e,Ee(t),i),a.autoMargin(e,Pe(t),s)})),s.syncOrAsync(oe)}}function ue(e){var r=v+(e||"tick");return S[r]||(S[r]=function(e,t){var r,n,i,a;return e._selections[t].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,e._selections[t].each((function(){var e=Ae(this),t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),i=Math.min(i,t.left),a=Math.max(a,t.right)}))):(r=0,n=0,i=0,a=0),{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(t,r)),S[r]}},H.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],i=e.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)===("x"===r)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},H.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return l(e._offset+e.l2p(t.x),0)}:function(t){return l(0,e._offset+e.l2p(t.x))}},H.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var u=e.side,c=l?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;return(o||n)&&(c+=d*B,f+=(e.linewidth||0)/2),(i||a)&&(c+=(e.linewidth||0)/2,f+=3),s&&"top"===u&&(f-=d*(1-B)),(i||n)&&(c=-c),"bottom"!==u&&"right"!==u||(f=-f),[l?c:0,s?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return l(r+e._offset+e.l2p(ke(t)),n)}:function(t){return l(n,r+e._offset+e.l2p(ke(t)))}},H.makeTickPath=function(e,t,r,n){n||(n={});var i=n.minor;if(i&&!e.minor)return"";var a=void 0!==n.len?n.len:i?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),s=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+s*r)+"v"+a*r:"M"+(t+s*r)+",0h"+a*r},H.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",a=function(e){return-1!==n.indexOf(e)},o=a("top"),l=a("left"),u=a("right"),c=a("bottom")||l||o||u,f=a("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,v=d?e.ticklen:0;if(f?v*=-1:c&&(v=0),d&&(p+=v,r)){var m=s.deg2rad(r);p=v*Math.cos(m)+1,h=v*Math.sin(m)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var g,y,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},k=0,T=e.side,M=e._id.charAt(0),S=e.tickangle;if("x"===M)b=(_=!f&&"bottom"===T||f&&"top"===T)?1:-1,f&&(b*=-1),g=h*b,y=t+p*b,x=_?1:-.2,90===Math.abs(S)&&(f?x+=Z:x=-90===S&&"bottom"===T?B:90===S&&"top"===T?Z:.5,k=Z/2*(S/90)),w.xFn=function(e){return e.dx+g+k*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*x},w.anchorFn=function(e,t){if(c){if(l)return"end";if(u)return"start"}return i(t)&&0!==t&&180!==t?t*b<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===M){if(b=(_=!f&&"left"===T||f&&"right"===T)?1:-1,f&&(b*=-1),g=p,y=h*b,x=0,f||90!==Math.abs(S)||(x=-90===S&&"left"===T||90===S&&"right"===T?B:.5),f){var A=i(S)?+S:0;if(0!==A){var C=s.deg2rad(A);k=Math.abs(Math.sin(C))*B*b,x=0}}w.xFn=function(e){return e.dx+t-(g+e.fontSize*x)*b+k*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*Z},w.anchorFn=function(e,t){return i(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},H.drawTicks=function(e,t,r){r=r||{};var i=t._id+"tick",a=[].concat(t.minor&&t.minor.ticks?r.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?r.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=r.layer.selectAll("path."+i).data(a,Te);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return d.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Fe(t,[z]),o.attr("transform",r.transFn)},H.drawGrid=function(e,t,r){if(r=r||{},"sync"!==t.tickmode){var i=t._id+"grid",a=t.minor&&t.minor.showgrid,o=a?r.vals.filter((function(e){return e.minor})):[],s=t.showgrid?r.vals.filter((function(e){return!e.minor})):[],l=r.counterAxis;if(l&&H.shouldShowZeroLine(e,t,l))for(var u="array"===t.tickmode,c=0;c=0;g--){var y=g?v:m;if(y){var x=y.selectAll("path."+i).data(g?s:o,Te);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),x.attr("transform",r.transFn).attr("d",r.path).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return d.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?h:t._gw)+"px"})).style("display",null),"function"===typeof r.path&&x.attr("d",r.path)}}Fe(t,[O,D])}},H.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",i=H.shouldShowZeroLine(e,t,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:t._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return q(e.id,t.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,t.zerolinecolor||f.defaultLine).style("stroke-width",d.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Fe(t,[R])},H.drawLabels=function(e,t,r){r=r||{};var a=e._fullLayout,o=t._id,c=o.charAt(0),f=r.cls||o+"tick",p=r.vals.filter((function(e){return e.text})),h=r.labelFns,v=r.secondary?0:t.tickangle,m=(t._prevTickAngles||{})[f],g=r.layer.selectAll("g."+f).data(t.showticklabels?p:[],Te),y=[];function x(e,a){e.each((function(e){var o=n.select(this),s=o.select(".text-math-group"),c=h.anchorFn(e,a),f=r.transFn.call(o.node(),e)+(i(a)&&0!==+a?" rotate("+a+","+h.xFn(e)+","+(h.yFn(e)-e.fontSize/2)+")":""),p=u.lineCount(o),v=V*e.fontSize,m=h.heightFn(e,i(a)?+a:0,(p-1)*v);if(m&&(f+=l(0,m)),s.empty()){var g=o.select("text");g.attr({transform:f,"text-anchor":c}),g.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var y=d.bBox(s.node()).width*{end:-.5,start:.5}[c];s.attr("transform",f+l(y,0))}}))}g.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),i=e._promises.length;r.call(u.positionText,h.xFn(t),h.yFn(t)).call(d.font,t.font,t.fontSize,t.fontColor).text(t.text).call(u.convertToTspans,e),e._promises[i]?y.push(e._promises.pop().then((function(){x(r,v)}))):x(r,v)})),Fe(t,[F]),g.exit().remove(),r.repositionOnUpdate&&g.each((function(e){n.select(this).select("text").call(u.positionText,h.xFn(e),h.yFn(e))})),t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===t._id.charAt(0),l=0,u=o?e._fullLayout.width:e._fullLayout.height;if(-1!==r.indexOf("domain")){var c=s.simpleMap(t.range,t.r2l);l=t.l2p(c[0])+t._offset,u=t.l2p(c[1])+t._offset}var f=Math.min(l,u),p=Math.max(l,u),h=t.side,v=1/0,m=-1/0;for(var y in g.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=d.bBox(r.node()),s=0;o?(a.right>p||a.leftp||a.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==e.K||i||l.style("display",null)}))}))}))}))},x(g,m+1?m:v);var b=null;t._selections&&(t._selections[f]=g);var _=[function(){return y.length&&Promise.all(y)}];t.automargin&&a._redrawFromAutoMarginCount&&90===m?(b=90,_.push((function(){x(g,m)}))):_.push((function(){if(x(g,v),p.length&&"x"===c&&!i(v)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,a=[];if(g.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),i=Ae(this),o=d.bBox(i.node());a.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,l=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),u=t.ticklabelposition||"",f=function(e){return-1!==u.indexOf(e)},h=f("top"),m=f("left"),y=f("right"),_=f("bottom")||m||h||y?(t.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===t.type||"realaxis"===t._name;for(e=0;e1)for(n=1;n2*o}(i,t))return"date";var m="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),i=0,o=0,s={},c=0;c2*i}(i,m)?"category":function(e,t){for(var r=e.length,n=0;n=2){var s,u,c="";if(2===o.length)for(s=0;s<2;s++)if(u=_(o[s])){c=g;break}var f=i("pattern",c);if(f===g)for(s=0;s<2;s++)(u=_(o[s]))&&(t.bounds[s]=o[s]=u-1);if(f)for(s=0;s<2;s++)switch(u=o[s],f){case g:if(!n(u))return void(t.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=u;break;case y:if(!n(u))return void(t.enabled=!1);if((u=+u)<0||u>24)return void(t.enabled=!1);t.bounds[s]=o[s]=u}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},t.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},t.isLinked=function(e,t){return a(t,e._axisMatchGroups)||a(t,e._axisConstraintGroups)}},15258:function(e){"use strict";e.exports=function(e,t,r,n){if("category"===t.type){var i,a=e.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=t.categoryorder="trace"),"trace"===l?t._initialCategories=[]:"array"===l?t._initialCategories=s.slice():(s=function(e,t){var r,n,i,a=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+e*t:o}function m(e,t){for(var r=t._size,n=r.h/r.w,i={},a=Object.keys(e),o=0;ou*x)||k)for(r=0;rR&&FL&&(L=F);d/=(L-P)/(2*I),P=l.l2r(P),L=l.l2r(L),l.range=l._input.range=A=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function N(e,t,r,n,i){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(r,n)).attr("d",i+"Z")}function Z(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(t,r)).attr("d","M0,0Z")}function B(e,t,r,n,i,a){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),V(e,t,i,a)}function V(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function U(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function H(e){I&&e.data&&e._context.showTips&&(i.notifier(i._(e,"Double-click to zoom back out"),"long"),I=!1)}function W(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,L)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n,a){for(var o,s,l,u,c=!1,f={},d={},p=(a||{}).xaHash,h=(a||{}).yaHash,v=0;v=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(U(i),2!==e||ge||He(),me)o.indexOf("select")>-1&&A(r,i,K,$,t.id,Le),o.indexOf("event")>-1&&p.click(i,r,t.id);else if(1===e&&ge){var s=v?R:I,u="s"===v||"w"===g?0:1,f=s._name+".range["+u+"]",d=function(e,t){var r,n=e.range[t],i=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,u),h="left",m="middle";if(s.fixedrange)return;v?(m="n"===v?"top":"bottom","right"===s.side&&(h="right")):"e"===g&&(h="right"),i._context.showAxisRangeEntryBoxes&&n.select(be).call(c.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(d),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:h,verticalAlign:m}).on("edit",(function(e){var t=s.d2r(e);void 0!==t&&l.call("_guiRelayout",i,f,t)}))}}}function Oe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),i=Math.max(0,Math.min(te,he*r+we)),a=Math.abs(n-_e),o=Math.abs(i-we);function s(){Ae="",ke.r=ke.l,ke.t=ke.b,Ee.attr("d","M0,0Z")}if(ke.l=Math.min(_e,n),ke.r=Math.max(_e,n),ke.t=Math.min(we,i),ke.b=Math.max(we,i),re.isSubplotConstrained)a>L||o>L?(Ae="xy",a/ee>o/te?(o=a*te/ee,we>i?ke.t=we-o:ke.b=we+o):(a=o*ee/te,_e>n?ke.l=_e-a:ke.r=_e+a),Ee.attr("d",W(ke))):s();else if(ne.isSubplotConstrained)if(a>L||o>L){Ae="xy";var l=Math.min(ke.l/ee,(te-ke.b)/te),u=Math.max(ke.r/ee,(te-ke.t)/te);ke.l=l*ee,ke.r=u*ee,ke.b=(1-l)*te,ke.t=(1-u)*te,Ee.attr("d",W(ke))}else s();else!ae||o0){var c;if(ne.isSubplotConstrained||!ie&&1===ae.length){for(c=0;c1&&(void 0!==a.maxallowed&&se===(a.range[0]1&&(void 0!==o.maxallowed&&le===(o.range[0]b[1]-1/4096&&(t.domain=s),i.noneOrAll(e.domain,t.domain,s),"sync"===t.tickmode&&(t.tickmode="auto")}return r("layer"),t}},89426:function(e,t,r){"use strict";var n=r(59652);e.exports=function(e,t,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(e);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},42449:function(e,t,r){"use strict";var n=r(18783).FROM_BL;e.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var i=[e.r2l(e.range[0]),e.r2l(e.range[1])],a=i[0]+(i[1]-i[0])*r;e.range=e._input.range=[e.l2r(a+(i[0]-a)*t),e.l2r(a+(i[1]-a)*t)],e.setScale()}},21994:function(e,t,r){"use strict";var n=r(39898),i=r(84096).g0,a=r(71828),o=a.numberFormat,s=r(92770),l=a.cleanNumber,u=a.ms2DateTime,c=a.dateTime2ms,f=a.ensureNumber,d=a.isArrayOrTypedArray,p=r(50606),h=p.FP_SAFE,v=p.BADNUM,m=p.LOG_CLIP,g=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=r(41675),k=r(85555),T=k.HOUR_PATTERN,M=k.WEEKDAY_PATTERN;function S(e){return Math.pow(10,e)}function A(e){return null!==e&&void 0!==e}e.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function C(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],i=e.range[1];return.5*(n+i-2*m*Math.abs(n-i))}return v}function E(t,r,n,i){if((i||{}).msUTC&&s(t))return+t;var o=c(t,n||e.calendar);if(o===v){if(!s(t))return v;t=+t;var l=Math.floor(10*a.mod(t+.05,1)),u=Math.round(t-l/10);o=c(new Date(u))+l/10}return o}function P(t,r,n){return u(t,r,n||e.calendar)}function L(t){return e._categories[Math.round(t)]}function I(t){if(A(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"===typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return v}function R(t){if(e._categoriesMap)return e._categoriesMap[t]}function O(e){var t=R(e);return void 0!==t?t:s(e)?+e:void 0}function D(e){return s(e)?+e:R(e)}function z(e,t,r){return n.round(r+t*e,2)}function F(e,t,r){return(e-r)/t}var j=function(t){return s(t)?z(t,e._m,e._b):v},N=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var Z="y"===p;j=function(t){if(!s(t))return v;var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);var n=Z;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,a=i*t,o=0,l=0;lc)){o=a<(u+c)/2?l:l+1;break}o=l+1}var f=e._B[o]||0;return isFinite(f)?z(t,e._m2,f):0},N=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,i=0;ie._rangebreaks[i].pmax&&(n=i+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?C:f,e.l2c="log"===e.type?S:f,e.l2p=j,e.p2l=N,e.c2p="log"===e.type?function(e,t){return j(C(e,t))}:j,e.p2c="log"===e.type?function(e){return S(N(e))}:N,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=l,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(l(t))},e.p2d=e.p2r=N,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return C(l(e),t)},e.r2d=e.r2c=function(e){return S(l(e))},e.d2c=e.r2l=l,e.c2d=e.l2r=f,e.c2r=C,e.l2d=S,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return S(N(e))},e.r2p=function(t){return e.l2p(l(t))},e.p2r=N,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=a.identity,e.d2c=e.r2c=e.d2l=e.r2l=E,e.c2d=e.c2r=e.l2d=e.l2r=P,e.d2p=e.r2p=function(t,r,n){return e.l2p(E(t,0,n))},e.p2d=e.p2r=function(e,t,r){return P(N(e),t,r)},e.cleanPos=function(t){return a.cleanDate(t,v,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=I,e.r2d=e.c2d=e.l2d=L,e.d2r=e.d2l_noadd=O,e.r2c=function(t){var r=D(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=D,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return L(N(e))},e.r2p=e.d2p,e.p2r=N,e.cleanPos=function(e){return"string"===typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=L,e.d2r=e.d2l_noadd=O,e.r2c=function(t){var r=O(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=R,e.l2r=e.c2r=f,e.r2l=O,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return L(N(e))},e.r2p=e.d2p,e.p2r=N,e.cleanPos=function(e){return Array.isArray(e)||"string"===typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var i,o,s=e._traceIndices,l=e._matchGroup;if(l&&0===e._categories.length)for(var u in l)if(u!==r){var c=t[w.id2name(u)];s=s.concat(c._traceIndices)}var f=[[0,{}],[0,{}]],h=[];for(i=0;il[1]&&(i[s?0:1]=n)}},e.cleanRange=function(t,r){e._cleanRange(t,r),e.limitRange(t)},e._cleanRange=function(t,r){r||(r={}),t||(t="range");var n,i,o=a.nestedProperty(e,t).get();if(i=(i="date"===e.type?a.dfltRange(e.calendar):"y"===p?k.DFLTRANGEY:"realaxis"===e._name?[0,1]:r.dfltRange||k.DFLTRANGEX).slice(),"tozero"!==e.rangemode&&"nonnegative"!==e.rangemode||(i[0]=0),o&&2===o.length){var l=null===o[0],u=null===o[1];for("date"!==e.type||e.autorange||(o[0]=a.cleanDate(o[0],v,e.calendar),o[1]=a.cleanDate(o[1],v,e.calendar)),n=0;n<2;n++)if("date"===e.type){if(!a.isDateTime(o[n],e.calendar)){e[t]=i;break}if(e.r2l(o[0])===e.r2l(o[1])){var c=a.constrain(e.r2l(o[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);o[0]=e.l2r(c-1e3),o[1]=e.l2r(c+1e3);break}}else{if(!s(o[n])){if(l||u||!s(o[1-n])){e[t]=i;break}o[n]=o[1-n]*(n?10:.1)}if(o[n]<-h?o[n]=-h:o[n]>h&&(o[n]=h),o[0]===o[1]){var f=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=f,o[1]+=f}}}else a.nestedProperty(e,t).set(i)},e.setScale=function(r){var n=t._size;if(e.overlaying){var i=w.getFromId({_fullLayout:t},e.overlaying);e.domain=i.domain}var a=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(a);var s,l,u=e.r2l(e[a][0],o),c=e.r2l(e[a][1],o),f="y"===p;if(f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks&&(e._rangebreaks=e.locateBreaks(Math.min(u,c),Math.max(u,c)),e._rangebreaks.length)){for(s=0;sc&&(d=!d),d&&e._rangebreaks.reverse();var h=d?-1:1;for(e._m2=h*e._length/(Math.abs(c-u)-e._lBreaks),e._B.push(-e._m2*(f?c:u)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&t=s.min&&(es.max&&(s.max=n),i=!1)}i&&u.push({min:e,max:n})}};for(n=0;nr.duration?(function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function m(t,r){var n=t.plotinfo,i=n.xaxis,l=n.yaxis,u=i._length,c=l._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=a.simpleMap(t.xr0,i.r2l),v=a.simpleMap(t.xr1,i.r2l),m=h[1]-h[0],g=v[1]-v[0];p[0]=(h[0]*(1-r)+r*v[0]-h[0])/(h[1]-h[0])*u,p[2]=u*(1-r+r*g/m),i.range[0]=i.l2r(h[0]*(1-r)+r*v[0]),i.range[1]=i.l2r(h[1]*(1-r)+r*v[1])}else p[0]=0,p[2]=u;if(d){var y=a.simpleMap(t.yr0,l.r2l),x=a.simpleMap(t.yr1,l.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*c,p[3]=c*(1-r+r*_/b),l.range[0]=i.l2r(y[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=c;s.drawOne(e,i,{skipTitle:!0}),s.drawOne(e,l,{skipTitle:!0}),s.redrawComponents(e,[i._id,l._id]);var w=f?u/p[2]:1,k=d?c/p[3]:1,T=f?p[0]:0,M=d?p[1]:0,S=f?p[0]/p[2]*u:0,A=d?p[1]/p[3]*c:0,C=i._offset-S,E=l._offset-A;n.clipRect.call(o.setTranslate,T,M).call(o.setScale,1/w,1/k),n.plot.call(o.setTranslate,C,E).call(o.setScale,w,k),o.setPointGroupScale(n.zoomScalePts,1/w,1/k),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}s.redrawComponents(e)}},951:function(e,t,r){"use strict";var n=r(73972).traceIs,i=r(4322);function a(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=a(e),i=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return i&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}e.exports=function(e,t,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(function(e,t){if("-"===e.type){var r,s=e._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(e,t,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[t])return i;if((i[r+"axis"]||r)===t){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(t,s,l);if(u)if("histogram"!==u.type||l!=={v:"y",h:"x"}[u.orientation||"v"]){var c=l+"calendar",f=u[c],d={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};if("box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(d.noMultiCategory=!0),d.autotypenumbers=e.autotypenumbers,o(u,l)){var p=a(u),h=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,t,s,n+1):t(s,a,o)}}))}t.manageCommandObserver=function(e,r,n,o){var s={},l=!0;r&&r._commandObserver&&(s=r._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=t.hasSimpleAPICommandBindings(e,n,s.lookupTable);if(r&&r._commandObserver){if(u)return s;if(r._commandObserver.remove)return r._commandObserver.remove(),r._commandObserver=null,s}if(u){a(e,u,s.cache),s.check=function(){if(l){var t=a(e,u,s.cache);return t.changed&&o&&void 0!==s.lookupTable[t.value]&&(s.disable(),Promise.resolve(o({value:t.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[t.value]})).then(s.enable,s.enable)),t.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(e){return new S(e)},A.plot=function(e,t,r,n){var i=this;if(n)return i.update(e,t,!0);i._geoCalcData=e,i._fullLayout=t;var a=t[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var u=!1,c=0;c0&&o._module.calcGeoJSON(a,t)}if(!r){if(this.updateProjection(e,t))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(t,n),this.updateDims(t,n),this.updateFx(t,n),h.generalUpdatePerTraceModule(this.graphDiv,this,e,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},A.updateProjection=function(e,t){var r=this.graphDiv,n=t[this.id],l=t._size,c=n.domain,f=n.projection,d=n.lonaxis,p=n.lataxis,h=d._ax,v=p._ax,g=this.projection=function(e){var t=e.projection,r=t.type,n=w.projNames[r];n="geo"+u.titleCase(n);for(var l=(i[n]||s[n])(),c=e._isSatellite?180*Math.acos(1/t.distance)/Math.PI:e._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],d=function(e){return e?l:[]},p=0;pc*Math.PI/180}return!1},l.getPath=function(){return a().projection(l)},l.getBounds=function(e){return l.getPath().bounds(e)},l.precision(w.precision),e._isSatellite&&l.tilt(t.tilt).distance(t.distance),c&&l.clipAngle(c-w.clipPad),l}(n),y=[[l.l+l.w*c.x[0],l.t+l.h*(1-c.y[1])],[l.l+l.w*c.x[1],l.t+l.h*(1-c.y[0])]],x=n.center||{},b=f.rotation||{},_=d.range||[],k=p.range||[];if(n.fitbounds){h._length=y[1][0]-y[0][0],v._length=y[1][1]-y[0][1],h.range=m(r,h),v.range=m(r,v);var T=(h.range[0]+h.range[1])/2,M=(v.range[0]+v.range[1])/2;if(n._isScoped)x={lon:T,lat:M};else if(n._isClipped){x={lon:T,lat:M},b={lon:T,lat:M,roll:b.roll};var S=f.type,A=w.lonaxisSpan[S]/2||180,E=w.lataxisSpan[S]/2||90;_=[T-A,T+A],k=[M-E,M+E]}else x={lon:T,lat:M},b={lon:T,lat:b.lat,roll:b.roll}}g.center([x.lon-b.lon,x.lat-b.lat]).rotate([-b.lon,-b.lat,b.roll]).parallels(f.parallels);var P=C(_,k);g.fitExtent(y,P);var L=this.bounds=g.getBounds(P),I=this.fitScale=g.scale(),R=g.translate();if(n.fitbounds){var O=g.getBounds(C(h.range,v.range)),D=Math.min((L[1][0]-L[0][0])/(O[1][0]-O[0][0]),(L[1][1]-L[0][1])/(O[1][1]-O[0][1]));isFinite(D)?g.scale(D*I):u.warn("Something went wrong during"+this.id+"fitbounds computations.")}else g.scale(f.scale*I);var z=this.midPt=[(L[0][0]+L[1][0])/2,(L[0][1]+L[1][1])/2];if(g.translate([R[0]+(z[0]-R[0]),R[1]+(z[1]-R[1])]).clipExtent(L),n._isAlbersUsa){var F=g([x.lon,x.lat]),j=g.translate();g.translate([j[0]-(F[0]-j[0]),j[1]-(F[1]-j[1])])}},A.updateBaseLayers=function(e,t){var r=this,i=r.topojson,a=r.layers,o=r.basePaths;function s(e){return"lonaxis"===e||"lataxis"===e}function l(e){return Boolean(w.lineLayers[e])}function u(e){return Boolean(w.fillLayers[e])}var c=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(e){return l(e)||u(e)?t["show"+e]:!s(e)||t[e].showgrid})),p=r.framework.selectAll(".layer").data(c,String);p.exit().each((function(e){delete a[e],delete o[e],n.select(this).remove()})),p.enter().append("g").attr("class",(function(e){return"layer "+e})).each((function(e){var t=a[e]=n.select(this);"bg"===e?r.bgRect=t.append("rect").style("pointer-events","all"):s(e)?o[e]=t.append("path").style("fill","none"):"backplot"===e?t.append("g").classed("choroplethlayer",!0):"frontplot"===e?t.append("g").classed("scatterlayer",!0):l(e)?o[e]=t.append("path").style("fill","none").style("stroke-miterlimit",2):u(e)&&(o[e]=t.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||u(r)?n.datum(M(i,i.objects[r])):s(r)&&n.datum(function(e,t,r){var n,i,a,o=1e-6,s=2.5,l=t[e],u=w.scopeDefaults[t.scope];"lonaxis"===e?(n=u.lonaxisRange,i=u.lataxisRange,a=function(e,t){return[e,t]}):"lataxis"===e&&(n=u.lataxisRange,i=u.lonaxisRange,a=function(e,t){return[t,e]});var c={type:"linear",range:[n[0],n[1]-o],tick0:l.tick0,dtick:l.dtick};v.setConvert(c,r);var f=v.calcTicks(c);t.isScoped||"lonaxis"!==e||f.pop();for(var d=f.length,p=new Array(d),h=0;h-1&&b(n.event,i,[r.xaxis],[r.yaxis],r.id,c),s.indexOf("event")>-1&&p.click(i,n.event))}))}function f(e){return r.projection.invert([e[0]+r.xaxis._offset,e[1]+r.yaxis._offset])}},A.makeFramework=function(){var e=this,t=e.graphDiv,r=t._fullLayout,i="clip"+r._uid+e.id;e.clipDef=r._clips.append("clipPath").attr("id",i),e.clipRect=e.clipDef.append("rect"),e.framework=n.select(e.container).append("g").attr("class","geo "+e.id).call(d.setClipUrl,i,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},v.setConvert(e.mockAxis,r)},A.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,i=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},u.extendFlat(this.viewInitial,t)},A.render=function(e){this._hasMarkerAngles&&e?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},A._render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?c(r[0],r[1]):null}function i(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",i).attr("transform",n)}},44622:function(e,t,r){"use strict";var n=r(27659).AU,i=r(71828).counterRegex,a=r(69082),o="geo",s=i(o),l={};l[o]={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:r(77519),supplyLayoutDefaults:r(82161),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,i=t._subplots[o],s=0;s0&&L<0&&(L+=360);var I,R,O,D=(P+L)/2;if(!p){var z=h?f.projRotate:[D,0,0];I=r("projection.rotation.lon",z[0]),r("projection.rotation.lat",z[1]),r("projection.rotation.roll",z[2]),r("showcoastlines",!h&&x)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!x&&void 0)&&r("oceancolor")}p?(R=-96.6,O=38.7):(R=h?D:I,O=(E[0]+E[1])/2),r("center.lon",R),r("center.lat",O),v&&(r("projection.tilt"),r("projection.distance")),m&&r("projection.parallels",f.projParallels||[0,60]),r("projection.scale"),r("showland",!!x&&void 0)&&r("landcolor"),r("showlakes",!!x&&void 0)&&r("lakecolor"),r("showrivers",!!x&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",h&&"usa"!==c&&x)&&(r("countrycolor"),r("countrywidth")),("usa"===c||"north america"===c&&50===u)&&(r("showsubunits",x),r("subunitcolor"),r("subunitwidth")),h||r("showframe",x)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete t.projection.scale,h?(delete t.center.lon,delete t.center.lat):g?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}e.exports=function(e,t,r){i(e,t,r,{type:"geo",attributes:s,handleDefaults:u,fullData:r,partition:"y"})}},74455:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=r(73972),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},u={cursor:"auto"};function c(e,t){return n.behavior.zoom().translate(t.translate()).scale(t.scale())}function f(e,t,r){var n=e.id,o=e.graphDiv,s=o.layout,l=s[n],u=o._fullLayout,c=u[n],f={},d={};function p(e,t){f[n+"."+e]=i.nestedProperty(l,e).get(),a.call("_storeDirectGUIEdit",s,u._preGUI,f);var r=i.nestedProperty(c,e);r.get()!==t&&(r.set(t),i.nestedProperty(l,e).set(t),d[n+"."+e]=t)}r(p),p("projection.scale",t.scale()/e.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",d)}function d(e,t){var r=c(0,t);function i(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){t.scale(n.event.scale).translate(n.event.translate),e.render(!0);var r=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(u),f(e,t,i)})),r}function p(e,t){var r,i,a,o,s,d,p,h,v,m=c(0,t),g=2;function y(e){return t.invert(e)}function x(r){var n=t.rotate(),i=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return m.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),i=t.rotate(),a=t.translate(),o=i,s=y(r)})).on("zoom",(function(){if(d=n.mouse(this),function(e){var r=y(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>g||Math.abs(n[1]-e[1])>g}(r))return m.scale(t.scale()),void m.translate(t.translate());t.scale(n.event.scale),t.translate([a[0],n.event.translate[1]]),s?y(d)&&(h=y(d),p=[o[0]+(h[0]-s[0]),i[1],i[2]],t.rotate(p),o=p):s=y(r=d),v=!0,e.render(!0);var l=t.rotate(),u=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":u[0],"geo.center.lat":u[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(u),v&&f(e,t,x)})),m}function h(e,t){var r,i={r:t.rotate(),k:t.scale()},a=c(0,t),d=function(e){for(var t=0,r=arguments.length,i=[];++th?(a=(f>0?90:-90)-p,i=0):(a=Math.asin(f/h)*s-p,i=Math.sqrt(h*h-f*f));var v=180-a-2*p,g=(Math.atan2(d,c)-Math.atan2(u,i))*s,x=(Math.atan2(d,c)-Math.atan2(u,-i))*s,b=m(r[0],r[1],a,g),_=m(r[0],r[1],v,x);return b<=_?[a,g,r[2]]:[v,x,r[2]]}(l,r,f);isFinite(p[0])&&isFinite(p[1])&&isFinite(p[2])||(p=f),t.rotate(p),f=p}}else r=v(t,u=e);d.of(this,arguments)({type:"zoom"})})),e=d.of(this,arguments),p++||e({type:"zoomstart"})})).on("zoomend",(function(){var r;n.select(this).style(u),h.call(a,"zoom",null),r=d.of(this,arguments),--p||r({type:"zoomend"}),f(e,t,g)})).on("zoom.redraw",(function(){e.render(!0);var r=t.rotate();e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})})),n.rebind(a,d,"on")}function v(e,t){var r=e.invert(t);return r&&isFinite(r[0])&&isFinite(r[1])&&function(e){var t=e[0]*o,r=e[1]*o,n=Math.cos(r);return[n*Math.cos(t),n*Math.sin(t),Math.sin(r)]}(r)}function m(e,t,r,n){var i=g(r-e),a=g(n-t);return Math.sqrt(i*i+a*a)}function g(e){return(e%360+540)%360-180}function y(e,t,r){var n=r*o,i=e.slice(),a=0===t?1:0,s=2===t?1:2,l=Math.cos(n),u=Math.sin(n);return i[a]=e[a]*l-e[s]*u,i[s]=e[s]*l+e[a]*u,i}function x(e,t){for(var r=0,n=0,i=e.length;nMath.abs(s)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),u.boxEnd[1]l[3]&&(u.boxEnd[1]=l[3],u.boxEnd[0]=u.boxStart[0]+(l[3]-u.boxStart[1])/Math.abs(_))):(u.boxEnd[0]=u.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),u.boxEnd[0]l[2]&&(u.boxEnd[0]=l[2],u.boxEnd[1]=u.boxStart[1]+(l[2]-u.boxStart[0])*Math.abs(_)))}}else u.boxEnabled?(a=u.boxStart[0]!==u.boxEnd[0],s=u.boxStart[1]!==u.boxEnd[1],a||s?(a&&(m(0,u.boxStart[0],u.boxEnd[0]),e.xaxis.autorange=!1),s&&(m(1,u.boxStart[1],u.boxEnd[1]),e.yaxis.autorange=!1),e.relayoutCallback()):e.glplot.setDirty(),u.boxEnabled=!1,u.boxInited=!1):u.boxInited&&(u.boxInited=!1);break;case"pan":u.boxEnabled=!1,u.boxInited=!1,t?(u.panning||(u.dragStart[0]=n,u.dragStart[1]=i),Math.abs(u.dragStart[0]-n).999&&(m="turntable"):m="turntable")}else m="turntable";r("dragmode",m),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(e,t,r){var i=t._basePlotModules.length>1;o(e,t,r,{type:c,attributes:l,handleDefaults:f,fullLayout:t,font:t.font,fullData:r,getDfltFromLayout:function(t){if(!i)return n.validate(e[t],l[t])?e[t]:void 0},autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,calendar:t.calendar})}},65500:function(e,t,r){"use strict";var n=r(77894),i=r(27670).Y,a=r(1426).extendFlat,o=r(71828).counterRegex;function s(e,t,r){return{x:{valType:"number",dflt:e,editType:"camera"},y:{valType:"number",dflt:t,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},13133:function(e,t,r){"use strict";var n=r(78614),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(e){for(var t=0;t<3;++t){var r=e[i[t]];r.visible?(this.enabled[t]=r.showspikes,this.colors[t]=n(r.spikecolor),this.drawSides[t]=r.spikesides,this.lineWidth[t]=r.spikethickness):(this.enabled[t]=!1,this.drawSides[t]=!1)}},e.exports=function(e){var t=new a;return t.merge(e),t}},96085:function(e,t,r){"use strict";e.exports=function(e){for(var t=e.axesOptions,r=e.glplot.axesPixels,s=e.fullSceneLayout,l=[[],[],[]],u=0;u<3;++u){var c=s[a[u]];if(c._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/e.dataScale[u],Math.abs(c._length)===1/0||isNaN(c._length))l[u]=[];else{c._input_range=c.range.slice(),c.range[0]=r[u].lo/e.dataScale[u],c.range[1]=r[u].hi/e.dataScale[u],c._m=1/(e.dataScale[u]*r[u].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var f=c.tickmode;if("auto"===c.tickmode){c.tickmode="linear";var d=c.nticks||i.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/d)}for(var p=n.calcTicks(c,{msUTC:!0}),h=0;h/g," "));l[u]=p,c.tickmode=f}}for(t.ticks=l,u=0;u<3;++u)for(o[u]=.5*(e.glplot.bounds[0][u]+e.glplot.bounds[1][u]),h=0;h<2;++h)t.bounds[h][u]=e.glplot.bounds[h][u];e.contourLevels=function(e){for(var t=new Array(3),r=0;r<3;++r){for(var n=e[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=e.glplot.getAspectratio();e.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(e)}}),!!u&&{passive:!1}),e.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==e.fullSceneLayout.dragmode&&0!==e.camera.mouseListener.buttons){var t=n();e.graphDiv.emit("plotly_relayouting",t)}})),e.staticMode||e.glplot.canvas.addEventListener("webglcontextlost",(function(r){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:r,layer:e.id})}),!1)),e.glplot.oncontextloss=function(){e.recoverContext()},e.glplot.onrender=function(){e.render()},!0},T.render=function(){var e,t=this,r=t.graphDiv,n=t.svgContainer,i=t.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),b(t),t.glplot.axes.update(t.axesOptions);for(var u=Object.keys(t.traces),c=null,d=t.glplot.selection,v=0;v")):"isosurface"===e.type||"volume"===e.type?(T.valueLabel=p.hoverLabelText(t._mockAxis,t._mockAxis.d2l(d.traceCoordinate[3]),e.valuehoverformat),C.push("value: "+T.valueLabel),d.textLabel&&C.push(d.textLabel),x=C.join("
")):x=d.textLabel;var E={x:d.traceCoordinate[0],y:d.traceCoordinate[1],z:d.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:k};h.appendArrayPointValue(E,_,k),e._module.eventData&&(E=_._module.eventData(E,d,_,{},k));var P={points:[E]};if(t.fullSceneLayout.hovermode){var L=[];h.loneHover({trace:_,x:(.5+.5*y[0]/y[3])*s,y:(.5-.5*y[1]/y[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:x,name:c.name,color:h.castHoverOption(_,k,"bgcolor")||c.color,borderColor:h.castHoverOption(_,k,"bordercolor"),fontFamily:h.castHoverOption(_,k,"font.family"),fontSize:h.castHoverOption(_,k,"font.size"),fontColor:h.castHoverOption(_,k,"font.color"),nameLength:h.castHoverOption(_,k,"namelength"),textAlign:h.castHoverOption(_,k,"align"),hovertemplate:f.castOption(_,k,"hovertemplate"),hovertemplateLabels:f.extendFlat({},E,T),eventData:[E]},{container:n,gd:r,inOut_bbox:L}),E.bbox=L[0]}d.distance<5&&(d.buttons||w)?r.emit("plotly_click",P):r.emit("plotly_hover",P),this.oldEventData=P}else h.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;t.drawAnnotations(t)},T.recoverContext=function(){var e=this;e.glplot.dispose(),requestAnimationFrame((function t(){e.glplot.gl.isContextLost()?requestAnimationFrame(t):e.initializeGLPlot()?e.plot.apply(e,e.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")}))};var S=["xaxis","yaxis","zaxis"];function A(e,t,r){for(var n=e.fullSceneLayout,i=0;i<3;i++){var a=S[i],o=a.charAt(0),s=n[a],l=t[o],u=t[o+"calendar"],c=t["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var d,p=0;p<(c||l.length);p++)if(f.isArrayOrTypedArray(l[p]))for(var h=0;hg[1][o])g[0][o]=-1,g[1][o]=1;else{var I=g[1][o]-g[0][o];g[0][o]-=I/32,g[1][o]+=I/32}if(b=[g[0][o],g[1][o]],b=_(b,l),g[0][o]=b[0],g[1][o]=b[1],l.isReversed()){var R=g[0][o];g[0][o]=g[1][o],g[1][o]=R}}else b=l.range,g[0][o]=l.r2l(b[0]),g[1][o]=l.r2l(b[1]);g[0][o]===g[1][o]&&(g[0][o]-=1,g[1][o]+=1),y[o]=g[1][o]-g[0][o],l.range=[g[0][o],g[1][o]],l.limitRange(),n.glplot.setBounds(o,{min:l.range[0]*p[o],max:l.range[1]*p[o]})}var O=c.aspectmode;if("cube"===O)m=[1,1,1];else if("manual"===O){var D=c.aspectratio;m=[D.x,D.y,D.z]}else{if("auto"!==O&&"data"!==O)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=[1,1,1];for(o=0;o<3;++o){var F=x[u=(l=c[S[o]]).type];z[o]=Math.pow(F.acc,1/F.count)/p[o]}m="data"===O||Math.max.apply(null,z)/Math.min.apply(null,z)<=4?z:[1,1,1]}c.aspectratio.x=f.aspectratio.x=m[0],c.aspectratio.y=f.aspectratio.y=m[1],c.aspectratio.z=f.aspectratio.z=m[2],n.glplot.setAspectratio(c.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=c.aspectmode);var j=c.domain||null,N=t._size||null;if(j&&N){var Z=n.container.style;Z.position="absolute",Z.left=N.l+j.x[0]*N.w+"px",Z.top=N.t+(1-j.y[1])*N.h+"px",Z.width=N.w*(j.x[1]-j.x[0])+"px",Z.height=N.h*(j.y[1]-j.y[0])+"px"}n.glplot.redraw()}},T.destroy=function(){var e=this;e.glplot&&(e.camera.mouseListener.enabled=!1,e.container.removeEventListener("wheel",e.camera.wheelListener),e.camera=null,e.glplot.dispose(),e.container.parentNode.removeChild(e.container),e.glplot=null)},T.getCamera=function(){var e,t=this;return t.camera.view.recalcMatrix(t.camera.view.lastT()),{up:{x:(e=t.camera).up[0],y:e.up[1],z:e.up[2]},center:{x:e.center[0],y:e.center[1],z:e.center[2]},eye:{x:e.eye[0],y:e.eye[1],z:e.eye[2]},projection:{type:!0===e._ortho?"orthographic":"perspective"}}},T.setViewport=function(e){var t,r=this,n=e.camera;r.camera.lookAt.apply(this,[[(t=n).eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]),r.glplot.setAspectratio(e.aspectratio),"orthographic"===n.projection.type!==r.camera._ortho&&(r.glplot.redraw(),r.glplot.clearRGBA(),r.glplot.dispose(),r.initializeGLPlot())},T.isCameraChanged=function(e){var t=this.getCamera(),r=f.nestedProperty(e,this.id+".camera").get();function n(e,t,r,n){var i=["up","center","eye"],a=["x","y","z"];return t[i[r]]&&e[i[r]][a[n]]===t[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(t,r,a,o)){i=!0;break}(!r.projection||t.projection&&t.projection.type!==r.projection.type)&&(i=!0)}return i},T.isAspectChanged=function(e){var t=this.glplot.getAspectratio(),r=f.nestedProperty(e,this.id+".aspectratio").get();return void 0===r||r.x!==t.x||r.y!==t.y||r.z!==t.z},T.saveLayout=function(e){var t,r,n,i,a,o,s=this,l=s.fullLayout,u=s.isCameraChanged(e),d=s.isAspectChanged(e),p=u||d;if(p){var h={};u&&(t=s.getCamera(),n=(r=f.nestedProperty(e,s.id+".camera")).get(),h[s.id+".camera"]=n),d&&(i=s.glplot.getAspectratio(),o=(a=f.nestedProperty(e,s.id+".aspectratio")).get(),h[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",e,l._preGUI,h),u&&(r.set(t),f.nestedProperty(l,s.id+".camera").set(t)),d&&(a.set(i),f.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return p},T.updateFx=function(e,t){var r=this,n=r.camera;if(n)if("orbit"===e)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===e){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,u=o.up.z;if(u/Math.sqrt(s*s+l*l+u*u)<.999){var d=r.id+".camera.up",p={x:0,y:0,z:1},h={};h[d]=p;var v=i.layout;c.call("_storeDirectGUIEdit",v,a._preGUI,h),o.up=p,f.nestedProperty(v,d).set(p)}}else n.keyBindingMode=e;r.fullSceneLayout.hovermode=t},T.toImage=function(e){var t=this;e||(e="png"),t.staticMode&&t.container.appendChild(n),t.glplot.redraw();var r=t.glplot.gl,i=r.drawingBufferWidth,a=r.drawingBufferHeight;r.bindFramebuffer(r.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);r.readPixels(0,0,i,a,r.RGBA,r.UNSIGNED_BYTE,o),function(e,t,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)e[a+l]=Math.min(s*e[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,u=s.getContext("2d",{willReadFrequently:!0}),c=u.createImageData(i,a);switch(c.data.set(o),u.putImageData(c,0,0),e){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return t.staticMode&&t.container.removeChild(n),l},T.setConvert=function(){for(var e=0;e<3;e++){var t=this.fullSceneLayout[S[e]];p.setConvert(t,this.fullLayout),t.setScale=f.noop}},T.make4thDimension=function(){var e=this,t=e.graphDiv._fullLayout;e._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(e._mockAxis,t)},e.exports=k},90060:function(e){"use strict";e.exports=function(e,t,r,n){n=n||e.length;for(var i=new Array(n),a=0;aOpenStreetMap contributors',o=['\xa9 Carto',a].join(" "),s=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),l={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:a,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:o,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:o,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:s,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:s,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},u=n(l);e.exports={requiredVersion:i,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:l,styleValuesNonMapbox:u,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@"+i+"."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",u.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},13056:function(e,t,r){"use strict";var n=r(71828);e.exports=function(e,t){var r=e.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(t)?n.mean(t):t,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}},50101:function(e,t,r){"use strict";var n=r(44517),i=r(71828),a=i.strTranslate,o=i.strScale,s=r(27659).AU,l=r(77922),u=r(39898),c=r(91424),f=r(63893),d=r(10481),p="mapbox",h=t.constants=r(77734);function v(e){return"string"===typeof e&&(-1!==h.styleValuesMapbox.indexOf(e)||0===e.indexOf("mapbox://"))}t.name=p,t.attr="subplot",t.idRoot=p,t.idRegex=t.attrRegex=i.counterRegex(p),t.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},t.layoutAttributes=r(23585),t.supplyLayoutDefaults=r(77882),t.plot=function(e){var t=e._fullLayout,r=e.calcdata,a=t._subplots[p];if(n.version!==h.requiredVersion)throw new Error(h.wrongVersionErrorMsg);var o=function(e,t){var r=e._fullLayout,n=e._context;if(""===n.mapboxAccessToken)return"";for(var a=[],o=[],s=!1,l=!1,u=0;u1&&i.warn(h.multipleTokensErrorMsg),a[0]):(o.length&&i.log(["Listed mapbox access token(s)",o.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(e,a);n.accessToken=o;for(var l=0;lw/2){var k=y.split("|").join("
");b.text(k).attr("data-unformatted",k).call(f.convertToTspans,e),_=c.bBox(b.node())}b.attr("transform",a(-3,8-_.height)),x.insert("rect",".static-attribution").attr({x:-_.width-6,y:-_.height-3,width:_.width+6,height:_.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;_.width+6>w&&(T=w/(_.width+6));var M=[n.l+n.w*d.x[1],n.t+n.h*(1-d.y[0])];x.attr("transform",a(M[0],M[1])+o(T))}},t.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[p],n=0;n0){for(var r=0;r0}function c(e){var t={},r={};switch(e.type){case"circle":n.extendFlat(r,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":n.extendFlat(r,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case"symbol":var i=e.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(t,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":e.color,"text-color":i.textfont.color,"text-opacity":e.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:r}}l.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=u(e)},l.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},l.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},l.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapboxLayerId(this.lookupBelow());null!==t&&this.subplot.map.moveLayer(this.idLayer,t)},l.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,u(e)){var r=function(e){var t,r=e.sourcetype,n=e.source,a={type:r};return"geojson"===r?t="data":"vector"===r?t="string"===typeof n?"url":"tiles":"raster"===r?(t="tiles",a.tileSize=256):"image"===r&&(t="url",a.coordinates=e.coordinates),a[t]=n,e.sourceattribution&&(a.attribution=i(e.sourceattribution)),a}(e);t.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&m(t.originalEvent,n,[r.xaxis],[r.yaxis],r.id,e),i.indexOf("event")>-1&&u.click(n,t.originalEvent)}}},b.updateFx=function(e){var t=this,r=t.map,n=t.gd;if(!t.isStatic){var a,o=e.dragmode;a=function(e,r){r.isRect?(e.range={})[t.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]:(e.lassoPoints={})[t.id]=r.map(u)};var s=t.dragOptions;t.dragOptions=i.extendDeep(s||{},{dragmode:e.dragmode,element:t.div,gd:n,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:a},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),d(o)||f(o)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(e,r,n){p(e,r,n,t.dragOptions,o)},l.init(t.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener("touchstart",t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),r.on("click",t.onClickInPanHandler))}function u(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},b.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},b.updateLayers=function(e){var t,r=e[this.id].layers,n=this.layerList;if(r.length!==n.length){for(t=0;t=t.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=t._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){_.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(e,o),s.text(o.text()&&l.text()?" - ":"")}},_.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=_.graphJson(e,!1,"keepdata"),i.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function S(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,i={};function a(e){for(var r=!0,a=0;a1&&O.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&O.length>15&&0===l.shapes.length&&0===l.images.length,_.linkSubplots(d,l,f,n),_.cleanPlot(d,l,f,n);var N=!(!n._has||!n._has("gl2d")),Z=!(!l._has||!l._has("gl2d")),B=!(!n._has||!n._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||Z;B&&!V?n._bgLayer.remove():V&&!B&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var d=_.layoutAttributes.width.min,p=_.layoutAttributes.height.min;n1,v=!t.height&&Math.abs(r.height-i)>1;(v||h)&&(h&&(r.width=n),v&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),_.sanitizeMargins(r)},_.supplyLayoutModuleDefaults=function(e,t,r,n){var i,a,o,l=s.componentsRegistry,u=t._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(c.subplotSort);for(a=0;a1&&(r.l/=g,r.r/=g)}if(p){var y=(r.t+r.b)/p;y>1&&(r.t/=y,r.b/=y)}var x=void 0!==r.xl?r.xl:r.x,b=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,k=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:x,size:r.l+m},r:{val:b,size:r.r+m},b:{val:k,size:r.b+m},t:{val:w,size:r.t+m}},v[t]=1}else delete h[t],delete v[t];if(!n._replotting)return _.doAutoMargin(e)}},_.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),L(t);var i=t._size,a=t.margin,l={t:0,b:0,l:0,r:0},u=c.extendFlat({},i),f=a.l,d=a.r,h=a.t,v=a.b,m=t._pushmargin,g=t._pushmarginIds,y=t.minreducedwidth,x=t.minreducedheight;if(!1!==a.autoexpand){for(var b in m)g[b]||delete m[b];var w=e._fullLayout._reservedMargin;for(var k in w)for(var T in w[k]){var M=w[k][T];l[T]=Math.max(l[T],M)}for(var S in m.base={l:{val:0,size:f},r:{val:1,size:d},t:{val:1,size:h},b:{val:0,size:v}},l){var A=0;for(var C in m)"base"!==C&&o(m[C][S].size)&&(A=m[C][S].size>A?m[C][S].size:A);var E=Math.max(0,a[S]-A);l[S]=Math.max(0,l[S]-E)}for(var P in m){var I=m[P].l||{},R=m[P].b||{},O=I.val,D=I.size,z=R.val,F=R.size,j=r-l.r-l.l,N=n-l.t-l.b;for(var Z in m){if(o(D)&&m[Z].r){var B=m[Z].r.val,V=m[Z].r.size;if(B>O){var U=(D*B+(V-j)*O)/(B-O),H=(V*(1-O)+(D-j)*(1-B))/(B-O);U+H>f+d&&(f=U,d=H)}}if(o(F)&&m[Z].t){var W=m[Z].t.val,G=m[Z].t.size;if(W>z){var q=(F*W+(G-N)*z)/(W-z),Y=(G*(1-z)+(F-N)*(1-W))/(W-z);q+Y>v+h&&(v=q,h=Y)}}}}}var X=c.constrain(r-a.l-a.r,2,y),K=c.constrain(n-a.t-a.b,2,x),$=Math.max(0,r-X),J=Math.max(0,n-K);if($){var Q=(f+d)/$;Q>1&&(f/=Q,d/=Q)}if(J){var ee=(v+h)/J;ee>1&&(v/=ee,h/=ee)}if(i.l=Math.round(f)+l.l,i.r=Math.round(d)+l.r,i.t=Math.round(h)+l.t,i.b=Math.round(v)+l.b,i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!t._replotting&&(_.didMarginChange(u,i)||function(e){if("_redrawFromAutoMarginCount"in e._fullLayout)return!1;var t=p.list(e,"",!0);for(var r in t)if(t[r].autoshift||t[r].shift)return!0;return!1}(e))){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var te=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return s.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){var t;o++,n||o!==a||(t=i,e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)))}}r.runFn(l),setTimeout(l())}))}],a=c.syncOrAsync(i,e);return a&&a.then||(a=Promise.resolve()),a.then((function(){return e}))}_.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},_.graphJson=function(e,t,r,n,i,a){(i&&t&&!e._fullData||i&&!t&&!e._fullLayout)&&_.supplyDefaults(e);var o=i?e._fullData:e.data,s=i?e._fullLayout:e.layout,l=(e._transitionData||{})._frames;function u(e,t){if("function"===typeof e)return t?"_function_":null;if(c.isPlainObject(e)){var n,i={};return Object.keys(e).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!==typeof e[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0)return;i[a]=u(e[a],t)}else t&&(i[a]="_function")})),i}return Array.isArray(e)?e.map((function(e){return u(e,t)})):c.isTypedArray(e)?c.simpleMap(e,c.identity):c.isJSDate(e)?c.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=u(s),i)){var d=s._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return l&&(f.frames=u(l)),a&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},_.modifyFrames=function(e,t){var r,n,i,a=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(D(o,u,f),i=0;i1e-10?e:0}function d(e,t,r){t=t||0,r=r||0;for(var n=e.length,i=new Array(n),a=0;a0?r:1/0})),i=n.mod(r+1,t.length);return[t[r],t[i]]},findIntersectionXY:u,findXYatLength:function(e,t,r,n){var i=-t*r,a=t*t+1,o=2*(t*i-r),s=i*i+r*r-e*e,l=Math.sqrt(o*o-4*a*s),u=(-o+l)/(2*a),c=(-o-l)/(2*a);return[[u,t*u+i+n],[c,t*c+i+n]]},clampTiny:f,pathPolygon:function(e,t,r,n,i,a){return"M"+d(c(e,t,r,n),i,a).join("L")},pathPolygonAnnulus:function(e,t,r,n,i,a,o){var s,l;e=90||l>90&&u>=450?1:f<=0&&p<=0?0:Math.max(f,p),t=l<=180&&u>=180||l>180&&u>=540?-1:c>=0&&d>=0?0:Math.min(c,d),r=l<=270&&u>=270||l>270&&u>=630?-1:f>=0&&p>=0?0:Math.min(f,p),n=u>=360?1:c<=0&&d<=0?0:Math.max(c,d),[t,r,n,i]}(h),_=b[2]-b[0],w=b[3]-b[1],k=p/d,T=Math.abs(w/_);k>T?(v=d,x=(p-(m=d*T))/i.h/2,g=[s[0],s[1]],y=[f[0]+x,f[1]-x]):(m=p,x=(d-(v=p/T))/i.w/2,g=[s[0]+x,s[1]-x],y=[f[0],f[1]]),r.xLength2=v,r.yLength2=m,r.xDomain2=g,r.yDomain2=y;var M,S=r.xOffset2=i.l+i.w*g[0],A=r.yOffset2=i.t+i.h*(1-y[1]),C=r.radius=v/_,E=r.innerRadius=r.getHole(t)*C,P=r.cx=S-C*b[0],L=r.cy=A+C*b[3],I=r.cxx=P-S,R=r.cyy=L-A,O=a.side;"counterclockwise"===O?(M=O,O="top"):"clockwise"===O&&(M=O,O="bottom"),r.radialAxis=r.mockAxis(e,t,a,{_id:"x",side:O,_trueSide:M,domain:[E/i.w,C/i.w]}),r.angularAxis=r.mockAxis(e,t,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(e,t),r.updateAngularAxis(e,t),r.updateRadialAxis(e,t),r.updateRadialAxisTitle(e,t),r.xaxis=r.mockCartesianAxis(e,t,{_id:"x",domain:g}),r.yaxis=r.mockCartesianAxis(e,t,{_id:"y",domain:y});var F=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",F).attr("transform",l(I,R)),n.frontplot.attr("transform",l(S,A)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",F).attr("transform",l(P,L)).call(u.fill,t.bgcolor)},N.mockAxis=function(e,t,r,n){var i=o.extendFlat({},r,n);return h(i,t,e),i},N.mockCartesianAxis=function(e,t,r){var n=this,i=n.isSmith,a=r._id,s=o.extendFlat({type:"linear"},r);p(s,e);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var e=n.sectorBBox,r=l[a],i=n.radialAxis._rl,o=(i[1]-i[0])/(1-n.getHole(t));s.range=[e[r[0]]*o,e[r[1]]*o]},s.isPtWithinRange="x"!==a||i?function(){return!0}:function(e){return n.isPtInside(e)},s.setRange(),s.setScale(),s},N.doAutoRange=function(e,t){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(t);v(n,i);var o=i.range;a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")]},N.updateRadialAxis=function(e,t){var r=this,n=r.gd,i=r.layers,a=r.radius,c=r.innerRadius,f=r.cx,p=r.cy,h=r.getRadial(t),v=D(r.getSector(t)[0],360),m=r.radialAxis,g=c90&&v<=270&&(m.tickangle=180);var x=y?function(e){var t=R(r,P([e.x,0]));return l(t[0]-f,t[1]-p)}:function(e){return l(m.l2p(e.x)+c,0)},b=y?function(e){return I(r,e.x,-1/0,1/0)}:function(e){return r.pathArc(m.r2p(e.x)+c)},_=Z(h);if(r.radialTickLayout!==_&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),g){m.setScale();var w=0,k=y?(m.tickvals||[]).filter((function(e){return e>=0})).map((function(e){return d.tickText(m,e,!0,!1)})):d.calcTicks(m),T=y?k:d.clipEnds(m,k),M=d.getTickSigns(m)[2];y&&(("top"===m.ticks&&"bottom"===m.side||"bottom"===m.ticks&&"top"===m.side)&&(M=-M),"top"===m.ticks&&"top"===m.side&&(w=-m.ticklen),"bottom"===m.ticks&&"bottom"===m.side&&(w=m.ticklen)),d.drawTicks(n,m,{vals:k,layer:i["radial-axis"],path:d.makeTickPath(m,0,M),transFn:x,crisp:!1}),d.drawGrid(n,m,{vals:T,layer:i["radial-grid"],path:b,transFn:o.noop,crisp:!1}),d.drawLabels(n,m,{vals:k,layer:i["radial-axis"],transFn:x,labelFns:d.makeLabelFns(m,w)})}var S=r.radialAxisAngle=r.vangles?F(B(z(h.angle),r.vangles)):h.angle,A=l(f,p),C=A+s(-S);V(i["radial-axis"],g&&(h.showticklabels||h.ticks),{transform:C}),V(i["radial-grid"],g&&h.showgrid,{transform:y?"":A}),V(i["radial-line"].select("line"),g&&h.showline,{x1:y?-a:c,y1:0,x2:a,y2:0,transform:C}).attr("stroke-width",h.linewidth).call(u.stroke,h.linecolor)},N.updateRadialAxisTitle=function(e,t,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(t),u=n.id+"title",f=0;if(l.title){var d=c.bBox(n.layers["radial-axis"].node()).height,p=l.title.font.size,h=l.side;f="top"===h?p:"counterclockwise"===h?-(d+.4*p):d+.8*p}var v=void 0!==r?r:n.radialAxisAngle,m=z(v),g=Math.cos(m),y=Math.sin(m),b=o+a/2*g+f*y,_=s-a/2*y+f*g;n.layers["radial-axis-title"]=x.draw(i,u,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:O(i,"Click to enter radial axis title"),attributes:{x:b,y:_,"text-anchor":"middle"},transform:{rotate:-v}})}},N.updateAngularAxis=function(e,t){var r=this,n=r.gd,i=r.layers,a=r.radius,c=r.innerRadius,f=r.cx,p=r.cy,h=r.getAngular(t),v=r.angularAxis,m=r.isSmith;m||(r.fillViewInitialKey("angularaxis.rotation",h.rotation),v.setGeometry(),v.setScale());var g=m?function(e){var t=R(r,P([0,e.x]));return Math.atan2(t[0]-f,t[1]-p)-Math.PI/2}:function(e){return v.t2g(e.x)};"linear"===v.type&&"radians"===v.thetaunit&&(v.tick0=F(v.tick0),v.dtick=F(v.dtick));var y=function(e){return l(f+a*Math.cos(e),p-a*Math.sin(e))},x=m?function(e){var t=R(r,P([0,e.x]));return l(t[0],t[1])}:function(e){return y(g(e))},b=m?function(e){var t=R(r,P([0,e.x])),n=Math.atan2(t[0]-f,t[1]-p)-Math.PI/2;return l(t[0],t[1])+s(-F(n))}:function(e){var t=g(e);return y(t)+s(-F(t))},_=m?function(e){return L(r,e.x,0,1/0)}:function(e){var t=g(e),r=Math.cos(t),n=Math.sin(t);return"M"+[f+c*r,p-c*n]+"L"+[f+a*r,p-a*n]},w=d.makeLabelFns(v,0).labelStandoff,k={xFn:function(e){var t=g(e);return Math.cos(t)*w},yFn:function(e){var t=g(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(w+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*S)},anchorFn:function(e){var t=g(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(e,t,r){var n=g(e);return-.5*(1+Math.sin(n))*r}},T=Z(h);r.angularTickLayout!==T&&(i["angular-axis"].selectAll("."+v._id+"tick").remove(),r.angularTickLayout=T);var M,A=m?[1/0].concat(v.tickvals||[]).map((function(e){return d.tickText(v,e,!0,!1)})):d.calcTicks(v);if(m&&(A[0].text="\u221e",A[0].fontSize*=1.75),"linear"===t.gridshape?(M=A.map(g),o.angleDelta(M[0],M[1])<0&&(M=M.slice().reverse())):M=null,r.vangles=M,"category"===v.type&&(A=A.filter((function(e){return o.isAngleInsideSector(g(e),r.sectorInRad)}))),v.visible){var C="inside"===v.ticks?-1:1,E=(v.linewidth||1)/2;d.drawTicks(n,v,{vals:A,layer:i["angular-axis"],path:"M"+C*E+",0h"+C*v.ticklen,transFn:b,crisp:!1}),d.drawGrid(n,v,{vals:A,layer:i["angular-grid"],path:_,transFn:o.noop,crisp:!1}),d.drawLabels(n,v,{vals:A,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:k})}V(i["angular-line"].select("path"),h.showline,{d:r.pathSubplot(),transform:l(f,p)}).attr("stroke-width",h.linewidth).call(u.stroke,h.linecolor)},N.updateFx=function(e,t){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(e),this.updateRadialDrag(e,t,0),this.updateRadialDrag(e,t,1)),this.updateHoverAndMainDrag(e))},N.updateHoverAndMainDrag=function(e){var t,r,s=this,u=s.isSmith,c=s.gd,f=s.layers,d=e._zoomlayer,p=A.MINZOOM,h=A.OFFEDGE,v=s.radius,x=s.innerRadius,k=s.cx,T=s.cy,M=s.cxx,S=s.cyy,E=s.sectorInRad,P=s.vangles,L=s.radialAxis,I=C.clampTiny,R=C.findXYatLength,O=C.findEnclosingVertexAngles,D=A.cornerHalfWidth,z=A.cornerLen/2,F=m.makeDragger(f,"path","maindrag",!1===e.dragmode?"none":"crosshair");n.select(F).attr("d",s.pathSubplot()).attr("transform",l(k,T)),F.onmousemove=function(e){y.hover(c,e,s.id),c._fullLayout._lasthover=F,c._fullLayout._hoversubplot=s.id},F.onmouseout=function(e){c._dragging||g.unhover(c,e)};var j,N,Z,B,V,U,H,W,G,q={element:F,gd:c,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function Y(e,t){return Math.sqrt(e*e+t*t)}function X(e,t){return Y(e-M,t-S)}function K(e,t){return Math.atan2(S-t,e-M)}function $(e,t){return[e*Math.cos(t),e*Math.sin(-t)]}function J(e,t){if(0===e)return s.pathSector(2*D);var r=z/e,n=t-r,i=t+r,a=Math.max(0,Math.min(e,v)),o=a-D,l=a+D;return"M"+$(o,n)+"A"+[o,o]+" 0,0,0 "+$(o,i)+"L"+$(l,i)+"A"+[l,l]+" 0,0,1 "+$(l,n)+"Z"}function Q(e,t,r){if(0===e)return s.pathSector(2*D);var n,i,a=$(e,t),o=$(e,r),l=I((a[0]+o[0])/2),u=I((a[1]+o[1])/2);if(l&&u){var c=u/l,f=-1/c,d=R(D,c,l,u);n=R(z,f,d[0][0],d[0][1]),i=R(z,f,d[1][0],d[1][1])}else{var p,h;u?(p=z,h=D):(p=D,h=z),n=[[l-p,u-h],[l+p,u-h]],i=[[l-p,u+h],[l+p,u+h]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function ee(e,t){return t=Math.max(Math.min(t,v),x),ep?(e-1&&1===e&&_(t,c,[s.xaxis],[s.yaxis],s.id,q),r.indexOf("event")>-1&&y.click(c,t,s.id)}q.prepFn=function(e,n,a){var l=c._fullLayout.dragmode,f=F.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var p=c._fullLayout._invTransform;t=c._fullLayout._invScaleX,r=c._fullLayout._invScaleY;var h=o.apply3DTransform(p)(n-f.left,a-f.top);if(j=h[0],N=h[1],P){var g=C.findPolygonOffset(v,E[0],E[1],P);j+=M+g[0],N+=S+g[1]}switch(l){case"zoom":q.clickFn=se,u||(q.moveFn=P?ie:re,q.doneFn=ae,function(){Z=null,B=null,V=s.pathSubplot(),U=!1;var e=c._fullLayout[s.id];H=i(e.bgcolor).getLuminance(),(W=m.makeZoombox(d,H,k,T,V)).attr("fill-rule","evenodd"),G=m.makeCorners(d,k,T),w(c)}());break;case"select":case"lasso":b(e,n,a,q,l)}},g.init(q)},N.updateRadialDrag=function(e,t,r){var i=this,u=i.gd,c=i.layers,f=i.radius,d=i.innerRadius,p=i.cx,h=i.cy,v=i.radialAxis,y=A.radialDragBoxSize,x=y/2;if(v.visible){var b,_,k,S=z(i.radialAxisAngle),C=v._rl,E=C[0],P=C[1],L=C[r],I=.75*(C[1]-C[0])/(1-i.getHole(t))/f;r?(b=p+(f+x)*Math.cos(S),_=h-(f+x)*Math.sin(S),k="radialdrag"):(b=p+(d-x)*Math.cos(S),_=h-(d-x)*Math.sin(S),k="radialdrag-inner");var R,O,D,j=m.makeRectDragger(c,k,"crosshair",-x,-x,y,y),N={element:j,gd:u};!1===e.dragmode&&(N.dragmode=!1),V(n.select(j),v.visible&&d0===(r?D>E:Dn?function(e){return e<=0}:function(e){return e>=0};e.c2g=function(r){var n=e.c2l(r)-t;return(s(n)?n:0)+o},e.g2c=function(r){return e.l2c(r+t-o)},e.g2p=function(e){return e*a},e.c2p=function(t){return e.g2p(e.c2g(t))}}}(e,t);break;case"angularaxis":!function(e,t){var r=e.type;if("linear"===r){var i=e.d2c,s=e.c2d;e.d2c=function(e,t){return function(e,t){return"degrees"===t?a(e):e}(i(e),t)},e.c2d=function(e,t){return s(function(e,t){return"degrees"===t?o(e):e}(e,t))}}e.makeCalcdata=function(t,i){var a,o,s=t[i],l=t._length,u=function(r){return e.d2c(r,t.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(a=new Array(l),o=0;o0?1:0}function r(e){var t=e[0],r=e[1];if(!isFinite(t)||!isFinite(r))return[1,0];var n=(t+1)*(t+1)+r*r;return[(t*t+r*r-1)/n,2*r/n]}function n(e,t){var r=t[0],n=t[1];return[r*e.radius+e.cx,-n*e.radius+e.cy]}function i(e,t){return t*e.radius}e.exports={smith:r,reactanceArc:function(e,t,a,o){var s=n(e,r([a,t])),l=s[0],u=s[1],c=n(e,r([o,t])),f=c[0],d=c[1];if(0===t)return["M"+l+","+u,"L"+f+","+d].join(" ");var p=i(e,1/Math.abs(t));return["M"+l+","+u,"A"+p+","+p+" 0 0,"+(t<0?1:0)+" "+f+","+d].join(" ")},resistanceArc:function(e,a,o,s){var l=i(e,1/(a+1)),u=n(e,r([a,o])),c=u[0],f=u[1],d=n(e,r([a,s])),p=d[0],h=d[1];if(t(o)!==t(s)){var v=n(e,r([a,0]));return["M"+c+","+f,"A"+l+","+l+" 0 0,"+(00){for(var n=[],i=0;i=c&&(d.min=0,h.min=0,m.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function v(e,t,r,n){var i=d[t._name];function o(r,n){return a.coerce(e,t,i,r,n)}o("uirevision",n.uirevision),t.type="linear";var p=o("color"),h=p!==i.color.dflt?p:r.font.color,v=t._name.charAt(0).toUpperCase(),m="Component "+v,g=o("title.text",m);t._hovertitle=g===m?g:v,a.coerceFont(o,"title.font",{family:r.font.family,size:a.bigFont(r.font.size),color:h}),o("min"),c(e,t,o,"linear"),l(e,t,o,"linear"),s(e,t,o,"linear"),u(e,t,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:h}),o("tickangle"),o("tickformat")),f(e,t,o,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(e,t,r){o(e,t,r,{type:"ternary",attributes:d,handleDefaults:h,font:t.font,paper_bgcolor:t.paper_bgcolor})}},64380:function(e,t,r){"use strict";var n=r(39898),i=r(84267),a=r(73972),o=r(71828),s=o.strTranslate,l=o._,u=r(7901),c=r(91424),f=r(21994),d=r(1426).extendFlat,p=r(74875),h=r(89298),v=r(28569),m=r(30211),g=r(64505),y=g.freeMode,x=g.rectMode,b=r(92998),_=r(47322).prepSelect,w=r(47322).selectOnClick,k=r(47322).clearOutline,T=r(47322).clearSelectionsCache,M=r(85555);function S(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=S;var A=S.prototype;A.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},A.plot=function(e,t){var r=this,n=t[r.id],i=t._size;r._hasClipOnAxisFalse=!1;for(var a=0;aC*b?i=(a=b)*C:a=(i=x)/C,o=g*i/x,l=y*a/b,r=t.l+t.w*v-i/2,n=t.t+t.h*(1-m)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=_,p.xaxis={type:"linear",range:[w+2*T-_,_-w-2*k],domain:[v-o/2,v+o/2],_id:"x"},f(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(e){return e.a>=p.aaxis.range[0]&&e.a<=p.aaxis.range[1]&&e.b>=p.baxis.range[1]&&e.b<=p.baxis.range[0]&&e.c>=p.caxis.range[1]&&e.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-k-T],domain:[m-l/2,m+l/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var M=p.yaxis.domain[0],S=p.aaxis=d({},e.aaxis,{range:[w,_-k-T],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[M,M+l*C],anchor:"free",position:0,_id:"y",_length:i});f(S,p.graphDiv._fullLayout),S.setScale();var A=p.baxis=d({},e.baxis,{range:[_-w-T,k],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});f(A,p.graphDiv._fullLayout),A.setScale();var E=p.caxis=d({},e.caxis,{range:[_-w-k,T],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[M,M+l*C],anchor:"free",position:0,_id:"y",_length:i});f(E,p.graphDiv._fullLayout),E.setScale();var P="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",P),p.layers.plotbg.select("path").attr("d",P);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",L);var I=s(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),p.clipDefRelative.select("path").attr("transform",null);var R=s(r-A._offset,n+a);p.layers.baxis.attr("transform",R),p.layers.bgrid.attr("transform",R);var O=s(r+i/2,n)+"rotate(30)"+s(0,-S._offset);p.layers.aaxis.attr("transform",O),p.layers.agrid.attr("transform",O);var D=s(r+i/2,n)+"rotate(-30)"+s(0,-E._offset);p.layers.caxis.attr("transform",D),p.layers.cgrid.attr("transform",D),p.drawAxes(!0),p.layers.aline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",A.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),c.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},A.drawAxes=function(e){var t=this,r=t.graphDiv,n=t.id.substr(7)+"title",i=t.layers,a=t.aaxis,o=t.baxis,s=t.caxis;if(t.drawAx(a),t.drawAx(o),t.drawAx(s),e){var u=Math.max(a.showticklabels?a.tickfont.size/2:0,(s.showticklabels?.75*s.tickfont.size:0)+("outside"===s.ticks?.87*s.ticklen:0)),c=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=b.draw(r,"a"+n,{propContainer:a,propName:t.id+".aaxis.title",placeholder:l(r,"Click to enter Component A title"),attributes:{x:t.x0+t.w/2,y:t.y0-a.title.font.size/3-u,"text-anchor":"middle"}}),i["b-title"]=b.draw(r,"b"+n,{propContainer:o,propName:t.id+".baxis.title",placeholder:l(r,"Click to enter Component B title"),attributes:{x:t.x0-c,y:t.y0+t.h+.83*o.title.font.size+c,"text-anchor":"middle"}}),i["c-title"]=b.draw(r,"c"+n,{propContainer:s,propName:t.id+".caxis.title",placeholder:l(r,"Click to enter Component C title"),attributes:{x:t.x0+t.w+c,y:t.y0+t.h+.83*s.title.font.size+c,"text-anchor":"middle"}})}},A.drawAx=function(e){var t,r=this,n=r.graphDiv,i=e._name,a=i.charAt(0),s=e._id,l=r.layers[i],u=a+"tickLayout",c=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);r[u]!==c&&(l.selectAll("."+s+"tick").remove(),r[u]=c),e.setScale();var f=h.calcTicks(e),d=h.clipEnds(e,f),p=h.makeTransTickFn(e),v=h.getTickSigns(e)[2],m=o.deg2rad(30),g=v*(e.linewidth||1)/2,y=v*e.ticklen,x=r.w,b=r.h,_="b"===a?"M0,"+g+"l"+Math.sin(m)*y+","+Math.cos(m)*y:"M"+g+",0l"+Math.cos(m)*y+","+-Math.sin(m)*y,w={a:"M0,0l"+b+",-"+x/2,b:"M0,0l-"+x/2+",-"+b,c:"M0,0l-"+b+","+x/2}[a];h.drawTicks(n,e,{vals:"inside"===e.ticks?d:f,layer:l,path:_,transFn:p,crisp:!1}),h.drawGrid(n,e,{vals:d,layer:r.layers[a+"grid"],path:w,transFn:p,crisp:!1}),h.drawLabels(n,e,{vals:f,layer:l,transFn:p,labelFns:h.makeLabelFns(e,0,30)})};var E=M.MINZOOM/2+.87,P="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(.87*E+4.5)+"l2.6,1.5l-"+E/2+","+.87*E+"Z",L="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-2.6,1.5l"+E/2+","+.87*E+"Z",I="m0,1l"+E/2+","+.87*E+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-"+(E/2+2.6)+","+(.87*E+4.5)+"l2.6,1.5l"+E/2+",-"+.87*E+"Z",R=!0;function O(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}A.clearOutline=function(){T(this.dragOptions),k(this.dragOptions.gd)},A.initInteractions=function(){var e,t,r,n,f,d,p,h,g,b,k,T,S=this,A=S.layers.plotbg.select("path").node(),E=S.graphDiv,D=E._fullLayout._zoomlayer;function z(e){var t={};return t[S.id+".aaxis.min"]=e.a,t[S.id+".baxis.min"]=e.b,t[S.id+".caxis.min"]=e.c,t}function F(e,t){var r=E._fullLayout.clickmode;O(E),2===e&&(E.emit("plotly_doubleclick",null),a.call("_guiRelayout",E,z({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&w(t,E,[S.xaxis],[S.yaxis],S.id,S.dragOptions),r.indexOf("event")>-1&&m.click(E,t,S.id)}function j(e,t){return 1-t/S.h}function N(e,t){return 1-(e+(S.h-t)/Math.sqrt(3))/S.w}function Z(e,t){return(e-(S.h-t)/Math.sqrt(3))/S.w}function B(i,a){var o=r+i*e,s=n+a*t,l=Math.max(0,Math.min(1,j(0,n),j(0,s))),u=Math.max(0,Math.min(1,N(r,n),N(o,s))),c=Math.max(0,Math.min(1,Z(r,n),Z(o,s))),v=(l/2+c)*S.w,m=(1-l/2-u)*S.w,y=(v+m)/2,x=m-v,_=(1-l)*S.h,w=_-x/C;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),T.transition().style("opacity",1).duration(200),b=!0),E.emit("plotly_relayouting",z(p))}function V(){O(E),p!==f&&(a.call("_guiRelayout",E,z(p)),R&&E.data&&E._context.showTips&&(o.notifier(l(E,"Double-click to zoom back out"),"long"),R=!1))}function U(e,t){var r=e/S.xaxis._m,n=t/S.yaxis._m,i=[(p={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,p.b,p.c].sort(o.sorterAsc),a=i.indexOf(p.a),l=i.indexOf(p.b),u=i.indexOf(p.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),p={a:i[a],b:i[l],c:i[u]},t=(f.a-p.a)*S.yaxis._m,e=(f.c-p.c-f.b+p.b)*S.xaxis._m);var d=s(S.x0+e,S.y0+t);S.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",d);var h=s(-e,-t);S.clipDefRelative.select("path").attr("transform",h),S.aaxis.range=[p.a,S.sum-p.b-p.c],S.baxis.range=[S.sum-p.a-p.c,p.b],S.caxis.range=[S.sum-p.a-p.b,p.c],S.drawAxes(!1),S._hasClipOnAxisFalse&&S.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,S),E.emit("plotly_relayouting",z(p))}function H(){a.call("_guiRelayout",E,z(p))}this.dragOptions={element:A,gd:E,plotinfo:{id:S.id,domain:E._fullLayout[S.id].domain,xaxis:S.xaxis,yaxis:S.yaxis},subplot:S.id,prepFn:function(a,l,c){S.dragOptions.xaxes=[S.xaxis],S.dragOptions.yaxes=[S.yaxis],e=E._fullLayout._invScaleX,t=E._fullLayout._invScaleY;var v=S.dragOptions.dragmode=E._fullLayout.dragmode;y(v)?S.dragOptions.minDrag=1:S.dragOptions.minDrag=void 0,"zoom"===v?(S.dragOptions.moveFn=B,S.dragOptions.clickFn=F,S.dragOptions.doneFn=V,function(e,t,a){var l=A.getBoundingClientRect();r=t-l.left,n=a-l.top,E._fullLayout._calcInverseTransform(E);var c=E._fullLayout._invTransform,v=o.apply3DTransform(c)(r,n);r=v[0],n=v[1],f={a:S.aaxis.range[0],b:S.baxis.range[1],c:S.caxis.range[1]},p=f,d=S.aaxis.range[1]-f.a,h=i(S.graphDiv._fullLayout[S.id].bgcolor).getLuminance(),g="M0,"+S.h+"L"+S.w/2+", 0L"+S.w+","+S.h+"Z",b=!1,k=D.append("path").attr("class","zoombox").attr("transform",s(S.x0,S.y0)).style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",g),T=D.append("path").attr("class","zoombox-corners").attr("transform",s(S.x0,S.y0)).style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),S.clearOutline(E)}(0,l,c)):"pan"===v?(S.dragOptions.moveFn=U,S.dragOptions.clickFn=F,S.dragOptions.doneFn=H,f={a:S.aaxis.range[0],b:S.baxis.range[1],c:S.caxis.range[1]},p=f,S.clearOutline(E)):(x(v)||y(v))&&_(a,l,c,S.dragOptions,v)}},A.onmousemove=function(e){m.hover(E,e,S.id),E._fullLayout._lasthover=A,E._fullLayout._hoversubplot=S.id},A.onmouseout=function(e){E._dragging||v.unhover(E,e)},v.init(this.dragOptions)}},73972:function(e,t,r){"use strict";var n=r(47769),i=r(64213),a=r(75138),o=r(41965),s=r(24401).addStyleRule,l=r(1426),u=r(9012),c=r(10820),f=l.extendFlat,d=l.extendDeepAll;function p(e){var r=e.name,i=e.categories,a=e.meta;if(t.modules[r])n.log("Type "+r+" already registered");else{t.subplotsRegistry[e.basePlotModule.name]||function(e){var r=e.name;if(t.subplotsRegistry[r])n.log("Plot type "+r+" already registered.");else for(var i in g(e),t.subplotsRegistry[r]=e,t.componentsRegistry)b(i,e.name)}(e.basePlotModule);for(var o={},l=0;l-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(w)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},75341:function(e,t,r){"use strict";var n=r(71828);e.exports=function(e,t){for(var r=0;rf+u||!n(c))}for(var p=0;pa))return t}return void 0!==r?r:e.dflt},t.coerceColor=function(e,t,r){return i(t).isValid()?t:void 0!==r?r:e.dflt},t.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},t.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:c<0&&(t-=r)}return t}function O(e){var t=c,r=e.b,i=R(e);return n.inbox(r-t,i-t,_+(i-t)/(i-r)-1)}var D=e[f+"a"],z=e[d+"a"];v=Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0]));var F=n.getDistanceFunction(i,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(m,F,e),!1!==e.index&&m[e.index].p!==u){T||(E=function(e){return Math.min(M(e),e.p-y.bargroupwidth/2)},P=function(e){return Math.max(S(e),e.p+y.bargroupwidth/2)});var j=m[e.index],N=g.base?j.b+j.s:j.s;e[d+"0"]=e[d+"1"]=z.c2p(j[d],!0),e[d+"LabelVal"]=N;var Z=y.extents[y.extents.round(j.p)];e[f+"0"]=D.c2p(x?E(j):Z[0],!0),e[f+"1"]=D.c2p(x?P(j):Z[1],!0);var B=void 0!==j.orig_p;return e[f+"LabelVal"]=B?j.orig_p:j.p,e.labelLabel=l(D,e[f+"LabelVal"],g[f+"hoverformat"]),e.valueLabel=l(z,e[d+"LabelVal"],g[d+"hoverformat"]),e.baseLabel=l(z,j.b,g[d+"hoverformat"]),e.spikeDistance=(function(e){var t=c,r=e.b,i=R(e);return n.inbox(r-t,i-t,w+(i-t)/(i-r)-1)}(j)+function(e){return L(M(e),S(e),w)}(j))/2,e[f+"Spike"]=D.c2p(j.p,!0),o(j,g,e),e.hovertemplate=g.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,i=s(e,t);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}e.exports={hoverPoints:function(e,t,r,n,a){var o=c(e,t,r,n,a);if(o){var s=o.cd,l=s[0].trace,u=s[o.index];return o.color=f(l,u),i.getComponentMethod("errorbars","hoverInfo")(u,l,o),[o]}},hoverOnBars:c,getTraceColor:f}},60822:function(e,t,r){"use strict";e.exports={attributes:r(1486),layoutAttributes:r(43641),supplyDefaults:r(90769).supplyDefaults,crossTraceDefaults:r(90769).crossTraceDefaults,supplyLayoutDefaults:r(13957),calc:r(92290),crossTraceCalc:r(11661).crossTraceCalc,colorbar:r(4898),arraysToCalcdata:r(75341),plot:r(17295).plot,style:r(16688).style,styleOnSelect:r(16688).styleOnSelect,hoverPoints:r(95423).hoverPoints,eventData:r(58065),selectPoints:r(81974),moduleType:"trace",name:"bar",basePlotModule:r(93612),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},43641:function(e){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},13957:function(e,t,r){"use strict";var n=r(73972),i=r(89298),a=r(71828),o=r(43641);e.exports=function(e,t,r){function s(r,n){return a.coerce(e,t,o,r,n)}for(var l=!1,u=!1,c=!1,f={},d=s("barmode"),p=0;p0}function A(e){return"auto"===e?0:e}function C(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:e.width*i+e.height*n,y:e.width*n+e.height*i}}function E(e,t,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,u=a.anchor||"end",c="end"===u,f="start"===u,d=((a.leftToRight||0)+1)/2,p=1-d,h=i.width,v=i.height,m=Math.abs(t-e),g=Math.abs(n-r),y=m>2*_&&g>2*_?_:0;m-=2*y,g-=2*y;var x=A(l);"auto"!==l||h<=m&&v<=g||!(h>m||v>g)||(h>g||v>m)&&h.01?W:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?W(e):e>t?Math.ceil(e):Math.floor(e)};N=G(N,Z,z),Z=G(Z,N,z),B=G(B,V,!z),V=G(V,B,!z)}var q=M(a.ensureSingle(R,"path"),L,m,g);if(q.style("vector-effect",I?"none":"non-scaling-stroke").attr("d",isNaN((Z-N)*(V-B))||U&&e._context.staticPlot?"M0,0Z":"M"+N+","+B+"V"+V+"H"+Z+"V"+B+"Z").call(l.setClipUrl,t.layerClipId,e),!L.uniformtext.mode&&F){var Y=l.makePointStyleFns(f);l.singlePointStyle(u,q,f,Y,e)}!function(e,t,r,n,i,s,u,f,p,m,g){var w,k=t.xaxis,S=t.yaxis,P=e._fullLayout;function L(t,r,n){return a.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,e)}var I=n[0].trace,R="h"===I.orientation,O=function(e,t,r,n,i){var o,s=t[0].trace,l=s.texttemplate;return o=l?function(e,t,r,n,i){var o=t[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,u,f,d,p="histogram"===o.type,h="waterfall"===o.type,v="funnel"===o.type,m="h"===o.orientation;function g(e){return c(u,u.c2l(e),!0).text}function y(e){return c(d,d.c2l(e),!0).text}m?(l="y",u=i,f="x",d=n):(l="x",u=n,f="y",d=i);var x=t[r],_={};_.label=x.p,_.labelLabel=_[l+"Label"]=g(x.p);var w=a.castOption(o,x.i,"text");(0===w||w)&&(_.text=w),_.value=x.s,_.valueLabel=_[f+"Label"]=y(x.s);var k={};b(k,o,x.i),(p||void 0===k.x)&&(k.x=m?_.value:_.label),(p||void 0===k.y)&&(k.y=m?_.label:_.value),(p||void 0===k.xLabel)&&(k.xLabel=m?_.valueLabel:_.labelLabel),(p||void 0===k.yLabel)&&(k.yLabel=m?_.labelLabel:_.valueLabel),h&&(_.delta=+x.rawS||x.s,_.deltaLabel=y(_.delta),_.final=x.v,_.finalLabel=y(_.final),_.initial=_.final-_.delta,_.initialLabel=y(_.initial)),v&&(_.value=x.s,_.valueLabel=y(_.value),_.percentInitial=x.begR,_.percentInitialLabel=a.formatPercent(x.begR),_.percentPrevious=x.difR,_.percentPreviousLabel=a.formatPercent(x.difR),_.percentTotal=x.sumR,_.percenTotalLabel=a.formatPercent(x.sumR));var T=a.castOption(o,x.i,"customdata");return T&&(_.customdata=T),a.texttemplateString(s,_,e._d3locale,k,_,o._meta||{})}(e,t,r,n,i):s.textinfo?function(e,t,r,n){var i=e[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function u(e){return c(o?n:r,e,!0).text}function f(e){return c(o?r:n,+e,!0).text}var d,p=i.textinfo,h=e[t],v=p.split("+"),m=[],g=function(e){return-1!==v.indexOf(e)};if(g("label")&&m.push(u(e[t].p)),g("text")&&(0===(d=a.castOption(i,h.i,"text"))||d)&&m.push(d),s){var y=+h.rawS||h.s,x=h.v,b=x-y;g("initial")&&m.push(f(b)),g("delta")&&m.push(f(y)),g("final")&&m.push(f(x))}if(l){g("value")&&m.push(f(h.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var w=_>1;g("percent initial")&&(d=a.formatPercent(h.begR),w&&(d+=" of initial"),m.push(d)),g("percent previous")&&(d=a.formatPercent(h.difR),w&&(d+=" of previous"),m.push(d)),g("percent total")&&(d=a.formatPercent(h.sumR),w&&(d+=" of total"),m.push(d))}return m.join("
")}(t,r,n,i):v.getValue(s.text,r),v.coerceString(y,o)}(P,n,i,k,S);w=function(e,t){var r=v.getValue(e.textposition,t);return v.coerceEnumerated(x,r)}(I,i);var D="stack"===m.mode||"relative"===m.mode,z=n[i],F=!D||z._outmost;if(O&&"none"!==w&&(!z.isBlank&&s!==u&&f!==p||"auto"!==w&&"inside"!==w)){var j=P.font,N=h.getBarColor(n[i],I),Z=h.getInsideTextFont(I,i,j,N),B=h.getOutsideTextFont(I,i,j),V=r.datum();R?"log"===k.type&&V.s0<=0&&(s=k.range[0]0&&G>0&&(W<=Y&&G<=X||W<=X&&G<=Y||(R?Y>=W*(X/G):X>=G*(Y/W)))?w="inside":(w="outside",U.remove(),U=null)):w="inside"),!U){var K=(U=L(r,O,q=a.ensureUniformFontSize(e,"outside"===w?B:Z))).attr("transform");if(U.attr("transform",""),W=(H=l.bBox(U.node())).width,G=H.height,U.attr("transform",K),W<=0||G<=0)return void U.remove()}var $,J=I.textangle;$="outside"===w?function(e,t,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,u=a.angle||0,c=i.width,f=i.height,d=Math.abs(t-e),p=Math.abs(n-r);o=s?p>2*_?_:0:d>2*_?_:0;var h=1;l&&(h=s?Math.min(1,p/f):Math.min(1,d/c));var v=A(u),m=C(i,v),g=(s?m.x:m.y)/2,y=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(e+t)/2,w=(r+n)/2,k=0,M=0,S=s?T(t,e):T(r,n);return s?(b=t-S*o,k=S*g):(w=n+S*o,M=-S*g),{textX:y,textY:x,targetX:b,targetY:w,anchorX:k,anchorY:M,scale:h,rotate:v}}(s,u,f,p,H,{isHorizontal:R,constrained:"both"===I.constraintext||"outside"===I.constraintext,angle:J}):E(s,u,f,p,H,{isHorizontal:R,constrained:"both"===I.constraintext||"inside"===I.constraintext,angle:J,anchor:I.insidetextanchor}),$.fontSize=q.size,d("histogram"===I.type?"bar":I.type,$,P),z.transform=$;var Q=M(U,P,m,g);a.setTransormAndDisplay(Q,$)}else r.select("text").remove()}(e,t,R,r,p,N,Z,B,V,m,g),t.layerClipId&&l.hideOutsideRangePoint(u,R.select("text"),w,P,f.xcalendar,f.ycalendar)}));var B=!1===f.cliponaxis;l.setClipUrl(u,B?null:t.layerClipId,e)}));u.getComponentMethod("errorbars","plot")(e,R,t,m)},toMoveInsideBar:E}},81974:function(e){"use strict";function t(e,t,r,n,i){var a=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),s=r.c2p(n?e.p0:e.s0,!0),l=r.c2p(n?e.p1:e.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(e,r){var n,i=e.cd,a=e.xaxis,o=e.yaxis,s=i[0].trace,l="funnel"===s.type,u="h"===s.orientation,c=[];if(!1===r)for(n=0;n1||0===i.bargap&&0===i.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),s.getComponentMethod("errorbars","style")(t)},styleTextPoints:v,styleOnSelect:function(e,t,r){var i=t[0].trace;i.selectedpoints?function(e,t,r){a.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var i,s=n.select(this);if(e.selected){i=o.ensureUniformFontSize(r,m(s,e,t,r));var l=t.selected.textfont&&t.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,t)}))}(e.selectAll("text"),t,r)}(r,i,e):(h(r,i,e),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:l}},98340:function(e,t,r){"use strict";var n=r(7901),i=r(52075).hasColorscale,a=r(1586),o=r(71828).coercePattern;e.exports=function(e,t,r,s,l){var u=r("marker.color",s),c=i(e,"marker");c&&a(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(e,"marker.line")&&a(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",u,c),r("selected.marker.color"),r("unselected.marker.color")}},72597:function(e,t,r){"use strict";var n=r(39898),i=r(71828);function a(e){return"_"+e+"Text_minsize"}e.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=a(e),i=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=od.range[1]&&(x+=Math.PI),n.getClosest(u,(function(e){return v(y,x,[e.rp0,e.rp1],[e.thetag0,e.thetag1],h)?m+Math.min(1,Math.abs(e.thetag1-e.thetag0)/g)-1+(e.rp1-y)/(e.rp1-e.rp0)-1:1/0}),e),!1!==e.index){var b=u[e.index];e.x0=e.x1=b.ct[0],e.y0=e.y1=b.ct[1];var _=i.extendFlat({},b,{r:b.s,theta:b.p});return o(b,c,e),s(_,c,f,e),e.hovertemplate=c.hovertemplate,e.color=a(c,b),e.xLabelVal=e.yLabelVal=void 0,b.s<0&&(e.idealAlign="left"),[e]}}},23381:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:r(23580),categories:["polar","bar","showLegend"],attributes:r(55023),layoutAttributes:r(40151),supplyDefaults:r(6135),supplyLayoutDefaults:r(19860),calc:r(74692).calc,crossTraceCalc:r(74692).crossTraceCalc,plot:r(60173),colorbar:r(4898),formatLabels:r(98608),style:r(16688).style,styleOnSelect:r(16688).styleOnSelect,hoverPoints:r(27379),selectPoints:r(81974),meta:{}}},40151:function(e){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},19860:function(e,t,r){"use strict";var n=r(71828),i=r(40151);e.exports=function(e,t,r){var a,o={};function s(r,o){return n.coerce(e[a]||{},t[a],i,r,o)}for(var l=0;l0?(u=o,c=l):(u=l,c=o);var f=[s.findEnclosingVertexAngles(u,e.vangles)[0],(u+c)/2,s.findEnclosingVertexAngles(c,e.vangles)[1]];return s.pathPolygonAnnulus(n,i,u,c,f,t,r)}:function(e,n,i,o){return a.pathAnnulus(e,n,i,o,t,r)}}(t),h=t.layers.frontplot.select("g.barlayer");a.makeTraceGroups(h,r,"trace bars").each((function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(e){var t,r=n.select(this),o=e.rp0=f.c2p(e.s0),s=e.rp1=f.c2p(e.s1),l=e.thetag0=d.c2g(e.p0),h=e.thetag1=d.c2g(e.p1);if(i(o)&&i(s)&&i(l)&&i(h)&&o!==s&&l!==h){var v=f.c2g(e.s1),m=(l+h)/2;e.ct=[u.c2p(v*Math.cos(m)),c.c2p(v*Math.sin(m))],t=p(o,s,l,h)}else t="M0,0Z";a.ensureSingle(r,"path").attr("d",t)})),o.setClipUrl(r,t._hasClipOnAxisFalse?t.clipIds.forTraces:null,e)}))}},53522:function(e,t,r){"use strict";var n=r(82196),i=r(1486),a=r(22399),o=r(12663).axisHoverFormat,s=r(5386).fF,l=r(1426).extendFlat,u=n.marker,c=u.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},u.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},u.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},u.angle,{arrayOk:!1,editType:"calc"}),size:l({},u.size,{arrayOk:!1,editType:"calc"}),color:l({},u.color,{arrayOk:!1,editType:"style"}),line:{color:l({},c.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},c.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},48518:function(e,t,r){"use strict";var n=r(92770),i=r(89298),a=r(42973),o=r(71828),s=r(50606).BADNUM,l=o._;e.exports=function(e,t){var r,u,y,x,b,_,w,k=e._fullLayout,T=i.getFromId(e,t.xaxis||"x"),M=i.getFromId(e,t.yaxis||"y"),S=[],A="violin"===t.type?"_numViolins":"_numBoxes";"h"===t.orientation?(y=T,x="x",b=M,_="y",w=!!t.yperiodalignment):(y=M,x="y",b=T,_="x",w=!!t.xperiodalignment);var C,E,P,L,I,R,O=function(e,t,r,i){var s,l=t in e,u=t+"0"in e,c="d"+t in e;if(l||u&&c){var f=r.makeCalcdata(e,t);return[a(e,r,t,f).vals,f]}s=u?e[t+"0"]:"name"in e&&("category"===r.type||n(e.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(e.name)&&"date"===r.type)?e.name:i;for(var d="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,e[t+"calendar"]),p=e._length,h=new Array(p),v=0;vC.uf};if(t._hasPreCompStats){var B=t[x],V=function(e){return y.d2c((t[e]||[])[r])},U=1/0,H=-1/0;for(r=0;r=C.q1&&C.q3>=C.med){var G=V("lowerfence");C.lf=G!==s&&G<=C.q1?G:p(C,P,L);var q=V("upperfence");C.uf=q!==s&&q>=C.q3?q:h(C,P,L);var Y=V("mean");C.mean=Y!==s?Y:L?o.mean(P,L):(C.q1+C.q3)/2;var X=V("sd");C.sd=Y!==s&&X>=0?X:L?o.stdev(P,L,C.mean):C.q3-C.q1,C.lo=v(C),C.uo=m(C);var K=V("notchspan");K=K!==s&&K>0?K:g(C,L),C.ln=C.med-K,C.un=C.med+K;var $=C.lf,J=C.uf;t.boxpoints&&P.length&&($=Math.min($,P[0]),J=Math.max(J,P[L-1])),t.notched&&($=Math.min($,C.ln),J=Math.max(J,C.un)),C.min=$,C.max=J}else{var Q;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+C.q1,"median = "+C.med,"q3 = "+C.q3].join("\n")),Q=C.med!==s?C.med:C.q1!==s?C.q3!==s?(C.q1+C.q3)/2:C.q1:C.q3!==s?C.q3:0,C.med=Q,C.q1=C.q3=Q,C.lf=C.uf=Q,C.mean=C.sd=Q,C.ln=C.un=Q,C.min=C.max=Q}U=Math.min(U,C.min),H=Math.max(H,C.max),C.pts2=E.filter(Z),S.push(C)}}t._extremes[y._id]=i.findExtremes(y,[U,H],{padded:!0})}else{var ee=y.makeCalcdata(t,x),te=function(e,t){for(var r=e.length,n=new Array(r+1),i=0;i=0&&ie0){var ce,fe;(C={}).pos=C[_]=j[r],E=C.pts=ne[r].sort(f),L=(P=C[x]=E.map(d)).length,C.min=P[0],C.max=P[L-1],C.mean=o.mean(P,L),C.sd=o.stdev(P,L,C.mean)*t.sdmultiple,C.med=o.interp(P,.5),L%2&&(le||ue)?(le?(ce=P.slice(0,L/2),fe=P.slice(L/2+1)):ue&&(ce=P.slice(0,L/2+1),fe=P.slice(L/2)),C.q1=o.interp(ce,.5),C.q3=o.interp(fe,.5)):(C.q1=o.interp(P,.25),C.q3=o.interp(P,.75)),C.lf=p(C,P,L),C.uf=h(C,P,L),C.lo=v(C),C.uo=m(C);var de=g(C,L);C.ln=C.med-de,C.un=C.med+de,ae=Math.min(ae,C.ln),oe=Math.max(oe,C.un),C.pts2=E.filter(Z),S.push(C)}t._extremes[y._id]=i.findExtremes(y,t.notched?ee.concat([ae,oe]):ee,{padded:!0})}return function(e,t){if(o.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(S[0].t={num:k[A],dPos:N,posLetter:_,valLetter:x,labels:{med:l(e,"median:"),min:l(e,"min:"),q1:l(e,"q1:"),q3:l(e,"q3:"),max:l(e,"max:"),mean:"sd"===t.boxmean||"sd"===t.sizemode?l(e,"mean \xb1 \u03c3:").replace("\u03c3",1===t.sdmultiple?"\u03c3":t.sdmultiple+"\u03c3"):l(e,"mean:"),lf:l(e,"lower fence:"),uf:l(e,"upper fence:")}},k[A]++,S):[{t:{empty:!0}}]};var u={text:"tx",hovertext:"htx"};function c(e,t,r){for(var n in u)o.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(t[n][r[0]])&&(e[u[n]]=t[n][r[0]][r[1]]):e[u[n]]=t[n][r])}function f(e,t){return e.v-t.v}function d(e){return e.v}function p(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(o.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function h(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(o.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function v(e){return 4*e.q1-3*e.q3}function m(e){return 4*e.q3-3*e.q1}function g(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}},37188:function(e,t,r){"use strict";var n=r(89298),i=r(71828),a=r(99082).getAxisGroup,o=["v","h"];function s(e,t,r,o){var s,l,u,c=t.calcdata,f=t._fullLayout,d=o._id,p=d.charAt(0),h=[],v=0;for(s=0;s1,b=1-f[e+"gap"],_=1-f[e+"groupgap"];for(s=0;s0){var H=C.pointpos,W=C.jitter,G=C.marker.size/2,q=0;H+W>=0&&((q=V*(H+W))>S?(U=!0,Z=G,j=q):q>z&&(Z=G,j=S)),q<=S&&(j=S);var Y=0;H-W<=0&&((Y=-V*(H-W))>A?(U=!0,B=G,N=Y):Y>F&&(B=G,N=A)),Y<=A&&(N=A)}else j=S,N=A;var X=new Array(u.length);for(l=0;l0?(m="v",g=x>0?Math.min(_,b):Math.min(b)):x>0?(m="h",g=Math.min(_)):g=0;if(g){t._length=g;var A=r("orientation",m);t._hasPreCompStats?"v"===A&&0===x?(r("x0",0),r("dx",1)):"h"===A&&0===y&&(r("y0",0),r("dy",1)):"v"===A&&0===x?r("x0"):"h"===A&&0===y&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],a)}else t.visible=!1}function f(e,t,r,i){var a=i.prefix,o=n.coerce2(e,t,u,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";t._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var c=r(a+"points",l);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.angle"),r("marker.color",t.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",t.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete t.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(t,r)}e.exports={supplyDefaults:function(e,t,r,i){function s(r,i){return n.coerce(e,t,u,r,i)}if(c(e,t,s,i),!1!==t.visible){o(e,t,i,s),s("xhoverformat"),s("yhoverformat");var l=t._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(e.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(t.line.color,.5));var d=!1;if(l){var p=s("mean"),h=s("sd");p&&p.length&&(d=!0,h&&h.length&&(d="sd"))}s("whiskerwidth");var v,m=s("sizemode");"quartiles"===m&&(v=s("boxmean",d)),s("showwhiskers","quartiles"===m),"sd"!==m&&"sd"!==v||s("sdmultiple"),s("width"),s("quartilemethod");var g=!1;if(l){var y=s("notchspan");y&&y.length&&(g=!0)}else n.validate(e.notchwidth,u.notchwidth)&&(g=!0);s("notched",g)&&s("notchwidth"),f(e,t,s,{prefix:"box"})}},crossTraceDefaults:function(e,t){var r,i;function a(e){return n.coerce(i._input,i,u,e)}for(var o=0;oe.lo&&(_.so=!0)}return a}));h.enter().append("path").classed("point",!0),h.exit().remove(),h.call(a.translatePoints,l,u)}function c(e,t,r,a){var o,s,l=t.val,u=t.pos,c=!!u.rangebreaks,f=a.bPos,d=a.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var h=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);h.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),h.exit().remove(),h.each((function(e){var t=u.c2l(e.pos+f,!0),i=u.l2p(t-o)+d,a=u.l2p(t+s)+d,h=c?(i+a)/2:u.l2p(t)+d,v=l.c2p(e.mean,!0),m=l.c2p(e.mean-e.sd,!0),g=l.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+v+","+i+"V"+a+("sd"===p?"m0,0L"+m+","+h+"L"+v+","+i+"L"+g+","+h+"Z":"")):n.select(this).attr("d","M"+i+","+v+"H"+a+("sd"===p?"m0,0L"+h+","+m+"L"+i+","+v+"L"+h+","+g+"Z":""))}))}e.exports={plot:function(e,t,r,a){var o=e._context.staticPlot,s=t.xaxis,f=t.yaxis;i.makeTraceGroups(a,r,"trace boxes").each((function(e){var t,r,i=n.select(this),a=e[0],d=a.t,p=a.trace;d.wdPos=d.bdPos*p.whiskerwidth,!0!==p.visible||d.empty?i.remove():("h"===p.orientation?(t=f,r=s):(t=s,r=f),l(i,{pos:t,val:r},p,d,o),u(i,{x:s,y:f},p,d),c(i,{pos:t,val:r},p,d))}))},plotBoxAndWhiskers:l,plotPoints:u,plotBoxMean:c}},24626:function(e){"use strict";e.exports=function(e,t){var r,n,i=e.cd,a=e.xaxis,o=e.yaxis,s=[];if(!1===t)for(r=0;r=10)return null;for(var r=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,I=E>0?Math.ceil:Math.floor,R=E>0?Math.min:Math.max,O=E>0?Math.max:Math.min,D=L(A+P),z=I(C-P),F=[[f=S(A)]];for(a=D;a*E=0;i--)a[c-i]=e[f][i],o[c-i]=t[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=e[i][0],o[f-i]=t[i][0];return s.push({x:a,y:o,bicubic:u}),s}},20347:function(e,t,r){"use strict";var n=r(89298),i=r(1426).extendFlat;e.exports=function(e,t,r){var a,o,s,l,u,c,f,d,p,h,v,m,g,y,x=e["_"+t],b=e[t+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],k=b._boundarylines=[],T=e["_"+r],M=e[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var S=e._xctrl,A=e._yctrl,C=S[0].length,E=S.length,P=e._a.length,L=e._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function R(n){var i,a,o,s,l,u,c,f,p,h,v,m,g=[],y=[],x={};if("b"===t)for(a=e.b2j(n),o=Math.floor(Math.max(0,Math.min(L-2,a))),s=a-o,x.length=L,x.crossLength=P,x.xy=function(t){return e.evalxy([],t,a)},x.dxy=function(t,r){return e.dxydi([],t,o,r,s)},i=0;i0&&(p=e.dxydi([],i-1,o,0,s),g.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),h=e.dxydi([],i-1,o,1,s),g.push(f[0]-h[0]/3),y.push(f[1]-h[1]/3)),g.push(f[0]),y.push(f[1]),l=f;else for(i=e.a2i(n),u=Math.floor(Math.max(0,Math.min(P-2,i))),c=i-u,x.length=P,x.crossLength=L,x.xy=function(t){return e.evalxy([],i,t)},x.dxy=function(t,r){return e.dxydj([],u,t,c,r)},a=0;a0&&(v=e.dxydj([],u,a-1,c,0),g.push(l[0]+v[0]/3),y.push(l[1]+v[1]/3),m=e.dxydj([],u,a-1,c,1),g.push(f[0]-m[0]/3),y.push(f[1]-m[1]/3)),g.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=t,x.axis=b,x.crossAxis=M,x.value=n,x.constvar=r,x.index=d,x.x=g,x.y=y,x.smoothing=M.smoothing,x}function O(n){var i,a,o,s,l,u=[],c=[],f={};if(f.length=x.length,f.crossLength=T.length,"b"===t)for(o=Math.max(0,Math.min(L-2,n)),l=Math.min(1,Math.max(0,n-o)),f.xy=function(t){return e.evalxy([],t,n)},f.dxy=function(t,r){return e.dxydi([],t,o,r,l)},i=0;ix.length-1||_.push(i(O(o),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(d=c;dx.length-1)&&!(v<0||v>x.length-1))for(m=x[s],g=x[v],a=0;ax[x.length-1]||w.push(i(R(h),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&k.push(i(O(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(i(O(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,c=(u=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(e,t){return e-t})))[0],f=u[1],d=c;d<=f;d++)p=b.tick0+b.dtick*d,_.push(i(R(p),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(d=c-1;dx[x.length-1]||w.push(i(R(h),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&k.push(i(R(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(i(R(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},83311:function(e,t,r){"use strict";var n=r(89298),i=r(1426).extendFlat;e.exports=function(e,t){var r,a,o,s=t._labels=[],l=t._gridlines;for(r=0;rt.length&&(e=e.slice(0,t.length)):e=[],i=0;i90&&(p-=180,l=-l),{angle:p,flip:l,p:e.c2p(n,t,r),offsetMultplier:u}}},89740:function(e,t,r){"use strict";var n=r(39898),i=r(91424),a=r(27669),o=r(67961),s=r(11651),l=r(63893),u=r(71828),c=u.strRotate,f=u.strTranslate,d=r(18783);function p(e,t,r,s,l,u,c){var f="const-"+l+"-lines",d=r.selectAll("."+f).data(u);d.enter().append("path").classed(f,!0).style("vector-effect",c?"none":"non-scaling-stroke"),d.each((function(r){var s=r,l=s.x,u=s.y,c=a([],l,e.c2p),f=a([],u,t.c2p),d="M"+o(c,f,s.smoothing);n.select(this).attr("d",d).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",i.dashStyle(s.dash,s.width)).style("fill","none")})),d.exit().remove()}function h(e,t,r,a,o,u,d,p){var h=u.selectAll("text."+p).data(d);h.enter().append("text").classed(p,!0);var v=0,m={};return h.each((function(o,u){var d;if("auto"===o.axis.tickangle)d=s(a,t,r,o.xy,o.dxy);else{var p=(o.axis.tickangle+180)*Math.PI/180;d=s(a,t,r,o.xy,[Math.cos(p),Math.sin(p)])}u||(m={angle:d.angle,flip:d.flip});var h=(o.endAnchor?-1:1)*d.flip,g=n.select(this).attr({"text-anchor":h>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,e),y=i.bBox(this);g.attr("transform",f(d.p[0],d.p[1])+c(d.angle)+f(o.axis.labelpadding*h,.3*y.height)),v=Math.max(v,y.width+o.axis.labelpadding)})),h.exit().remove(),m.maxExtent=v,m}e.exports=function(e,t,r,i){var l=e._context.staticPlot,c=t.xaxis,f=t.yaxis,d=e._fullLayout._clips;u.makeTraceGroups(i,r,"trace").each((function(t){var r=n.select(this),i=t[0],v=i.trace,m=v.aaxis,y=v.baxis,x=u.ensureSingle(r,"g","minorlayer"),b=u.ensureSingle(r,"g","majorlayer"),_=u.ensureSingle(r,"g","boundarylayer"),w=u.ensureSingle(r,"g","labellayer");r.style("opacity",v.opacity),p(c,f,b,0,"a",m._gridlines,!0),p(c,f,b,0,"b",y._gridlines,!0),p(c,f,x,0,"a",m._minorgridlines,!0),p(c,f,x,0,"b",y._minorgridlines,!0),p(c,f,_,0,"a-boundary",m._boundarylines,l),p(c,f,_,0,"b-boundary",y._boundarylines,l);var k=h(e,c,f,v,0,w,m._labels,"a-label"),T=h(e,c,f,v,0,w,y._labels,"b-label");!function(e,t,r,n,i,a,o,l){var c,f,d,p,h=u.aggNums(Math.min,null,r.a),v=u.aggNums(Math.max,null,r.a),m=u.aggNums(Math.min,null,r.b),y=u.aggNums(Math.max,null,r.b);c=.5*(h+v),f=m,d=r.ab2xy(c,f,!0),p=r.dxyda_rough(c,f),void 0===o.angle&&u.extendFlat(o,s(r,i,a,d,r.dxydb_rough(c,f))),g(e,t,r,0,d,p,r.aaxis,i,a,o,"a-title"),c=h,f=.5*(m+y),d=r.ab2xy(c,f,!0),p=r.dxydb_rough(c,f),void 0===l.angle&&u.extendFlat(l,s(r,i,a,d,r.dxyda_rough(c,f))),g(e,t,r,0,d,p,r.baxis,i,a,l,"b-title")}(e,w,v,0,c,f,k,T),function(e,t,r,n,i){var s,l,c,f,d=r.select("#"+e._clipPathId);d.size()||(d=r.append("clipPath").classed("carpetclip",!0));var p=u.ensureSingle(d,"path","carpetboundary"),h=t.clipsegments,v=[];for(f=0;f90&&y<270,b=n.select(this);b.text(d.title.text).call(l.convertToTspans,e),x&&(_=(-l.lineCount(b)+m)*v*a-_),b.attr("transform",f(t.p[0],t.p[1])+c(t.angle)+f(0,_)).attr("text-anchor","middle").call(i.font,d.title.font)})),b.exit().remove()}},11435:function(e,t,r){"use strict";var n=r(35509),i=r(65888).findBin,a=r(45664),o=r(20349),s=r(54495),l=r(73057);e.exports=function(e){var t=e._a,r=e._b,u=t.length,c=r.length,f=e.aaxis,d=e.baxis,p=t[0],h=t[u-1],v=r[0],m=r[c-1],g=t[t.length-1]-t[0],y=r[r.length-1]-r[0],x=g*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,h+=x,v-=b,m+=b,e.isVisible=function(e,t){return e>p&&ev&&th||tm},e.setScale=function(){var t=e._x,r=e._y,n=a(e._xctrl,e._yctrl,t,r,f.smoothing,d.smoothing);e._xctrl=n[0],e._yctrl=n[1],e.evalxy=o([e._xctrl,e._yctrl],u,c,f.smoothing,d.smoothing),e.dxydi=s([e._xctrl,e._yctrl],f.smoothing,d.smoothing),e.dxydj=l([e._xctrl,e._yctrl],f.smoothing,d.smoothing)},e.i2a=function(e){var r=Math.max(0,Math.floor(e[0]),u-2),n=e[0]-r;return(1-n)*t[r]+n*t[r+1]},e.j2b=function(e){var t=Math.max(0,Math.floor(e[1]),u-2),n=e[1]-t;return(1-n)*r[t]+n*r[t+1]},e.ij2ab=function(t){return[e.i2a(t[0]),e.j2b(t[1])]},e.a2i=function(e){var r=Math.max(0,Math.min(i(e,t),u-2)),n=t[r],a=t[r+1];return Math.max(0,Math.min(u-1,r+(e-n)/(a-n)))},e.b2j=function(e){var t=Math.max(0,Math.min(i(e,r),c-2)),n=r[t],a=r[t+1];return Math.max(0,Math.min(c-1,t+(e-n)/(a-n)))},e.ab2ij=function(t){return[e.a2i(t[0]),e.b2j(t[1])]},e.i2c=function(t,r){return e.evalxy([],t,r)},e.ab2xy=function(n,i,a){if(!a&&(nt[u-1]|ir[c-1]))return[!1,!1];var o=e.a2i(n),s=e.b2j(i),l=e.evalxy([],o,s);if(a){var f,d,p,h,v=0,m=0,g=[];nt[u-1]?(f=u-2,d=1,v=(n-t[u-1])/(t[u-1]-t[u-2])):d=o-(f=Math.max(0,Math.min(u-2,Math.floor(o)))),ir[c-1]?(p=c-2,h=1,m=(i-r[c-1])/(r[c-1]-r[c-2])):h=s-(p=Math.max(0,Math.min(c-2,Math.floor(s)))),v&&(e.dxydi(g,f,p,d,h),l[0]+=g[0]*v,l[1]+=g[1]*v),m&&(e.dxydj(g,f,p,d,h),l[0]+=g[0]*m,l[1]+=g[1]*m)}return l},e.c2p=function(e,t,r){return[t.c2p(e[0]),r.c2p(e[1])]},e.p2x=function(e,t,r){return[t.p2c(e[0]),r.p2c(e[1])]},e.dadi=function(e){var r=Math.max(0,Math.min(t.length-2,e));return t[r+1]-t[r]},e.dbdj=function(e){var t=Math.max(0,Math.min(r.length-2,e));return r[t+1]-r[t]},e.dxyda=function(t,r,n,i){var a=e.dxydi(null,t,r,n,i),o=e.dadi(t,n);return[a[0]/o,a[1]/o]},e.dxydb=function(t,r,n,i){var a=e.dxydj(null,t,r,n,i),o=e.dbdj(r,i);return[a[0]/o,a[1]/o]},e.dxyda_rough=function(t,r,n){var i=g*(n||.1),a=e.ab2xy(t+i,r,!0),o=e.ab2xy(t-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dxydb_rough=function(t,r,n){var i=y*(n||.1),a=e.ab2xy(t,r+i,!0),o=e.ab2xy(t,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dpdx=function(e){return e._m},e.dpdy=function(e){return e._m}}},72505:function(e,t,r){"use strict";var n=r(71828);e.exports=function(e,t,r){var i,a,o,s=[],l=[],u=e[0].length,c=e.length;function f(t,r){var n,i=0,a=0;return t>0&&void 0!==(n=e[r][t-1])&&(a++,i+=n),t0&&void 0!==(n=e[r-1][t])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",T,"after",M,"iterations"),e}},19237:function(e,t,r){"use strict";var n=r(71828).isArray1D;e.exports=function(e,t,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(t._cheater=!i,a&&!n(i)||s&&!n(o))t._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),t.a&&t.a.length&&(l=Math.min(l,t.a.length)),t.b&&t.b.length&&(l=Math.min(l,t.b.length)),t._length=l}return!0}},69568:function(e,t,r){"use strict";var n=r(5386).fF,i=r(19316),a=r(50693),o=r(9012),s=r(22399).defaultLine,l=r(1426).extendFlat,u=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},u.color,{dflt:s}),width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},38675:function(e,t,r){"use strict";var n=r(92770),i=r(50606).BADNUM,a=r(78803),o=r(75225),s=r(66279);function l(e){return e&&"string"===typeof e}e.exports=function(e,t){var r,u=t._length,c=new Array(u);r=t.geojson?function(e){return l(e)||n(e)}:l;for(var f=0;f")}}(e,f,o),[e]}},51319:function(e,t,r){"use strict";e.exports={attributes:r(69568),supplyDefaults:r(61869),colorbar:r(61243),calc:r(38675),calcGeoJSON:r(99841).calcGeoJSON,plot:r(99841).plot,style:r(99636).style,styleOnSelect:r(99636).styleOnSelect,hoverPoints:r(42300),eventData:r(92069),selectPoints:r(81253),moduleType:"trace",name:"choropleth",basePlotModule:r(44622),categories:["geo","noOpacity","showLegend"],meta:{}}},99841:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=r(41327),o=r(90973).getTopojsonFeatures,s=r(71739).findExtremes,l=r(99636).style;e.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],i=n._subplot,l=r.locationmode,u=r._length,c="geojson-id"===l?a.extractTraceFeature(e):o(r,i.topojson),f=[],d=[],p=0;p=0;n--){var i=r[n].id;if("string"===typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)e.removeLayer(t[r][1])},s.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},e.exports=function(e,t){var r=t[0].trace,i=new o(e,r.uid),a=i.sourceId,s=n(t),l=i.below=e.belowLookup["trace-"+r.uid];return e.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),t[0].trace._glTrace=i,i}},12674:function(e,t,r){"use strict";var n=r(50693),i=r(12663).axisHoverFormat,a=r(5386).fF,o=r(2418),s=r(9012),l=r(1426).extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(u,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(e){u[e]=o[e]})),u.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),u.transforms=void 0,e.exports=u},31371:function(e,t,r){"use strict";var n=r(78803);e.exports=function(e,t){for(var r=t.u,i=t.v,a=t.w,o=Math.min(t.x.length,t.y.length,t.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,u=0;uo.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,u=-1/0,c=1/0;for(r=0;r":p>u&&(n.prefixBoundary=!0);break;case"<":(pu||n.starts.length&&d===c)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),d=Math.max(p[0],p[1]),fu&&(n.prefixBoundary=!0)}}}},90654:function(e,t,r){"use strict";var n=r(21081),i=r(86068),a=r(53572);e.exports={min:"zmin",max:"zmax",calc:function(e,t,r){var o=t.contours,s=t.line,l=o.size||1,u=o.coloring,c=i(t,{isColorbar:!0});if("heatmap"===u){var f=n.extractOpts(t);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===u&&(r._fillcolor=c);r._line={color:"lines"===u?c:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},36914:function(e){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},83179:function(e,t,r){"use strict";var n=r(92770),i=r(14523),a=r(7901),o=a.addOpacity,s=a.opacity,l=r(74808),u=l.CONSTRAINT_REDUCTION,c=l.COMPARISON_OPS2;e.exports=function(e,t,r,a,l,f){var d,p,h,v=t.contours,m=r("contours.operation");v._operation=u[m],function(e,t){var r;-1===c.indexOf(t.operation)?(e("contours.value",[0,1]),Array.isArray(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e("contours.value",0),n(t.value)||(Array.isArray(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(r,v),"="===m?d=v.showlines=!0:(d=r("contours.showlines"),h=r("fillcolor",o((e.line||{}).color||l,.5))),d&&(p=r("line.color",h&&s(h)?o(t.fillcolor,1):l),r("line.width",2),r("line.dash")),r("line.smoothing"),i(r,a,p,f)}},64237:function(e,t,r){"use strict";var n=r(74808),i=r(92770);function a(e,t){var r,a=Array.isArray(t);function o(e){return i(e)?+e:null}return-1!==n.COMPARISON_OPS2.indexOf(e)?r=o(a?t[0]:t):-1!==n.INTERVAL_OPS.indexOf(e)?r=a?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==n.SET_OPS.indexOf(e)&&(r=a?t.map(o):[o(t)]),r}function o(e){return function(t){t=a(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function s(e){return function(t){return{start:t=a(e,t),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},67217:function(e){"use strict";e.exports=function(e,t,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},84857:function(e,t,r){"use strict";var n=r(71828);function i(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}e.exports=function(e,t){var r,a,o,s=function(e){return e.reverse()},l=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&n.warn("Contour data invalid for the specified inequality operation."),a=e[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",e);break}return l}},53572:function(e){"use strict";e.exports=function(e){return e.end+e.size/1e6}},81696:function(e,t,r){"use strict";var n=r(71828),i=r(36914);function a(e,t,r,n){return Math.abs(e[0]-t[0])20&&t?208===e||1114===e?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(e)?a=1:-1!==i.LEFTSTART.indexOf(e)?n=1:-1!==i.TOPSTART.indexOf(e)?a=-1:n=-1,[n,a]}(d,r,t),h=[l(e,t,[-p[0],-p[1]])],v=e.z.length,m=e.z[0].length,g=t.slice(),y=p.slice();for(c=0;c<1e4;c++){if(d>20?(d=i.CHOOSESADDLE[d][(p[0]||p[1])<0?0:1],e.crossings[f]=i.SADDLEREMAINDER[d]):delete e.crossings[f],!(p=i.NEWDELTA[d])){n.log("Found bad marching index:",d,t,e.level);break}h.push(l(e,t,p)),t[0]+=p[0],t[1]+=p[1],f=t.join(","),a(h[h.length-1],h[h.length-2],s,u)&&h.pop();var x=p[0]&&(t[0]<0||t[0]>m-2)||p[1]&&(t[1]<0||t[1]>v-2);if(t[0]===g[0]&&t[1]===g[1]&&p[0]===y[0]&&p[1]===y[1]||r&&x)break;d=e.crossings[f]}1e4===c&&n.log("Infinite loop in contour?");var b,_,w,k,T,M,S,A,C,E,P,L=a(h[0],h[h.length-1],s,u),I=0,R=.2*e.smoothing,O=[],D=0;for(c=1;c=D;c--)if((b=O[c])=D&&b+O[_]A&&C--,e.edgepaths[C]=P.concat(h,E));break}N||(e.edgepaths[A]=h.concat(E))}for(A=0;A=y)&&(r<=g&&(r=g),o>=y&&(o=y),l=Math.floor((o-r)/s)+1,u=0),d=0;dg&&(v.unshift(g),m.unshift(m[0])),v[v.length-1]e?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(e){var t,r,a,o,s,l,u,c,f,d=e[0].z,p=d.length,h=d[0].length,v=2===p||2===h;for(r=0;r=0&&(n=y,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;f+="L"+n}if(s===e.edgepaths.length){i.log("unclosed perimeter path");break}d=s,(h=-1===p.indexOf(d))&&(d=p[0],f+="Z")}for(d=0;dn.center?n.right-s:s-n.left)/(c+Math.abs(Math.sin(u)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(u)*o);if(d<1||p<1)return 1/0;var h=g.EDGECOST*(1/(d-1)+1/(p-1));h+=g.ANGLECOST*u*u;for(var v=s-c,m=l-f,y=s+c,x=l+f,b=0;b2*g.MAXCOST)break;p&&(s/=2),l=(o=u-s/2)+1.5*s}if(d<=g.MAXCOST)return c},t.addLabelData=function(e,t,r,n){var i=t.fontSize,a=t.width+i/3,o=Math.max(0,t.height-i/3),s=e.x,l=e.y,u=e.theta,c=Math.sin(u),f=Math.cos(u),d=function(e,t){return[s+e*f-t*c,l+e*c+t*f]},p=[d(-a/2,-o/2),d(-a/2,o/2),d(a/2,o/2),d(a/2,-o/2)];r.push({text:t.text,x:s,y:l,dy:t.dy,theta:u,level:t.level,width:a,height:o}),n.push(p)},t.drawLabels=function(e,t,r,a,o){var l=e.selectAll("text").data(t,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var t=e.x+Math.sin(e.theta)*e.dy,i=e.y-Math.cos(e.theta)*e.dy;n.select(this).text(e.text).attr({x:t,y:i,transform:"rotate("+180*e.theta/Math.PI+" "+t+" "+i+")"}).call(s.convertToTspans,r)})),o){for(var u="",c=0;cr.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),i.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if("constraint"!==r.type){var u,c=r.start,f=r.end,d=e._input.contours;c>f&&(r.start=d.start=f,f=r.end=d.end=c,c=r.start),r.size>0||(u=c===f?1:a(c,f,e.ncontours).dtick,d.size=r.size=u)}}},84426:function(e,t,r){"use strict";var n=r(39898),i=r(91424),a=r(70035),o=r(86068);e.exports=function(e){var t=n.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=n.select(this),r=e[0].trace,a=r.contours,s=r.line,l=a.size||1,u=a.start,c="constraint"===a.type,f=!c&&"lines"===a.coloring,d=!c&&"fill"===a.coloring,p=f||d?o(r):null;t.selectAll("g.contourlevel").each((function(e){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,f?p(e.level):s.color,s.dash)}));var h=a.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){i.font(n.select(this),{family:h.family,size:h.size,color:h.color||(f?p(e.level):s.color)})})),c)t.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var v;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===v&&(v=e.level),p(e.level+.5*l)})),void 0===v&&(v=u),t.selectAll("g.contourbg path").style("fill",p(v-.5*l))}})),a(e)}},8724:function(e,t,r){"use strict";var n=r(1586),i=r(14523);e.exports=function(e,t,r,a,o){var s,l=r("contours.coloring"),u="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(u=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,u,o)}},88085:function(e,t,r){"use strict";var n=r(21606),i=r(70600),a=r(50693),o=r(1426).extendFlat,s=i.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},59885:function(e,t,r){"use strict";var n=r(78803),i=r(71828),a=r(68296),o=r(4742),s=r(824),l=r(43907),u=r(70769),c=r(75005),f=r(22882),d=r(18670);e.exports=function(e,t){var r=t._carpetTrace=f(e,t);if(r&&r.visible&&"legendonly"!==r.visible){if(!t.a||!t.b){var p=e.data[r.index],h=e.data[t.index];h.a||(h.a=p.a),h.b||(h.b=p.b),c(h,t,t._defaultColor,e._fullLayout)}var v=function(e,t){var r,c,f,d,p,h,v,m=t._carpetTrace,g=m.aaxis,y=m.baxis;g._minDtick=0,y._minDtick=0,i.isArray1D(t.z)&&a(t,g,y,"a","b",["z"]),r=t._a=t._a||t.a,d=t._b=t._b||t.b,r=r?g.makeCalcdata(t,"_a"):[],d=d?y.makeCalcdata(t,"_b"):[],c=t.a0||0,f=t.da||1,p=t.b0||0,h=t.db||1,v=t._z=o(t._z||t.z,t.transpose),t._emptypoints=l(v),s(v,t._emptypoints);var x=i.maxRowLength(v),b="scaled"===t.xtype?"":r,_=u(t,b,c,f,x,g),w="scaled"===t.ytype?"":d,k=u(t,w,p,h,v.length,y),T={a:_,b:k,z:v};return"levels"===t.contours.type&&"none"!==t.contours.coloring&&n(e,t,{vals:v,containerStr:"",cLetter:"z"}),[T]}(e,t);return d(t,t._z),v}}},75005:function(e,t,r){"use strict";var n=r(71828),i=r(67684),a=r(88085),o=r(83179),s=r(67217),l=r(8724);e.exports=function(e,t,r,u){function c(r,i){return n.coerce(e,t,a,r,i)}if(c("carpet"),e.a&&e.b){if(!i(e,t,c,u,"a","b"))return void(t.visible=!1);c("text"),"constraint"===c("contours.type")?o(e,t,c,u,r,{hasHover:!1}):(s(e,t,c,(function(r){return n.coerce2(e,t,a,r)})),l(e,t,c,u,{hasHover:!1}))}else t._defaultColor=r,t._length=null}},93740:function(e,t,r){"use strict";e.exports={attributes:r(88085),supplyDefaults:r(75005),colorbar:r(90654),calc:r(59885),plot:r(51048),style:r(84426),moduleType:"trace",name:"contourcarpet",basePlotModule:r(93612),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},51048:function(e,t,r){"use strict";var n=r(39898),i=r(27669),a=r(67961),o=r(91424),s=r(71828),l=r(87678),u=r(81696),c=r(29854),f=r(36914),d=r(84857),p=r(87558),h=r(20083),v=r(22882),m=r(4536);function g(e,t,r){var n=e.getPointAtLength(t),i=e.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function y(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}function x(e,t){var r=Math.abs(e[0]*t[0]+e[1]*t[1]);return Math.sqrt(1-r*r)/r}e.exports=function(e,t,r,b){var _=t.xaxis,w=t.yaxis;s.makeTraceGroups(b,r,"contour").each((function(r){var b=n.select(this),k=r[0],T=k.trace,M=T._carpetTrace=v(e,T),S=e.calcdata[M.index][0];if(M.visible&&"legendonly"!==M.visible){var A=k.a,C=k.b,E=T.contours,P=p(E,t,k),L="constraint"===E.type,I=E._operation,R=L?"="===I?"lines":"fill":E.coloring,O=[[A[0],C[C.length-1]],[A[A.length-1],C[C.length-1]],[A[A.length-1],C[0]],[A[0],C[0]]];l(P);var D=1e-8*(A[A.length-1]-A[0]),z=1e-8*(C[C.length-1]-C[0]);u(P,D,z);var F,j,N,Z,B=P;"constraint"===E.type&&(B=d(P,I)),function(e,t){var r,n,i,a,o,s,l,u,c;for(r=0;r=0;Z--)F=S.clipsegments[Z],j=i([],F.x,_.c2p),N=i([],F.y,w.c2p),j.reverse(),N.reverse(),V.push(a(j,N,F.bicubic));var U="M"+V.join("L")+"Z";!function(e,t,r,n,o,l){var u,c,f,d,p=s.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var h=[];for(d=0;d=0&&(d=E,h=v):Math.abs(f[1]-d[1])=0&&(d=E,h=v):s.log("endpt to newendpt is not vert. or horz.",f,d,E)}if(h>=0)break;y+=A(f,d),f=d}if(h===t.edgepaths.length){s.log("unclosed perimeter path");break}c=h,(b=-1===x.indexOf(c))&&(c=x[0],y+=A(f,d)+"Z",f=null)}for(c=0;cv&&(n.max=v),n.len=n.max-n.min}function m(e,t){var r,n=0,o=.1;return(Math.abs(e[0]-l)0?+p[c]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:g},properties:y})}}var b=o.extractOpts(t),_=b.reversescale?o.flipScale(b.colorscale):b.colorscale,w=_[0][1],k=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(c=1;c<_.length;c++)k.push(_[c][0],_[c][1]);var T=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return i.extendFlat(u.heatmap.paint,{"heatmap-weight":h?T:1/(b.max-b.min),"heatmap-color":k,"heatmap-radius":v?{type:"identity",property:"r"}:t.radius,"heatmap-opacity":t.opacity}),u.geojson={type:"FeatureCollection",features:f},u.heatmap.layout.visibility="visible",u}},79429:function(e,t,r){"use strict";var n=r(71828),i=r(1586),a=r(64096);e.exports=function(e,t,r,o){function s(r,i){return n.coerce(e,t,a,r,i)}var l=s("lon")||[],u=s("lat")||[],c=Math.min(l.length,u.length);c?(t._length=c,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),i(e,t,o,s,{prefix:"",cLetter:"z"})):t.visible=!1}},62474:function(e){"use strict";e.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}},84684:function(e,t,r){"use strict";var n=r(89298),i=r(28178).hoverPoints,a=r(28178).getExtraText;e.exports=function(e,t,r){var o=i(e,t,r);if(o){var s=o[0],l=s.cd,u=l[0].trace,c=l[s.index];if(delete s.color,"z"in c){var f=s.subplot.mockAxis;s.z=c.z,s.zLabel=n.tickText(f,f.c2l(c.z),"hover").text}return s.extraText=a(u,c,l[0].t.labels),[s]}}},93814:function(e,t,r){"use strict";e.exports={attributes:r(64096),supplyDefaults:r(79429),colorbar:r(61243),formatLabels:r(15636),calc:r(85070),plot:r(7336),hoverPoints:r(84684),eventData:r(62474),getBelow:function(e,t){for(var r=t.getMapLayers(),n=0;n=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},e.exports=function(e,t){var r=t[0].trace,i=new a(e,r.uid),o=i.sourceId,s=n(t),l=i.below=e.belowLookup["trace-"+r.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},49789:function(e,t,r){"use strict";var n=r(71828);e.exports=function(e,t){for(var r=0;r"),l.color=function(e,t){var r=e.marker,i=t.mc||r.color,a=t.mlc||r.line.color,o=t.mlw||r.line.width;return n(i)?i:n(a)&&o?a:void 0}(c,d),[l]}}},51759:function(e,t,r){"use strict";e.exports={attributes:r(1285),layoutAttributes:r(10440),supplyDefaults:r(26199).supplyDefaults,crossTraceDefaults:r(26199).crossTraceDefaults,supplyLayoutDefaults:r(93138),calc:r(9532),crossTraceCalc:r(8984),plot:r(80461),style:r(68266).style,hoverPoints:r(63341),eventData:r(34598),selectPoints:r(81974),moduleType:"trace",name:"funnel",basePlotModule:r(93612),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},10440:function(e){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},93138:function(e,t,r){"use strict";var n=r(71828),i=r(10440);e.exports=function(e,t,r){var a=!1;function o(r,a){return n.coerce(e,t,i,r,a)}for(var s=0;s path").each((function(e){if(!e.isBlank){var t=s.marker;n.select(this).call(a.fill,e.mc||t.color).call(a.stroke,e.mlc||t.line.color).call(i.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",s.selectedpoints&&!e.selected?o:1)}})),u(r,s,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},86807:function(e,t,r){"use strict";var n=r(34e3),i=r(9012),a=r(27670).Y,o=r(5386).fF,s=r(5386).si,l=r(1426).extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},pattern:n.marker.pattern,editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},6452:function(e,t,r){"use strict";var n=r(74875);t.name="funnelarea",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},89574:function(e,t,r){"use strict";var n=r(32354);e.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},86282:function(e,t,r){"use strict";var n=r(71828),i=r(86807),a=r(27670).c,o=r(90769).handleText,s=r(37434).handleLabelsAndValues,l=r(37434).handleMarkerDefaults;e.exports=function(e,t,r,u){function c(r,a){return n.coerce(e,t,i,r,a)}var f=c("labels"),d=c("values"),p=s(f,d),h=p.len;if(t._hasLabels=p.hasLabels,t._hasValues=p.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),h){t._length=h,l(e,t,u,c),c("scalegroup");var v,m=c("text"),g=c("texttemplate");if(g||(v=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),g||v&&"none"!==v){var y=c("textposition");o(e,t,u,c,y,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}a(t,u,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",u.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},10421:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:r(6452),categories:["pie-like","funnelarea","showLegend"],attributes:r(86807),layoutAttributes:r(80097),supplyDefaults:r(86282),supplyLayoutDefaults:r(57402),calc:r(89574).calc,crossTraceCalc:r(89574).crossTraceCalc,plot:r(79187),style:r(71858),styleOne:r(63463),meta:{}}},80097:function(e,t,r){"use strict";var n=r(92774).hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},57402:function(e,t,r){"use strict";var n=r(71828),i=r(80097);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},79187:function(e,t,r){"use strict";var n=r(39898),i=r(91424),a=r(71828),o=a.strScale,s=a.strTranslate,l=r(63893),u=r(17295).toMoveInsideBar,c=r(72597),f=c.recordMinTextSize,d=c.clearMinTextSize,p=r(53581),h=r(14575),v=h.attachFxHandlers,m=h.determineInsideTextFont,g=h.layoutAreas,y=h.prerenderTitles,x=h.positionTitleOutside,b=h.formatSliceLabel;function _(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}function w(e,t){return[.5*(e[0]+t[0]),.5*(e[1]+t[1])]}e.exports=function(e,t){var r=e._context.staticPlot,c=e._fullLayout;d("funnelarea",c),y(t,e),g(t,c._size),a.makeTraceGroups(c._funnelarealayer,t,"trace").each((function(t){var d=n.select(this),h=t[0],g=h.trace;!function(e){if(e.length){var t=e[0],r=t.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),u=t.vTotal,c=u,f=u*l/(1-l)/u,d=[];for(d.push(C()),o=e.length-1;o>-1;o--)if(!(s=e[o]).hidden){var p=s.v/c;f+=p,d.push(C())}var h=1/0,v=-1/0;for(o=0;o-1;o--)if(!(s=e[o]).hidden){var M=d[T+=1][0],S=d[T][1];s.TL=[-M,S],s.TR=[M,S],s.BL=_,s.BR=k,s.pxmid=w(s.TR,s.BR),_=s.TL,k=s.TR}}function A(){var e=Math.sqrt(f);return{x:e,y:-e}}function C(){var e=A();return[e.x,e.y]}}(t),d.each((function(){var d=n.select(this).selectAll("g.slice").data(t);d.enter().append("g").classed("slice",!0),d.exit().remove(),d.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=g.index;var d=h.cx,y=h.cy,x=n.select(this),w=x.selectAll("path.surface").data([o]);w.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),x.call(v,e,t);var k="M"+(d+o.TR[0])+","+(y+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";w.attr("d",k),b(e,o,h);var T=p.castOption(g.textposition,o.pts),M=x.selectAll("g.slicetext").data(o.text&&"none"!==T?[0]:[]);M.enter().append("g").classed("slicetext",!0),M.exit().remove(),M.each((function(){var r=a.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),p=a.ensureUniformFontSize(e,m(g,o,c.font));r.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,p).call(l.convertToTspans,e);var h,v,x,b=i.bBox(r.node()),_=Math.min(o.BL[1],o.BR[1])+y,w=Math.max(o.TL[1],o.TR[1])+y;v=Math.max(o.TL[0],o.BL[0])+d,x=Math.min(o.TR[0],o.BR[0])+d,(h=u(v,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,f(g.type,h,c),t[s].transform=h,a.setTransormAndDisplay(r,h)}))}}));var y=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);y.enter().append("g").classed("titletext",!0),y.exit().remove(),y.each((function(){var t=a.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),r=g.title.text;g._meta&&(r=a.templateString(r,g._meta)),t.text(r).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,g.title.font).call(l.convertToTspans,e);var u=x(h,c._size);t.attr("transform",s(u.x,u.y)+o(Math.min(1,u.scale))+s(u.tx,u.ty))}))}))}))}},71858:function(e,t,r){"use strict";var n=r(39898),i=r(63463),a=r(72597).resizeText;e.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");a(e,t,"funnelarea"),t.each((function(t){var r=t[0].trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each((function(t){n.select(this).call(i,t,r,e)}))}))}},21606:function(e,t,r){"use strict";var n=r(82196),i=r(9012),a=r(41940),o=r(12663).axisHoverFormat,s=r(5386).fF,l=r(5386).si,u=r(50693),c=r(1426).extendFlat;e.exports=c({z:{valType:"data_array",editType:"calc"},x:c({},n.x,{impliedEdits:{xtype:"array"}}),x0:c({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:c({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:c({},n.y,{impliedEdits:{ytype:"array"}}),y0:c({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:c({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:c({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:c({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:c({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:c({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:c({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:c({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:a({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:c({},i.showlegend,{dflt:!1})},{transforms:void 0},u("",{cLetter:"z",autoColorDflt:!1}))},90757:function(e,t,r){"use strict";var n=r(73972),i=r(71828),a=r(89298),o=r(42973),s=r(17562),l=r(78803),u=r(68296),c=r(4742),f=r(824),d=r(43907),p=r(70769),h=r(50606).BADNUM;function v(e){for(var t=[],r=e.length,n=0;n1){var t=(e[e.length-1]-e[0])/(e.length-1),r=Math.abs(t/100);for(T=0;Tr)return!1}return!0}(S.rangebreaks||A.rangebreaks)&&(k=function(e,t,r){for(var n=[],i=-1,a=0;a=0;o--)(s=((f[[(r=(a=d[o])[0])-1,i=a[1]]]||v)[2]+(f[[r+1,i]]||v)[2]+(f[[r,i-1]]||v)[2]+(f[[r,i+1]]||v)[2])/20)&&(l[a]=[r,i,s],d.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],c.push(l[a])}return c.sort((function(e,t){return t[2]-e[2]}))}},46248:function(e,t,r){"use strict";var n=r(30211),i=r(71828),a=r(89298),o=r(21081).extractOpts;e.exports=function(e,t,r,s,l){l||(l={});var u,c,f,d,p=l.isContour,h=e.cd[0],v=h.trace,m=e.xa,g=e.ya,y=h.x,x=h.y,b=h.z,_=h.xCenter,w=h.yCenter,k=h.zmask,T=v.zhoverformat,M=y,S=x;if(!1!==e.index){try{f=Math.round(e.index[1]),d=Math.round(e.index[0])}catch(N){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(f<0||f>=b[0].length||d<0||d>b.length)return}else{if(n.inbox(t-y[0],t-y[y.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(p){var A;for(M=[2*y[0]-y[1]],A=1;Av&&(g=Math.max(g,Math.abs(e[a][o]-h)/(m-v))))}return g}e.exports=function(e,t){var r,i=1;for(o(e,t),r=0;r.01;r++)i=o(e,t,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),e}},58623:function(e,t,r){"use strict";var n=r(71828);e.exports=function(e,t){e("texttemplate");var r=n.extendFlat({},t.font,{color:"auto",size:"auto"});n.coerceFont(e,"textfont",r)}},70769:function(e,t,r){"use strict";var n=r(73972),i=r(71828).isArrayOrTypedArray;e.exports=function(e,t,r,a,o,s){var l,u,c,f=[],d=n.traceIs(e,"contour"),p=n.traceIs(e,"histogram"),h=n.traceIs(e,"gl2d");if(i(t)&&t.length>1&&!p&&"category"!==s.type){var v=t.length;if(!(v<=o))return d?t.slice(0,o):t.slice(0,o+1);if(d||h)f=t.slice(0,o);else if(1===o)f=[t[0]-.5,t[0]+.5];else{for(f=[1.5*t[0]-.5*t[1]],c=1;c0;)T=M.c2p(N[P]),P--;for(T0;)E=S.c2p(Z[P]),P--;E=M._length||T<=0||C>=S._length||E<=0)return R.selectAll("image").data([]).exit().remove(),void b(R);"fast"===X?($=G,J=W):($=Q,J=ee);var te=document.createElement("canvas");te.width=$,te.height=J;var re,ne,ie=te.getContext("2d"),ae=p(D,{noNumericCheck:!0,returnArray:!0});"fast"===X?(re=q?function(e){return G-1-e}:l.identity,ne=Y?function(e){return W-1-e}:l.identity):(re=function(e){return l.constrain(Math.round(M.c2p(N[e])-r),0,Q)},ne=function(e){return l.constrain(Math.round(S.c2p(Z[e])-C),0,ee)});var oe,se,le,ue,ce=ne(0),fe=[ce,ce],de=q?0:1,pe=Y?0:1,he=0,ve=0,me=0,ge=0;function ye(e,t){if(void 0!==e){var r=ae(e);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),he+=t,ve+=r[0]*t,me+=r[1]*t,ge+=r[2]*t,r}return[0,0,0,0]}function xe(e,t,r,n){var i=e[r.bin0];if(void 0===i)return ye(void 0,1);var a,o=e[r.bin1],s=t[r.bin0],l=t[r.bin1],u=o-i||0,c=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,ye(i+r.frac*u+n.frac*(c+r.frac*a))}if("default"!==X){var be,_e=0;try{be=new Uint8Array($*J*4)}catch(gt){be=new Array($*J*4)}if("smooth"===X){var we,ke,Te,Me=B||N,Se=V||Z,Ae=new Array(Me.length),Ce=new Array(Se.length),Ee=new Array(Q),Pe=B?w:_,Le=V?w:_;for(P=0;PXe||Xe>S._length))for(L=We;L$e||$e>M._length)){var Je=c({x:Ke,y:Ye},D,e._fullLayout);Je.x=Ke,Je.y=Ye;var Qe=O.z[P][L];void 0===Qe?(Je.z="",Je.zLabel=""):(Je.z=Qe,Je.zLabel=s.tickText(Be,Qe,"hover").text);var et=O.text&&O.text[P]&&O.text[P][L];void 0!==et&&!1!==et||(et=""),Je.text=et;var tt=l.texttemplateString(Ne,Je,e._fullLayout._d3locale,Je,D._meta||{});if(tt){var rt=tt.split("
"),nt=rt.length,it=0;for(I=0;I0&&(a=!0);for(var l=0;la){var o=a-r[e];return r[e]=a,o}}return 0},max:function(e,t,r,i){var a=i[t];if(n(a)){if(a=Number(a),!n(r[e]))return r[e]=a,a;if(r[e]u?e>o?e>1.1*i?i:e>1.1*a?a:o:e>s?s:e>l?l:u:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,a,s){if(n&&e>o){var l=h(t,a,s),u=h(r,a,s),c=e===i?0:1;return l[c]!==u[c]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(e,t,r,n,a){var s,l,u=-1.1*t,d=-.1*t,p=e-d,h=r[0],v=r[1],m=Math.min(f(h+d,h+p,n,a),f(v+d,v+p,n,a)),g=Math.min(f(h+u,h+d,n,a),f(v+u,v+d,n,a));if(m>g&&go){var y=s===i?1:6,x=s===i?"M12":"M1";return function(t,r){var o=n.c2d(t,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var u=n.d2c(o,0,a);if(ur.r2l(j)&&(Z=o.tickIncrement(Z,b.size,!0,p)),O.start=r.l2r(Z),F||i.nestedProperty(t,g+".start").set(O.start)}var B=b.end,V=r.r2l(R.end),U=void 0!==V;if((b.endFound||U)&&V!==r.r2l(B)){var H=U?V:i.aggNums(Math.max,null,h);O.end=r.l2r(H),U||i.nestedProperty(t,g+".start").set(O.end)}var W="autobin"+s;return!1===t._input[W]&&(t._input[g]=i.extendFlat({},t[g]||{}),delete t._input[W],delete t[W]),[O,h]}e.exports={calc:function(e,t){var r,a,p,h,v=[],m=[],g="h"===t.orientation,y=o.getFromId(e,g?t.yaxis:t.xaxis),x=g?"y":"x",b={x:"y",y:"x"}[x],_=t[x+"calendar"],w=t.cumulative,k=d(e,t,y,x),T=k[0],M=k[1],S="string"===typeof T.size,A=[],C=S?A:T,E=[],P=[],L=[],I=0,R=t.histnorm,O=t.histfunc,D=-1!==R.indexOf("density");w.enabled&&D&&(R=R.replace(/ ?density$/,""),D=!1);var z,F="max"===O||"min"===O?null:0,j=l.count,N=u[R],Z=!1,B=function(e){return y.r2c(e,0,_)};for(i.isArrayOrTypedArray(t[b])&&"count"!==O&&(z=t[b],Z="avg"===O,j=l[O]),r=B(T.start),p=B(T.end)+(r-o.tickIncrement(r,T.size,!1,_))/1e6;r=0&&h=0;n--)s(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(m,w.direction,w.currentbin);var $=Math.min(v.length,m.length),J=[],Q=0,ee=$-1;for(r=0;r<$;r++)if(m[r]){Q=r;break}for(r=$-1;r>=Q;r--)if(m[r]){ee=r;break}for(r=Q;r<=ee;r++)if(n(v[r])&&n(m[r])){var te={p:v[r],s:m[r],b:0};w.enabled||(te.pts=L[r],G?te.ph0=te.ph1=L[r].length?M[L[r][0]]:v[r]:(t._computePh=!0,te.ph0=H(A[r]),te.ph1=H(A[r+1],!0))),J.push(te)}return 1===J.length&&(J[0].width1=o.tickIncrement(J[0].p,T.size,!1,_)-J[0].p),s(J,t),i.isArrayOrTypedArray(t.selectedpoints)&&i.tagSelected(J,t,X),J},calcAllAutoBins:d}},72406:function(e){"use strict";e.exports={eventDataKeys:["binNumber"]}},82222:function(e,t,r){"use strict";var n=r(71828),i=r(41675),a=r(73972).traceIs,o=r(26125),s=n.nestedProperty,l=r(99082).getAxisGroup,u=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],c=["x","y"];e.exports=function(e,t){var r,f,d,p,h,v,m,g=t._histogramBinOpts={},y=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function k(e,r,a){var o=e.uid+"__"+a;r||(r=o);var s=function(e,r){return i.getFromTrace({_fullLayout:t},e,r).type}(e,a),l=e[a+"calendar"]||"",u=g[r],c=!0;u&&(s===u.axType&&l===u.calendar?(c=!1,u.traces.push(e),u.dirs.push(a)):(r=o,s!==u.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+s,"axis","with bins on","type:"+u.axType,"axis."].join(" ")),l!==u.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",l,"calendar","with bins",u.calendar?"on a "+u.calendar+" calendar":"w/o a set calendar"].join(" ")))),c&&(g[r]={traces:[e],dirs:[a],axType:s,calendar:e[a+"calendar"]||""}),e["_"+a+"bingroup"]=r}for(h=0;hA&&k.splice(A,k.length-A),S.length>A&&S.splice(A,S.length-A);var C=[],E=[],P=[],L="string"===typeof w.size,I="string"===typeof M.size,R=[],O=[],D=L?R:w,z=I?O:M,F=0,j=[],N=[],Z=t.histnorm,B=t.histfunc,V=-1!==Z.indexOf("density"),U="max"===B||"min"===B?null:0,H=a.count,W=o[Z],G=!1,q=[],Y=[],X="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";X&&"count"!==B&&(G="avg"===B,H=a[B]);var K=w.size,$=x(w.start),J=x(w.end)+($-i.tickIncrement($,K,!1,g))/1e6;for(r=$;r=0&&p=0&&h-1,flipY:P.tiling.flip.indexOf("y")>-1,orientation:P.tiling.orientation,pad:{inner:P.tiling.pad},maxDepth:P._maxDepth}).descendants(),D=1/0,z=-1/0;O.forEach((function(e){var t=e.depth;t>=P._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(D=Math.min(D,t),z=Math.max(z,t))})),h=h.data(O,c.getPtId),P._maxVisibleLayers=isFinite(z)?z-D+1:0,h.enter().append("g").classed("slice",!0),T(h,p,{},[m,g],b),h.order();var F=null;if(k&&A){var j=c.getPtId(A);h.each((function(e){null===F&&c.getPtId(e)===j&&(F={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var N=function(){return F||{x0:0,x1:m,y0:0,y1:g}},Z=h;return k&&(Z=Z.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),Z.each((function(s){s._x0=y(s.x0),s._x1=y(s.x1),s._y0=x(s.y0),s._y1=x(s.y1),s._hoverX=y(s.x1-P.tiling.pad),s._hoverY=x(R?s.y1-P.tiling.pad/2:s.y0+P.tiling.pad/2);var h=n.select(this),v=i.ensureSingle(h,"path","surface",(function(e){e.style("pointer-events",C?"none":"all")}));k?v.transition().attrTween("d",(function(e){var t=M(e,p,N(),[m,g],{orientation:P.tiling.orientation,flipX:P.tiling.flip.indexOf("x")>-1,flipY:P.tiling.flip.indexOf("y")>-1});return function(e){return b(t(e))}})):v.attr("d",b),h.call(f,r,e,t,{styleOne:l,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),v.call(l,s,P,e,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=d(s,r,P,t,E)||"";var T=i.ensureSingle(h,"g","slicetext"),A=i.ensureSingle(T,"text","",(function(e){e.attr("data-notex",1)})),O=i.ensureUniformFontSize(e,c.determineTextFont(P,s,E.font));A.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",I?"end":L?"start":"middle").call(a.font,O).call(o.convertToTspans,e),s.textBB=a.bBox(A.node()),s.transform=_(s,{fontSize:O.size}),s.transform.fontSize=O.size,k?A.transition().attrTween("transform",(function(e){var t=S(e,p,N(),[m,g]);return function(e){return w(t(e))}})):A.attr("transform",w(s))})),F}},69816:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:r(96346),categories:[],animatable:!0,attributes:r(46291),layoutAttributes:r(92894),supplyDefaults:r(56524),supplyLayoutDefaults:r(21070),calc:r(46584).y,crossTraceCalc:r(46584).T,plot:r(85596),style:r(82454).style,colorbar:r(4898),meta:{}}},92894:function(e){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},21070:function(e,t,r){"use strict";var n=r(71828),i=r(92894);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("iciclecolorway",t.colorway),r("extendiciclecolors")}},21538:function(e,t,r){"use strict";var n=r(674),i=r(14102);e.exports=function(e,t,r){var a=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,u=t[0],c=t[1];l&&(u=(e.height+1)*t[0]/Math.min(e.height+1,l),c=(e.height+1)*t[1]/Math.min(e.height+1,l));var f=n.partition().padding(r.pad.inner).size(s?[t[1],u]:[t[0],c])(e);return(s||a||o)&&i(f,t,{swapXY:s,flipX:a,flipY:o}),f}},85596:function(e,t,r){"use strict";var n=r(80694),i=r(90666);e.exports=function(e,t,r,a){return n(e,t,r,a,{type:"icicle",drawDescendants:i})}},82454:function(e,t,r){"use strict";var n=r(39898),i=r(7901),a=r(71828),o=r(72597).resizeText,s=r(43467);function l(e,t,r,n){var o=t.data.data,l=!t.children,u=o.i,c=a.castOption(r,u,"marker.line.color")||i.defaultLine,f=a.castOption(r,u,"marker.line.width")||0;e.call(s,t,r,n).style("stroke-width",f).call(i.stroke,c).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(e){var t=e._fullLayout._iciclelayer.selectAll(".trace");o(e,t,"icicle"),t.each((function(t){var r=n.select(this),i=t[0].trace;r.style("opacity",i.opacity),r.selectAll("path.surface").each((function(t){n.select(this).call(l,t,i,e)}))}))},styleOne:l}},17230:function(e,t,r){"use strict";for(var n=r(9012),i=r(5386).fF,a=r(1426).extendFlat,o=r(51877).colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],u=[],c=0;c0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var c,f=Math.floor((t-o.x0)/s.dx),d=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?c=o.z[d][f]:s._hasSource&&(c=s._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,d,1,1).data),c){var p,h=o.hi||s.hoverinfo;if(h){var v=h.split("+");-1!==v.indexOf("all")&&(v=["color"]),-1!==v.indexOf("color")&&(p=!0)}var m,g=a.colormodel[s.colormodel],y=g.colormodel||s.colormodel,x=y.length,b=s._scaler(c),_=g.suffix,w=[];(s.hovertemplate||p)&&(w.push("["+[b[0]+_[0],b[1]+_[1],b[2]+_[2]].join(", ")),4===x&&w.push(", "+b[3]+_[3]),w.push("]"),w=w.join(""),e.extraText=y.toUpperCase()+": "+w),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[d])?m=s.hovertext[d][f]:Array.isArray(s.text)&&Array.isArray(s.text[d])&&(m=s.text[d][f]);var k=u.c2p(o.y0+(d+.5)*s.dy),T=o.x0+(f+.5)*s.dx,M=o.y0+(d+.5)*s.dy,S="["+c.slice(0,s.colormodel.length).join(", ")+"]";return[i.extendFlat(e,{index:[d,f],x0:l.c2p(o.x0+f*s.dx),x1:l.c2p(o.x0+(f+1)*s.dx),y0:k,y1:k,color:b,xVal:T,xLabelVal:T,yVal:M,yLabelVal:M,zLabelVal:S,text:m,hovertemplateLabels:{zLabel:S,colorLabel:w,"color[0]Label":b[0]+_[0],"color[1]Label":b[1]+_[1],"color[2]Label":b[2]+_[2],"color[3]Label":b[3]+_[3]}})]}}}},94507:function(e,t,r){"use strict";e.exports={attributes:r(17230),supplyDefaults:r(13245),calc:r(71113),plot:r(60775),style:r(12826),hoverPoints:r(28749),eventData:r(30835),moduleType:"trace",name:"image",basePlotModule:r(93612),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},60775:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=i.strTranslate,o=r(77922),s=r(51877),l=r(3883),u=r(32396).STYLE;e.exports=function(e,t,r,c){var f=t.xaxis,d=t.yaxis,p=!e._context._exportedPlot&&l();i.makeTraceGroups(c,r,"im").each((function(t){var r=n.select(this),l=t[0],c=l.trace,h=("fast"===c.zsmooth||!1===c.zsmooth&&p)&&!c._hasZ&&c._hasSource&&"linear"===f.type&&"linear"===d.type;c._realImage=h;var v,m,g,y,x,b,_=l.z,w=l.x0,k=l.y0,T=l.w,M=l.h,S=c.dx,A=c.dy;for(b=0;void 0===v&&b0;)m=f.c2p(w+b*S),b--;for(b=0;void 0===y&&b0;)x=d.c2p(k+b*A),b--;mR[0];if(O||D){var z=v+C/2,F=y+E/2;L+="transform:"+a(z+"px",F+"px")+"scale("+(O?-1:1)+","+(D?-1:1)+")"+a(-z+"px",-F+"px")+";"}}P.attr("style",L);var j=new Promise((function(e){if(c._hasZ)e();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===M&&c._canvas.source===c.source)e();else{var t=document.createElement("canvas");t.width=T,t.height=M;var r=t.getContext("2d",{willReadFrequently:!0});c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:t,source:c.source},e()},n.setAttribute("src",c.source)}})).then((function(){var e,t;if(c._hasZ)t=N((function(e,t){return _[t][e]})),e=t.toDataURL("image/png");else if(c._hasSource)if(h)e=c.source;else{var r=c._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,T,M).data;t=N((function(e,t){var n=4*(t*T+e);return[r[n],r[n+1],r[n+2],r[n+3]]})),e=t.toDataURL("image/png")}P.attr({"xlink:href":e,height:E,width:C,x:v,y:y})}));e._promises.push(j)}function N(e){var t=document.createElement("canvas");t.width=C,t.height=E;var r,n=t.getContext("2d",{willReadFrequently:!0}),a=function(e){return i.constrain(Math.round(f.c2p(w+e*S)-v),0,C)},o=function(e){return i.constrain(Math.round(d.c2p(k+e*A)-y),0,E)},u=s.colormodel[c.colormodel],p=u.colormodel||c.colormodel,h=u.fmt;for(b=0;b0}function k(e){e.each((function(e){y.stroke(n.select(this),e.line.color)})).each((function(e){y.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function T(e,t,r){var n=e._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),a={type:"linear",_id:"x"+t._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(e,t){return o.coerce(i,a,g,e,t)}return v(i,a,l,s,n),m(i,a,l,s),a}function M(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function S(e,t,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(p.convertToTspans,i).call(f.font,t),f.bBox(o.node())}function A(e,t,r,n,i,a){var s="_cache"+t;e[s]&&e[s].key===i||(e[s]={key:i,value:r});var l=o.aggNums(a,null,[e[s].value,n],2);return e[s].value=l,l}e.exports=function(e,t,r,v){var m,g=e._fullLayout;w(r)&&v&&(m=v()),o.makeTraceGroups(g._indicatorlayer,t,"trace").each((function(t){var v,C,E,P,L,I=t[0].trace,R=n.select(this),O=I._hasGauge,D=I._isAngular,z=I._isBullet,F=I.domain,j={w:g._size.w*(F.x[1]-F.x[0]),h:g._size.h*(F.y[1]-F.y[0]),l:g._size.l+g._size.w*F.x[0],r:g._size.r+g._size.w*(1-F.x[1]),t:g._size.t+g._size.h*(1-F.y[1]),b:g._size.b+g._size.h*F.y[0]},N=j.l+j.w/2,Z=j.t+j.h/2,B=Math.min(j.w/2,j.h),V=d.innerRadius*B,U=I.align||"center";if(C=Z,O){if(D&&(v=N,C=Z+B/2,E=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height),n=t/r;return[n,e,t]}(e,.9*V)}),z){var H=d.bulletPadding,W=1-d.bulletNumberDomainSize+H;v=j.l+(W+(1-W)*b[U])*j.w,E=function(e){return M(e,(d.bulletNumberDomainSize-H)*j.w,j.h)}}}else v=j.l+b[U]*j.w,E=function(e){return M(e,j.w,j.h)};!function(e,t,r,i){var u,c,d,v=r[0].trace,m=i.numbersX,g=i.numbersY,k=v.align||"center",M=x[k],C=i.transitionOpts,E=i.onComplete,P=o.ensureSingle(t,"g","numbers"),L=[];v._hasNumber&&L.push("number"),v._hasDelta&&(L.push("delta"),"left"===v.delta.position&&L.reverse());var I=P.selectAll("text").data(L);function R(t,r,n,i){if(!t.match("s")||n>=0===i>=0||r(n).slice(-1).match(_)||r(i).slice(-1).match(_))return r;var a=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=T(e,{tickformat:a});return function(e){return Math.abs(e)<1?h.tickText(o,e).text:r(e)}}function O(){var t=T(e,{tickformat:v.number.valueformat},v._range);t.setScale(),h.prepTicks(t);var i=function(e){return h.tickText(t,e).text},o=v.number.suffix,s=v.number.prefix,l=P.select("text.number");function c(){var t="number"===typeof r[0].y?s+i(r[0].y)+o:"-";l.text(t).call(f.font,v.number.font).call(p.convertToTspans,e)}return w(C)?l.transition().duration(C.duration).ease(C.easing).each("end",(function(){c(),E&&E()})).each("interrupt",(function(){c(),E&&E()})).attrTween("text",(function(){var e=n.select(this),t=a(r[0].lastY,r[0].y);v._lastValue=r[0].y;var l=R(v.number.valueformat,i,r[0].lastY,r[0].y);return function(r){e.text(s+l(t(r))+o)}})):c(),u=S(s+i(r[0].y)+o,v.number.font,M,e),l}function D(){var t=T(e,{tickformat:v.delta.valueformat},v._range);t.setScale(),h.prepTicks(t);var i=function(e){return h.tickText(t,e).text},o=v.delta.suffix,s=v.delta.prefix,l=function(e){return v.delta.relative?e.relativeDelta:e.delta},u=function(e,t){return 0===e||"number"!==typeof e||isNaN(e)?"-":(e>0?v.delta.increasing.symbol:v.delta.decreasing.symbol)+s+t(e)+o},d=function(e){return e.delta>=0?v.delta.increasing.color:v.delta.decreasing.color};void 0===v._deltaLastValue&&(v._deltaLastValue=l(r[0]));var m=P.select("text.delta");function g(){m.text(u(l(r[0]),i)).call(y.fill,d(r[0])).call(p.convertToTspans,e)}return m.call(f.font,v.delta.font).call(y.fill,d({delta:v._deltaLastValue})),w(C)?m.transition().duration(C.duration).ease(C.easing).tween("text",(function(){var e=n.select(this),t=l(r[0]),o=v._deltaLastValue,s=R(v.delta.valueformat,i,o,t),c=a(o,t);return v._deltaLastValue=t,function(t){e.text(u(c(t),s)),e.call(y.fill,d({delta:c(t)}))}})).each("end",(function(){g(),E&&E()})).each("interrupt",(function(){g(),E&&E()})):g(),c=S(u(l(r[0]),i),v.delta.font,M,e),m}I.enter().append("text"),I.attr("text-anchor",(function(){return M})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),I.exit().remove();var z,F=v.mode+v.align;if(v._hasDelta&&(z=D(),F+=v.delta.position+v.delta.font.size+v.delta.font.family+v.delta.valueformat,F+=v.delta.increasing.symbol+v.delta.decreasing.symbol,d=c),v._hasNumber&&(O(),F+=v.number.font.size+v.number.font.family+v.number.valueformat+v.number.suffix+v.number.prefix,d=u),v._hasDelta&&v._hasNumber){var j,N,Z=[(u.left+u.right)/2,(u.top+u.bottom)/2],B=[(c.left+c.right)/2,(c.top+c.bottom)/2],V=.75*v.delta.font.size;"left"===v.delta.position&&(j=A(v,"deltaPos",0,-1*(u.width*b[v.align]+c.width*(1-b[v.align])+V),F,Math.min),N=Z[1]-B[1],d={width:u.width+c.width+V,height:Math.max(u.height,c.height),left:c.left+j,right:u.right,top:Math.min(u.top,c.top+N),bottom:Math.max(u.bottom,c.bottom+N)}),"right"===v.delta.position&&(j=A(v,"deltaPos",0,u.width*(1-b[v.align])+c.width*b[v.align]+V,F,Math.max),N=Z[1]-B[1],d={width:u.width+c.width+V,height:Math.max(u.height,c.height),left:u.left,right:c.right+j,top:Math.min(u.top,c.top+N),bottom:Math.max(u.bottom,c.bottom+N)}),"bottom"===v.delta.position&&(j=null,N=c.height,d={width:Math.max(u.width,c.width),height:u.height+c.height,left:Math.min(u.left,c.left),right:Math.max(u.right,c.right),top:u.bottom-u.height,bottom:u.bottom+c.height}),"top"===v.delta.position&&(j=null,N=u.top,d={width:Math.max(u.width,c.width),height:u.height+c.height,left:Math.min(u.left,c.left),right:Math.max(u.right,c.right),top:u.bottom-u.height-c.height,bottom:u.bottom}),z.attr({dx:j,dy:N})}(v._hasNumber||v._hasDelta)&&P.attr("transform",(function(){var e=i.numbersScaler(d);F+=e[2];var t,r=A(v,"numbersScale",1,e[0],F,Math.min);v._scaleNumbers||(r=1),t=v._isAngular?g-r*d.bottom:g-r*(d.top+d.bottom)/2,v._numbersTop=r*d.top+t;var n=d[k];"center"===k&&(n=(d.left+d.right)/2);var a=m-r*n;return a=A(v,"numbersTranslate",0,a,F,Math.max),l(a,t)+s(r)}))}(e,R,t,{numbersX:v,numbersY:C,numbersScaler:E,transitionOpts:r,onComplete:m}),O&&(P={range:I.gauge.axis.range,color:I.gauge.bgcolor,line:{color:I.gauge.bordercolor,width:0},thickness:1},L={range:I.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:I.gauge.bordercolor,width:I.gauge.borderwidth},thickness:1});var G=R.selectAll("g.angular").data(D?t:[]);G.exit().remove();var q=R.selectAll("g.angularaxis").data(D?t:[]);q.exit().remove(),D&&function(e,t,r,a){var o,s,f,d,p=r[0].trace,v=a.size,m=a.radius,g=a.innerRadius,y=a.gaugeBg,x=a.gaugeOutline,b=[v.l+v.w/2,v.t+v.h/2+m/2],_=a.gauge,M=a.layer,S=a.transitionOpts,A=a.onComplete,C=Math.PI/2;function E(e){var t=p.gauge.axis.range[0],r=(e-t)/(p.gauge.axis.range[1]-t)*Math.PI-C;return r<-C?-C:r>C?C:r}function P(e){return n.svg.arc().innerRadius((g+m)/2-e/2*(m-g)).outerRadius((g+m)/2+e/2*(m-g)).startAngle(-C)}function L(e){e.attr("d",(function(e){return P(e.thickness).startAngle(E(e.range[0])).endAngle(E(e.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",l(b[0],b[1])),M.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),M.selectAll("g.xangularaxistick,path,text").remove(),(o=T(e,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var I=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},R={},O=h.makeLabelFns(o,0).labelStandoff;R.xFn=function(e){var t=I(e);return Math.cos(t)*O},R.yFn=function(e){var t=I(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(O+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*c)},R.anchorFn=function(e){var t=I(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},R.heightFn=function(e,t,r){var n=I(e);return-.5*(1+Math.sin(n))*r};var D=function(e){return l(b[0]+m*Math.cos(e),b[1]-m*Math.sin(e))};f=function(e){return D(I(e))};var z=function(e){var t=I(e);return D(t)+"rotate("+-u(t)+")"};if(s=h.calcTicks(o),d=h.getTickSigns(o)[2],o.visible){d="inside"===o.ticks?-1:1;var F=(o.linewidth||1)/2;h.drawTicks(e,o,{vals:s,layer:M,path:"M"+d*F+",0h"+d*o.ticklen,transFn:z}),h.drawLabels(e,o,{vals:s,layer:M,transFn:f,labelFns:R})}var j=[y].concat(p.gauge.steps),N=_.selectAll("g.bg-arc").data(j);N.enter().append("g").classed("bg-arc",!0).append("path"),N.select("path").call(L).call(k),N.exit().remove();var Z=P(p.gauge.bar.thickness),B=_.selectAll("g.value-arc").data([p.gauge.bar]);B.enter().append("g").classed("value-arc",!0).append("path");var V,U,H,W=B.select("path");w(S)?(W.transition().duration(S.duration).ease(S.easing).each("end",(function(){A&&A()})).each("interrupt",(function(){A&&A()})).attrTween("d",(V=Z,U=E(r[0].lastY),H=E(r[0].y),function(){var e=i(U,H);return function(t){return V.endAngle(e(t))()}})),p._lastValue=r[0].y):W.attr("d","number"===typeof r[0].y?Z.endAngle(E(r[0].y)):"M0,0Z"),W.call(k),B.exit().remove(),j=[];var G=p.gauge.threshold.value;(G||0===G)&&j.push({range:[G,G],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var q=_.selectAll("g.threshold-arc").data(j);q.enter().append("g").classed("threshold-arc",!0).append("path"),q.select("path").call(L).call(k),q.exit().remove();var Y=_.selectAll("g.gauge-outline").data([x]);Y.enter().append("g").classed("gauge-outline",!0).append("path"),Y.select("path").call(L).call(k),Y.exit().remove()}(e,0,t,{radius:B,innerRadius:V,gauge:G,layer:q,size:j,gaugeBg:P,gaugeOutline:L,transitionOpts:r,onComplete:m});var Y=R.selectAll("g.bullet").data(z?t:[]);Y.exit().remove();var X=R.selectAll("g.bulletaxis").data(z?t:[]);X.exit().remove(),z&&function(e,t,r,n){var i,a,o,s,u,c=r[0].trace,f=n.gauge,p=n.layer,v=n.gaugeBg,m=n.gaugeOutline,g=n.size,x=c.domain,b=n.transitionOpts,_=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",l(g.l,g.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var M=g.h,S=c.gauge.bar.thickness*M,A=x.x[0],C=x.x[0]+(x.x[1]-x.x[0])*(c._hasNumber||c._hasDelta?1-d.bulletNumberDomainSize:1);function E(e){e.attr("width",(function(e){return Math.max(0,i.c2p(e.range[1])-i.c2p(e.range[0]))})).attr("x",(function(e){return i.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*M})).attr("height",(function(e){return e.thickness*M}))}(i=T(e,c.gauge.axis))._id="xbulletaxis",i.domain=[A,C],i.setScale(),a=h.calcTicks(i),o=h.makeTransTickFn(i),s=h.getTickSigns(i)[2],u=g.t+g.h,i.visible&&(h.drawTicks(e,i,{vals:"inside"===i.ticks?h.clipEnds(i,a):a,layer:p,path:h.makeTickPath(i,u,s),transFn:o}),h.drawLabels(e,i,{vals:a,layer:p,transFn:o,labelFns:h.makeLabelFns(i,u)}));var P=[v].concat(c.gauge.steps),L=f.selectAll("g.bg-bullet").data(P);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(E).call(k),L.exit().remove();var I=f.selectAll("g.value-bullet").data([c.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",S).attr("y",(M-S)/2).call(k),w(b)?I.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y)))):I.select("rect").attr("width","number"===typeof r[0].y?Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y))):0),I.exit().remove();var R=r.filter((function(){return c.gauge.threshold.value||0===c.gauge.threshold.value})),O=f.selectAll("g.threshold-bullet").data(R);O.enter().append("g").classed("threshold-bullet",!0).append("line"),O.select("line").attr("x1",i.c2p(c.gauge.threshold.value)).attr("x2",i.c2p(c.gauge.threshold.value)).attr("y1",(1-c.gauge.threshold.thickness)/2*M).attr("y2",(1-(1-c.gauge.threshold.thickness)/2)*M).call(y.stroke,c.gauge.threshold.line.color).style("stroke-width",c.gauge.threshold.line.width),O.exit().remove();var D=f.selectAll("g.gauge-outline").data([m]);D.enter().append("g").classed("gauge-outline",!0).append("rect"),D.select("rect").call(E).call(k),D.exit().remove()}(e,0,t,{gauge:Y,layer:X,size:j,gaugeBg:P,gaugeOutline:L,transitionOpts:r,onComplete:m});var K=R.selectAll("text.title").data(t);K.exit().remove(),K.enter().append("text").classed("title",!0),K.attr("text-anchor",(function(){return z?x.right:x[I.title.align]})).text(I.title.text).call(f.font,I.title.font).call(p.convertToTspans,e),K.attr("transform",(function(){var e,t=j.l+j.w*b[I.title.align],r=d.titlePadding,n=f.bBox(K.node());return O?(D&&(e=I.gauge.axis.visible?f.bBox(q.node()).top-r-n.bottom:j.t+j.h/2-B/2-n.bottom-r),z&&(e=C-(n.top+n.bottom)/2,t=j.l-d.bulletPadding*j.w)):e=I._numbersTop-r-n.bottom,l(t,e)}))}))}},16249:function(e,t,r){"use strict";var n=r(50693),i=r(12663).axisHoverFormat,a=r(5386).fF,o=r(2418),s=r(9012),l=r(1426).extendFlat,u=r(30962).overrideAll,c=e.exports=u(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes",c.transforms=void 0},56959:function(e,t,r){"use strict";var n=r(78803),i=r(88489).processGrid,a=r(88489).filter;e.exports=function(e,t){t._len=Math.min(t.x.length,t.y.length,t.z.length,t.value.length),t._x=a(t.x,t._len),t._y=a(t.y,t._len),t._z=a(t.z,t._len),t._value=a(t.value,t._len);var r=i(t);t._gridFill=r.fill,t._Xs=r.Xs,t._Ys=r.Ys,t._Zs=r.Zs,t._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(t[r],t[r-1]),i=Math.max(t[r],t[r-1]);if(i>n&&n-1}function z(e,t){return null===e?t:e}function F(t,r,n){P();var i,a,o,l=[r],u=[n];if(s>=1)l=[r],u=[n];else if(s>0){var c=function(e,t){var r=e[0],n=e[1],i=e[2],a=function(e,t,r){for(var n=[],i=0;i-1?n[p]:E(h,v,g);d[p]=x>-1?x:I(h,v,g,z(t,y))}i=d[0],a=d[1],o=d[2],e._meshI.push(i),e._meshJ.push(a),e._meshK.push(o),++m}}function j(e,t,r,n){var i=e[3];in&&(i=n);for(var a=(e[3]-i)/(e[3]-t[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*e[s]+a*t[s];return o}function N(e,t,r){return e>=t&&e<=r}function Z(e){var t=.001*(C-A);return e>=A-t&&e<=C+t}function B(t){for(var r=[],n=0;n<4;n++){var i=t[n];r.push([e._x[i],e._y[i],e._z[i],e._value[i]])}return r}var V=3;function U(e,t,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[N(t[0][3],n,i),N(t[1][3],n,i),N(t[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(e,t,r){return Z(t[0][3])&&Z(t[1][3])&&Z(t[2][3])?(F(e,t,r),!0):aMath.abs(k-S)?[M,k]:[k,S];ee(r,E[0],E[1])}}var P=[[Math.min(A,S),Math.max(A,S)],[Math.min(M,C),Math.max(M,C)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i0&&(f.push(h.id),"x"===r?d.push([h.distRatio,0,0]):"y"===r?d.push([0,h.distRatio,0]):d.push([0,0,h.distRatio]))}else c=ie(1,"x"===r?b-1:"y"===r?_-1:w-1);f.length>0&&(n[a]="x"===r?te(t,f,o,s,d,n[a]):"y"===r?re(t,f,o,s,d,n[a]):ne(t,f,o,s,d,n[a]),a++),c.length>0&&(n[a]="x"===r?K(t,c,o,s,n[a]):"y"===r?$(t,c,o,s,n[a]):J(t,c,o,s,n[a]),a++)}var v=e.caps[r];v.show&&v.fill&&(O(v.fill),n[a]="x"===r?K(t,[0,b-1],o,s,n[a]):"y"===r?$(t,[0,_-1],o,s,n[a]):J(t,[0,w-1],o,s,n[a]),a++)}})),0===m&&L(),e._meshX=n,e._meshY=i,e._meshZ=a,e._meshIntensity=o,e._Xs=g,e._Ys=y,e._Zs=x}(),e}e.exports={findNearestOnAxis:l,generateIsoMeshes:d,createIsosurfaceTrace:function(e,t){var r=e.glplot.gl,i=n({gl:r}),a=new u(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}},82738:function(e,t,r){"use strict";var n=r(71828),i=r(73972),a=r(16249),o=r(1586);function s(e,t,r,n,a){var s=a("isomin"),l=a("isomax");void 0!==l&&null!==l&&void 0!==s&&null!==s&&s>l&&(t.isomin=null,t.isomax=null);var u=a("x"),c=a("y"),f=a("z"),d=a("value");u&&u.length&&c&&c.length&&f&&f.length&&d&&d.length?(i.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(e){a(e+"hoverformat");var t="caps."+e;a(t+".show")&&a(t+".fill");var r="slices."+e;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(e){a(e)})),o(e,t,n,a,{prefix:"",cLetter:"c"}),t._length=null):t.visible=!1}e.exports={supplyDefaults:function(e,t,r,i){s(e,t,0,i,(function(r,i){return n.coerce(e,t,a,r,i)}))},supplyIsoDefaults:s}},64943:function(e,t,r){"use strict";e.exports={attributes:r(16249),supplyDefaults:r(82738).supplyDefaults,calc:r(56959),colorbar:{min:"cmin",max:"cmax"},plot:r(22674).createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:r(58547),categories:["gl3d","showLegend"],meta:{}}},2418:function(e,t,r){"use strict";var n=r(50693),i=r(12663).axisHoverFormat,a=r(5386).fF,o=r(54532),s=r(9012),l=r(1426).extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},82932:function(e,t,r){"use strict";var n=r(78803);e.exports=function(e,t){t.intensity&&n(e,t,{vals:t.intensity,containerStr:"",cLetter:"c"})}},91134:function(e,t,r){"use strict";var n=r(9330).gl_mesh3d,i=r(9330).delaunay_triangulate,a=r(9330).alpha_shape,o=r(9330).convex_hull,s=r(81697).parseColorScale,l=r(78614),u=r(21081).extractOpts,c=r(90060);function f(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var d=f.prototype;function p(e){for(var t=[],r=e.length,n=0;n=t-.5)return!1;return!0}d.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index;e.data._cellCenter?e.traceCoordinate=e.data.dataCoordinate:e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[t]?e.textLabel=r[t]:r&&(e.textLabel=r),!0}},d.update=function(e){var t=this.scene,r=t.fullSceneLayout;this.data=e;var n,f=e.x.length,d=c(h(r.xaxis,e.x,t.dataScale[0],e.xcalendar),h(r.yaxis,e.y,t.dataScale[1],e.ycalendar),h(r.zaxis,e.z,t.dataScale[2],e.zcalendar));if(e.i&&e.j&&e.k){if(e.i.length!==e.j.length||e.j.length!==e.k.length||!m(e.i,f)||!m(e.j,f)||!m(e.k,f))return;n=c(v(e.i),v(e.j),v(e.k))}else n=0===e.alphahull?o(d):e.alphahull>0?a(e.alphahull,d):function(e,t){for(var r=["x","y","z"].indexOf(e),n=[],a=t.length,o=0;og):m=M>w,g=M;var S=u(w,k,T,M);S.pos=_,S.yc=(w+M)/2,S.i=b,S.dir=m?"increasing":"decreasing",S.x=S.pos,S.y=[T,k],y&&(S.orig_p=r[b]),h&&(S.tx=t.text[b]),v&&(S.htx=t.hovertext[b]),x.push(S)}else x.push({pos:_,empty:!0})}return t._extremes[l._id]=a.findExtremes(l,n.concat(d,f),{padded:!0}),x.length&&(x[0].t={labels:{open:i(e,"open:")+" ",high:i(e,"high:")+" ",low:i(e,"low:")+" ",close:i(e,"close:")+" "}}),x}e.exports={calc:function(e,t){var r=a.getFromId(e,t.xaxis),i=a.getFromId(e,t.yaxis),s=function(e,t,r){var i=r._minDiff;if(!i){var a,s=e._fullData,l=[];for(i=1/0,a=0;a"+u.labels[x]+n.hoverLabelText(s,b,l.yhoverformat):((y=i.extendFlat({},d)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=u.labels[x]+n.hoverLabelText(s,b,l.yhoverformat),y.name="",f.push(y),m[b]=y)}return f}function d(e,t,r,i){var a=e.cd,o=e.ya,l=a[0].trace,f=a[0].t,d=c(e,t,r,i);if(!d)return[];var p=a[d.index],h=d.index=p.i,v=p.dir;function m(e){return f.labels[e]+n.hoverLabelText(o,l[e][h],l.yhoverformat)}var g=p.hi||l.hoverinfo,y=g.split("+"),x="all"===g,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[m("open"),m("high"),m("low"),m("close")+" "+u[v]]:[];return _&&s(p,l,w),d.extraText=w.join("
"),d.y0=d.y1=o.c2p(p.yc,!0),[d]}e.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?f(e,t,r,n):d(e,t,r,n)},hoverSplit:f,hoverOnPoints:d}},54186:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:r(93612),categories:["cartesian","svg","showLegend"],meta:{},attributes:r(2522),supplyDefaults:r(16169),calc:r(3485).calc,plot:r(72314),style:r(53101),hoverPoints:r(66449).hoverPoints,selectPoints:r(67324)}},14555:function(e,t,r){"use strict";var n=r(73972),i=r(71828);e.exports=function(e,t,r,a){var o=r("x"),s=r("open"),l=r("high"),u=r("low"),c=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],a),s&&l&&u&&c){var f=Math.min(s.length,l.length,u.length,c.length);return o&&(f=Math.min(f,i.minRowLength(o))),t._length=f,f}}},72314:function(e,t,r){"use strict";var n=r(39898),i=r(71828);e.exports=function(e,t,r,a){var o=t.yaxis,s=t.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],a=r.t;if(!0!==r.trace.visible||a.empty)t.remove();else{var u=a.tickLen,c=t.selectAll("path").data(i.identity);c.enter().append("path"),c.exit().remove(),c.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=s.c2p(e.pos-u,!0),r=s.c2p(e.pos+u,!0),n=l?(t+r)/2:s.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}},67324:function(e){"use strict";e.exports=function(e,t){var r,n=e.cd,i=e.xaxis,a=e.yaxis,o=[],s=n[0].t.bPos||0;if(!1===t)for(r=0;r=e.length)return!1;if(void 0!==t[e[r]])return!1;t[e[r]]=!0}return!0}(r))for(t=0;t0;u&&(o="array");var c=r("categoryorder",o);"array"===c?(r("categoryarray"),r("ticktext")):(delete e.categoryarray,delete e.ticktext),u||"array"!==c||(t.categoryorder="trace")}}e.exports=function(e,t,r,f){function d(r,i){return n.coerce(e,t,l,r,i)}var p=s(e,t,{name:"dimensions",handleItemDefaults:c}),h=function(e,t,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(e,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=r}return 1/0}(e,t,r,f,d);o(t,f,d),Array.isArray(p)&&p.length||(t.visible=!1),u(t,p,"values",h),d("hoveron"),d("hovertemplate"),d("arrangement"),d("bundlecolors"),d("sortpaths"),d("counts");var v={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(d,"labelfont",v);var m={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(d,"tickfont",m)}},94873:function(e,t,r){"use strict";e.exports={attributes:r(99506),supplyDefaults:r(14647),calc:r(28699),plot:r(45784),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:r(27677),categories:["noOpacity"],meta:{}}},45460:function(e,t,r){"use strict";var n=r(39898),i=r(81684).k4,a=r(72391),o=r(30211),s=r(71828),l=s.strTranslate,u=r(91424),c=r(84267),f=r(63893);function d(e,t,r,i){var a=t._context.staticPlot,o=e.map(F.bind(0,t,r)),c=i.selectAll("g.parcatslayer").data([null]);c.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var d=c.selectAll("g.trace.parcats").data(o,p),y=d.enter().append("g").attr("class","trace parcats");d.attr("transform",(function(e){return l(e.x,e.y)})),y.append("g").attr("class","paths");var x=d.select("g.paths").selectAll("path.path").data((function(e){return e.paths}),p);x.attr("fill",(function(e){return e.model.color}));var w=x.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(e){return e.model.color})).attr("fill-opacity",0);_(w),x.attr("d",(function(e){return e.svgD})),w.empty()||x.sort(v),x.exit().remove(),x.on("mouseover",m).on("mouseout",g).on("click",b),y.append("g").attr("class","dimensions");var M=d.select("g.dimensions").selectAll("g.dimension").data((function(e){return e.dimensions}),p);M.enter().append("g").attr("class","dimension"),M.attr("transform",(function(e){return l(e.x,0)})),M.exit().remove();var S=M.selectAll("g.category").data((function(e){return e.categories}),p),A=S.enter().append("g").attr("class","category");S.attr("transform",(function(e){return l(0,e.y)})),A.append("rect").attr("class","catrect").attr("pointer-events","none"),S.select("rect.catrect").attr("fill","none").attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})),k(A);var C=S.selectAll("rect.bandrect").data((function(e){return e.bands}),p);C.each((function(){s.raiseToTop(this)})),C.attr("fill",(function(e){return e.color}));var O=C.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(e){return e.color})).attr("fill-opacity",0);C.attr("fill",(function(e){return e.color})).attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).attr("y",(function(e){return e.y})).attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"perpendicular"===e.parcatsViewModel.arrangement?"ns-resize":"move"})),T(O),C.exit().remove(),A.append("text").attr("class","catlabel").attr("pointer-events","none");var D=t._fullLayout.paper_bgcolor;S.select("text.catlabel").attr("text-anchor",(function(e){return h(e)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",f.makeTextShadow(D)).style("fill","rgb(0, 0, 0)").attr("x",(function(e){return h(e)?e.width+5:-5})).attr("y",(function(e){return e.height/2})).text((function(e){return e.model.categoryLabel})).each((function(e){u.font(n.select(this),e.parcatsViewModel.categorylabelfont),f.convertToTspans(n.select(this),t)})),A.append("text").attr("class","dimlabel"),S.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(e){return e.width/2})).attr("y",-5).text((function(e,t){return 0===t?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null})).each((function(e){u.font(n.select(this),e.parcatsViewModel.labelfont)})),S.selectAll("rect.bandrect").on("mouseover",E).on("mouseout",P),S.exit().remove(),M.call(n.behavior.drag().origin((function(e){return{x:e.x,y:0}})).on("dragstart",L).on("drag",I).on("dragend",R)),d.each((function(e){e.traceSelection=n.select(this),e.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),e.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),d.exit().remove()}function p(e){return e.key}function h(e){var t=e.parcatsViewModel.dimensions.length,r=e.parcatsViewModel.dimensions[t-1].model.dimensionInd;return e.model.dimensionInd===r}function v(e,t){return e.model.rawColor>t.model.rawColor?1:e.model.rawColor"),E=n.mouse(f)[0];o.loneHover({trace:d,x:b-h.left+v.left,y:_-h.top+v.top,text:C,color:e.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:k,idealAlign:E1&&d.displayInd===f.dimensions.length-1?(i=u.left,a="left"):(i=u.left+u.width,a="right");var v=c.model.count,m=c.model.categoryLabel,g=v/c.parcatsViewModel.model.count,y={countLabel:v,categoryLabel:m,probabilityLabel:g.toFixed(3)},x=[];-1!==c.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",y.countLabel].join(" ")),-1!==c.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+y.categoryLabel+"):",y.probabilityLabel].join(" "));var b=x.join("
");return{trace:p,x:o*(i-t.left),y:s*(h-t.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:y,eventData:[{data:p._input,fullData:p,count:v,category:m,probability:g}]}}function E(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var t,r=e.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=e.parcatsViewModel.hoveron,u=this;"color"===l?(function(e){var t=n.select(e).datum(),r=M(t);w(r),r.each((function(){s.raiseToTop(this)})),n.select(e.parentNode).selectAll("rect.bandrect").filter((function(e){return e.color===t.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(u),A(u,"plotly_hover",n.event)):(function(e){n.select(e.parentNode).selectAll("rect.bandrect").each((function(e){var t=M(e);w(t),t.each((function(){s.raiseToTop(this)}))})),n.select(e.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(u),S(u,"plotly_hover",n.event)),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?t=C(r,a,u):"color"===l?t=function(e,t,r){e._fullLayout._calcInverseTransform(e);var i,a,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=r.getBoundingClientRect(),u=n.select(r).datum(),f=u.categoryViewModel,d=f.parcatsViewModel,p=d.model.dimensions[f.model.dimensionInd],h=d.trace,v=l.y+l.height/2;d.dimensions.length>1&&p.displayInd===d.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var m=f.model.categoryLabel,g=u.parcatsViewModel.model.count,y=0;u.categoryViewModel.bands.forEach((function(e){e.color===u.color&&(y+=e.count)}));var x=f.model.count,b=0;d.pathSelection.each((function(e){e.model.color===u.color&&(b+=e.model.count)}));var _=y/g,w=y/b,k=y/x,T={countLabel:g,categoryLabel:m,probabilityLabel:_.toFixed(3)},M=[];-1!==f.parcatsViewModel.hoverinfoItems.indexOf("count")&&M.push(["Count:",T.countLabel].join(" ")),-1!==f.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(M.push("P(color \u2229 "+m+"): "+T.probabilityLabel),M.push("P("+m+" | color): "+w.toFixed(3)),M.push("P(color | "+m+"): "+k.toFixed(3)));var S=M.join("
"),A=c.mostReadable(u.color,["black","white"]);return{trace:h,x:o*(i-t.left),y:s*(v-t.top),text:S,color:u.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:A,fontSize:10,idealAlign:a,hovertemplate:h.hovertemplate,hovertemplateLabels:T,eventData:[{data:h._input,fullData:h,category:m,count:g,probability:_,categorycount:x,colorcount:b,bandcolorcount:y}]}}(r,a,u):"dimension"===l&&(t=function(e,t,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(C(e,t,this))})),i}(r,a,u)),t&&o.loneHover(t,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r}))}}function P(e){var t=e.parcatsViewModel;t.dragDimension||(_(t.pathSelection),k(t.dimensionSelection.selectAll("g.category")),T(t.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(t.graphDiv._fullLayout._hoverlayer.node()),t.pathSelection.sort(v),-1!==t.hoverinfoItems.indexOf("skip"))||("color"===e.parcatsViewModel.hoveron?A(this,"plotly_unhover",n.event):S(this,"plotly_unhover",n.event))}function L(e){"fixed"!==e.parcatsViewModel.arrangement&&(e.dragDimensionDisplayInd=e.model.displayInd,e.initialDragDimensionDisplayInds=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),e.dragHasMoved=!1,e.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(t){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=t.width+2&&-2<=i&&i<=t.height+2&&(e.dragCategoryDisplayInd=t.model.displayInd,e.initialDragCategoryDisplayInds=e.model.categories.map((function(e){return e.displayInd})),t.model.dragY=t.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(t){t.yf.y+f.height/2&&(o.model.displayInd=f.model.displayInd,f.model.displayInd=l),e.dragCategoryDisplayInd=o.model.displayInd}if(null===e.dragCategoryDisplayInd||"freeform"===e.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var d=e.parcatsViewModel.dimensions[r],p=e.parcatsViewModel.dimensions[i];void 0!==d&&a.model.dragXp.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=e.dragDimensionDisplayInd),e.dragDimensionDisplayInd=a.model.displayInd}Z(e.parcatsViewModel),N(e.parcatsViewModel),z(e.parcatsViewModel),D(e.parcatsViewModel)}}function R(e){if("fixed"!==e.parcatsViewModel.arrangement&&null!==e.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var t={},r=O(e.parcatsViewModel),i=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),o=e.initialDragDimensionDisplayInds.some((function(e,t){return e!==i[t]}));o&&i.forEach((function(r,n){var i=e.parcatsViewModel.model.dimensions[n].containerInd;t["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==e.dragCategoryDisplayInd){var l=e.model.categories.map((function(e){return e.displayInd}));if(s=e.initialDragCategoryDisplayInds.some((function(e,t){return e!==l[t]}))){var u=e.model.categories.slice().sort((function(e,t){return e.displayInd-t.displayInd})),c=u.map((function(e){return e.categoryValue})),f=u.map((function(e){return e.categoryLabel}));t["dimensions["+e.model.containerInd+"].categoryarray"]=[c],t["dimensions["+e.model.containerInd+"].ticktext"]=[f],t["dimensions["+e.model.containerInd+"].categoryorder"]="array"}}-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!e.dragHasMoved&&e.potentialClickBand&&("color"===e.parcatsViewModel.hoveron?A(e.potentialClickBand,"plotly_click",n.event.sourceEvent):S(e.potentialClickBand,"plotly_click",n.event.sourceEvent)),e.model.dragX=null,null!==e.dragCategoryDisplayInd&&(e.parcatsViewModel.dimensions[e.dragDimensionDisplayInd].categories[e.dragCategoryDisplayInd].model.dragY=null,e.dragCategoryDisplayInd=null),e.dragDimensionDisplayInd=null,e.parcatsViewModel.dragDimension=null,e.dragHasMoved=null,e.potentialClickBand=null,Z(e.parcatsViewModel),N(e.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){z(e.parcatsViewModel,!0),D(e.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(e.parcatsViewModel.graphDiv,t,[r])}))}}function O(e){for(var t,r=e.graphDiv._fullData,n=0;n=0;s--)c+="C"+u[s]+","+(t[s+1]+n)+" "+l[s]+","+(t[s]+n)+" "+(e[s]+r[s])+","+(t[s]+n),c+="l-"+r[s]+",0 ";return c+="Z"}function N(e){var t=e.dimensions,r=e.model,n=t.map((function(e){return e.categories.map((function(e){return e.y}))})),i=e.model.dimensions.map((function(e){return e.categories.map((function(e){return e.displayInd}))})),a=e.model.dimensions.map((function(e){return e.displayInd})),o=e.dimensions.map((function(e){return e.model.dimensionInd})),s=t.map((function(e){return e.x})),l=t.map((function(e){return e.width})),u=[];for(var c in r.paths)r.paths.hasOwnProperty(c)&&u.push(r.paths[c]);function f(e){var t=e.categoryInds.map((function(e,t){return i[t][e]}));return o.map((function(e){return t[e]}))}u.sort((function(t,r){var n=f(t),i=f(r);return"backward"===e.sortpaths&&(n.reverse(),i.reverse()),n.push(t.valueInds[0]),i.push(r.valueInds[0]),e.bundlecolors&&(n.unshift(t.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var d=new Array(u.length),p=t[0].model.count,h=t[0].categories.map((function(e){return e.height})).reduce((function(e,t){return e+t})),v=0;v0?h*(g.count/p):0;for(var y,x=new Array(n.length),b=0;b1?(e.width-80-16)/(n-1):0)*i;var a,o,s,l,u,c=[],f=e.model.maxCats,d=t.categories.length,p=t.count,h=e.height-8*(f-1),v=8*(f-d)/2,m=t.categories.map((function(e){return{displayInd:e.displayInd,categoryInd:e.categoryInd}}));for(m.sort((function(e,t){return e.displayInd-t.displayInd})),u=0;u0?o.count/p*h:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:v,bands:[],parcatsViewModel:e},v=v+a+8,c.push(s);return{key:t.dimensionInd,x:null!==t.dragX?t.dragX:r,y:0,width:16,model:t,categories:c,parcatsViewModel:e,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(e,t,r,n){d(r,e,n,t)}},45784:function(e,t,r){"use strict";var n=r(45460);e.exports=function(e,t,r,i){var a=e._fullLayout,o=a._paper,s=a._size;n(e,o,t,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},73362:function(e,t,r){"use strict";var n=r(50693),i=r(13838),a=r(41940),o=r(27670).Y,s=r(1426).extendFlat,l=r(44467).templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:a({editType:"plot"}),tickfont:a({editType:"plot"}),rangefont:a({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},i.tickvals,{editType:"plot"}),ticktext:s({},i.ticktext,{editType:"plot"}),tickformat:s({},i.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}},57920:function(e,t,r){"use strict";var n=r(25706),i=r(39898),a=r(28984).keyFun,o=r(28984).repeat,s=r(71828).sorterAsc,l=r(71828).strTranslate,u=n.bar.snapRatio;function c(e,t){return e*(1-u)+t*u}var f=n.bar.snapClose;function d(e,t){return e*(1-f)+t*f}function p(e,t,r,n){if(function(e,t){for(var r=0;r=t[r][0]&&e<=t[r][1])return!0;return!1}(r,n))return r;var i=e?-1:1,a=0,o=t.length-1;if(i<0){var s=a;a=o,o=s}for(var l=t[a],u=l,f=a;i*ft){d=r;break}}if(a=c,isNaN(a)&&(a=isNaN(f)||isNaN(d)?isNaN(f)?d:f:t-u[f][1]e[1]+r||t=.9*e[1]+.1*e[0]?"n":t<=.9*e[0]+.1*e[1]?"s":"ns"}(h,t);v&&(o.interval=l[a],o.intervalPix=h,o.region=v)}}if(e.ordinal&&!o.region){var m=e.unitTickvals,y=e.unitToPaddedPx.invert(t);for(r=0;r=x[0]&&y<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(e,t){i.event.sourceEvent.stopPropagation();var r=t.height-i.mouse(e)[1]-2*n.verticalPadding,a=t.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(t.unitToPaddedPx.invert):a.newExtent=[a.startExtent,t.unitToPaddedPx.invert(r)].sort(s),t.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(t),b(e.parentNode)}function k(e,t){var r=_(t,t.height-i.mouse(e)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function T(e){e.on("mousemove",(function(e){i.event.preventDefault(),e.parent.inBrushDrag||k(this,e)})).on("mouseleave",(function(e){e.parent.inBrushDrag||y()})).call(i.behavior.drag().on("dragstart",(function(e){!function(e,t){i.event.sourceEvent.stopPropagation();var r=t.height-i.mouse(e)[1]-2*n.verticalPadding,a=t.unitToPaddedPx.invert(r),o=t.brush,s=_(t,r),l=s.interval,u=o.svgBrush;if(u.wasDragged=!1,u.grabbingBar="ns"===s.region,u.grabbingBar){var c=l.map(t.unitToPaddedPx);u.grabPoint=r-c[0]-n.verticalPadding,u.barLength=c[1]-c[0]}u.clickableOrdinalRange=s.clickableOrdinalRange,u.stayingIntervals=t.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(u.stayingIntervals=u.stayingIntervals.filter((function(e){return e[0]!==l[0]&&e[1]!==l[1]}))),u.startExtent=s.region?l["s"===s.region?1:0]:a,t.parent.inBrushDrag=!0,u.brushStartCallback()}(this,e)})).on("drag",(function(e){w(this,e)})).on("dragend",(function(e){!function(e,t){var r=t.brush,n=r.filter,a=r.svgBrush;a._dragging||(k(e,t),w(e,t),t.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,t.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&t.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&S(r)):S(r),a.brushCallback(t),b(e.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(t.ordinal){var l=t.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(u?[a.newExtent]:[]),a.extent.length||S(r),a.brushCallback(t),u?b(e.parentNode,s):(s(),b(e.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,e)})))}function M(e,t){return e[0]-t[0]}function S(e){e.filterSpecified=!1,e.svgBrush.extent=[[-1/0,1/0]]}function A(e){for(var t,r=e.slice(),n=[],i=r.shift();i;){for(t=i.slice();(i=r.shift())&&i[0]<=t[1];)t[1]=Math.max(t[1],i[1]);n.push(t)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(e,t,r,n,i,a){var o,l=function(){var e,t,r=[];return{set:function(n){1===(r=n.map((function(e){return e.slice().sort(s)})).sort(M)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),e=A(r),t=r.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return e},getBounds:function(){return t}}}();return l.set(r),{filter:l,filterSpecified:t,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(e){var t=e.brush,r=function(e){return e.svgBrush.extent.map((function(e){return e.slice()}))}(t),n=r.slice();t.filter.set(n),o()}),brushEndCallback:a}}},ensureAxisBrush:function(e,t,r){var i=e.selectAll("."+n.cn.axisBrush).data(o,a);i.enter().append("g").classed(n.cn.axisBrush,!0),function(e,t,r){var i=r._context.staticPlot,a=e.selectAll(".background").data(o);a.enter().append("rect").classed("background",!0).call(h).call(v).style("pointer-events",i?"none":"auto").attr("transform",l(0,n.verticalPadding)),a.call(T).attr("height",(function(e){return e.height-n.verticalPadding}));var s=e.selectAll(".highlight-shadow").data(o);s.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",t).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),s.attr("y1",(function(e){return e.height})).call(x);var u=e.selectAll(".highlight").data(o);u.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),u.attr("y1",(function(e){return e.height})).call(x)}(i,t,r)},cleanRanges:function(e,t){if(Array.isArray(e[0])?(e=e.map((function(e){return e.sort(s)})),e=t.multiselect?A(e.sort(M)):[e[0]]):e=[e.sort(s)],t.tickvals){var r=t.tickvals.slice().sort(s);if(!(e=e.map((function(e){var t=[p(0,r,e[0],[]),p(1,r,e[1],[])];if(t[1]>t[0])return t})).filter((function(e){return e}))).length)return}return e.length>1?e:e[0]}}},71791:function(e,t,r){"use strict";e.exports={attributes:r(73362),supplyDefaults:r(3633),calc:r(24639),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:r(49351),categories:["gl","regl","noOpacity","noHover"],meta:{}}},49351:function(e,t,r){"use strict";var n=r(39898),i=r(27659).a0,a=r(21341),o=r(77922);t.name="parcoords",t.plot=function(e){var t=i(e.calcdata,"parcoords")[0];t.length&&a(e,t)},t.clean=function(e,t,r,n){var i=n._has&&n._has("parcoords"),a=t._has&&t._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},t.toSVG=function(e){var t=e._fullLayout._glimages,r=n.select(e).selectAll(".svg-container");r.filter((function(e,t){return t===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this,r=e.toDataURL("image/png");t.append("svg:image").attr({xmlns:o.svg,"xlink:href":r,preserveAspectRatio:"none",x:0,y:0,width:e.style.width,height:e.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},24639:function(e,t,r){"use strict";var n=r(71828).isArrayOrTypedArray,i=r(21081),a=r(28984).wrap;e.exports=function(e,t){var r,o;return i.hasColorscale(t,"line")&&n(t.line.color)?(r=t.line.color,o=i.extractOpts(t.line).colorscale,i.calc(e,t,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(e){for(var t=new Array(e),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),h.splice(f));var v=s(e,t,{name:"dimensions",layout:l,handleItemDefaults:p}),m=function(e,t,r,o,s){var l=s("line.color",r);if(i(e,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=r}return 1/0}(e,t,r,l,c);o(t,l,c),Array.isArray(v)&&v.length||(t.visible=!1),d(t,v,"values",m);var g={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(c,"labelfont",g),n.coerceFont(c,"tickfont",g),n.coerceFont(c,"rangefont",g),c("labelangle"),c("labelside"),c("unselected.line.color"),c("unselected.line.opacity")}},1602:function(e,t,r){"use strict";var n=r(71828).isTypedArray;t.convertTypedArray=function(e){return n(e)?Array.prototype.slice.call(e):e},t.isOrdinal=function(e){return!!e.tickvals},t.isVisible=function(e){return e.visible||!("visible"in e)}},67618:function(e,t,r){"use strict";var n=r(71791);n.plot=r(21341),e.exports=n},83398:function(e,t,r){"use strict";var n=r(56068),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=r(25706).maxDimensionCount,s=r(71828),l=1e-6,u=2048,c=new Uint8Array(4),f=new Uint8Array(4),d={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function p(e,t,r,n,i){var a=e._gl;a.enable(a.SCISSOR_TEST),a.scissor(t,r,n,i),e.clear({color:[0,0,0,0],depth:1})}function h(e,t,r,n,i,a){var o=a.key;r.drawCompleted||(function(e){e.read({x:0,y:0,width:1,height:1,data:c})}(e),r.drawCompleted=!0),function s(l){var u=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],p(e,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*u,a.offset=2*l*n,t(a),l*n+u>>8*t)%256/255}function g(e,t,r){for(var n=new Array(8*t),i=0,a=0;af&&(f=e[i].dim1.canvasX,o=i);0===s&&p(M,0,0,r.canvasWidth,r.canvasHeight);var d=function(e){var t,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!e&&no._length&&(A=A.slice(0,o._length));var E,P=o.tickvals;function L(e,t){return{val:e,text:E[t]}}function I(e,t){return e.val-t.val}if(Array.isArray(P)&&P.length){E=o.ticktext,Array.isArray(E)&&E.length?E.length>P.length?E=E.slice(0,P.length):P.length>E.length&&(P=P.slice(0,E.length)):E=P.map(a(o.tickformat));for(var R=1;R=r||l>=i)return;var u=e.lineLayer.readPixel(s,i-1-l),c=0!==u[3],f=c?u[2]+256*(u[1]+256*u[0]):null,d={x:s,y:l,clientX:t.clientX,clientY:t.clientY,dataIndex:e.model.key,curveNumber:f};f!==F&&(c?a.hover(d):a.unhover&&a.unhover(d),F=f)}})),z.style("opacity",(function(e){return e.pick?0:1})),p.style("background","rgba(255, 255, 255, 0)");var j=p.selectAll("."+y.cn.parcoords).data(A,h);j.exit().remove(),j.enter().append("g").classed(y.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),j.attr("transform",(function(e){return u(e.model.translateX,e.model.translateY)}));var N=j.selectAll("."+y.cn.parcoordsControlView).data(v,h);N.enter().append("g").classed(y.cn.parcoordsControlView,!0),N.attr("transform",(function(e){return u(e.model.pad.l,e.model.pad.t)}));var Z=N.selectAll("."+y.cn.yAxis).data((function(e){return e.dimensions}),h);Z.enter().append("g").classed(y.cn.yAxis,!0),N.each((function(e){R(Z,e,k)})),z.each((function(e){if(e.viewModel){!e.lineLayer||a?e.lineLayer=b(this,e):e.lineLayer.update(e),(e.key||0===e.key)&&(e.viewModel[e.key]=e.lineLayer);var t=!e.context||a;e.lineLayer.render(e.viewModel.panels,t)}})),Z.attr("transform",(function(e){return u(e.xScale(e.xIndex),0)})),Z.call(n.behavior.drag().origin((function(e){return e})).on("drag",(function(e){var t=e.parent;S.linePickActive(!1),e.x=Math.max(-y.overdrag,Math.min(e.model.width+y.overdrag,n.event.x)),e.canvasX=e.x*e.model.canvasPixelRatio,Z.sort((function(e,t){return e.x-t.x})).each((function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio})),R(Z,t,k),Z.filter((function(t){return 0!==Math.abs(e.xIndex-t.xIndex)})).attr("transform",(function(e){return u(e.xScale(e.xIndex),0)})),n.select(this).attr("transform",u(e.x,0)),Z.each((function(r,n,i){i===e.parent.key&&(t.dimensions[n]=r)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!C(t)),t.focusLayer.render&&t.focusLayer.render(t.panels)})).on("dragend",(function(e){var t=e.parent;e.x=e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio,R(Z,t,k),n.select(this).attr("transform",(function(e){return u(e.x,0)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!C(t)),t.focusLayer&&t.focusLayer.render(t.panels),t.pickLayer&&t.pickLayer.render(t.panels,!0),S.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(t.key,t.dimensions.map((function(e){return e.crossfilterDimensionIndex})))}))),Z.exit().remove();var B=Z.selectAll("."+y.cn.axisOverlays).data(v,h);B.enter().append("g").classed(y.cn.axisOverlays,!0),B.selectAll("."+y.cn.axis).remove();var V=B.selectAll("."+y.cn.axis).data(v,h);V.enter().append("g").classed(y.cn.axis,!0),V.each((function(e){var t=e.model.height/e.model.tickDistance,r=e.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(t,e.tickFormat).tickValues(e.ordinal?i:null).tickFormat((function(t){return g.isOrdinal(e)?t:O(e.model.dimensions[e.visibleIndex],t)})).scale(r)),f.font(V.selectAll("text"),e.model.tickFont)})),V.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),V.selectAll("text").style("text-shadow",c.makeTextShadow(M)).style("cursor","default");var U=B.selectAll("."+y.cn.axisHeading).data(v,h);U.enter().append("g").classed(y.cn.axisHeading,!0);var H=U.selectAll("."+y.cn.axisTitle).data(v,h);H.enter().append("text").classed(y.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),H.text((function(e){return e.label})).each((function(t){var r=n.select(this);f.font(r,t.model.labelFont),c.convertToTspans(r,e)})).attr("transform",(function(e){var t=I(e.model.labelAngle,e.model.labelSide),r=y.axisTitleOffset;return(t.dir>0?"":u(0,2*r+e.model.height))+l(t.degrees)+u(-r*t.dx,-r*t.dy)})).attr("text-anchor",(function(e){var t=I(e.model.labelAngle,e.model.labelSide);return 2*Math.abs(t.dx)>Math.abs(t.dy)?t.dir*t.dx<0?"start":"end":"middle"}));var W=B.selectAll("."+y.cn.axisExtent).data(v,h);W.enter().append("g").classed(y.cn.axisExtent,!0);var G=W.selectAll("."+y.cn.axisExtentTop).data(v,h);G.enter().append("g").classed(y.cn.axisExtentTop,!0),G.attr("transform",u(0,-y.axisExtentOffset));var q=G.selectAll("."+y.cn.axisExtentTopText).data(v,h);q.enter().append("text").classed(y.cn.axisExtentTopText,!0).call(L),q.text((function(e){return D(e,!0)})).each((function(e){f.font(n.select(this),e.model.rangeFont)}));var Y=W.selectAll("."+y.cn.axisExtentBottom).data(v,h);Y.enter().append("g").classed(y.cn.axisExtentBottom,!0),Y.attr("transform",(function(e){return u(0,e.model.height+y.axisExtentOffset)}));var X=Y.selectAll("."+y.cn.axisExtentBottomText).data(v,h);X.enter().append("text").classed(y.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(L),X.text((function(e){return D(e,!1)})).each((function(e){f.font(n.select(this),e.model.rangeFont)})),x.ensureAxisBrush(B,M,e)}},21341:function(e,t,r){"use strict";var n=r(17171),i=r(79749),a=r(1602).isVisible,o={};function s(e,t,r){var n=t.indexOf(r),i=e.indexOf(n);return-1===i&&(i+=t.length),i}(e.exports=function(e,t){var r=e._fullLayout;if(i(e,[],o)){var l={},u={},c={},f={},d=r._size;t.forEach((function(t,r){var n=t[0].trace;c[r]=n.index;var i=f[r]=n._fullInput.index;l[r]=e.data[i].dimensions,u[r]=e.data[i].dimensions.slice()})),n(e,t,{width:d.w,height:d.h,margin:{t:d.t,r:d.r,b:d.b,l:d.l}},{filterChanged:function(t,n,i){var a=u[t][n],o=i.map((function(e){return e.slice()})),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[e._fullData[c[t]]._fullInput.uid];if(void 0===l[s]){var d=a.constraintrange;l[s]=d||null}var p=e._fullData[c[t]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,p.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete p.constraintrange,o=null);var h={};h[s]=o,e.emit("plotly_restyle",[h,[f[t]]])},hover:function(t){e.emit("plotly_hover",t)},unhover:function(t){e.emit("plotly_unhover",t)},axesMoved:function(t,r){var n=function(e,t){return function(r,n){return s(e,t,r)-s(e,t,n)}}(r,u[t].filter(a));l[t].sort(n),u[t].filter((function(e){return!a(e)})).sort((function(e){return u[t].indexOf(e)})).forEach((function(e){l[t].splice(l[t].indexOf(e),1),l[t].splice(u[t].indexOf(e),0,e)})),e.emit("plotly_restyle",[{dimensions:[l[t]]},[f[t]]])}})}}).reglPrecompiled=o},34e3:function(e,t,r){"use strict";var n=r(9012),i=r(27670).Y,a=r(41940),o=r(22399),s=r(5386).fF,l=r(5386).si,u=r(1426).extendFlat,c=r(79952).u,f=a({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:u({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:u({},f,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:u({},f,{}),outsidetextfont:u({},f,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:u({},f,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:i({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:u({},f,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},13584:function(e,t,r){"use strict";var n=r(74875);t.name="pie",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},32354:function(e,t,r){"use strict";var n=r(92770),i=r(84267),a=r(7901),o={};function s(e){return function(t,r){return!!t&&!!(t=i(t)).isValid()&&(t=a.addOpacity(t,t.getAlpha()),e[r]||(e[r]=t),t)}}function l(e,t){var r,n=JSON.stringify(e),a=t[n];if(!a){for(a=e.slice(),r=0;r=0})),("funnelarea"===t.type?g:t.sort)&&a.sort((function(e,t){return t.v-e.v})),a[0]&&(a[0].vTotal=m),a},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,i=e.calcdata,a=n[r+"colorway"],s=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=l(a,o));for(var u=0,c=0;c0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}function c(e,t,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");l(n,"marker.pattern",a),e.marker&&!t.marker.pattern.fgcolor&&(t.marker.pattern.fgcolor=e.marker.colors),t.marker.pattern.bgcolor||(t.marker.pattern.bgcolor=r.paper_bgcolor)}e.exports={handleLabelsAndValues:u,handleMarkerDefaults:c,supplyDefaults:function(e,t,r,n){function l(r,n){return i.coerce(e,t,a,r,n)}var f=u(l("labels"),l("values")),d=f.len;if(t._hasLabels=f.hasLabels,t._hasValues=f.hasValues,!t._hasLabels&&t._hasValues&&(l("label0"),l("dlabel")),d){t._length=d,c(e,t,n,l,!0),l("scalegroup");var p,h=l("text"),v=l("texttemplate");if(v||(p=l("textinfo",Array.isArray(h)?"text+percent":"percent")),l("hovertext"),l("hovertemplate"),v||p&&"none"!==p){var m=l("textposition");s(e,t,n,l,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&l("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&l("insidetextorientation")}o(t,n,l);var g=l("hole");if(l("title.text")){var y=l("title.position",g?"middle center":"top center");g||"middle center"!==y||(t.title.position="top center"),i.coerceFont(l,"title.font",n.font)}l("sort"),l("direction"),l("rotation"),l("pull")}else t.visible=!1}}},20007:function(e,t,r){"use strict";var n=r(23469).appendArrayMultiPointValues;e.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},22209:function(e,t,r){"use strict";var n=r(91424),i=r(7901);e.exports=function(e,t,r,a){var o=r.marker.pattern;o&&o.shape?n.pointStyle(e,r,a,t):i.fill(e,t.color)}},53581:function(e,t,r){"use strict";var n=r(71828);function i(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}t.formatPiePercent=function(e,t){var r=i((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},t.formatPieValue=function(e,t){var r=i(e.toPrecision(10));return n.numSeparate(r,t)},t.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:f.hovertemplate||-1!==d.indexOf("name")?f.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:m.castOption(_.bgcolor,e.pts)||e.color,borderColor:m.castOption(_.bordercolor,e.pts),fontFamily:m.castOption(w.family,e.pts),fontSize:m.castOption(w.size,e.pts),fontColor:m.castOption(w.color,e.pts),nameLength:m.castOption(_.namelength,e.pts),textAlign:m.castOption(_.align,e.pts),hovertemplate:m.castOption(f.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:k}),e.bbox=k[0],u._hasHoverLabel=!0}u._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,f)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,i=t._fullData[u.index],o=n.select(this).datum();u._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(o,i)],event:n.event}),u._hasHoverEvent=!1),u._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),u._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,i=t._fullData[u.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,i)],a.click(t,n.event))}))}function b(e,t,r){var n=m.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=m.castOption(e._input.textfont.color,t.pts));var i=m.castOption(e.insidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,a=m.castOption(e.insidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:i,size:a}}function _(e,t){for(var r,n,i=0;it&&t>n||r=-4;m-=2)g(Math.PI*m,"tan");for(m=4;m>=-4;m-=2)g(Math.PI*(m+1),"tan")}if(f||p){for(m=4;m>=-4;m-=2)g(Math.PI*(m+1.5),"rad");for(m=4;m>=-4;m-=2)g(Math.PI*(m+.5),"rad")}}if(s||h||f){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((a={scale:i*n*2/y,rCenter:1-i,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,a.scale>=1)return a;v.push(a)}(h||p)&&((a=k(e,n,o,l,u)).textPosAngle=(t.startangle+t.stopangle)/2,v.push(a)),(h||d)&&((a=T(e,n,o,l,u)).textPosAngle=(t.startangle+t.stopangle)/2,v.push(a));for(var x=0,b=0,_=0;_=1)break}return v[x]}function k(e,t,r,n,i){t=Math.max(0,t-2*v);var a=e.width/e.height,o=A(a,n,t,r);return{scale:2*o/e.height,rCenter:M(a,o/t),rotate:S(i)}}function T(e,t,r,n,i){t=Math.max(0,t-2*v);var a=e.height/e.width,o=A(a,n,t,r);return{scale:2*o/e.width,rCenter:M(a,o/t),rotate:S(i+Math.PI/2)}}function M(e,t){return Math.cos(t)-e*t}function S(e){return(180/Math.PI*e+720)%180-90}function A(e,t,r,n){var i=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(e*e+n/2)+e))}function C(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function E(e,t){var r=t.pxmid[0],n=t.pxmid[1],i=e.width/2,a=e.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function P(e,t){var r,n,i,a=e.trace,o={x:e.cx,y:e.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=I(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*e.r,s.ty-=e.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*e.r);var l,u,c=(l=e.r,u=e.trace.aspectratio,l/(void 0===u?1:u)),f=t.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(f+=c,o.x-=(1+i)*c,s.tx+=e.titleBox.width/2):-1!==a.title.position.indexOf("center")?f*=2:-1!==a.title.position.indexOf("right")&&(f+=c,o.x+=(1+i)*c,s.tx-=e.titleBox.width/2),r=f/e.titleBox.width,n=L(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function L(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function I(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function R(e,t){for(var r=[],n=0;n1?c=(u=r.r)/i.aspectratio:u=(c=r.r)*i.aspectratio,l=(u*=(1+i.baseratio)/2)*c}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var x=l.castOption(i,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:m.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:m.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:l.castOption(i,e.i,"customdata")}}(t),_=m.getFirstFilled(i.text,t.pts);(y(_)||""===_)&&(b.text=_),t.text=l.texttemplateString(x,b,e._fullLayout._d3locale,b,i._meta||{})}else t.text=""}}function z(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=a*n-o*i,e.textY=a*i+o*n,e.noCenter=!0}e.exports={plot:function(e,t){var r=e._context.staticPlot,a=e._fullLayout,d=a._size;h("pie",a),_(t,e),R(t,d);var v=l.makeTraceGroups(a._pielayer,t,"trace").each((function(t){var h=n.select(this),v=t[0],g=v.trace;!function(e){var t,r,n,i=e[0],a=i.r,o=i.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,u="px0",c="px1";if("counterclockwise"===o.direction){for(t=0;ti.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=C(r,i))}(t),h.attr("stroke-linejoin","round"),h.each((function(){var y=n.select(this).selectAll("g.slice").data(t);y.enter().append("g").classed("slice",!0),y.exit().remove();var _=[[[],[]],[[],[]]],k=!1;y.each((function(i,o){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=g.index,_[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var u=v.cx,c=v.cy,d=n.select(this),h=d.selectAll("path.surface").data([i]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),d.call(x,e,t),g.pull){var y=+m.castOption(g.pull,i.pts)||0;y>0&&(u+=y*i.pxmid[0],c+=y*i.pxmid[1])}i.cxFinal=u,i.cyFinal=c;var T=g.hole;if(i.v===v.vTotal){var M="M"+(u+i.px0[0])+","+(c+i.px0[1])+L(i.px0,i.pxmid,!0,1)+L(i.pxmid,i.px0,!0,1)+"Z";T?h.attr("d","M"+(u+T*i.px0[0])+","+(c+T*i.px0[1])+L(i.px0,i.pxmid,!1,T)+L(i.pxmid,i.px0,!1,T)+"Z"+M):h.attr("d",M)}else{var S=L(i.px0,i.px1,!0,1);if(T){var A=1-T;h.attr("d","M"+(u+T*i.px1[0])+","+(c+T*i.px1[1])+L(i.px1,i.px0,!1,T)+"l"+A*i.px0[0]+","+A*i.px0[1]+S+"Z")}else h.attr("d","M"+u+","+c+"l"+i.px0[0]+","+i.px0[1]+S+"Z")}D(e,i,v);var C=m.castOption(g.textposition,i.pts),P=d.selectAll("g.slicetext").data(i.text&&"none"!==C?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each((function(){var r=l.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),d=l.ensureUniformFontSize(e,"outside"===C?function(e,t,r){var n=m.castOption(e.outsidetextfont.color,t.pts)||m.castOption(e.textfont.color,t.pts)||r.color,i=m.castOption(e.outsidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,a=m.castOption(e.outsidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:i,size:a}}(g,i,a.font):b(g,i,a.font));r.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,d).call(f.convertToTspans,e);var h,y=s.bBox(r.node());if("outside"===C)h=E(y,i);else if(h=w(y,i,v),"auto"===C&&h.scale<1){var x=l.ensureUniformFontSize(e,g.outsidetextfont);r.call(s.font,x),h=E(y=s.bBox(r.node()),i)}var _=h.textPosAngle,T=void 0===_?i.pxmid:O(v.r,_);if(h.targetX=u+T[0]*h.rCenter+(h.x||0),h.targetY=c+T[1]*h.rCenter+(h.y||0),z(h,y),h.outside){var M=h.targetY;i.yLabelMin=M-y.height/2,i.yLabelMid=M,i.yLabelMax=M+y.height/2,i.labelExtraX=0,i.labelExtraY=0,k=!0}h.fontSize=d.size,p(g.type,h,a),t[o].transform=h,l.setTransormAndDisplay(r,h)}))}function L(e,t,r,n){var a=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*v.r+","+n*v.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var T=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,r=l.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),i=g.title.text;g._meta&&(i=l.templateString(i,g._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,g.title.font).call(f.convertToTspans,e),t="middle center"===g.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(v):P(v,d),r.attr("transform",c(t.x,t.y)+u(Math.min(1,t.scale))+c(t.tx,t.ty))})),k&&function(e,t){var r,n,i,a,o,s,l,u,c,f,d,p,h;function v(e,t){return e.pxmid[1]-t.pxmid[1]}function g(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var i,u,c,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,v=n?e.yLabelMax:e.yLabelMin,g=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-h;if(y*l>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(u=0;u=(m.castOption(t.pull,c.pts)||0)||((e.pxmid[1]-c.pxmid[1])*l>0?(y=c.cyFinal+o(c.px0[1],c.px1[1])-h-e.labelExtraY)*l>0&&(e.labelExtraY+=y):(v+e.labelExtraY-g)*l>0&&(i=3*s*Math.abs(u-f.indexOf(e)),(d=c.cxFinal+a(c.px0[0],c.px1[0])+i-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*s>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(i=n?v:g,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(u=e[n][r]).sort(i),c=e[1-n][r],f=c.concat(u),p=[],d=0;dMath.abs(f)?s+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(a+e.labelExtraX+u):s+="l"+e.labelExtraX+","+c+"v"+(f-c)+"h"+u}else s+="V"+(e.yLabelMid+e.labelExtraY)+"h"+u;l.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(y,g),k&&g.automargin){var M=s.bBox(h.node()),S=g.domain,A=d.w*(S.x[1]-S.x[0]),C=d.h*(S.y[1]-S.y[0]),L=(.5*A-v.r)/d.w,I=(.5*C-v.r)/d.h;i.autoMargin(e,"pie."+g.uid+".automargin",{xl:S.x[0]-L,xr:S.x[1]+L,yb:S.y[0]-I,yt:S.y[1]+I,l:Math.max(v.cx-v.r-M.left,0),r:Math.max(M.right-(v.cx+v.r),0),b:Math.max(M.bottom-(v.cy+v.r),0),t:Math.max(v.cy-v.r-M.top,0),pad:5})}}))}));setTimeout((function(){v.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:D,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:P,prerenderTitles:_,layoutAreas:R,attachFxHandlers:x,computeTransform:z}},68357:function(e,t,r){"use strict";var n=r(39898),i=r(63463),a=r(72597).resizeText;e.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");a(e,t,"pie"),t.each((function(t){var r=t[0].trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each((function(t){n.select(this).call(i,t,r,e)}))}))}},63463:function(e,t,r){"use strict";var n=r(7901),i=r(53581).castOption,a=r(22209);e.exports=function(e,t,r,o){var s=r.marker.line,l=i(s.color,t.pts)||n.defaultLine,u=i(s.width,t.pts)||0;e.call(a,t,r,o).style("stroke-width",u).call(n.stroke,l)}},10959:function(e,t,r){"use strict";var n=r(82196);e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},42743:function(e,t,r){"use strict";var n=r(9330).gl_pointcloud2d,i=r(78614),a=r(71739).findExtremes,o=r(34603);function s(e,t){this.scene=e,this.uid=t,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(e.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(e){var t=this.idToIndex[e.pointId];return{trace:this,dataCoord:e.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*t],this.pickXYData[2*t+1]]:[this.pickXData[t],this.pickYData[t]],textLabel:Array.isArray(this.textLabels)?this.textLabels[t]:this.textLabels,color:this.color,name:this.name,pointIndex:t,hoverinfo:this.hoverinfo}},l.update=function(e){this.index=e.index,this.textLabels=e.text,this.name=e.name,this.hoverinfo=e.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(e),this.color=o(e,{})},l.updateFast=function(e){var t,r,n,o,s,l,u=this.xData=this.pickXData=e.x,c=this.yData=this.pickYData=e.y,f=this.pickXYData=e.xy,d=e.xbounds&&e.ybounds,p=e.indices,h=this.bounds;if(f){if(n=f,t=f.length>>>1,d)h[0]=e.xbounds[0],h[2]=e.xbounds[1],h[1]=e.ybounds[0],h[3]=e.ybounds[1];else for(l=0;lh[2]&&(h[2]=o),sh[3]&&(h[3]=s);if(p)r=p;else for(r=new Int32Array(t),l=0;lh[2]&&(h[2]=o),sh[3]&&(h[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var v=i(e.marker.color),m=i(e.marker.border.color),g=e.opacity*e.marker.opacity;v[3]*=g,this.pointcloudOptions.color=v;var y=e.marker.blend;null===y&&(y=u.length<100||c.length<100),this.pointcloudOptions.blend=y,m[3]*=g,this.pointcloudOptions.borderColor=m;var x=e.marker.sizemin,b=Math.max(e.marker.sizemax,e.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=e.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,k=b/2||.5;e._extremes[_._id]=a(_,[h[0],h[2]],{ppad:k}),e._extremes[w._id]=a(w,[h[1],h[3]],{ppad:k})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(e,t){var r=new s(e,t.uid);return r.update(t),r}},33876:function(e,t,r){"use strict";var n=r(71828),i=r(10959);e.exports=function(e,t,r){function a(r,a){return n.coerce(e,t,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),e.xy&&e.xy instanceof Float32Array&&(t.xy=e.xy),e.indices&&e.indices instanceof Int32Array&&(t.indices=e.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),t._length=null}},20593:function(e,t,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" "),e.exports={attributes:r(10959),supplyDefaults:r(33876),calc:r(36563),plot:r(42743),moduleType:"trace",name:"pointcloud",basePlotModule:r(4796),categories:["gl","gl2d","showLegend"],meta:{}}},39953:function(e,t,r){"use strict";var n=r(41940),i=r(9012),a=r(22399),o=r(77914),s=r(27670).Y,l=r(5386).fF,u=r(50693),c=r(44467).templatedArray,f=r(12663).descriptionOnlyNumbers,d=r(1426).extendFlat,p=r(30962).overrideAll;(e.exports=p({hoverinfo:d({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:f("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:c("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:d(u().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},75536:function(e,t,r){"use strict";var n=r(30962).overrideAll,i=r(27659).a0,a=r(60436),o=r(528),s=r(6964),l=r(28569),u=r(47322).prepSelect,c=r(71828),f=r(73972),d="sankey";function p(e,t){var r=e._fullData[t],n=e._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if(o&&"pan"!==i&&"zoom"!==i){s(o,a);var d={_id:"x",c2p:c.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:c.identity,_offset:r._sankey.translateY,_length:r._sankey.height},h={gd:e,element:o.node(),plotinfo:{id:t,xaxis:d,yaxis:p,fillRangeItems:c.noop},subplot:t,xaxes:[d],yaxes:[p],doneFnCompleted:function(r){var n,i=e._fullData[t],a=i.node.groups.slice(),o=[];function s(e){for(var t=i._sankey.graph.nodes,r=0;ry&&(y=a.source[t]),a.target[t]>y&&(y=a.target[t]);var x,b=y+1;e.node._count=b;var _=e.node.groups,w={};for(t=0;t<_.length;t++){var k=_[t];for(x=0;x0&&s(C,b)&&s(E,b)&&(!w.hasOwnProperty(C)||!w.hasOwnProperty(E)||w[C]!==w[E])){w.hasOwnProperty(E)&&(E=w[E]),w.hasOwnProperty(C)&&(C=w[C]),E=+E,d[C=+C]=d[E]=!0;var P="";a.label&&a.label[t]&&(P=a.label[t]);var L=null;P&&p.hasOwnProperty(P)&&(L=p[P]),u.push({pointNumber:t,label:P,color:c?a.color[t]:a.color,customdata:f?a.customdata[t]:a.customdata,concentrationscale:L,source:C,target:E,value:+A}),S.source.push(C),S.target.push(E)}}var I=b+_.length,R=o(r.color),O=o(r.customdata),D=[];for(t=0;tb-1,childrenNodes:[],pointNumber:t,label:z,color:R?r.color[t]:r.color,customdata:O?r.customdata[t]:r.customdata})}var F=!1;return function(e,t,r){for(var a=i.init2dArray(e,0),o=0;o1}))}(I,S.source,S.target)&&(F=!0),{circular:F,links:u,nodes:D,groups:_,groupLookup:w}}e.exports=function(e,t){var r=u(t);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},85247:function(e){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},26857:function(e,t,r){"use strict";var n=r(71828),i=r(39953),a=r(7901),o=r(84267),s=r(27670).c,l=r(38048),u=r(44467),c=r(85501);function f(e,t){function r(r,a){return n.coerce(e,t,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(e,t,r,d){function p(r,a){return n.coerce(e,t,i,r,a)}var h=n.extendDeep(d.hoverlabel,e.hoverlabel),v=e.node,m=u.newContainer(t,"node");function g(e,t){return n.coerce(v,m,i.node,e,t)}g("label"),g("groups"),g("x"),g("y"),g("pad"),g("thickness"),g("line.color"),g("line.width"),g("hoverinfo",e.hoverinfo),l(v,m,g,h),g("hovertemplate");var y=d.colorway;g("color",m.label.map((function(e,t){return a.addOpacity(function(e){return y[e%y.length]}(t),.8)}))),g("customdata");var x=e.link||{},b=u.newContainer(t,"link");function _(e,t){return n.coerce(x,b,i.link,e,t)}_("label"),_("arrowlen"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",e.hoverinfo),l(x,b,_,h),_("hovertemplate");var w,k=o(d.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(k,b.value.length)),_("customdata"),c(x,b,{name:"colorscales",handleItemDefaults:f}),s(t,d,p),p("orientation"),p("valueformat"),p("valuesuffix"),m.x.length&&m.y.length&&(w="freeform"),p("arrangement",w),n.coerceFont(p,"textfont",n.extendFlat({},d.font)),t._length=null}},29396:function(e,t,r){"use strict";e.exports={attributes:r(39953),supplyDefaults:r(26857),calc:r(92930),plot:r(60436),moduleType:"trace",name:"sankey",basePlotModule:r(75536),selectPoints:r(84564),categories:["noOpacity"],meta:{}}},60436:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=i.numberFormat,o=r(3393),s=r(30211),l=r(7901),u=r(85247).cn,c=i._;function f(e){return""!==e}function d(e,t){return e.filter((function(e){return e.key===t.traceId}))}function p(e,t){n.select(e).select("path").style("fill-opacity",t),n.select(e).select("rect").style("fill-opacity",t)}function h(e){n.select(e).select("text.name").style("fill","black")}function v(e){return function(t){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function m(e){return function(t){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(e,t,r){t&&r&&d(r,t).selectAll("."+u.sankeyLink).filter(v(t)).call(x.bind(0,t,r,!1))}function y(e,t,r){t&&r&&d(r,t).selectAll("."+u.sankeyLink).filter(v(t)).call(b.bind(0,t,r,!1))}function x(e,t,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(e){if(!e.link.concentrationscale)return.4})),i&&d(t,e).selectAll("."+u.sankeyLink).filter((function(e){return e.link.label===i})).style("fill-opacity",(function(e){if(!e.link.concentrationscale)return.4})),r&&d(t,e).selectAll("."+u.sankeyNode).filter(m(e)).call(g)}function b(e,t,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(e){return e.tinyColorAlpha})),i&&d(t,e).selectAll("."+u.sankeyLink).filter((function(e){return e.link.label===i})).style("fill-opacity",(function(e){return e.tinyColorAlpha})),r&&d(t,e).selectAll(u.sankeyNode).filter(m(e)).call(y)}function _(e,t){var r=e.hoverlabel||{},n=i.nestedProperty(r,t).get();return!Array.isArray(n)&&n}e.exports=function(e,t){for(var r=e._fullLayout,i=r._paper,d=r._size,v=0;v"),color:_(o,"bgcolor")||l.addOpacity(v.color,1),borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:n.event.x"),color:_(o,"bgcolor")||i.tinyColorHue,borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:y,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e});p(w,.85),h(w)}}},unhover:function(t,i,a){!1!==e._fullLayout.hovermode&&(n.select(t).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,e.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(t,r,i){var a=r.node;a.originalEvent=n.event,e._hoverdata=[a],n.select(t).call(y,r,i),s.click(e,{target:!0})}}})}},3393:function(e,t,r){"use strict";var n=r(49887),i=r(81684).k4,a=r(39898),o=r(30838),s=r(86781),l=r(85247),u=r(84267),c=r(7901),f=r(91424),d=r(71828),p=d.strTranslate,h=d.strRotate,v=r(28984),m=v.keyFun,g=v.repeat,y=v.unwrap,x=r(63893),b=r(73972),_=r(18783),w=_.CAP_SHIFT,k=_.LINE_SPACING;function T(e,t,r){var n,i=y(t),a=i.trace,c=a.domain,f="h"===a.orientation,p=a.node.pad,h=a.node.thickness,v=e.width*(c.x[1]-c.x[0]),m=e.height*(c.y[1]-c.y[0]),g=i._nodes,x=i._links,b=i.circular;(n=b?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(f?[v,m]:[m,v]).nodeWidth(h).nodePadding(p).nodeId((function(e){return e.pointNumber})).nodes(g).links(x);var _,w,k,T=n();for(var M in n.nodePadding()=i||(r=i-t.y0)>1e-6&&(t.y0+=r,t.y1+=r),i=t.y1+p}))}(function(e){var t,r,n=e.map((function(e,t){return{x0:e.x0,index:t}})).sort((function(e,t){return e.x0-t.x0})),i=[],a=-1,o=-1/0;for(_=0;_o+h&&(a+=1,t=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=t-s.x0,s.x0+=r,s.x1+=r}return i}(g=T.nodes)),n.update(T)}return{circular:b,key:r,trace:a,guid:d.randstr(),horizontal:f,width:v,height:m,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,linkArrowLength:a.link.arrowlen,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:c.x[0]*e.width+e.margin.l,translateY:e.height-c.y[1]*e.height+e.margin.t,dragParallel:f?m:v,dragPerpendicular:f?v:m,arrangement:a.arrangement,sankey:n,graph:T,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function M(e,t,r){var n=u(t.color),i=t.source.label+"|"+t.target.label+"__"+r;return t.trace=e.trace,t.curveNumber=e.trace.index,{circular:e.circular,key:i,traceId:e.key,pointNumber:t.pointNumber,link:t,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:S,linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,linkArrowLength:e.linkArrowLength,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,parent:e,interactionState:e.interactionState,flow:t.flow}}function S(){return function(e){var t=e.linkArrowLength;if(e.link.circular)return function(e,t){var r=e.width/2,n=e.circularPathData;return"top"===e.circularLinkType?"M "+(n.targetX-t)+" "+(n.targetY+r)+" L"+(n.rightInnerExtent-t)+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r-t)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-t)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r-t)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-t)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+(n.rightInnerExtent-t)+" "+(n.targetY-r)+"L"+(n.targetX-t)+" "+(n.targetY-r)+(t>0?"L"+n.targetX+" "+n.targetY:"")+"Z":"M "+(n.targetX-t)+" "+(n.targetY-r)+" L"+(n.rightInnerExtent-t)+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r-t)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-t)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r-t)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-t)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+(n.rightInnerExtent-t)+" "+(n.targetY+r)+"L"+(n.targetX-t)+" "+(n.targetY+r)+(t>0?"L"+n.targetX+" "+n.targetY:"")+"Z"}(e.link,t);var r=Math.abs((e.link.target.x0-e.link.source.x1)/2);t>r&&(t=r);var n=e.link.source.x1,a=e.link.target.x0-t,o=i(n,a),s=o(.5),l=o(.5),u=e.link.y0-e.link.width/2,c=e.link.y0+e.link.width/2,f=e.link.y1-e.link.width/2,d=e.link.y1+e.link.width/2,p="M"+n+","+u,h="C"+s+","+u+" "+l+","+f+" "+a+","+f,v="C"+l+","+d+" "+s+","+c+" "+n+","+c,m=t>0?"L"+(a+t)+","+(f+e.link.width/2):"";return p+h+(m+="L"+a+","+d)+v+"Z"}}function A(e,t){var r=u(t.color),n=l.nodePadAcross,i=e.nodePad/2;t.dx=t.x1-t.x0,t.dy=t.y1-t.y0;var a=t.dx,o=Math.max(.5,t.dy),s="node_"+t.pointNumber;return t.group&&(s=d.randstr()),t.trace=e.trace,t.curveNumber=e.trace.index,{index:t.pointNumber,key:s,partOfGroup:t.partOfGroup||!1,group:t.group,traceId:e.key,trace:e.trace,node:t,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:e.horizontal?t.dy/2+1:t.dx/2+1,left:1===t.originalLayer,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,graph:e.graph,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,s].join("_"),interactionState:e.interactionState,figure:e}}function C(e){e.attr("transform",(function(e){return p(e.node.x0.toFixed(3),e.node.y0.toFixed(3))}))}function E(e){e.call(C)}function P(e,t){e.call(E),t.attr("d",S())}function L(e){e.attr("width",(function(e){return e.node.x1-e.node.x0})).attr("height",(function(e){return e.visibleHeight}))}function I(e){return e.link.width>1||e.linkLineWidth>0}function R(e){return p(e.translateX,e.translateY)+(e.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function O(e,t,r){e.on(".basic",null).on("mouseover.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.hover(this,e,t),e.interactionState.hovered=[this,e])})).on("mousemove.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.follow(this,e),e.interactionState.hovered=[this,e])})).on("mouseout.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.unhover(this,e,t),e.interactionState.hovered=!1)})).on("click.basic",(function(e){e.interactionState.hovered&&(r.unhover(this,e,t),e.interactionState.hovered=!1),e.interactionState.dragInProgress||e.partOfGroup||r.select(this,e,t)}))}function D(e,t,r,i){var o=a.behavior.drag().origin((function(e){return{x:e.node.x0+e.visibleWidth/2,y:e.node.y0+e.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(d.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(e){i._fullLayout._dragCover=e})),d.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(e,t,r,i){!function(e){for(var t=0;t0&&n.forceLayouts[t].alpha(0)}}(0,t,a,r)).stop()}(0,o,a),function(e,t,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,z(r,i)}}))}(e,t,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),P(e.filter(j(r)),t))}})).on("dragend",(function(e){if("fixed"!==e.arrangement){e.interactionState.dragInProgress=!1;for(var t=0;tl&&P[g].gap;)g--;for(x=P[g].s,v=P.length-1;v>g;v--)P[v].s=x;for(;lA[f]&&f=0;f--){var d=e[f];if("scatter"===d.type&&d.xaxis===u.xaxis&&d.yaxis===u.yaxis){d.opacity=void 0;break}}}}}},17438:function(e,t,r){"use strict";var n=r(71828),i=r(73972),a=r(82196),o=r(47581),s=r(34098),l=r(67513),u=r(73927),c=r(565),f=r(49508),d=r(11058),p=r(94039),h=r(82410),v=r(28908),m=r(71828).coercePattern;e.exports=function(e,t,r,g){function y(r,i){return n.coerce(e,t,a,r,i)}var x=l(e,t,g,y);if(x||(t.visible=!1),t.visible){u(e,t,g,y),y("xhoverformat"),y("yhoverformat");var b=c(e,t,g,y);"group"===g.scattermode&&void 0===t.orientation&&y("orientation","v");var _=!b&&x=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(d.c2p(e.x)-h);return a=Math.min(t,r)&&v<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(p.c2p(e.y)-v);return aq!==(N=O[I][1])>=q&&(z=O[I-1][0],F=O[I][0],N-j&&(D=z+(F-z)*(q-j)/(N-j),U=Math.min(U,D),H=Math.max(H,D)));U=Math.max(U,0),H=Math.min(H,d._length);var Y=s.defaultLine;return s.opacity(f.fillcolor)?Y=f.fillcolor:s.opacity((f.line||{}).color)&&(Y=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:U,x1:H,y0:q,y1:q,color:Y,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},67368:function(e,t,r){"use strict";var n=r(34098);e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:r(82196),layoutAttributes:r(21479),supplyDefaults:r(17438),crossTraceDefaults:r(34936),supplyLayoutDefaults:r(79334),calc:r(47761).calc,crossTraceCalc:r(72626),arraysToCalcdata:r(75225),plot:r(32663),colorbar:r(4898),formatLabels:r(8225),style:r(16296).style,styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(33720),selectPoints:r(98002),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:r(93612),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},21479:function(e){"use strict";e.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}},79334:function(e,t,r){"use strict";var n=r(71828),i=r(21479);e.exports=function(e,t){var r,a,o="group"===t.barmode;"group"===t.scattermode&&(r="scattergap",a=o?t.bargap:.2,n.coerce(e,t,i,r,a))}},11058:function(e,t,r){"use strict";var n=r(71828).isArrayOrTypedArray,i=r(52075).hasColorscale,a=r(1586);e.exports=function(e,t,r,o,s,l){l||(l={});var u=(e.marker||{}).color;s("line.color",r),i(e,"line")?a(e,t,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r),s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},34621:function(e,t,r){"use strict";var n=r(91424),i=r(50606),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,u=r(71828),c=u.segmentsIntersect,f=u.constrain,d=r(47581);e.exports=function(e,t){var r,i,o,p,h,v,m,g,y,x,b,_,w,k,T,M,S,A,C=t.trace||{},E=t.xaxis,P=t.yaxis,L="log"===E.type,I="log"===P.type,R=E._length,O=P._length,D=t.backoff,z=C.marker,F=t.connectGaps,j=t.baseTolerance,N=t.shape,Z="linear"===N,B=C.fill&&"none"!==C.fill,V=[],U=d.minTolerance,H=e.length,W=new Array(H),G=0;function q(r){var n=e[r];if(!n)return!1;var i=t.linearized?E.l2p(n.x):E.c2p(n.x),o=t.linearized?P.l2p(n.y):P.c2p(n.y);if(i===a){if(L&&(i=E.c2p(n.x,!0)),i===a)return!1;I&&o===a&&(i*=Math.abs(E._m*O*(E._m>0?s:l)/(P._m*R*(P._m>0?s:l)))),i*=1e3}if(o===a){if(I&&(o=P.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function Y(e,t,r,n){var i=r-e,a=n-t,o=.5-e,s=.5-t,l=i*i+a*a,u=i*o+a*s;if(u>0&&uoe||e[1]le)return[f(e[0],ae,oe),f(e[1],se,le)]}function fe(e,t){return e[0]===t[0]&&(e[0]===ae||e[0]===oe)||e[1]===t[1]&&(e[1]===se||e[1]===le)||void 0}function de(e,t,r){return function(n,i){var a=ce(n),o=ce(i),s=[];if(a&&o&&fe(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*u.constrain((n[e]+i[e])/2,t,r)-((a||n)[e]+(o||i)[e]);return l&&((a&&o?l>0===a[e]>o[e]?a:o:a||o)[e]+=l),s}}function pe(e){var t=e[0],r=e[1],n=t===W[G-1][0],i=r===W[G-1][1];if(!n||!i)if(G>1){var a=t===W[G-2][0],o=r===W[G-2][1];n&&(t===ae||t===oe)&&a?o?G--:W[G-1]=e:i&&(r===se||r===le)&&o?a?G--:W[G-1]=e:W[G++]=e}else W[G++]=e}function he(e){W[G-1][0]!==e[0]&&W[G-1][1]!==e[1]&&pe([Q,ee]),pe(e),te=null,Q=ee=0}"linear"===N||"spline"===N?ne=function(e,t){for(var r=[],n=0,i=0;i<4;i++){var a=ue[i],o=c(e[0],e[1],t[0],t[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&K(o,e)oe?oe:0,J=t[1]le?le:0,$||J){if(G)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),W[G++]=n[1])}else re=ne(W[G-1],t)[0],W[G++]=re;else W[G++]=[$||t[0],J||t[1]];var i=W[G-1];$&&J&&(i[0]!==$||i[1]!==J)?(te&&(Q!==$&&ee!==J?pe(Q&&ee?function(e,t){var r=t[0]-e[0],n=(t[1]-e[1])/r;return(e[1]*t[0]-t[1]*e[0])/r>0?[n>0?ae:oe,le]:[n>0?oe:ae,se]}(te,t):[Q||$,ee||J]):Q&&ee&&pe([Q,ee])),pe([$,J])):Q-$&&ee-J&&pe([$||Q,J||ee]),te=t,Q=$,ee=J}else te&&he(ne(te,t)[0]),W[G++]=t}for(r=0;rX(v,ge))break;o=v,(w=y[0]*g[0]+y[1]*g[1])>b?(b=w,p=v,m=!1):w<_&&(_=w,h=v,m=!0)}if(m?(me(p),o!==h&&me(h)):(h!==i&&me(h),o!==p&&me(p)),me(o),r>=e.length||!v)break;me(v),i=v}}else me(p)}te&&pe([Q||te[0],ee||te[1]]),V.push(W.slice(0,G))}var ye=N.slice(N.length-1);if(D&&"h"!==ye&&"v"!==ye){for(var xe=!1,be=-1,_e=[],we=0;we=0?l=p:(l=p=d,d++),l0?Math.max(r,a):0}}},4898:function(e){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},49508:function(e,t,r){"use strict";var n=r(7901),i=r(52075).hasColorscale,a=r(1586),o=r(34098);e.exports=function(e,t,r,s,l,u){var c=o.isBubble(e),f=(e.line||{}).color;u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),u.noAngle||(l("marker.angle"),u.noAngleRef||l("marker.angleref"),u.noStandOff||l("marker.standoff")),l("marker.color",r),i(e,"marker")&&a(e,t,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:c?n.background:n.defaultLine),i(e,"marker.line")&&a(e,t,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}},73927:function(e,t,r){"use strict";var n=r(71828).dateTick0,i=r(50606).ONEWEEK;function a(e,t){return n(t,e%i===0?1:0)}e.exports=function(e,t,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,t.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,t.ycalendar)),n("yperiodalignment"))}}},32663:function(e,t,r){"use strict";var n=r(39898),i=r(73972),a=r(71828),o=a.ensureSingle,s=a.identity,l=r(91424),u=r(34098),c=r(34621),f=r(68687),d=r(61082).tester;function p(e,t,r,f,p,h,v){var m,g=e._context.staticPlot;!function(e,t,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),d=i[0].trace;if(u.hasMarkers(d)){var p=d.marker.maxdisplayed;if(0!==p){var h=i.filter((function(e){return e.x>=c[0]&&e.x<=c[1]&&e.y>=f[0]&&e.y<=f[1]})),v=Math.ceil(h.length/p),m=0;o.forEach((function(e,r){var n=e[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function x(e){return y?e.transition():e}var b=r.xaxis,_=r.yaxis,w=f[0].trace,k=w.line,T=n.select(h),M=o(T,"g","errorbars"),S=o(T,"g","lines"),A=o(T,"g","points"),C=o(T,"g","text");if(i.getComponentMethod("errorbars","plot")(e,M,r,v),!0===w.visible){var E,P;x(T).style("opacity",w.opacity);var L=w.fill.charAt(w.fill.length-1);"x"!==L&&"y"!==L&&(L=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var I,R,O="",D=[],z=w._prevtrace;z&&(O=z._prevRevpath||"",P=z._nextFill,D=z._polygons);var F,j,N,Z,B,V,U,H="",W="",G=[],q=a.noop;if(E=w._ownFill,u.hasLines(w)||"none"!==w.fill){for(P&&P.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(k.shape)?(F=l.steps(k.shape),j=l.steps(k.shape.split("").reverse().join(""))):F=j="spline"===k.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?l.smoothclosed(e.slice(1),k.smoothing):l.smoothopen(e,k.smoothing)}:function(e){return"M"+e.join("L")},N=function(e){return j(e.reverse())},G=c(f,{xaxis:b,yaxis:_,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(k.width||1,3)/4,shape:k.shape,backoff:k.backoff,simplify:k.simplify,fill:w.fill}),U=w._polygons=new Array(G.length),m=0;m0,m=f(e,t,r);(c=i.selectAll("g.trace").data(m,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(e,t,r){t.each((function(t){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,e);var a=t[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(e){a[e]=null})).remove(),c.order().each((function(e){a[e]=o(n.select(this),"path","js-fill")}))}))}(e,c,t),v?(u&&(d=u()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){i.selectAll("g.trace").each((function(r,n){p(e,n,t,r,m,this,a)}))}))):c.each((function(r,n){p(e,n,t,r,m,this,a)})),h&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},98002:function(e,t,r){"use strict";var n=r(34098);e.exports=function(e,t){var r,i,a,o,s=e.cd,l=e.xaxis,u=e.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r0){var d=i.c2l(c);i._lowerLogErrorBound||(i._lowerLogErrorBound=d),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,d)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(e,t,r){var n=[i(e.x,e.error_x,t[0],r.xaxis),i(e.y,e.error_y,t[1],r.yaxis),i(e.z,e.error_z,t[2],r.zaxis)],a=function(e){for(var t=0;t-1?-1:e.indexOf("right")>-1?1:0}function b(e){return null===e||void 0===e?0:e.indexOf("top")>-1?-1:e.indexOf("bottom")>-1?1:0}function _(e,t){return t(4*e)}function w(e){return p[e]}function k(e,t,r,n,i){var a=null;if(l.isArrayOrTypedArray(e)){a=[];for(var o=0;o=0){var v=function(e,t,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",p||h);for(var v=["x","y","z"],m=0;m<3;++m){var g="projection."+v[m];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}var y=n.getComponentMethod("errorbars","supplyDefaults");y(e,t,p||h||r,{axis:"z"}),y(e,t,p||h||r,{axis:"y",inherit:"z"}),y(e,t,p||h||r,{axis:"x",inherit:"z"})}else t.visible=!1}},13551:function(e,t,r){"use strict";e.exports={plot:r(58925),attributes:r(44542),markerSymbols:r(87381),supplyDefaults:r(21428),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:r(36563),moduleType:"trace",name:"scatter3d",basePlotModule:r(58547),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},97001:function(e,t,r){"use strict";var n=r(82196),i=r(9012),a=r(5386).fF,o=r(5386).si,s=r(50693),l=r(1426).extendFlat,u=n.marker,c=n.line,f=u.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:c.color,width:c.width,dash:c.dash,backoff:c.backoff,shape:l({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,angle:u.angle,angleref:u.angleref,standoff:u.standoff,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:l({width:f.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},34618:function(e,t,r){"use strict";var n=r(92770),i=r(36922),a=r(75225),o=r(66279),s=r(47761).calcMarkerSize,l=r(22882);e.exports=function(e,t){var r=t._carpetTrace=l(e,t);if(r&&r.visible&&"legendonly"!==r.visible){var u;t.xaxis=r.xaxis,t.yaxis=r.yaxis;var c,f,d=t._length,p=new Array(d),h=!1;for(u=0;u")}return o}function y(e,t){var r;r=e.labelprefix&&e.labelprefix.length>0?e.labelprefix.replace(/ = $/,""):e._hovertitle,m.push(r+": "+t.toFixed(3)+e.labelsuffix)}}},46858:function(e,t,r){"use strict";e.exports={attributes:r(97001),supplyDefaults:r(98965),colorbar:r(4898),formatLabels:r(48953),calc:r(34618),plot:r(1913),style:r(16296).style,styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(22931),selectPoints:r(98002),eventData:r(16165),moduleType:"trace",name:"scattercarpet",basePlotModule:r(93612),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},1913:function(e,t,r){"use strict";var n=r(32663),i=r(89298),a=r(91424);e.exports=function(e,t,r,o){var s,l,u,c=r[0][0].carpet,f=i.getFromId(e,c.xaxis||"x"),d=i.getFromId(e,c.yaxis||"y"),p={xaxis:f,yaxis:d,plot:t.plot};for(s=0;s")}function p(e){return e+"\xb0"}}(u,v,e,l[0].t.labels),e.hovertemplate=u.hovertemplate,[e]}}},17988:function(e,t,r){"use strict";e.exports={attributes:r(19316),supplyDefaults:r(10659),colorbar:r(4898),formatLabels:r(82719),calc:r(84622),calcGeoJSON:r(89171).calcGeoJSON,plot:r(89171).plot,style:r(33095),styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(14977),eventData:r(84084),selectPoints:r(20548),moduleType:"trace",name:"scattergeo",basePlotModule:r(44622),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},89171:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=r(90973).getTopojsonFeatures,o=r(18214),s=r(41327),l=r(71739).findExtremes,u=r(50606).BADNUM,c=r(47761).calcMarkerSize,f=r(34098),d=r(33095);e.exports={calcGeoJSON:function(e,t){var r,n,i=e[0].trace,o=t[i.geo],f=o._subplot,d=i._length;if(Array.isArray(i.locations)){var p=i.locationmode,h="geojson-id"===p?s.extractTraceFeature(e):a(i,f.topojson);for(r=0;r=m,w=2*b,k={},T=l.makeCalcdata(t,"x"),M=y.makeCalcdata(t,"y"),S=s(t,l,"x",T),A=s(t,y,"y",M),C=S.vals,E=A.vals;t._x=C,t._y=E,t.xperiodalignment&&(t._origX=T,t._xStarts=S.starts,t._xEnds=S.ends),t.yperiodalignment&&(t._origY=M,t._yStarts=A.starts,t._yEnds=A.ends);var P=new Array(w),L=new Array(b);for(r=0;r1&&i.extendFlat(s.line,p.linePositions(e,r,n)),s.errorX||s.errorY){var l=p.errorBarPositions(e,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}return s.text&&(i.extendFlat(s.text,{positions:n},p.textPosition(e,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},p.textPosition(e,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},p.textPosition(e,r,s.text,s.markerUnsel))),s}(e,0,t,P,C,E),O=h(e,x);return f(o,t),_?R.marker&&(I=R.marker.sizeAvg||Math.max(R.marker.size,3)):I=u(t,b),c(e,t,l,y,C,E,I),R.errorX&&g(t,l,R.errorX),R.errorY&&g(t,y,R.errorY),R.fill&&!O.fill2d&&(O.fill2d=!0),R.marker&&!O.scatter2d&&(O.scatter2d=!0),R.line&&!O.line2d&&(O.line2d=!0),!R.errorX&&!R.errorY||O.error2d||(O.error2d=!0),R.text&&!O.glText&&(O.glText=!0),R.marker&&(R.marker.snap=b),O.lineOptions.push(R.line),O.errorXOptions.push(R.errorX),O.errorYOptions.push(R.errorY),O.fillOptions.push(R.fill),O.markerOptions.push(R.marker),O.markerSelectedOptions.push(R.markerSel),O.markerUnselectedOptions.push(R.markerUnsel),O.textOptions.push(R.text),O.textSelectedOptions.push(R.textSel),O.textUnselectedOptions.push(R.textUnsel),O.selectBatch.push([]),O.unselectBatch.push([]),k._scene=O,k.index=O.count,k.x=C,k.y=E,k.positions=P,O.count++,[{x:!1,y:!1,t:k,trace:t}]}},78232:function(e){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},19635:function(e,t,r){"use strict";var n=r(92770),i=r(82019),a=r(25075),o=r(73972),s=r(71828),l=r(91424),u=r(41675),c=r(81697).formatColor,f=r(34098),d=r(39984),p=r(68645),h=r(78232),v=r(37822).DESELECTDIM,m={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},g=r(23469).appendArrayPointValue;function y(e,t){var r,i=e._fullLayout,a=t._length,o=t.textfont,l=t.textposition,u=Array.isArray(l)?l:[l],c=o.color,f=o.size,d=o.family,p={},h=e._context.plotGlPixelRatio,v=t.texttemplate;if(v){p.text=[];var m=i._d3locale,y=Array.isArray(v),x=y?Math.min(v.length,a):a,b=y?function(e){return v[e]}:function(){return v};for(r=0;rh.TOO_MANY_POINTS||f.hasMarkers(t)?"rect":"round";if(u&&t.connectgaps){var d=n[0],p=n[1];for(i=0;i1?l[i]:l[0]:l,h=Array.isArray(u)?u.length>1?u[i]:u[0]:u,v=m[p],g=m[h],y=c?c/.8+1:0,x=-g*y-.5*g;o.offset[i]=[v*y/d,x/d]}}return o}}},47148:function(e,t,r){"use strict";var n=r(71828),i=r(73972),a=r(68645),o=r(42341),s=r(47581),l=r(34098),u=r(67513),c=r(73927),f=r(49508),d=r(11058),p=r(28908),h=r(82410);e.exports=function(e,t,r,v){function m(r,i){return n.coerce(e,t,o,r,i)}var g=!!e.marker&&a.isOpenSymbol(e.marker.symbol),y=l.isBubble(e),x=u(e,t,v,m);if(x){c(e,t,v,m),m("xhoverformat"),m("yhoverformat");var b=x100},t.isDotSymbol=function(e){return"string"===typeof e?n.DOT_RE.test(e):e>200}},20794:function(e,t,r){"use strict";var n=r(73972),i=r(71828),a=r(34603);function o(e,t,r,o){var s=e.xa,l=e.ya,u=e.distance,c=e.dxy,f=e.index,d={pointNumber:f,x:t[f],y:r[f]};d.tx=Array.isArray(o.text)?o.text[f]:o.text,d.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,d.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,d.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var p=o.textfont;p&&(d.ts=i.isArrayOrTypedArray(p.size)?p.size[f]:p.size,d.tc=Array.isArray(p.color)?p.color[f]:p.color,d.tf=Array.isArray(p.family)?p.family[f]:p.family);var h=o.marker;h&&(d.ms=i.isArrayOrTypedArray(h.size)?h.size[f]:h.size,d.mo=i.isArrayOrTypedArray(h.opacity)?h.opacity[f]:h.opacity,d.mx=i.isArrayOrTypedArray(h.symbol)?h.symbol[f]:h.symbol,d.ma=i.isArrayOrTypedArray(h.angle)?h.angle[f]:h.angle,d.mc=i.isArrayOrTypedArray(h.color)?h.color[f]:h.color);var v=h&&h.line;v&&(d.mlc=Array.isArray(v.color)?v.color[f]:v.color,d.mlw=i.isArrayOrTypedArray(v.width)?v.width[f]:v.width);var m=h&&h.gradient;m&&"none"!==m.type&&(d.mgt=Array.isArray(m.type)?m.type[f]:m.type,d.mgc=Array.isArray(m.color)?m.color[f]:m.color);var g=s.c2p(d.x,!0),y=l.c2p(d.y,!0),x=d.mrc||1,b=o.hoverlabel;b&&(d.hbg=Array.isArray(b.bgcolor)?b.bgcolor[f]:b.bgcolor,d.hbc=Array.isArray(b.bordercolor)?b.bordercolor[f]:b.bordercolor,d.hts=i.isArrayOrTypedArray(b.font.size)?b.font.size[f]:b.font.size,d.htc=Array.isArray(b.font.color)?b.font.color[f]:b.font.color,d.htf=Array.isArray(b.font.family)?b.font.family[f]:b.font.family,d.hnl=i.isArrayOrTypedArray(b.namelength)?b.namelength[f]:b.namelength);var _=o.hoverinfo;_&&(d.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(d.ht=Array.isArray(w)?w[f]:w);var k={};k[e.index]=d;var T=o._origX,M=o._origY,S=i.extendFlat({},e,{color:a(o,d),x0:g-x,x1:g+x,xLabelVal:T?T[f]:d.x,y0:y-x,y1:y+x,yLabelVal:M?M[f]:d.y,cd:k,distance:u,spikeDistance:c,hovertemplate:d.ht});return d.htx?S.text=d.htx:d.tx?S.text=d.tx:o.text&&(S.text=o.text),i.fillText(d,o,S),n.getComponentMethod("errorbars","hoverInfo")(d,o,S),S}e.exports={hoverPoints:function(e,t,r,n){var i,a,s,l,u,c,f,d,p,h,v=e.cd,m=v[0].t,g=v[0].trace,y=e.xa,x=e.ya,b=m.x,_=m.y,w=y.c2p(t),k=x.c2p(r),T=e.distance;if(m.tree){var M=y.p2c(w-T),S=y.p2c(w+T),A=x.p2c(k-T),C=x.p2c(k+T);i="x"===n?m.tree.range(Math.min(M,S),Math.min(x._rl[0],x._rl[1]),Math.max(M,S),Math.max(x._rl[0],x._rl[1])):m.tree.range(Math.min(M,S),Math.min(A,C),Math.max(M,S),Math.max(A,C))}else i=m.ids;var E=T;if("x"===n){var P=!!g.xperiodalignment,L=!!g.yperiodalignment;for(c=0;c=Math.min(I,R)&&w<=Math.max(I,R)?0:1/0}if(f=Math.min(O,D)&&k<=Math.max(O,D)?0:1/0}h=Math.sqrt(f*f+d*d),s=i[c]}}}else for(c=i.length-1;c>-1;c--)l=b[a=i[c]],u=_[a],f=y.c2p(l)-w,d=x.c2p(u)-k,(p=Math.sqrt(f*f+d*d))y.glText.length){var k=_-y.glText.length;for(v=0;vr&&(isNaN(t[n])||isNaN(t[n+1]));)n-=2;e.positions=t.slice(r,n+2)}return e})),y.line2d.update(y.lineOptions)),y.error2d){var M=(y.errorXOptions||[]).concat(y.errorYOptions||[]);y.error2d.update(M)}y.scatter2d&&y.scatter2d.update(y.markerOptions),y.fillOrder=s.repeat(null,_),y.fill2d&&(y.fillOptions=y.fillOptions.map((function(e,t){var n=r[t];if(e&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,u=y.lineOptions[t],c=[];s._ownfill&&c.push(t),s._nexttrace&&c.push(t+1),c.length&&(y.fillOrder[t]=c);var f,d,p=[],h=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(h[d+1]);)d-=2;0!==h[f+1]&&(p=[h[f],0]),p=p.concat(h.slice(f,d+2)),0!==h[d+1]&&(p=p.concat([h[d],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(h[d]);)d-=2;0!==h[f]&&(p=[0,h[f+1]]),p=p.concat(h.slice(f,d+2)),0!==h[d]&&(p=p.concat([0,h[d+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(p=[],i=0,e.splitNull=!0,a=0;a-1;for(v=0;v<_;v++){var E=r[v][0],P=E.trace,L=E.t,I=L.index,R=P._length,O=L.x,D=L.y;if(P.selectedpoints||A||C){if(A||(A=!0),P.selectedpoints){var z=y.selectBatch[I]=s.selIndices2selPoints(P),F={};for(m=0;m")}function c(e){return e+"\xb0"}}e.exports={hoverPoints:function(e,t,r){var o=e.cd,c=o[0].trace,f=e.xa,d=e.ya,p=e.subplot,h=[],v=l+c.uid+"-circle",m=c.cluster&&c.cluster.enabled;if(m){var g=p.map.queryRenderedFeatures(null,{layers:[v]});h=g.map((function(e){return e.id}))}var y=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),x=t-y;if(n.getClosest(o,(function(e){var t=e.lonlat;if(t[0]===s)return 1/0;if(m&&-1===h.indexOf(e.i+1))return 1/0;var n=i.modHalf(t[0],360),a=t[1],o=p.project([n,a]),l=o.x-f.c2p([x,a]),u=o.y-d.c2p([n,r]),c=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-c,1-3/c)}),e),!1!==e.index){var b=o[e.index],_=b.lonlat,w=[i.modHalf(_[0],360)+y,_[1]],k=f.c2p(w),T=d.c2p(w),M=b.mrc||1;e.x0=k-M,e.x1=k+M,e.y0=T-M,e.y1=T+M;var S={};S[c.subplot]={_subplot:p};var A=c._module.formatLabels(b,c,S);return e.lonLabel=A.lonLabel,e.latLabel=A.latLabel,e.color=a(c,b),e.extraText=u(c,b,o[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}},getExtraText:u}},20467:function(e,t,r){"use strict";e.exports={attributes:r(99181),supplyDefaults:r(76645),colorbar:r(4898),formatLabels:r(15636),calc:r(84622),plot:r(86951),hoverPoints:r(28178).hoverPoints,eventData:r(53353),selectPoints:r(86387),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.update(t)},moduleType:"trace",name:"scattermapbox",basePlotModule:r(50101),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},86951:function(e,t,r){"use strict";var n=r(71828),i=r(15790),a=r(77734).traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(e,t,r,n){this.type="scattermapbox",this.subplot=e,this.uid=t,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+t+"-fill",line:"source-"+t+"-line",circle:"source-"+t+"-circle",symbol:"source-"+t+"-symbol",cluster:"source-"+t+"-circle",clusterCount:"source-"+t+"-circle"},this.layerIds={fill:a+t+"-fill",line:a+t+"-line",circle:a+t+"-circle",symbol:a+t+"-symbol",cluster:a+t+"-cluster",clusterCount:a+t+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(e,t,r){var i={type:"geojson",data:t.geojson};r&&r.enabled&&n.extendFlat(i,{cluster:!0,clusterMaxZoom:r.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[e]);a?a.setData(t.geojson):this.subplot.map.addSource(this.sourceIds[e],i)},l.setSourceData=function(e,t){this.subplot.map.getSource(this.sourceIds[e]).setData(t.geojson)},l.addLayer=function(e,t,r){var n={type:t.type,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint};t.filter&&(n.filter=t.filter);for(var i,a=this.layerIds[e],o=this.subplot.getMapLayers(),s=0;s=0;r--){var i=t[r];n.removeLayer(c.layerIds[i])}e||n.removeSource(c.sourceIds.circle)}(e):function(e){for(var t=o.nonCluster,r=t.length-1;r>=0;r--){var i=t[r];n.removeLayer(c.layerIds[i]),e||n.removeSource(c.sourceIds[i])}}(e)}function d(e){l?function(e){e||c.addSource("circle",a.circle,t.cluster);for(var r=o.cluster,n=0;n=0;r--){var n=t[r];e.removeLayer(this.layerIds[n]),e.removeSource(this.sourceIds[n])}},e.exports=function(e,t){var r,n,a,l=t[0].trace,u=l.cluster&&l.cluster.enabled,c=!0!==l.visible,f=new s(e,l.uid,u,c),d=i(e.gd,t),p=f.below=e.belowLookup["trace-"+l.uid];if(u)for(f.addSource("circle",d.circle,l.cluster),r=0;r")}}e.exports={hoverPoints:function(e,t,r,a){var o=n(e,t,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(u,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}},91271:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:r(23580),categories:["polar","symbols","showLegend","scatter-like"],attributes:r(81245),supplyDefaults:r(22184).supplyDefaults,colorbar:r(4898),formatLabels:r(98608),calc:r(26442),plot:r(45162),style:r(16296).style,styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(59150).hoverPoints,selectPoints:r(98002),meta:{}}},45162:function(e,t,r){"use strict";var n=r(32663),i=r(50606).BADNUM;e.exports=function(e,t,r){for(var a=t.layers.frontplot.select("g.scatterlayer"),o=t.xaxis,s=t.yaxis,l={xaxis:o,yaxis:s,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},u=t.radialAxis,c=t.angularAxis,f=0;f=u&&(y.marker.cluster=h.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=_),y.line&&_.length>1&&l.extendFlat(y.line,s.linePositions(e,p,_)),y.text&&(l.extendFlat(y.text,{positions:_},s.textPosition(e,p,y.text,y.marker)),l.extendFlat(y.textSel,{positions:_},s.textPosition(e,p,y.text,y.markerSel)),l.extendFlat(y.textUnsel,{positions:_},s.textPosition(e,p,y.text,y.markerUnsel))),y.fill&&!d.fill2d&&(d.fill2d=!0),y.marker&&!d.scatter2d&&(d.scatter2d=!0),y.line&&!d.line2d&&(d.line2d=!0),y.text&&!d.glText&&(d.glText=!0),d.lineOptions.push(y.line),d.fillOptions.push(y.fill),d.markerOptions.push(y.marker),d.markerSelectedOptions.push(y.markerSel),d.markerUnselectedOptions.push(y.markerUnsel),d.textOptions.push(y.text),d.textSelectedOptions.push(y.textSel),d.textUnselectedOptions.push(y.textUnsel),d.selectBatch.push([]),d.unselectBatch.push([]),h.x=w,h.y=k,h.rawx=w,h.rawy=k,h.r=m,h.theta=g,h.positions=_,h._scene=d,h.index=d.count,d.count++}})),a(e,t,r)}},e.exports.reglPrecompiled={}},48300:function(e,t,r){"use strict";var n=r(5386).fF,i=r(5386).si,a=r(1426).extendFlat,o=r(82196),s=r(9012),l=o.line;e.exports={mode:o.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:i({editType:"plot"},{keys:["real","imag","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:a({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:a({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:a({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o.fillcolor,hoverinfo:a({},s.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:o.hoveron,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},30621:function(e,t,r){"use strict";var n=r(92770),i=r(50606).BADNUM,a=r(36922),o=r(75225),s=r(66279),l=r(47761).calcMarkerSize;e.exports=function(e,t){for(var r=e._fullLayout,u=t.subplot,c=r[u].realaxis,f=r[u].imaginaryaxis,d=c.makeCalcdata(t,"real"),p=f.makeCalcdata(t,"imag"),h=t._length,v=new Array(h),m=0;m")}}e.exports={hoverPoints:function(e,t,r,a){var o=n(e,t,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(u,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}},85956:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:r(7504),categories:["smith","symbols","showLegend","scatter-like"],attributes:r(48300),supplyDefaults:r(65269),colorbar:r(4898),formatLabels:r(62047),calc:r(30621),plot:r(12480),style:r(16296).style,styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(11350).hoverPoints,selectPoints:r(98002),meta:{}}},12480:function(e,t,r){"use strict";var n=r(32663),i=r(50606).BADNUM,a=r(23893).smith;e.exports=function(e,t,r){for(var o=t.layers.frontplot.select("g.scatterlayer"),s=t.xaxis,l=t.yaxis,u={xaxis:s,yaxis:l,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},c=0;c"),o.hovertemplate=d.hovertemplate,a}function x(e,t){g.push(e._hovertitle+": "+t)}}},52979:function(e,t,r){"use strict";e.exports={attributes:r(50413),supplyDefaults:r(46008),colorbar:r(4898),formatLabels:r(93645),calc:r(54337),plot:r(7507),style:r(16296).style,styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(47250),selectPoints:r(98002),eventData:r(4524),moduleType:"trace",name:"scatterternary",basePlotModule:r(61639),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},7507:function(e,t,r){"use strict";var n=r(32663);e.exports=function(e,t,r){var i=t.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=t.xaxis,o=t.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},l=t.layers.frontplot.select("g.scatterlayer"),u=0;ud?b.sizeAvg||Math.max(b.size,3):a(t,x),p=0;pa&&l||i-1,L=!0;if(o(x)||p.selectedpoints||P){var I=p._length;if(p.selectedpoints){v.selectBatch=p.selectedpoints;var R=p.selectedpoints,O={};for(l=0;l1&&(c=v[y-1],d=m[y-1],h=g[y-1]),t=0;tc?"-":"+")+"x")).replace("y",(f>d?"-":"+")+"y")).replace("z",(p>h?"-":"+")+"z");var E=function(){y=0,S=[],A=[],C=[]};(!y||y2?e.slice(1,t-1):2===t?[(e[0]+e[1])/2]:e}function p(e){var t=e.length;return 1===t?[.5,.5]:[e[1]-e[0],e[t-1]-e[t-2]]}function h(e,t){var r=e.fullSceneLayout,i=e.dataScale,c=t._len,f={};function h(e,t){var n=r[t],o=i[u[t]];return a.simpleMap(e,(function(e){return n.d2l(e)*o}))}if(f.vectors=l(h(t._u,"xaxis"),h(t._v,"yaxis"),h(t._w,"zaxis"),c),!c)return{positions:[],cells:[]};var v=h(t._Xs,"xaxis"),m=h(t._Ys,"yaxis"),g=h(t._Zs,"zaxis");if(f.meshgrid=[v,m,g],f.gridFill=t._gridFill,t._slen)f.startingPositions=l(h(t._startsX,"xaxis"),h(t._startsY,"yaxis"),h(t._startsZ,"zaxis"));else{for(var y=m[0],x=d(v),b=d(g),_=new Array(x.length*b.length),w=0,k=0;k=0};y?(r=Math.min(g.length,b.length),l=function(e){return S(g[e])&&A(e)},f=function(e){return String(g[e])}):(r=Math.min(x.length,b.length),l=function(e){return S(x[e])&&A(e)},f=function(e){return String(x[e])}),w&&(r=Math.min(r,_.length));for(var C=0;C1){for(var I=a.randstr(),R=0;R=0){t.i=s.i;var c=r.marker;c.pattern&&c.colors&&c.pattern.shape||(c.color=u,t.color=u),n.pointStyle(e,r,a,t)}else i.fill(e,u)}},83523:function(e,t,r){"use strict";var n=r(39898),i=r(73972),a=r(23469).appendArrayPointValue,o=r(30211),s=r(71828),l=r(11086),u=r(2791),c=r(53581).formatPieValue;function f(e,t,r){for(var n=e.data.data,i={curveNumber:t.index,pointNumber:n.i,data:t._input,fullData:t},o=0;o"),name:M||O("name")?y.name:void 0,color:T("hoverlabel.bgcolor")||x.color,borderColor:T("hoverlabel.bordercolor"),fontFamily:T("hoverlabel.font.family"),fontSize:T("hoverlabel.font.size"),fontColor:T("hoverlabel.font.color"),nameLength:T("hoverlabel.namelength"),textAlign:T("hoverlabel.align"),hovertemplate:M,hovertemplateLabels:L,eventData:l};m&&(F.x0=C-i.rInscribed*i.rpx1,F.x1=C+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),g&&(F.x=C,F.idealAlign=C<0?"left":"right");var j=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:j}),l[0].bbox=j[0],h._hasHoverLabel=!0}if(g){var N=e.select("path.surface");d.styleOne(N,i,y,r,{hovered:!0})}h._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[f(i,y,d.eventDataKeys)],event:n.event})}})),e.on("mouseout",(function(t){var i=r._fullLayout,a=r._fullData[h.index],s=n.select(this).datum();if(h._hasHoverEvent&&(t.originalEvent=n.event,r.emit("plotly_unhover",{points:[f(s,a,d.eventDataKeys)],event:n.event}),h._hasHoverEvent=!1),h._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),h._hasHoverLabel=!1),g){var l=e.select("path.surface");d.styleOne(l,s,a,r,{hovered:!1})}})),e.on("click",(function(e){var t=r._fullLayout,a=r._fullData[h.index],s=m&&(u.isHierarchyRoot(e)||u.isLeaf(e)),c=u.getPtId(e),p=u.isEntry(e)?u.findEntryWithChild(v,c):u.findEntryWithLevel(v,c),g=u.getPtId(p),y={points:[f(e,a,d.eventDataKeys)],event:n.event};s||(y.nextLevel=g);var x=l.triggerHandler(r,"plotly_"+h.type+"click",y);if(!1!==x&&t.hovermode&&(r._hoverdata=[f(e,a,d.eventDataKeys)],o.click(r,n.event)),!s&&!1!==x&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,t._tracePreGUI[a.uid],{level:a.level});var b={data:[{level:g}],traces:[h.index]},_={frame:{redraw:!1,duration:d.transitionTime},transition:{duration:d.transitionTime,easing:d.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(t._hoverlayer.node()),i.call("animate",r,b,_)}}))}},2791:function(e,t,r){"use strict";var n=r(71828),i=r(7901),a=r(6964),o=r(53581);function s(e){return e.data.data.pid}t.findEntryWithLevel=function(e,r){var n;return r&&e.eachAfter((function(e){if(t.getPtId(e)===r)return n=e.copy()})),n||e},t.findEntryWithChild=function(e,r){var n;return e.eachAfter((function(e){for(var i=e.children||[],a=0;a0)},t.getMaxDepth=function(e){return e.maxdepth>=0?e.maxdepth:1/0},t.isHeader=function(e,r){return!(t.isLeaf(e)||e.depth===r._maxDepth-1)},t.getParent=function(e,r){return t.findEntryWithLevel(e,s(r))},t.listPath=function(e,r){var n=e.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return t.listPath(n,r).concat(i)},t.getPath=function(e){return t.listPath(e,"label").join("/")+"/"},t.formatValue=o.formatPieValue,t.formatPercent=function(e,t){var r=n.formatPercent(e,0);return"0%"===r&&(r=o.formatPiePercent(e,t)),r}},87619:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:r(66888),categories:[],animatable:!0,attributes:r(57564),layoutAttributes:r(2654),supplyDefaults:r(17094),supplyLayoutDefaults:r(57034),calc:r(52147).calc,crossTraceCalc:r(52147).crossTraceCalc,plot:r(24714).plot,style:r(29969).style,colorbar:r(4898),meta:{}}},2654:function(e){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},57034:function(e,t,r){"use strict";var n=r(71828),i=r(2654);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("sunburstcolorway",t.colorway),r("extendsunburstcolors")}},24714:function(e,t,r){"use strict";var n=r(39898),i=r(674),a=r(81684).sX,o=r(91424),s=r(71828),l=r(63893),u=r(72597),c=u.recordMinTextSize,f=u.clearMinTextSize,d=r(14575),p=r(53581).getRotationAngle,h=d.computeTransform,v=d.transformInsideText,m=r(29969).styleOne,g=r(16688).resizeText,y=r(83523),x=r(7055),b=r(2791);function _(e,r,u,f){var d=e._context.staticPlot,g=e._fullLayout,_=!g.uniformtext.mode&&b.hasTransition(f),k=n.select(u).selectAll("g.slice"),T=r[0],M=T.trace,S=T.hierarchy,A=b.findEntryWithLevel(S,M.level),C=b.getMaxDepth(M),E=g._size,P=M.domain,L=E.w*(P.x[1]-P.x[0]),I=E.h*(P.y[1]-P.y[0]),R=.5*Math.min(L,I),O=T.cx=E.l+E.w*(P.x[1]+P.x[0])/2,D=T.cy=E.t+E.h*(1-P.y[0])-I/2;if(!A)return k.remove();var z=null,F={};_&&k.each((function(e){F[b.getPtId(e)]={rpx0:e.rpx0,rpx1:e.rpx1,x0:e.x0,x1:e.x1,transform:e.transform},!z&&b.isEntry(e)&&(z=e)}));var j=function(e){return i.partition().size([2*Math.PI,e.height+1])(e)}(A).descendants(),N=A.height+1,Z=0,B=C;T.hasMultipleRoots&&b.isHierarchyRoot(A)&&(j=j.slice(1),N-=1,Z=1,B+=1),j=j.filter((function(e){return e.y1<=B}));var V=p(M.rotation);V&&j.forEach((function(e){e.x0+=V,e.x1+=V}));var U=Math.min(N,C),H=function(e){return(e-Z)/U*R},W=function(e,t){return[e*Math.cos(t),-e*Math.sin(t)]},G=function(e){return s.pathAnnulus(e.rpx0,e.rpx1,e.x0,e.x1,O,D)},q=function(e){return O+w(e)[0]*(e.transform.rCenter||0)+(e.transform.x||0)},Y=function(e){return D+w(e)[1]*(e.transform.rCenter||0)+(e.transform.y||0)};(k=k.data(j,b.getPtId)).enter().append("g").classed("slice",!0),_?k.exit().transition().each((function(){var e=n.select(this);e.select("path.surface").transition().attrTween("d",(function(e){var t=function(e){var t,r=b.getPtId(e),n=F[r],i=F[b.getPtId(A)];if(i){var o=(e.x1>i.x1?2*Math.PI:0)+V;t=e.rpx1X?2*Math.PI:0)+V;t={x0:i,x1:i}}else t={rpx0:R,rpx1:R},s.extendFlat(t,J(e));else t={rpx0:0,rpx1:0};else t={x0:V,x1:V};return a(t,n)}(e);return function(e){return G(t(e))}})):f.attr("d",G),u.call(y,A,e,r,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,e,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:e._transitioning}),f.call(m,i,M,e);var p=s.ensureSingle(u,"g","slicetext"),w=s.ensureSingle(p,"text","",(function(e){e.attr("data-notex",1)})),k=s.ensureUniformFontSize(e,b.determineTextFont(M,i,g.font));w.text(t.formatSliceLabel(i,A,M,r,g)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,k).call(l.convertToTspans,e);var S=o.bBox(w.node());i.transform=v(S,i,T),i.transform.targetX=q(i),i.transform.targetY=Y(i);var C=function(e,t){var r=e.transform;return h(r,t),r.fontSize=k.size,c(M.type,r,g),s.getTextTransform(r)};_?w.transition().attrTween("transform",(function(e){var t=function(e){var t,r=F[b.getPtId(e)],n=e.transform;if(r)t=r;else if(t={rpx1:e.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},z)if(e.parent)if(X){var i=e.x1>X?2*Math.PI:0;t.x0=t.x1=i}else s.extendFlat(t,J(e));else t.x0=t.x1=V;else t.x0=t.x1=V;var o=a(t.transform.textPosAngle,e.transform.textPosAngle),l=a(t.rpx1,e.rpx1),u=a(t.x0,e.x0),f=a(t.x1,e.x1),d=a(t.transform.scale,n.scale),p=a(t.transform.rotate,n.rotate),h=0===n.rCenter?3:0===t.transform.rCenter?1/3:1,v=a(t.transform.rCenter,n.rCenter),m=function(e){return v(Math.pow(e,h))};return function(e){var t=l(e),r=u(e),i=f(e),a=m(e),s={pxmid:W(t,(r+i)/2),rpx1:t,transform:{textPosAngle:o(e),rCenter:a,x:n.x,y:n.y}};return c(M.type,n,g),{transform:{targetX:q(s),targetY:Y(s),scale:d(e),rotate:p(e),rCenter:a}}}}(e);return function(e){return C(t(e),S)}})):w.attr("transform",C(i,S))}))}function w(e){return t=e.rpx1,r=e.transform.textPosAngle,[t*Math.sin(r),-t*Math.cos(r)];var t,r}t.plot=function(e,t,r,i){var a,o,s=e._fullLayout,l=s._sunburstlayer,u=!r,c=!s.uniformtext.mode&&b.hasTransition(r);f("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),c?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(t){_(e,t,this,r)}))}))):(a.each((function(t){_(e,t,this,r)})),s.uniformtext.mode&&g(e,s._sunburstlayer.selectAll(".trace"),"sunburst")),u&&a.exit().remove()},t.formatSliceLabel=function(e,t,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!a&&(!o||"none"===o))return"";var l=i.separators,u=n[0],c=e.data.data,f=u.hierarchy,d=b.isHierarchyRoot(e),p=b.getParent(f,e),h=b.getValue(e);if(!a){var v,m=o.split("+"),g=function(e){return-1!==m.indexOf(e)},y=[];if(g("label")&&c.label&&y.push(c.label),c.hasOwnProperty("v")&&g("value")&&y.push(b.formatValue(c.v,l)),!d){g("current path")&&y.push(b.getPath(e.data));var x=0;g("percent parent")&&x++,g("percent entry")&&x++,g("percent root")&&x++;var _=x>1;if(x){var w,k=function(e){v=b.formatPercent(w,l),_&&(v+=" of "+e),y.push(v)};g("percent parent")&&!d&&(w=h/b.getValue(p),k("parent")),g("percent entry")&&(w=h/b.getValue(t),k("entry")),g("percent root")&&(w=h/b.getValue(f),k("root"))}}return g("text")&&(v=s.castOption(r,c.i,"text"),s.isValidTextValue(v)&&y.push(v)),y.join("
")}var T=s.castOption(r,c.i,"texttemplate");if(!T)return"";var M={};c.label&&(M.label=c.label),c.hasOwnProperty("v")&&(M.value=c.v,M.valueLabel=b.formatValue(c.v,l)),M.currentPath=b.getPath(e.data),d||(M.percentParent=h/b.getValue(p),M.percentParentLabel=b.formatPercent(M.percentParent,l),M.parent=b.getPtLabel(p)),M.percentEntry=h/b.getValue(t),M.percentEntryLabel=b.formatPercent(M.percentEntry,l),M.entry=b.getPtLabel(t),M.percentRoot=h/b.getValue(f),M.percentRootLabel=b.formatPercent(M.percentRoot,l),M.root=b.getPtLabel(f),c.hasOwnProperty("color")&&(M.color=c.color);var S=s.castOption(r,c.i,"text");return(s.isValidTextValue(S)||""===S)&&(M.text=S),M.customdata=s.castOption(r,c.i,"customdata"),s.texttemplateString(T,M,i._d3locale,M,r._meta||{})}},29969:function(e,t,r){"use strict";var n=r(39898),i=r(7901),a=r(71828),o=r(72597).resizeText,s=r(43467);function l(e,t,r,n){var o=t.data.data,l=!t.children,u=o.i,c=a.castOption(r,u,"marker.line.color")||i.defaultLine,f=a.castOption(r,u,"marker.line.width")||0;e.call(s,t,r,n).style("stroke-width",f).call(i.stroke,c).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(e){var t=e._fullLayout._sunburstlayer.selectAll(".trace");o(e,t,"sunburst"),t.each((function(t){var r=n.select(this),i=t[0].trace;r.style("opacity",i.opacity),r.selectAll("path.surface").each((function(t){n.select(this).call(l,t,i,e)}))}))},styleOne:l}},54532:function(e,t,r){"use strict";var n=r(7901),i=r(50693),a=r(12663).axisHoverFormat,o=r(5386).fF,s=r(9012),l=r(1426).extendFlat,u=r(30962).overrideAll;function c(e){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var f=e.exports=u(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");f.x.editType=f.y.editType=f.z.editType="calc+clearAxisTypes",f.transforms=void 0},18396:function(e,t,r){"use strict";var n=r(78803);e.exports=function(e,t){t.surfacecolor?n(e,t,{vals:t.surfacecolor,containerStr:"",cLetter:"c"}):n(e,t,{vals:t.z,containerStr:"",cLetter:"c"})}},43768:function(e,t,r){"use strict";var n=r(9330).gl_surface3d,i=r(9330).ndarray,a=r(9330).ndarray_linear_interpolate.d2,o=r(824),s=r(43907),l=r(71828).isArrayOrTypedArray,u=r(81697).parseColorScale,c=r(78614),f=r(21081).extractOpts;function d(e,t,r){this.scene=e,this.uid=r,this.surface=t,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var p=d.prototype;p.getXat=function(e,t,r,n){var i=l(this.data.x)?l(this.data.x[0])?this.data.x[t][e]:this.data.x[e]:e;return void 0===r?i:n.d2l(i,0,r)},p.getYat=function(e,t,r,n){var i=l(this.data.y)?l(this.data.y[0])?this.data.y[t][e]:this.data.y[t]:t;return void 0===r?i:n.d2l(i,0,r)},p.getZat=function(e,t,r,n){var i=this.data.z[t][e];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[t][e]),void 0===r?i:n.d2l(i,0,r)},p.handlePick=function(e){if(e.object===this.surface){var t=(e.data.index[0]-1)/this.dataScaleX-1,r=(e.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(t),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);e.index=[n,i],e.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],e.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=e.dataCoordinate[a];null!==o&&void 0!==o&&(e.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[i]&&void 0!==s[i][n]?e.textLabel=s[i][n]:e.textLabel=s||"",e.data.dataCoordinate=e.dataCoordinate.slice(),this.surface.highlight(e.data),this.scene.glplot.spikes.position=e.dataCoordinate,!0}};var h=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function v(e,t){if(e0){r=h[n];break}return r}function y(e,t){if(!(e<1||t<1)){for(var r=m(e),n=m(t),i=1,a=0;a_;)r--,r/=g(r),++r1?n:1},p.refineCoords=function(e){for(var t=this.dataScaleX,r=this.dataScaleY,n=e[0].shape[0],a=e[0].shape[1],o=0|Math.floor(e[0].shape[0]*t+1),s=0|Math.floor(e[0].shape[1]*r+1),l=1+n+1,u=1+a+1,c=i(new Float32Array(l*u),[l,u]),f=[1/t,0,0,0,1/r,0,0,0,1],d=0;d0&&null!==this.contourStart[e]&&null!==this.contourEnd[e]&&this.contourEnd[e]>this.contourStart[e]))for(i[e]=!0,t=this.contourStart[e];ta&&(this.minValues[t]=a),this.maxValues[t]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},51018:function(e,t,r){"use strict";var n=r(49850),i=r(1426).extendFlat,a=r(92770);function o(e){if(Array.isArray(e)){for(var t=0,r=0;r=t||u===e.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=u,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=u+1,a=0);return n}e.exports=function(e,t){var r=l(t.cells.values),p=function(e){return e.slice(t.header.values.length,e.length)},h=l(t.header.values);h.length&&!h[0].length&&(h[0]=[""],h=l(h));var v=h.concat(p(r).map((function(){return u((h[0]||[""]).length)}))),m=t.domain,g=Math.floor(e._fullLayout._size.w*(m.x[1]-m.x[0])),y=Math.floor(e._fullLayout._size.h*(m.y[1]-m.y[0])),x=t.header.values.length?v[0].map((function(){return t.header.height})):[n.emptyHeaderHeight],b=r.length?r[0].map((function(){return t.cells.height})):[],_=x.reduce(s,0),w=d(b,y-_+n.uplift),k=f(d(x,_),[]),T=f(w,k),M={},S=t._fullInput.columnorder.concat(p(r.map((function(e,t){return t})))),A=v.map((function(e,r){var n=Array.isArray(t.columnwidth)?t.columnwidth[Math.min(r,t.columnwidth.length-1)]:t.columnwidth;return a(n)?Number(n):1})),C=A.reduce(s,0);A=A.map((function(e){return e/C*g}));var E=Math.max(o(t.header.line.width),o(t.cells.line.width)),P={key:t.uid+e._context.staticPlot,translateX:m.x[0]*e._fullLayout._size.w,translateY:e._fullLayout._size.h*(1-m.y[1]),size:e._fullLayout._size,width:g,maxLineWidth:E,height:y,columnOrder:S,groupHeight:y,rowBlocks:T,headerRowBlocks:k,scrollY:0,cells:i({},t.cells,{values:r}),headerCells:i({},t.header,{values:v}),gdColumns:v.map((function(e){return e[0]})),gdColumnsOriginalOrder:v.map((function(e){return e[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:v.map((function(e,t){var r=M[e];return M[e]=(r||0)+1,{key:e+"__"+M[e],label:e,specIndex:t,xIndex:S[t],xScale:c,x:void 0,calcdata:void 0,columnWidth:A[t]}}))};return P.columns.forEach((function(e){e.calcdata=P,e.x=c(e)})),P}},56269:function(e,t,r){"use strict";var n=r(1426).extendFlat;t.splitToPanels=function(e){var t=[0,0],r=n({},e,{key:"header",type:"header",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!0,values:e.calcdata.headerCells.values[e.specIndex],rowBlocks:e.calcdata.headerRowBlocks,calcdata:n({},e.calcdata,{cells:e.calcdata.headerCells})});return[n({},e,{key:"cells1",type:"cells",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),n({},e,{key:"cells2",type:"cells",page:1,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),r]},t.splitToCells=function(e){var t=function(e){var t=e.rowBlocks[e.page],r=t?t.rows[0].rowIndex:0,n=t?r+t.rows.length:0;return[r,n]}(e);return(e.values||[]).slice(t[0],t[1]).map((function(r,n){return{keyWithinBlock:n+("string"===typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:t[0]+n,column:e,calcdata:e.calcdata,page:e.page,rowBlocks:e.rowBlocks,value:r}}))}},39754:function(e,t,r){"use strict";var n=r(71828),i=r(44464),a=r(27670).c;e.exports=function(e,t,r,o){function s(r,a){return n.coerce(e,t,i,r,a)}a(t,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(e,t){for(var r=e.columnorder||[],n=e.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(e,t){return e-t})),o=i.map((function(e){return a.indexOf(e)})),s=o.length;s/i),l=!o||s;e.mayHaveMarkup=o&&i.match(/[<&>]/);var u,c="string"===typeof(u=i)&&u.match(n.latexCheck);e.latex=c;var f,d,p=c?"":k(e.calcdata.cells.prefix,t,r)||"",h=c?"":k(e.calcdata.cells.suffix,t,r)||"",v=c?null:k(e.calcdata.cells.format,t,r)||null,m=p+(v?a(v)(e.value):e.value)+h;if(e.wrappingNeeded=!e.wrapped&&!l&&!c&&(f=w(m)),e.cellHeightMayIncrease=s||c||e.mayHaveMarkup||(void 0===f?w(m):f),e.needsConvertToTspans=e.mayHaveMarkup||e.wrappingNeeded||e.latex,e.wrappingNeeded){var g=(" "===n.wrapSplitCharacter?m.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===u.length&&(u[0]===i.length-1?u.unshift(u[0]-1):u.push(u[0]+1)),u[0]%2&&u.reverse(),t.each((function(e,t){e.page=u[t],e.scrollY=l})),t.attr("transform",(function(e){var t=D(e.rowBlocks,e.page)-e.scrollY;return c(0,t)})),e&&(P(e,r,t,u,n.prevPages,n,0),P(e,r,t,u,n.prevPages,n,1),x(r,e))}}function E(e,t,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=t.filter((function(e){return s.key===e.key})),u=r||s.scrollbarState.dragMultiplier,c=s.scrollY;s.scrollY=void 0===a?s.scrollY+u*i.event.dy:a;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(M);return C(e,f,l),s.scrollY===c}}function P(e,t,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(e,t){return t===o&&n[t]!==i[t]}));b(e,t,a,r),i[o]=n[o]})))}function L(e,t,r,a){return function(){var o=i.select(t.parentNode);o.each((function(e){var t=e.fragments;o.selectAll("tspan.line").each((function(e,r){t[r].width=this.getComputedTextLength()}));var r,i,a=t[t.length-1].width,s=t.slice(0,-1),l=[],u=0,c=e.column.columnWidth-2*n.cellPad;for(e.value="";s.length;)u+(i=(r=s.shift()).width+a)>c&&(e.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],u=0),l.push(r.text),u+=i;u&&(e.value+=l.join(n.wrapSpacer)),e.wrapped=!0})),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,e,a),i.select(t.parentNode.parentNode).call(O)}}function I(e,t,r,a,o){return function(){if(!o.settledY){var s=i.select(t.parentNode),l=j(o),u=o.key-l.firstRowIndex,f=l.rows[u].rowHeight,d=o.cellHeightMayIncrease?t.parentNode.getBoundingClientRect().height+2*n.cellPad:f,p=Math.max(d,f);p-l.rows[u].rowHeight&&(l.rows[u].rowHeight=p,e.selectAll("."+n.cn.columnCell).call(O),C(null,e.filter(M),0),x(r,a,!0)),s.attr("transform",(function(){var e=this,t=e.parentNode.getBoundingClientRect(),r=i.select(e.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),a=e.transform.baseVal.consolidate(),s=r.top-t.top+(a?a.matrix.f:n.cellPad);return c(R(o,i.select(e.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function R(e,t){switch(e.align){case"left":default:return n.cellPad;case"right":return e.column.columnWidth-(t||0)-n.cellPad;case"center":return(e.column.columnWidth-(t||0))/2}}function O(e){e.attr("transform",(function(e){var t=e.rowBlocks[0].auxiliaryBlocks.reduce((function(e,t){return e+z(t,1/0)}),0),r=z(j(e),e.key);return c(0,r+t)})).selectAll("."+n.cn.cellRect).attr("height",(function(e){return(t=j(e),r=e.key,t.rows[r-t.firstRowIndex]).rowHeight;var t,r}))}function D(e,t){for(var r=0,n=t-1;n>=0;n--)r+=F(e[n]);return r}function z(e,t){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:u.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},78018:function(e,t,r){"use strict";var n=r(74875);t.name="treemap",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},65039:function(e,t,r){"use strict";var n=r(52147);t.y=function(e,t){return n.calc(e,t)},t.T=function(e){return n._runCrossTraceCalc("treemap",e)}},43473:function(e){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},91174:function(e,t,r){"use strict";var n=r(71828),i=r(45802),a=r(7901),o=r(27670).c,s=r(90769).handleText,l=r(97313).TEXTPAD,u=r(37434).handleMarkerDefaults,c=r(21081),f=c.hasColorscale,d=c.handleDefaults;e.exports=function(e,t,r,c){function p(r,a){return n.coerce(e,t,i,r,a)}var h=p("labels"),v=p("parents");if(h&&h.length&&v&&v.length){var m=p("values");m&&m.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var g=p("text");p("texttemplate"),t.texttemplate||p("textinfo",Array.isArray(g)?"text+label":"label"),p("hovertext"),p("hovertemplate");var y=p("pathbar.visible");s(e,t,c,p,"auto",{hasPathbar:y,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var x=-1!==t.textposition.indexOf("bottom");u(e,t,c,p),(t._hasColorscale=f(e,"marker","colors")||(e.marker||{}).coloraxis)?d(e,t,c,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(t.marker.colors||[]).length);var b=2*t.textfont.size;p("marker.pad.t",x?b/4:b),p("marker.pad.l",b/4),p("marker.pad.r",b/4),p("marker.pad.b",x?b:b/4),p("marker.cornerradius"),t._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},y&&(p("pathbar.thickness",t.pathbar.textfont.size+2*l),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),o(t,c,p),t._length=null}else t.visible=!1}},80694:function(e,t,r){"use strict";var n=r(39898),i=r(2791),a=r(72597).clearMinTextSize,o=r(16688).resizeText,s=r(46650);e.exports=function(e,t,r,l,u){var c,f,d=u.type,p=u.drawDescendants,h=e._fullLayout,v=h["_"+d+"layer"],m=!r;a(d,h),(c=v.selectAll("g.trace."+d).data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(d,!0),c.order(),!h.uniformtext.mode&&i.hasTransition(r)?(l&&(f=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){v.selectAll("g.trace").each((function(t){s(e,t,this,r,p)}))}))):(c.each((function(t){s(e,t,this,r,p)})),h.uniformtext.mode&&o(e,v.selectAll(".trace"),d)),m&&c.exit().remove()}},66209:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=r(91424),o=r(63893),s=r(37210),l=r(96362).styleOne,u=r(43473),c=r(2791),f=r(83523),d=!0;e.exports=function(e,t,r,p,h){var v=h.barDifY,m=h.width,g=h.height,y=h.viewX,x=h.viewY,b=h.pathSlice,_=h.toMoveInsideSlice,w=h.strTransform,k=h.hasTransition,T=h.handleSlicesExit,M=h.makeUpdateSliceInterpolator,S=h.makeUpdateTextInterpolator,A={},C=e._context.staticPlot,E=e._fullLayout,P=t[0],L=P.trace,I=P.hierarchy,R=m/L._entryDepth,O=c.listPath(r.data,"id"),D=s(I.copy(),[m,g],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(D=D.filter((function(e){var t=O.indexOf(e.data.id);return-1!==t&&(e.x0=R*t,e.x1=R*(t+1),e.y0=v,e.y1=v+g,e.onPathbar=!0,!0)}))).reverse(),(p=p.data(D,c.getPtId)).enter().append("g").classed("pathbar",!0),T(p,d,A,[m,g],b),p.order();var z=p;k&&(z=z.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),z.each((function(s){s._x0=y(s.x0),s._x1=y(s.x1),s._y0=x(s.y0),s._y1=x(s.y1),s._hoverX=y(s.x1-Math.min(m,g)/2),s._hoverY=x(s.y1-g/2);var p=n.select(this),h=i.ensureSingle(p,"path","surface",(function(e){e.style("pointer-events",C?"none":"all")}));k?h.transition().attrTween("d",(function(e){var t=M(e,d,A,[m,g]);return function(e){return b(t(e))}})):h.attr("d",b),p.call(f,r,e,t,{styleOne:l,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:e._transitioning}),h.call(l,s,L,e,{hovered:!1}),s._text=(c.getPtLabel(s)||"").split("
").join(" ")||"";var v=i.ensureSingle(p,"g","slicetext"),T=i.ensureSingle(v,"text","",(function(e){e.attr("data-notex",1)})),P=i.ensureUniformFontSize(e,c.determineTextFont(L,s,E.font,{onPathbar:!0}));T.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,P).call(o.convertToTspans,e),s.textBB=a.bBox(T.node()),s.transform=_(s,{fontSize:P.size,onPathbar:!0}),s.transform.fontSize=P.size,k?T.transition().attrTween("transform",(function(e){var t=S(e,d,A,[m,g]);return function(e){return w(t(e))}})):T.attr("transform",w(s))}))}},52583:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=r(91424),o=r(63893),s=r(37210),l=r(96362).styleOne,u=r(43473),c=r(2791),f=r(83523),d=r(24714).formatSliceLabel,p=!1;e.exports=function(e,t,r,h,v){var m=v.width,g=v.height,y=v.viewX,x=v.viewY,b=v.pathSlice,_=v.toMoveInsideSlice,w=v.strTransform,k=v.hasTransition,T=v.handleSlicesExit,M=v.makeUpdateSliceInterpolator,S=v.makeUpdateTextInterpolator,A=v.prevEntry,C=e._context.staticPlot,E=e._fullLayout,P=t[0].trace,L=-1!==P.textposition.indexOf("left"),I=-1!==P.textposition.indexOf("right"),R=-1!==P.textposition.indexOf("bottom"),O=!R&&!P.marker.pad.t||R&&!P.marker.pad.b,D=s(r,[m,g],{packing:P.tiling.packing,squarifyratio:P.tiling.squarifyratio,flipX:P.tiling.flip.indexOf("x")>-1,flipY:P.tiling.flip.indexOf("y")>-1,pad:{inner:P.tiling.pad,top:P.marker.pad.t,left:P.marker.pad.l,right:P.marker.pad.r,bottom:P.marker.pad.b}}).descendants(),z=1/0,F=-1/0;D.forEach((function(e){var t=e.depth;t>=P._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(z=Math.min(z,t),F=Math.max(F,t))})),h=h.data(D,c.getPtId),P._maxVisibleLayers=isFinite(F)?F-z+1:0,h.enter().append("g").classed("slice",!0),T(h,p,{},[m,g],b),h.order();var j=null;if(k&&A){var N=c.getPtId(A);h.each((function(e){null===j&&c.getPtId(e)===N&&(j={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var Z=function(){return j||{x0:0,x1:m,y0:0,y1:g}},B=h;return k&&(B=B.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),B.each((function(s){var h=c.isHeader(s,P);s._x0=y(s.x0),s._x1=y(s.x1),s._y0=x(s.y0),s._y1=x(s.y1),s._hoverX=y(s.x1-P.marker.pad.r),s._hoverY=x(R?s.y1-P.marker.pad.b/2:s.y0+P.marker.pad.t/2);var v=n.select(this),T=i.ensureSingle(v,"path","surface",(function(e){e.style("pointer-events",C?"none":"all")}));k?T.transition().attrTween("d",(function(e){var t=M(e,p,Z(),[m,g]);return function(e){return b(t(e))}})):T.attr("d",b),v.call(f,r,e,t,{styleOne:l,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),T.call(l,s,P,e,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h?O?"":c.getPtLabel(s)||"":d(s,r,P,t,E)||"";var A=i.ensureSingle(v,"g","slicetext"),D=i.ensureSingle(A,"text","",(function(e){e.attr("data-notex",1)})),z=i.ensureUniformFontSize(e,c.determineTextFont(P,s,E.font));D.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",I?"end":L||h?"start":"middle").call(a.font,z).call(o.convertToTspans,e),s.textBB=a.bBox(D.node()),s.transform=_(s,{fontSize:z.size,isHeader:h}),s.transform.fontSize=z.size,k?D.transition().attrTween("transform",(function(e){var t=S(e,p,Z(),[m,g]);return function(e){return w(t(e))}})):D.attr("transform",w(s))})),j}},14102:function(e){"use strict";e.exports=function e(t,r,n){var i;n.swapXY&&(i=t.x0,t.x0=t.y0,t.y0=i,i=t.x1,t.x1=t.y1,t.y1=i),n.flipX&&(i=t.x0,t.x0=r[0]-t.x1,t.x1=r[0]-i),n.flipY&&(i=t.y0,t.y0=r[1]-t.y1,t.y1=r[1]-i);var a=t.children;if(a)for(var o=0;o-1?P+R:-(I+R):0,D={x0:L,x1:L,y0:O,y1:O+I},z=function(e,t,r){var n=g.tiling.pad,i=function(e){return e-n<=t.x0},a=function(e){return e+n>=t.x1},o=function(e){return e-n<=t.y0},s=function(e){return e+n>=t.y1};return e.x0===t.x0&&e.x1===t.x1&&e.y0===t.y0&&e.y1===t.y1?{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1}:{x0:i(e.x0-n)?0:a(e.x0-n)?r[0]:e.x0,x1:i(e.x1+n)?0:a(e.x1+n)?r[0]:e.x1,y0:o(e.y0-n)?0:s(e.y0-n)?r[1]:e.y0,y1:o(e.y1+n)?0:s(e.y1+n)?r[1]:e.y1}},F=null,j={},N={},Z=null,B=function(e,t){return t?j[d(e)]:N[d(e)]},V=function(e,t,r,n){if(t)return j[d(x)]||D;var i=N[g.level]||r;return function(e){return e.data.depth-b.data.depth=(n-=(y?te:te.r)-s)){var p=(r+n)/2;r=p,n=p}var h;oe?i<(h=a-(y?te:te.b))&&h"===ee?(l.x-=a,u.x-=a,c.x-=a,f.x-=a):"/"===ee?(c.x-=a,f.x-=a,o.x-=a/2,s.x-=a/2):"\\"===ee?(l.x-=a,u.x-=a,o.x-=a/2,s.x-=a/2):"<"===ee&&(o.x-=a,s.x-=a),Q(l),Q(f),Q(o),Q(u),Q(c),Q(s),"M"+$(l.x,l.y)+"L"+$(u.x,u.y)+"L"+$(s.x,s.y)+"L"+$(c.x,c.y)+"L"+$(f.x,f.y)+"L"+$(o.x,o.y)+"Z"},toMoveInsideSlice:se,makeUpdateSliceInterpolator:ue,makeUpdateTextInterpolator:ce,handleSlicesExit:fe,hasTransition:M,strTransform:de}):w.remove()}},96362:function(e,t,r){"use strict";var n=r(39898),i=r(7901),a=r(71828),o=r(2791),s=r(72597).resizeText,l=r(43467);function u(e,t,r,n,s){var u,c,f=(s||{}).hovered,d=t.data.data,p=d.i,h=d.color,v=o.isHierarchyRoot(t),m=1;if(f)u=r._hovered.marker.line.color,c=r._hovered.marker.line.width;else if(v&&h===r.root.color)m=100,u="rgba(0,0,0,0)",c=0;else if(u=a.castOption(r,p,"marker.line.color")||i.defaultLine,c=a.castOption(r,p,"marker.line.width")||0,!r._hasColorscale&&!t.onPathbar){var g=r.marker.depthfade;if(g){var y,x=i.combine(i.addOpacity(r._backgroundColor,.75),h);if(!0===g){var b=o.getMaxDepth(r);y=isFinite(b)?o.isLeaf(t)?0:r._maxVisibleLayers-(t.data.depth-r._entryDepth):t.data.height+1}else y=t.data.depth-r._entryDepth,r._atRootLevel||y++;if(y>0)for(var _=0;_0){var b,_,w,k,T,M=e.xa,S=e.ya;"h"===h.orientation?(T=t,b="y",w=S,_="x",k=M):(T=r,b="x",w=M,_="y",k=S);var A=p[e.index];if(T>=A.span[0]&&T<=A.span[1]){var C=i.extendFlat({},e),E=k.c2p(T,!0),P=s.getKdeValue(A,h,T),L=s.getPositionOnKdePath(A,h,E),I=w._offset,R=w._length;C[b+"0"]=L[0],C[b+"1"]=L[1],C[_+"0"]=C[_+"1"]=E,C[_+"Label"]=_+": "+a.hoverLabelText(k,T,h[_+"hoverformat"])+", "+p[0].t.labels.kde+" "+P.toFixed(3);for(var O=0,D=0;D")),c.color=function(e,t){var r=e[t.dir].marker,n=r.color,a=r.line.color,o=r.line.width;return i(n)?n:i(a)&&o?a:void 0}(d,m),[c]}function T(e){return n(v,e,d[h+"hoverformat"])}}},19990:function(e,t,r){"use strict";e.exports={attributes:r(43037),layoutAttributes:r(13494),supplyDefaults:r(83266).supplyDefaults,crossTraceDefaults:r(83266).crossTraceDefaults,supplyLayoutDefaults:r(5176),calc:r(52752),crossTraceCalc:r(70766),plot:r(30436),style:r(55750).style,hoverPoints:r(61326),eventData:r(58593),selectPoints:r(81974),moduleType:"trace",name:"waterfall",basePlotModule:r(93612),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},13494:function(e){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},5176:function(e,t,r){"use strict";var n=r(71828),i=r(13494);e.exports=function(e,t,r){var a=!1;function o(r,a){return n.coerce(e,t,i,r,a)}for(var s=0;s0&&(m+=d?"M"+f[0]+","+h[1]+"V"+h[0]:"M"+f[1]+","+h[0]+"H"+f[0]),"between"!==p&&(r.isSum||s path").each((function(e){if(!e.isBlank){var t=s[e.dir].marker;n.select(this).call(a.fill,t.color).call(a.stroke,t.line.color).call(i.dashLine,t.line.dash,t.line.width).style("opacity",s.selectedpoints&&!e.selected?o:1)}})),u(r,s,e),r.selectAll(".lines").each((function(){var e=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},82887:function(e,t,r){"use strict";var n=r(89298),i=r(71828),a=r(86281),o=r(79344).p,s=r(50606).BADNUM;t.moduleType="transform",t.name="aggregate";var l=t.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},u=l.aggregations;function c(e,t,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(t,o),u=l.get(),c=function(e,t){var r=e.func,n=t.d2c,a=t.c2d;switch(r){case"count":return f;case"first":return d;case"last":return p;case"sum":return function(e,t){for(var r=0,i=0;ii&&(i=c,o=u)}}return i?a(o):s};case"rms":return function(e,t){for(var r=0,i=0,o=0;o":return function(e){return d(e)>s};case">=":return function(e){return d(e)>=s};case"[]":return function(e){var t=d(e);return t>=s[0]&&t<=s[1]};case"()":return function(e){var t=d(e);return t>s[0]&&t=s[0]&&ts[0]&&t<=s[1]};case"][":return function(e){var t=d(e);return t<=s[0]||t>=s[1]};case")(":return function(e){var t=d(e);return ts[1]};case"](":return function(e){var t=d(e);return t<=s[0]||t>s[1]};case")[":return function(e){var t=d(e);return t=s[1]};case"{}":return function(e){return-1!==s.indexOf(d(e))};case"}{":return function(e){return-1===s.indexOf(d(e))}}}(r,a.getDataToCoordFunc(e,t,s,i),d),x={},b={},_=0;h?(m=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},g=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(m=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},g=function(e,t){var r=x[e.astr][t];e.get().push(r)}),T(m);for(var w=o(t.transforms,r),k=0;k1?"%{group} (%{trace})":"%{group}");var l=e.styles,u=o.styles=[];if(l)for(a=0;ad)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,h.prototype),t}function h(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return g(e)}return v(e,t,r)}function v(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!h.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|_(e,t),n=p(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(te(e,Uint8Array)){var t=new Uint8Array(e);return x(t.buffer,t.byteOffset,t.byteLength)}return y(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(e));if(te(e,ArrayBuffer)||e&&te(e.buffer,ArrayBuffer))return x(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(te(e,SharedArrayBuffer)||e&&te(e.buffer,SharedArrayBuffer)))return x(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return h.from(n,t,r);var i=function(e){if(h.isBuffer(e)){var t=0|b(e.length),r=p(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||re(e.length)?p(0):y(e):"Buffer"===e.type&&Array.isArray(e.data)?y(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return h.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(e))}function m(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function g(e){return m(e),p(e<0?0:0|b(e))}function y(e){for(var t=e.length<0?0:0|b(e.length),r=p(t),n=0;n=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return 0|e}function _(e,t){if(h.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||te(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+l(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return J(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(e).length;default:if(i)return n?-1:J(e).length;t=(""+t).toLowerCase(),i=!0}}function w(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return z(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return L(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function k(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function T(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),re(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=h.from(t,n)),h.isBuffer(t))return 0===t.length?-1:M(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):M(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function M(e,t,r,n,i){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,d=0;di&&(n=i):n=i;var a,o=t.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function L(e,t,r){return 0===t&&r===e.length?u.fromByteArray(e):u.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,u=void 0,c=void 0,f=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128===(192&(l=e[i+1]))&&(f=(31&a)<<6|63&l)>127&&(o=f);break;case 3:l=e[i+1],u=e[i+2],128===(192&l)&&128===(192&u)&&(f=(15&a)<<12|(63&l)<<6|63&u)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=e[i+1],u=e[i+2],c=e[i+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(f=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?(h.isBuffer(a)||(a=h.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!h.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},h.byteLength=_,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},f&&(h.prototype[f]=h.prototype.inspect),h.prototype.compare=function(e,t,r,n,i){if(te(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+l(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(n,i),c=e.slice(t,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return C(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function O(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,a){if(!h.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function Z(e,t,r,n,i){Y(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function B(e,t,r,n,i){Y(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function V(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,i){return t=+t,r>>>=0,i||V(e,0,r,4),c.write(e,t,r,n,23,4),r+4}function H(e,t,r,n,i){return t=+t,r>>>=0,i||V(e,0,r,8),c.write(e,t,r,n,52,8),r+8}h.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||j(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||j(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},h.prototype.readUint8=h.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readBigUInt64LE=ie((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,t>>>=0,r||j(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},h.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},h.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readBigInt64LE=ie((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<>>=0,t||j(e,4,this.length),c.read(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),c.read(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),c.read(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),c.read(this,e,!1,52,8)},h.prototype.writeUintLE=h.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},h.prototype.writeUint8=h.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeBigUInt64LE=ie((function(e){return Z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeBigUInt64BE=ie((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},h.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},h.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},h.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},h.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeBigInt64LE=ie((function(e){return Z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeBigInt64BE=ie((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},h.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},h.prototype.writeDoubleLE=function(e,t,r){return H(this,e,t,!0,r)},h.prototype.writeDoubleBE=function(e,t,r){return H(this,e,t,!1,r)},h.prototype.copy=function(e,t,r,n){if(!h.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function Y(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(r).concat(s),new W.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){X(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,i,a)}function X(e,t){if("number"!==typeof e)throw new W.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw X(e,r),new W.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new W.ERR_BUFFER_OUT_OF_BOUNDS;throw new W.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}G("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),G("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(l(t))}),TypeError),G("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=q(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=q(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var $=/[^+/0-9A-Za-z-_]/g;function J(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Q(e){return u.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function ee(e,t,r,n){var i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function te(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function re(e){return e!==e}var ne=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function ie(e){return"undefined"===typeof BigInt?ae:e}function ae(){throw new Error("BigInt not supported")}},2321:function(e){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});var i=e.ua;if(i||"undefined"===typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"===typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!==typeof i)return!1;var a=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},3910:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=s(e),o=a[0],l=a[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,l)),c=0,f=l>0?o-4:o;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3187:function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,c=-7,f=r?i-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=h,s/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=h,o/=256,u-=8);e[r+p-h]|=128*v}},1152:function(e,t,r){"use strict";e.exports=function(e){var t=(e=e||{}).eye||[0,0,1],r=e.center||[0,0,0],s=e.up||[0,1,0],l=e.distanceLimits||[0,1/0],u=e.mode||"turntable",c=n(),f=i(),d=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,t,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,t,r,s),d.setDistanceLimits(l[0],l[1]),d.lookAt(0,t,r,s),new o({turntable:c,orbit:f,matrix:d},u)};var n=r(3440),i=r(7774),a=r(9298);function o(e,t){this._controllerNames=Object.keys(e),this._controllerList=this._controllerNames.map((function(t){return e[t]})),this._mode=t,this._active=e[t],this._active||(this._mode="turntable",this._active=e.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(e){for(var t=this._controllerList,r=0;r0?u=u.ushln(f):f<0&&(c=c.ushln(-f)),s(u,c)}},234:function(e,t,r){"use strict";var n=r(3218);e.exports=function(e){return Array.isArray(e)&&2===e.length&&n(e[0])&&n(e[1])}},4275:function(e,t,r){"use strict";var n=r(1928);e.exports=function(e){return e.cmp(new n(0))}},9958:function(e,t,r){"use strict";var n=r(4275);e.exports=function(e){var t=e.length,r=e.words,i=0;if(1===t)i=r[0];else if(2===t)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},3218:function(e,t,r){"use strict";r(1928),e.exports=function(e){return e&&"object"===typeof e&&Boolean(e.words)}},5514:function(e,t,r){"use strict";var n=r(1928),i=r(8362);e.exports=function(e){var t=i.exponent(e);return t<52?new n(e):new n(e*Math.pow(2,52-t)).ushln(t-52)}},8524:function(e,t,r){"use strict";var n=r(5514),i=r(4275);e.exports=function(e,t){var r=i(e),a=i(t);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(e=e.neg(),t=t.neg());var o=e.gcd(t);return o.cmpn(1)?[e.div(o),t.div(o)]:[e,t]}},2813:function(e,t,r){"use strict";var n=r(1928);e.exports=function(e){return new n(e)}},3962:function(e,t,r){"use strict";var n=r(8524);e.exports=function(e,t){return n(e[0].mul(t[0]),e[1].mul(t[1]))}},4951:function(e,t,r){"use strict";var n=r(4275);e.exports=function(e){return n(e[0])*n(e[1])}},4354:function(e,t,r){"use strict";var n=r(8524);e.exports=function(e,t){return n(e[0].mul(t[1]).sub(e[1].mul(t[0])),e[1].mul(t[1]))}},7999:function(e,t,r){"use strict";var n=r(9958),i=r(1112);e.exports=function(e){var t=e[0],r=e[1];if(0===t.cmpn(0))return 0;var a=t.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,u=t.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=i(s)+4;return u*(s+(d=n(l.ushln(c).divRound(r)))*Math.pow(2,-c))}var f=r.bitLength()-l.bitLength()+53,d=n(l.ushln(f).divRound(r));return f<1023?u*d*Math.pow(2,-f):u*(d*=Math.pow(2,-1023))*Math.pow(2,1023-f)}},5070:function(e){"use strict";function t(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}e.exports={ge:function(e,r,n,i,a){return o(e,r,n,i,a,t)},gt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},lt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},le:function(e,t,r,n,a){return o(e,t,r,n,a,i)},eq:function(e,t,r,n,i){return o(e,t,r,n,i,a)}}},2288:function(e,t){"use strict";function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},1928:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"===typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(6601).Buffer}catch(M){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=l(e,t,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,d=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=d;p++){var h=u-p|0;c+=(o=(i=0|e.words[h])*(a=0|t.words[p])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=f[e],p=d[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var v=h.modn(p).toString(e);r=(h=h.idivn(p)).isZero()?v+r:c[u-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n("undefined"!==typeof o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===t,u=new e(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,p=0|o[1],h=8191&p,v=p>>>13,m=0|o[2],g=8191&m,y=m>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],k=8191&w,T=w>>>13,M=0|o[5],S=8191&M,A=M>>>13,C=0|o[6],E=8191&C,P=C>>>13,L=0|o[7],I=8191&L,R=L>>>13,O=0|o[8],D=8191&O,z=O>>>13,F=0|o[9],j=8191&F,N=F>>>13,Z=0|s[0],B=8191&Z,V=Z>>>13,U=0|s[1],H=8191&U,W=U>>>13,G=0|s[2],q=8191&G,Y=G>>>13,X=0|s[3],K=8191&X,$=X>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],le=8191&se,ue=se>>>13,ce=0|s[8],fe=8191&ce,de=ce>>>13,pe=0|s[9],he=8191&pe,ve=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(n=Math.imul(f,B))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(d,B)|0))<<13)|0;u=((a=Math.imul(d,V))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(h,B),i=(i=Math.imul(h,V))+Math.imul(v,B)|0,a=Math.imul(v,V);var ge=(u+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,H)|0))<<13)|0;u=((a=a+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,B),i=(i=Math.imul(g,V))+Math.imul(y,B)|0,a=Math.imul(y,V),n=n+Math.imul(h,H)|0,i=(i=i+Math.imul(h,W)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,W)|0;var ye=(u+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,q)|0))<<13)|0;u=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(b,B),i=(i=Math.imul(b,V))+Math.imul(_,B)|0,a=Math.imul(_,V),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,W)|0,n=n+Math.imul(h,q)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(v,q)|0,a=a+Math.imul(v,Y)|0;var xe=(u+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(d,K)|0))<<13)|0;u=((a=a+Math.imul(d,$)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(k,B),i=(i=Math.imul(k,V))+Math.imul(T,B)|0,a=Math.imul(T,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(g,q)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,Y)|0,n=n+Math.imul(h,K)|0,i=(i=i+Math.imul(h,$)|0)+Math.imul(v,K)|0,a=a+Math.imul(v,$)|0;var be=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;u=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(S,B),i=(i=Math.imul(S,V))+Math.imul(A,B)|0,a=Math.imul(A,V),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,W)|0,n=n+Math.imul(b,q)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,$)|0,n=n+Math.imul(h,Q)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,ee)|0;var _e=(u+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,B),i=(i=Math.imul(E,V))+Math.imul(P,B)|0,a=Math.imul(P,V),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(A,H)|0,a=a+Math.imul(A,W)|0,n=n+Math.imul(k,q)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(T,q)|0,a=a+Math.imul(T,Y)|0,n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,ee)|0,n=n+Math.imul(h,re)|0,i=(i=i+Math.imul(h,ne)|0)+Math.imul(v,re)|0,a=a+Math.imul(v,ne)|0;var we=(u+(n=n+Math.imul(f,ae)|0)|0)+((8191&(i=(i=i+Math.imul(f,oe)|0)+Math.imul(d,ae)|0))<<13)|0;u=((a=a+Math.imul(d,oe)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,B),i=(i=Math.imul(I,V))+Math.imul(R,B)|0,a=Math.imul(R,V),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,W)|0,n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(A,q)|0,a=a+Math.imul(A,Y)|0,n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(T,K)|0,a=a+Math.imul(T,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0,n=n+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,oe)|0;var ke=(u+(n=n+Math.imul(f,le)|0)|0)+((8191&(i=(i=i+Math.imul(f,ue)|0)+Math.imul(d,le)|0))<<13)|0;u=((a=a+Math.imul(d,ue)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,B),i=(i=Math.imul(D,V))+Math.imul(z,B)|0,a=Math.imul(z,V),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,W)|0,n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(P,q)|0,a=a+Math.imul(P,Y)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(T,Q)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(g,ae)|0,i=(i=i+Math.imul(g,oe)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(h,le)|0,i=(i=i+Math.imul(h,ue)|0)+Math.imul(v,le)|0,a=a+Math.imul(v,ue)|0;var Te=(u+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(j,B),i=(i=Math.imul(j,V))+Math.imul(N,B)|0,a=Math.imul(N,V),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,W)|0,n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(R,q)|0,a=a+Math.imul(R,Y)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,$)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(g,le)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(y,le)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(v,fe)|0,a=a+Math.imul(v,de)|0;var Me=(u+(n=n+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(d,he)|0))<<13)|0;u=((a=a+Math.imul(d,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(j,H),i=(i=Math.imul(j,W))+Math.imul(N,H)|0,a=Math.imul(N,W),n=n+Math.imul(D,q)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(z,q)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(R,K)|0,a=a+Math.imul(R,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ne)|0,n=n+Math.imul(k,ae)|0,i=(i=i+Math.imul(k,oe)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(b,le)|0,i=(i=i+Math.imul(b,ue)|0)+Math.imul(_,le)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(y,fe)|0,a=a+Math.imul(y,de)|0;var Se=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(v,he)|0))<<13)|0;u=((a=a+Math.imul(v,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(j,q),i=(i=Math.imul(j,Y))+Math.imul(N,q)|0,a=Math.imul(N,Y),n=n+Math.imul(D,K)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,$)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(P,re)|0,a=a+Math.imul(P,ne)|0,n=n+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,n=n+Math.imul(k,le)|0,i=(i=i+Math.imul(k,ue)|0)+Math.imul(T,le)|0,a=a+Math.imul(T,ue)|0,n=n+Math.imul(b,fe)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(_,fe)|0,a=a+Math.imul(_,de)|0;var Ae=(u+(n=n+Math.imul(g,he)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(y,he)|0))<<13)|0;u=((a=a+Math.imul(y,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(j,K),i=(i=Math.imul(j,$))+Math.imul(N,K)|0,a=Math.imul(N,$),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(R,re)|0,a=a+Math.imul(R,ne)|0,n=n+Math.imul(E,ae)|0,i=(i=i+Math.imul(E,oe)|0)+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(A,le)|0,a=a+Math.imul(A,ue)|0,n=n+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,de)|0)+Math.imul(T,fe)|0,a=a+Math.imul(T,de)|0;var Ce=(u+(n=n+Math.imul(b,he)|0)|0)+((8191&(i=(i=i+Math.imul(b,ve)|0)+Math.imul(_,he)|0))<<13)|0;u=((a=a+Math.imul(_,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(j,Q),i=(i=Math.imul(j,ee))+Math.imul(N,Q)|0,a=Math.imul(N,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,oe)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,oe)|0,n=n+Math.imul(E,le)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(P,le)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(A,fe)|0,a=a+Math.imul(A,de)|0;var Ee=(u+(n=n+Math.imul(k,he)|0)|0)+((8191&(i=(i=i+Math.imul(k,ve)|0)+Math.imul(T,he)|0))<<13)|0;u=((a=a+Math.imul(T,ve)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,re),i=(i=Math.imul(j,ne))+Math.imul(N,re)|0,a=Math.imul(N,ne),n=n+Math.imul(D,ae)|0,i=(i=i+Math.imul(D,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(R,le)|0,a=a+Math.imul(R,ue)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(P,fe)|0,a=a+Math.imul(P,de)|0;var Pe=(u+(n=n+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,ve)|0)+Math.imul(A,he)|0))<<13)|0;u=((a=a+Math.imul(A,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(j,ae),i=(i=Math.imul(j,oe))+Math.imul(N,ae)|0,a=Math.imul(N,oe),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,ue)|0)+Math.imul(z,le)|0,a=a+Math.imul(z,ue)|0,n=n+Math.imul(I,fe)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(R,fe)|0,a=a+Math.imul(R,de)|0;var Le=(u+(n=n+Math.imul(E,he)|0)|0)+((8191&(i=(i=i+Math.imul(E,ve)|0)+Math.imul(P,he)|0))<<13)|0;u=((a=a+Math.imul(P,ve)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(j,le),i=(i=Math.imul(j,ue))+Math.imul(N,le)|0,a=Math.imul(N,ue),n=n+Math.imul(D,fe)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(z,fe)|0,a=a+Math.imul(z,de)|0;var Ie=(u+(n=n+Math.imul(I,he)|0)|0)+((8191&(i=(i=i+Math.imul(I,ve)|0)+Math.imul(R,he)|0))<<13)|0;u=((a=a+Math.imul(R,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(j,fe),i=(i=Math.imul(j,de))+Math.imul(N,fe)|0,a=Math.imul(N,de);var Re=(u+(n=n+Math.imul(D,he)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(z,he)|0))<<13)|0;u=((a=a+Math.imul(z,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Oe=(u+(n=Math.imul(j,he))|0)+((8191&(i=(i=Math.imul(j,ve))+Math.imul(N,he)|0))<<13)|0;return u=((a=Math.imul(N,ve))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l[0]=me,l[1]=ge,l[2]=ye,l[3]=xe,l[4]=be,l[5]=_e,l[6]=we,l[7]=ke,l[8]=Te,l[9]=Me,l[10]=Se,l[11]=Ae,l[12]=Ce,l[13]=Ee,l[14]=Pe,l[15]=Le,l[16]=Ie,l[17]=Re,l[18]=Oe,0!==u&&(l[19]=u,r.length++),r};function v(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=p),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?p(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):v(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var f=0|this.words[u];this.words[u]=c<<26-a|f>>>a,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==t){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var h=0,v=1;0===(r.words[0]&v)&&h<26;++h,v<<=1);if(h>0)for(r.iushrn(h);h-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(l)):(r.isub(t),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0===(t.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(t.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,d=1;0===(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new k(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"===typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(x,y),x.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new x;else if("p224"===e)t=new b;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=o;0!==p.cmp(s);){for(var v=p,m=0;0!==v.cmp(s);m++)v=v.redSqr();n(m=0;n--){for(var u=t.words[n],c=l-1;c>=0;c--){var f=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new T(e)},i(T,k),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},2692:function(e){"use strict";e.exports=function(e){var t,r,n,i=e.length,a=0;for(t=0;t>>1;if(!(c<=0)){var f,d=i.mallocDouble(2*c*s),p=i.mallocInt32(s);if((s=l(e,c,d,p))>0){if(1===c&&n)a.init(s),f=a.sweepComplete(c,r,0,s,d,p,0,s,d,p);else{var h=i.mallocDouble(2*c*u),v=i.mallocInt32(u);(u=l(t,c,h,v))>0&&(a.init(s+u),f=1===c?a.sweepBipartite(c,r,0,s,d,p,0,u,h,v):o(c,r,n,s,d,p,u,h,v),i.free(h),i.free(v))}i.free(d),i.free(p)}return f}}}function c(e,t){n.push([e,t])}},7333:function(e,t){"use strict";function r(e){return e?function(e,t,r,n,i,a,o,s,l,u,c){return i-n>l-s?function(e,t,r,n,i,a,o,s,l,u,c){for(var f=2*e,d=n,p=f*n;du-l?n?function(e,t,r,n,i,a,o,s,l,u,c){for(var f=2*e,d=n,p=f*n;d0;){var O=(I-=1)*b,D=w[O],z=w[O+1],F=w[O+2],j=w[O+3],N=w[O+4],Z=w[O+5],B=I*_,V=k[B],U=k[B+1],H=1&Z,W=!!(16&Z),G=c,q=A,Y=E,X=P;if(H&&(G=E,q=P,Y=c,X=A),!(2&Z&&z>=(F=m(e,D,z,F,G,q,U)))&&!(4&Z&&(z=g(e,D,z,F,G,q,V))>=F)){var K=F-z,$=N-j;if(W){if(e*K*(K+$)=p0)&&!(p1>=hi)"),v=c("lo===p0"),m=c("lo>>1,d=2*e,p=f,h=s[d*f+t];u=x?(p=y,h=x):g>=_?(p=m,h=g):(p=b,h=_):x>=_?(p=y,h=x):_>=g?(p=m,h=g):(p=b,h=_);for(var w=d*(c-1),k=d*p,T=0;Tr&&i[f+t]>u;--c,f-=o){for(var d=f,p=f+o,h=0;hd;++d,l+=s)if(i[l+f]===o)if(c===d)c+=1,u+=s;else{for(var p=0;s>p;++p){var h=i[l+p];i[l+p]=i[u],i[u++]=h}var v=a[d];a[d]=a[c],a[c++]=v}return c},"lod;++d,l+=s)if(i[l+f]p;++p){var h=i[l+p];i[l+p]=i[u],i[u++]=h}var v=a[d];a[d]=a[c],a[c++]=v}return c},"lo<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,u=l,c=r,f=e+t,d=r;n>d;++d,l+=s)if(i[l+f]<=o)if(c===d)c+=1,u+=s;else{for(var p=0;s>p;++p){var h=i[l+p];i[l+p]=i[u],i[u++]=h}var v=a[d];a[d]=a[c],a[c++]=v}return c},"hi<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,u=l,c=r,f=e+t,d=r;n>d;++d,l+=s)if(i[l+f]<=o)if(c===d)c+=1,u+=s;else{for(var p=0;s>p;++p){var h=i[l+p];i[l+p]=i[u],i[u++]=h}var v=a[d];a[d]=a[c],a[c++]=v}return c},"lop;++p,l+=s){var h=i[l+f],v=i[l+d];if(hm;++m){var g=i[l+m];i[l+m]=i[u],i[u++]=g}var y=a[p];a[p]=a[c],a[c++]=y}}return c},"lo<=p0&&p0<=hi":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,u=l,c=r,f=t,d=e+t,p=r;n>p;++p,l+=s){var h=i[l+f],v=i[l+d];if(h<=o&&o<=v)if(c===p)c+=1,u+=s;else{for(var m=0;s>m;++m){var g=i[l+m];i[l+m]=i[u],i[u++]=g}var y=a[p];a[p]=a[c],a[c++]=y}}return c},"!(lo>=p0)&&!(p1>=hi)":function(e,t,r,n,i,a,o,s){for(var l=2*e,u=l*r,c=u,f=r,d=t,p=e+t,h=r;n>h;++h,u+=l){var v=i[u+d],m=i[u+p];if(!(v>=o)&&!(s>=m))if(f===h)f+=1,c+=l;else{for(var g=0;l>g;++g){var y=i[u+g];i[u+g]=i[c],i[c++]=y}var x=a[h];a[h]=a[f],a[f++]=x}}return f}}},309:function(e){"use strict";e.exports=function(e,n){n<=4*t?r(0,n-1,e):u(0,n-1,e)};var t=32;function r(e,t,r){for(var n=2*(e+1),i=e+1;i<=t;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >e;){var u=r[l-2],c=r[l-1];if(ur[t+1])}function l(e,t,r,n){var i=n[e*=2];return i>1,m=v-d,g=v+d,y=p,x=m,b=v,_=g,w=h,k=e+1,T=c-1,M=0;s(y,x,f)&&(M=y,y=x,x=M),s(_,w,f)&&(M=_,_=w,w=M),s(y,b,f)&&(M=y,y=b,b=M),s(x,b,f)&&(M=x,x=b,b=M),s(y,_,f)&&(M=y,y=_,_=M),s(b,_,f)&&(M=b,b=_,_=M),s(x,w,f)&&(M=x,x=w,w=M),s(x,b,f)&&(M=x,x=b,b=M),s(_,w,f)&&(M=_,_=w,w=M);for(var S=f[2*x],A=f[2*x+1],C=f[2*_],E=f[2*_+1],P=2*y,L=2*b,I=2*w,R=2*p,O=2*v,D=2*h,z=0;z<2;++z){var F=f[P+z],j=f[L+z],N=f[I+z];f[R+z]=F,f[O+z]=j,f[D+z]=N}i(m,e,f),i(g,c,f);for(var Z=k;Z<=T;++Z)if(l(Z,S,A,f))Z!==k&&n(Z,k,f),++k;else if(!l(Z,C,E,f))for(;;){if(l(T,C,E,f)){l(T,S,A,f)?(a(Z,k,T,f),++k,--T):(n(Z,T,f),--T);break}if(--T>>1;a(h,A);var C=0,E=0;for(k=0;k=o)v(c,f,E--,P=P-o|0);else if(P>=0)v(l,u,C--,P);else if(P<=-o){P=-P-o|0;for(var L=0;L>>1;a(h,C);var E=0,P=0,L=0;for(T=0;T>1===h[2*T+3]>>1&&(R=2,T+=1),I<0){for(var O=-(I>>1)-1,D=0;D>1)-1,0===R?v(l,u,E--,O):1===R?v(c,f,P--,O):2===R&&v(d,p,L--,O)}},scanBipartite:function(e,t,r,n,i,s,c,f,d,p,g,y){var x=0,b=2*e,_=t,w=t+e,k=1,T=1;n?T=o:k=o;for(var M=i;M>>1;a(h,E);var P=0;for(M=0;M=o?(I=!n,S-=o):(I=!!n,S-=1),I)m(l,u,P++,S);else{var R=y[S],O=b*S,D=g[O+t+1],z=g[O+t+1+e];e:for(var F=0;F>>1;a(h,k);var T=0;for(x=0;x=o)l[T++]=b-o;else{var S=p[b-=1],A=m*b,C=d[A+t+1],E=d[A+t+1+e];e:for(var P=0;P=0;--P)if(l[P]===b){for(O=P+1;O0;){for(var p=r.pop(),h=(c=-1,f=-1,l=o[s=r.pop()],1);h=0||(t.flip(s,p),i(e,t,r,c,s,f),i(e,t,r,s,f,c),i(e,t,r,f,p,c),i(e,t,r,p,c,f))}}},7098:function(e,t,r){"use strict";var n=r(5070);function i(e,t,r,n,i,a,o){this.cells=e,this.neighbor=t,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function a(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]}e.exports=function(e,t,r){var n=function(e,t){for(var r=e.cells(),n=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var p=s.pop();if(u[p]!==-o){u[p]=o,c[p];for(var h=0;h<3;++h){var v=d[3*p+h];v>=0&&0===u[v]&&(f[3*p+h]?l.push(v):(s.push(v),u[v]=o))}}}var m=l;l=s,s=m,l.length=0,o=-o}var g=function(e,t,r){for(var n=0,i=0;i1&&i(r[d[p-2]],r[d[p-1]],a)>0;)e.push([d[p-1],d[p-2],o]),p-=1;d.length=p,d.push(o);var h=f.upperIds;for(p=h.length;p>1&&i(r[h[p-2]],r[h[p-1]],a)<0;)e.push([h[p-2],h[p-1],o]),p-=1;h.length=p,h.push(o)}}function f(e,t){var r;return(r=e.a[0]v[0]&&i.push(new s(v,h,2,u),new s(h,v,1,u))}i.sort(l);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new o([m,1],[m,0],-1,[],[],[],[])],y=[],x=(u=0,i.length);u=0}}(),a.removeTriangle=function(e,t,r){var n=this.stars;o(n[e],t,r),o(n[t],r,e),o(n[r],e,t)},a.addTriangle=function(e,t,r){var n=this.stars;n[e].push(t,r),n[t].push(r,e),n[r].push(e,t)},a.opposite=function(e,t){for(var r=this.stars[t],n=1,i=r.length;nt[2]?1:0)}function g(e,t,r){if(0!==e.length){if(t)for(var n=0;n=0;--a){var x=t[c=(A=n[a])[0]],b=x[0],_=x[1],w=e[b],k=e[_];if((w[0]-k[0]||w[1]-k[1])<0){var T=b;b=_,_=T}x[0]=b;var M,S=x[1]=A[1];for(i&&(M=x[2]);a>0&&n[a-1][0]===c;){var A,C=(A=n[--a])[1];i?t.push([S,C,M]):t.push([S,C]),S=C}i?t.push([S,_,M]):t.push([S,_])}return d}(e,t,d,m,r),x=h(e,y);return g(t,x,r),!!x||d.length>0||m.length>0}},5528:function(e,t,r){"use strict";e.exports=function(e,t,r,n){var a=s(t,e),f=s(n,r),d=c(a,f);if(0===o(d))return null;var p=s(e,r),h=c(f,p),v=i(h,d),m=u(a,v);return l(e,m)};var n=r(3962),i=r(9189),a=r(4354),o=r(4951),s=r(6695),l=r(7584),u=r(4469);function c(e,t){return a(n(e[0],t[1]),n(e[1],t[0]))}},5692:function(e){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},9156:function(e,t,r){"use strict";var n=r(5692),i=r(3578);function a(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function o(e){for(var t,r="#",n=0;n<3;++n)r+=("00"+(t=(t=e[n]).toString(16))).substr(t.length);return r}function s(e){return"rgba("+e.join(",")+")"}e.exports=function(e){var t,r,l,u,c,f,d,p,h,v;if(e||(e={}),p=(e.nshades||72)-1,d=e.format||"hex",(f=e.colormap)||(f="jet"),"string"===typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");c=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);c=f.slice()}if(c.length>p+1)throw new Error(f+" map requires nshades to be at least size "+c.length);h=Array.isArray(e.alpha)?2!==e.alpha.length?[1,1]:e.alpha.slice():"number"===typeof e.alpha?[e.alpha,e.alpha]:[1,1],t=c.map((function(e){return Math.round(e.index*p)})),h[0]=Math.min(Math.max(h[0],0),1),h[1]=Math.min(Math.max(h[1],0),1);var m=c.map((function(e,t){var r=c[t].index,n=c[t].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=h[0]+(h[1]-h[0])*r),n})),g=[];for(v=0;v0||l(e,t,a)?-1:1:0===s?u>0||l(e,t,r)?1:-1:i(u-s)}var f=n(e,t,r);return f>0?o>0&&n(e,t,a)>0?1:-1:f<0?o>0||n(e,t,a)>0?1:-1:n(e,t,a)>0||l(e,t,r)?1:-1};var n=r(417),i=r(7538),a=r(87),o=r(2019),s=r(9662);function l(e,t,r){var n=a(e[0],-t[0]),i=a(e[1],-t[1]),l=a(r[0],-t[0]),u=a(r[1],-t[1]),c=s(o(n,l),o(i,u));return c[c.length-1]>=0}},7538:function(e){"use strict";e.exports=function(e){return e<0?-1:e>0?1:0}},9209:function(e){e.exports=function(e,n){var i=e.length,a=e.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return e[0]-n[0];case 2:return e[0]+e[1]-n[0]-n[1]||t(e[0],e[1])-t(n[0],n[1]);case 3:var o=e[0]+e[1],s=n[0]+n[1];if(a=o+e[2]-(s+n[2]))return a;var l=t(e[0],e[1]),u=t(n[0],n[1]);return t(l,e[2])-t(u,n[2])||t(l+e[2],o)-t(u+n[2],s);case 4:var c=e[0],f=e[1],d=e[2],p=e[3],h=n[0],v=n[1],m=n[2],g=n[3];return c+f+d+p-(h+v+m+g)||t(c,f,d,p)-t(h,v,m,g,h)||t(c+f,c+d,c+p,f+d,f+p,d+p)-t(h+v,h+m,h+g,v+m,v+g,m+g)||t(c+f+d,c+f+p,c+d+p,f+d+p)-t(h+v+m,h+v+g,h+m+g,v+m+g);default:for(var y=e.slice().sort(r),x=n.slice().sort(r),b=0;be[r][0]&&(r=n);return tr?[[r],[t]]:[[t]]}},8722:function(e,t,r){"use strict";e.exports=function(e){var t=n(e),r=t.length;if(r<=2)return[];for(var i=new Array(r),a=t[r-1],o=0;o=t[l]&&(s+=1);a[o]=s}}return e}(n(a,!0),r)}};var n=r(2183),i=r(2153)},9680:function(e){"use strict";e.exports=function(e,t,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,f=s*(3-2*i),d=s*o;if(e.length){a||(a=new Array(e.length));for(var p=e.length-1;p>=0;--p)a[p]=u*e[p]+c*t[p]+f*r[p]+d*n[p];return a}return u*e+c*t+f*r+d*n},e.exports.derivative=function(e,t,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(e.length){a||(a=new Array(e.length));for(var c=e.length-1;c>=0;--c)a[c]=o*e[c]+s*t[c]+l*r[c]+u*n[c];return a}return o*e+s*t+l*r[c]+u*n}},4419:function(e,t,r){"use strict";var n=r(2183),i=r(1215);function a(e,t){this.point=e,this.index=t}function o(e,t){for(var r=e.point,n=t.point,i=r.length,a=0;a=2)return!1;e[r]=n}return!0})):_.filter((function(e){for(var t=0;t<=s;++t){var r=g[e[t]];if(r<0)return!1;e[t]=r}return!0})),1&s)for(c=0;c<_.length;++c)d=(b=_[c])[0],b[0]=b[1],b[1]=d;return _}},8362:function(e){var t=!1;if("undefined"!==typeof Float64Array){var r=new Float64Array(1),n=new Uint32Array(r.buffer);r[0]=1,t=!0,1072693248===n[1]?(e.exports=function(e){return r[0]=e,[n[0],n[1]]},e.exports.pack=function(e,t){return n[0]=e,n[1]=t,r[0]},e.exports.lo=function(e){return r[0]=e,n[0]},e.exports.hi=function(e){return r[0]=e,n[1]}):1072693248===n[0]?(e.exports=function(e){return r[0]=e,[n[1],n[0]]},e.exports.pack=function(e,t){return n[1]=e,n[0]=t,r[0]},e.exports.lo=function(e){return r[0]=e,n[1]},e.exports.hi=function(e){return r[0]=e,n[0]}):t=!1}if(!t){var i=new Buffer(8);e.exports=function(e){return i.writeDoubleLE(e,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},e.exports.pack=function(e,t){return i.writeUInt32LE(e,0,!0),i.writeUInt32LE(t,4,!0),i.readDoubleLE(0,!0)},e.exports.lo=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(0,!0)},e.exports.hi=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}},3094:function(e){"use strict";function t(e,r,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a0)return function(e,t){var r,n;for(r=new Array(e),n=0;n=r-1){d=l.length-1;var h=e-t[r-1];for(p=0;p=r-1)for(var c=s.length-1,f=(t[r-1],0);f=0;--r)if(e[--t])return!1;return!0},s.jump=function(e){var t=this.lastT(),r=this.dimension;if(!(e0;--f)n.push(a(l[f-1],u[f-1],arguments[f])),i.push(0)}},s.push=function(e){var t=this.lastT(),r=this.dimension;if(!(e1e-6?1/s:0;this._time.push(e);for(var d=r;d>0;--d){var p=a(u[d-1],c[d-1],arguments[d]);n.push(p),i.push((p-n[o++])*f)}}},s.set=function(e){var t=this.dimension;if(!(e0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(e){var t=this.lastT(),r=this.dimension;if(!(e<=t||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=e-t,f=c>1e-6?1/c:0;this._time.push(e);for(var d=r;d>0;--d){var p=arguments[d];n.push(a(l[d-1],u[d-1],n[o++]+p)),i.push(p*f)}}},s.idle=function(e){var t=this.lastT();if(!(e=0;--f)n.push(a(l[f],u[f],n[o]+c*i[o])),i.push(0),o+=1}}},7080:function(e){"use strict";function t(e,t,r,n,i,a){this._color=e,this.key=t,this.value=r,this.left=n,this.right=i,this._count=a}function r(e){return new t(e._color,e.key,e.value,e.left,e.right,e._count)}function n(e,r){return new t(e,r.key,r.value,r.left,r.right,r._count)}function i(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function a(e,t){this._compare=e,this.root=t}e.exports=function(e){return new a(e||p,null)};var o=a.prototype;function s(e,t){var r;return t.left&&(r=s(e,t.left))?r:(r=e(t.key,t.value))||(t.right?s(e,t.right):void 0)}function l(e,t,r,n){if(t(e,n.key)<=0){var i;if(n.left&&(i=l(e,t,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(e,t,r,n.right)}function u(e,t,r,n,i){var a,o=r(e,i.key),s=r(t,i.key);if(o<=0){if(i.left&&(a=u(e,t,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return u(e,t,r,n,i.right)}function c(e,t){this.tree=e,this._stack=t}Object.defineProperty(o,"keys",{get:function(){var e=[];return this.forEach((function(t,r){e.push(t)})),e}}),Object.defineProperty(o,"values",{get:function(){var e=[];return this.forEach((function(t,r){e.push(r)})),e}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(e,r){for(var o=this._compare,s=this.root,l=[],u=[];s;){var c=o(e,s.key);l.push(s),u.push(c),s=c<=0?s.left:s.right}l.push(new t(0,e,r,null,null,1));for(var f=l.length-2;f>=0;--f)s=l[f],u[f]<=0?l[f]=new t(s._color,s.key,s.value,l[f+1],s.right,s._count+1):l[f]=new t(s._color,s.key,s.value,s.left,l[f+1],s._count+1);for(f=l.length-1;f>1;--f){var d=l[f-1];if(s=l[f],1===d._color||1===s._color)break;var p=l[f-2];if(p.left===d)if(d.left===s){if(!(h=p.right)||0!==h._color){p._color=0,p.left=d.right,d._color=1,d.right=p,l[f-2]=d,l[f-1]=s,i(p),i(d),f>=3&&((v=l[f-3]).left===p?v.left=d:v.right=d);break}d._color=1,p.right=n(1,h),p._color=0,f-=1}else{if(!(h=p.right)||0!==h._color){d.right=s.left,p._color=0,p.left=s.right,s._color=1,s.left=d,s.right=p,l[f-2]=s,l[f-1]=d,i(p),i(d),i(s),f>=3&&((v=l[f-3]).left===p?v.left=s:v.right=s);break}d._color=1,p.right=n(1,h),p._color=0,f-=1}else if(d.right===s){if(!(h=p.left)||0!==h._color){p._color=0,p.right=d.left,d._color=1,d.left=p,l[f-2]=d,l[f-1]=s,i(p),i(d),f>=3&&((v=l[f-3]).right===p?v.right=d:v.left=d);break}d._color=1,p.left=n(1,h),p._color=0,f-=1}else{var h;if(!(h=p.left)||0!==h._color){var v;d.left=s.right,p._color=0,p.right=s.left,s._color=1,s.right=d,s.left=p,l[f-2]=s,l[f-1]=d,i(p),i(d),i(s),f>=3&&((v=l[f-3]).right===p?v.right=s:v.left=s);break}d._color=1,p.left=n(1,h),p._color=0,f-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(e,t,r){if(this.root)switch(arguments.length){case 1:return s(e,this.root);case 2:return l(t,this._compare,e,this.root);case 3:if(this._compare(t,r)>=0)return;return u(t,r,this._compare,e,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new c(this,e)}}),Object.defineProperty(o,"end",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new c(this,e)}}),o.at=function(e){if(e<0)return new c(this,[]);for(var t=this.root,r=[];;){if(r.push(t),t.left){if(e=t.right._count)break;t=t.right}return new c(this,[])},o.ge=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.gt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.lt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.le=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.find=function(e){for(var t=this._compare,r=this.root,n=[];r;){var i=t(e,r.key);if(n.push(r),0===i)return new c(this,n);r=i<=0?r.left:r.right}return new c(this,[])},o.remove=function(e){var t=this.find(e);return t?t.remove():this},o.get=function(e){for(var t=this._compare,r=this.root;r;){var n=t(e,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var f=c.prototype;function d(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e._color=t._color,e._count=t._count}function p(e,t){return et?1:0}Object.defineProperty(f,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(f,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),f.clone=function(){return new c(this.tree,this._stack.slice())},f.remove=function(){var e=this._stack;if(0===e.length)return this.tree;var o=new Array(e.length),s=e[e.length-1];o[o.length-1]=new t(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=e.length-2;l>=0;--l)(s=e[l]).left===e[l+1]?o[l]=new t(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var u=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var c=o[u-1];for(o.push(new t(s._color,c.key,c.value,s.left,s.right,s._count)),o[u-1].key=s.key,o[u-1].value=s.value,l=o.length-2;l>=u;--l)s=o[l],o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);o[u-1].left=o[u]}if(0===(s=o[o.length-1])._color){var f=o[o.length-2];for(f.left===s?f.left=null:f.right===s&&(f.right=null),o.pop(),l=0;l=0;--l){if(t=e[l],0===l)return void(t._color=1);if((a=e[l-1]).left===t){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,t._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((u=e[l-2]).left===a?u.left=o:u.right=o),void(e[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((u=e[l-2]).left===a?u.left=s:u.right=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((u=e[l-2]).left===a?u.left=o:u.right=o),e[l-1]=o,e[l]=a,l+11&&((u=e[l-2]).right===a?u.right=o:u.left=o),void(e[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((u=e[l-2]).right===a?u.right=s:u.left=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var u;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((u=e[l-2]).right===a?u.right=o:u.left=o),e[l-1]=o,e[l]=a,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(f,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(f,"index",{get:function(){var e=0,t=this._stack;if(0===t.length){var r=this.tree.root;return r?r._count:0}t[t.length-1].left&&(e=t[t.length-1].left._count);for(var n=t.length-2;n>=0;--n)t[n+1]===t[n].right&&(++e,t[n].left&&(e+=t[n].left._count));return e},enumerable:!0}),f.next=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.right)for(t=t.right;t;)e.push(t),t=t.left;else for(e.pop();e.length>0&&e[e.length-1].right===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(f,"hasNext",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].right)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}}),f.update=function(e){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new t(i._color,i.key,e,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new t(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new t(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},f.prev=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.left)for(t=t.left;t;)e.push(t),t=t.right;else for(e.pop();e.length>0&&e[e.length-1].left===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(f,"hasPrev",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].left)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}})},7453:function(e,t,r){"use strict";e.exports=function(e,t){var r=new c(e);return r.update(t),r};var n=r(9557),i=r(1681),a=r(1011),o=r(2864),s=r(8468),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function u(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function c(e){this.gl=e,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(e)}var f=c.prototype;function d(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.update=function(e){function t(t,r,n){if(n in e){var i,a=e[n],o=this[n];(t?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}e=e||{};var r,a=t.bind(this,!1,Number),o=t.bind(this,!1,Boolean),l=t.bind(this,!1,String),u=t.bind(this,!0,(function(e){if(Array.isArray(e)){if(3===e.length)return[+e[0],+e[1],+e[2],1];if(4===e.length)return[+e[0],+e[1],+e[2],+e[3]]}return[0,0,0,1]})),c=!1,f=!1;if("bounds"in e)for(var d=e.bounds,p=0;p<2;++p)for(var h=0;h<3;++h)d[p][h]!==this.bounds[p][h]&&(f=!0),this.bounds[p][h]=d[p][h];if("ticks"in e)for(r=e.ticks,c=!0,this.autoTicks=!1,p=0;p<3;++p)this.tickSpacing[p]=0;else a("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in e||"tickSpacing"in e||(this.autoTicks=!0),f=!0,c=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),c=!0),c){for(p=0;p<3;++p)r[p].sort((function(e,t){return e.x-t.x}));s.equal(r,this.ticks)?c=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(c=!0),a("tickSize"),a("tickAngle"),a("tickPad"),u("tickColor");var v=l("labels");l("labelFont")&&(v=!0),o("labelEnable"),a("labelSize"),a("labelPad"),u("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),u("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),u("lineTickColor"),o("gridEnable"),a("gridWidth"),u("gridColor"),o("zeroEnable"),u("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),u("backgroundColor"),this._text?this._text&&(v||c)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=n(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var p=[new d,new d,new d];function h(e,t,r,n,i){for(var a=e.primalOffset,o=e.primalMinor,s=e.mirrorOffset,l=e.mirrorMinor,u=n[t],c=0;c<3;++c)if(t!==c){var f=a,d=s,p=o,h=l;u&1<0?(p[c]=-1,h[c]=0):(p[c]=0,h[c]=1)}}var v=[0,0,0],m={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(e){};var g=[0,0,0],y=[0,0,0],x=[0,0,0];f.draw=function(e){e=e||m;for(var t=this.gl,r=e.model||l,n=e.view||l,i=e.projection||l,a=this.bounds,s=e._ortho||!1,c=o(r,n,i,a,s),f=c.cubeEdges,d=c.axis,b=n[12],_=n[13],w=n[14],k=n[15],T=(s?2:1)*this.pixelRatio*(i[3]*b+i[7]*_+i[11]*w+i[15]*k)/t.drawingBufferHeight,M=0;M<3;++M)this.lastCubeProps.cubeEdges[M]=f[M],this.lastCubeProps.axis[M]=d[M];var S=p;for(M=0;M<3;++M)h(p[M],M,this.bounds,f,d);t=this.gl;var A,C,E,P=v;for(M=0;M<3;++M)this.backgroundEnable[M]?P[M]=d[M]:P[M]=0;for(this._background.draw(r,n,i,a,P,this.backgroundColor),this._lines.bind(r,n,i,this),M=0;M<3;++M){var L=[0,0,0];d[M]>0?L[M]=a[1][M]:L[M]=a[0][M];for(var I=0;I<2;++I){var R=(M+1+I)%3,O=(M+1+(1^I))%3;this.gridEnable[R]&&this._lines.drawGrid(R,O,this.bounds,L,this.gridColor[R],this.gridWidth[R]*this.pixelRatio)}for(I=0;I<2;++I)R=(M+1+I)%3,O=(M+1+(1^I))%3,this.zeroEnable[O]&&Math.min(a[0][O],a[1][O])<=0&&Math.max(a[0][O],a[1][O])>=0&&this._lines.drawZero(R,O,this.bounds,L,this.zeroLineColor[O],this.zeroLineWidth[O]*this.pixelRatio)}for(M=0;M<3;++M){this.lineEnable[M]&&this._lines.drawAxisLine(M,this.bounds,S[M].primalOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio),this.lineMirror[M]&&this._lines.drawAxisLine(M,this.bounds,S[M].mirrorOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio);var D=u(g,S[M].primalMinor),z=u(y,S[M].mirrorMinor),F=this.lineTickLength;for(I=0;I<3;++I){var j=T/r[5*I];D[I]*=F[I]*j,z[I]*=F[I]*j}this.lineTickEnable[M]&&this._lines.drawAxisTicks(M,S[M].primalOffset,D,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio),this.lineTickMirror[M]&&this._lines.drawAxisTicks(M,S[M].mirrorOffset,z,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio)}function N(e){(E=[0,0,0])[e]=1}function Z(e,t,r){var n=(e+1)%3,i=(e+2)%3,a=t[n],o=t[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?N(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&N(i)}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),M=0;M<3;++M){var B=S[M].primalMinor,V=S[M].mirrorMinor,U=u(x,S[M].primalOffset);for(I=0;I<3;++I)this.lineTickEnable[M]&&(U[I]+=T*B[I]*Math.max(this.lineTickLength[I],0)/r[5*I]);var H=[0,0,0];if(H[M]=1,this.tickEnable[M]){for(-3600===this.tickAngle[M]?(this.tickAngle[M]=0,this.tickAlign[M]="auto"):this.tickAlign[M]=-1,C=1,"auto"===(A=[this.tickAlign[M],.5,C])[0]?A[0]=0:A[0]=parseInt(""+A[0]),E=[0,0,0],Z(M,B,V),I=0;I<3;++I)U[I]+=T*B[I]*this.tickPad[I]/r[5*I];this._text.drawTicks(M,this.tickSize[M],this.tickAngle[M],U,this.tickColor[M],H,E,A)}if(this.labelEnable[M]){for(C=0,E=[0,0,0],this.labels[M].length>4&&(N(M),C=1),"auto"===(A=[this.labelAlign[M],.5,C])[0]?A[0]=0:A[0]=parseInt(""+A[0]),I=0;I<3;++I)U[I]+=T*B[I]*this.labelPad[I]/r[5*I];U[M]+=.5*(a[0][M]+a[1][M]),this._text.drawLabel(M,this.labelSize[M],this.labelAngle[M],U,this.labelColor[M],[0,0,0],E,A)}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},1011:function(e,t,r){"use strict";e.exports=function(e){for(var t=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],d=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=p,d[l]=p;for(var h=-1;h<=1;h+=2){f[u]=h;for(var v=-1;v<=1;v+=2)f[c]=v,t.push(f[0],f[1],f[2],d[0],d[1],d[2]),s+=1}var m=u;u=c,c=m}var g=n(e,new Float32Array(t)),y=n(e,new Uint16Array(r),e.ELEMENT_ARRAY_BUFFER),x=i(e,[{buffer:g,type:e.FLOAT,size:3,offset:0,stride:24},{buffer:g,type:e.FLOAT,size:3,offset:12,stride:24}],y),b=a(e);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(e,g,x,b)};var n=r(5827),i=r(2944),a=r(1943).bg;function o(e,t,r,n){this.gl=e,this.buffer=t,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(e,t,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:e,view:t,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},2864:function(e,t,r){"use strict";e.exports=function(e,t,r,a,p){i(s,t,e),i(s,r,s);for(var y=0,x=0;x<2;++x){c[2]=a[x][2];for(var b=0;b<2;++b){c[1]=a[b][1];for(var _=0;_<2;++_)c[0]=a[_][0],d(l[y],c,s),y+=1}}var w=-1;for(x=0;x<8;++x){for(var k=l[x][3],T=0;T<3;++T)u[x][T]=l[x][T]/k;p&&(u[x][2]*=-1),k<0&&(w<0||u[x][2]C&&(w|=1<C&&(w|=1<u[x][1])&&(z=x);var F=-1;for(x=0;x<3;++x)(N=z^1<u[j][0]&&(j=N))}var Z=v;Z[0]=Z[1]=Z[2]=0,Z[n.log2(F^z)]=z&F,Z[n.log2(z^j)]=z&j;var B=7^j;B===w||B===D?(B=7^F,Z[n.log2(j^B)]=B&j):Z[n.log2(F^B)]=B&F;var V=m,U=w;for(M=0;M<3;++M)V[M]=U&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);t.f=function(e){return i(e,s,l,null,[{name:"position",type:"vec3"}])};var u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);t.bg=function(e){return i(e,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},9557:function(e,t,r){"use strict";e.exports=function(e,t,r,i,o,l){var u=n(e),f=a(e,[{buffer:u,size:3}]),d=s(e);d.attributes.position.location=0;var p=new c(e,d,u,f);return p.update(t,r,i,o,l),p};var n=r(5827),a=r(2944),o=r(875),s=r(1943).f,l=window||i.global||{},u=l.__TEXT_CACHE||{};function c(e,t,r,n){this.gl=e,this.shader=t,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}l.__TEXT_CACHE={};var f=c.prototype,d=[0,0];f.bind=function(e,t,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=e,i.view=t,i.projection=r,i.pixelScale=n,d[0]=this.gl.drawingBufferWidth,d[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=d},f.unbind=function(){this.vao.unbind()},f.update=function(e,t,r,n,i){var a=[];function s(e,t,r,n,i,s){var l=u[r];l||(l=u[r]={});var c=l[t];c||(c=l[t]=function(e,t){try{return o(e,t)}catch(r){return console.warn('error vectorizing text:"'+e+'" error:',r),{cells:[],positions:[]}}}(t,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,d=c.positions,p=c.cells,h=0,v=p.length;h=0;--g){var y=d[m[g]];a.push(f*y[0],-f*y[1],e)}}for(var l=[0,0,0],c=[0,0,0],f=[0,0,0],d=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},h=0;h<3;++h){f[h]=a.length/3|0,s(.5*(e[0][h]+e[1][h]),t[h],r[h],12,1.25,p),d[h]=(a.length/3|0)-f[h],l[h]=a.length/3|0;for(var v=0;v=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(e*t*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var f=""+u;f.length=e[0][i];--o)a.push({x:o*t[i],text:r(t[i],o)});n.push(a)}return n},t.equal=function(e,t){for(var r=0;r<3;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return e.bufferSubData(t,a,i),r}function c(e,t){for(var r=n.malloc(e.length,t),i=e.length,a=0;a=0;--n){if(t[n]!==r)return!1;r*=e[n]}return!0}(e.shape,e.stride))0===e.offset&&e.data.length===e.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,e.data,t):this.length=u(this.gl,this.type,this.length,this.usage,e.data.subarray(e.offset,e.shape[0]),t);else{var s=n.malloc(e.size,r),l=a(s,e.shape);i.assign(l,e),this.length=u(this.gl,this.type,this.length,this.usage,t<0?s:s.subarray(0,e.size),t),n.free(s)}}else if(Array.isArray(e)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(e,"uint16"):c(e,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,t<0?f:f.subarray(0,e.length),t),n.free(f)}else if("object"===typeof e&&"number"===typeof e.length)this.length=u(this.gl,this.type,this.length,this.usage,e,t);else{if("number"!==typeof e&&void 0!==e)throw new Error("gl-buffer: Invalid data type");if(t>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(e|=0)<=0&&(e=1),this.gl.bufferData(this.type,0|e,this.usage),this.length=e}},e.exports=function(e,t,r,n){if(r=r||e.ARRAY_BUFFER,n=n||e.DYNAMIC_DRAW,r!==e.ARRAY_BUFFER&&r!==e.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==e.DYNAMIC_DRAW&&n!==e.STATIC_DRAW&&n!==e.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=e.createBuffer(),a=new s(e,r,i,0,n);return a.update(t),a}},1140:function(e,t,r){"use strict";var n=r(2858);e.exports=function(e,t){var r=e.positions,i=e.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:e.vertexIntensityBounds,vectors:[],cells:[],coneOffset:e.coneOffset,colormap:e.colormap};if(0===e.positions.length)return t&&(t[0]=[0,0,0],t[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,u=1/0,c=-1/0,f=1/0,d=-1/0,p=null,h=null,v=[],m=1/0,g=!1,y=0;yo&&(o=n.length(b)),y){var _=2*n.distance(p,x)/(n.length(h)+n.length(b));_?(m=Math.min(m,_),g=!1):g=!0}g||(p=x,h=b),v.push(b)}var w=[s,u,f],k=[l,c,d];t&&(t[0]=w,t[1]=k),0===o&&(o=1);var T=1/o;isFinite(m)||(m=1),a.vectorScale=m;var M=e.coneSize||.5;e.absoluteConeSize&&(M=e.absoluteConeSize*T),a.coneScale=M,y=0;for(var S=0;y=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(e){this.pickId=e},p.update=function(e){e=e||{};var t=this.gl;this.dirty=!0,"lightPosition"in e&&(this.lightPosition=e.lightPosition),"opacity"in e&&(this.opacity=e.opacity),"ambient"in e&&(this.ambientLight=e.ambient),"diffuse"in e&&(this.diffuseLight=e.diffuse),"specular"in e&&(this.specularLight=e.specular),"roughness"in e&&(this.roughness=e.roughness),"fresnel"in e&&(this.fresnel=e.fresnel),void 0!==e.tubeScale&&(this.tubeScale=e.tubeScale),void 0!==e.vectorScale&&(this.vectorScale=e.vectorScale),void 0!==e.coneScale&&(this.coneScale=e.coneScale),void 0!==e.coneOffset&&(this.coneOffset=e.coneOffset),e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(function(e){for(var t=c({colormap:e,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=t[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return u(r,[256,256,4],[4,0,1])}(e.colormap)),this.texture.generateMipmap());var r=e.cells,n=e.positions,i=e.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=i;var d=e.meshColor||[1,1,1,1],p=e.vertexIntensity,h=1/0,v=-1/0;if(p)if(e.vertexIntensityBounds)h=+e.vertexIntensityBounds[0],v=+e.vertexIntensityBounds[1];else for(var m=0;m0){var v=this.triShader;v.bind(),v.uniforms=u,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||f,n=e.view||f,i=e.projection||f,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=t),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(e,t,r){var s=r.shaders;1===arguments.length&&(e=(t=e).gl);var l=function(e,t){var r=n(e,t.meshShader.vertex,t.meshShader.fragment,null,t.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(e,s),c=function(e,t){var r=n(e,t.pickShader.vertex,t.pickShader.fragment,null,t.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(e,s),f=o(e,u(new Uint8Array([255,255,255,255]),[1,1,4]));f.generateMipmap(),f.minFilter=e.LINEAR_MIPMAP_LINEAR,f.magFilter=e.LINEAR;var p=i(e),h=i(e),v=i(e),m=i(e),g=i(e),y=new d(e,f,l,c,p,h,g,v,m,a(e,[{buffer:p,type:e.FLOAT,size:4},{buffer:g,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:v,type:e.FLOAT,size:4},{buffer:m,type:e.FLOAT,size:2},{buffer:h,type:e.FLOAT,size:4}]),r.traceType||"cone");return y.update(t),y}},7234:function(e,t,r){var n=r(6832),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},1950:function(e){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},6603:function(e,t,r){var n=r(1950);e.exports=function(e){return n[e]}},3110:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl,r=n(t),o=i(t,[{buffer:r,type:t.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:t.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:t.FLOAT,size:3,offset:28,stride:40}]),l=a(t);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(t,r,o,l);return u.update(e),u};var n=r(5827),i=r(2944),a=r(7667),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,n){this.gl=e,this.shader=n,this.buffer=t,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function u(e,t){for(var r=0;r<3;++r)e[0][r]=Math.min(e[0][r],t[r]),e[1][r]=Math.max(e[1][r],t[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(e){var t=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=e.view||o,i=r.projection=e.projection||o;r.model=e.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],u=n[15],c=(e._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*u)/t.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)t.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*c,this.lineCount[f]&&t.drawArrays(t.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var c=function(){for(var e=new Array(3),t=0;t<3;++t){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+t)%3]=i,r.push(a)}e[t]=r}return e}();function f(e,t,r,n){for(var i=c[n],a=0;a0&&((p=c.slice())[s]+=h[1][s],i.push(c[0],c[1],c[2],v[0],v[1],v[2],v[3],0,0,0,p[0],p[1],p[2],v[0],v[1],v[2],v[3],0,0,0),u(this.bounds,p),o+=2+f(i,p,v,s)))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},7667:function(e,t,r){"use strict";var n=r(6832),i=r(5158),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},4234:function(e,t,r){"use strict";var n=r(8931);e.exports=function(e,t,r,n){i||(i=e.FRAMEBUFFER_UNSUPPORTED,a=e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=e.getExtension("WEBGL_draw_buffers");if(!l&&u&&function(e,t){var r=e.getParameter(t.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;ac||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>e.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var d=e.UNSIGNED_BYTE,p=e.getExtension("OES_texture_float");if(n.float&&f>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");d=e.FLOAT}else n.preferFloat&&f>0&&p&&(d=e.FLOAT);var v=!0;"depth"in n&&(v=!!n.depth);var m=!1;return"stencil"in n&&(m=!!n.stencil),new h(e,t,r,d,f,v,m,u)};var i,a,o,s,l=null;function u(e){return[e.getParameter(e.FRAMEBUFFER_BINDING),e.getParameter(e.RENDERBUFFER_BINDING),e.getParameter(e.TEXTURE_BINDING_2D)]}function c(e,t){e.bindFramebuffer(e.FRAMEBUFFER,t[0]),e.bindRenderbuffer(e.RENDERBUFFER,t[1]),e.bindTexture(e.TEXTURE_2D,t[2])}function f(e){switch(e){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function d(e,t,r,i,a,o){if(!i)return null;var s=n(e,t,r,a,i);return s.magFilter=e.NEAREST,s.minFilter=e.NEAREST,s.mipSamples=1,s.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,o,e.TEXTURE_2D,s.handle,0),s}function p(e,t,r,n,i){var a=e.createRenderbuffer();return e.bindRenderbuffer(e.RENDERBUFFER,a),e.renderbufferStorage(e.RENDERBUFFER,n,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,a),a}function h(e,t,r,n,i,a,o,s){this.gl=e,this._shape=[0|t,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var h=0;h1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?h?e.depth=d(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):v&&(e.depth=d(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):v&&h?e._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):v?e._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):h&&(e._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(e._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(e.handle),e.handle=null,e.depth&&(e.depth.dispose(),e.depth=null),e._depth_rb&&(r.deleteRenderbuffer(e._depth_rb),e._depth_rb=null),g=0;gi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");e._shape[0]=t,e._shape[1]=r;for(var a=u(n),o=0;o>8*p&255;this.pickOffset=r,i.bind();var h=i.uniforms;h.viewTransform=e,h.pickOffset=t,h.shape=this.shape;var v=i.attributes;return this.positionBuffer.bind(),v.position.pointer(),this.weightBuffer.bind(),v.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),v.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),c.pick=function(e,t,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},c.update=function(e){var t=(e=e||{}).shape||[0,0],r=e.x||i(t[0]),o=e.y||i(t[1]),s=e.z||new Float32Array(t[0]*t[1]),l=!1!==e.zsmooth;this.xData=r,this.yData=o;var u,c,d,p,h=e.colorLevels||[0],v=e.colorValues||[0,0,0,1],m=h.length,g=this.bounds;l?(u=g[0]=r[0],c=g[1]=o[0],d=g[2]=r[r.length-1],p=g[3]=o[o.length-1]):(u=g[0]=r[0]+(r[1]-r[0])/2,c=g[1]=o[0]+(o[1]-o[0])/2,d=g[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,p=g[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(d-u),x=1/(p-c),b=t[0],_=t[1];this.shape=[b,_];var w=(l?(b-1)*(_-1):b*_)*(f.length>>>1);this.numVertices=w;for(var k=a.mallocUint8(4*w),T=a.mallocFloat32(2*w),M=a.mallocUint8(2*w),S=a.mallocUint32(w),A=0,C=l?b-1:b,E=l?_-1:_,P=0;P max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(e){return i(e,a,o,null,l)},t.createPickShader=function(e){return i(e,a,s,null,l)}},6086:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl||e.scene&&e.scene.gl,r=f(t);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=d(t);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(t),l=i(t,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),c=u(new Array(1024),[256,1,4]),p=0;p<1024;++p)c.data[p]=255;var h=a(t,c);h.wrap=t.REPEAT;var v=new g(t,r,o,s,l,h);return v.update(e),v};var n=r(5827),i=r(2944),a=r(8931),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(5070),u=r(5050),c=r(248),f=c.createShader,d=c.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(e,t){for(var r=0,n=0;n<3;++n){var i=e[n]-t[n];r+=i*i}return Math.sqrt(r)}function v(e){for(var t=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)t[0][r]=Math.max(e[0][r],t[0][r]),t[1][r]=Math.min(e[1][r],t[1][r]);return t}function m(e,t,r,n){this.arcLength=e,this.position=t,this.index=r,this.dataCoordinate=n}function g(e,t,r,n,i,a){this.gl=e,this.shader=t,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=g.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(e){this.pickId=e},y.drawTransparent=y.draw=function(e){if(this.vertexCount){var t=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:e.model||p,view:e.view||p,projection:e.projection||p,clipBounds:v(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.drawPick=function(e){if(this.vertexCount){var t=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:e.model||p,view:e.view||p,projection:e.projection||p,pickId:this.pickId,clipBounds:v(this.clipBounds),screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(e){var t,r;this.dirty=!0;var n=!!e.connectGaps;"dashScale"in e&&(this.dashScale=e.dashScale),this.hasAlpha=!1,"opacity"in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,c=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],d=e.position||e.positions;if(d){var p=e.color||e.colors||[0,0,0,1],v=e.lineWidth||1,m=!1;e:for(t=1;t0){for(var w=0;w<24;++w)i.push(i[i.length-12]);c+=2,m=!0}continue e}f[0][r]=Math.min(f[0][r],b[r],_[r]),f[1][r]=Math.max(f[1][r],b[r],_[r])}Array.isArray(p[0])?(g=p.length>t-1?p[t-1]:p.length>0?p[p.length-1]:[0,0,0,1],y=p.length>t?p[t]:p.length>0?p[p.length-1]:[0,0,0,1]):g=y=p,3===g.length&&(g=[g[0],g[1],g[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&g[3]<1&&(this.hasAlpha=!0),x=Array.isArray(v)?v.length>t-1?v[t-1]:v.length>0?v[v.length-1]:[0,0,0,1]:v;var k=s;if(s+=h(b,_),m){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,g[0],g[1],g[2],g[3]);c+=2,m=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,g[0],g[1],g[2],g[3],b[0],b[1],b[2],_[0],_[1],_[2],k,-x,g[0],g[1],g[2],g[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,y[0],y[1],y[2],y[3]),c+=4}}if(this.buffer.update(i),a.push(s),o.push(d[d.length-1].slice()),this.bounds=f,this.vertexCount=c,this.points=o,this.arcLength=a,"dashes"in e){var T=e.dashes.slice();for(T.unshift(0),t=1;t1.0001)return null;g+=m[f]}return Math.abs(g-1)>.001?null:[d,s(e,m),m]}},2056:function(e,t,r){var n=r(6832),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:d,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:p,fragment:h,attributes:[{name:"position",type:"vec3"}]}},8116:function(e,t,r){"use strict";var n=r(5158),i=r(5827),a=r(2944),o=r(8931),s=r(115),l=r(104),u=r(7437),c=r(5050),f=r(9156),d=r(7212),p=r(5306),h=r(2056),v=r(4340),m=h.meshShader,g=h.wireShader,y=h.pointShader,x=h.pickShader,b=h.pointPickShader,_=h.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function k(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x,b,_,k,T,M,S,A){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=d,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=h,this.edgeColors=m,this.edgeUVs=g,this.edgeIds=v,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=k,this.pointSizes=T,this.pointIds=b,this.pointVAO=M,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=S,this.contourVAO=A,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var T=k.prototype;function M(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;re&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}function S(e){var t=n(e,y.vertex,y.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.pointSize.location=4,t}function A(e){var t=n(e,x.vertex,x.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t}function C(e){var t=n(e,b.vertex,b.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t.attributes.pointSize.location=4,t}function E(e){var t=n(e,_.vertex,_.fragment);return t.attributes.position.location=0,t}T.isOpaque=function(){return!this.hasAlpha},T.isTransparent=function(){return this.hasAlpha},T.pickSlots=1,T.setPickBase=function(e){this.pickId=e},T.highlight=function(e){if(e&&this.contourEnable){for(var t=d(this.cells,this.intensity,e.intensity),r=t.cells,n=t.vertexIds,i=t.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),t.drawArrays(t.LINES,0,this.contourCount),this.contourVAO.unbind())},T.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||w,n=e.view||w,i=e.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind())},T.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;for(var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions,i=new Array(r.length),a=0;al[T]&&(a.uniforms.dataAxis=e,a.uniforms.screenOffset=t,a.uniforms.color=m[n],a.uniforms.angle=g[n],u.drawArrays(u.TRIANGLES,l[T],l[M]-l[T]))),y[n]&&k&&(t[1^n]-=S*p*x[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=t,a.uniforms.color=b[n],a.uniforms.angle=_[n],u.drawArrays(u.TRIANGLES,w,k)),t[1^n]=S*c[2+(1^n)]-1,h[n+2]&&(t[1^n]+=S*p*v[n+2],Tl[T]&&(a.uniforms.dataAxis=e,a.uniforms.screenOffset=t,a.uniforms.color=m[n+2],a.uniforms.angle=g[n+2],u.drawArrays(u.TRIANGLES,l[T],l[M]-l[T]))),y[n+2]&&k&&(t[1^n]+=S*p*x[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=t,a.uniforms.color=b[n+2],a.uniforms.angle=_[n+2],u.drawArrays(u.TRIANGLES,w,k))}}(),u.drawTitle=function(){var e=[0,0],t=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)t[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=e,n.uniforms.screenOffset=t,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),u.bind=function(){var e=[0,0],t=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var u=0;u<2;++u){var c=a[u],f=a[u+2]-c,d=.5*(o[u+2]+o[u]),p=o[u+2]-o[u],h=l[u],v=l[u+2]-h,m=s[u],g=s[u+2]-m;t[u]=2*f/p*v/g,e[u]=2*(c-d)/p*v/g}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=t,i.uniforms.dataShift=e,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),u.update=function(e){var t,r,n,i,o,s=[],l=e.ticks,u=e.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],f=[-1/0],d=l[o];for(t=0;t=0){var v=t[h]-n[h]*(t[h+2]-t[h])/(n[h+2]-n[h]);0===h?o.drawLine(v,t[1],v,t[3],p[h],d[h]):o.drawLine(t[0],v,t[2],v,p[h],d[h])}}for(h=0;h=0;--e)this.objects[e].dispose();for(this.objects.length=0,e=this.overlays.length-1;e>=0;--e)this.overlays[e].dispose();this.overlays.length=0,this.gl=null},u.addObject=function(e){this.objects.indexOf(e)<0&&(this.objects.push(e),this.setDirty())},u.removeObject=function(e){for(var t=this.objects,r=0;rMath.abs(t))u.rotate(a,0,0,-e*r*Math.PI*h.rotateSpeed/window.innerWidth);else if(!h._ortho){var o=-h.zoomSpeed*i*t/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,f*(Math.exp(o)-1))}}}),!0)},h.enableMouseListeners(),h};var n=r(8161),i=r(1152),a=r(6145),o=r(6475),s=r(2565),l=r(5233)},8245:function(e,t,r){var n=r(6832),i=r(5158),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec2"}])}},1059:function(e,t,r){"use strict";var n=r(4296),i=r(7453),a=r(2771),o=r(6496),s=r(2611),l=r(4234),u=r(8126),c=r(6145),f=r(1120),d=r(5268),p=r(8245),h=r(2321)({tablet:!0,featureDetect:!0});function v(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function m(e){var t=Math.round(Math.log(Math.abs(e))/Math.log(10));if(t<0){var r=Math.round(Math.pow(10,-t));return Math.ceil(e*r)/r}return t>0?(r=Math.round(Math.pow(10,t)),Math.ceil(e/r)*r):Math.ceil(e)}function g(e){return"boolean"!==typeof e||e}e.exports={createScene:function(e){(e=e||{}).camera=e.camera||{};var t=e.canvas;t||(t=document.createElement("canvas"),e.container?e.container.appendChild(t):document.body.appendChild(t));var r=e.gl;if(r||(e.glOptions&&(h=!!e.glOptions.preserveDrawingBuffer),r=function(e,t){var r=null;try{(r=e.getContext("webgl",t))||(r=e.getContext("experimental-webgl",t))}catch(n){return null}return r}(t,e.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:h})),!r)throw new Error("webgl not supported");var y=e.bounds||[[-10,-10,-10],[10,10,10]],x=new v,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!h}),_=p(r),w=e.cameraObject&&!0===e.cameraObject._ortho||e.camera.projection&&"orthographic"===e.camera.projection.type||!1,k={eye:e.camera.eye||[2,0,0],center:e.camera.center||[0,0,0],up:e.camera.up||[0,1,0],zoomMin:e.camera.zoomMax||.1,zoomMax:e.camera.zoomMin||100,mode:e.camera.mode||"turntable",_ortho:w},T=e.axes||{},M=i(r,T);M.enable=!T.disable;var S=e.spikes||{},A=o(r,S),C=[],E=[],P=[],L=[],I=!0,R=!0,O=new Array(16),D=new Array(16),z={view:null,projection:O,model:D,_ortho:!1},F=(R=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),j=e.cameraObject||n(t,k),N={gl:r,contextLost:!1,pixelRatio:e.pixelRatio||1,canvas:t,selection:x,camera:j,axes:M,axesPixels:null,spikes:A,bounds:y,objects:C,shape:F,aspect:e.aspectRatio||[1,1,1],pickRadius:e.pickRadius||10,zNear:e.zNear||.01,zFar:e.zFar||1e3,fovy:e.fovy||Math.PI/4,clearColor:e.clearColor||[0,0,0,0],autoResize:g(e.autoResize),autoBounds:g(e.autoBounds),autoScale:!!e.autoScale,autoCenter:g(e.autoCenter),clipToBounds:g(e.clipToBounds),snapToData:!!e.snapToData,onselect:e.onselect||null,onrender:e.onrender||null,onclick:e.onclick||null,cameraParams:z,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(e){this.aspect[0]=e.x,this.aspect[1]=e.y,this.aspect[2]=e.z,R=!0},setBounds:function(e,t){this.bounds[0][e]=t.min,this.bounds[1][e]=t.max},setClearColor:function(e){this.clearColor=e},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},Z=[r.drawingBufferWidth/N.pixelRatio|0,r.drawingBufferHeight/N.pixelRatio|0];function B(){if(!N._stopped&&N.autoResize){var e=t.parentNode,r=1,n=1;e&&e!==document.body?(r=e.clientWidth,n=e.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*N.pixelRatio),a=0|Math.ceil(n*N.pixelRatio);if(i!==t.width||a!==t.height){t.width=i,t.height=a;var o=t.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",I=!0}}}function V(){for(var e=C.length,t=L.length,n=0;n0&&0===P[t-1];)P.pop(),L.pop().dispose()}function U(){if(N.contextLost)return!0;r.isContextLost()&&(N.contextLost=!0,N.mouseListener.enabled=!1,N.selection.object=null,N.oncontextloss&&N.oncontextloss())}N.autoResize&&B(),window.addEventListener("resize",B),N.update=function(e){N._stopped||(e=e||{},I=!0,R=!0)},N.add=function(e){N._stopped||(e.axes=M,C.push(e),E.push(-1),I=!0,R=!0,V())},N.remove=function(e){if(!N._stopped){var t=C.indexOf(e);t<0||(C.splice(t,1),E.pop(),I=!0,R=!0,V())}},N.dispose=function(){if(!N._stopped&&(N._stopped=!0,window.removeEventListener("resize",B),t.removeEventListener("webglcontextlost",U),N.mouseListener.enabled=!1,!N.contextLost)){M.dispose(),A.dispose();for(var e=0;ex.distance)continue;for(var u=0;u 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),t.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),t.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},8271:function(e,t,r){"use strict";var n=r(5158),i=r(5827),a=r(5306),o=r(8023);function s(e,t,r,n,i){this.plot=e,this.offsetBuffer=t,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(e,t){var r=e.gl,a=i(r),l=i(r),u=n(r,o.pointVertex,o.pointFragment),c=n(r,o.pickVertex,o.pickFragment),f=new s(e,a,l,u,c);return f.update(t),e.addObject(f),f};var l=s.prototype;l.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},l.update=function(e){var t;function r(t,r){return t in e?e[t]:r}e=e||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=e.positions.length>>>1,i=e.positions instanceof Float32Array,o=e.idToIndex instanceof Int32Array&&e.idToIndex.length>=n,s=e.positions,l=i?s:a.mallocFloat32(s.length),u=o?e.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),t=0;t>>1;for(r=0;r=t[0]&&a<=t[2]&&o>=t[1]&&o<=t[3]&&n++}return n}(this.points,o),c=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(u,.33333)));e[0]=2/s,e[4]=2/l,e[6]=-2*o[0]/s-1,e[7]=-2*o[1]/l-1,this.offsetBuffer.bind(),i.bind(),i.attributes.position.pointer(),i.uniforms.matrix=e,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointCloud=c<5,i.uniforms.pointSize=c,i.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(t[0]=255&r,t[1]=r>>8&255,t[2]=r>>16&255,t[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(a.UNSIGNED_BYTE),i.uniforms.pickOffset=t,this.pickOffset=r);var f=a.getParameter(a.BLEND),d=a.getParameter(a.DITHER);return f&&!this.blend&&a.disable(a.BLEND),d&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),f&&!this.blend&&a.enable(a.BLEND),d&&a.enable(a.DITHER),r+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.pick=function(e,t,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},6093:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,u=t[0],c=t[1],f=t[2],d=t[3],p=r[0],h=r[1],v=r[2],m=r[3];return(a=u*p+c*h+f*v+d*m)<0&&(a=-a,p=-p,h=-h,v=-v,m=-m),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),e[0]=s*u+l*p,e[1]=s*c+l*h,e[2]=s*f+l*v,e[3]=s*d+l*m,e}},8240:function(e){"use strict";e.exports=function(e){return e||0===e?e.toString():""}},4123:function(e,t,r){"use strict";var n=r(875);e.exports=function(e,t,r){var a=i[t];if(a||(a=i[t]={}),e in a)return a[e];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:t,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(e,o);o.triangles=!1;var l,u,c=n(e,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),u=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:c},d={vertex:o,fragment:l,attributes:c},p={vertex:s,fragment:l,attributes:c},h={vertex:a,fragment:u,attributes:c},v={vertex:o,fragment:u,attributes:c},m={vertex:s,fragment:u,attributes:c};function g(e,t){var r=n(e,t),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}t.createPerspective=function(e){return g(e,f)},t.createOrtho=function(e){return g(e,d)},t.createProject=function(e){return g(e,p)},t.createPickPerspective=function(e){return g(e,h)},t.createPickOrtho=function(e){return g(e,v)},t.createPickProject=function(e){return g(e,m)}},2182:function(e,t,r){"use strict";var n=r(3596),i=r(5827),a=r(2944),o=r(5306),s=r(104),l=r(9282),u=r(4123),c=r(8240),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];return e[0]=t[0]*r+t[4]*n+t[8]*i+t[12]*a,e[1]=t[1]*r+t[5]*n+t[9]*i+t[13]*a,e[2]=t[2]*r+t[6]*n+t[10]*i+t[14]*a,e[3]=t[3]*r+t[7]*n+t[11]*i+t[15]*a,e}function p(e,t,r,n){return d(n,n),d(n,n),d(n,n)}function h(e,t){this.index=e,this.dataCoordinate=this.position=t}function v(e){return!0===e||e>1?1:e}function m(e,t,r,n,i,a,o,s,l,u,c,f){this.gl=e,this.pixelRatio=1,this.shader=t,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=c,this.pickProjectShader=f,this.points=[],this._selectResult=new h(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(e){var t=e.gl,r=l.createPerspective(t),n=l.createOrtho(t),o=l.createProject(t),s=l.createPickPerspective(t),u=l.createPickOrtho(t),c=l.createPickProject(t),f=i(t),d=i(t),p=i(t),h=i(t),v=a(t,[{buffer:f,size:3,type:t.FLOAT},{buffer:d,size:4,type:t.FLOAT},{buffer:p,size:2,type:t.FLOAT},{buffer:h,size:4,type:t.UNSIGNED_BYTE,normalized:!0}]),g=new m(t,r,n,o,f,d,p,h,v,s,u,c);return g.update(e),g};var g=m.prototype;g.pickSlots=1,g.setPickBase=function(e){this.pickId=e},g.isTransparent=function(){if(this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&this.projectHasAlpha)return!0;return!1},g.isOpaque=function(){if(!this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],k=f.slice(),T=[0,0,0],M=[[0,0,0],[0,0,0]];function S(e){return e[0]=e[1]=e[2]=0,e}function A(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=1,e}function C(e,t,r,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[r]=n,e}function E(e,t,r,n){var i,a=t.axesProject,o=t.gl,l=e.uniforms,u=r.model||f,c=r.view||f,d=r.projection||f,h=t.axesBounds,v=function(e){for(var t=M,r=0;r<2;++r)for(var n=0;n<3;++n)t[r][n]=Math.max(Math.min(e[r][n],1e8),-1e8);return t}(t.clipBounds);i=t.axes&&t.axes.lastCubeProps?t.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,e.bind(),l.view=c,l.projection=d,l.screenSize=y,l.highlightId=t.highlightId,l.highlightScale=t.highlightScale,l.clipBounds=v,l.pickGroup=t.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=t.projectScale[m],l.opacity=t.projectOpacity[m];for(var g=k,E=0;E<16;++E)g[E]=0;for(E=0;E<4;++E)g[5*E]=1;g[5*m]=0,i[m]<0?g[12+m]=h[0][m]:g[12+m]=h[1][m],s(g,u,g),l.model=g;var P=(m+1)%3,L=(m+2)%3,I=S(x),R=S(b);I[P]=1,R[L]=1;var O=p(0,0,0,A(_,I)),D=p(0,0,0,A(w,R));if(Math.abs(O[1])>Math.abs(D[1])){var z=O;O=D,D=z,z=I,I=R,R=z;var F=P;P=L,L=F}O[0]<0&&(I[P]=-1),D[1]>0&&(R[L]=-1);var j=0,N=0;for(E=0;E<4;++E)j+=Math.pow(u[4*P+E],2),N+=Math.pow(u[4*L+E],2);I[P]/=Math.sqrt(j),R[L]/=Math.sqrt(N),l.axes[0]=I,l.axes[1]=R,l.fragClipBounds[0]=C(T,v[0],m,-1e8),l.fragClipBounds[1]=C(T,v[1],m,1e8),t.vao.bind(),t.vao.draw(o.TRIANGLES,t.vertexCount),t.lineWidth>0&&(o.lineWidth(t.lineWidth*n),t.vao.draw(o.LINES,t.lineVertexCount,t.vertexCount)),t.vao.unbind()}}var P=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function L(e,t,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&E(t,r,n,i),a===r.hasAlpha||o){e.bind();var l=e.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=P,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function I(e,t,r,i){var a;a=Array.isArray(e)?t=this.pointCount||t<0)return null;var r=this.points[t],n=this._selectResult;n.index=t;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},g.highlight=function(e){if(e){var t=e.index,r=255&t,n=t>>8&255,i=t>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},g.update=function(e){if("perspective"in(e=e||{})&&(this.useOrtho=!e.perspective),"orthographic"in e&&(this.useOrtho=!!e.orthographic),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"project"in e)if(Array.isArray(e.project))this.axesProject=e.project;else{var t=!!e.project;this.axesProject=[t,t,t]}if("projectScale"in e)if(Array.isArray(e.projectScale))this.projectScale=e.projectScale.slice();else{var r=+e.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in e){Array.isArray(e.projectOpacity)?this.projectOpacity=e.projectOpacity.slice():(r=+e.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in e&&(this.opacity=v(e.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=e.position,l=e.font||"normal",u=e.alignment||[0,0];if(2===u.length)i=u[0],a=u[1];else for(i=[],a=[],n=0;n0){var R=0,O=x,D=[0,0,0,1],z=[0,0,0,1],F=Array.isArray(p)&&Array.isArray(p[0]),j=Array.isArray(g)&&Array.isArray(g[0]);e:for(n=0;n<_;++n){for(y+=1,w=s[n],k=0;k<3;++k){if(isNaN(w[k])||!isFinite(w[k]))continue e;f[k]=Math.max(f[k],w[k]),c[k]=Math.min(c[k],w[k])}T=(N=I(d,n,l,this.pixelRatio)).mesh,M=N.lines,S=N.bounds;var N,Z=N.visible;if(Z)if(Array.isArray(p)){if(3===(B=F?n0?1-S[0][0]:G<0?1+S[1][0]:1,q*=q>0?1-S[0][1]:q<0?1+S[1][1]:1],X=T.cells||[],K=T.positions||[];for(k=0;k0){var g=r*c;o.drawBox(f-g,d-g,p+g,d+g,a),o.drawBox(f-g,h-g,p+g,h+g,a),o.drawBox(f-g,d-g,f+g,h+g,a),o.drawBox(p-g,d-g,p+g,h+g,a)}}}},s.update=function(e){e=e||{},this.innerFill=!!e.innerFill,this.outerFill=!!e.outerFill,this.innerColor=(e.innerColor||[0,0,0,.5]).slice(),this.outerColor=(e.outerColor||[0,0,0,.5]).slice(),this.borderColor=(e.borderColor||[0,0,0,1]).slice(),this.borderWidth=e.borderWidth||0,this.selectBox=(e.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},2611:function(e,t,r){"use strict";e.exports=function(e,t){var r=t[0],a=t[1],o=n(e,r,a,{}),s=i.mallocUint8(r*a*4);return new l(e,o,s)};var n=r(4234),i=r(5306),a=r(5050),o=r(2288).nextPow2;function s(e,t,r,n,i){this.coord=[e,t],this.id=r,this.value=n,this.distance=i}function l(e,t,r){this.gl=e,this.fbo=t,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(t.bind(),e.readPixels(0,0,t.shape[0],t.shape[1],e.RGBA,e.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var u=l.prototype;Object.defineProperty(u,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(e){if(this.gl){this.fbo.shape=e;var t=this.fbo.shape[0],r=this.fbo.shape[1];if(r*t*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*t*4)),a=0;ar)for(e=r;et)for(e=t;e=0){for(var k=0|w.type.charAt(w.type.length-1),T=new Array(k),M=0;M=0;)S+=1;_[y]=S}var A=new Array(r.length);function C(){d.program=o.program(p,d._vref,d._fref,b,_);for(var e=0;e=0){if((h=d.charCodeAt(d.length-1)-48)<2||h>4)throw new n("","Invalid data type for attribute "+f+": "+d);s(e,t,p[0],i,h,a,f)}else{if(!(d.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+d);var h;if((h=d.charCodeAt(d.length-1)-48)<2||h>4)throw new n("","Invalid data type for attribute "+f+": "+d);l(e,t,p,i,h,a,f)}}}return a};var n=r(9068);function i(e,t,r,n,i,a){this._gl=e,this._wrapper=t,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(e,t,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,e||a.FLOAT,!!t,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(e,t,r,n){return this._constFunc(this._locations[this._index],e,t,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(e){return e!==this._locations[this._index]&&(this._locations[this._index]=0|e,this._wrapper.program=null),0|e}});var o=[function(e,t,r){return void 0===r.length?e.vertexAttrib1f(t,r):e.vertexAttrib1fv(t,r)},function(e,t,r,n){return void 0===r.length?e.vertexAttrib2f(t,r,n):e.vertexAttrib2fv(t,r)},function(e,t,r,n,i){return void 0===r.length?e.vertexAttrib3f(t,r,n,i):e.vertexAttrib3fv(t,r)},function(e,t,r,n,i,a){return void 0===r.length?e.vertexAttrib4f(t,r,n,i,a):e.vertexAttrib4fv(t,r)}];function s(e,t,r,n,a,s,l){var u=o[a],c=new i(e,t,r,n,a,u);Object.defineProperty(s,l,{set:function(t){return e.disableVertexAttribArray(n[r]),u(e,n[r],t),t},get:function(){return c},enumerable:!0})}function l(e,t,r,n,i,a,o){for(var l=new Array(i),u=new Array(i),c=0;c4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+y);e["uniformMatrix"+g+"fv"](s[f],!1,d);break}throw new i("","Unknown uniform data type for "+name+": "+y)}if((g=y.charCodeAt(y.length-1)-48)<2||g>4)throw new i("","Invalid data type");switch(y.charAt(0)){case"b":case"i":e["uniform"+g+"iv"](s[f],d);break;case"v":e["uniform"+g+"fv"](s[f],d);break;default:throw new i("","Unrecognized data type for vector "+name+": "+y)}}}}}}function u(e,t){if("object"!==typeof t)return[[e,t]];var r=[];for(var n in t){var i=t[n],a=e;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"===typeof i?r.push.apply(r,u(a,i)):r.push([a,i])}return r}function c(e,t,n){if("object"===typeof n){var u=f(n);Object.defineProperty(e,t,{get:a(u),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(e,t,{get:(c=n,function(e,t,r){return e.getUniform(t.program,r[c])}),set:l(n),enumerable:!0,configurable:!1}):e[t]=function(e){switch(e){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var t=e.indexOf("vec");if(0<=t&&t<=1&&e.length===4+t){if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===e.charAt(0)?o(r,!1):o(r,0)}if(0===e.indexOf("mat")&&4===e.length){var r;if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+e);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+e)}}(r[n].type);var c}function f(e){var t;if(Array.isArray(e)){t=new Array(e.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7307:function(e,t,r){"use strict";var n=r(2858),i=r(4020),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(e,t,r,a){for(var o=0,s=0;s0)for(k=0;k<8;k++){var T=(k+1)%8;u.push(d[k],p[k],p[T],p[T],d[T],d[k]),f.push(y,g,g,g,y,y),h.push(v,m,m,m,v,v);var M=u.length;c.push([M-6,M-5,M-4],[M-3,M-2,M-1])}var S=d;d=p,p=S;var A=y;y=g,g=A;var C=v;v=m,m=C}return{positions:u,cells:c,vectors:f,vertexIntensity:h}}(e,r,a,o)})),f=[],d=[],p=[],h=[];for(s=0;st)return r-1}return r},l=function(e,t,r){return er?r:e},u=function(e){var t=1/0;e.sort((function(e,t){return e-t}));for(var r=e.length,n=1;nf-1||y>d-1||x>p-1)return n.create();var b,_,w,k,T,M,S=a[0][h],A=a[0][g],C=a[1][v],E=a[1][y],P=a[2][m],L=(o-S)/(A-S),I=(u-C)/(E-C),R=(c-P)/(a[2][x]-P);switch(isFinite(L)||(L=.5),isFinite(I)||(I=.5),isFinite(R)||(R=.5),r.reversedX&&(h=f-1-h,g=f-1-g),r.reversedY&&(v=d-1-v,y=d-1-y),r.reversedZ&&(m=p-1-m,x=p-1-x),r.filled){case 5:T=m,M=x,w=v*p,k=y*p,b=h*p*d,_=g*p*d;break;case 4:T=m,M=x,b=h*p,_=g*p,w=v*p*f,k=y*p*f;break;case 3:w=v,k=y,T=m*d,M=x*d,b=h*d*p,_=g*d*p;break;case 2:w=v,k=y,b=h*d,_=g*d,T=m*d*f,M=x*d*f;break;case 1:b=h,_=g,T=m*f,M=x*f,w=v*f*p,k=y*f*p;break;default:b=h,_=g,w=v*f,k=y*f,T=m*f*d,M=x*f*d}var O=i[b+w+T],D=i[b+w+M],z=i[b+k+T],F=i[b+k+M],j=i[_+w+T],N=i[_+w+M],Z=i[_+k+T],B=i[_+k+M],V=n.create(),U=n.create(),H=n.create(),W=n.create();n.lerp(V,O,j,L),n.lerp(U,D,N,L),n.lerp(H,z,Z,L),n.lerp(W,F,B,L);var G=n.create(),q=n.create();n.lerp(G,V,H,I),n.lerp(q,U,W,I);var Y=n.create();return n.lerp(Y,G,q,R),Y}(t,e,p)},v=e.getDivergence||function(e,t){var r=n.create(),i=1e-4;n.add(r,e,[i,0,0]);var a=h(r);n.subtract(a,a,t),n.scale(a,a,1/i),n.add(r,e,[0,i,0]);var o=h(r);n.subtract(o,o,t),n.scale(o,o,1/i),n.add(r,e,[0,0,i]);var s=h(r);return n.subtract(s,s,t),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},m=[],g=t[0][0],y=t[0][1],x=t[0][2],b=t[1][0],_=t[1][1],w=t[1][2],k=function(e){var t=e[0],r=e[1],n=e[2];return!(tb||r_||nw)},T=10*n.distance(t[0],t[1])/i,M=T*T,S=1,A=0,C=r.length;C>1&&(S=function(e){for(var t=[],r=[],n=[],i={},a={},o={},s=e.length,l=0;lA&&(A=F),D.push(F),m.push({points:L,velocities:I,divergences:D});for(var j=0;j<100*i&&L.lengthM&&n.scale(N,N,T/Math.sqrt(Z)),n.add(N,N,P),R=h(N),n.squaredDistance(O,N)-M>-1e-4*M&&(L.push(N),O=N,I.push(R),z=v(N,R),F=n.length(z),isFinite(F)&&F>A&&(A=F),D.push(F)),P=N}}var B=o(m,e.colormap,A,S);return f?B.tubeScale=f:(0===A&&(A=1),B.tubeScale=.5*c*S/A),B};var c=r(9578),f=r(1140).createMesh;e.exports.createTubeMesh=function(e,t){return f(e,t,{shaders:c,traceType:"streamtube"})}},9054:function(e,t,r){var n=r(5158),i=r(6832),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);t.createShader=function(e){var t=n(e,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createPickShader=function(e){var t=n(e,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createContourShader=function(e){var t=n(e,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t},t.createPickContourShader=function(e){var t=n(e,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t}},3754:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl,r=y(t),n=b(t),s=x(t),l=_(t),u=i(t),c=a(t,[{buffer:u,size:4,stride:w,offset:0},{buffer:u,size:3,stride:w,offset:16},{buffer:u,size:3,stride:w,offset:28}]),f=i(t),d=a(t,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),p=i(t),h=a(t,[{buffer:p,size:2,type:t.FLOAT}]),v=o(t,1,A,t.RGBA,t.UNSIGNED_BYTE);v.minFilter=t.LINEAR,v.magFilter=t.LINEAR;var m=new C(t,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,v,s,l,f,d,p,h,[0,0,0]),g={levels:[[],[],[]]};for(var k in e)g[k]=e[k];return g.colormap=g.colormap||"jet",m.update(g),m};var n=r(2288),i=r(5827),a=r(2944),o=r(8931),s=r(5306),l=r(9156),u=r(7498),c=r(7382),f=r(5050),d=r(4162),p=r(104),h=r(7437),v=r(5070),m=r(9144),g=r(9054),y=g.createShader,x=g.createContourShader,b=g.createPickShader,_=g.createPickContourShader,w=40,k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],M=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function S(e,t,r,n,i){this.position=e,this.index=t,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var e=0;e<3;++e){var t=M[e],r=(e+2)%3;t[(e+1)%3+0]=1,t[r+3]=1,t[e+6]=1}}();var A=256;function C(e,t,r,n,i,a,o,l,u,c,d,p,h,v,m){this.gl=e,this.shape=t,this.bounds=r,this.objectOffset=m,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=d,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new S([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=h,this._dynamicVAO=v,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var E=C.prototype;E.genColormap=function(e,t){var r=!1,n=c([l({colormap:e,nshades:A,format:"rgba"}).map((function(e,n){var i=t?function(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;re&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}(n/255,t):e[3];return i<1&&(r=!0),[e[0],e[1],e[2],255*i]}))]);return u.divseq(n,255),this.hasAlphaScale=r,n},E.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},E.isOpaque=function(){return!this.isTransparent()},E.pickSlots=1,E.setPickBase=function(e){this.pickId=e};var P=[0,0,0],L={showSurface:!1,showContour:!1,projections:[k.slice(),k.slice(),k.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function I(e,t){var r,n,i,a=t.axes&&t.axes.lastCubeProps.axis||P,o=t.showSurface,s=t.showContour;for(r=0;r<3;++r)for(o=o||t.surfaceProject[r],n=0;n<3;++n)s=s||t.contourProject[r][n];for(r=0;r<3;++r){var l=L.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=t.axesBounds[+(a[r]>0)][r],p(l,e.model,l);var u=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=e.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var R={model:k,view:k,projection:k,inverseModel:k.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},O=k.slice(),D=[1,0,0,0,1,0,0,0,1];function z(e,t){e=e||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=R;n.model=e.model||k,n.view=e.view||k,n.projection=e.projection||k,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=h(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=D,n.vertexColor=this.vertexColor;var s=O;for(p(s,n.view,n.model),p(s,n.projection,s),h(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var u=s[12+i];for(o=0;o<3;++o)u+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=u/l}var c=I(n,this);if(c.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[i],this._shader.uniforms.clipBounds=c.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(f.uniforms.permutation=M[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=t[1]*(e.value[1]+(15&e.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var f=c?a:1-a,d=0;d<2;++d)for(var p=i+c,h=s+d,m=f*(d?l:1-l),g=0;g<3;++g)u[g]+=this._field[g].get(p,h)*m;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=v.le(this.contourLevels[x],u[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]Math.abs(_-u[x])&&(y[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/t[0],r.uv[1]=o/t[1],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},E.padField=function(e,t){var r=t.shape.slice(),n=e.shape.slice();u.assign(e.lo(1,1).hi(r[0],r[1]),t),u.assign(e.lo(1).hi(r[0],1),t.hi(r[0],1)),u.assign(e.lo(1,n[1]-1).hi(r[0],1),t.lo(0,r[1]-1).hi(r[0],1)),u.assign(e.lo(0,1).hi(1,r[1]),t.hi(1)),u.assign(e.lo(n[0]-1,1).hi(1,r[1]),t.lo(r[0]-1)),e.set(0,0,t.get(0,0)),e.set(0,n[1]-1,t.get(0,r[1]-1)),e.set(n[0]-1,0,t.get(r[0]-1,0)),e.set(n[0]-1,n[1]-1,t.get(r[0]-1,r[1]-1))},E.update=function(e){e=e||{},this.objectOffset=e.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in e&&(this.contourWidth=j(e.contourWidth,Number)),"showContour"in e&&(this.showContour=j(e.showContour,Boolean)),"showSurface"in e&&(this.showSurface=!!e.showSurface),"contourTint"in e&&(this.contourTint=j(e.contourTint,Boolean)),"contourColor"in e&&(this.contourColor=Z(e.contourColor)),"contourProject"in e&&(this.contourProject=j(e.contourProject,(function(e){return j(e,Boolean)}))),"surfaceProject"in e&&(this.surfaceProject=e.surfaceProject),"dynamicColor"in e&&(this.dynamicColor=Z(e.dynamicColor)),"dynamicTint"in e&&(this.dynamicTint=j(e.dynamicTint,Number)),"dynamicWidth"in e&&(this.dynamicWidth=j(e.dynamicWidth,Number)),"opacity"in e&&(this.opacity=e.opacity),"opacityscale"in e&&(this.opacityscale=e.opacityscale),"colorBounds"in e&&(this.colorBounds=e.colorBounds),"vertexColor"in e&&(this.vertexColor=e.vertexColor?1:0),"colormap"in e&&this._colorMap.setPixels(this.genColormap(e.colormap,this.opacityscale));var t=e.field||e.coords&&e.coords[2]||null,r=!1;if(t||(t=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in e||"coords"in e){var i=(t.shape[0]+2)*(t.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[t.shape[0]+2,t.shape[1]+2]),this.padField(this._field[2],t),this.shape=t.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(e.coords){var l=e.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var u=l[o];for(g=0;g<2;++g)if(u.shape[g]!==a[g])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],u)}}else if(e.ticks){var c=e.ticks;if(!Array.isArray(c)||2!==c.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=c[o];if((Array.isArray(p)||p.length)&&(p=f(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var h=f(p.data,a);h.stride[o]=p.stride[0],h.stride[1^o]=0,this.padField(this._field[o],h)}}else{for(o=0;o<2;++o){var v=[0,0];v[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],v,0)}this._field[0].set(0,0,0);for(var g=0;g0){for(var xe=0;xe<5;++xe)J.pop();B-=1}continue e}J.push(ne[0],ne[1],oe[0],oe[1],ne[2]),B+=1}}re.push(B)}this._contourOffsets[Q]=te,this._contourCounts[Q]=re}var be=s.mallocFloat(J.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=h(o,t.stride.slice()),u=0;"float32"===r?u=e.FLOAT:"float64"===r?(u=e.FLOAT,l=!1,r="float32"):"uint8"===r?u=e.UNSIGNED_BYTE:(u=e.UNSIGNED_BYTE,l=!1,r="uint8");var f,p,m=0;if(2===o.length)m=e.LUMINANCE,o=[o[0],o[1],1],t=n(t.data,o,[t.stride[0],t.stride[1],1],t.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])m=e.ALPHA;else if(2===o[2])m=e.LUMINANCE_ALPHA;else if(3===o[2])m=e.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");m=e.RGBA}}u!==e.FLOAT||e.getExtension("OES_texture_float")||(u=e.UNSIGNED_BYTE,l=!1);var g=t.size;if(l)f=0===t.offset&&t.data.length===g?t.data:t.data.subarray(t.offset,t.offset+g);else{var y=[o[2],o[2]*o[0],1];p=a.malloc(g,r);var x=n(p,o,y,0);"float32"!==r&&"float64"!==r||u!==e.UNSIGNED_BYTE?i.assign(x,t):c(x,t),f=p.subarray(0,g)}var b=v(e);return e.texImage2D(e.TEXTURE_2D,0,m,o[0],o[1],0,m,u,f),l||a.free(p),new d(e,b,o[0],o[1],m,u)}(e,t)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(e){return"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&e instanceof ImageData}var c=function(e,t){i.muls(e,t,255)};function f(e,t,r){var n=e.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(t<0||t>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return e._shape=[t,r],e.bind(),n.texImage2D(n.TEXTURE_2D,0,e.format,t,r,0,e.format,e.type,null),e._mipLevels=[0],e}function d(e,t,r,n,i,a){this.gl=e,this.handle=t,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=e.NEAREST,this._minFilter=e.NEAREST,this._wrapS=e.CLAMP_TO_EDGE,this._wrapT=e.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(e){return o.wrapS=e}},{get:function(){return o._wrapT},set:function(e){return o.wrapT=e}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(e){return o.width=e}},{get:function(){return o._shape[1]},set:function(e){return o.height=e}}]),this._shapeVector=l}var p=d.prototype;function h(e,t){return 3===e.length?1===t[2]&&t[1]===e[0]*e[2]&&t[0]===e[2]:1===t[0]&&t[1]===e[0]}function v(e){var t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t}function m(e,t,r,n,i){var a=e.getParameter(e.MAX_TEXTURE_SIZE);if(t<0||t>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===e.FLOAT&&!e.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=v(e);return e.texImage2D(e.TEXTURE_2D,0,n,t,r,0,n,i,null),new d(e,o,t,r,n,i)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),this._minFilter=e}},magFilter:{get:function(){return this._magFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),this._magFilter=e}},mipSamples:{get:function(){return this._anisoSamples},set:function(e){var t=this._anisoSamples;if(this._anisoSamples=0|Math.max(e,1),t!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,e),this._wrapS=e}},wrapT:{get:function(){return this._wrapT},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,e),this._wrapT=e}},wrap:{get:function(){return this._wrapVector},set:function(e){if(Array.isArray(e)||(e=[e,e]),2!==e.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var t=0;t<2;++t)if(l.indexOf(e[t])<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);this._wrapS=e[0],this._wrapT=e[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),e}},shape:{get:function(){return this._shapeVector},set:function(e){if(Array.isArray(e)){if(2!==e.length)throw new Error("gl-texture2d: Invalid texture shape")}else e=[0|e,0|e];return f(this,0|e[0],0|e[1]),[0|e[0],0|e[1]]}},width:{get:function(){return this._shape[0]},set:function(e){return f(this,e|=0,this._shape[1]),e}},height:{get:function(){return this._shape[1]},set:function(e){return e|=0,f(this,this._shape[0],e),e}}}),p.bind=function(e){var t=this.gl;return void 0!==e&&t.activeTexture(t.TEXTURE0+(0|e)),t.bindTexture(t.TEXTURE_2D,this.handle),void 0!==e?0|e:t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var e=Math.min(this._shape[0],this._shape[1]),t=0;e>0;++t,e>>>=1)this._mipLevels.indexOf(t)<0&&this._mipLevels.push(t)},p.setPixels=function(e,t,r,o){var s=this.gl;this.bind(),Array.isArray(t)?(o=r,r=0|t[1],t=0|t[0]):(t=t||0,r=r||0),o=o||0;var l=u(e)?e:e.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,t,r,this.format,this.type,l);else{if(!(e.shape&&e.stride&&e.data))throw new Error("gl-texture2d: Unsupported data type");if(e.shape.length<2||t+e.shape[1]>this._shape[1]>>>o||r+e.shape[0]>this._shape[0]>>>o||t<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(e,t,r,o,s,l,u,f){var d=f.dtype,p=f.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var v=0,m=0,g=h(p,f.stride.slice());if("float32"===d?v=e.FLOAT:"float64"===d?(v=e.FLOAT,g=!1,d="float32"):"uint8"===d?v=e.UNSIGNED_BYTE:(v=e.UNSIGNED_BYTE,g=!1,d="uint8"),2===p.length)m=e.LUMINANCE,p=[p[0],p[1],1],f=n(f.data,p,[f.stride[0],f.stride[1],1],f.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])m=e.ALPHA;else if(2===p[2])m=e.LUMINANCE_ALPHA;else if(3===p[2])m=e.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");m=e.RGBA}p[2]}if(m!==e.LUMINANCE&&m!==e.ALPHA||s!==e.LUMINANCE&&s!==e.ALPHA||(m=s),m!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=f.size,x=u.indexOf(o)<0;if(x&&u.push(o),v===l&&g)0===f.offset&&f.data.length===y?x?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,l,f.data):e.texSubImage2D(e.TEXTURE_2D,o,t,r,p[0],p[1],s,l,f.data):x?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,l,f.data.subarray(f.offset,f.offset+y)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,p[0],p[1],s,l,f.data.subarray(f.offset,f.offset+y));else{var b;b=l===e.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(b,p,[p[2],p[2]*p[0],1]);v===e.FLOAT&&l===e.UNSIGNED_BYTE?c(_,f):i.assign(_,f),x?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,y)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,p[0],p[1],s,l,b.subarray(0,y)),l===e.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,t,r,o,this.format,this.type,this._mipLevels,e)}}},3056:function(e){"use strict";e.exports=function(e,t,r){t?t.bind():e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null);var n=0|e.getParameter(e.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=r(5415),i=r(899),a=r(9305)},8827:function(e){e.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}},7622:function(e){e.exports=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},8782:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},8501:function(e){e.exports=function(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},903:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}},5981:function(e,t,r){e.exports=r(8288)},8288:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}},8629:function(e,t,r){e.exports=r(7979)},7979:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}},9305:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},154:function(e){e.exports=1e-6},4932:function(e,t,r){e.exports=function(e,t){var r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(154)},5777:function(e){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},3306:function(e){e.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}},7447:function(e,t,r){e.exports=function(e,t,r,i,a,o){var s,l;for(t||(t=3),r||(r=0),l=i?Math.min(i*t+r,e.length):e.length,s=r;s0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e}},6660:function(e){e.exports=function(e,t){t=t||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}},392:function(e){e.exports=function(e,t,r,n){var i=r[1],a=r[2],o=t[1]-i,s=t[2]-a,l=Math.sin(n),u=Math.cos(n);return e[0]=t[0],e[1]=i+o*u-s*l,e[2]=a+o*l+s*u,e}},3222:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[2],o=t[0]-i,s=t[2]-a,l=Math.sin(n),u=Math.cos(n);return e[0]=i+s*l+o*u,e[1]=t[1],e[2]=a+s*u-o*l,e}},3388:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[1],o=t[0]-i,s=t[1]-a,l=Math.sin(n),u=Math.cos(n);return e[0]=i+o*u-s*l,e[1]=a+o*l+s*u,e[2]=t[2],e}},1624:function(e){e.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}},5685:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}},6722:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}},831:function(e){e.exports=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}},5294:function(e,t,r){e.exports=r(6403)},3303:function(e,t,r){e.exports=r(4337)},6403:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}},4337:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}},8921:function(e,t,r){e.exports=r(911)},911:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}},9908:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}},3255:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}},6568:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,d=u*a+o*i-s*n,p=-o*n-s*i-l*a;return e[0]=c*u+p*-o+f*-l-d*-s,e[1]=f*u+p*-s+d*-o-c*-l,e[2]=d*u+p*-l+c*-s-f*-o,e}},3433:function(e){e.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}},1413:function(e){e.exports=function(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},3470:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},5313:function(e){e.exports=function(){var e=new Float32Array(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}},5446:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},205:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}},4242:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}},5680:function(e){e.exports=function(e,t,r,n){var i=new Float32Array(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}},4020:function(e,t,r){e.exports={create:r(5313),clone:r(1413),fromValues:r(5680),copy:r(3470),set:r(6453),add:r(3433),subtract:r(2705),multiply:r(746),divide:r(205),min:r(2170),max:r(3030),scale:r(5510),scaleAndAdd:r(4224),distance:r(5446),squaredDistance:r(1542),length:r(8177),squaredLength:r(9037),negate:r(6459),inverse:r(8057),normalize:r(381),dot:r(4242),lerp:r(8746),random:r(3770),transformMat4:r(6342),transformQuat:r(5022)}},8057:function(e){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}},8177:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}},8746:function(e){e.exports=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}},3030:function(e){e.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}},2170:function(e){e.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}},746:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}},6459:function(e){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}},381:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o),e}},3770:function(e,t,r){var n=r(381),i=r(5510);e.exports=function(e,t){return t=t||1,e[0]=Math.random(),e[1]=Math.random(),e[2]=Math.random(),e[3]=Math.random(),n(e,e),i(e,e,t),e}},5510:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}},4224:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e}},6453:function(e){e.exports=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}},1542:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return r*r+n*n+i*i+a*a}},9037:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}},2705:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}},6342:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}},5022:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,d=u*a+o*i-s*n,p=-o*n-s*i-l*a;return e[0]=c*u+p*-o+f*-l-d*-s,e[1]=f*u+p*-s+d*-o-c*-l,e[2]=d*u+p*-l+c*-s-f*-o,e[3]=t[3],e}},9365:function(e,t,r){var n=r(8096),i=r(7896);e.exports=function(e){for(var t=Array.isArray(e)?e:n(e),r=0;r0)continue;r=e.slice(0,1).join("")}return N(r),L+=r.length,(A=A.slice(r.length)).length}}function q(){return/[^a-fA-F0-9]/.test(t)?(N(A.join("")),S=l,T):(A.push(t),r=t,T+1)}function Y(){return"."===t||/[eE]/.test(t)?(A.push(t),S=v,r=t,T+1):"x"===t&&1===A.length&&"0"===A[0]?(S=_,A.push(t),r=t,T+1):/[^\d]/.test(t)?(N(A.join("")),S=l,T):(A.push(t),r=t,T+1)}function X(){return"f"===t&&(A.push(t),r=t,T+=1),/[eE]/.test(t)?(A.push(t),r=t,T+1):("-"!==t&&"+"!==t||!/[eE]/.test(r))&&/[^\d]/.test(t)?(N(A.join("")),S=l,T):(A.push(t),r=t,T+1)}function K(){if(/[^\d\w_]/.test(t)){var e=A.join("");return S=j[e]?y:F[e]?g:m,N(A.join("")),S=l,T}return A.push(t),r=t,T+1}};var n=r(399),i=r(9746),a=r(9525),o=r(9458),s=r(3585),l=999,u=9999,c=0,f=1,d=2,p=3,h=4,v=5,m=6,g=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3585:function(e,t,r){var n=r(9525);n=n.slice().filter((function(e){return!/^(gl\_|texture)/.test(e)})),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},9525:function(e){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},9458:function(e,t,r){var n=r(399);e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},399:function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},9746:function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},8096:function(e,t,r){var n=r(3193);e.exports=function(e,t){var r=n(t),i=[];return i=(i=i.concat(r(e))).concat(r(null))}},6832:function(e){e.exports=function(e){"string"===typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n0;)for(var s=(e=o.pop()).adjacent,l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;f<=r;++f){var d=c[f];i[f]=d<0?t:a[d]}var p=this.orient();if(p>0)return u;u.lastVisited=-n,0===p&&o.push(u)}}return null},c.walk=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=t?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];e:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];for(s.lastVisited=r,c=0;c<=n;++c){var f=u[c];if(!(f.lastVisited>=r)){var d=a[c];a[c]=e;var p=this.orient();if(a[c]=d,p<0){s=f;continue e}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},c.addPeaks=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[t];t.lastVisited=r,t.vertices[t.vertices.indexOf(-1)]=r,t.boundary=!1,u.push(t);for(var d=[];f.length>0;){var p=(t=f.pop()).vertices,h=t.adjacent,v=p.indexOf(r);if(!(v<0))for(var m=0;m<=n;++m)if(m!==v){var g=h[m];if(g.boundary&&!(g.lastVisited>=r)){var y=g.vertices;if(g.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=e):l[b]=i[y[b]];if(this.orient()>0){y[x]=r,g.boundary=!1,u.push(g),f.push(g),g.lastVisited=r;continue}g.lastVisited=-r}var _=g.adjacent,w=p.slice(),k=h.slice(),T=new a(w,k,!0);c.push(T);var M=_.indexOf(t);if(!(M<0))for(_[M]=T,k[v]=g,w[m]=-1,k[m]=t,h[m]=T,T.flip(),b=0;b<=n;++b){var S=w[b];if(!(S<0||S===r)){for(var A=new Array(n-1),C=0,E=0;E<=n;++E){var P=w[E];P<0||E===b||(A[C++]=P)}d.push(new o(A,T,b))}}}}}for(d.sort(s),m=0;m+1=0?o[l++]=s[c]:u=1&c;if(u===(1&e)){var f=o[0];o[0]=o[1],o[1]=f}t.push(o)}}return t}},9014:function(e,t,r){"use strict";var n=r(5070);function i(e,t,r,n,i){this.mid=e,this.left=t,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(t?t.count:0)+(r?r.count:0)+n.length}e.exports=function(e){return e&&0!==e.length?new g(m(e)):new g(null)};var a=i.prototype;function o(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function s(e,t){var r=m(t);e.mid=r.mid,e.left=r.left,e.right=r.right,e.leftPoints=r.leftPoints,e.rightPoints=r.rightPoints,e.count=r.count}function l(e,t){var r=e.intervals([]);r.push(t),s(e,r)}function u(e,t){var r=e.intervals([]),n=r.indexOf(t);return n<0?0:(r.splice(n,1),s(e,r),1)}function c(e,t,r){for(var n=0;n=0&&e[n][1]>=t;--n){var i=r(e[n]);if(i)return i}}function d(e,t){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(t+1)?l(this,e):this.left.insert(e):this.left=m([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?l(this,e):this.right.insert(e):this.right=m([e]);else{var r=n.ge(this.leftPoints,e,h),i=n.ge(this.rightPoints,e,v);this.leftPoints.splice(r,0,e),this.rightPoints.splice(i,0,e)}},a.remove=function(e){var t=this.count-this.leftPoints;if(e[1]3*(t-1)?u(this,e):2===(s=this.left.remove(e))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(e[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(t-1)?u(this,e):2===(s=this.right.remove(e))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===e?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===e){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,e,h);athis.mid?this.right&&(r=this.right.queryPoint(e,t))?r:f(this.rightPoints,e,t):d(this.leftPoints,t);var r},a.queryInterval=function(e,t,r){var n;return ethis.mid&&this.right&&(n=this.right.queryInterval(e,t,r))?n:tthis.mid?f(this.rightPoints,e,r):d(this.leftPoints,r)};var y=g.prototype;y.insert=function(e){this.root?this.root.insert(e):this.root=new i(e[0],null,null,[e],[e])},y.remove=function(e){if(this.root){var t=this.root.remove(e);return 2===t&&(this.root=null),0!==t}return!1},y.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},y.queryInterval=function(e,t,r){if(e<=t&&this.root)return this.root.queryInterval(e,t,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9560:function(e){"use strict";e.exports=function(e){for(var t=new Array(e),r=0;r13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},3578:function(e){e.exports=function(e,t,r){return e*(1-r)+t*r}},7191:function(e,t,r){var n=r(4690),i=r(9823),a=r(7332),o=r(7787),s=r(7437),l=r(2142),u={length:r(4693),normalize:r(899),dot:r(9305),cross:r(903)},c=i(),f=i(),d=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],h=[0,0,0];function v(e,t,r,n,i){e[0]=t[0]*n+r[0]*i,e[1]=t[1]*n+r[1]*i,e[2]=t[2]*n+r[2]*i}e.exports=function(e,t,r,i,m,g){if(t||(t=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),m||(m=[0,0,0,1]),g||(g=[0,0,0,1]),!n(c,e))return!1;if(a(f,c),f[3]=0,f[7]=0,f[11]=0,f[15]=1,Math.abs(o(f)<1e-8))return!1;var y,x,b=c[3],_=c[7],w=c[11],k=c[12],T=c[13],M=c[14],S=c[15];if(0!==b||0!==_||0!==w){if(d[0]=b,d[1]=_,d[2]=w,d[3]=S,!s(f,f))return!1;l(f,f),function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o}(m,d,f)}else m[0]=m[1]=m[2]=0,m[3]=1;if(t[0]=k,t[1]=T,t[2]=M,x=c,(y=p)[0][0]=x[0],y[0][1]=x[1],y[0][2]=x[2],y[1][0]=x[4],y[1][1]=x[5],y[1][2]=x[6],y[2][0]=x[8],y[2][1]=x[9],y[2][2]=x[10],r[0]=u.length(p[0]),u.normalize(p[0],p[0]),i[0]=u.dot(p[0],p[1]),v(p[1],p[1],p[0],1,-i[0]),r[1]=u.length(p[1]),u.normalize(p[1],p[1]),i[0]/=r[1],i[1]=u.dot(p[0],p[2]),v(p[2],p[2],p[0],1,-i[1]),i[2]=u.dot(p[1],p[2]),v(p[2],p[2],p[1],1,-i[2]),r[2]=u.length(p[2]),u.normalize(p[2],p[2]),i[1]/=r[2],i[2]/=r[2],u.cross(h,p[1],p[2]),u.dot(p[0],h)<0)for(var A=0;A<3;A++)r[A]*=-1,p[A][0]*=-1,p[A][1]*=-1,p[A][2]*=-1;return g[0]=.5*Math.sqrt(Math.max(1+p[0][0]-p[1][1]-p[2][2],0)),g[1]=.5*Math.sqrt(Math.max(1-p[0][0]+p[1][1]-p[2][2],0)),g[2]=.5*Math.sqrt(Math.max(1-p[0][0]-p[1][1]+p[2][2],0)),g[3]=.5*Math.sqrt(Math.max(1+p[0][0]+p[1][1]+p[2][2],0)),p[2][1]>p[1][2]&&(g[0]=-g[0]),p[0][2]>p[2][0]&&(g[1]=-g[1]),p[1][0]>p[0][1]&&(g[2]=-g[2]),!0}},4690:function(e){e.exports=function(e,t){var r=t[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)e[i]=t[i]*n;return!0}},7649:function(e,t,r){var n=r(1868),i=r(1102),a=r(7191),o=r(7787),s=r(1116),l=f(),u=f(),c=f();function f(){return{translate:d(),scale:d(1),skew:d(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function d(e){return[e||0,e||0,e||0]}e.exports=function(e,t,r,f){if(0===o(t)||0===o(r))return!1;var d=a(t,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!d||!p)&&(n(c.translate,l.translate,u.translate,f),n(c.skew,l.skew,u.skew,f),n(c.scale,l.scale,u.scale,f),n(c.perspective,l.perspective,u.perspective,f),s(c.quaternion,l.quaternion,u.quaternion,f),i(e,c.translate,c.scale,c.skew,c.perspective,c.quaternion),!0)}},1102:function(e,t,r){var n={identity:r(9947),translate:r(998),multiply:r(104),create:r(9823),scale:r(3668),fromRotationTranslation:r(7280)},i=(n.create(),n.create());e.exports=function(e,t,r,a,o,s){return n.identity(e),n.fromRotationTranslation(e,s,t),e[3]=o[0],e[7]=o[1],e[11]=o[2],e[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(e,e,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(e,e,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(e,e,i)),n.scale(e,e,r),e}},9298:function(e,t,r){"use strict";var n=r(5070),i=r(7649),a=r(7437),o=r(6109),s=r(7115),l=r(5240),u=r(3012),c=r(998),f=(r(3668),r(899)),d=[0,0,0];function p(e){this._components=e.slice(),this._time=[0],this.prevMatrix=e.slice(),this.nextMatrix=e.slice(),this.computedMatrix=e.slice(),this.computedInverse=e.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}e.exports=function(e){return new p((e=e||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var h=p.prototype;h.recalcMatrix=function(e){var t=this._time,r=n.le(t,e),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===t.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{var c=t[r+1]-t[r],d=(l=16*r,this.prevMatrix),p=!0;for(u=0;u<16;++u)d[u]=s[l++];var h=this.nextMatrix;for(u=0;u<16;++u)h[u]=s[l++],p=p&&d[u]===h[u];if(c<1e-6||p)for(u=0;u<16;++u)o[u]=d[u];else i(o,d,h,(e-t[r])/c)}var v=this.computedUp;v[0]=o[1],v[1]=o[5],v[2]=o[9],f(v,v);var m=this.computedInverse;a(m,o);var g=this.computedEye,y=m[15];g[0]=m[12]/y,g[1]=m[13]/y,g[2]=m[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(u=0;u<3;++u)x[u]=g[u]-o[2+4*u]*b}},h.idle=function(e){if(!(e1&&n(e[o[c-2]],e[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(e[s[c-2]],e[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var f=0,d=(i=0,o.length);i0;--p)r[f++]=s[p];return r};var n=r(417)[3]},6145:function(e,t,r){"use strict";e.exports=function(e,t){t||(t=e,e=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function u(e,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||u!==i||c!==a||l(s))&&(r=0|e,i=u||0,a=c||0,t&&t(r,i,a,o))}function c(e){u(0,e)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function d(e){l(e)&&t&&t(r,i,a,o)}function p(e){0===n.buttons(e)?u(0,e):u(r,e)}function h(e){u(r|n.buttons(e),e)}function v(e){u(r&~n.buttons(e),e)}function m(){s||(s=!0,e.addEventListener("mousemove",p),e.addEventListener("mousedown",h),e.addEventListener("mouseup",v),e.addEventListener("mouseleave",c),e.addEventListener("mouseenter",c),e.addEventListener("mouseout",c),e.addEventListener("mouseover",c),e.addEventListener("blur",f),e.addEventListener("keyup",d),e.addEventListener("keydown",d),e.addEventListener("keypress",d),e!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",d),window.addEventListener("keydown",d),window.addEventListener("keypress",d)))}m();var g={element:e};return Object.defineProperties(g,{enabled:{get:function(){return s},set:function(t){t?m():s&&(s=!1,e.removeEventListener("mousemove",p),e.removeEventListener("mousedown",h),e.removeEventListener("mouseup",v),e.removeEventListener("mouseleave",c),e.removeEventListener("mouseenter",c),e.removeEventListener("mouseout",c),e.removeEventListener("mouseover",c),e.removeEventListener("blur",f),e.removeEventListener("keyup",d),e.removeEventListener("keydown",d),e.removeEventListener("keypress",d),e!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",d),window.removeEventListener("keydown",d),window.removeEventListener("keypress",d)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),g};var n=r(4110)},2565:function(e){var t={left:0,top:0};e.exports=function(e,r,n){r=r||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=e.clientX||0,o=e.clientY||0,s=(i=r)===window||i===document||i===document.body?t:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},4110:function(e,t){"use strict";function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"===typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<=0)return 1< 0"),"function"!==typeof e.vertex&&t("Must specify vertex creation function"),"function"!==typeof e.cell&&t("Must specify cell creation function"),"function"!==typeof e.phase&&t("Must specify phase function");for(var s=e.getters||[],l=new Array(a),u=0;u=0?l[u]=!0:l[u]=!1;return function(e,t,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(e,t,r,n.mallocUint32,n.freeUint32)}(e.vertex,e.cell,e.phase,0,r,l)};var i={"false,0,1":function(e,t,r,n,i){return function(a,o,s,l){var u,c=0|a.shape[0],f=0|a.shape[1],d=a.data,p=0|a.offset,h=0|a.stride[0],v=0|a.stride[1],m=p,g=0|-h,y=0,x=0|-v,b=0,_=-h-v|0,w=0,k=0|h,T=v-h*c|0,M=0,S=0,A=0,C=2*c|0,E=n(C),P=n(C),L=0,I=0,R=-1,O=-1,D=0,z=0|-c,F=0|c,j=0,N=-c-1|0,Z=c-1|0,B=0,V=0,U=0;for(M=0;M0){if(S=1,E[L++]=r(d[m],o,s,l),m+=k,c>0)for(M=1,u=d[m],I=E[L]=r(u,o,s,l),D=E[L+R],j=E[L+z],B=E[L+N],I===D&&I===j&&I===B||(y=d[m+g],b=d[m+x],w=d[m+_],e(M,S,u,y,b,w,I,D,j,B,o,s,l),V=P[L]=A++),L+=1,m+=k,M=2;M0)for(M=1,u=d[m],I=E[L]=r(u,o,s,l),D=E[L+R],j=E[L+z],B=E[L+N],I===D&&I===j&&I===B||(y=d[m+g],b=d[m+x],w=d[m+_],e(M,S,u,y,b,w,I,D,j,B,o,s,l),V=P[L]=A++,B!==j&&t(P[L+z],V,b,w,j,B,o,s,l)),L+=1,m+=k,M=2;M0){if(M=1,E[L++]=r(d[m],o,s,l),m+=k,f>0)for(S=1,u=d[m],I=E[L]=r(u,o,s,l),j=E[L+z],D=E[L+R],B=E[L+N],I===j&&I===D&&I===B||(y=d[m+g],b=d[m+x],w=d[m+_],e(M,S,u,y,b,w,I,j,D,B,o,s,l),V=P[L]=A++),L+=1,m+=k,S=2;S0)for(S=1,u=d[m],I=E[L]=r(u,o,s,l),j=E[L+z],D=E[L+R],B=E[L+N],I===j&&I===D&&I===B||(y=d[m+g],b=d[m+x],w=d[m+_],e(M,S,u,y,b,w,I,j,D,B,o,s,l),V=P[L]=A++,B!==j&&t(P[L+z],V,w,y,B,j,o,s,l)),L+=1,m+=k,S=2;S2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),e.pick(0,-1,1).lo(1).hi(a[1]-2)),t(e.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),e.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),t(e.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),e.pick(-1,0,0).lo(1).hi(a[0]-2)),t(e.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),e.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),t(e.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),e.set(0,0,0,0),e.set(0,0,1,0),e.set(a[0]-1,0,0,0),e.set(a[0]-1,0,1,0),e.set(0,a[1]-1,0,0),e.set(0,a[1]-1,1,0),e.set(a[0]-1,a[1]-1,0,0),e.set(a[0]-1,a[1]-1,1,0),e}}e.exports=function(e,t,r){return Array.isArray(r)||(r=n(t.dimension,"string"===typeof r?r:"clamp")),0===t.size?e:0===t.dimension?(e.set(0),e):function(e){var t=e.join();if(a=c[t])return a;for(var r=e.length,n=[f,d],i=1;i<=r;++i)n.push(p(i));var a=h.apply(void 0,n);return c[t]=a,a}(r)(e,t)}},3581:function(e){"use strict";function t(e,t){var r=Math.floor(t),n=t-r,i=0<=r&&r0;){x<64?(l=x,x=0):(l=64,x-=64);for(var b=0|e[1];b>0;){b<64?(u=b,b=0):(u=64,b-=64),n=g+x*f+b*d,o=y+x*h+b*v;var _=0,w=0,k=0,T=p,M=f-c*p,S=d-l*f,A=m,C=h-c*m,E=v-l*h;for(k=0;k0;){v<64?(l=v,v=0):(l=64,v-=64);for(var m=0|e[0];m>0;){m<64?(s=m,m=0):(s=64,m-=64),n=p+v*c+m*u,o=h+v*d+m*f;var g=0,y=0,x=c,b=u-l*c,_=d,w=f-l*d;for(y=0;y0;){y<64?(u=y,y=0):(u=64,y-=64);for(var x=0|e[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var b=0|e[1];b>0;){b<64?(l=b,b=0):(l=64,b-=64),n=m+y*d+x*c+b*f,o=g+y*v+x*p+b*h;var _=0,w=0,k=0,T=d,M=c-u*d,S=f-s*c,A=v,C=p-u*v,E=h-s*p;for(k=0;kr;){g=0,y=v-o;t:for(m=0;mb)break t;y+=f,g+=d}for(g=v,y=v-o,m=0;m>1,H=U-Z,W=U+Z,G=B,q=H,Y=U,X=W,K=V,$=i+1,J=a-1,Q=!0,ee=0,te=0,re=0,ne=f,ie=t(ne),ae=t(ne);M=l*G,S=l*q,N=s;e:for(T=0;T0){m=G,G=q,q=m;break e}if(re<0)break e;N+=p}M=l*X,S=l*K,N=s;e:for(T=0;T0){m=X,X=K,K=m;break e}if(re<0)break e;N+=p}M=l*G,S=l*Y,N=s;e:for(T=0;T0){m=G,G=Y,Y=m;break e}if(re<0)break e;N+=p}M=l*q,S=l*Y,N=s;e:for(T=0;T0){m=q,q=Y,Y=m;break e}if(re<0)break e;N+=p}M=l*G,S=l*X,N=s;e:for(T=0;T0){m=G,G=X,X=m;break e}if(re<0)break e;N+=p}M=l*Y,S=l*X,N=s;e:for(T=0;T0){m=Y,Y=X,X=m;break e}if(re<0)break e;N+=p}M=l*q,S=l*K,N=s;e:for(T=0;T0){m=q,q=K,K=m;break e}if(re<0)break e;N+=p}M=l*q,S=l*Y,N=s;e:for(T=0;T0){m=q,q=Y,Y=m;break e}if(re<0)break e;N+=p}M=l*X,S=l*K,N=s;e:for(T=0;T0){m=X,X=K,K=m;break e}if(re<0)break e;N+=p}for(M=l*G,S=l*q,A=l*Y,C=l*X,E=l*K,P=l*B,L=l*U,I=l*V,j=0,N=s,T=0;T0)){if(re<0){for(M=l*b,S=l*$,A=l*J,N=s,T=0;T0)for(;;){for(_=s+J*l,j=0,T=0;T0)){for(_=s+J*l,j=0,T=0;TV){e:for(;;){for(_=s+$*l,j=0,N=s,T=0;T1&&n?s(r,n[0],n[1]):s(r)}(e,t,l);return n(l,u)}},8729:function(e,t,r){"use strict";var n=r(8139),i={};e.exports=function(e){var t=e.order,r=e.dtype,a=[t,r].join(":"),o=i[a];return o||(i[a]=o=n(t,r)),o(e),e}},5050:function(e,t,r){var n=r(4780),i="undefined"!==typeof Float64Array;function a(e,t){return e[0]-t[0]}function o(){var e,t=this.stride,r=new Array(t.length);for(e=0;e=0&&(t+=a*(r=0|e),i-=r),new n(this.data,i,a,t)},i.step=function(e){var t=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"===typeof e&&((a=0|e)<0?(i+=r*(t-1),t=o(-t/a)):t=o(t/a),r*=a),new n(this.data,t,r,i)},i.transpose=function(e){e=void 0===e?0:0|e;var t=this.shape,r=this.stride;return new n(this.data,t[e],r[e],this.offset)},i.pick=function(e){var r=[],n=[],i=this.offset;return"number"===typeof e&&e>=0?i=i+this.stride[0]*e|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,t[r.length+1])(this.data,r,n,i)},function(e,t,r,i){return new n(e,t[0],r[0],i)}},2:function(e,t,r){function n(e,t,r,n,i,a){this.data=e,this.shape=[t,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=e,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(t,r,n){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]=n},i.get=function(t,r){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]},i.index=function(e,t){return this.offset+this.stride[0]*e+this.stride[1]*t},i.hi=function(e,t){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,this.stride[0],this.stride[1],this.offset)},i.lo=function(e,t){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"===typeof e&&e>=0&&(r+=s*(i=0|e),a-=i),"number"===typeof t&&t>=0&&(r+=l*(i=0|t),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(e,t){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,u=Math.ceil;return"number"===typeof e&&((l=0|e)<0?(s+=a*(r-1),r=u(-r/l)):r=u(r/l),a*=l),"number"===typeof t&&((l=0|t)<0?(s+=o*(i-1),i=u(-i/l)):i=u(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(e,t){e=void 0===e?0:0|e,t=void 0===t?1:0|t;var r=this.shape,i=this.stride;return new n(this.data,r[e],r[t],i[e],i[t],this.offset)},i.pick=function(e,r){var n=[],i=[],a=this.offset;return"number"===typeof e&&e>=0?a=a+this.stride[0]*e|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"===typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,t[n.length+1])(this.data,n,i,a)},function(e,t,r,i){return new n(e,t[0],t[1],r[0],r[1],i)}},3:function(e,t,r){function n(e,t,r,n,i,a,o,s){this.data=e,this.shape=[t,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=e,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var e=Math.abs(this.stride[0]),t=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return e>t?t>r?[2,1,0]:e>r?[1,2,0]:[1,0,2]:e>r?[2,0,1]:r>t?[0,1,2]:[0,2,1]}}),i.set=function(t,r,n,i){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(t,r,n){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]},i.index=function(e,t,r){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r},i.hi=function(e,t,r){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(e,t,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.stride[0],c=this.stride[1],f=this.stride[2];return"number"===typeof e&&e>=0&&(i+=u*(a=0|e),o-=a),"number"===typeof t&&t>=0&&(i+=c*(a=0|t),s-=a),"number"===typeof r&&r>=0&&(i+=f*(a=0|r),l-=a),new n(this.data,o,s,l,u,c,f,i)},i.step=function(e,t,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],u=this.stride[2],c=this.offset,f=0,d=Math.ceil;return"number"===typeof e&&((f=0|e)<0?(c+=s*(i-1),i=d(-i/f)):i=d(i/f),s*=f),"number"===typeof t&&((f=0|t)<0?(c+=l*(a-1),a=d(-a/f)):a=d(a/f),l*=f),"number"===typeof r&&((f=0|r)<0?(c+=u*(o-1),o=d(-o/f)):o=d(o/f),u*=f),new n(this.data,i,a,o,s,l,u,c)},i.transpose=function(e,t,r){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[e],i[t],i[r],a[e],a[t],a[r],this.offset)},i.pick=function(e,r,n){var i=[],a=[],o=this.offset;return"number"===typeof e&&e>=0?o=o+this.stride[0]*e|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"===typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"===typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,t[i.length+1])(this.data,i,a,o)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],r[0],r[1],r[2],i)}},4:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,u){this.data=e,this.shape=[t,r,n,i],this.stride=[a,o,s,l],this.offset=0|u}var i=n.prototype;return i.dtype=e,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(t,r,n,i){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(e,t,r,n){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n},i.hi=function(e,t,r,i){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(e,t,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],u=this.shape[2],c=this.shape[3],f=this.stride[0],d=this.stride[1],p=this.stride[2],h=this.stride[3];return"number"===typeof e&&e>=0&&(a+=f*(o=0|e),s-=o),"number"===typeof t&&t>=0&&(a+=d*(o=0|t),l-=o),"number"===typeof r&&r>=0&&(a+=p*(o=0|r),u-=o),"number"===typeof i&&i>=0&&(a+=h*(o=0|i),c-=o),new n(this.data,s,l,u,c,f,d,p,h,a)},i.step=function(e,t,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],u=this.stride[0],c=this.stride[1],f=this.stride[2],d=this.stride[3],p=this.offset,h=0,v=Math.ceil;return"number"===typeof e&&((h=0|e)<0?(p+=u*(a-1),a=v(-a/h)):a=v(a/h),u*=h),"number"===typeof t&&((h=0|t)<0?(p+=c*(o-1),o=v(-o/h)):o=v(o/h),c*=h),"number"===typeof r&&((h=0|r)<0?(p+=f*(s-1),s=v(-s/h)):s=v(s/h),f*=h),"number"===typeof i&&((h=0|i)<0?(p+=d*(l-1),l=v(-l/h)):l=v(l/h),d*=h),new n(this.data,a,o,s,l,u,c,f,d,p)},i.transpose=function(e,t,r,i){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[e],a[t],a[r],a[i],o[e],o[t],o[r],o[i],this.offset)},i.pick=function(e,r,n,i){var a=[],o=[],s=this.offset;return"number"===typeof e&&e>=0?s=s+this.stride[0]*e|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"===typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"===typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"===typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,t[a.length+1])(this.data,a,o,s)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],r[0],r[1],r[2],r[3],i)}},5:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,u,c,f){this.data=e,this.shape=[t,r,n,i,a],this.stride=[o,s,l,u,c],this.offset=0|f}var i=n.prototype;return i.dtype=e,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a,o){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(t,r,n,i,a){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(e,t,r,n,i){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(e,t,r,i,a){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,"number"!==typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(e,t,r,i,a){var o=this.offset,s=0,l=this.shape[0],u=this.shape[1],c=this.shape[2],f=this.shape[3],d=this.shape[4],p=this.stride[0],h=this.stride[1],v=this.stride[2],m=this.stride[3],g=this.stride[4];return"number"===typeof e&&e>=0&&(o+=p*(s=0|e),l-=s),"number"===typeof t&&t>=0&&(o+=h*(s=0|t),u-=s),"number"===typeof r&&r>=0&&(o+=v*(s=0|r),c-=s),"number"===typeof i&&i>=0&&(o+=m*(s=0|i),f-=s),"number"===typeof a&&a>=0&&(o+=g*(s=0|a),d-=s),new n(this.data,l,u,c,f,d,p,h,v,m,g,o)},i.step=function(e,t,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.shape[3],c=this.shape[4],f=this.stride[0],d=this.stride[1],p=this.stride[2],h=this.stride[3],v=this.stride[4],m=this.offset,g=0,y=Math.ceil;return"number"===typeof e&&((g=0|e)<0?(m+=f*(o-1),o=y(-o/g)):o=y(o/g),f*=g),"number"===typeof t&&((g=0|t)<0?(m+=d*(s-1),s=y(-s/g)):s=y(s/g),d*=g),"number"===typeof r&&((g=0|r)<0?(m+=p*(l-1),l=y(-l/g)):l=y(l/g),p*=g),"number"===typeof i&&((g=0|i)<0?(m+=h*(u-1),u=y(-u/g)):u=y(u/g),h*=g),"number"===typeof a&&((g=0|a)<0?(m+=v*(c-1),c=y(-c/g)):c=y(c/g),v*=g),new n(this.data,o,s,l,u,c,f,d,p,h,v,m)},i.transpose=function(e,t,r,i,a){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[e],o[t],o[r],o[i],o[a],s[e],s[t],s[r],s[i],s[a],this.offset)},i.pick=function(e,r,n,i,a){var o=[],s=[],l=this.offset;return"number"===typeof e&&e>=0?l=l+this.stride[0]*e|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"===typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"===typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"===typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"===typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,t[o.length+1])(this.data,o,s,l)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],t[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(e,t){var r=-1===t?"T":String(t),n=s[r];return-1===t?n(e):0===t?n(e,u[e][0]):n(e,u[e],o)}var u={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(e,t,r,a){if(void 0===e)return(0,u.array[0])([]);"number"===typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var o=t.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=t[s]}if(void 0===a)for(a=0,s=0;s>>0;e.exports=function(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(0===e)return t<0?-i:i;var r=n.hi(e),o=n.lo(e);return t>e===e>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},115:function(e,t){t.vertexNormals=function(e,t,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var b=i[u],_=1/Math.sqrt(m*y);for(x=0;x<3;++x){var w=(x+1)%3,k=(x+2)%3;b[x]+=_*(g[w]*v[k]-g[k]*v[w])}}}for(o=0;oa)for(_=1/Math.sqrt(T),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},t.faceNormals=function(e,t,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(p):0,u=0;u<3;++u)d[u]*=p;i[o]=d}return i}},567:function(e){"use strict";e.exports=function(e,t,r,n,i,a,o,s,l,u){var c=t+a+u;if(f>0){var f=Math.sqrt(c+1);e[0]=.5*(o-l)/f,e[1]=.5*(s-n)/f,e[2]=.5*(r-a)/f,e[3]=.5*f}else{var d=Math.max(t,a,u);f=Math.sqrt(2*d-c+1),t>=d?(e[0]=.5*f,e[1]=.5*(i+r)/f,e[2]=.5*(s+n)/f,e[3]=.5*(o-l)/f):a>=d?(e[0]=.5*(r+i)/f,e[1]=.5*f,e[2]=.5*(l+o)/f,e[3]=.5*(s-n)/f):(e[0]=.5*(n+s)/f,e[1]=.5*(o+l)/f,e[2]=.5*f,e[3]=.5*(r-i)/f)}return e}},7774:function(e,t,r){"use strict";e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.rotation||[0,0,0,1],n=e.radius||1;t=[].slice.call(t,0,3),c(r=[].slice.call(r,0,4),r);var i=new f(r,t,Math.log(n));return i.setDistanceLimits(e.zoomMin,e.zoomMax),("eye"in e||"up"in e)&&i.lookAt(0,e.eye,e.center,e.up),i};var n=r(8444),i=r(3012),a=r(5950),o=r(7437),s=r(567);function l(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function u(e,t,r,n){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2)+Math.pow(n,2))}function c(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=u(r,n,i,a);o>1e-6?(e[0]=r/o,e[1]=n/o,e[2]=i/o,e[3]=a/o):(e[0]=e[1]=e[2]=0,e[3]=1)}function f(e,t,r){this.radius=n([r]),this.center=n(t),this.rotation=n(e),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var d=f.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(e){this.radius.curve(e),this.center.curve(e),this.rotation.curve(e);var t=this.computedRotation;c(t,t);var r=this.computedMatrix;a(r,t);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,f=0;f<3;++f)u+=r[l+4*f]*i[f];r[12+l]=-u}},d.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r},d.idle=function(e){this.center.idle(e),this.radius.idle(e),this.rotation.idle(e)},d.flush=function(e){this.center.flush(e),this.radius.flush(e),this.rotation.flush(e)},d.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],u=l(a,o,s);a/=u,o/=u,s/=u;var c=i[0],f=i[4],d=i[8],p=c*a+f*o+d*s,h=l(c-=a*p,f-=o*p,d-=s*p);c/=h,f/=h,d/=h;var v=i[2],m=i[6],g=i[10],y=v*a+m*o+g*s,x=v*c+m*f+g*d,b=l(v-=y*a+x*c,m-=y*o+x*f,g-=y*s+x*d);v/=b,m/=b,g/=b;var _=c*t+a*r,w=f*t+o*r,k=d*t+s*r;this.center.move(e,_,w,k);var T=Math.exp(this.computedRadius[0]);T=Math.max(1e-4,T+n),this.radius.set(e,Math.log(T))},d.rotate=function(e,t,r,n){this.recalcMatrix(e),t=t||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],c=i[1],f=i[5],d=i[9],p=i[2],h=i[6],v=i[10],m=t*a+r*c,g=t*o+r*f,y=t*s+r*d,x=-(h*y-v*g),b=-(v*m-p*y),_=-(p*g-h*m),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),k=u(x,b,_,w);k>1e-6?(x/=k,b/=k,_/=k,w/=k):(x=b=_=0,w=1);var T=this.computedRotation,M=T[0],S=T[1],A=T[2],C=T[3],E=M*w+C*x+S*_-A*b,P=S*w+C*b+A*x-M*_,L=A*w+C*_+M*b-S*x,I=C*w-M*x-S*b-A*_;if(n){x=p,b=h,_=v;var R=Math.sin(n)/l(x,b,_);x*=R,b*=R,_*=R,I=I*(w=Math.cos(t))-(E=E*w+I*x+P*_-L*b)*x-(P=P*w+I*b+L*x-E*_)*b-(L=L*w+I*_+E*b-P*x)*_}var O=u(E,P,L,I);O>1e-6?(E/=O,P/=O,L/=O,I/=O):(E=P=L=0,I=1),this.rotation.set(e,E,P,L,I)},d.lookAt=function(e,t,r,n){this.recalcMatrix(e),r=r||this.computedCenter,t=t||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,t,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),c(o,o),this.rotation.set(e,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-t[u],2);this.radius.set(e,.5*Math.log(Math.max(l,1e-6))),this.center.set(e,r[0],r[1],r[2])},d.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},d.setMatrix=function(e,t){var r=this.computedRotation;s(r,t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]),c(r,r),this.rotation.set(e,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,t);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,u=n[14]/i;this.recalcMatrix(e);var f=Math.exp(this.computedRadius[0]);this.center.set(e,a-n[2]*f,l-n[6]*f,u-n[10]*f),this.radius.idle(e)}else this.center.idle(e),this.radius.idle(e)},d.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},d.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},d.getDistanceLimits=function(e){var t=this.radius.bounds;return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(e){var t=this.lastT(),r=e.center;r&&this.center.set(t,r[0],r[1],r[2]);var n=e.rotation;n&&this.rotation.set(t,n[0],n[1],n[2],n[3]);var i=e.distance;i&&i>0&&this.radius.set(t,Math.log(i)),this.setDistanceLimits(e.zoomMin,e.zoomMax)}},4930:function(e,t,r){"use strict";var n=r(6184);e.exports=function(e,t,r){return n(r="undefined"!==typeof r?r+"":" ",t)+e}},4405:function(e){e.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},4166:function(e,t,r){"use strict";e.exports=function(e,t){for(var r=0|t.length,i=e.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var d=a[f][r],p=0;p0&&(o=h,s=v,l=f)}return i||o&&u(o,l),s}function f(e,r){var i=a[r][e][0],o=[e];u(i,r);for(var s=i[1^r];;){for(;s!==e;)o.push(s),s=c(o[o.length-2],s,!1);if(a[0][e].length+a[1][e].length===0)break;var l=o[o.length-1],f=e,d=o[1],p=c(l,f,!0);if(n(t[l],t[f],t[d],t[p])<0)break;o.push(e),s=c(l,f)}return o}function d(e,t){return t[1]===t[t.length-1]}for(o=0;o0;){a[0][o].length;var v=f(o,p);d(0,v)?h.push.apply(h,v):(h.length>0&&l.push(h),h=v)}h.length>0&&l.push(h)}return l};var n=r(9398)},3959:function(e,t,r){"use strict";e.exports=function(e,t){for(var r=n(e,t.length),i=new Array(t.length),a=new Array(t.length),o=[],s=0;s0;){i[p=o.pop()]=!1;var u=r[p];for(s=0;s0}))).length,m=new Array(v),g=new Array(v);for(p=0;p0;){var j=z.pop(),N=C[j];l(N,(function(e,t){return e-t}));var Z,B=N.length,V=F[j];for(0===V&&(Z=[U=h[j]]),p=0;p=0||(F[H]=1^V,z.push(H),0===V&&(D(U=h[H])||(U.reverse(),Z.push(U))))}0===V&&r.push(Z)}return r};var n=r(8348),i=r(4166),a=r(211),o=r(9660),s=r(9662),l=r(1215),u=r(3959);function c(e,t){for(var r=new Array(e),n=0;n0&&t[i]===r[0]))return 1;a=e[i-1]}for(var s=1;a;){var l=a.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(u>0)a=a.left;else{if(!(u<0))return 0;s=1,a=a.right}}return s}}(g.slabs,g.coordinates);return 0===a.length?y:function(e,t){return function(r){return e(r[0],r[1])?0:t(r)}}(l(a),y)};var n=r(417)[3],i=r(4385),a=r(9014),o=r(5070);function s(){return!0}function l(e){for(var t={},r=0;r=u?(T=1,y=u+2*d+h):y=d*(T=-d/u)+h):(T=0,p>=0?(M=0,y=h):-p>=f?(M=1,y=f+2*p+h):y=p*(M=-p/f)+h);else if(M<0)M=0,d>=0?(T=0,y=h):-d>=u?(T=1,y=u+2*d+h):y=d*(T=-d/u)+h;else{var S=1/k;y=(T*=S)*(u*T+c*(M*=S)+2*d)+M*(c*T+f*M+2*p)+h}else T<0?(b=f+p)>(x=c+d)?(_=b-x)>=(w=u-2*c+f)?(T=1,M=0,y=u+2*d+h):y=(T=_/w)*(u*T+c*(M=1-T)+2*d)+M*(c*T+f*M+2*p)+h:(T=0,b<=0?(M=1,y=f+2*p+h):p>=0?(M=0,y=h):y=p*(M=-p/f)+h):M<0?(b=u+d)>(x=c+p)?(_=b-x)>=(w=u-2*c+f)?(M=1,T=0,y=f+2*p+h):y=(T=1-(M=_/w))*(u*T+c*M+2*d)+M*(c*T+f*M+2*p)+h:(M=0,b<=0?(T=1,y=u+2*d+h):d>=0?(T=0,y=h):y=d*(T=-d/u)+h):(_=f+p-c-d)<=0?(T=0,M=1,y=f+2*p+h):_>=(w=u-2*c+f)?(T=1,M=0,y=u+2*d+h):y=(T=_/w)*(u*T+c*(M=1-T)+2*d)+M*(c*T+f*M+2*p)+h;var A=1-T-M;for(l=0;l0){var u=e[r-1];if(0===n(s,u)&&a(u)!==l){r-=1;continue}}e[r++]=s}}return e.length=r,e}},6184:function(e){"use strict";var t,r="";e.exports=function(e,n){if("string"!==typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var i=e.length*n;if(t!==e||"undefined"===typeof t)t=e,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,i)}},8161:function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},402:function(e){"use strict";e.exports=function(e){for(var t=e.length,r=e[e.length-1],n=t,i=t-2;i>=0;--i){var a=r;(l=(s=e[i])-((r=a+s)-a))&&(e[--n]=r,r=l)}var o=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(e,t,r)},function(e,t,r,n){var i=e[0]-n[0],a=t[0]-n[0],o=r[0]-n[0],s=e[1]-n[1],l=t[1]-n[1],u=r[1]-n[1],c=e[2]-n[2],f=t[2]-n[2],p=r[2]-n[2],h=a*u,v=o*l,m=o*s,g=i*u,y=i*l,x=a*s,b=c*(h-v)+f*(m-g)+p*(y-x),_=7771561172376103e-31*((Math.abs(h)+Math.abs(v))*Math.abs(c)+(Math.abs(m)+Math.abs(g))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(p));return b>_||-b>_?b:d(e,t,r,n)}];function h(e){var t=p[e.length];return t||(t=p[e.length]=c(e.length)),t.apply(void 0,e)}function v(e,t,r,n,i,a,o){return function(t,r,s,l,u){switch(arguments.length){case 0:case 1:return 0;case 2:return n(t,r);case 3:return i(t,r,s);case 4:return a(t,r,s,l);case 5:return o(t,r,s,l,u)}for(var c=new Array(arguments.length),f=0;f0&&o>0||a<0&&o<0)return!1;var s=n(r,e,t),l=n(i,e,t);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(e,t,r,n){for(var i=0;i<2;++i){var a=e[i],o=t[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],f=Math.min(u,c);if(Math.max(u,c)=n?(i=f,(l+=1)=n?(i=f,(l+=1)>1,u=t[2*l+1];if(u===a)return l;a>1,u=t[2*l+1];if(u===a)return l;a>1,u=t[2*l+1];if(u===a)return l;a0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},6656:function(e,t,r){"use strict";var n=r(9392),i=r(9521);function a(e,t){var r=e.length,n=e.length-t.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:return(s=e[0]+e[1]-t[0]-t[1])||i(e[0],e[1])-i(t[0],t[1]);case 3:var a=e[0]+e[1],o=t[0]+t[1];if(s=a+e[2]-(o+t[2]))return s;var s,l=i(e[0],e[1]),u=i(t[0],t[1]);return(s=i(l,e[2])-i(u,t[2]))||i(l+e[2],a)-i(u+t[2],o);default:var c=e.slice(0);c.sort();var f=t.slice(0);f.sort();for(var d=0;d>1,s=a(e[o],t);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(e,t){for(var r=new Array(e.length),i=0,o=r.length;i=e.length||0!==a(e[m],s)););}return r}function f(e,t){if(t<0)return[];for(var r=[],i=(1<>>c&1&&u.push(i[c]);t.push(u)}return s(t)},t.skeleton=f,t.boundary=function(e){for(var t=[],r=0,n=e.length;r>1:(e>>1)-1}function x(e){for(var t=g(e);;){var r=t,n=2*e+1,i=2*(e+1),a=e;if(n0;){var r=y(e);if(!(r>=0&&t0){var e=T[0];return m(0,S-1),S-=1,x(0),e}return-1}function w(e,t){var r=T[e];return u[r]===t?e:(u[r]=-1/0,b(e),_(),u[r]=t,b((S+=1)-1))}function k(e){if(!c[e]){c[e]=!0;var t=s[e],r=l[e];s[r]>=0&&(s[r]=t),l[t]>=0&&(l[t]=r),M[t]>=0&&w(M[t],v(t)),M[r]>=0&&w(M[r],v(r))}}var T=[],M=new Array(a);for(f=0;f>1;f>=0;--f)x(f);for(;;){var A=_();if(A<0||u[A]>r)break;k(A)}var C=[];for(f=0;f=0&&r>=0&&t!==r){var n=M[t],i=M[r];n!==i&&P.push([n,i])}})),i.unique(i.normalize(P)),{positions:C,edges:P}};var n=r(417),i=r(6656)},6638:function(e,t,r){"use strict";e.exports=function(e,t){var r,a,o,s;if(t[0][0]t[1][0]))return i(t,e);r=t[1],a=t[0]}if(e[0][0]e[1][0]))return-i(e,t);o=e[1],s=e[0]}var l=n(r,a,s),u=n(r,a,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,a),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return a[0]-s[0]};var n=r(417);function i(e,t){var r,i,a,o;if(t[0][0]t[1][0])){var s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]),u=Math.min(t[0][1],t[1][1]),c=Math.max(t[0][1],t[1][1]);return lc?s-c:l-c}r=t[1],i=t[0]}e[0][1]0)if(t[0]!==o[1][0])r=e,e=e.right;else{if(l=u(e.right,t))return l;e=e.left}else{if(t[0]!==o[1][0])return e;var l;if(l=u(e.right,t))return l;e=e.left}}return r}function c(e,t,r,n){this.y=e,this.index=t,this.start=r,this.closed=n}function f(e,t,r,n){this.x=e,this.segment=t,this.create=r,this.index=n}s.prototype.castUp=function(e){var t=n.le(this.coordinates,e[0]);if(t<0)return-1;this.slabs[t];var r=u(this.slabs[t],e),i=-1;if(r&&(i=r.value),this.coordinates[t]===e[0]){var s=null;if(r&&(s=r.key),t>0){var c=u(this.slabs[t-1],e);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var f=this.horizontal[t];if(f.length>0){var d=n.ge(f,e[1],l);if(d=f.length)return i;p=f[d]}}if(p.start)if(s){var h=a(s[0],s[1],[e[0],p.y]);s[0][0]>s[1][0]&&(h=-h),h>0&&(i=p.index)}else i=p.index;else p.y!==e[1]&&(i=p.index)}}}return i}},4670:function(e,t,r){"use strict";var n=r(9130),i=r(9662);function a(e,t){var r=i(n(e,t),[t[t.length-1]]);return r[r.length-1]}function o(e,t,r,n){var i=-t/(n-t);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=e.length,s=new Array(o),l=0;l0||i>0&&c<0){var f=o(s,c,l,i);r.push(f),n.push(f.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},e.exports.positive=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},e.exports.negative=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},8974:function(e,t,r){var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(e){return function(e,t){var r,n,o,s,l,u,c,f,d,p=1,h=e.length,v="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?v+=r:(!i.number.test(s.type)||f&&!s.sign?d="":(d=f?"+":"-",r=r.toString().replace(i.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(d+r).length,l=s.width&&c>0?u.repeat(c):"",v+=s.align?d+r+l:"0"===u?d+l+r:l+d+r)}return v}(function(e){if(s[e])return s[e];for(var t,r=e,n=[],a=0;r;){if(null!==(t=i.text.exec(r)))n.push(t[0]);else if(null!==(t=i.modulo.exec(r)))n.push("%");else{if(null===(t=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){a|=1;var o=[],l=t[2],u=[];if(null===(u=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=i.key_access.exec(l)))o.push(u[1]);else{if(null===(u=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}t[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return s[e]=n}(e),arguments)}function o(e,t){return a.apply(null,[e].concat(t||[]))}var s=Object.create(null);t.sprintf=a,t.vsprintf=o,"undefined"!==typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(t,r,t,e))||(e.exports=n))}()},4162:function(e,t,r){"use strict";e.exports=function(e,t){if(e.dimension<=0)return{positions:[],cells:[]};if(1===e.dimension)return function(e,t){for(var r=i(e,t),n=r.length,a=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(e,t,r,n,i,a,o,s,l,u,c,f,d){var p=(o<<0)+(s<<1)+(l<<2)+(u<<3)|0;if(0!==p&&15!==p)switch(p){case 0:case 15:c.push([e-.5,t-.5]);break;case 1:c.push([e-.25-.25*(n+r-2*d)/(r-n),t-.25-.25*(i+r-2*d)/(r-i)]);break;case 2:c.push([e-.75-.25*(-n-r+2*d)/(n-r),t-.25-.25*(a+n-2*d)/(n-a)]);break;case 3:c.push([e-.5,t-.5-.5*(i+r+a+n-4*d)/(r-i+n-a)]);break;case 4:c.push([e-.25-.25*(a+i-2*d)/(i-a),t-.75-.25*(-i-r+2*d)/(i-r)]);break;case 5:c.push([e-.5-.5*(n+r+a+i-4*d)/(r-n+i-a),t-.5]);break;case 6:c.push([e-.5-.25*(-n-r+a+i)/(n-r+i-a),t-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:c.push([e-.75-.25*(a+i-2*d)/(i-a),t-.75-.25*(a+n-2*d)/(n-a)]);break;case 8:c.push([e-.75-.25*(-a-i+2*d)/(a-i),t-.75-.25*(-a-n+2*d)/(a-n)]);break;case 9:c.push([e-.5-.25*(n+r+-a-i)/(r-n+a-i),t-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:c.push([e-.5-.5*(-n-r-a-i+4*d)/(n-r+a-i),t-.5]);break;case 11:c.push([e-.25-.25*(-a-i+2*d)/(a-i),t-.75-.25*(i+r-2*d)/(r-i)]);break;case 12:c.push([e-.5,t-.5-.5*(-i-r-a-n+4*d)/(i-r+a-n)]);break;case 13:c.push([e-.75-.25*(n+r-2*d)/(r-n),t-.25-.25*(-a-n+2*d)/(a-n)]);break;case 14:c.push([e-.25-.25*(-n-r+2*d)/(n-r),t-.25-.25*(-i-r+2*d)/(i-r)])}},cell:function(e,t,r,n,i,a,o,s,l){i?s.push([e,t]):s.push([t,e])}});return function(e,t){var r=[],i=[];return n(e,r,i,t),{positions:r,cells:i}}}},o={}},6946:function(e,t,r){"use strict";e.exports=function e(t,r,i){i=i||{};var a=o[t];a||(a=o[t]={" ":{data:new Float32Array(0),shape:.2}});var s=a[r];if(!s)if(r.length<=1||!/\d/.test(r))s=a[r]=function(e){for(var t=e.cells,r=e.positions,n=new Float32Array(6*t.length),i=0,a=0,o=0;o0&&(f+=.02);var p=new Float32Array(c),h=0,v=-.5*f;for(d=0;dMath.max(r,n)?i[2]=1:r>Math.max(t,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=e[l]*e[l],o+=i[l]*e[l];for(l=0;l<3;++l)i[l]-=o/a*e[l];return s(i,i),i}function d(e,t,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(e,t),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}var p=d.prototype;p.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},p.getDistanceLimits=function(e){var t=this.radius.bounds[0];return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},p.recalcMatrix=function(e){this.center.curve(e),this.up.curve(e),this.right.curve(e),this.radius.curve(e),this.angle.curve(e);for(var t=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=t[a]*r[a],n+=t[a]*t[a];var l=Math.sqrt(n),c=0;for(a=0;a<3;++a)r[a]-=t[a]*i/n,c+=r[a]*r[a],t[a]/=l;var f=Math.sqrt(c);for(a=0;a<3;++a)r[a]/=f;var d=this.computedToward;o(d,t,r),s(d,d);var p=Math.exp(this.computedRadius[0]),h=this.computedAngle[0],v=this.computedAngle[1],m=Math.cos(h),g=Math.sin(h),y=Math.cos(v),x=Math.sin(v),b=this.computedCenter,_=m*y,w=g*y,k=x,T=-m*x,M=-g*x,S=y,A=this.computedEye,C=this.computedMatrix;for(a=0;a<3;++a){var E=_*r[a]+w*d[a]+k*t[a];C[4*a+1]=T*r[a]+M*d[a]+S*t[a],C[4*a+2]=E,C[4*a+3]=0}var P=C[1],L=C[5],I=C[9],R=C[2],O=C[6],D=C[10],z=L*D-I*O,F=I*R-P*D,j=P*O-L*R,N=u(z,F,j);for(z/=N,F/=N,j/=N,C[0]=z,C[4]=F,C[8]=j,a=0;a<3;++a)A[a]=b[a]+C[2+4*a]*p;for(a=0;a<3;++a){c=0;for(var Z=0;Z<3;++Z)c+=C[a+4*Z]*A[Z];C[12+a]=-c}C[15]=1},p.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r};var h=[0,0,0];p.rotate=function(e,t,r,n){if(this.angle.move(e,t,r),n){this.recalcMatrix(e);var i=this.computedMatrix;h[0]=i[2],h[1]=i[6],h[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)i[4*u]=o[u],i[4*u+1]=s[u],i[4*u+2]=l[u];for(a(i,i,n,h),u=0;u<3;++u)o[u]=i[4*u],s[u]=i[4*u+1];this.up.set(e,o[0],o[1],o[2]),this.right.set(e,s[0],s[1],s[2])}},p.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=u(a,o,s);a/=l,o/=l,s/=l;var c=i[0],f=i[4],d=i[8],p=c*a+f*o+d*s,h=u(c-=a*p,f-=o*p,d-=s*p),v=(c/=h)*t+a*r,m=(f/=h)*t+o*r,g=(d/=h)*t+s*r;this.center.move(e,v,m,g);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(e,Math.log(y))},p.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},p.setMatrix=function(e,t,r,n){var a=1;"number"===typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;t||(this.recalcMatrix(e),t=this.computedMatrix);var s=t[a],l=t[a+4],f=t[a+8];if(n){var d=Math.abs(s),p=Math.abs(l),h=Math.abs(f),v=Math.max(d,p,h);d===v?(s=s<0?-1:1,l=f=0):h===v?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var m=u(s,l,f);s/=m,l/=m,f/=m}var g,y,x=t[o],b=t[o+4],_=t[o+8],w=x*s+b*l+_*f,k=u(x-=s*w,b-=l*w,_-=f*w),T=l*(_/=k)-f*(b/=k),M=f*(x/=k)-s*_,S=s*b-l*x,A=u(T,M,S);if(T/=A,M/=A,S/=A,this.center.jump(e,H,W,G),this.radius.idle(e),this.up.jump(e,s,l,f),this.right.jump(e,x,b,_),2===a){var C=t[1],E=t[5],P=t[9],L=C*x+E*b+P*_,I=C*T+E*M+P*S;g=z<0?-Math.PI/2:Math.PI/2,y=Math.atan2(I,L)}else{var R=t[2],O=t[6],D=t[10],z=R*s+O*l+D*f,F=R*x+O*b+D*_,j=R*T+O*M+D*S;g=Math.asin(c(z)),y=Math.atan2(j,F)}this.angle.jump(e,y,g),this.recalcMatrix(e);var N=t[2],Z=t[6],B=t[10],V=this.computedMatrix;i(V,t);var U=V[15],H=V[12]/U,W=V[13]/U,G=V[14]/U,q=Math.exp(this.computedRadius[0]);this.center.jump(e,H-N*q,W-Z*q,G-B*q)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(e){this.center.idle(e),this.up.idle(e),this.right.idle(e),this.radius.idle(e),this.angle.idle(e)},p.flush=function(e){this.center.flush(e),this.up.flush(e),this.right.flush(e),this.radius.flush(e),this.angle.flush(e)},p.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},p.lookAt=function(e,t,r,n){this.recalcMatrix(e),t=t||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=u(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=t[0]-r[0],f=t[1]-r[1],d=t[2]-r[2],p=u(l,f,d);if(!(p<1e-6)){l/=p,f/=p,d/=p;var h=this.computedRight,v=h[0],m=h[1],g=h[2],y=i*v+a*m+o*g,x=u(v-=y*i,m-=y*a,g-=y*o);if(!(x<.01&&(x=u(v=a*d-o*f,m=o*l-i*d,g=i*f-a*l))<1e-6)){v/=x,m/=x,g/=x,this.up.set(e,i,a,o),this.right.set(e,v,m,g),this.center.set(e,r[0],r[1],r[2]),this.radius.set(e,Math.log(p));var b=a*g-o*m,_=o*v-i*g,w=i*m-a*v,k=u(b,_,w),T=i*l+a*f+o*d,M=v*l+m*f+g*d,S=(b/=k)*l+(_/=k)*f+(w/=k)*d,A=Math.asin(c(T)),C=Math.atan2(S,M),E=this.angle._state,P=E[E.length-1],L=E[E.length-2];P%=2*Math.PI;var I=Math.abs(P+2*Math.PI-C),R=Math.abs(P-C),O=Math.abs(P-2*Math.PI-C);I0?r.pop():new ArrayBuffer(e)}function h(e){return new Uint8Array(p(e),0,e)}function v(e){return new Uint16Array(p(2*e),0,e)}function m(e){return new Uint32Array(p(4*e),0,e)}function g(e){return new Int8Array(p(e),0,e)}function y(e){return new Int16Array(p(2*e),0,e)}function x(e){return new Int32Array(p(4*e),0,e)}function b(e){return new Float32Array(p(4*e),0,e)}function _(e){return new Float64Array(p(8*e),0,e)}function w(e){return o?new Uint8ClampedArray(p(e),0,e):h(e)}function k(e){return s?new BigUint64Array(p(8*e),0,e):null}function T(e){return l?new BigInt64Array(p(8*e),0,e):null}function M(e){return new DataView(p(e),0,e)}function S(e){e=n.nextPow2(e);var t=n.log2(e),r=f[t];return r.length>0?r.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))f[n.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|n.log2(t);c[r].push(e)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(e){d(e.buffer)},t.freeArrayBuffer=d,t.freeBuffer=function(e){f[n.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return p(e);switch(t){case"uint8":return h(e);case"uint16":return v(e);case"uint32":return m(e);case"int8":return g(e);case"int16":return y(e);case"int32":return x(e);case"float":case"float32":return b(e);case"double":case"float64":return _(e);case"uint8_clamped":return w(e);case"bigint64":return T(e);case"biguint64":return k(e);case"buffer":return S(e);case"data":case"dataview":return M(e);default:return null}return null},t.mallocArrayBuffer=p,t.mallocUint8=h,t.mallocUint16=v,t.mallocUint32=m,t.mallocInt8=g,t.mallocInt16=y,t.mallocInt32=x,t.mallocFloat32=t.mallocFloat=b,t.mallocFloat64=t.mallocDouble=_,t.mallocUint8Clamped=w,t.mallocBigUint64=k,t.mallocBigInt64=T,t.mallocDataView=M,t.mallocBuffer=S,t.clearCache=function(){for(var e=0;e<32;++e)u.UINT8[e].length=0,u.UINT16[e].length=0,u.UINT32[e].length=0,u.INT8[e].length=0,u.INT16[e].length=0,u.INT32[e].length=0,u.FLOAT[e].length=0,u.DOUBLE[e].length=0,u.BIGUINT64[e].length=0,u.BIGINT64[e].length=0,u.UINT8C[e].length=0,c[e].length=0,f[e].length=0}},1731:function(e){"use strict";function t(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(e){return e})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",w(function(e,t,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(k=0;k-1?parseInt(e[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),S*=Math.pow(.75,l-s),n=n.replace("?px ",F())),M+=.25*E*(l-s)}if(!0===o.superscripts){var u=e.indexOf(h),f=r.indexOf(h),p=u>-1?parseInt(e[1+u]):0,v=f>-1?parseInt(r[1+f]):0;p!==v&&(n=n.replace(F(),"?px "),S*=Math.pow(.75,v-p),n=n.replace("?px ",F())),M-=.25*E*(v-p)}if(!0===o.bolds){var m=e.indexOf(c)>-1,y=r.indexOf(c)>-1;!m&&y&&(n=x?n.replace("italic ","italic bold "):"bold "+n),m&&!y&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=e.indexOf(d)>-1,b=r.indexOf(d)>-1;!x&&b&&(n="italic "+n),x&&!b&&(n=n.replace("italic ",""))}t.font=n}for(w=0;w",a="",o=i.length,s=a.length,l=t[0]===h||t[0]===g,u=0,c=-s;u>-1&&-1!==(u=r.indexOf(i,u))&&-1!==(c=r.indexOf(a,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var d=n[f].indexOf(t[0]);-1===d?n[f]+=t:l&&(n[f]=n[f].substr(0,d+1)+(1+parseInt(n[f][d+1]))+n[f].substr(d+2))}var p=u+o,v=r.substr(p,c-p).indexOf(i);u=-1!==v?v:c+s}return n}function b(e,t){var r=n(e,128);return t?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function _(e,t,r,n){var i=b(e,n),a=function(e,t,r){for(var n=t.textAlign||"start",i=t.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=e.length,l=0;l=0?r[a]:i}))},has___:{value:x((function(e){var r=y(e);return r?n in r:t.indexOf(e)>=0}))},set___:{value:x((function(e,i){var a,o=y(e);return o?o[n]=i:(a=t.indexOf(e))>=0?r[a]=i:(a=t.length,r[a]=i,t[a]=e),this}))},delete___:{value:x((function(e){var i,a,o=y(e);return o?n in o&&delete o[n]:!((i=t.indexOf(e))<0)&&(a=t.length-1,t[i]=void 0,r[i]=r[a],t[i]=t[a],t.length=a,r.length=a,!0)}))}})};v.prototype=Object.create(Object.prototype,{get:{value:function(e,t){return this.get___(e,t)},writable:!0,configurable:!0},has:{value:function(e){return this.has___(e)},writable:!0,configurable:!0},set:{value:function(e,t){return this.set___(e,t)},writable:!0,configurable:!0},delete:{value:function(e){return this.delete___(e)},writable:!0,configurable:!0}}),"function"===typeof r?function(){function n(){this instanceof v||b();var e,n=new r,i=void 0,a=!1;return e=t?function(e,t){return n.set(e,t),n.has(e)||(i||(i=new v),i.set(e,t)),this}:function(e,t){if(a)try{n.set(e,t)}catch(r){i||(i=new v),i.set___(e,t)}else n.set(e,t);return this},Object.create(v.prototype,{get___:{value:x((function(e,t){return i?n.has(e)?n.get(e):i.get___(e,t):n.get(e,t)}))},has___:{value:x((function(e){return n.has(e)||!!i&&i.has___(e)}))},set___:{value:x(e)},delete___:{value:x((function(e){var t=!!n.delete(e);return i&&i.delete___(e)||t}))},permitHostObjects___:{value:x((function(e){if(e!==m)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&"undefined"!==typeof Proxy&&(Proxy=void 0),n.prototype=v.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!==typeof Proxy&&(Proxy=void 0),e.exports=v)}function m(e){e.permitHostObjects___&&e.permitHostObjects___(m)}function g(e){return!(e.substr(0,8)==l&&"___"===e.substr(e.length-3))}function y(e){if(e!==Object(e))throw new TypeError("Not an object: "+e);var t=e[u];if(t&&t.key===e)return t;if(s(e)){t={key:e};try{return o(e,u,{value:t,writable:!1,enumerable:!1,configurable:!1}),t}catch(r){return}}}function x(e){return e.prototype=null,Object.freeze(e)}function b(){p||"undefined"===typeof console||(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},9222:function(e,t,r){var n=r(7178);e.exports=function(){var e={};return function(t){if(("object"!==typeof t||null===t)&&"function"!==typeof t)throw new Error("Weakmap-shim: Key must be object");var r=t.valueOf(e);return r&&r.identity===e?r:n(t,e)}}},7178:function(e){e.exports=function(e,t){var r={identity:t},n=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function(e){return e!==t?n.apply(this,arguments):r},writable:!0}),r}},4037:function(e,t,r){var n=r(9222);e.exports=function(){var e=n();return{get:function(t,r){var n=e(t);return n.hasOwnProperty("value")?n.value:r},set:function(t,r){return e(t).value=r,this},has:function(t){return"value"in e(t)},delete:function(t){return delete e(t).value}}}},6183:function(e){"use strict";var t=function(){return function(e,t,r,n,i,a){var o=e[0],s=r[0],l=[0],u=s;n|=0;var c=0,f=s;for(c=0;c=0!==p>=0&&i.push(l[0]+.5+.5*(d+p)/(d-p)),n+=f,++l[0]}}};e.exports=function(e){return r={funcName:e.funcName},function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=t[s];return l||(t[s]=l=e([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(t.bind(void 0,r));var r}({funcName:"zeroCrossings"})},9584:function(e,t,r){"use strict";e.exports=function(e,t){var r=[];return t=+t||0,n(e.hi(e.shape[0]-1),r,t),r};var n=r(6183)},6601:function(){}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}return r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},r(7386)}()},e.exports=n()},12856:function(e,t,r){"use strict";function n(e,t){for(var r=0;rp)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,v.prototype),t}function v(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return y(e)}return m(e,t,r)}function m(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!v.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|w(e,t),n=h(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(re(e,Uint8Array)){var t=new Uint8Array(e);return b(t.buffer,t.byteOffset,t.byteLength)}return x(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(e));if(re(e,ArrayBuffer)||e&&re(e.buffer,ArrayBuffer))return b(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(re(e,SharedArrayBuffer)||e&&re(e.buffer,SharedArrayBuffer)))return b(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return v.from(n,t,r);var i=function(e){if(v.isBuffer(e)){var t=0|_(e.length),r=h(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||ne(e.length)?h(0):x(e):"Buffer"===e.type&&Array.isArray(e.data)?x(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return v.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(e))}function g(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function y(e){return g(e),h(e<0?0:0|_(e))}function x(e){for(var t=e.length<0?0:0|_(e.length),r=h(t),n=0;n=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return 0|e}function w(e,t){if(v.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||re(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+u(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ee(e).length;default:if(i)return n?-1:Q(e).length;t=(""+t).toLowerCase(),i=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return R(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return z(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function T(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function M(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),ne(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=v.from(t,n)),v.isBuffer(t))return 0===t.length?-1:S(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):S(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function S(e,t,r,n,i){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,d=0;di&&(n=i):n=i;var a,o=t.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function I(e,t,r){return 0===t&&r===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(t,r))}function R(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,u=void 0,c=void 0,f=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128===(192&(l=e[i+1]))&&(f=(31&a)<<6|63&l)>127&&(o=f);break;case 3:l=e[i+1],u=e[i+2],128===(192&l)&&128===(192&u)&&(f=(15&a)<<12|(63&l)<<6|63&u)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=e[i+1],u=e[i+2],c=e[i+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(f=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?(v.isBuffer(a)||(a=v.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!v.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},v.byteLength=w,v.prototype._isBuffer=!0,v.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},d&&(v.prototype[d]=v.prototype.inspect),v.prototype.compare=function(e,t,r,n,i){if(re(e,Uint8Array)&&(e=v.from(e,e.offset,e.byteLength)),!v.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+u(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(n,i),c=e.slice(t,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return A(this,e,t,r);case"utf8":case"utf-8":return C(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return P(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function D(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function Z(e,t,r,n,i,a){if(!v.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function B(e,t,r,n,i){X(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function V(e,t,r,n,i){X(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function U(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return t=+t,r>>>=0,i||U(e,0,r,4),f.write(e,t,r,n,23,4),r+4}function W(e,t,r,n,i){return t=+t,r>>>=0,i||U(e,0,r,8),f.write(e,t,r,n,52,8),r+8}v.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},v.prototype.readUint8=v.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},v.prototype.readBigUInt64LE=ae((function(e){K(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},v.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},v.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},v.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},v.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},v.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},v.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},v.prototype.readBigInt64LE=ae((function(e){K(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<>>=0,t||N(e,4,this.length),f.read(this,e,!0,23,4)},v.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),f.read(this,e,!1,23,4)},v.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),f.read(this,e,!0,52,8)},v.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),f.read(this,e,!1,52,8)},v.prototype.writeUintLE=v.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||Z(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||Z(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},v.prototype.writeUint8=v.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,1,255,0),this[t]=255&e,t+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},v.prototype.writeBigUInt64LE=ae((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),v.prototype.writeBigUInt64BE=ae((function(e){return V(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),v.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);Z(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},v.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);Z(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},v.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},v.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},v.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},v.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},v.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},v.prototype.writeBigInt64LE=ae((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),v.prototype.writeBigInt64BE=ae((function(e){return V(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),v.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},v.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},v.prototype.writeDoubleLE=function(e,t,r){return W(this,e,t,!0,r)},v.prototype.writeDoubleBE=function(e,t,r){return W(this,e,t,!1,r)},v.prototype.copy=function(e,t,r,n){if(!v.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function X(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(r).concat(s),new G.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,i,a)}function K(e,t){if("number"!==typeof e)throw new G.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw K(e,r),new G.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new G.ERR_BUFFER_OUT_OF_BOUNDS;throw new G.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(u(t))}),TypeError),q("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=Y(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Y(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var J=/[^+/0-9A-Za-z-_]/g;function Q(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function ee(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function te(e,t,r,n){var i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ne(e){return e!==e}var ie=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function ae(e){return"undefined"===typeof BigInt?oe:e}function oe(){throw new Error("BigInt not supported")}},35791:function(e){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});var i=e.ua;if(i||"undefined"===typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"===typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!==typeof i)return!1;var a=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},86781:function(e,t,r){"use strict";r.r(t),r.d(t,{sankeyCenter:function(){return d},sankeyCircular:function(){return P},sankeyJustify:function(){return f},sankeyLeft:function(){return u},sankeyRight:function(){return c}});var n=r(33064),i=r(15140),a=r(45879),o=r(2502),s=r.n(o);function l(e){return e.target.depth}function u(e){return e.depth}function c(e,t){return t-1-e.height}function f(e,t){return e.sourceLinks.length?e.depth:t-1}function d(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?(0,n.VV)(e.sourceLinks,l)-1:0}function p(e){return function(){return e}}var h="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function v(e,t){return g(e.source,t.source)||e.index-t.index}function m(e,t){return g(e.target,t.target)||e.index-t.index}function g(e,t){return e.partOfCycle===t.partOfCycle?e.y0-t.y0:"top"===e.circularLinkType||"bottom"===t.circularLinkType?-1:1}function y(e){return e.value}function x(e){return(e.y0+e.y1)/2}function b(e){return x(e.source)}function _(e){return x(e.target)}function w(e){return e.index}function k(e){return e.nodes}function T(e){return e.links}function M(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function S(e,t){return t(e)}var A=25,C=10,E=.3;function P(){var e,t,r=0,a=0,o=1,l=1,u=24,c=w,d=f,S=k,P=T,I=32,O=2,D=null;function F(){var f={nodes:S.apply(null,arguments),links:P.apply(null,arguments)};!function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=(0,i.UI)(e.nodes,c);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==("undefined"===typeof n?"undefined":h(n))&&(n=e.source=M(t,n)),"object"!==("undefined"===typeof i?"undefined":h(i))&&(i=e.target=M(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(f),function(e,t,r){var n=0;if(null===r){for(var i=[],a=0;a0;--h)m(p*=.99,f),w();function v(i){if(t){var c=1/0;d.forEach((function(e){var r=l*t/(e.length+1);c=r0?t+A+C:t,bottom:r=r>0?r+A+C:r,left:a=a>0?a+A+C:a,right:i=i>0?i+A+C:i}}(s),h=function(e,t){var i=(0,n.Fp)(e.nodes,(function(e){return e.column})),s=o-r,c=l-a,f=s+t.right+t.left,d=c+t.top+t.bottom,p=s/f,h=c/d;return r=r*p+t.left,o=0==t.right?o:o*p,a=a*h+t.top,l*=h,e.nodes.forEach((function(e){e.x0=r+e.column*((o-r-u)/i),e.x1=e.x0+u})),h}(s,p);f*=h,s.links.forEach((function(e){e.width=e.value*f})),d.forEach((function(e){var t=e.length;e.forEach((function(e,r){e.depth==d.length-1&&1==t||0==e.depth&&1==t?(e.y0=l/2-e.value*f,e.y1=e.y0+e.value*f):e.partOfCycle?0==R(e,i)?(e.y0=l/2+r,e.y1=e.y0+e.value*f):"top"==e.circularLinkType?(e.y0=a+r,e.y1=e.y0+e.value*f):(e.y0=l-e.value*f-r,e.y1=e.y0+e.value*f):0==p.top||0==p.bottom?(e.y0=(l-a)/t*r,e.y1=e.y0+e.value*f):(e.y0=(l-a)/2-t/2+r,e.y1=e.y0+e.value*f)}))}))}function m(e,t){var r=d.length;d.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&R(i,t)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=l/2-s/2,i.y1=l/2+s/2;else if(o==r-1&&1==a)s=i.y1-i.y0,i.y0=l/2-s/2,i.y1=l/2+s/2;else{var u=(0,n.J6)(i.sourceLinks,_),c=(0,n.J6)(i.targetLinks,b),f=((u&&c?(u+c)/2:u||c)-x(i))*e;i.y0+=f,i.y1+=f}}))}))}function w(){d.forEach((function(t){var r,n,i,o=a,s=t.length;for(t.sort(g),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+e;if((n=o-e-l)>0)for(o=r.y0-=n,r.y1-=n,i=s-2;i>=0;--i)(n=(r=t[i]).y1+e-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}(f,I,c),j(f);for(var p=0;p<4;p++)Y(f,l,c),X(f,0,c),G(f,a,l,c),Y(f,l,c),X(f,0,c);return function(e,t,r){var i=e.nodes,a=e.links,o=!1,s=!1;if(a.forEach((function(e){"top"==e.circularLinkType?o=!0:"bottom"==e.circularLinkType&&(s=!0)})),0==o||0==s){var l=(0,n.VV)(i,(function(e){return e.y0})),u=(r-t)/((0,n.Fp)(i,(function(e){return e.y1}))-l);i.forEach((function(e){var t=(e.y1-e.y0)*u;e.y0=(e.y0-l)*u,e.y1=e.y0+t})),a.forEach((function(e){e.y0=(e.y0-l)*u,e.y1=(e.y1-l)*u,e.width=e.width*u}))}}(f,a,l),z(f,O,l,c),f}function j(e){e.nodes.forEach((function(e){e.sourceLinks.sort(m),e.targetLinks.sort(v)})),e.nodes.forEach((function(e){var t=e.y0,r=t,n=e.y1,i=n;e.sourceLinks.forEach((function(e){e.circular?(e.y0=n-e.width/2,n-=e.width):(e.y0=t+e.width/2,t+=e.width)})),e.targetLinks.forEach((function(e){e.circular?(e.y1=i-e.width/2,i-=e.width):(e.y1=r+e.width/2,r+=e.width)}))}))}return F.nodeId=function(e){return arguments.length?(c="function"===typeof e?e:p(e),F):c},F.nodeAlign=function(e){return arguments.length?(d="function"===typeof e?e:p(e),F):d},F.nodeWidth=function(e){return arguments.length?(u=+e,F):u},F.nodePadding=function(t){return arguments.length?(e=+t,F):e},F.nodes=function(e){return arguments.length?(S="function"===typeof e?e:p(e),F):S},F.links=function(e){return arguments.length?(P="function"===typeof e?e:p(e),F):P},F.size=function(e){return arguments.length?(r=a=0,o=+e[0],l=+e[1],F):[o-r,l-a]},F.extent=function(e){return arguments.length?(r=+e[0][0],o=+e[1][0],a=+e[0][1],l=+e[1][1],F):[[r,a],[o,l]]},F.iterations=function(e){return arguments.length?(I=+e,F):I},F.circularLinkGap=function(e){return arguments.length?(O=+e,F):O},F.nodePaddingRatio=function(e){return arguments.length?(t=+e,F):t},F.sortNodes=function(e){return arguments.length?(D=e,F):D},F.update=function(e){return L(e,c),j(e),e.links.forEach((function(e){e.circular&&(e.circularLinkType=e.y0+e.y11||i>1)}function D(e,t,r){return e.sort(F),e.forEach((function(n,i){var a,o,s=0;if(J(n,r)&&O(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var u=e[l].circularPathData.verticalBuffer+e[l].width/2+t;s=u>s?u:s}n.circularPathData.verticalBuffer=s+n.width/2}})),e}function z(e,t,r,i){var o=(0,n.VV)(e.links,(function(e){return e.source.y0}));e.links.forEach((function(e){e.circular&&(e.circularPathData={})})),D(e.links.filter((function(e){return"top"==e.circularLinkType})),t,i),D(e.links.filter((function(e){return"bottom"==e.circularLinkType})),t,i),e.links.forEach((function(n){if(n.circular){if(n.circularPathData.arcRadius=n.width+C,n.circularPathData.leftNodeBuffer=5,n.circularPathData.rightNodeBuffer=5,n.circularPathData.sourceWidth=n.source.x1-n.source.x0,n.circularPathData.sourceX=n.source.x0+n.circularPathData.sourceWidth,n.circularPathData.targetX=n.target.x0,n.circularPathData.sourceY=n.y0,n.circularPathData.targetY=n.y1,J(n,i)&&O(n))n.circularPathData.leftSmallArcRadius=C+n.width/2,n.circularPathData.leftLargeArcRadius=C+n.width/2,n.circularPathData.rightSmallArcRadius=C+n.width/2,n.circularPathData.rightLargeArcRadius=C+n.width/2,"bottom"==n.circularLinkType?(n.circularPathData.verticalFullExtent=n.source.y1+A+n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.rightLargeArcRadius):(n.circularPathData.verticalFullExtent=n.source.y0-A-n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.rightLargeArcRadius);else{var s=n.source.column,l=n.circularLinkType,u=e.links.filter((function(e){return e.source.column==s&&e.circularLinkType==l}));"bottom"==n.circularLinkType?u.sort(N):u.sort(j);var c=0;u.forEach((function(e,r){e.circularLinkID==n.circularLinkID&&(n.circularPathData.leftSmallArcRadius=C+n.width/2+c,n.circularPathData.leftLargeArcRadius=C+n.width/2+r*t+c),c+=e.width})),s=n.target.column,u=e.links.filter((function(e){return e.target.column==s&&e.circularLinkType==l})),"bottom"==n.circularLinkType?u.sort(B):u.sort(Z),c=0,u.forEach((function(e,r){e.circularLinkID==n.circularLinkID&&(n.circularPathData.rightSmallArcRadius=C+n.width/2+c,n.circularPathData.rightLargeArcRadius=C+n.width/2+r*t+c),c+=e.width})),"bottom"==n.circularLinkType?(n.circularPathData.verticalFullExtent=Math.max(r,n.source.y1,n.target.y1)+A+n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.rightLargeArcRadius):(n.circularPathData.verticalFullExtent=o-A-n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.rightLargeArcRadius)}n.circularPathData.leftInnerExtent=n.circularPathData.sourceX+n.circularPathData.leftNodeBuffer,n.circularPathData.rightInnerExtent=n.circularPathData.targetX-n.circularPathData.rightNodeBuffer,n.circularPathData.leftFullExtent=n.circularPathData.sourceX+n.circularPathData.leftLargeArcRadius+n.circularPathData.leftNodeBuffer,n.circularPathData.rightFullExtent=n.circularPathData.targetX-n.circularPathData.rightLargeArcRadius-n.circularPathData.rightNodeBuffer}if(n.circular)n.path=function(e){return"top"==e.circularLinkType?"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 0 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY-e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 0 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 0 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY-e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 0 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY:"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 1 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY+e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 1 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 1 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY+e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 1 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY}(n);else{var f=(0,a.h5)().source((function(e){return[e.source.x0+(e.source.x1-e.source.x0),e.y0]})).target((function(e){return[e.target.x0,e.y1]}));n.path=f(n)}}))}function F(e,t){return V(e)==V(t)?"bottom"==e.circularLinkType?N(e,t):j(e,t):V(t)-V(e)}function j(e,t){return e.y0-t.y0}function N(e,t){return t.y0-e.y0}function Z(e,t){return e.y1-t.y1}function B(e,t){return t.y1-e.y1}function V(e){return e.target.column-e.source.column}function U(e){return e.target.x0-e.source.x1}function H(e,t){var r=I(e),n=U(t)/Math.tan(r);return"up"==$(e)?e.y1+n:e.y1-n}function W(e,t){var r=I(e),n=U(t)/Math.tan(r);return"up"==$(e)?e.y1-n:e.y1+n}function G(e,t,r,n){e.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)e.nodes.forEach((function(o){if(o.column==a){var u,c=s/(l+1),f=Math.pow(1-c,3),d=3*c*Math.pow(1-c,2),p=3*Math.pow(c,2)*(1-c),h=Math.pow(c,3),v=f*i.y0+d*i.y0+p*i.y1+h*i.y1,m=v-i.width/2,g=v+i.width/2;m>o.y0&&ma.y0&&i.y0a.y0&&i.y1a.y1)&&q(e,u,t,r)}))):(g>o.y0&&go.y1)&&(u=g-o.y0+10,o=q(o,u,t,r),e.nodes.forEach((function(e){S(e,n)!=S(o,n)&&e.column==o.column&&e.y0o.y1&&q(e,u,t,r)})))}}))}}))}function q(e,t,r,n){return e.y0+t>=r&&e.y1+t<=n&&(e.y0=e.y0+t,e.y1=e.y1+t,e.targetLinks.forEach((function(e){e.y1=e.y1+t})),e.sourceLinks.forEach((function(e){e.y0=e.y0+t}))),e}function Y(e,t,r,n){e.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>t&&(i.y=i.y-(i.y+(i.y1-i.y0)-t));var a=e.links.filter((function(e){return S(e.source,r)==S(i,r)})),o=a.length;o>1&&a.sort((function(e,t){if(!e.circular&&!t.circular){if(e.target.column==t.target.column)return e.y1-t.y1;if(!K(e,t))return e.y1-t.y1;if(e.target.column>t.target.column){var r=W(t,e);return e.y1-r}if(t.target.column>e.target.column)return W(e,t)-t.y1}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.target.column===t.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.target.column===t.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:"top"==e.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(e){e.y0=s+e.width/2,s+=e.width})),a.forEach((function(e,t){if("bottom"==e.circularLinkType){for(var r=t+1,n=0;r1&&n.sort((function(e,t){if(!e.circular&&!t.circular){if(e.source.column==t.source.column)return e.y0-t.y0;if(!K(e,t))return e.y0-t.y0;if(t.source.column0?"up":"down"}function J(e,t){return S(e.source,t)==S(e.target,t)}},30838:function(e,t,r){"use strict";r.r(t),r.d(t,{sankey:function(){return w},sankeyCenter:function(){return u},sankeyJustify:function(){return l},sankeyLeft:function(){return o},sankeyLinkHorizontal:function(){return S},sankeyRight:function(){return s}});var n=r(33064),i=r(15140);function a(e){return e.target.depth}function o(e){return e.depth}function s(e,t){return t-1-e.height}function l(e,t){return e.sourceLinks.length?e.depth:t-1}function u(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?(0,n.VV)(e.sourceLinks,a)-1:0}function c(e){return function(){return e}}function f(e,t){return p(e.source,t.source)||e.index-t.index}function d(e,t){return p(e.target,t.target)||e.index-t.index}function p(e,t){return e.y0-t.y0}function h(e){return e.value}function v(e){return(e.y0+e.y1)/2}function m(e){return v(e.source)*e.value}function g(e){return v(e.target)*e.value}function y(e){return e.index}function x(e){return e.nodes}function b(e){return e.links}function _(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function w(){var e=0,t=0,r=1,a=1,o=24,s=8,u=y,w=l,k=x,T=b,M=32,S=2/3;function A(){var l={nodes:k.apply(null,arguments),links:T.apply(null,arguments)};return function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=(0,i.UI)(e.nodes,u);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==typeof n&&(n=e.source=_(t,n)),"object"!==typeof i&&(i=e.target=_(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(l),function(e){e.nodes.forEach((function(e){e.value=Math.max((0,n.Sm)(e.sourceLinks,h),(0,n.Sm)(e.targetLinks,h))}))}(l),function(t){var n,i,a;for(n=t.nodes,i=[],a=0;n.length;++a,n=i,i=[])n.forEach((function(e){e.depth=a,e.sourceLinks.forEach((function(e){i.indexOf(e.target)<0&&i.push(e.target)}))}));for(n=t.nodes,i=[],a=0;n.length;++a,n=i,i=[])n.forEach((function(e){e.height=a,e.targetLinks.forEach((function(e){i.indexOf(e.source)<0&&i.push(e.source)}))}));var s=(r-e-o)/(a-1);t.nodes.forEach((function(t){t.x1=(t.x0=e+Math.max(0,Math.min(a-1,Math.floor(w.call(null,t,a))))*s)+o}))}(l),function(e){var r=(0,i.b1)().key((function(e){return e.x0})).sortKeys(n.j2).entries(e.nodes).map((function(e){return e.values}));u(),d();for(var o=1,l=M;l>0;--l)f(o*=.99),d(),c(o),d();function u(){var i=(0,n.Fp)(r,(function(e){return e.length})),o=S*(a-t)/(i-1);s>o&&(s=o);var l=(0,n.VV)(r,(function(e){return(a-t-(e.length-1)*s)/(0,n.Sm)(e,h)}));r.forEach((function(e){e.forEach((function(e,t){e.y1=(e.y0=t)+e.value*l}))})),e.links.forEach((function(e){e.width=e.value*l}))}function c(e){r.forEach((function(t){t.forEach((function(t){if(t.targetLinks.length){var r=((0,n.Sm)(t.targetLinks,m)/(0,n.Sm)(t.targetLinks,h)-v(t))*e;t.y0+=r,t.y1+=r}}))}))}function f(e){r.slice().reverse().forEach((function(t){t.forEach((function(t){if(t.sourceLinks.length){var r=((0,n.Sm)(t.sourceLinks,g)/(0,n.Sm)(t.sourceLinks,h)-v(t))*e;t.y0+=r,t.y1+=r}}))}))}function d(){r.forEach((function(e){var r,n,i,o=t,l=e.length;for(e.sort(p),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+s;if((n=o-s-a)>0)for(o=r.y0-=n,r.y1-=n,i=l-2;i>=0;--i)(n=(r=e[i]).y1+s-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}(l),C(l),l}function C(e){e.nodes.forEach((function(e){e.sourceLinks.sort(d),e.targetLinks.sort(f)})),e.nodes.forEach((function(e){var t=e.y0,r=t;e.sourceLinks.forEach((function(e){e.y0=t+e.width/2,t+=e.width})),e.targetLinks.forEach((function(e){e.y1=r+e.width/2,r+=e.width}))}))}return A.update=function(e){return C(e),e},A.nodeId=function(e){return arguments.length?(u="function"===typeof e?e:c(e),A):u},A.nodeAlign=function(e){return arguments.length?(w="function"===typeof e?e:c(e),A):w},A.nodeWidth=function(e){return arguments.length?(o=+e,A):o},A.nodePadding=function(e){return arguments.length?(s=+e,A):s},A.nodes=function(e){return arguments.length?(k="function"===typeof e?e:c(e),A):k},A.links=function(e){return arguments.length?(T="function"===typeof e?e:c(e),A):T},A.size=function(n){return arguments.length?(e=t=0,r=+n[0],a=+n[1],A):[r-e,a-t]},A.extent=function(n){return arguments.length?(e=+n[0][0],r=+n[1][0],t=+n[0][1],a=+n[1][1],A):[[e,t],[r,a]]},A.iterations=function(e){return arguments.length?(M=+e,A):M},A}var k=r(45879);function T(e){return[e.source.x1,e.y0]}function M(e){return[e.target.x0,e.y1]}function S(){return(0,k.h5)().source(T).target(M)}},39898:function(e,t,r){var n,i;(function(){var a={version:"3.8.0"},o=[].slice,s=function(e){return o.call(e)},l=self.document;function u(e){return e&&(e.ownerDocument||e.document||e).documentElement}function c(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(l)try{s(l.documentElement.childNodes)[0].nodeType}catch(ga){s=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),l)try{l.createElement("DIV").style.setProperty("opacity",0,"")}catch(ya){var f=this.Element.prototype,d=f.setAttribute,p=f.setAttributeNS,h=this.CSSStyleDeclaration.prototype,v=h.setProperty;f.setAttribute=function(e,t){d.call(this,e,t+"")},f.setAttributeNS=function(e,t,r){p.call(this,e,t,r+"")},h.setProperty=function(e,t,r){v.call(this,e,t+"",r)}}function m(e,t){return et?1:e>=t?0:NaN}function g(e){return null===e?NaN:+e}function y(e){return!isNaN(e)}function x(e){return{left:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}a.ascending=m,a.descending=function(e,t){return te?1:t>=e?0:NaN},a.min=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},a.max=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},a.extent=function(e,t){var r,n,i,a=-1,o=e.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},a.deviation=function(){var e=a.variance.apply(this,arguments);return e?Math.sqrt(e):e};var b=x(m);function _(e){return e.length}a.bisectLeft=b.left,a.bisect=a.bisectRight=b.right,a.bisector=function(e){return x(1===e.length?function(t,r){return m(e(t),r)}:e)},a.shuffle=function(e,t,r){(a=arguments.length)<3&&(r=e.length,a<2&&(t=0));for(var n,i,a=r-t;a;)i=Math.random()*a--|0,n=e[a+t],e[a+t]=e[i+t],e[i+t]=n;return e},a.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},a.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],i=new Array(r<0?0:r);t=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r};var w=Math.abs;function k(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function T(){this._=Object.create(null)}a.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r===1/0)throw new Error("infinite range");var n,i=[],a=function(e){for(var t=1;e*t%1;)t*=10;return t}(w(r)),o=-1;if(e*=a,t*=a,(r*=a)<0)for(;(n=e+r*++o)>t;)i.push(n/a);else for(;(n=e+r*++o)=n.length)return t?t.call(r,a):e?a.sort(e):a;for(var l,u,c,f,d=-1,p=a.length,h=n[s++],v=new T;++d=n.length)return e;var r=[],a=i[t++];return e.forEach((function(e,n){r.push({key:e,values:s(n,t)})})),a?r.sort((function(e,t){return a(e.key,t.key)})):r}return r.map=function(e,t){return o(t,e,0)},r.entries=function(e){return s(o(a.map,e,0),0)},r.key=function(e){return n.push(e),r},r.sortKeys=function(e){return i[n.length-1]=e,r},r.sortValues=function(t){return e=t,r},r.rollup=function(e){return t=e,r},r},a.set=function(e){var t=new O;if(e)for(var r=0,n=e.length;r=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},a.event=null,a.requote=function(e){return e.replace(W,"\\$&")};var W=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,G={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function q(e){return G(e,$),e}var Y=function(e,t){return t.querySelector(e)},X=function(e,t){return t.querySelectorAll(e)},K=function(e,t){var r=e.matches||e[F(e,"matchesSelector")];return K=function(e,t){return r.call(e,t)},K(e,t)};"function"===typeof Sizzle&&(Y=function(e,t){return Sizzle(e,t)[0]||null},X=Sizzle,K=Sizzle.matchesSelector),a.selection=function(){return a.select(l.documentElement)};var $=a.selection.prototype=[];function J(e){return"function"===typeof e?e:function(){return Y(e,this)}}function Q(e){return"function"===typeof e?e:function(){return X(e,this)}}$.select=function(e){var t,r,n,i,a=[];e=J(e);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),te.hasOwnProperty(r)?{space:te[r],local:e}:e}},$.attr=function(e,t){if(arguments.length<2){if("string"===typeof e){var r=this.node();return(e=a.ns.qualify(e)).local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}for(t in e)this.each(re(t,e[t]));return this}return this.each(re(e,t))},$.classed=function(e,t){if(arguments.length<2){if("string"===typeof e){var r=this.node(),n=(e=ae(e)).length,i=-1;if(t=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},$.sort=function(e){e=he.apply(this,arguments);for(var t=-1,r=this.length;++t0&&(e=e.slice(0,i));var l=xe.get(e);function u(){var t=this[n];t&&(this.removeEventListener(e,t,t.$),delete this[n])}return l&&(e=l,o=_e),i?t?function(){var i=o(t,s(arguments));u.call(this),this.addEventListener(e,this[n]=i,i.$=r),i._=t}:u:t?N:function(){var t,r=new RegExp("^__on([^.]+)"+a.requote(e)+"$");for(var n in this)if(t=n.match(r)){var i=this[n];this.removeEventListener(t[1],i,i.$),delete this[n]}}}a.selection.enter=me,a.selection.enter.prototype=ge,ge.append=$.append,ge.empty=$.empty,ge.node=$.node,ge.call=$.call,ge.size=$.size,ge.select=function(e){for(var t,r,n,i,a,o=[],s=-1,l=this.length;++s=t&&(t=i+1);!(o=s[t])&&++t1?Re:e<-1?-Re:Math.asin(e)}function Fe(e){return((e=Math.exp(e))+1/e)/2}var je=Math.SQRT2;a.interpolateZoom=function(e,t){var r,n,i=e[0],a=e[1],o=e[2],s=t[0],l=t[1],u=t[2],c=s-i,f=l-a,d=c*c+f*f;if(d0&&(e=e.transition().duration(v)),e.call(w.event)}function A(){s&&s.domain(o.range().map((function(e){return(e-d.x)/d.k})).map(o.invert)),f&&f.domain(u.range().map((function(e){return(e-d.y)/d.k})).map(u.invert))}function C(e){m++||e({type:"zoomstart"})}function E(e){A(),e({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function P(e){--m||(e({type:"zoomend"}),t=null)}function L(){var e=this,t=_.of(e,arguments),r=0,n=a.select(c(e)).on(y,(function(){r=1,M(a.mouse(e),i),E(t)})).on(x,(function(){n.on(y,null).on(x,null),o(r),P(t)})),i=k(a.mouse(e)),o=Te(e);Ji.call(e),C(t)}function I(){var e,t=this,r=_.of(t,arguments),n={},o=0,s=".zoom-"+a.event.changedTouches[0].identifier,l="touchmove"+s,u="touchend"+s,c=[],f=a.select(t),p=Te(t);function h(){var r=a.touches(t);return e=d.k,r.forEach((function(e){e.identifier in n&&(n[e.identifier]=k(e))})),r}function v(){var e=a.event.target;a.select(e).on(l,m).on(u,y),c.push(e);for(var r=a.event.changedTouches,s=0,f=r.length;s1){g=p[0];var x=p[1],b=g[0]-x[0],_=g[1]-x[1];o=b*b+_*_}}function m(){var s,l,u,c,f=a.touches(t);Ji.call(t);for(var d=0,p=f.length;d360?e-=360:e<0&&(e+=360),e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+t):r+t-r*t),new ot(a(e+120),a(e),a(e-120))}function Ge(e,t,r){return this instanceof Ge?(this.h=+e,this.c=+t,void(this.l=+r)):arguments.length<2?e instanceof Ge?new Ge(e.h,e.c,e.l):rt(e instanceof Xe?e.l:(e=pt((e=a.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ge(e,t,r)}He.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Ue(this.h,this.s,this.l/e)},He.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Ue(this.h,this.s,e*this.l)},He.rgb=function(){return We(this.h,this.s,this.l)},a.hcl=Ge;var qe=Ge.prototype=new Ve;function Ye(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Xe(r,Math.cos(e*=Oe)*t,Math.sin(e)*t)}function Xe(e,t,r){return this instanceof Xe?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof Xe?new Xe(e.l,e.a,e.b):e instanceof Ge?Ye(e.h,e.c,e.l):pt((e=ot(e)).r,e.g,e.b):new Xe(e,t,r)}qe.brighter=function(e){return new Ge(this.h,this.c,Math.min(100,this.l+Ke*(arguments.length?e:1)))},qe.darker=function(e){return new Ge(this.h,this.c,Math.max(0,this.l-Ke*(arguments.length?e:1)))},qe.rgb=function(){return Ye(this.h,this.c,this.l).rgb()},a.lab=Xe;var Ke=18,$e=.95047,Je=1,Qe=1.08883,et=Xe.prototype=new Ve;function tt(e,t,r){var n=(e+16)/116,i=n+t/500,a=n-r/200;return new ot(at(3.2404542*(i=nt(i)*$e)-1.5371385*(n=nt(n)*Je)-.4985314*(a=nt(a)*Qe)),at(-.969266*i+1.8760108*n+.041556*a),at(.0556434*i-.2040259*n+1.0572252*a))}function rt(e,t,r){return e>0?new Ge(Math.atan2(r,t)*De,Math.sqrt(t*t+r*r),e):new Ge(NaN,NaN,e)}function nt(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function it(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function at(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function ot(e,t,r){return this instanceof ot?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof ot?new ot(e.r,e.g,e.b):ft(""+e,ot,We):new ot(e,t,r)}function st(e){return new ot(e>>16,e>>8&255,255&e)}function lt(e){return st(e)+""}et.brighter=function(e){return new Xe(Math.min(100,this.l+Ke*(arguments.length?e:1)),this.a,this.b)},et.darker=function(e){return new Xe(Math.max(0,this.l-Ke*(arguments.length?e:1)),this.a,this.b)},et.rgb=function(){return tt(this.l,this.a,this.b)},a.rgb=ot;var ut=ot.prototype=new Ve;function ct(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function ft(e,t,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(vt(i[0]),vt(i[1]),vt(i[2]))}return(a=mt.get(e))?t(a.r,a.g,a.b):(null==e||"#"!==e.charAt(0)||isNaN(a=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===e.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),t(o,s,l))}function dt(e,t,r){var n,i,a=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=e==o?(t-r)/s+(t0&&l<1?0:n),new Ue(n,i,l)}function pt(e,t,r){var n=it((.4124564*(e=ht(e))+.3575761*(t=ht(t))+.1804375*(r=ht(r)))/$e),i=it((.2126729*e+.7151522*t+.072175*r)/Je);return Xe(116*i-16,500*(n-i),200*(i-it((.0193339*e+.119192*t+.9503041*r)/Qe)))}function ht(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function vt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}ut.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,i=30;return t||r||n?(t&&t=200&&t<300||304===t){try{e=r.call(i,u)}catch(ga){return void o.error.call(i,ga)}o.load.call(i,e)}else o.error.call(i,u)}return self.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(e){var t=a.event;a.event=e;try{o.progress.call(i,u)}finally{a.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",i):t},i.responseType=function(e){return arguments.length?(c=e,i):c},i.response=function(e){return r=e,i},["get","post"].forEach((function(e){i[e]=function(){return i.send.apply(i,[e].concat(s(arguments)))}})),i.send=function(r,n,a){if(2===arguments.length&&"function"===typeof n&&(a=n,n=null),u.open(r,e,!0),null==t||"accept"in l||(l.accept=t+",*/*"),u.setRequestHeader)for(var s in l)u.setRequestHeader(s,l[s]);return null!=t&&u.overrideMimeType&&u.overrideMimeType(t),null!=c&&(u.responseType=c),null!=a&&i.on("error",a).on("load",(function(e){a(null,e)})),o.beforesend.call(i,u),u.send(null==n?null:n),i},i.abort=function(){return u.abort(),i},a.rebind(i,o,"on"),null==n?i:i.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(n))}mt.forEach((function(e,t){mt.set(e,st(t))})),a.functor=gt,a.xhr=yt(D),a.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function i(e,r,n){arguments.length<3&&(n=r,r=null);var i=xt(e,t,null==r?a:o(r),n);return i.row=function(e){return arguments.length?i.response(null==(r=e)?a:o(e)):r},i}function a(e){return i.parse(e.responseText)}function o(e){return function(t){return i.parse(t.responseText,e)}}function s(t){return t.map(l).join(e)}function l(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return i.parse=function(e,t){var r;return i.parseRows(e,(function(e,n){if(r)return r(e,n-1);var i=function(t){for(var r={},n=e.length,i=0;i=l)return o;if(i)return i=!1,a;var t=u;if(34===e.charCodeAt(t)){for(var r=t;r++24?(isFinite(t)&&(clearTimeout(kt),kt=setTimeout(St,t)),wt=0):(wt=1,Tt(St))}function At(){for(var e=Date.now(),t=bt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function Ct(){for(var e,t=bt,r=1/0;t;)t.c?(t.t1&&(t=e[a[o-2]],r=e[a[o-1]],n=e[s],(r[0]-t[0])*(n[1]-t[1])-(r[1]-t[1])*(n[0]-t[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function It(e,t){return e[0]-t[0]||e[1]-t[1]}a.timer=function(){Mt.apply(this,arguments)},a.timer.flush=function(){At(),Ct()},a.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},a.geom={},a.geom.hull=function(e){var t=Et,r=Pt;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,i=gt(t),a=gt(r),o=e.length,s=[],l=[];for(n=0;n=0;--n)p.push(e[s[u[n]][2]]);for(n=+f;nCe)s=s.L;else{if(!((i=a-Kt(s,o))>Ce)){n>-Ce?(t=s.P,r=s):i>-Ce?(t=s,r=s.N):t=r=s;break}if(!s.R){t=s;break}s=s.R}var l=Wt(e);if(Nt.insert(t,l),t||r){if(t===r)return tr(t),r=Wt(t.site),Nt.insert(l,r),l.edge=r.edge=ir(t.site,l.site),er(t),void er(r);if(r){tr(t),tr(r);var u=t.site,c=u.x,f=u.y,d=e.x-c,p=e.y-f,h=r.site,v=h.x-c,m=h.y-f,g=2*(d*m-p*v),y=d*d+p*p,x=v*v+m*m,b={x:(m*y-p*x)/g+c,y:(d*x-v*y)/g+f};or(r.edge,u,h,b),l.edge=ir(u,e,null,b),r.edge=ir(e,h,null,b),er(t),er(r)}else l.edge=ir(t.site,l.site)}}function Xt(e,t){var r=e.site,n=r.x,i=r.y,a=i-t;if(!a)return n;var o=e.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-t;if(!u)return s;var c=s-n,f=1/a-1/u,d=c/u;return f?(-d+Math.sqrt(d*d-2*f*(c*c/(-2*u)-l+u/2+i-a/2)))/f+n:(n+s)/2}function Kt(e,t){var r=e.N;if(r)return Xt(r,t);var n=e.site;return n.y===t?n.x:1/0}function $t(e){this.site=e,this.edges=[]}function Jt(e,t){return t.angle-e.angle}function Qt(){ur(this),this.x=this.y=this.arc=this.site=this.cy=null}function er(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,i=e.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,f=2*(l*(m=a.y-s)-u*c);if(!(f>=-Ee)){var d=l*l+u*u,p=c*c+m*m,h=(m*d-u*p)/f,v=(l*p-c*d)/f,m=v+s,g=Ut.pop()||new Qt;g.arc=e,g.site=i,g.x=h+o,g.y=m+Math.sqrt(h*h+v*v),g.cy=m,e.circle=g;for(var y=null,x=Bt._;x;)if(g.y=s)return;if(d>h){if(a){if(a.y>=u)return}else a={x:m,y:l};r={x:m,y:u}}else{if(a){if(a.y1)if(d>h){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(t/=d,d<0){if(t0){if(t>f)return;t>c&&(c=t)}if(t=i-l,d||!(t<0)){if(t/=d,d<0){if(t>f)return;t>c&&(c=t)}else if(d>0){if(t0)){if(t/=p,p<0){if(t0){if(t>f)return;t>c&&(c=t)}if(t=a-u,p||!(t<0)){if(t/=p,p<0){if(t>f)return;t>c&&(c=t)}else if(p>0){if(t0&&(e.a={x:l+c*d,y:u+c*p}),f<1&&(e.b={x:l+f*d,y:u+f*p}),e}}}}}),l=o.length;l--;)(!rr(t=o[l],e)||!s(t)||w(t.a.x-t.b.x)Ce||w(i-r)>Ce)&&(s.splice(o,0,new sr(ar(a.site,c,w(n-f)Ce?{x:f,y:w(t-f)Ce?{x:w(r-h)Ce?{x:d,y:w(t-d)Ce?{x:w(r-p)=r&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=e[s]})),t}function s(e){return e.map((function(e,t){return{x:Math.round(n(e,t)/Ce)*Ce,y:Math.round(i(e,t)/Ce)*Ce,i:t}}))}return o.links=function(e){return pr(s(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},o.triangles=function(e){var t=[];return pr(s(e)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,u=r.edges.sort(Jt),c=-1,f=u.length,d=u[f-1].edge,p=d.l===l?d.r:d.l;++ca&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:_r(r,n)})),a=Tr.lastIndex;return av&&(v=l.x),l.y>m&&(m=l.y),u.push(l.x),c.push(l.y);else for(f=0;fv&&(v=x),b>m&&(m=b),u.push(x),c.push(b)}var _=v-p,k=m-h;function T(e,t,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var l=e.x,u=e.y;if(null!=l)if(w(l-r)+w(u-n)<.01)M(e,t,r,n,i,a,o,s);else{var c=e.point;e.x=e.y=e.point=null,M(e,c,l,u,i,a,o,s),M(e,t,r,n,i,a,o,s)}else e.x=r,e.y=n,e.point=t}else M(e,t,r,n,i,a,o,s)}function M(e,t,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,f=n>=u,d=f<<1|c;e.leaf=!1,c?i=l:o=l,f?a=u:s=u,T(e=e.nodes[d]||(e.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,i,a,o,s)}_>k?m=h+_:v=p+k;var S={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){T(S,e,+g(e,++f),+y(e,f),p,h,v,m)},visit:function(e){yr(e,S,p,h,v,m)},find:function(e){return function(e,t,r,n,i,a,o){var s,l=1/0;return function e(u,c,f,d,p){if(!(c>a||f>o||d=_)<<1|t>=b,k=w+4;w=0&&!(r=a.interpolators[n](e,t)););return r}function Sr(e,t){var r,n=[],i=[],a=e.length,o=t.length,s=Math.min(e.length,t.length);for(r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Dr(e){return 1-Math.cos(e*Re)}function zr(e){return Math.pow(2,10*(e-1))}function Fr(e){return 1-Math.sqrt(1-e*e)}function jr(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function Nr(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function Zr(e){var t,r,n,i=[e.a,e.b],a=[e.c,e.d],o=Vr(i),s=Br(i,a),l=Vr(((t=a)[0]+=(n=-s)*(r=i)[0],t[1]+=n*r[1],t))||0;i[0]*a[1]=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):"in";return n=Cr.get(n)||Ar,i=Er.get(i)||D,t=i(n.apply(null,o.call(arguments,1))),function(e){return e<=0?0:e>=1?1:t(e)}},a.interpolateHcl=function(e,t){e=a.hcl(e),t=a.hcl(t);var r=e.h,n=e.c,i=e.l,o=t.h-r,s=t.c-n,l=t.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?t.c:n),isNaN(o)?(o=0,r=isNaN(r)?t.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return Ye(r+o*e,n+s*e,i+l*e)+""}},a.interpolateHsl=function(e,t){e=a.hsl(e),t=a.hsl(t);var r=e.h,n=e.s,i=e.l,o=t.h-r,s=t.s-n,l=t.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?t.s:n),isNaN(o)?(o=0,r=isNaN(r)?t.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return We(r+o*e,n+s*e,i+l*e)+""}},a.interpolateLab=function(e,t){e=a.lab(e),t=a.lab(t);var r=e.l,n=e.a,i=e.b,o=t.l-r,s=t.a-n,l=t.b-i;return function(e){return tt(r+o*e,n+s*e,i+l*e)+""}},a.interpolateRound=Nr,a.transform=function(e){var t=l.createElementNS(a.ns.prefix.svg,"g");return(a.transform=function(e){if(null!=e){t.setAttribute("transform",e);var r=t.transform.baseVal.consolidate()}return new Zr(r?r.matrix:Ur)})(e)},Zr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Ur={a:1,b:0,c:0,d:1,e:0,f:0};function Hr(e){return e.length?e.pop()+",":""}function Wr(e,t){var r=[],n=[];return e=a.transform(e),t=a.transform(t),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:_r(e[0],t[0])},{i:i-2,x:_r(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(e.translate,t.translate,r,n),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(Hr(r)+"rotate(",null,")")-2,x:_r(e,t)})):t&&r.push(Hr(r)+"rotate("+t+")")}(e.rotate,t.rotate,r,n),function(e,t,r,n){e!==t?n.push({i:r.push(Hr(r)+"skewX(",null,")")-2,x:_r(e,t)}):t&&r.push(Hr(r)+"skewX("+t+")")}(e.skew,t.skew,r,n),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push(Hr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:_r(e[0],t[0])},{i:i-2,x:_r(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(Hr(r)+"scale("+t+")")}(e.scale,t.scale,r,n),e=t=null,function(e){for(var t,i=-1,a=n.length;++i0?r=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:r=0})):t>0&&(l.start({type:"start",alpha:r=t}),e=Mt(s.tick)),s):r},s.start=function(){var e,t,r,a=g.length,l=y.length,c=u[0],h=u[1];for(e=0;e=0;)r.push(i[n])}function sn(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(a=e.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return sn(i,(function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)})),s}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(on(e,(function(e){e.children&&(e.value=0)})),sn(e,(function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},n},a.layout.partition=function(){var e=a.layout.hierarchy(),t=[1,1];function r(e,t,n,i){var a=e.children;if(e.x=t,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=t);return n}function _n(e){return e.reduce(wn,0)}function wn(e,t){return e+t[1]}function kn(e,t){return Tn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Tn(e,t){for(var r=-1,n=+e[0],i=(e[1]-n)/t,a=[];++r<=t;)a[r]=i*r+n;return a}function Mn(e){return[a.min(e),a.max(e)]}function Sn(e,t){return e.value-t.value}function An(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function Cn(e,t){e._pack_next=t,t._pack_prev=e}function En(e,t){var r=t.x-e.x,n=t.y-e.y,i=e.r+t.r;return.999*i*i>r*r+n*n}function Pn(e){if((t=e.children)&&(l=t.length)){var t,r,n,i,a,o,s,l,u=1/0,c=-1/0,f=1/0,d=-1/0;if(t.forEach(Ln),(r=t[0]).x=-r.r,r.y=0,x(r),l>1&&((n=t[1]).x=n.r,n.y=0,x(n),l>2))for(On(r,n,i=t[2]),x(i),An(r,i),r._pack_prev=i,An(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[a.bisect(d,l,1,h)-1]).y+=v,s.push(i[o]));return u}return i.value=function(e){return arguments.length?(t=e,i):t},i.range=function(e){return arguments.length?(r=gt(e),i):r},i.bins=function(e){return arguments.length?(n="number"===typeof e?function(t){return Tn(t,e)}:gt(e),i):n},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},a.layout.pack=function(){var e,t=a.layout.hierarchy().sort(Sn),r=0,n=[1,1];function i(i,a){var o=t.call(this,i,a),s=o[0],l=n[0],u=n[1],c=null==e?Math.sqrt:"function"===typeof e?e:function(){return e};if(s.x=s.y=0,sn(s,(function(e){e.r=+c(e.value)})),sn(s,Pn),r){var f=r*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;sn(s,(function(e){e.r+=f})),sn(s,Pn),sn(s,(function(e){e.r-=f}))}return Rn(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}return i.size=function(e){return arguments.length?(n=e,i):n},i.radius=function(t){return arguments.length?(e=null==t||"function"===typeof t?t:+t,i):e},i.padding=function(e){return arguments.length?(r=+e,i):r},an(i,t)},a.layout.tree=function(){var e=a.layout.hierarchy().sort(null).value(null),t=Dn,r=[1,1],n=null;function i(i,a){var u=e.call(this,i,a),c=u[0],f=function(e){for(var t,r={A:null,children:[e]},n=[r];null!=(t=n.pop());)for(var i,a=t.children,o=0,s=a.length;op.x&&(p=e),e.depth>h.depth&&(h=e)}));var v=t(d,p)/2-d.x,m=r[0]/(p.x+t(p,d)/2+v),g=r[1]/(h.depth||1);on(c,(function(e){e.x=(e.x+v)*m,e.y=e.depth*g}))}return u}function o(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r.length){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],u=a.m,c=o.m,f=s.m,d=l.m;s=Fn(s),a=zn(a),s&&a;)l=zn(l),(o=Fn(o)).a=e,(i=s.z+f-a.z-u+t(s._,a._))>0&&(jn(Nn(s,e,n),e,i),u+=i,c+=i),f+=s.m,u+=a.m,d+=l.m,c+=o.m;s&&!Fn(o)&&(o.t=s,o.m+=f-c),a&&!zn(l)&&(l.t=a,l.m+=u-d,n=e)}return n}(e,i,e.parent.A||n[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=r[0],e.y=e.depth*r[1]}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(n=null==(r=e)?l:null,i):n?null:r},i.nodeSize=function(e){return arguments.length?(n=null==(r=e)?null:l,i):n?r:null},an(i,e)},a.layout.cluster=function(){var e=a.layout.hierarchy().sort(null).value(null),t=Dn,r=[1,1],n=!1;function i(i,o){var s,l=e.call(this,i,o),u=l[0],c=0;sn(u,(function(e){var r=e.children;r&&r.length?(e.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(r),e.y=function(e){return 1+a.max(e,(function(e){return e.y}))}(r)):(e.x=s?c+=t(e,s):0,e.y=0,s=e)}));var f=Zn(u),d=Bn(u),p=f.x-t(f,d)/2,h=d.x+t(d,f)/2;return sn(u,n?function(e){e.x=(e.x-u.x)*r[0],e.y=(u.y-e.y)*r[1]}:function(e){e.x=(e.x-p)/(h-p)*r[0],e.y=(1-(u.y?e.y/u.y:1))*r[1]}),l}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(n=null==(r=e),i):n?null:r},i.nodeSize=function(e){return arguments.length?(n=null!=(r=e),i):n?r:null},an(i,e)},a.layout.treemap=function(){var e,t=a.layout.hierarchy(),r=Math.round,n=[1,1],i=null,o=Vn,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(e,t){for(var r,n,i=-1,a=e.length;++i0;)s.push(r=u[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,v))<=d?(u.pop(),d=n):(s.area-=s.pop().area,h(s,v,a,!1),v=Math.min(a.dx,a.dy),s.length=s.area=0,d=1/0);s.length&&(h(s,v,a,!0),s.length=s.area=0),t.forEach(f)}}function d(e){var t=e.children;if(t&&t.length){var r,n=o(e),i=t.slice(),a=[];for(c(i,n.dx*n.dy/e.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(h(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);t.forEach(d)}}function p(e,t){for(var r,n=e.area,i=0,a=1/0,o=-1,s=e.length;++oi&&(i=r));return t*=t,(n*=n)?Math.max(t*i*u/n,n/(t*a*u)):1/0}function h(e,t,n,i){var a,o=-1,s=e.length,l=n.x,u=n.y,c=t?r(e.area/t):0;if(t==n.dx){for((i||c>n.dy)&&(c=n.dy);++on.dx)&&(c=n.dx);++o1);return e+t*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=a.random.normal.apply(a,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=a.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,r=0;r2?Kn:Gn,l=n?qr:Gr;return i=o(e,t,l,r),a=o(t,e,l,Mr),s}function s(e){return i(e)}return s.invert=function(e){return a(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},s.range=function(e){return arguments.length?(t=e,o()):t},s.rangeRound=function(e){return s.range(e).interpolate(Nr)},s.clamp=function(e){return arguments.length?(n=e,o()):n},s.interpolate=function(e){return arguments.length?(r=e,o()):r},s.ticks=function(t){return ti(e,t)},s.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},s.nice=function(t){return Qn(e,t),o()},s.copy=function(){return $n(e,t,r,n)},o()}function Jn(e,t){return a.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Qn(e,t){return qn(e,Yn(ei(e,t)[2])),qn(e,Yn(ei(e,t)[2])),e}function ei(e,t){null==t&&(t=10);var r=Hn(e),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),a=t/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function ti(e,t){return a.range.apply(a,ei(e,t))}function ri(e,t,r,n){function i(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function a(e){return r?Math.pow(t,e):-Math.pow(t,-e)}function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(r=t[0]>=0,e.domain((n=t.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(t=+r,e.domain(n.map(i)),o):t},o.nice=function(){var t=qn(n.map(i),r?Math:ni);return e.domain(t),n=t.map(a),o},o.ticks=function(){var e=Hn(n),o=[],s=e[0],l=e[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=t%1?2:t;if(isFinite(c-u)){if(r){for(;u0;d--)o.push(a(u)*d);for(u=0;o[u]l;c--);o=o.slice(u,c)}return o},o.copy=function(){return ri(e.copy(),t,r,n)},Jn(o,e)}a.scale.linear=function(){return $n([0,1],[0,1],Mr,!1)},a.scale.log=function(){return ri(a.scale.linear().domain([0,1]),10,!0,[1,10])};var ni={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function ii(e,t,r){var n=ai(t),i=ai(1/t);function a(t){return e(n(t))}return a.invert=function(t){return i(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain((r=t.map(Number)).map(n)),a):r},a.ticks=function(e){return ti(r,e)},a.tickFormat=function(e,t){return d3_scale_linearTickFormat(r,e,t)},a.nice=function(e){return a.domain(Qn(r,e))},a.exponent=function(o){return arguments.length?(n=ai(t=o),i=ai(1/t),e.domain(r.map(n)),a):t},a.copy=function(){return ii(e.copy(),t,r)},Jn(a,e)}function ai(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function oi(e,t){var r,n,i;function o(i){return n[((r.get(i)||("range"===t.t?r.set(i,e.push(i)):NaN))-1)%n.length]}function s(t,r){return a.range(e.length).map((function(e){return t+r*e}))}return o.domain=function(n){if(!arguments.length)return e;e=[],r=new T;for(var i,a=-1,s=n.length;++a0?r[n-1]:e[0],nf?0:1;if(u=Ie)return l(u,p)+(s?l(s,1-p):"")+"Z";var h,v,m,g,y,x,b,_,w,k,T,M,S=0,A=0,C=[];if((g=(+o.apply(this,arguments)||0)/2)&&(m=n===mi?Math.sqrt(s*s+u*u):+n.apply(this,arguments),p||(A*=-1),u&&(A=ze(m/u*Math.sin(g))),s&&(S=ze(m/s*Math.sin(g)))),u){y=u*Math.cos(c+A),x=u*Math.sin(c+A),b=u*Math.cos(f-A),_=u*Math.sin(f-A);var E=Math.abs(f-c-2*A)<=Pe?0:1;if(A&&wi(y,x,b,_)===p^E){var P=(c+f)/2;y=u*Math.cos(P),x=u*Math.sin(P),b=_=null}}else y=x=0;if(s){w=s*Math.cos(f-S),k=s*Math.sin(f-S),T=s*Math.cos(c+S),M=s*Math.sin(c+S);var L=Math.abs(c-f+2*S)<=Pe?0:1;if(S&&wi(w,k,T,M)===1-p^L){var I=(c+f)/2;w=s*Math.cos(I),k=s*Math.sin(I),T=M=null}}else w=k=0;if(d>Ce&&(h=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){v=s0?0:1}function ki(e,t,r,n,i){var a=e[0]-t[0],o=e[1]-t[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=e[0]+l,f=e[1]+u,d=t[0]+l,p=t[1]+u,h=(c+d)/2,v=(f+p)/2,m=d-c,g=p-f,y=m*m+g*g,x=r-n,b=c*p-d*f,_=(g<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*g-m*_)/y,k=(-b*m-g*_)/y,T=(b*g+m*_)/y,M=(-b*m+g*_)/y,S=w-h,A=k-v,C=T-h,E=M-v;return S*S+A*A>C*C+E*E&&(w=T,k=M),[[w-l,k-u],[w*r/x,k*r/x]]}function Ti(){return!0}function Mi(e){var t=Et,r=Pt,n=Ti,i=Ai,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,f=a.length,d=gt(t),p=gt(r);function h(){l.push("M",i(e(u),o))}for(;++c1&&i.push("H",n[0]),i.join("")},"step-before":Ei,"step-after":Pi,basis:Ri,"basis-open":function(e){if(e.length<4)return Ai(e);for(var t,r=[],n=-1,i=e.length,a=[0],o=[0];++n<3;)t=e[n],a.push(t[0]),o.push(t[1]);for(r.push(Oi(Fi,a)+","+Oi(Fi,o)),--n;++n9&&(i=3*t/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(e))}});function Ai(e){return e.length>1?e.join("L"):e+"Z"}function Ci(e){return e.join("L")+"Z"}function Ei(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t1){s=t[1],a=e[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;uPe)+",1 "+t}function l(e,t,r,n){return"Q 0,0 "+n}return a.radius=function(e){return arguments.length?(r=gt(e),a):r},a.source=function(t){return arguments.length?(e=gt(t),a):e},a.target=function(e){return arguments.length?(t=gt(e),a):t},a.startAngle=function(e){return arguments.length?(n=gt(e),a):n},a.endAngle=function(e){return arguments.length?(i=gt(e),a):i},a},a.svg.diagonal=function(){var e=Vi,t=Ui,r=Wi;function n(n,i){var a=e.call(this,n,i),o=t.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(t){return arguments.length?(e=gt(t),n):e},n.target=function(e){return arguments.length?(t=gt(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},a.svg.diagonal.radial=function(){var e=a.svg.diagonal(),t=Wi,r=e.projection;return e.projection=function(e){return arguments.length?r(function(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Re;return[r*Math.cos(n),r*Math.sin(n)]}}(t=e)):t},e},a.svg.symbol=function(){var e=qi,t=Gi;function r(r,n){return(Xi.get(e.call(this,r,n))||Yi)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=gt(t),r):e},r.size=function(e){return arguments.length?(t=gt(e),r):t},r};var Xi=a.map({circle:Yi,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*$i)),r=t*$i;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Ki),r=t*Ki/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Ki),r=t*Ki/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});a.svg.symbolTypes=Xi.keys();var Ki=Math.sqrt(3),$i=Math.tan(30*Oe);$.transition=function(e){for(var t,r,n=ta||++ia,i=sa(e),a=[],o=ra||{time:Date.now(),ease:Or,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--d].call(e,o);if(a>=1)return f.event&&f.event.end.call(e,e.__data__,t),--c.count?delete c[n]:delete e[r],1}f||(a=i.time,o=Mt((function(e){var t=f.delay;if(o.t=t+a,t<=e)return d(e-t);o.c=d}),0,a),f=c[n]={tween:new T,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++c.count)}na.call=$.call,na.empty=$.empty,na.node=$.node,na.size=$.size,a.transition=function(e,t){return e&&e.transition?ta?e.transition(t):e:a.selection().transition(e)},a.transition.prototype=na,na.select=function(e){var t,r,n,i=this.id,a=this.namespace,o=[];e=J(e);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",o[1]-o[0])}function v(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function m(){var f,m,g=this,y=a.select(a.event.target),x=r.of(g,arguments),b=a.select(g),_=y.datum(),w=!/^(n|s)$/.test(_)&&n,k=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),M=Te(g),S=a.mouse(g),A=a.select(c(g)).on("keydown.brush",(function(){32==a.event.keyCode&&(T||(f=null,S[0]-=o[1],S[1]-=s[1],T=2),V())})).on("keyup.brush",(function(){32==a.event.keyCode&&2==T&&(S[0]+=o[1],S[1]+=s[1],T=0,V())}));if(a.event.changedTouches?A.on("touchmove.brush",P).on("touchend.brush",I):A.on("mousemove.brush",P).on("mouseup.brush",I),b.interrupt().selectAll("*").interrupt(),T)S[0]=o[0]-S[0],S[1]=s[0]-S[1];else if(_){var C=+/w$/.test(_),E=+/^n/.test(_);m=[o[1-C]-S[0],s[1-E]-S[1]],S[0]=o[C],S[1]=s[E]}else a.event.altKey&&(f=S.slice());function P(){var e=a.mouse(g),t=!1;m&&(e[0]+=m[0],e[1]+=m[1]),T||(a.event.altKey?(f||(f=[(o[0]+o[1])/2,(s[0]+s[1])/2]),S[0]=o[+(e[0]>>1;t.dtype||(t.dtype="array"),"string"===typeof t.dtype?h=new(f(t.dtype))(m):t.dtype&&(h=t.dtype,Array.isArray(h)&&(h.length=m));for(var g=0;gr||s>1073741824){for(var d=0;dr+i||S>n+i||A=P)&&o!==s){var l=y[a];void 0===s&&(s=l.length);for(var u=o;u=m&&f<=w&&d>=g&&d<=k&&L.push(c)}var p=x[a],h=p[4*o+0],v=p[4*o+1],b=p[4*o+2],_=p[4*o+3],T=function(e,t){for(var r=null,n=0;null===r;)if(r=e[4*t+n],++n>e.length)return null;return r}(p,o+1),C=.5*i,I=a+1;t(r,n,C,I,h,v||b||_||T),t(r,n+C,C,I,v,b||_||T),t(r+C,n,C,I,b,_||T),t(r+C,n+C,C,I,_,T)}}(0,0,1,0,0,1),L},h;function C(e,t,r){for(var n=1,i=.5,a=.5,o=.5,s=0;s0){t+=Math.abs(o(e[0]));for(var r=1;r2){for(l=0;l=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=f,t.lengthToDegrees=function(e,t){return d(f(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=d,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(f(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=p,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!p(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},60302:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(23132);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,u,c,f,d=0,p=0,h=e.type,v="FeatureCollection"===h,m="Feature"===h,g=v?e.features.length:1,y=0;yu||p>c||h>f)return l=i,u=r,c=p,f=h,void(o=0);var v=n.lineString([l,i],e.properties);if(!1===t(v,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;se[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=f,t.lengthToDegrees=function(e,t){return d(f(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=d,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(f(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=p,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!p(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},27138:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(94228);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,u,c,f,d=0,p=0,h=e.type,v="FeatureCollection"===h,m="Feature"===h,g=v?e.features.length:1,y=0;yu||p>c||h>f)return l=i,u=r,c=p,f=h,void(o=0);var v=n.lineString([l,i],e.properties);if(!1===t(v,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=f,t.lengthToDegrees=function(e,t){return d(f(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=d,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(f(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=p,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!p(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")},t.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},t.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},t.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},t.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},t.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},t.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},t.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},88553:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(64182);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,u,c,f,d=0,p=0,h=e.type,v="FeatureCollection"===h,m="Feature"===h,g=v?e.features.length:1,y=0;yu||p>c||h>f)return l=i,u=r,c=p,f=h,void(o=0);var v=n.lineString([l,i],e.properties);if(!1===t(v,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;si&&(i=e[o]),e[o]1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;ie.length)&&(r=e.length),e.substring(r-t.length,r)===t}var m="",g="",y="",x="",b={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function w(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function k(e,t,r){var i="",a="",o=0,s="",l=!1,u=w(e),c=u.split("\n"),f=w(t).split("\n"),p=0,h="";if("strictEqual"===r&&"object"===d(e)&&"object"===d(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===f.length&&c[0]!==f[0]){var _=c[0].length+f[0].length;if(_<=10){if(("object"!==d(e)||null===e)&&("object"!==d(t)||null===t)&&(0!==e||0!==t))return"".concat(b[r],"\n\n")+"".concat(c[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&_<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;c[0][p]===f[0][p];)p++;p>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",p),"^"),p=0)}}for(var k=c[c.length-1],T=f[f.length-1];k===T&&(p++<2?s="\n ".concat(k).concat(s):i=k,c.pop(),f.pop(),0!==c.length&&0!==f.length);)k=c[c.length-1],T=f[f.length-1];var M=Math.max(c.length,f.length);if(0===M){var S=u.split("\n");if(S.length>30)for(S[26]="".concat(m,"...").concat(x);S.length>27;)S.pop();return"".concat(b.notIdentical,"\n\n").concat(S.join("\n"),"\n")}p>3&&(s="\n".concat(m,"...").concat(x).concat(s),l=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var A=0,C=b[r]+"\n".concat(g,"+ actual").concat(x," ").concat(y,"- expected").concat(x),E=" ".concat(m,"...").concat(x," Lines skipped");for(p=0;p1&&p>2&&(P>4?(a+="\n".concat(m,"...").concat(x),l=!0):P>3&&(a+="\n ".concat(f[p-2]),A++),a+="\n ".concat(f[p-1]),A++),o=p,i+="\n".concat(y,"-").concat(x," ").concat(f[p]),A++;else if(f.length1&&p>2&&(P>4?(a+="\n".concat(m,"...").concat(x),l=!0):P>3&&(a+="\n ".concat(c[p-2]),A++),a+="\n ".concat(c[p-1]),A++),o=p,a+="\n".concat(g,"+").concat(x," ").concat(c[p]),A++;else{var L=f[p],I=c[p],R=I!==L&&(!v(I,",")||I.slice(0,-1)!==L);R&&v(L,",")&&L.slice(0,-1)===I&&(R=!1,I+=","),R?(P>1&&p>2&&(P>4?(a+="\n".concat(m,"...").concat(x),l=!0):P>3&&(a+="\n ".concat(c[p-2]),A++),a+="\n ".concat(c[p-1]),A++),o=p,a+="\n".concat(g,"+").concat(x," ").concat(I),i+="\n".concat(y,"-").concat(x," ").concat(L),A+=2):(a+=i,i="",1!==P&&0!==p||(a+="\n ".concat(I),A++))}if(A>20&&p30)for(T[26]="".concat(m,"...").concat(x);T.length>27;)T.pop();r=1===T.length?o(this,f(t).call(this,"".concat(v," ").concat(T[0]))):o(this,f(t).call(this,"".concat(v,"\n\n").concat(T.join("\n"),"\n")))}else{var M=w(u),S="",A=b[a];"notDeepEqual"===a||"notEqual"===a?(M="".concat(b[a],"\n\n").concat(M)).length>1024&&(M="".concat(M.slice(0,1021),"...")):(S="".concat(w(c)),M.length>512&&(M="".concat(M.slice(0,509),"...")),S.length>512&&(S="".concat(S.slice(0,509),"...")),"deepEqual"===a||"equal"===a?M="".concat(A,"\n\n").concat(M,"\n\nshould equal\n\n"):S=" ".concat(a," ").concat(S)),r=o(this,f(t).call(this,"".concat(M).concat(S)))}return Error.stackTraceLimit=p,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=u,r.expected=c,r.operator=a,Error.captureStackTrace&&Error.captureStackTrace(s(r),l),r.stack,r.name="AssertionError",o(r)}var r,l,u;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,e),r=t,l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(e,t){return p(this,function(e){for(var t=1;t2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(e,t,i){var a,o,l,u;if(void 0===s&&(s=r(32791)),s("string"===typeof e,"'name' must be a string"),"string"===typeof t&&(o="not ",t.substr(!l||l<0?0:+l,o.length)===o)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))u="The ".concat(e," ").concat(a," ").concat(f(t,"type"));else{var c=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";u='The "'.concat(e,'" ').concat(c," ").concat(a," ").concat(f(t,"type"))}return u+=". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===l&&(l=r(43827));var i=l.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n0,"At least one arg needs to be specified");var i="The ",a=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),a){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,a-1).join(", "),i+=", and ".concat(t[a-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=u},74061:function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(l){i=!0,a=l}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var a=void 0!==/a/g.flags,o=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},s=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:r(64003),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},c=Number.isNaN?Number.isNaN:r(15567);function f(e){return e.call.bind(e)}var d=f(Object.prototype.hasOwnProperty),p=f(Object.prototype.propertyIsEnumerable),h=f(Object.prototype.toString),v=r(43827).types,m=v.isAnyArrayBuffer,g=v.isArrayBufferView,y=v.isDate,x=v.isMap,b=v.isRegExp,_=v.isSet,w=v.isNativeError,k=v.isBoxedPrimitive,T=v.isNumberObject,M=v.isStringObject,S=v.isBooleanObject,A=v.isBigIntObject,C=v.isSymbolObject,E=v.isFloat32Array,P=v.isFloat64Array;function L(e){if(0===e.length||e.length>10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function I(e){return Object.keys(e).filter(L).concat(u(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function R(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i0?o-4:o;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},91358:function(e){"use strict";function t(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}e.exports={ge:function(e,r,n,i,a){return o(e,r,n,i,a,t)},gt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},lt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},le:function(e,t,r,n,a){return o(e,t,r,n,a,i)},eq:function(e,t,r,n,i){return o(e,t,r,n,i,a)}}},13547:function(e,t){"use strict";function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},44781:function(e,t,r){"use strict";var n=r(53435);e.exports=function(e,t){t||(t={});var r,o,s,l,u,c,f,d,p,h,v,m=null==t.cutoff?.25:t.cutoff,g=null==t.radius?8:t.radius,y=t.channel||0;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,o=t.height,l=e,c=t.stride?t.stride:Math.floor(e.length/r/o)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(f=(d=e).getContext("2d"),r=d.width,o=d.height,l=(p=f.getImageData(0,0,r,o)).data,c=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(f=e,r=(d=e.canvas).width,o=d.height,l=(p=f.getImageData(0,0,r,o)).data,c=4):window.ImageData&&e instanceof window.ImageData&&(p=e,r=e.width,o=e.height,l=p.data,c=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(r*o),h=0,v=u.length;h-1?i(r):r}},68222:function(e,t,r){"use strict";var n=r(77575),i=r(68318),a=i("%Function.prototype.apply%"),o=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(o,a),l=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),c=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(d){u=null}e.exports=function(e){var t=s(n,o,arguments);return l&&u&&l(t,"length").configurable&&u(t,"length",{value:1+c(0,e.length-(arguments.length-1))}),t};var f=function(){return s(n,a,arguments)};u?u(e.exports,"apply",{value:f}):e.exports.apply=f},53435:function(e){e.exports=function(e,t,r){return tr?r:e:et?t:e}},6475:function(e,t,r){"use strict";var n=r(53435);function i(e,t){null==t&&(t=!0);var r=e[0],i=e[1],a=e[2],o=e[3];return null==o&&(o=t?1:255),t&&(r*=255,i*=255,a*=255,o*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((a=255&n(a,0,255))<<8)+(o=255&n(o,0,255))}e.exports=i,e.exports.to=i,e.exports.from=function(e,t){var r=(e=+e)>>>24,n=(16711680&e)>>>16,i=(65280&e)>>>8,a=255&e;return!1===t?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},76857:function(e){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},25075:function(e,t,r){"use strict";var n=r(36652),i=r(53435),a=r(90660);e.exports=function(e,t){"float"!==t&&t||(t="array"),"uint"===t&&(t="uint8"),"uint_clamped"===t&&(t="uint8_clamped");var r=new(a(t))(4),o="uint8"!==t&&"uint8_clamped"!==t;return e.length&&"string"!==typeof e||((e=n(e))[0]/=255,e[1]/=255,e[2]/=255),function(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||!!(Array.isArray(e)&&(e[0]>1||0===e[0])&&(e[1]>1||0===e[1])&&(e[2]>1||0===e[2])&&(!e[3]||e[3]>1))}(e)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=null!=e[3]?e[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=null!=e[3]?e[3]:1):(r[0]=i(Math.floor(255*e[0]),0,255),r[1]=i(Math.floor(255*e[1]),0,255),r[2]=i(Math.floor(255*e[2]),0,255),r[3]=null==e[3]?255:i(Math.floor(255*e[3]),0,255)),r)}},90736:function(e,t,r){"use strict";var n=r(76857),i=r(10973),a=r(46775);e.exports=function(e){var t,s,l=[],u=1;if("string"===typeof e)if(n[e])l=n[e].slice(),s="rgb";else if("transparent"===e)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var c=e.slice(1);u=1,(p=c.length)<=4?(l=[parseInt(c[0]+c[0],16),parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16)],4===p&&(u=parseInt(c[3]+c[3],16)/255)):(l=[parseInt(c[0]+c[1],16),parseInt(c[2]+c[3],16),parseInt(c[4]+c[5],16)],8===p&&(u=parseInt(c[6]+c[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var f=t[1],d="rgb"===f;s=c=f.replace(/a$/,"");var p="cmyk"===c?4:"gray"===c?1:3;l=t[2].trim().split(/\s*,\s*/).map((function(e,t){if(/%$/.test(e))return t===p?parseFloat(e)/100:"rgb"===c?255*parseFloat(e)/100:parseFloat(e);if("h"===c[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==o[e])return o[e]}return parseFloat(e)})),f===c&&l.push(1),u=d||void 0===l[p]?1:l[p],l=l.slice(0,p)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(l=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),s=e.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(e))if(i(e)){var h=a(e.r,e.red,e.R,null);null!==h?(s="rgb",l=[h,a(e.g,e.green,e.G),a(e.b,e.blue,e.B)]):(s="hsl",l=[a(e.h,e.hue,e.H),a(e.s,e.saturation,e.S),a(e.l,e.lightness,e.L,e.b,e.brightness)]),u=a(e.a,e.alpha,e.opacity,1),null!=e.opacity&&(u/=100)}else(Array.isArray(e)||r.g.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(e))&&(l=[e[0],e[1],e[2]],s="rgb",u=4===e.length?e[3]:1);else s="rgb",l=[e>>>16,(65280&e)>>>8,255&e];return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}},36652:function(e,t,r){"use strict";var n=r(90736),i=r(80009),a=r(53435);e.exports=function(e){var t,r=n(e);return r.space?((t=Array(3))[0]=a(r.values[0],0,255),t[1]=a(r.values[1],0,255),t[2]=a(r.values[2],0,255),"h"===r.space[0]&&(t=i.rgb(t)),t.push(a(r.alpha,0,1)),t):[]}},80009:function(e,t,r){"use strict";var n=r(6866);e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t,r,n,i,a,o=e[0]/360,s=e[1]/100,l=e[2]/100;if(0===s)return[a=255*l,a,a];t=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[u]=255*a;return i}},n.hsl=function(e){var t,r,n=e[0]/255,i=e[1]/255,a=e[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?t=0:n===s?t=(i-a)/l:i===s?t=2+(a-n)/l:a===s&&(t=4+(n-i)/l),(t=Math.min(60*t,360))<0&&(t+=360),r=(o+s)/2,[t,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},6866:function(e){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},24138:function(e){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},72791:function(e,t,r){"use strict";e.exports={parse:r(41004),stringify:r(53313)}},63625:function(e,t,r){"use strict";var n=r(40402);e.exports={isSize:function(e){return/^[\d\.]/.test(e)||-1!==e.indexOf("/")||-1!==n.indexOf(e)}}},41004:function(e,t,r){"use strict";var n=r(90448),i=r(38732),a=r(41901),o=r(15659),s=r(96209),l=r(83794),u=r(99011),c=r(63625).isSize;e.exports=d;var f=d.cache={};function d(e){if("string"!==typeof e)throw new Error("Font argument must be a string.");if(f[e])return f[e];if(""===e)throw new Error("Cannot parse an empty string.");if(-1!==a.indexOf(e))return f[e]={system:e};for(var t,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},d=u(e,/\s+/);t=d.shift();){if(-1!==i.indexOf(t))return["style","variant","weight","stretch"].forEach((function(e){r[e]=t})),f[e]=r;if(-1===s.indexOf(t))if("normal"!==t&&"small-caps"!==t)if(-1===l.indexOf(t)){if(-1===o.indexOf(t)){if(c(t)){var h=u(t,"/");if(r.size=h[0],null!=h[1]?r.lineHeight=p(h[1]):"/"===d[0]&&(d.shift(),r.lineHeight=p(d.shift())),!d.length)throw new Error("Missing required font-family.");return r.family=u(d.join(" "),/\s*,\s*/).map(n),f[e]=r}throw new Error("Unknown or unsupported font token: "+t)}r.weight=t}else r.stretch=t;else r.variant=t;else r.style=t}throw new Error("Missing required font-size.")}function p(e){var t=parseFloat(e);return t.toString()===e?t:e}},53313:function(e,t,r){"use strict";var n=r(71299),i=r(63625).isSize,a=v(r(38732)),o=v(r(41901)),s=v(r(15659)),l=v(r(96209)),u=v(r(83794)),c={normal:1,"small-caps":1},f={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},d="1rem",p="serif";function h(e,t){if(e&&!t[e]&&!a[e])throw Error("Unknown keyword `"+e+"`");return e}function v(e){for(var t={},r=0;rt?1:e>=t?0:NaN}r.d(t,{j2:function(){return n},Fp:function(){return o},J6:function(){return l},TS:function(){return u},VV:function(){return c},w6:function(){return f},Sm:function(){return d}});var i=function(e){var t;return 1===e.length&&(t=e,e=function(e,r){return n(t(e),r)}),{left:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}(n),a=(i.right,i.left,Array.prototype);function o(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n}function s(e){return null===e?NaN:+e}function l(e,t){var r,n=e.length,i=n,a=-1,o=0;if(null==t)for(;++a=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r}function c(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function f(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),a=new Array(i);++n=n.length)return null!=e&&r.sort(e),null!=t?t(r):r;for(var u,c,f,d=-1,p=r.length,h=n[i++],v=o(),m=s();++dn.length)return e;var a,o=i[r-1];return null!=t&&r>=n.length?a=e.entries():(a=[],e.each((function(e,t){a.push({key:t,values:s(e,r)})}))),null!=o?a.sort((function(e,t){return o(e.key,t.key)})):a}return r={object:function(e){return a(e,0,l,u)},map:function(e){return a(e,0,c,f)},entries:function(e){return s(a(e,0,c,f),0)},key:function(e){return n.push(e),r},sortKeys:function(e){return i[n.length-1]=e,r},sortValues:function(t){return e=t,r},rollup:function(e){return t=e,r}}}function l(){return{}}function u(e,t,r){e[t]=r}function c(){return o()}function f(e,t,r){e.set(t,r)}function d(){}var p=o.prototype;d.prototype=function(e,t){var r=new d;if(e instanceof d)e.each((function(e){r.add(e)}));else if(e){var n=-1,i=e.length;if(null==t)for(;++n=(a=(v+g)/2))?v=a:g=a,(c=r>=(o=(m+y)/2))?m=o:y=o,i=p,!(p=p[f=c<<1|u]))return i[f]=h,e;if(s=+e._x.call(null,p.data),l=+e._y.call(null,p.data),t===s&&r===l)return h.next=p,i?i[f]=h:e._root=h,e;do{i=i?i[f]=new Array(4):e._root=new Array(4),(u=t>=(a=(v+g)/2))?v=a:g=a,(c=r>=(o=(m+y)/2))?m=o:y=o}while((f=c<<1|u)===(d=(l>=o)<<1|s>=a));return i[d]=p,i[f]=h,e}function s(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function l(e){return e[0]}function u(e){return e[1]}function c(e,t,r){var n=new f(null==t?l:t,null==r?u:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function f(e,t,r,n,i,a){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function d(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}r.r(t),r.d(t,{forceCenter:function(){return n},forceCollide:function(){return m},forceLink:function(){return b},forceManyBody:function(){return K},forceRadial:function(){return $},forceSimulation:function(){return X},forceX:function(){return J},forceY:function(){return Q}});var p=c.prototype=f.prototype;function h(e){return e.x+e.vx}function v(e){return e.y+e.vy}function m(e){var t,r,n=1,o=1;function s(){for(var e,i,s,u,f,d,p,m=t.length,g=0;gu+h||if+h||os.index){var v=u-l.x-l.vx,m=f-l.y-l.vy,g=v*v+m*m;ge.r&&(e.r=e[t].r)}function u(){if(t){var n,i,a=t.length;for(r=new Array(a),n=0;nf&&(f=n),id&&(d=i));if(u>f||c>d)return this;for(this.cover(u,c).cover(f,d),r=0;re||e>=i||n>t||t>=a;)switch(s=(tp||(a=u.y0)>h||(o=u.x1)=y)<<1|e>=g)&&(u=v[v.length-1],v[v.length-1]=v[v.length-1-c],v[v.length-1-c]=u)}else{var x=e-+this._x.call(null,m.data),b=t-+this._y.call(null,m.data),_=x*x+b*b;if(_=(s=(h+m)/2))?h=s:m=s,(c=o>=(l=(v+g)/2))?v=l:g=l,t=p,!(p=p[f=c<<1|u]))return this;if(!p.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(r=t,d=f)}for(;p.data!==e;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):t?(i?t[f]=i:delete t[f],(p=t[0]||t[1]||t[2]||t[3])&&p===(t[3]||t[2]||t[1]||t[0])&&!p.length&&(r?r[d]=p:this._root=p),this):(this._root=i,this)},p.removeAll=function(e){for(var t=0,r=e.length;t=0&&(t=e.slice(r+1),e=e.slice(0,r)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!==typeof t)throw new Error("invalid callback: "+t);for(;++o0)for(var r,n,i=new Array(r),a=0;a=0&&t._call.call(null,e),t=t._next;--E}()}finally{E=0,function(){for(var e,t,r=S,n=1/0;r;)r._call?(n>r._time&&(n=r._time),e=r,r=r._next):(t=r._next,r._next=null,r=e?e._next=t:S=t);A=e,H(n)}(),O=0}}function U(){var e=z.now(),t=e-R;t>I&&(D-=t,R=e)}function H(e){E||(P&&(P=clearTimeout(P)),e-O>24?(e<1/0&&(P=setTimeout(V,e-z.now()-D)),L&&(L=clearInterval(L))):(L||(R=z.now(),L=setInterval(U,I)),E=1,F(V)))}function W(e){return e.x}function G(e){return e.y}Z.prototype=B.prototype={constructor:Z,restart:function(e,t,r){if("function"!==typeof e)throw new TypeError("callback is not a function");r=(null==r?j():+r)+(null==t?0:+t),this._next||A===this||(A?A._next=this:S=this,A=this),this._call=e,this._time=r,H()},stop:function(){this._call&&(this._call=null,this._time=1/0,H())}};var q=10,Y=Math.PI*(3-Math.sqrt(5));function X(e){var t,r=1,n=.001,i=1-Math.pow(n,1/300),a=0,o=.6,s=(0,g.UI)(),l=B(c),u=C("tick","end");function c(){f(),u.call("tick",t),r1?(null==r?s.remove(e):s.set(e,p(r)),t):s.get(e)},find:function(t,r,n){var i,a,o,s,l,u=0,c=e.length;for(null==n?n=1/0:n*=n,u=0;u1?(u.on(e,r),t):u.on(e)}}}function K(){var e,t,r,n,o=i(-30),s=1,l=1/0,u=.81;function f(n){var i,a=e.length,o=c(e,W,G).visitAfter(p);for(r=n,i=0;i=l)){(e.data!==t||e.next)&&(0===f&&(h+=(f=a())*f),0===d&&(h+=(d=a())*d),h1?n[0]+n.slice(2):n,+e.slice(r+1)]}r.d(t,{WU:function(){return d},FF:function(){return v}});var i,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(e){if(!(t=a.exec(e)))throw new Error("invalid format: "+e);var t;return new s({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function s(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function l(e,t){var r=n(e,t);if(!r)return e+"";var i=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}o.prototype=s.prototype,s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var u={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return l(100*e,t)},r:l,s:function(e,t){var r=n(e,t);if(!r)return e+"";var a=r[0],o=r[1],s=o-(i=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+n(e,Math.max(0,t+s-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function c(e){return e}var f,d,p=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function v(e){var t,r,a=void 0===e.grouping||void 0===e.thousands?c:(t=p.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var i=e.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(e.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[o=(o+1)%t.length];return a.reverse().join(r)}),s=void 0===e.currency?"":e.currency[0]+"",l=void 0===e.currency?"":e.currency[1]+"",f=void 0===e.decimal?".":e.decimal+"",d=void 0===e.numerals?c:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(p.call(e.numerals,String)),v=void 0===e.percent?"%":e.percent+"",m=void 0===e.minus?"-":e.minus+"",g=void 0===e.nan?"NaN":e.nan+"";function y(e){var t=(e=o(e)).fill,r=e.align,n=e.sign,c=e.symbol,p=e.zero,y=e.width,x=e.comma,b=e.precision,_=e.trim,w=e.type;"n"===w?(x=!0,w="g"):u[w]||(void 0===b&&(b=12),_=!0,w="g"),(p||"0"===t&&"="===r)&&(p=!0,t="0",r="=");var k="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T="$"===c?l:/[%p]/.test(w)?v:"",M=u[w],S=/[defgprs%]/.test(w);function A(e){var o,s,l,u=k,c=T;if("c"===w)c=M(e)+c,e="";else{var v=(e=+e)<0||1/e<0;if(e=isNaN(e)?g:M(Math.abs(e),b),_&&(e=function(e){e:for(var t,r=e.length,n=1,i=-1;n0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),v&&0===+e&&"+"!==n&&(v=!1),u=(v?"("===n?n:m:"-"===n||"("===n?"":n)+u,c=("s"===w?h[8+i/3]:"")+c+(v&&"("===n?")":""),S)for(o=-1,s=e.length;++o(l=e.charCodeAt(o))||l>57){c=(46===l?f+e.slice(o+1):e.slice(o))+c,e=e.slice(0,o);break}}x&&!p&&(e=a(e,1/0));var A=u.length+e.length+c.length,C=A>1)+u+e+c+C.slice(A);break;default:e=C+u+e+c}return d(e)}return b=void 0===b?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),A.toString=function(){return e+""},A}return{format:y,formatPrefix:function(e,t){var r,i=y(((e=o(e)).type="f",e)),a=3*Math.max(-8,Math.min(8,Math.floor((r=t,((r=n(Math.abs(r)))?r[1]:NaN)/3)))),s=Math.pow(10,-a),l=h[8+a/3];return function(e){return i(s*e)+l}}}}f=v({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),d=f.format,f.formatPrefix},65704:function(e,t,r){"use strict";r.r(t),r.d(t,{geoAiry:function(){return D},geoAiryRaw:function(){return O},geoAitoff:function(){return F},geoAitoffRaw:function(){return z},geoArmadillo:function(){return N},geoArmadilloRaw:function(){return j},geoAugust:function(){return B},geoAugustRaw:function(){return Z},geoBaker:function(){return W},geoBakerRaw:function(){return H},geoBerghaus:function(){return Y},geoBerghausRaw:function(){return q},geoBertin1953:function(){return re},geoBertin1953Raw:function(){return te},geoBoggs:function(){return ce},geoBoggsRaw:function(){return ue},geoBonne:function(){return ve},geoBonneRaw:function(){return he},geoBottomley:function(){return ge},geoBottomleyRaw:function(){return me},geoBromley:function(){return xe},geoBromleyRaw:function(){return ye},geoChamberlin:function(){return Ce},geoChamberlinAfrica:function(){return Ae},geoChamberlinRaw:function(){return Me},geoCollignon:function(){return Pe},geoCollignonRaw:function(){return Ee},geoCraig:function(){return Ie},geoCraigRaw:function(){return Le},geoCraster:function(){return De},geoCrasterRaw:function(){return Oe},geoCylindricalEqualArea:function(){return Fe},geoCylindricalEqualAreaRaw:function(){return ze},geoCylindricalStereographic:function(){return Ne},geoCylindricalStereographicRaw:function(){return je},geoEckert1:function(){return Be},geoEckert1Raw:function(){return Ze},geoEckert2:function(){return Ue},geoEckert2Raw:function(){return Ve},geoEckert3:function(){return We},geoEckert3Raw:function(){return He},geoEckert4:function(){return qe},geoEckert4Raw:function(){return Ge},geoEckert5:function(){return Xe},geoEckert5Raw:function(){return Ye},geoEckert6:function(){return $e},geoEckert6Raw:function(){return Ke},geoEisenlohr:function(){return et},geoEisenlohrRaw:function(){return Qe},geoFahey:function(){return nt},geoFaheyRaw:function(){return rt},geoFoucaut:function(){return at},geoFoucautRaw:function(){return it},geoFoucautSinusoidal:function(){return st},geoFoucautSinusoidalRaw:function(){return ot},geoGilbert:function(){return dt},geoGingery:function(){return mt},geoGingeryRaw:function(){return pt},geoGinzburg4:function(){return xt},geoGinzburg4Raw:function(){return yt},geoGinzburg5:function(){return _t},geoGinzburg5Raw:function(){return bt},geoGinzburg6:function(){return kt},geoGinzburg6Raw:function(){return wt},geoGinzburg8:function(){return Mt},geoGinzburg8Raw:function(){return Tt},geoGinzburg9:function(){return At},geoGinzburg9Raw:function(){return St},geoGringorten:function(){return Pt},geoGringortenQuincuncial:function(){return ai},geoGringortenRaw:function(){return Et},geoGuyou:function(){return Ot},geoGuyouRaw:function(){return Rt},geoHammer:function(){return J},geoHammerRaw:function(){return K},geoHammerRetroazimuthal:function(){return jt},geoHammerRetroazimuthalRaw:function(){return zt},geoHealpix:function(){return qt},geoHealpixRaw:function(){return Ut},geoHill:function(){return Xt},geoHillRaw:function(){return Yt},geoHomolosine:function(){return tr},geoHomolosineRaw:function(){return er},geoHufnagel:function(){return nr},geoHufnagelRaw:function(){return rr},geoHyperelliptical:function(){return sr},geoHyperellipticalRaw:function(){return or},geoInterrupt:function(){return cr},geoInterruptedBoggs:function(){return dr},geoInterruptedHomolosine:function(){return hr},geoInterruptedMollweide:function(){return mr},geoInterruptedMollweideHemispheres:function(){return yr},geoInterruptedQuarticAuthalic:function(){return fn},geoInterruptedSinuMollweide:function(){return br},geoInterruptedSinusoidal:function(){return wr},geoKavrayskiy7:function(){return Tr},geoKavrayskiy7Raw:function(){return kr},geoLagrange:function(){return Sr},geoLagrangeRaw:function(){return Mr},geoLarrivee:function(){return Er},geoLarriveeRaw:function(){return Cr},geoLaskowski:function(){return Lr},geoLaskowskiRaw:function(){return Pr},geoLittrow:function(){return Rr},geoLittrowRaw:function(){return Ir},geoLoximuthal:function(){return Dr},geoLoximuthalRaw:function(){return Or},geoMiller:function(){return Fr},geoMillerRaw:function(){return zr},geoModifiedStereographic:function(){return Xr},geoModifiedStereographicAlaska:function(){return Hr},geoModifiedStereographicGs48:function(){return Wr},geoModifiedStereographicGs50:function(){return Gr},geoModifiedStereographicLee:function(){return Yr},geoModifiedStereographicMiller:function(){return qr},geoModifiedStereographicRaw:function(){return jr},geoMollweide:function(){return oe},geoMollweideRaw:function(){return ae},geoMtFlatPolarParabolic:function(){return Qr},geoMtFlatPolarParabolicRaw:function(){return Jr},geoMtFlatPolarQuartic:function(){return tn},geoMtFlatPolarQuarticRaw:function(){return en},geoMtFlatPolarSinusoidal:function(){return nn},geoMtFlatPolarSinusoidalRaw:function(){return rn},geoNaturalEarth:function(){return an.Z},geoNaturalEarth2:function(){return sn},geoNaturalEarth2Raw:function(){return on},geoNaturalEarthRaw:function(){return an.K},geoNellHammer:function(){return un},geoNellHammerRaw:function(){return ln},geoNicolosi:function(){return pn},geoNicolosiRaw:function(){return dn},geoPatterson:function(){return Tn},geoPattersonRaw:function(){return kn},geoPeirceQuincuncial:function(){return oi},geoPierceQuincuncial:function(){return oi},geoPolyconic:function(){return Sn},geoPolyconicRaw:function(){return Mn},geoPolyhedral:function(){return Rn},geoPolyhedralButterfly:function(){return Zn},geoPolyhedralCollignon:function(){return Un},geoPolyhedralWaterman:function(){return Hn},geoProject:function(){return Xn},geoQuantize:function(){return si},geoQuincuncial:function(){return ii},geoRectangularPolyconic:function(){return ui},geoRectangularPolyconicRaw:function(){return li},geoRobinson:function(){return di},geoRobinsonRaw:function(){return fi},geoSatellite:function(){return hi},geoSatelliteRaw:function(){return pi},geoSinuMollweide:function(){return Qt},geoSinuMollweideRaw:function(){return Jt},geoSinusoidal:function(){return pe},geoSinusoidalRaw:function(){return de},geoStitch:function(){return Ri},geoTimes:function(){return Di},geoTimesRaw:function(){return Oi},geoTwoPointAzimuthal:function(){return Ni},geoTwoPointAzimuthalRaw:function(){return Fi},geoTwoPointAzimuthalUsa:function(){return ji},geoTwoPointEquidistant:function(){return Vi},geoTwoPointEquidistantRaw:function(){return Zi},geoTwoPointEquidistantUsa:function(){return Bi},geoVanDerGrinten:function(){return Hi},geoVanDerGrinten2:function(){return Gi},geoVanDerGrinten2Raw:function(){return Wi},geoVanDerGrinten3:function(){return Yi},geoVanDerGrinten3Raw:function(){return qi},geoVanDerGrinten4:function(){return Ki},geoVanDerGrinten4Raw:function(){return Xi},geoVanDerGrintenRaw:function(){return Ui},geoWagner:function(){return Ji},geoWagner4:function(){return na},geoWagner4Raw:function(){return ra},geoWagner6:function(){return aa},geoWagner6Raw:function(){return ia},geoWagner7:function(){return Qi},geoWagnerRaw:function(){return $i},geoWiechel:function(){return sa},geoWiechelRaw:function(){return oa},geoWinkel3:function(){return ua},geoWinkel3Raw:function(){return la}});var n=r(15002),i=Math.abs,a=Math.atan,o=Math.atan2,s=(Math.ceil,Math.cos),l=Math.exp,u=Math.floor,c=Math.log,f=Math.max,d=Math.min,p=Math.pow,h=Math.round,v=Math.sign||function(e){return e>0?1:e<0?-1:0},m=Math.sin,g=Math.tan,y=1e-6,x=1e-12,b=Math.PI,_=b/2,w=b/4,k=Math.SQRT1_2,T=L(2),M=L(b),S=2*b,A=180/b,C=b/180;function E(e){return e>1?_:e<-1?-_:Math.asin(e)}function P(e){return e>1?0:e<-1?b:Math.acos(e)}function L(e){return e>0?Math.sqrt(e):0}function I(e){return(l(e)-l(-e))/2}function R(e){return(l(e)+l(-e))/2}function O(e){var t=g(e/2),r=2*c(s(e/2))/(t*t);function n(e,t){var n=s(e),i=s(t),a=m(t),o=i*n,l=-((1-o?c((1+o)/2)/(1-o):-.5)+r/(1+o));return[l*i*m(e),l*a]}return n.invert=function(t,n){var a,l=L(t*t+n*n),u=-e/2,f=50;if(!l)return[0,0];do{var d=u/2,p=s(d),h=m(d),v=h/p,g=-c(i(p));u-=a=(2/v*g-r*v-l)/(-g/(h*h)+1-r/(2*p*p))*(p<0?.7:1)}while(i(a)>y&&--f>0);var x=m(u);return[o(t*x,l*s(u)),E(n*x/l)]},n}function D(){var e=_,t=(0,n.r)(O),r=t(e);return r.radius=function(r){return arguments.length?t(e=r*C):e*A},r.scale(179.976).clipAngle(147)}function z(e,t){var r=s(t),n=function(e){return e?e/Math.sin(e):1}(P(r*s(e/=2)));return[2*r*m(e)*n,m(t)*n]}function F(){return(0,n.Z)(z).scale(152.63)}function j(e){var t=m(e),r=s(e),n=e>=0?1:-1,a=g(n*e),l=(1+t-r)/2;function u(e,i){var u=s(i),c=s(e/=2);return[(1+u)*m(e),(n*i>-o(c,a)-.001?0:10*-n)+l+m(i)*r-(1+u)*t*c]}return u.invert=function(e,u){var c=0,f=0,d=50;do{var p=s(c),h=m(c),v=s(f),g=m(f),x=1+v,b=x*h-e,_=l+g*r-x*t*p-u,w=x*p/2,k=-h*g,T=t*x*h/2,M=r*v+t*p*g,S=k*T-M*w,A=(_*k-b*M)/S/2,C=(b*T-_*w)/S;i(C)>2&&(C/=2),c-=A,f-=C}while((i(A)>y||i(C)>y)&&--d>0);return n*f>-o(s(c),a)-.001?[2*c,f]:null},u}function N(){var e=20*C,t=e>=0?1:-1,r=g(t*e),i=(0,n.r)(j),a=i(e),l=a.stream;return a.parallel=function(n){return arguments.length?(r=g((t=(e=n*C)>=0?1:-1)*e),i(e)):e*A},a.stream=function(n){var i=a.rotate(),u=l(n),c=(a.rotate([0,0]),l(n)),f=a.precision();return a.rotate(i),u.sphere=function(){c.polygonStart(),c.lineStart();for(var n=-180*t;t*n<180;n+=90*t)c.point(n,90*t);if(e)for(;t*(n-=3*t*f)>=-180;)c.point(n,t*-o(s(n*C/2),r)*A);c.lineEnd(),c.polygonEnd()},u},a.scale(218.695).center([0,28.0974])}function Z(e,t){var r=g(t/2),n=L(1-r*r),i=1+n*s(e/=2),a=m(e)*n/i,o=r/i,l=a*a,u=o*o;return[4/3*a*(3+l-3*u),4/3*o*(3+3*l-u)]}function B(){return(0,n.Z)(Z).scale(66.1603)}z.invert=function(e,t){if(!(e*e+4*t*t>b*b+y)){var r=e,n=t,a=25;do{var o,l=m(r),u=m(r/2),c=s(r/2),f=m(n),d=s(n),p=m(2*n),h=f*f,v=d*d,g=u*u,x=1-v*c*c,_=x?P(d*c)*L(o=1/x):o=0,w=2*_*d*u-e,k=_*f-t,T=o*(v*g+_*d*c*h),M=o*(.5*l*p-2*_*f*u),S=.25*o*(p*u-_*f*v*l),A=o*(h*c+_*g*d),C=M*S-A*T;if(!C)break;var E=(k*M-w*A)/C,I=(w*S-k*T)/C;r-=E,n-=I}while((i(E)>y||i(I)>y)&&--a>0);return[r,n]}},Z.invert=function(e,t){if(t*=3/8,!(e*=3/8)&&i(t)>1)return null;var r=1+e*e+t*t,n=L((r-L(r*r-4*t*t))/2),a=E(n)/3,l=n?function(e){return c(e+L(e*e-1))}(i(t/n))/3:function(e){return c(e+L(e*e+1))}(i(e))/3,u=s(a),f=R(l),d=f*f-u*u;return[2*v(e)*o(I(l)*u,.25-d),2*v(t)*o(f*m(a),.25+d)]};var V=L(8),U=c(1+T);function H(e,t){var r=i(t);return rx&&--u>0);return[e/(s(o)*(V-1/m(o))),v(t)*o]};var G=r(17889);function q(e){var t=2*b/e;function r(e,r){var n=(0,G.N)(e,r);if(i(e)>_){var a=o(n[1],n[0]),l=L(n[0]*n[0]+n[1]*n[1]),u=t*h((a-_)/t)+_,c=o(m(a-=u),2-s(a));a=u+E(b/l*m(c))-c,n[0]=l*s(a),n[1]=l*m(a)}return n}return r.invert=function(e,r){var n=L(e*e+r*r);if(n>_){var i=o(r,e),l=t*h((i-_)/t)+_,u=i>l?-1:1,c=n*s(l-i),f=1/g(u*P((c-b)/L(b*(b-2*c)+n*n)));i=l+2*a((f+u*L(f*f-3))/3),e=n*s(i),r=n*m(i)}return G.N.invert(e,r)},r}function Y(){var e=5,t=(0,n.r)(q),r=t(e),i=r.stream,a=.01,l=-s(a*C),u=m(a*C);return r.lobes=function(r){return arguments.length?t(e=+r):e},r.stream=function(t){var n=r.rotate(),c=i(t),f=(r.rotate([0,0]),i(t));return r.rotate(n),c.sphere=function(){f.polygonStart(),f.lineStart();for(var t=0,r=360/e,n=2*b/e,i=90-180/e,c=_;t0&&i(n)>y);return s<0?NaN:r}function ee(e,t,r){return void 0===t&&(t=40),void 0===r&&(r=x),function(n,a,o,s){var l,u,c;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var f=0;fl)o-=u/=2,s-=c/=2;else{l=v;var m=(o>0?-1:1)*r,g=(s>0?-1:1)*r,y=e(o+m,s),x=e(o,s+g),b=(y[0]-d[0])/m,_=(y[1]-d[1])/m,w=(x[0]-d[0])/g,k=(x[1]-d[1])/g,T=k*b-_*w,M=(i(T)<.5?.5:1)/T;if(o+=u=(h*w-p*k)*M,s+=c=(p*_-h*b)*M,i(u)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return t.invert=ee(t),t}function re(){return(0,n.Z)(te()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ne(e,t){var r,n=e*m(t),a=30;do{t-=r=(t+m(t)-n)/(1+s(t))}while(i(r)>y&&--a>0);return t/2}function ie(e,t,r){function n(n,i){return[e*n*s(i=ne(r,i)),t*m(i)]}return n.invert=function(n,i){return i=E(i/t),[n/(e*s(i)),E((2*i+m(2*i))/r)]},n}$.invert=function(e,t){var r=2*E(t/2);return[e*s(r/2)/s(r),r]};var ae=ie(T/_,T,b);function oe(){return(0,n.Z)(ae).scale(169.529)}var se=2.00276,le=1.11072;function ue(e,t){var r=ne(b,t);return[se*e/(1/s(t)+le/s(r)),(t+T*m(r))/se]}function ce(){return(0,n.Z)(ue).scale(160.857)}function fe(e){var t=0,r=(0,n.r)(e),i=r(t);return i.parallel=function(e){return arguments.length?r(t=e*C):t*A},i}function de(e,t){return[e*s(t),t]}function pe(){return(0,n.Z)(de).scale(152.63)}function he(e){if(!e)return de;var t=1/g(e);function r(r,n){var i=t+e-n,a=i?r*s(n)/i:i;return[i*m(a),t-i*s(a)]}return r.invert=function(r,n){var i=L(r*r+(n=t-n)*n),a=t+e-i;return[i/s(a)*o(r,n),a]},r}function ve(){return fe(he).scale(123.082).center([0,26.1441]).parallel(45)}function me(e){function t(t,r){var n=_-r,i=n?t*e*m(n)/n:n;return[n*m(i)/e,_-n*s(i)]}return t.invert=function(t,r){var n=t*e,i=_-r,a=L(n*n+i*i),s=o(n,i);return[(a?a/m(a):1)*s/e,_-a]},t}function ge(){var e=.5,t=(0,n.r)(me),r=t(e);return r.fraction=function(r){return arguments.length?t(e=+r):e},r.scale(158.837)}ue.invert=function(e,t){var r,n,a=se*t,o=t<0?-w:w,l=25;do{n=a-T*m(o),o-=r=(m(2*o)+2*o-b*m(n))/(2*s(2*o)+2+b*s(n)*T*s(o))}while(i(r)>y&&--l>0);return n=a-T*m(o),[e*(1/s(n)+le/s(o))/se,n]},de.invert=function(e,t){return[e/s(t),t]};var ye=ie(1,4/b,b);function xe(){return(0,n.Z)(ye).scale(152.63)}var be=r(66624),_e=r(49386);function we(e,t,r,n,a,l){var u,c=s(l);if(i(e)>1||i(l)>1)u=P(r*a+t*n*c);else{var f=m(e/2),d=m(l/2);u=2*E(L(f*f+t*n*d*d))}return i(u)>y?[u,o(n*m(l),t*a-r*n*c)]:[0,0]}function ke(e,t,r){return P((e*e+t*t-r*r)/(2*e*t))}function Te(e){return e-2*b*u((e+b)/(2*b))}function Me(e,t,r){for(var n,i=[[e[0],e[1],m(e[1]),s(e[1])],[t[0],t[1],m(t[1]),s(t[1])],[r[0],r[1],m(r[1]),s(r[1])]],a=i[2],o=0;o<3;++o,a=n)n=i[o],a.v=we(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=ke(i[0].v[0],i[2].v[0],i[1].v[0]),u=ke(i[0].v[0],i[1].v[0],i[2].v[0]),c=b-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var f=[i[2].point[0]=i[0].point[0]+i[2].v[0]*s(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(e,t){var r,n=m(t),a=s(t),o=new Array(3);for(r=0;r<3;++r){var l=i[r];if(o[r]=we(t-l[1],l[3],l[2],a,n,e-l[0]),!o[r][0])return l.point;o[r][1]=Te(o[r][1]-l.v[1])}var d=f.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,h=ke(i[r].v[0],o[r][0],o[p][0]);o[r][1]<0&&(h=-h),r?1==r?(h=u-h,d[0]-=o[r][0]*s(h),d[1]-=o[r][0]*m(h)):(h=c-h,d[0]+=o[r][0]*s(h),d[1]+=o[r][0]*m(h)):(d[0]+=o[r][0]*s(h),d[1]-=o[r][0]*m(h))}return d[0]/=3,d[1]/=3,d}}function Se(e){return e[0]*=C,e[1]*=C,e}function Ae(){return Ce([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function Ce(e,t,r){var i=(0,be.Z)({type:"MultiPoint",coordinates:[e,t,r]}),a=[-i[0],-i[1]],o=(0,_e.Z)(a),s=Me(Se(o(e)),Se(o(t)),Se(o(r)));s.invert=ee(s);var l=(0,n.Z)(s).rotate(a),u=l.center;return delete l.rotate,l.center=function(e){return arguments.length?u(o(e)):o.invert(u())},l.clipAngle(90)}function Ee(e,t){var r=L(1-m(t));return[2/M*e*r,M*(1-r)]}function Pe(){return(0,n.Z)(Ee).scale(95.6464).center([0,30])}function Le(e){var t=g(e);function r(e,r){return[e,(e?e/m(e):1)*(m(r)*s(e)-t*s(r))]}return r.invert=t?function(e,r){e&&(r*=m(e)/e);var n=s(e);return[e,2*o(L(n*n+t*t-r*r)-n,t-r)]}:function(e,t){return[e,E(e?t*g(e)/e:t)]},r}function Ie(){return fe(Le).scale(249.828).clipAngle(90)}Ee.invert=function(e,t){var r=(r=t/M-1)*r;return[r>0?e*L(b/r)/2:0,E(1-r)]};var Re=L(3);function Oe(e,t){return[Re*e*(2*s(2*t/3)-1)/M,Re*M*m(t/3)]}function De(){return(0,n.Z)(Oe).scale(156.19)}function ze(e){var t=s(e);function r(e,r){return[e*t,m(r)/t]}return r.invert=function(e,r){return[e/t,E(r*t)]},r}function Fe(){return fe(ze).parallel(38.58).scale(195.044)}function je(e){var t=s(e);function r(e,r){return[e*t,(1+t)*g(r/2)]}return r.invert=function(e,r){return[e/t,2*a(r/(1+t))]},r}function Ne(){return fe(je).scale(124.75)}function Ze(e,t){var r=L(8/(3*b));return[r*e*(1-i(t)/b),r*t]}function Be(){return(0,n.Z)(Ze).scale(165.664)}function Ve(e,t){var r=L(4-3*m(i(t)));return[2/L(6*b)*e*r,v(t)*L(2*b/3)*(2-r)]}function Ue(){return(0,n.Z)(Ve).scale(165.664)}function He(e,t){var r=L(b*(4+b));return[2/r*e*(1+L(1-4*t*t/(b*b))),4/r*t]}function We(){return(0,n.Z)(He).scale(180.739)}function Ge(e,t){var r=(2+_)*m(t);t/=2;for(var n=0,a=1/0;n<10&&i(a)>y;n++){var o=s(t);t-=a=(t+m(t)*(o+2)-r)/(2*o*(1+o))}return[2/L(b*(4+b))*e*(1+s(t)),2*L(b/(4+b))*m(t)]}function qe(){return(0,n.Z)(Ge).scale(180.739)}function Ye(e,t){return[e*(1+s(t))/L(2+b),2*t/L(2+b)]}function Xe(){return(0,n.Z)(Ye).scale(173.044)}function Ke(e,t){for(var r=(1+_)*m(t),n=0,a=1/0;n<10&&i(a)>y;n++)t-=a=(t+m(t)-r)/(1+s(t));return r=L(2+b),[e*(1+s(t))/r,2*t/r]}function $e(){return(0,n.Z)(Ke).scale(173.044)}Oe.invert=function(e,t){var r=3*E(t/(Re*M));return[M*e/(Re*(2*s(2*r/3)-1)),r]},Ze.invert=function(e,t){var r=L(8/(3*b)),n=t/r;return[e/(r*(1-i(n)/b)),n]},Ve.invert=function(e,t){var r=2-i(t)/L(2*b/3);return[e*L(6*b)/(2*r),v(t)*E((4-r*r)/3)]},He.invert=function(e,t){var r=L(b*(4+b))/2;return[e*r/(1+L(1-t*t*(4+b)/(4*b))),t*r/2]},Ge.invert=function(e,t){var r=t*L((4+b)/b)/2,n=E(r),i=s(n);return[e/(2/L(b*(4+b))*(1+i)),E((n+r*(i+2))/(2+_))]},Ye.invert=function(e,t){var r=L(2+b),n=t*r/2;return[r*e/(1+s(n)),n]},Ke.invert=function(e,t){var r=1+_,n=L(r/2);return[2*e*n/(1+s(t*=n)),E((t+m(t))/r)]};var Je=3+2*T;function Qe(e,t){var r=m(e/=2),n=s(e),i=L(s(t)),o=s(t/=2),l=m(t)/(o+T*n*i),u=L(2/(1+l*l)),f=L((T*o+(n+r)*i)/(T*o+(n-r)*i));return[Je*(u*(f-1/f)-2*c(f)),Je*(u*l*(f+1/f)-2*a(l))]}function et(){return(0,n.Z)(Qe).scale(62.5271)}Qe.invert=function(e,t){if(!(r=Z.invert(e/1.2,1.065*t)))return null;var r,n=r[0],o=r[1],l=20;e/=Je,t/=Je;do{var u=n/2,p=o/2,h=m(u),v=s(u),g=m(p),x=s(p),b=s(o),w=L(b),M=g/(x+T*v*w),S=M*M,A=L(2/(1+S)),C=(T*x+(v+h)*w)/(T*x+(v-h)*w),E=L(C),P=E-1/E,I=E+1/E,R=A*P-2*c(E)-e,O=A*M*I-2*a(M)-t,D=g&&k*w*h*S/g,z=(T*v*x+w)/(2*(x+T*v*w)*(x+T*v*w)*w),F=-.5*M*A*A*A,j=F*D,N=F*z,B=(B=2*x+T*w*(v-h))*B*E,V=(T*v*x*w+b)/B,U=-T*h*g/(w*B),H=P*j-2*V/E+A*(V+V/C),W=P*N-2*U/E+A*(U+U/C),G=M*I*j-2*D/(1+S)+A*I*D+A*M*(V-V/C),q=M*I*N-2*z/(1+S)+A*I*z+A*M*(U-U/C),Y=W*G-q*H;if(!Y)break;var X=(O*W-R*q)/Y,K=(R*G-O*H)/Y;n-=X,o=f(-_,d(_,o-K))}while((i(X)>y||i(K)>y)&&--l>0);return i(i(o)-_)n){var d=L(f),p=o(c,u),v=r*h(p/r),g=p-v,x=e*s(g),w=(e*m(g)-g*m(x))/(_-x),k=ht(g,w),T=(b-e)/vt(k,x,b);u=d;var M,S=50;do{u-=M=(e+vt(k,x,u)*T-d)/(k(u)*T)}while(i(M)>y&&--S>0);c=g*m(u),u<_&&(c-=w*(u-_));var A=m(v),C=s(v);l[0]=u*C-c*A,l[1]=u*A+c*C}return l}return a.invert=function(t,a){var l=t*t+a*a;if(l>n){var u=L(l),c=o(a,t),f=r*h(c/r),d=c-f;t=u*s(d),a=u*m(d);for(var p=t-_,v=m(t),g=a/v,y=t<_?1/0:0,w=10;;){var k=e*m(g),T=e*s(g),M=m(T),S=_-T,A=(k-g*M)/S,C=ht(g,A);if(i(y)y||i(p)>y)&&--g>0);return[h,v]},c}var yt=gt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function xt(){return(0,n.Z)(yt).scale(149.995)}var bt=gt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function _t(){return(0,n.Z)(bt).scale(153.93)}var wt=gt(5/6*b,-.62636,-.0344,0,1.3493,-.05524,0,.045);function kt(){return(0,n.Z)(wt).scale(130.945)}function Tt(e,t){var r=e*e,n=t*t;return[e*(1-.162388*n)*(.87-952426e-9*r*r),t*(1+n/12)]}function Mt(){return(0,n.Z)(Tt).scale(131.747)}Tt.invert=function(e,t){var r,n=e,a=t,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-t)/(1+s/4)}while(i(r)>y&&--o>0);o=50,e/=1-.162388*s;do{var l=(l=n*n)*l;n-=r=(n*(.87-952426e-9*l)-e)/(.87-.00476213*l)}while(i(r)>y&&--o>0);return[n,a]};var St=gt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function At(){return(0,n.Z)(St).scale(131.087)}function Ct(e){var t=e(_,0)[0]-e(-_,0)[0];function r(r,n){var i=r>0?-.5:.5,a=e(r+i*b,n);return a[0]-=i*t,a}return e.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=e.invert(r+i*t,n),o=a[0]-i*b;return o<-b?o+=2*b:o>b&&(o-=2*b),a[0]=o,a}),r}function Et(e,t){var r=v(e),n=v(t),a=s(t),l=s(e)*a,u=m(e)*a,c=m(n*t);e=i(o(u,c)),t=E(l),i(e-_)>y&&(e%=_);var f=function(e,t){if(t===_)return[0,0];var r,n,a=m(t),o=a*a,l=o*o,u=1+l,c=1+3*l,f=1-l,d=E(1/L(u)),p=f+o*u*d,h=(1-a)/p,v=L(h),g=h*u,x=L(g),w=v*f;if(0===e)return[0,-(w+o*x)];var k,T=s(t),M=1/T,S=2*a*T,A=(-3*o+d*c)*S,C=(-p*T-(1-a)*A)/(p*p),P=o*u*C+h*c*S,I=-M*S,R=-M*P,O=-2*M*(f*(.5*C/v)-2*o*v*S),D=4*e/b;if(e>.222*b||t.175*b){if(r=(w+o*L(g*(1+l)-w*w))/(1+l),e>b/4)return[r,r];var z=r,F=.5*r;r=.5*(F+z),n=50;do{var j=r*(O+I*L(g-r*r))+R*E(r/x)-D;if(!j)break;j<0?F=r:z=r,r=.5*(F+z)}while(i(z-F)>y&&--n>0)}else{r=y,n=25;do{var N=r*r,Z=L(g-N),B=O+I*Z,V=r*B+R*E(r/x)-D;r-=k=Z?V/(B+(R-I*N)/Z):0}while(i(k)>y&&--n>0)}return[r,-w-o*L(g-r*r)]}(e>b/4?_-e:e,t);return e>b/4&&(c=f[0],f[0]=-f[1],f[1]=-c),f[0]*=r,f[1]*=-n,f}function Pt(){return(0,n.Z)(Ct(Et)).scale(239.75)}function Lt(e,t){var r,n,o,u,c,f;if(t=1-y)return r=(1-t)/4,o=1/(n=R(e)),[(u=((f=l(2*(f=e)))-1)/(f+1))+r*((c=n*I(e))-e)/(n*n),o-r*u*o*(c-e),o+r*u*o*(c+e),2*a(l(e))-_+r*(c-e)/n];var d=[1,0,0,0,0,0,0,0,0],p=[L(t),0,0,0,0,0,0,0,0],h=0;for(n=L(1-t),c=1;i(p[h]/d[h])>y&&h<8;)r=d[h++],p[h]=(r-n)/2,d[h]=(r+n)/2,n=L(r*n),c*=2;o=c*d[h]*e;do{o=(E(u=p[h]*m(n=o)/d[h])+o)/2}while(--h);return[m(o),u=s(o),u/s(o-n),o]}function It(e,t){if(!t)return e;if(1===t)return c(g(e/2+w));for(var r=1,n=L(1-t),o=L(t),s=0;i(o)>y;s++){if(e%b){var l=a(n*g(e)/r);l<0&&(l+=b),e+=l+~~(e/b)*b}else e+=e;o=(r+n)/2,n=L(r*n),o=((r=o)-n)/2}return e/(p(2,s)*r)}function Rt(e,t){var r=(T-1)/(T+1),n=L(1-r*r),u=It(_,n*n),f=c(g(b/4+i(t)/2)),d=l(-1*f)/L(r),p=function(e,t){var r=e*e,n=t+1,i=1-r-t*t;return[.5*((e>=0?_:-_)-o(i,2*e)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(d*s(-1*e),d*m(-1*e)),h=function(e,t,r){var n=i(e),o=I(i(t));if(n){var s=1/m(n),l=1/(g(n)*g(n)),u=-(l+r*(o*o*s*s)-1+r),c=(-u+L(u*u-(r-1)*l*4))/2;return[It(a(1/L(c)),r)*v(e),It(a(L((c/l-1)/r)),1-r)*v(t)]}return[0,It(a(o),1-r)*v(t)]}(p[0],p[1],n*n);return[-h[1],(t>=0?1:-1)*(.5*u-h[0])]}function Ot(){return(0,n.Z)(Ct(Rt)).scale(151.496)}Et.invert=function(e,t){i(e)>1&&(e=2*v(e)-e),i(t)>1&&(t=2*v(t)-t);var r=v(e),n=v(t),a=-r*e,l=-n*t,u=l/a<1,c=function(e,t){for(var r=0,n=1,a=.5,o=50;;){var l=a*a,u=L(a),c=E(1/L(1+l)),f=1-l+a*(1+l)*c,d=(1-u)/f,p=L(d),h=d*(1+l),v=p*(1-l),m=L(h-e*e),g=t+v+a*m;if(i(n-r)0?r=a:n=a,a=.5*(r+n)}if(!o)return null;var y=E(u),_=s(y),w=1/_,k=2*u*_,T=(-f*_-(-3*a+c*(1+3*l))*k*(1-u))/(f*f),M=.5*T/p,S=(1-l)*M-2*a*p*k;return[b/4*(e*(-2*w*S+-w*k*m)+-w*(a*(1+l)*T+d*(1+3*l)*k)*E(e/L(h))),y]}(u?l:a,u?a:l),f=c[0],d=c[1],p=s(d);return u&&(f=-_-f),[r*(o(m(f)*p,-m(d))+b),n*E(s(f)*p)]},Rt.invert=function(e,t){var r=(T-1)/(T+1),n=L(1-r*r),i=function(e,t,r){var n,i,a;return e?(n=Lt(e,r),t?(a=(i=Lt(t,1-r))[1]*i[1]+r*n[0]*n[0]*i[0]*i[0],[[n[0]*i[2]/a,n[1]*n[2]*i[0]*i[1]/a],[n[1]*i[1]/a,-n[0]*n[2]*i[0]*i[2]/a],[n[2]*i[1]*i[2]/a,-r*n[0]*n[1]*i[0]/a]]):[[n[0],0],[n[1],0],[n[2],0]]):[[0,(i=Lt(t,1-r))[0]/i[1]],[1/i[1],0],[i[2]/i[1],0]]}(.5*It(_,n*n)-t,-e,n*n),s=function(e,t){var r=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/r,(e[1]*t[0]-e[0]*t[1])/r]}(i[0],i[1]);return[o(s[1],s[0])/-1,2*a(l(-.5*c(r*s[0]*s[0]+r*s[1]*s[1])))-_]};var Dt=r(7613);function zt(e){var t=m(e),r=s(e),n=Ft(e);function a(e,a){var o=n(e,a);e=o[0],a=o[1];var l=m(a),u=s(a),c=s(e),f=P(t*l+r*u*c),d=m(f),p=i(d)>y?f/d:1;return[p*r*m(e),(i(e)>_?p:-p)*(t*u-r*l*c)]}return n.invert=Ft(-e),a.invert=function(e,r){var i=L(e*e+r*r),a=-m(i),l=s(i),u=i*l,c=-r*a,f=i*t,d=L(u*u+c*c-f*f),p=o(u*f+c*d,c*f-u*d),h=(i>_?-1:1)*o(e*a,i*s(p)*l+r*m(p)*a);return n.invert(h,p)},a}function Ft(e){var t=m(e),r=s(e);return function(e,n){var i=s(n),a=s(e)*i,l=m(e)*i,u=m(n);return[o(l,a*r-u*t),E(u*r+a*t)]}}function jt(){var e=0,t=(0,n.r)(zt),r=t(e),i=r.rotate,a=r.stream,o=(0,Dt.Z)();return r.parallel=function(n){if(!arguments.length)return e*A;var i=r.rotate();return t(e=n*C).rotate(i)},r.rotate=function(t){return arguments.length?(i.call(r,[t[0],t[1]-e*A]),o.center([-t[0],-t[1]]),r):((t=i.call(r))[1]+=e*A,t)},r.stream=function(e){return(e=a(e)).sphere=function(){e.polygonStart();var t,r=o.radius(89.99)().coordinates[0],n=r.length-1,i=-1;for(e.lineStart();++i=0;)e.point((t=r[i])[0],t[1]);e.lineEnd(),e.polygonEnd()},e},r.scale(79.4187).parallel(45).clipAngle(179.999)}var Nt=r(33064),Zt=r(72736),Bt=E(1-1/3)*A,Vt=ze(0);function Ut(e){var t=Bt*C,r=Ee(b,t)[0]-Ee(-b,t)[0],n=Vt(0,t)[1],a=Ee(0,t)[1],o=M-a,s=S/e,l=4/S,c=n+o*o*4/S;function p(p,h){var v,m=i(h);if(m>t){var g=d(e-1,f(0,u((p+b)/s)));(v=Ee(p+=b*(e-1)/e-g*s,m))[0]=v[0]*S/r-S*(e-1)/(2*e)+g*S/e,v[1]=n+4*(v[1]-a)*o/S,h<0&&(v[1]=-v[1])}else v=Vt(p,h);return v[0]*=l,v[1]/=c,v}return p.invert=function(t,p){t/=l;var h=i(p*=c);if(h>n){var v=d(e-1,f(0,u((t+b)/s)));t=(t+b*(e-1)/e-v*s)*r/S;var m=Ee.invert(t,.25*(h-n)*S/o+a);return m[0]-=b*(e-1)/e-v*s,p<0&&(m[1]=-m[1]),m}return Vt.invert(t,p)},p}function Ht(e,t){return[e,1&t?90-y:Bt]}function Wt(e,t){return[e,1&t?-90+y:-Bt]}function Gt(e){return[e[0]*(1-y),e[1]]}function qt(){var e=4,t=(0,n.r)(Ut),r=t(e),i=r.stream;return r.lobes=function(r){return arguments.length?t(e=+r):e},r.stream=function(t){var n=r.rotate(),a=i(t),o=(r.rotate([0,0]),i(t));return r.rotate(n),a.sphere=function(){(0,Zt.Z)(function(e){var t=[].concat((0,Nt.w6)(-180,180+e/2,e).map(Ht),(0,Nt.w6)(180,-180-e/2,-e).map(Wt));return{type:"Polygon",coordinates:[180===e?t.map(Gt):t]}}(180/e),o)},a},r.scale(239.75)}function Yt(e){var t,r=1+e,n=E(m(1/r)),a=2*L(b/(t=b+4*n*r)),l=.5*a*(r+L(e*(2+e))),u=e*e,c=r*r;function f(f,d){var p,h,v=1-m(d);if(v&&v<2){var g,y=_-d,w=25;do{var k=m(y),T=s(y),M=n+o(k,r-T),S=1+c-2*r*T;y-=g=(y-u*n-r*k+S*M-.5*v*t)/(2*r*k*M)}while(i(g)>x&&--w>0);p=a*L(S),h=f*M/b}else p=a*(e+v),h=f*n/b;return[p*m(h),l-p*s(h)]}return f.invert=function(e,i){var s=e*e+(i-=l)*i,f=(1+c-s/(a*a))/(2*r),d=P(f),p=m(d),h=n+o(p,r-f);return[E(e/L(s))*b/h,E(1-2*(d-u*n-r*p+(1+c-2*r*f)*h)/t)]},f}function Xt(){var e=1,t=(0,n.r)(Yt),r=t(e);return r.ratio=function(r){return arguments.length?t(e=+r):e},r.scale(167.774).center([0,18.67])}var Kt=.7109889596207567,$t=.0528035274542;function Jt(e,t){return t>-Kt?((e=ae(e,t))[1]+=$t,e):de(e,t)}function Qt(){return(0,n.Z)(Jt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function er(e,t){return i(t)>Kt?((e=ae(e,t))[1]-=t>0?$t:-$t,e):de(e,t)}function tr(){return(0,n.Z)(er).scale(152.63)}function rr(e,t,r,n){var i=L(4*b/(2*r+(1+e-t/2)*m(2*r)+(e+t)/2*m(4*r)+t/2*m(6*r))),a=L(n*m(r)*L((1+e*s(2*r)+t*s(4*r))/(1+e+t))),o=r*u(1);function l(r){return L(1+e*s(2*r)+t*s(4*r))}function u(n){var i=n*r;return(2*i+(1+e-t/2)*m(2*i)+(e+t)/2*m(4*i)+t/2*m(6*i))/r}function c(e){return l(e)*m(e)}var f=function(e,t){var n=r*Q(u,o*m(t)/r,t/b);isNaN(n)&&(n=r*v(t));var c=i*l(n);return[c*a*e/b*s(n),c/a*m(n)]};return f.invert=function(e,t){var n=Q(c,t*a/i);return[e*b/(s(n)*i*a*l(n)),E(r*u(n/r)/o)]},0===r&&(i=L(n/b),(f=function(e,t){return[e*i,m(t)/i]}).invert=function(e,t){return[e/i,E(t*i)]}),f}function nr(){var e=1,t=0,r=45*C,i=2,a=(0,n.r)(rr),o=a(e,t,r,i);return o.a=function(n){return arguments.length?a(e=+n,t,r,i):e},o.b=function(n){return arguments.length?a(e,t=+n,r,i):t},o.psiMax=function(n){return arguments.length?a(e,t,r=+n*C,i):r*A},o.ratio=function(n){return arguments.length?a(e,t,r,i=+n):i},o.scale(180.739)}function ir(e,t,r,n,i,a,o,s,l,u,c){if(c.nanEncountered)return NaN;var f,d,p,h,v,m,g,y,x,b;if(d=e(t+.25*(f=r-t)),p=e(r-.25*f),isNaN(d))c.nanEncountered=!0;else{if(!isNaN(p))return b=((m=(h=f*(n+4*d+i)/12)+(v=f*(i+4*p+a)/12))-o)/15,u>l?(c.maxDepthCount++,m+b):Math.abs(b)e?r=n:t=n,n=t+r>>1}while(n>t);var i=u[n+1]-u[n];return i&&(i=(e-u[n+1])/i),(n+1+i)/s}var d=2*f(1)/b*o/r,h=function(e,t){var r=f(i(m(t))),a=n(r)*e;return r/=d,[a,t>=0?r:-r]};return h.invert=function(e,t){var r;return i(t*=d)<1&&(r=v(t)*E(a(i(t))*o)),[e/n(i(t)),r]},h}function sr(){var e=0,t=2.5,r=1.183136,i=(0,n.r)(or),a=i(e,t,r);return a.alpha=function(n){return arguments.length?i(e=+n,t,r):e},a.k=function(n){return arguments.length?i(e,t=+n,r):t},a.gamma=function(n){return arguments.length?i(e,t,r=+n):r},a.scale(152.63)}function lr(e,t){return i(e[0]-t[0])a[o][2][0];++o);var l=e(r-a[o][1][0],n);return l[0]+=e(a[o][1][0],i*n>i*a[o][0][1]?a[o][0][1]:n)[0],l}r?o.invert=r(o):e.invert&&(o.invert=function(r,n){for(var i=a[+(n<0)],s=t[+(n<0)],l=0,u=i.length;l=0;--s)r=(t=e[1][s])[0][0],n=t[0][1],i=t[1][1],a=t[2][0],o=t[2][1],l.push(ur([[a-y,o-y],[a-y,i+y],[r+y,i+y],[r+y,n-y]],30));return{type:"Polygon",coordinates:[(0,Nt.TS)(l)]}}(r),t=r.map((function(e){return e.map((function(e){return[[e[0][0]*C,e[0][1]*C],[e[1][0]*C,e[1][1]*C],[e[2][0]*C,e[2][1]*C]]}))})),a=t.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),s):t.map((function(e){return e.map((function(e){return[[e[0][0]*A,e[0][1]*A],[e[1][0]*A,e[1][1]*A],[e[2][0]*A,e[2][1]*A]]}))}))},null!=t&&s.lobes(t),s}Jt.invert=function(e,t){return t>-Kt?ae.invert(e,t-$t):de.invert(e,t)},er.invert=function(e,t){return i(t)>Kt?ae.invert(e,t+(t>0?$t:-$t)):de.invert(e,t)};var fr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function dr(){return cr(ue,fr).scale(160.857)}var pr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function hr(){return cr(er,pr).scale(152.63)}var vr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function mr(){return cr(ae,vr).scale(169.529)}var gr=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function yr(){return cr(ae,gr).scale(169.529).rotate([20,0])}var xr=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function br(){return cr(Jt,xr,ee).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var _r=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function wr(){return cr(de,_r).scale(152.63).rotate([-20,0])}function kr(e,t){return[3/S*e*L(b*b/3-t*t),t]}function Tr(){return(0,n.Z)(kr).scale(158.837)}function Mr(e){function t(t,r){if(i(i(r)-_)2)return null;var a=(t/=2)*t,s=(r/=2)*r,l=2*r/(1+a+s);return l=p((1+l)/(1-l),1/e),[o(2*t,1-a-s)/e,E((l-1)/(l+1))]},t}function Sr(){var e=.5,t=(0,n.r)(Mr),r=t(e);return r.spacing=function(r){return arguments.length?t(e=+r):e},r.scale(124.75)}kr.invert=function(e,t){return[S/3*e/L(b*b/3-t*t),t]};var Ar=b/T;function Cr(e,t){return[e*(1+L(s(t)))/2,t/(s(t/2)*s(e/6))]}function Er(){return(0,n.Z)(Cr).scale(97.2672)}function Pr(e,t){var r=e*e,n=t*t;return[e*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),t*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function Lr(){return(0,n.Z)(Pr).scale(139.98)}function Ir(e,t){return[m(e)/s(t),g(t)*s(e)]}function Rr(){return(0,n.Z)(Ir).scale(144.049).clipAngle(89.999)}function Or(e){var t=s(e),r=g(w+e/2);function n(n,a){var o=a-e,s=i(o)=0;)d=(f=e[c])[0]+l*(i=d)-u*p,p=f[1]+l*p+u*i;return[d=l*(i=d)-u*p,p=l*p+u*i]}return r.invert=function(r,n){var l=20,u=r,c=n;do{for(var f,d=t,p=e[d],h=p[0],v=p[1],g=0,x=0;--d>=0;)g=h+u*(f=g)-c*x,x=v+u*x+c*f,h=(p=e[d])[0]+u*(f=h)-c*v,v=p[1]+u*v+c*f;var b,_,w=(g=h+u*(f=g)-c*x)*g+(x=v+u*x+c*f)*x;u-=b=((h=u*(f=h)-c*v-r)*g+(v=u*v+c*f-n)*x)/w,c-=_=(v*g-h*x)/w}while(i(b)+i(_)>y*y&&--l>0);if(l){var k=L(u*u+c*c),T=2*a(.5*k),M=m(T);return[o(u*M,k*s(T)),k?E(c*M/k):0]}},r}Cr.invert=function(e,t){var r=i(e),n=i(t),a=y,o=_;ny||i(x)>y)&&--a>0);return a&&[r,n]},Ir.invert=function(e,t){var r=e*e,n=t*t+1,i=r+n,a=e?k*L((i-L(i*i-4*r))/r):1/L(n);return[E(e*a),v(t)*P(a)]},zr.invert=function(e,t){return[e,2.5*a(l(.8*t))-.625*b]};var Nr=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Zr=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Br=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Vr=[[.9245,0],[0,0],[.01943,0]],Ur=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Hr(){return Xr(Nr,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Wr(){return Xr(Zr,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Gr(){return Xr(Br,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function qr(){return Xr(Vr,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Yr(){return Xr(Ur,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Xr(e,t){var r=(0,n.Z)(jr(e)).rotate(t).clipAngle(90),i=(0,_e.Z)(t),a=r.center;return delete r.rotate,r.center=function(e){return arguments.length?a(i(e)):i.invert(a())},r}var Kr=L(6),$r=L(7);function Jr(e,t){var r=E(7*m(t)/(3*Kr));return[Kr*e*(2*s(2*r/3)-1)/$r,9*m(r/3)/$r]}function Qr(){return(0,n.Z)(Jr).scale(164.859)}function en(e,t){for(var r,n=(1+k)*m(t),a=t,o=0;o<25&&(a-=r=(m(a/2)+m(a)-n)/(.5*s(a/2)+s(a)),!(i(r)x&&--l>0);return[e/(.84719-.13063*(n=s*s)+(o=n*(a=n*n))*o*(.05494*n-.04515-.02326*a+.00331*o)),s]},ln.invert=function(e,t){for(var r=t/2,n=0,a=1/0;n<10&&i(a)>y;++n){var o=s(t/2);t-=a=(t-g(t/2)-r)/(1-.5/(o*o))}return[2*e/(1+s(t)),t]};var cn=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function fn(){return cr(K(1/0),cn).rotate([20,0]).scale(152.63)}function dn(e,t){var r=m(t),n=s(t),a=v(e);if(0===e||i(t)===_)return[0,t];if(0===t)return[e,0];if(i(e)===_)return[e*n,_*r];var o=b/(2*e)-2*e/b,l=2*t/b,u=(1-l*l)/(r-l),c=o*o,f=u*u,d=1+c/f,p=1+f/c,h=(o*r/u-o/2)/d,g=(f*r/c+u/2)/p,y=g*g-(f*r*r/c+u*r-1)/p;return[_*(h+L(h*h+n*n/d)*a),_*(g+L(y<0?0:y)*v(-t*o)*a)]}function pn(){return(0,n.Z)(dn).scale(127.267)}dn.invert=function(e,t){var r=(e/=_)*e,n=r+(t/=_)*t,i=b*b;return[e?(n-1+L((1-n)*(1-n)+4*r))/(2*e)*_:0,Q((function(e){return n*(b*m(e)-2*e)*b+4*e*e*(t-m(e))+2*b*e-i*t}),0)]};var hn=1.0148,vn=.23185,mn=-.14499,gn=.02406,yn=hn,xn=5*vn,bn=7*mn,_n=9*gn,wn=1.790857183;function kn(e,t){var r=t*t;return[e,t*(hn+r*r*(vn+r*(mn+gn*r)))]}function Tn(){return(0,n.Z)(kn).scale(139.319)}function Mn(e,t){if(i(t)wn?t=wn:t<-1.790857183&&(t=-1.790857183);var r,n=t;do{var a=n*n;n-=r=(n*(hn+a*a*(vn+a*(mn+gn*a)))-t)/(yn+a*a*(xn+a*(bn+_n*a)))}while(i(r)>y);return[e,n]},Mn.invert=function(e,t){if(i(t)y&&--o>0);return l=g(a),[(i(t)=0;)if(n=t[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(t.face,r.face),i=En(n.map(r.project),n.map(t.project));t.transform=r.transform?Pn(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;o0?[-t[0],0]:[180-t[0],180])};var t=Nn.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,r){var n=t[e];n&&(n.children||(n.children=[])).push(t[r])})),Rn(t[0],(function(e,r){return t[e<-b/2?r<0?6:4:e<0?r<0?2:0:en^p>n&&r<(d-u)*(n-c)/(p-c)+u&&(i=!i)}return i}(e[0],r))return e.push(t),!0}))||e.push([t])})),ei=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}};function ii(e){var t=e(_,0)[0]-e(-_,0)[0];function r(r,n){var a=i(r)<_,o=e(a?r:r>0?r-b:r+b,n),s=(o[0]-o[1])*k,l=(o[0]+o[1])*k;if(a)return[s,l];var u=t*k,c=s>0^l>0?-1:1;return[c*s-v(l)*u,c*l-v(s)*u]}return e.invert&&(r.invert=function(r,n){var a=(r+n)*k,o=(n-r)*k,s=i(a)<.5*t&&i(o)<.5*t;if(!s){var l=t*k,u=a>0^o>0?-1:1,c=-u*r+(o>0?1:-1)*l,f=-u*n+(a>0?1:-1)*l;a=(-c-f)*k,o=(c-f)*k}var d=e.invert(a,o);return s||(d[0]+=a>0?b:-b),d}),(0,n.Z)(r).rotate([-90,-90,45]).clipAngle(179.999)}function ai(){return ii(Et).scale(176.423)}function oi(){return ii(Rt).scale(111.48)}function si(e,t){if(!(0<=(t=+t)&&t<=20))throw new Error("invalid digits");function r(e){var r=e.length,n=2,i=new Array(r);for(i[0]=+e[0].toFixed(t),i[1]=+e[1].toFixed(t);n2||a[0]!=t[0]||a[1]!=t[1])&&(n.push(a),t=a)}return 1===n.length&&e.length>1&&n.push(r(e[e.length-1])),n}function a(e){return e.map(i)}function o(e){if(null==e)return e;var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(o)};break;case"Point":t={type:"Point",coordinates:r(e.coordinates)};break;case"MultiPoint":t={type:e.type,coordinates:n(e.coordinates)};break;case"LineString":t={type:e.type,coordinates:i(e.coordinates)};break;case"MultiLineString":case"Polygon":t={type:e.type,coordinates:a(e.coordinates)};break;case"MultiPolygon":t={type:"MultiPolygon",coordinates:e.coordinates.map(a)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function s(e){var t={type:"Feature",properties:e.properties,geometry:o(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),t}if(null!=e)switch(e.type){case"Feature":return s(e);case"FeatureCollection":var l={type:"FeatureCollection",features:e.features.map(s)};return null!=e.bbox&&(l.bbox=e.bbox),l;default:return o(e)}return e}function li(e){var t=m(e);function r(r,n){var i=t?g(r*t/2)/t:r/2;if(!n)return[2*i,-e];var o=2*a(i*m(n)),l=1/g(n);return[m(o)*l,n+(1-s(o))*l-e]}return r.invert=function(r,n){if(i(n+=e)y&&--c>0);var h=r*(f=g(u)),v=g(i(n)0?_:-_)*(f+o*(h-l)/2+o*o*(h-2*f+l)/2)]}function di(){return(0,n.Z)(fi).scale(152.63)}function pi(e,t){var r=function(e){function t(t,r){var n=s(r),i=(e-1)/(e-n*s(t));return[i*n*m(t),i*m(r)]}return t.invert=function(t,r){var n=t*t+r*r,i=L(n),a=(e-L(1-n*(e+1)/(e-1)))/((e-1)/i+i/(e-1));return[o(t*a,i*L(1-a*a)),i?E(r*a/i):0]},t}(e);if(!t)return r;var n=s(t),i=m(t);function a(t,a){var o=r(t,a),s=o[1],l=s*i/(e-1)+n;return[o[0]*n/l,s/l]}return a.invert=function(t,a){var o=(e-1)/(e-1-a*i);return r.invert(o*t,o*a*n)},a}function hi(){var e=2,t=0,r=(0,n.r)(pi),i=r(e,t);return i.distance=function(n){return arguments.length?r(e=+n,t):e},i.tilt=function(n){return arguments.length?r(e,t=n*C):t*A},i.scale(432.147).clipAngle(P(1/e)*A-1e-6)}ci.forEach((function(e){e[1]*=1.0144})),fi.invert=function(e,t){var r=t/_,n=90*r,a=d(18,i(n/5)),o=f(0,u(a));do{var s=ci[o][1],l=ci[o+1][1],c=ci[d(19,o+2)][1],p=c-s,h=c-2*l+s,v=2*(i(r)-l)/p,m=h/p,g=v*(1-m*v*(1-2*m*v));if(g>=0||1===o){n=(t>=0?5:-5)*(g+a);var y,b=50;do{g=(a=d(18,i(n)/5))-(o=u(a)),s=ci[o][1],l=ci[o+1][1],c=ci[d(19,o+2)][1],n-=(y=(t>=0?_:-_)*(l+g*(c-s)/2+g*g*(c-2*l+s)/2)-t)*A}while(i(y)>x&&--b>0);break}}while(--o>=0);var w=ci[o][0],k=ci[o+1][0],T=ci[d(19,o+2)][0];return[e/(k+g*(T-w)/2+g*g*(T-2*k+w)/2),n*C]};var vi=1e-4,mi=1e4,gi=-180,yi=gi+vi,xi=180,bi=xi-vi,_i=-90,wi=_i+vi,ki=90,Ti=ki-vi;function Mi(e){return e.length>0}function Si(e){return e===_i||e===ki?[0,e]:[gi,(t=e,Math.floor(t*mi)/mi)];var t}function Ai(e){var t=e[0],r=e[1],n=!1;return t<=yi?(t=gi,n=!0):t>=bi&&(t=xi,n=!0),r<=wi?(r=_i,n=!0):r>=Ti&&(r=ki,n=!0),n?[t,r]:e}function Ci(e){return e.map(Ai)}function Ei(e,t,r){for(var n=0,i=e.length;n=bi||c<=wi||c>=Ti){a[o]=Ai(l);for(var f=o+1;fyi&&pwi&&h=s)break;r.push({index:-1,polygon:t,ring:a=a.slice(f-1)}),a[0]=Si(a[0][1]),o=-1,s=a.length}}}}function Pi(e){var t,r,n,i,a,o,s=e.length,l={},u={};for(t=0;t0?b-l:l)*A],c=(0,n.Z)(e(s)).rotate(u),f=(0,_e.Z)(u),d=c.center;return delete c.rotate,c.center=function(e){return arguments.length?d(f(e)):f.invert(d())},c.clipAngle(90)}function Fi(e){var t=s(e);function r(e,r){var n=(0,Fn.M)(e,r);return n[0]*=t,n}return r.invert=function(e,r){return Fn.M.invert(e/t,r)},r}function ji(){return Ni([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Ni(e,t){return zi(Fi,e,t)}function Zi(e){if(!(e*=2))return G.N;var t=-e/2,r=-t,n=e*e,i=g(r),a=.5/m(r);function l(i,a){var o=P(s(a)*s(i-t)),l=P(s(a)*s(i-r));return[((o*=o)-(l*=l))/(2*e),(a<0?-1:1)*L(4*n*l-(n-o+l)*(n-o+l))/(2*e)]}return l.invert=function(e,n){var l,u,c=n*n,f=s(L(c+(l=e+t)*l)),d=s(L(c+(l=e+r)*l));return[o(u=f-d,l=(f+d)*i),(n<0?-1:1)*P(L(l*l+u*u)*a)]},l}function Bi(){return Vi([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function Vi(e,t){return zi(Zi,e,t)}function Ui(e,t){if(i(t)y&&--l>0);return[v(e)*(L(a*a+4)+a)*b/4,_*s]};var ea=4*b+3*L(3),ta=2*L(2*b*L(3)/ea),ra=ie(ta*L(3)/b,ta,ea/6);function na(){return(0,n.Z)(ra).scale(176.84)}function ia(e,t){return[e*L(1-3*t*t/(b*b)),t]}function aa(){return(0,n.Z)(ia).scale(152.63)}function oa(e,t){var r=s(t),n=s(e)*r,i=1-n,a=s(e=o(m(e)*r,-m(t))),l=m(e);return[l*(r=L(1-n*n))-a*i,-a*r-l*i]}function sa(){return(0,n.Z)(oa).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)}function la(e,t){var r=z(e,t);return[(r[0]+e/_)/2,(r[1]+t)/2]}function ua(){return(0,n.Z)(la).scale(158.837)}ia.invert=function(e,t){return[e/L(1-3*t*t/(b*b)),t]},oa.invert=function(e,t){var r=(e*e+t*t)/-2,n=L(-r*(2+r)),i=t*r+e*n,a=e*r-t*n,s=L(a*a+i*i);return[o(n*i,s*(1+r)),s?-E(n*a/s):0]},la.invert=function(e,t){var r=e,n=t,a=25;do{var o,l=s(n),u=m(n),c=m(2*n),f=u*u,d=l*l,p=m(r),h=s(r/2),v=m(r/2),g=v*v,x=1-d*h*h,b=x?P(l*h)*L(o=1/x):o=0,w=.5*(2*b*l*v+r/_)-e,k=.5*(b*u+n)-t,T=.5*o*(d*g+b*l*h*f)+.5/_,M=o*(p*c/4-b*u*v),S=.125*o*(c*v-b*u*d*p),A=.5*o*(f*h+b*g*l)+.5,C=M*S-A*T,E=(k*M-w*A)/C,I=(w*S-k*T)/C;r-=E,n-=I}while((i(E)>y||i(I)>y)&&--a>0);return[r,n]}},33940:function(e,t,r){"use strict";function n(){return new i}function i(){this.reset()}r.d(t,{Z:function(){return n}}),i.prototype={constructor:i,reset:function(){this.s=this.t=0},add:function(e){o(a,e,this.t),o(this,a.s,this.s),this.s?this.t+=a.t:this.s=a.t},valueOf:function(){return this.s}};var a=new i;function o(e,t,r){var n=e.s=t+r,i=n-t,a=n-i;e.t=t-a+(r-i)}},97860:function(e,t,r){"use strict";r.d(t,{L9:function(){return d},ZP:function(){return x},gL:function(){return h}});var n,i,a,o,s,l=r(33940),u=r(39695),c=r(73182),f=r(72736),d=(0,l.Z)(),p=(0,l.Z)(),h={point:c.Z,lineStart:c.Z,lineEnd:c.Z,polygonStart:function(){d.reset(),h.lineStart=v,h.lineEnd=m},polygonEnd:function(){var e=+d;p.add(e<0?u.BZ+e:e),this.lineStart=this.lineEnd=this.point=c.Z},sphere:function(){p.add(u.BZ)}};function v(){h.point=g}function m(){y(n,i)}function g(e,t){h.point=y,n=e,i=t,e*=u.uR,t*=u.uR,a=e,o=(0,u.mC)(t=t/2+u.pu),s=(0,u.O$)(t)}function y(e,t){e*=u.uR,t=(t*=u.uR)/2+u.pu;var r=e-a,n=r>=0?1:-1,i=n*r,l=(0,u.mC)(t),c=(0,u.O$)(t),f=s*c,p=o*l+f*(0,u.mC)(i),h=f*n*(0,u.O$)(i);d.add((0,u.fv)(h,p)),a=e,o=l,s=c}function x(e){return p.reset(),(0,f.Z)(e,h),2*p}},77338:function(e,t,r){"use strict";r.d(t,{Z:function(){return P}});var n,i,a,o,s,l,u,c,f,d,p=r(33940),h=r(97860),v=r(7620),m=r(39695),g=r(72736),y=(0,p.Z)(),x={point:b,lineStart:w,lineEnd:k,polygonStart:function(){x.point=T,x.lineStart=M,x.lineEnd=S,y.reset(),h.gL.polygonStart()},polygonEnd:function(){h.gL.polygonEnd(),x.point=b,x.lineStart=w,x.lineEnd=k,h.L9<0?(n=-(a=180),i=-(o=90)):y>m.Ho?o=90:y<-m.Ho&&(i=-90),d[0]=n,d[1]=a},sphere:function(){n=-(a=180),i=-(o=90)}};function b(e,t){f.push(d=[n=e,a=e]),to&&(o=t)}function _(e,t){var r=(0,v.Og)([e*m.uR,t*m.uR]);if(c){var l=(0,v.T5)(c,r),u=[l[1],-l[0],0],p=(0,v.T5)(u,l);(0,v.iJ)(p),p=(0,v.Y1)(p);var h,g=e-s,y=g>0?1:-1,x=p[0]*m.RW*y,b=(0,m.Wn)(g)>180;b^(y*so&&(o=h):b^(y*s<(x=(x+360)%360-180)&&xo&&(o=t)),b?eA(n,a)&&(a=e):A(e,a)>A(n,a)&&(n=e):a>=n?(ea&&(a=e)):e>s?A(n,e)>A(n,a)&&(a=e):A(e,a)>A(n,a)&&(n=e)}else f.push(d=[n=e,a=e]);to&&(o=t),c=r,s=e}function w(){x.point=_}function k(){d[0]=n,d[1]=a,x.point=b,c=null}function T(e,t){if(c){var r=e-s;y.add((0,m.Wn)(r)>180?r+(r>0?360:-360):r)}else l=e,u=t;h.gL.point(e,t),_(e,t)}function M(){h.gL.lineStart()}function S(){T(l,u),h.gL.lineEnd(),(0,m.Wn)(y)>m.Ho&&(n=-(a=180)),d[0]=n,d[1]=a,c=null}function A(e,t){return(t-=e)<0?t+360:t}function C(e,t){return e[0]-t[0]}function E(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tA(s[0],s[1])&&(s[1]=l[1]),A(l[0],s[1])>A(s[0],s[1])&&(s[0]=l[0])):u.push(s=l);for(c=-1/0,t=0,s=u[r=u.length-1];t<=r;s=l,++t)l=u[t],(p=A(s[1],l[0]))>c&&(c=p,n=l[0],a=s[1])}return f=d=null,n===1/0||i===1/0?[[NaN,NaN],[NaN,NaN]]:[[n,i],[a,o]]}},7620:function(e,t,r){"use strict";r.d(t,{Og:function(){return a},T:function(){return u},T5:function(){return s},Y1:function(){return i},iJ:function(){return c},j9:function(){return o},s0:function(){return l}});var n=r(39695);function i(e){return[(0,n.fv)(e[1],e[0]),(0,n.ZR)(e[2])]}function a(e){var t=e[0],r=e[1],i=(0,n.mC)(r);return[i*(0,n.mC)(t),i*(0,n.O$)(t),(0,n.O$)(r)]}function o(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function s(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function l(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function u(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function c(e){var t=(0,n._b)(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}},66624:function(e,t,r){"use strict";r.d(t,{Z:function(){return R}});var n,i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x=r(39695),b=r(73182),_=r(72736),w={sphere:b.Z,point:k,lineStart:M,lineEnd:C,polygonStart:function(){w.lineStart=E,w.lineEnd=P},polygonEnd:function(){w.lineStart=M,w.lineEnd=C}};function k(e,t){e*=x.uR,t*=x.uR;var r=(0,x.mC)(t);T(r*(0,x.mC)(e),r*(0,x.O$)(e),(0,x.O$)(t))}function T(e,t,r){++n,a+=(e-a)/n,o+=(t-o)/n,s+=(r-s)/n}function M(){w.point=S}function S(e,t){e*=x.uR,t*=x.uR;var r=(0,x.mC)(t);m=r*(0,x.mC)(e),g=r*(0,x.O$)(e),y=(0,x.O$)(t),w.point=A,T(m,g,y)}function A(e,t){e*=x.uR,t*=x.uR;var r=(0,x.mC)(t),n=r*(0,x.mC)(e),a=r*(0,x.O$)(e),o=(0,x.O$)(t),s=(0,x.fv)((0,x._b)((s=g*o-y*a)*s+(s=y*n-m*o)*s+(s=m*a-g*n)*s),m*n+g*a+y*o);i+=s,l+=s*(m+(m=n)),u+=s*(g+(g=a)),c+=s*(y+(y=o)),T(m,g,y)}function C(){w.point=k}function E(){w.point=L}function P(){I(h,v),w.point=k}function L(e,t){h=e,v=t,e*=x.uR,t*=x.uR,w.point=I;var r=(0,x.mC)(t);m=r*(0,x.mC)(e),g=r*(0,x.O$)(e),y=(0,x.O$)(t),T(m,g,y)}function I(e,t){e*=x.uR,t*=x.uR;var r=(0,x.mC)(t),n=r*(0,x.mC)(e),a=r*(0,x.O$)(e),o=(0,x.O$)(t),s=g*o-y*a,h=y*n-m*o,v=m*a-g*n,b=(0,x._b)(s*s+h*h+v*v),_=(0,x.ZR)(b),w=b&&-_/b;f+=w*s,d+=w*h,p+=w*v,i+=_,l+=_*(m+(m=n)),u+=_*(g+(g=a)),c+=_*(y+(y=o)),T(m,g,y)}function R(e){n=i=a=o=s=l=u=c=f=d=p=0,(0,_.Z)(e,w);var t=f,r=d,h=p,v=t*t+r*r+h*h;return v0?os)&&(o+=i*a.BZ));for(var d,p=o;i>0?p>s:p0?i.pi:-i.pi,u=(0,i.Wn)(o-r);(0,i.Wn)(u-i.pi)0?i.ou:-i.ou),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),e.point(o,n),t=0):a!==l&&u>=i.pi&&((0,i.Wn)(r-a)i.Ho?(0,i.z4)(((0,i.O$)(t)*(o=(0,i.mC)(n))*(0,i.O$)(r)-(0,i.O$)(n)*(a=(0,i.mC)(t))*(0,i.O$)(e))/(a*o*s)):(t+n)/2}(r,n,o,s),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),t=0),e.point(r=o,n=s),a=l},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}}),(function(e,t,r,n){var a;if(null==e)a=r*i.ou,n.point(-i.pi,a),n.point(0,a),n.point(i.pi,a),n.point(i.pi,0),n.point(i.pi,-a),n.point(0,-a),n.point(-i.pi,-a),n.point(-i.pi,0),n.point(-i.pi,a);else if((0,i.Wn)(e[0]-t[0])>i.Ho){var o=e[0]1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}},1457:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(7620),i=r(7613),a=r(39695),o=r(67108),s=r(97023);function l(e){var t=(0,a.mC)(e),r=6*a.uR,l=t>0,u=(0,a.Wn)(t)>a.Ho;function c(e,r){return(0,a.mC)(e)*(0,a.mC)(r)>t}function f(e,r,i){var o=(0,n.Og)(e),s=(0,n.Og)(r),l=[1,0,0],u=(0,n.T5)(o,s),c=(0,n.j9)(u,u),f=u[0],d=c-f*f;if(!d)return!i&&e;var p=t*c/d,h=-t*f/d,v=(0,n.T5)(l,u),m=(0,n.T)(l,p),g=(0,n.T)(u,h);(0,n.s0)(m,g);var y=v,x=(0,n.j9)(m,y),b=(0,n.j9)(y,y),_=x*x-b*((0,n.j9)(m,m)-1);if(!(_<0)){var w=(0,a._b)(_),k=(0,n.T)(y,(-x-w)/b);if((0,n.s0)(k,m),k=(0,n.Y1)(k),!i)return k;var T,M=e[0],S=r[0],A=e[1],C=r[1];S0^k[1]<((0,a.Wn)(k[0]-M)a.pi^(M<=k[0]&&k[0]<=S)){var L=(0,n.T)(y,(-x+w)/b);return(0,n.s0)(L,m),[k,(0,n.Y1)(L)]}}}function d(t,r){var n=l?e:a.pi-e,i=0;return t<-n?i|=1:t>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}return(0,s.Z)(c,(function(e){var t,r,n,i,s;return{lineStart:function(){i=n=!1,s=1},point:function(p,h){var v,m=[p,h],g=c(p,h),y=l?g?0:d(p,h):g?d(p+(p<0?a.pi:-a.pi),h):0;if(!t&&(i=n=g)&&e.lineStart(),g!==n&&(!(v=f(t,m))||(0,o.Z)(t,v)||(0,o.Z)(m,v))&&(m[2]=1),g!==n)s=0,g?(e.lineStart(),v=f(m,t),e.point(v[0],v[1])):(v=f(t,m),e.point(v[0],v[1],2),e.lineEnd()),t=v;else if(u&&t&&l^g){var x;y&r||!(x=f(m,t,!0))||(s=0,l?(e.lineStart(),e.point(x[0][0],x[0][1]),e.point(x[1][0],x[1][1]),e.lineEnd()):(e.point(x[1][0],x[1][1]),e.lineEnd(),e.lineStart(),e.point(x[0][0],x[0][1],3)))}!g||t&&(0,o.Z)(t,m)||e.point(m[0],m[1]),t=m,n=g,r=y},lineEnd:function(){n&&e.lineEnd(),t=null},clean:function(){return s|(i&&n)<<1}}}),(function(t,n,a,o){(0,i.m)(o,e,r,a,t,n)}),l?[0,-e]:[-a.pi,e-a.pi])}},97023:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(85272),i=r(46225),a=r(39695),o=r(23071),s=r(33064);function l(e,t,r,a){return function(l){var f,d,p,h=t(l),v=(0,n.Z)(),m=t(v),g=!1,y={point:x,lineStart:_,lineEnd:w,polygonStart:function(){y.point=k,y.lineStart=T,y.lineEnd=M,d=[],f=[]},polygonEnd:function(){y.point=x,y.lineStart=_,y.lineEnd=w,d=(0,s.TS)(d);var e=(0,o.Z)(f,a);d.length?(g||(l.polygonStart(),g=!0),(0,i.Z)(d,c,e,r,l)):e&&(g||(l.polygonStart(),g=!0),l.lineStart(),r(null,null,1,l),l.lineEnd()),g&&(l.polygonEnd(),g=!1),d=f=null},sphere:function(){l.polygonStart(),l.lineStart(),r(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function x(t,r){e(t,r)&&l.point(t,r)}function b(e,t){h.point(e,t)}function _(){y.point=b,h.lineStart()}function w(){y.point=x,h.lineEnd()}function k(e,t){p.push([e,t]),m.point(e,t)}function T(){m.lineStart(),p=[]}function M(){k(p[0][0],p[0][1]),m.lineEnd();var e,t,r,n,i=m.clean(),a=v.result(),o=a.length;if(p.pop(),f.push(p),p=null,o)if(1&i){if((t=(r=a[0]).length-1)>0){for(g||(l.polygonStart(),g=!0),l.lineStart(),e=0;e1&&2&i&&a.push(a.pop().concat(a.shift())),d.push(a.filter(u))}return y}}function u(e){return e.length>1}function c(e,t){return((e=e.x)[0]<0?e[1]-a.ou-a.Ho:a.ou-e[1])-((t=t.x)[0]<0?t[1]-a.ou-a.Ho:a.ou-t[1])}},87605:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(39695),i=r(85272),a=r(46225),o=r(33064),s=1e9,l=-s;function u(e,t,r,u){function c(n,i){return e<=n&&n<=r&&t<=i&&i<=u}function f(n,i,a,o){var s=0,l=0;if(null==n||(s=d(n,a))!==(l=d(i,a))||h(n,i)<0^a>0)do{o.point(0===s||3===s?e:r,s>1?u:t)}while((s=(s+a+4)%4)!==l);else o.point(i[0],i[1])}function d(i,a){return(0,n.Wn)(i[0]-e)0?0:3:(0,n.Wn)(i[0]-r)0?2:1:(0,n.Wn)(i[1]-t)0?1:0:a>0?3:2}function p(e,t){return h(e.x,t.x)}function h(e,t){var r=d(e,1),n=d(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(n){var d,h,v,m,g,y,x,b,_,w,k,T=n,M=(0,i.Z)(),S={point:A,lineStart:function(){S.point=C,h&&h.push(v=[]),w=!0,_=!1,x=b=NaN},lineEnd:function(){d&&(C(m,g),y&&_&&M.rejoin(),d.push(M.result())),S.point=A,_&&T.lineEnd()},polygonStart:function(){T=M,d=[],h=[],k=!0},polygonEnd:function(){var t=function(){for(var t=0,r=0,n=h.length;ru&&(f-i)*(u-a)>(d-a)*(e-i)&&++t:d<=u&&(f-i)*(u-a)<(d-a)*(e-i)&&--t;return t}(),r=k&&t,i=(d=(0,o.TS)(d)).length;(r||i)&&(n.polygonStart(),r&&(n.lineStart(),f(null,null,1,n),n.lineEnd()),i&&(0,a.Z)(d,p,t,f,n),n.polygonEnd()),T=n,d=h=v=null}};function A(e,t){c(e,t)&&T.point(e,t)}function C(n,i){var a=c(n,i);if(h&&v.push([n,i]),w)m=n,g=i,y=a,w=!1,a&&(T.lineStart(),T.point(n,i));else if(a&&_)T.point(n,i);else{var o=[x=Math.max(l,Math.min(s,x)),b=Math.max(l,Math.min(s,b))],f=[n=Math.max(l,Math.min(s,n)),i=Math.max(l,Math.min(s,i))];!function(e,t,r,n,i,a){var o,s=e[0],l=e[1],u=0,c=1,f=t[0]-s,d=t[1]-l;if(o=r-s,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>c)return;o>u&&(u=o)}if(o=i-s,f||!(o<0)){if(o/=f,f<0){if(o>c)return;o>u&&(u=o)}else if(f>0){if(o0)){if(o/=d,d<0){if(o0){if(o>c)return;o>u&&(u=o)}if(o=a-l,d||!(o<0)){if(o/=d,d<0){if(o>c)return;o>u&&(u=o)}else if(d>0){if(o0&&(e[0]=s+u*f,e[1]=l+u*d),c<1&&(t[0]=s+c*f,t[1]=l+c*d),!0}}}}}(o,f,e,t,r,u)?a&&(T.lineStart(),T.point(n,i),k=!1):(_||(T.lineStart(),T.point(o[0],o[1])),T.point(f[0],f[1]),a||T.lineEnd(),k=!1)}x=n,b=i,_=a}return S}}},46225:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(67108),i=r(39695);function a(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function o(e,t,r,o,l){var u,c,f=[],d=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,r,o=e[0],s=e[t];if((0,n.Z)(o,s)){if(!o[2]&&!s[2]){for(l.lineStart(),u=0;u=0;--u)l.point((h=p[u])[0],h[1]);else o(m.x,m.p.x,-1,l);m=m.p}p=(m=m.o).z,g=!g}while(!m.v);l.lineEnd()}}}function s(e){if(t=e.length){for(var t,r,n=0,i=e[0];++n0&&(i=A(e[a],e[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))m.Ho})).map(l)).concat((0,F.w6)((0,m.mD)(a/p)*p,i,p).filter((function(e){return(0,m.Wn)(e%v)>m.Ho})).map(u))}return y.lines=function(){return x().map((function(e){return{type:"LineString",coordinates:e}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(n).concat(f(o).slice(1),c(r).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.extentMajor(e).extentMinor(e):y.extentMinor()},y.extentMajor=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),y.precision(g)):[[n,s],[r,o]]},y.extentMinor=function(r){return arguments.length?(t=+r[0][0],e=+r[1][0],a=+r[0][1],i=+r[1][1],t>e&&(r=t,t=e,e=r),a>i&&(r=a,a=i,i=r),y.precision(g)):[[t,a],[e,i]]},y.step=function(e){return arguments.length?y.stepMajor(e).stepMinor(e):y.stepMinor()},y.stepMajor=function(e){return arguments.length?(h=+e[0],v=+e[1],y):[h,v]},y.stepMinor=function(e){return arguments.length?(d=+e[0],p=+e[1],y):[d,p]},y.precision=function(d){return arguments.length?(g=+d,l=j(a,i,90),u=N(t,e,g),c=j(s,o,90),f=N(n,r,g),y):g},y.extentMajor([[-180,-90+m.Ho],[180,90-m.Ho]]).extentMinor([[-180,-80-m.Ho],[180,80+m.Ho]])}function B(){return Z()()}var V,U,H,W,G=r(83074),q=r(8593),Y=(0,v.Z)(),X=(0,v.Z)(),K={point:g.Z,lineStart:g.Z,lineEnd:g.Z,polygonStart:function(){K.lineStart=$,K.lineEnd=ee},polygonEnd:function(){K.lineStart=K.lineEnd=K.point=g.Z,Y.add((0,m.Wn)(X)),X.reset()},result:function(){var e=Y/2;return Y.reset(),e}};function $(){K.point=J}function J(e,t){K.point=Q,V=H=e,U=W=t}function Q(e,t){X.add(W*e-H*t),H=e,W=t}function ee(){Q(V,U)}var te,re,ne,ie,ae=K,oe=r(3559),se=0,le=0,ue=0,ce=0,fe=0,de=0,pe=0,he=0,ve=0,me={point:ge,lineStart:ye,lineEnd:_e,polygonStart:function(){me.lineStart=we,me.lineEnd=ke},polygonEnd:function(){me.point=ge,me.lineStart=ye,me.lineEnd=_e},result:function(){var e=ve?[pe/ve,he/ve]:de?[ce/de,fe/de]:ue?[se/ue,le/ue]:[NaN,NaN];return se=le=ue=ce=fe=de=pe=he=ve=0,e}};function ge(e,t){se+=e,le+=t,++ue}function ye(){me.point=xe}function xe(e,t){me.point=be,ge(ne=e,ie=t)}function be(e,t){var r=e-ne,n=t-ie,i=(0,m._b)(r*r+n*n);ce+=i*(ne+e)/2,fe+=i*(ie+t)/2,de+=i,ge(ne=e,ie=t)}function _e(){me.point=ge}function we(){me.point=Te}function ke(){Me(te,re)}function Te(e,t){me.point=Me,ge(te=ne=e,re=ie=t)}function Me(e,t){var r=e-ne,n=t-ie,i=(0,m._b)(r*r+n*n);ce+=i*(ne+e)/2,fe+=i*(ie+t)/2,de+=i,pe+=(i=ie*e-ne*t)*(ne+e),he+=i*(ie+t),ve+=3*i,ge(ne=e,ie=t)}var Se=me;function Ae(e){this._context=e}Ae.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,m.BZ)}},result:g.Z};var Ce,Ee,Pe,Le,Ie,Re=(0,v.Z)(),Oe={point:g.Z,lineStart:function(){Oe.point=De},lineEnd:function(){Ce&&ze(Ee,Pe),Oe.point=g.Z},polygonStart:function(){Ce=!0},polygonEnd:function(){Ce=null},result:function(){var e=+Re;return Re.reset(),e}};function De(e,t){Oe.point=ze,Ee=Le=e,Pe=Ie=t}function ze(e,t){Le-=e,Ie-=t,Re.add((0,m._b)(Le*Le+Ie*Ie)),Le=e,Ie=t}var Fe=Oe;function je(){this._string=[]}function Ne(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Ze(e,t){var r,n,i=4.5;function a(e){return e&&("function"===typeof i&&n.pointRadius(+i.apply(this,arguments)),(0,y.Z)(e,r(n))),n.result()}return a.area=function(e){return(0,y.Z)(e,r(ae)),ae.result()},a.measure=function(e){return(0,y.Z)(e,r(Fe)),Fe.result()},a.bounds=function(e){return(0,y.Z)(e,r(oe.Z)),oe.Z.result()},a.centroid=function(e){return(0,y.Z)(e,r(Se)),Se.result()},a.projection=function(t){return arguments.length?(r=null==t?(e=null,q.Z):(e=t).stream,a):e},a.context=function(e){return arguments.length?(n=null==e?(t=null,new je):new Ae(t=e),"function"!==typeof i&&n.pointRadius(i),a):t},a.pointRadius=function(e){return arguments.length?(i="function"===typeof e?e:(n.pointRadius(+e),+e),a):i},a.projection(e).context(t)}je.prototype={_radius:4.5,_circle:Ne(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=Ne(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}};var Be=r(15002);function Ve(e){var t=0,r=m.pi/3,n=(0,Be.r)(e),i=n(t,r);return i.parallels=function(e){return arguments.length?n(t=e[0]*m.uR,r=e[1]*m.uR):[t*m.RW,r*m.RW]},i}function Ue(e,t){var r=(0,m.O$)(e),n=(r+(0,m.O$)(t))/2;if((0,m.Wn)(n)=.12&&i<.234&&n>=-.425&&n<-.214?s:i>=.166&&i<.234&&n>=-.214&&n<-.115?l:o).invert(e)},c.stream=function(r){return e&&t===r?e:e=function(e){var t=e.length;return{point:function(r,n){for(var i=-1;++i0?t<-m.ou+m.Ho&&(t=-m.ou+m.Ho):t>m.ou-m.Ho&&(t=m.ou-m.Ho);var r=i/(0,m.sQ)(et(t),n);return[r*(0,m.O$)(n*e),i-r*(0,m.mC)(n*e)]}return a.invert=function(e,t){var r=i-t,a=(0,m.Xx)(n)*(0,m._b)(e*e+r*r),o=(0,m.fv)(e,(0,m.Wn)(r))*(0,m.Xx)(r);return r*n<0&&(o-=m.pi*(0,m.Xx)(e)*(0,m.Xx)(r)),[o/n,2*(0,m.z4)((0,m.sQ)(i/a,1/n))-m.ou]},a}function rt(){return Ve(tt).scale(109.5).parallels([30,30])}$e.invert=function(e,t){return[e,2*(0,m.z4)((0,m.Qq)(t))-m.ou]};var nt=r(97492);function it(e,t){var r=(0,m.mC)(e),n=e===t?(0,m.O$)(e):(r-(0,m.mC)(t))/(t-e),i=r/n+e;if((0,m.Wn)(n)2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90]).scale(159.155)}xt.invert=(0,yt.O)((function(e){return 2*(0,m.z4)(e)})),_t.invert=function(e,t){return[-t,2*(0,m.z4)((0,m.Qq)(e))-m.ou]}},83074:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(39695);function i(e,t){var r=e[0]*n.uR,i=e[1]*n.uR,a=t[0]*n.uR,o=t[1]*n.uR,s=(0,n.mC)(i),l=(0,n.O$)(i),u=(0,n.mC)(o),c=(0,n.O$)(o),f=s*(0,n.mC)(r),d=s*(0,n.O$)(r),p=u*(0,n.mC)(a),h=u*(0,n.O$)(a),v=2*(0,n.ZR)((0,n._b)((0,n.Jy)(o-i)+s*u*(0,n.Jy)(a-r))),m=(0,n.O$)(v),g=v?function(e){var t=(0,n.O$)(e*=v)/m,r=(0,n.O$)(v-e)/m,i=r*f+t*p,a=r*d+t*h,o=r*l+t*c;return[(0,n.fv)(a,i)*n.RW,(0,n.fv)(o,(0,n._b)(i*i+a*a))*n.RW]}:function(){return[r*n.RW,i*n.RW]};return g.distance=v,g}},39695:function(e,t,r){"use strict";r.d(t,{BZ:function(){return l},Ho:function(){return n},Jy:function(){return M},Kh:function(){return k},O$:function(){return x},OR:function(){return w},Qq:function(){return m},RW:function(){return u},Wn:function(){return f},Xx:function(){return b},ZR:function(){return T},_b:function(){return _},aW:function(){return i},cM:function(){return g},fv:function(){return p},mC:function(){return h},mD:function(){return v},ou:function(){return o},pi:function(){return a},pu:function(){return s},sQ:function(){return y},uR:function(){return c},z4:function(){return d}});var n=1e-6,i=1e-12,a=Math.PI,o=a/2,s=a/4,l=2*a,u=180/a,c=a/180,f=Math.abs,d=Math.atan,p=Math.atan2,h=Math.cos,v=Math.ceil,m=Math.exp,g=(Math.floor,Math.log),y=Math.pow,x=Math.sin,b=Math.sign||function(e){return e>0?1:e<0?-1:0},_=Math.sqrt,w=Math.tan;function k(e){return e>1?0:e<-1?a:Math.acos(e)}function T(e){return e>1?o:e<-1?-o:Math.asin(e)}function M(e){return(e=x(e/2))*e}},73182:function(e,t,r){"use strict";function n(){}r.d(t,{Z:function(){return n}})},3559:function(e,t,r){"use strict";var n=r(73182),i=1/0,a=i,o=-i,s=o,l={point:function(e,t){eo&&(o=e),ts&&(s=t)},lineStart:n.Z,lineEnd:n.Z,polygonStart:n.Z,polygonEnd:n.Z,result:function(){var e=[[i,a],[o,s]];return o=s=-(a=i=1/0),e}};t.Z=l},67108:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(39695);function i(e,t){return(0,n.Wn)(e[0]-t[0])=0?1:-1,E=C*A,P=E>a.pi,L=x*M;if(o.add((0,a.fv)(L*C*(0,a.O$)(E),b*S+L*(0,a.mC)(E))),c+=P?A+C*a.BZ:A,P^g>=r^k>=r){var I=(0,i.T5)((0,i.Og)(m),(0,i.Og)(w));(0,i.iJ)(I);var R=(0,i.T5)(u,I);(0,i.iJ)(R);var O=(P^A>=0?-1:1)*(0,a.ZR)(R[2]);(n>O||n===O&&(I[0]||I[1]))&&(f+=P^A>=0?1:-1)}}return(c<-a.Ho||c4*t&&g--){var w=o+p,k=s+v,T=u+m,M=(0,l._b)(w*w+k*k+T*T),S=(0,l.ZR)(T/=M),A=(0,l.Wn)((0,l.Wn)(T)-1)t||(0,l.Wn)((x*L+b*I)/_-.5)>.3||o*p+s*v+u*m2?e[2]%360*l.uR:0,V()):[E*l.RW,P*l.RW,L*l.RW]},Z.angle=function(e){return arguments.length?(I=e%360*l.uR,V()):I*l.RW},Z.reflectX=function(e){return arguments.length?(R=e?-1:1,V()):R<0},Z.reflectY=function(e){return arguments.length?(O=e?-1:1,V()):O<0},Z.precision=function(e){return arguments.length?(x=v(b,N=e*e),U()):(0,l._b)(N)},Z.fitExtent=function(e,t){return(0,f.qg)(Z,e,t)},Z.fitSize=function(e,t){return(0,f.mF)(Z,e,t)},Z.fitWidth=function(e,t){return(0,f.V6)(Z,e,t)},Z.fitHeight=function(e,t){return(0,f.rf)(Z,e,t)},function(){return t=e.apply(this,arguments),Z.invert=t.invert&&B,V()}}},26867:function(e,t,r){"use strict";r.d(t,{K:function(){return a},Z:function(){return o}});var n=r(15002),i=r(39695);function a(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function o(){return(0,n.Z)(a).scale(175.295)}a.invert=function(e,t){var r,n=t,a=25;do{var o=n*n,s=o*o;n-=r=(n*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-t)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while((0,i.Wn)(r)>i.Ho&&--a>0);return[e/(.8707+(o=n*n)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),n]}},57962:function(e,t,r){"use strict";r.d(t,{I:function(){return o},Z:function(){return s}});var n=r(39695),i=r(25382),a=r(15002);function o(e,t){return[(0,n.mC)(t)*(0,n.O$)(e),(0,n.O$)(t)]}function s(){return(0,a.Z)(o).scale(249.5).clipAngle(90+n.Ho)}o.invert=(0,i.O)(n.ZR)},49386:function(e,t,r){"use strict";r.d(t,{I:function(){return o},Z:function(){return c}});var n=r(96059),i=r(39695);function a(e,t){return[(0,i.Wn)(e)>i.pi?e+Math.round(-e/i.BZ)*i.BZ:e,t]}function o(e,t,r){return(e%=i.BZ)?t||r?(0,n.Z)(l(e),u(t,r)):l(e):t||r?u(t,r):a}function s(e){return function(t,r){return[(t+=e)>i.pi?t-i.BZ:t<-i.pi?t+i.BZ:t,r]}}function l(e){var t=s(e);return t.invert=s(-e),t}function u(e,t){var r=(0,i.mC)(e),n=(0,i.O$)(e),a=(0,i.mC)(t),o=(0,i.O$)(t);function s(e,t){var s=(0,i.mC)(t),l=(0,i.mC)(e)*s,u=(0,i.O$)(e)*s,c=(0,i.O$)(t),f=c*r+l*n;return[(0,i.fv)(u*a-f*o,l*r-c*n),(0,i.ZR)(f*a+u*o)]}return s.invert=function(e,t){var s=(0,i.mC)(t),l=(0,i.mC)(e)*s,u=(0,i.O$)(e)*s,c=(0,i.O$)(t),f=c*a-u*o;return[(0,i.fv)(u*a+c*o,l*r+f*n),(0,i.ZR)(f*r-l*n)]},s}function c(e){function t(t){return(t=e(t[0]*i.uR,t[1]*i.uR))[0]*=i.RW,t[1]*=i.RW,t}return e=o(e[0]*i.uR,e[1]*i.uR,e.length>2?e[2]*i.uR:0),t.invert=function(t){return(t=e.invert(t[0]*i.uR,t[1]*i.uR))[0]*=i.RW,t[1]*=i.RW,t},t}a.invert=a},72736:function(e,t,r){"use strict";function n(e,t){e&&a.hasOwnProperty(e.type)&&a[e.type](e,t)}r.d(t,{Z:function(){return l}});var i={Feature:function(e,t){n(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,i=-1,a=r.length;++i=0;)t+=r[n].value;else t=1;e.value=t}function l(e,t){var r,n,i,a,o,s=new d(e),l=+e.value&&(s.value=e.value),c=[s];for(null==t&&(t=u);r=c.pop();)if(l&&(r.value=+r.data.value),(i=t(r.data))&&(o=i.length))for(r.children=new Array(o),a=o-1;a>=0;--a)c.push(n=r.children[a]=new d(i[a])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(f)}function u(e){return e.children}function c(e){e.data=e.data.data}function f(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function d(e){this.data=e,this.depth=this.height=0,this.parent=null}r.r(t),r.d(t,{cluster:function(){return o},hierarchy:function(){return l},pack:function(){return I},packEnclose:function(){return h},packSiblings:function(){return A},partition:function(){return j},stratify:function(){return H},tree:function(){return $},treemap:function(){return re},treemapBinary:function(){return ne},treemapDice:function(){return F},treemapResquarify:function(){return ae},treemapSlice:function(){return J},treemapSliceDice:function(){return ie},treemapSquarify:function(){return te}}),d.prototype=l.prototype={constructor:d,count:function(){return this.eachAfter(s)},each:function(e){var t,r,n,i,a=this,o=[a];do{for(t=o.reverse(),o=[];a=t.pop();)if(e(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(r){r!==e&&t.push({source:r.parent,target:r})})),t},copy:function(){return l(this).eachBefore(c)}};var p=Array.prototype.slice;function h(e){for(var t,r,n=0,i=(e=function(e){for(var t,r,n=e.length;n;)r=Math.random()*n--|0,t=e[n],e[n]=e[r],e[r]=t;return e}(p.call(e))).length,a=[];n0&&r*r>n*n+i*i}function y(e,t){for(var r=0;r(o*=o)?(n=(u+o-i)/(2*u),a=Math.sqrt(Math.max(0,o/u-n*n)),r.x=e.x-n*s-a*l,r.y=e.y-n*l+a*s):(n=(u+i-o)/(2*u),a=Math.sqrt(Math.max(0,i/u-n*n)),r.x=t.x+n*s-a*l,r.y=t.y+n*l+a*s)):(r.x=t.x+r.r,r.y=t.y)}function k(e,t){var r=e.r+t.r-1e-6,n=t.x-e.x,i=t.y-e.y;return r>0&&r*r>n*n+i*i}function T(e){var t=e._,r=e.next._,n=t.r+r.r,i=(t.x*r.r+r.x*t.r)/n,a=(t.y*r.r+r.y*t.r)/n;return i*i+a*a}function M(e){this._=e,this.next=null,this.previous=null}function S(e){if(!(i=e.length))return 0;var t,r,n,i,a,o,s,l,u,c,f;if((t=e[0]).x=0,t.y=0,!(i>1))return t.r;if(r=e[1],t.x=-r.r,r.x=t.r,r.y=0,!(i>2))return t.r+r.r;w(r,t,n=e[2]),t=new M(t),r=new M(r),n=new M(n),t.next=n.previous=r,r.next=t.previous=n,n.next=r.previous=t;e:for(s=3;s0)throw new Error("cycle");return a}return r.id=function(t){return arguments.length?(e=C(t),r):e},r.parentId=function(e){return arguments.length?(t=C(e),r):t},r}function W(e,t){return e.parent===t.parent?1:2}function G(e){var t=e.children;return t?t[0]:e.t}function q(e){var t=e.children;return t?t[t.length-1]:e.t}function Y(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function X(e,t,r){return e.a.parent===t.parent?e.a:r}function K(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function $(){var e=W,t=1,r=1,n=null;function i(i){var l=function(e){for(var t,r,n,i,a,o=new K(e,0),s=[o];t=s.pop();)if(n=t._.children)for(t.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=t.children[i]=new K(n[i],i)),r.parent=t;return(o.parent=new K(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var u=i,c=i,f=i;i.eachBefore((function(e){e.xc.x&&(c=e),e.depth>f.depth&&(f=e)}));var d=u===c?1:e(u,c)/2,p=d-u.x,h=t/(c.x+d+p),v=r/(f.depth||1);i.eachBefore((function(e){e.x=(e.x+p)*h,e.y=e.depth*v}))}return i}function a(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var a=(r[0].z+r[r.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,r,n){if(r){for(var i,a=t,o=t,s=r,l=a.parent.children[0],u=a.m,c=o.m,f=s.m,d=l.m;s=q(s),a=G(a),s&&a;)l=G(l),(o=q(o)).a=t,(i=s.z+f-a.z-u+e(s._,a._))>0&&(Y(X(s,t,n),t,i),u+=i,c+=i),f+=s.m,u+=a.m,d+=l.m,c+=o.m;s&&!q(o)&&(o.t=s,o.m+=f-c),a&&!G(l)&&(l.t=a,l.m+=u-d,n=t)}return n}(t,i,t.parent.A||n[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],i):n?null:[t,r]},i.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],i):n?[t,r]:null},i}function J(e,t,r,n,i){for(var a,o=e.children,s=-1,l=o.length,u=e.value&&(i-r)/e.value;++sd&&(d=s),m=c*c*v,(p=Math.max(d/m,m/f))>h){c-=s;break}h=p}g.push(o={value:c,dice:l1?t:1)},r}(Q);function re(){var e=te,t=!1,r=1,n=1,i=[0],a=E,o=E,s=E,l=E,u=E;function c(e){return e.x0=e.y0=0,e.x1=r,e.y1=n,e.eachBefore(f),i=[0],t&&e.eachBefore(z),e}function f(t){var r=i[t.depth],n=t.x0+r,c=t.y0+r,f=t.x1-r,d=t.y1-r;f=r-1){var c=s[t];return c.x0=i,c.y0=a,c.x1=o,void(c.y1=l)}for(var f=u[t],d=n/2+f,p=t+1,h=r-1;p>>1;u[v]l-a){var y=(i*g+o*m)/n;e(t,p,m,i,a,y,l),e(p,r,g,y,a,o,l)}else{var x=(a*g+l*m)/n;e(t,p,m,i,a,o,x),e(p,r,g,i,x,o,l)}}(0,l,e.value,t,r,n,i)}function ie(e,t,r,n,i){(1&e.depth?J:F)(e,t,r,n,i)}var ae=function e(t){function r(e,r,n,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,l,u,c,f=-1,d=o.length,p=e.value;++f1?t:1)},r}(Q)},45879:function(e,t,r){"use strict";r.d(t,{h5:function(){return y}});var n=Math.PI,i=2*n,a=1e-6,o=i-a;function s(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function l(){return new s}s.prototype=l.prototype={constructor:s,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,i,a){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,r,i,o){e=+e,t=+t,r=+r,i=+i,o=+o;var s=this._x1,l=this._y1,u=r-e,c=i-t,f=s-e,d=l-t,p=f*f+d*d;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(p>a)if(Math.abs(d*u-c*f)>a&&o){var h=r-s,v=i-l,m=u*u+c*c,g=h*h+v*v,y=Math.sqrt(m),x=Math.sqrt(p),b=o*Math.tan((n-Math.acos((m+p-g)/(2*y*x)))/2),_=b/x,w=b/y;Math.abs(_-1)>a&&(this._+="L"+(e+_*f)+","+(t+_*d)),this._+="A"+o+","+o+",0,0,"+ +(d*h>f*v)+","+(this._x1=e+w*u)+","+(this._y1=t+w*c)}else this._+="L"+(this._x1=e)+","+(this._y1=t)},arc:function(e,t,r,s,l,u){e=+e,t=+t,u=!!u;var c=(r=+r)*Math.cos(s),f=r*Math.sin(s),d=e+c,p=t+f,h=1^u,v=u?s-l:l-s;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+d+","+p:(Math.abs(this._x1-d)>a||Math.abs(this._y1-p)>a)&&(this._+="L"+d+","+p),r&&(v<0&&(v=v%i+i),v>o?this._+="A"+r+","+r+",0,1,"+h+","+(e-c)+","+(t-f)+"A"+r+","+r+",0,1,"+h+","+(this._x1=d)+","+(this._y1=p):v>a&&(this._+="A"+r+","+r+",0,"+ +(v>=n)+","+h+","+(this._x1=e+r*Math.cos(l))+","+(this._y1=t+r*Math.sin(l))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};var u=l,c=Array.prototype.slice;function f(e){return function(){return e}}function d(e){return e[0]}function p(e){return e[1]}function h(e){return e.source}function v(e){return e.target}function m(e){var t=h,r=v,n=d,i=p,a=null;function o(){var o,s=c.call(arguments),l=t.apply(this,s),f=r.apply(this,s);if(a||(a=o=u()),e(a,+n.apply(this,(s[0]=l,s)),+i.apply(this,s),+n.apply(this,(s[0]=f,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(r=e,o):r},o.x=function(e){return arguments.length?(n="function"===typeof e?e:f(+e),o):n},o.y=function(e){return arguments.length?(i="function"===typeof e?e:f(+e),o):i},o.context=function(e){return arguments.length?(a=null==e?null:e,o):a},o}function g(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,i,n,i)}function y(){return m(g)}},84096:function(e,t,r){"use strict";r.d(t,{i$:function(){return h},Dq:function(){return d},g0:function(){return v}});var n=r(58176),i=r(48480),a=r(59879),o=r(82301),s=r(34823),l=r(79791);function u(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function c(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function f(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function d(e){var t=e.dateTime,r=e.date,s=e.time,l=e.periods,d=e.days,p=e.shortDays,h=e.months,v=e.shortMonths,g=w(l),y=k(l),x=w(d),b=k(d),_=w(p),Ae=k(p),Ce=w(h),Ee=k(h),Pe=w(v),Le=k(v),Ie={a:function(e){return p[e.getDay()]},A:function(e){return d[e.getDay()]},b:function(e){return v[e.getMonth()]},B:function(e){return h[e.getMonth()]},c:null,d:H,e:H,f:X,H:W,I:G,j:q,L:Y,m:K,M:$,p:function(e){return l[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Me,s:Se,S:J,u:Q,U:ee,V:te,w:re,W:ne,x:null,X:null,y:ie,Y:ae,Z:oe,"%":Te},Re={a:function(e){return p[e.getUTCDay()]},A:function(e){return d[e.getUTCDay()]},b:function(e){return v[e.getUTCMonth()]},B:function(e){return h[e.getUTCMonth()]},c:null,d:se,e:se,f:de,H:le,I:ue,j:ce,L:fe,m:pe,M:he,p:function(e){return l[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Me,s:Se,S:ve,u:me,U:ge,V:ye,w:xe,W:be,x:null,X:null,y:_e,Y:we,Z:ke,"%":Te},Oe={a:function(e,t,r){var n=_.exec(t.slice(r));return n?(e.w=Ae[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=x.exec(t.slice(r));return n?(e.w=b[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.m=Le[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=Ce.exec(t.slice(r));return n?(e.m=Ee[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,r,n){return Fe(e,t,r,n)},d:O,e:O,f:Z,H:z,I:z,j:D,L:N,m:R,M:F,p:function(e,t,r){var n=g.exec(t.slice(r));return n?(e.p=y[n[0].toLowerCase()],r+n[0].length):-1},q:I,Q:V,s:U,S:j,u:M,U:S,V:A,w:T,W:C,x:function(e,t,n){return Fe(e,r,t,n)},X:function(e,t,r){return Fe(e,s,t,r)},y:P,Y:E,Z:L,"%":B};function De(e,t){return function(r){var n,i,a,o=[],s=-1,l=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++s53)return null;"w"in d||(d.w=1),"Z"in d?(l=(s=c(f(d.y,0,1))).getUTCDay(),s=l>4||0===l?n.l6.ceil(s):(0,n.l6)(s),s=i.Z.offset(s,7*(d.V-1)),d.y=s.getUTCFullYear(),d.m=s.getUTCMonth(),d.d=s.getUTCDate()+(d.w+6)%7):(l=(s=u(f(d.y,0,1))).getDay(),s=l>4||0===l?a.wA.ceil(s):(0,a.wA)(s),s=o.Z.offset(s,7*(d.V-1)),d.y=s.getFullYear(),d.m=s.getMonth(),d.d=s.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),l="Z"in d?c(f(d.y,0,1)).getUTCDay():u(f(d.y,0,1)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+7*d.W-(l+5)%7:d.w+7*d.U-(l+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,c(d)):u(d)}}function Fe(e,t,r,n){for(var i,a,o=0,s=t.length,l=r.length;o=l)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=Oe[i in m?t.charAt(o++):i])||(n=a(e,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Ie.x=De(r,Ie),Ie.X=De(s,Ie),Ie.c=De(t,Ie),Re.x=De(r,Re),Re.X=De(s,Re),Re.c=De(t,Re),{format:function(e){var t=De(e+="",Ie);return t.toString=function(){return e},t},parse:function(e){var t=ze(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=De(e+="",Re);return t.toString=function(){return e},t},utcParse:function(e){var t=ze(e+="",!0);return t.toString=function(){return e},t}}}var p,h,v,m={"-":"",_:" ",0:"0"},g=/^\s*\d+/,y=/^%/,x=/[\\^$*+?|[\]().{}]/g;function b(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function L(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function I(e,t,r){var n=g.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function R(e,t,r){var n=g.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function O(e,t,r){var n=g.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function D(e,t,r){var n=g.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function z(e,t,r){var n=g.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function F(e,t,r){var n=g.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function j(e,t,r){var n=g.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function N(e,t,r){var n=g.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Z(e,t,r){var n=g.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function B(e,t,r){var n=y.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function V(e,t,r){var n=g.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function U(e,t,r){var n=g.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function H(e,t){return b(e.getDate(),t,2)}function W(e,t){return b(e.getHours(),t,2)}function G(e,t){return b(e.getHours()%12||12,t,2)}function q(e,t){return b(1+o.Z.count((0,s.Z)(e),e),t,3)}function Y(e,t){return b(e.getMilliseconds(),t,3)}function X(e,t){return Y(e,t)+"000"}function K(e,t){return b(e.getMonth()+1,t,2)}function $(e,t){return b(e.getMinutes(),t,2)}function J(e,t){return b(e.getSeconds(),t,2)}function Q(e){var t=e.getDay();return 0===t?7:t}function ee(e,t){return b(a.OM.count((0,s.Z)(e)-1,e),t,2)}function te(e,t){var r=e.getDay();return e=r>=4||0===r?(0,a.bL)(e):a.bL.ceil(e),b(a.bL.count((0,s.Z)(e),e)+(4===(0,s.Z)(e).getDay()),t,2)}function re(e){return e.getDay()}function ne(e,t){return b(a.wA.count((0,s.Z)(e)-1,e),t,2)}function ie(e,t){return b(e.getFullYear()%100,t,2)}function ae(e,t){return b(e.getFullYear()%1e4,t,4)}function oe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+b(t/60|0,"0",2)+b(t%60,"0",2)}function se(e,t){return b(e.getUTCDate(),t,2)}function le(e,t){return b(e.getUTCHours(),t,2)}function ue(e,t){return b(e.getUTCHours()%12||12,t,2)}function ce(e,t){return b(1+i.Z.count((0,l.Z)(e),e),t,3)}function fe(e,t){return b(e.getUTCMilliseconds(),t,3)}function de(e,t){return fe(e,t)+"000"}function pe(e,t){return b(e.getUTCMonth()+1,t,2)}function he(e,t){return b(e.getUTCMinutes(),t,2)}function ve(e,t){return b(e.getUTCSeconds(),t,2)}function me(e){var t=e.getUTCDay();return 0===t?7:t}function ge(e,t){return b(n.Ox.count((0,l.Z)(e)-1,e),t,2)}function ye(e,t){var r=e.getUTCDay();return e=r>=4||0===r?(0,n.hB)(e):n.hB.ceil(e),b(n.hB.count((0,l.Z)(e),e)+(4===(0,l.Z)(e).getUTCDay()),t,2)}function xe(e){return e.getUTCDay()}function be(e,t){return b(n.l6.count((0,l.Z)(e)-1,e),t,2)}function _e(e,t){return b(e.getUTCFullYear()%100,t,2)}function we(e,t){return b(e.getUTCFullYear()%1e4,t,4)}function ke(){return"+0000"}function Te(){return"%"}function Me(e){return+e}function Se(e){return Math.floor(+e/1e3)}p=d({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),h=p.format,p.parse,v=p.utcFormat,p.utcParse},82301:function(e,t,r){"use strict";r.d(t,{a:function(){return o}});var n=r(30052),i=r(54263),a=(0,n.Z)((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.yB)/i.UD}),(function(e){return e.getDate()-1}));t.Z=a;var o=a.range},54263:function(e,t,r){"use strict";r.d(t,{UD:function(){return o},Y2:function(){return a},Ym:function(){return n},iM:function(){return s},yB:function(){return i}});var n=1e3,i=6e4,a=36e5,o=864e5,s=6048e5},81041:function(e,t,r){"use strict";r.r(t),r.d(t,{timeDay:function(){return g.Z},timeDays:function(){return g.a},timeFriday:function(){return y.mC},timeFridays:function(){return y.b$},timeHour:function(){return v},timeHours:function(){return m},timeInterval:function(){return n.Z},timeMillisecond:function(){return a},timeMilliseconds:function(){return o},timeMinute:function(){return d},timeMinutes:function(){return p},timeMonday:function(){return y.wA},timeMondays:function(){return y.bJ},timeMonth:function(){return b},timeMonths:function(){return _},timeSaturday:function(){return y.EY},timeSaturdays:function(){return y.Ff},timeSecond:function(){return u},timeSeconds:function(){return c},timeSunday:function(){return y.OM},timeSundays:function(){return y.vm},timeThursday:function(){return y.bL},timeThursdays:function(){return y.$t},timeTuesday:function(){return y.sy},timeTuesdays:function(){return y.aU},timeWednesday:function(){return y.zg},timeWednesdays:function(){return y.Ld},timeWeek:function(){return y.OM},timeWeeks:function(){return y.vm},timeYear:function(){return w.Z},timeYears:function(){return w.g},utcDay:function(){return E.Z},utcDays:function(){return E.y},utcFriday:function(){return P.QQ},utcFridays:function(){return P.fz},utcHour:function(){return A},utcHours:function(){return C},utcMillisecond:function(){return a},utcMilliseconds:function(){return o},utcMinute:function(){return T},utcMinutes:function(){return M},utcMonday:function(){return P.l6},utcMondays:function(){return P.$3},utcMonth:function(){return I},utcMonths:function(){return R},utcSaturday:function(){return P.g4},utcSaturdays:function(){return P.Q_},utcSecond:function(){return u},utcSeconds:function(){return c},utcSunday:function(){return P.Ox},utcSundays:function(){return P.SU},utcThursday:function(){return P.hB},utcThursdays:function(){return P.xj},utcTuesday:function(){return P.J1},utcTuesdays:function(){return P.DK},utcWednesday:function(){return P.b3},utcWednesdays:function(){return P.uy},utcWeek:function(){return P.Ox},utcWeeks:function(){return P.SU},utcYear:function(){return O.Z},utcYears:function(){return O.D}});var n=r(30052),i=(0,n.Z)((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?(0,n.Z)((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):i:null};var a=i,o=i.range,s=r(54263),l=(0,n.Z)((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+t*s.Ym)}),(function(e,t){return(t-e)/s.Ym}),(function(e){return e.getUTCSeconds()})),u=l,c=l.range,f=(0,n.Z)((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*s.Ym)}),(function(e,t){e.setTime(+e+t*s.yB)}),(function(e,t){return(t-e)/s.yB}),(function(e){return e.getMinutes()})),d=f,p=f.range,h=(0,n.Z)((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*s.Ym-e.getMinutes()*s.yB)}),(function(e,t){e.setTime(+e+t*s.Y2)}),(function(e,t){return(t-e)/s.Y2}),(function(e){return e.getHours()})),v=h,m=h.range,g=r(82301),y=r(59879),x=(0,n.Z)((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),b=x,_=x.range,w=r(34823),k=(0,n.Z)((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*s.yB)}),(function(e,t){return(t-e)/s.yB}),(function(e){return e.getUTCMinutes()})),T=k,M=k.range,S=(0,n.Z)((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*s.Y2)}),(function(e,t){return(t-e)/s.Y2}),(function(e){return e.getUTCHours()})),A=S,C=S.range,E=r(48480),P=r(58176),L=(0,n.Z)((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),I=L,R=L.range,O=r(79791)},30052:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=new Date,i=new Date;function a(e,t,r,o){function s(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return s.floor=function(t){return e(t=new Date(+t)),t},s.ceil=function(r){return e(r=new Date(r-1)),t(r,1),e(r),r},s.round=function(e){var t=s(e),r=s.ceil(e);return e-t0))return o;do{o.push(a=new Date(+r)),t(r,i),e(r)}while(a=t)for(;e(t),!r(t);)t.setTime(t-1)}),(function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););}))},r&&(s.count=function(t,a){return n.setTime(+t),i.setTime(+a),e(n),e(i),Math.floor(r(n,i))},s.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?s.filter(o?function(t){return o(t)%e===0}:function(t){return s.count(0,t)%e===0}):s:null}),s}},48480:function(e,t,r){"use strict";r.d(t,{y:function(){return o}});var n=r(30052),i=r(54263),a=(0,n.Z)((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/i.UD}),(function(e){return e.getUTCDate()-1}));t.Z=a;var o=a.range},58176:function(e,t,r){"use strict";r.d(t,{$3:function(){return h},DK:function(){return v},J1:function(){return l},Ox:function(){return o},QQ:function(){return f},Q_:function(){return x},SU:function(){return p},b3:function(){return u},fz:function(){return y},g4:function(){return d},hB:function(){return c},l6:function(){return s},uy:function(){return m},xj:function(){return g}});var n=r(30052),i=r(54263);function a(e){return(0,n.Z)((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/i.iM}))}var o=a(0),s=a(1),l=a(2),u=a(3),c=a(4),f=a(5),d=a(6),p=o.range,h=s.range,v=l.range,m=u.range,g=c.range,y=f.range,x=d.range},79791:function(e,t,r){"use strict";r.d(t,{D:function(){return a}});var n=r(30052),i=(0,n.Z)((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));i.every=function(e){return isFinite(e=Math.floor(e))&&e>0?(0,n.Z)((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null},t.Z=i;var a=i.range},59879:function(e,t,r){"use strict";r.d(t,{$t:function(){return g},EY:function(){return d},Ff:function(){return x},Ld:function(){return m},OM:function(){return o},aU:function(){return v},b$:function(){return y},bJ:function(){return h},bL:function(){return c},mC:function(){return f},sy:function(){return l},vm:function(){return p},wA:function(){return s},zg:function(){return u}});var n=r(30052),i=r(54263);function a(e){return(0,n.Z)((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.yB)/i.iM}))}var o=a(0),s=a(1),l=a(2),u=a(3),c=a(4),f=a(5),d=a(6),p=o.range,h=s.range,v=l.range,m=u.range,g=c.range,y=f.range,x=d.range},34823:function(e,t,r){"use strict";r.d(t,{g:function(){return a}});var n=r(30052),i=(0,n.Z)((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));i.every=function(e){return isFinite(e=Math.floor(e))&&e>0?(0,n.Z)((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null},t.Z=i;var a=i.range},17045:function(e,t,r){"use strict";var n=r(8709),i="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),a=Object.prototype.toString,o=Array.prototype.concat,s=Object.defineProperty,l=r(55622)(),u=s&&l,c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!==typeof(i=n)||"[object Function]"!==a.call(i)||!n())return;var i;u?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r},f=function(e,t){var r=arguments.length>2?arguments[2]:{},a=n(t);i&&(a=o.call(a,Object.getOwnPropertySymbols(t)));for(var s=0;ss*l){var p=(d-f)/s;o[c]=1e3*p}}return o}function i(e){for(var t=[],r=e[0];r<=e[1];r++)for(var n=String.fromCharCode(r),i=e[0];i0)return function(e,t){var r,n;for(r=new Array(e),n=0;n80*a){o=l=e[0],s=f=e[1];for(var b=a;bl&&(l=d),h>f&&(f=h);v=0!==(v=Math.max(l-o,f-s))?1/v:0}return i(y,x,a,o,s,v),x}function r(e,t,r,n,i){var a,o;if(i===S(e,t,r,n)>0)for(a=t;a=t;a-=n)o=k(a,e[a],e[a+1],o);return o&&g(o,o.next)&&(T(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!g(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(T(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function i(e,t,r,u,c,f,p){if(e){!p&&f&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=d(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,l,u=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1)}(i)}(e,u,c,f);for(var h,v,m=e;e.prev!==e.next;)if(h=e.prev,v=e.next,f?o(e,u,c,f):a(e))t.push(h.i/r),t.push(e.i/r),t.push(v.i/r),T(e),e=v.next,m=v.next;else if((e=v)===m){p?1===p?i(e=s(n(e),t,r),t,r,u,c,f,2):2===p&&l(e,t,r,u,c,f):i(n(e),t,r,u,c,f,1);break}}}function a(e){var t=e.prev,r=e,n=e.next;if(m(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(h(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&m(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function o(e,t,r,n){var i=e.prev,a=e,o=e.next;if(m(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=d(s,l,t,r,n),p=d(u,c,t,r,n),v=e.prevZ,g=e.nextZ;v&&v.z>=f&&g&&g.z<=p;){if(v!==e.prev&&v!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,g!==e.prev&&g!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;g&&g.z<=p;){if(g!==e.prev&&g!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function s(e,t,r){var i=e;do{var a=i.prev,o=i.next.next;!g(a,o)&&y(a,i,i.next,o)&&_(a,o)&&_(o,a)&&(t.push(a.i/r),t.push(i.i/r),t.push(o.i/r),T(i),T(i.next),i=e=o),i=i.next}while(i!==e);return n(i)}function l(e,t,r,a,o,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&v(l,u)){var c=w(l,u);return l=n(l,l.next),c=n(c,c.next),i(l,t,r,a,o,s),void i(c,t,r,a,o,s)}u=u.next}l=l.next}while(l!==e)}function u(e,t){return e.x-t.x}function c(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&h(ar.x||n.x===r.x&&f(r,n)))&&(r=n,p=l)),n=n.next}while(n!==u);return r}(e,t),t){var r=w(t,e);n(t,t.next),n(r,r.next)}}function f(e,t){return m(e.prev,e,t.prev)<0&&m(t.next,e,e.next)<0}function d(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,r=e;do{(t.x=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function v(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&y(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(_(e,t)&&_(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(m(e.prev,e,t.prev)||m(e,t.prev,t))||g(e,t)&&m(e.prev,e,e.next)>0&&m(t.prev,t,t.next)>0)}function m(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function g(e,t){return e.x===t.x&&e.y===t.y}function y(e,t,r,n){var i=b(m(e,t,r)),a=b(m(e,t,n)),o=b(m(r,n,e)),s=b(m(r,n,t));return i!==a&&o!==s||!(0!==i||!x(e,r,t))||!(0!==a||!x(e,n,t))||!(0!==o||!x(r,e,n))||!(0!==s||!x(r,t,n))}function x(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function b(e){return e>0?1:e<0?-1:0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function w(e,t){var r=new M(e.i,e.x,e.y),n=new M(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function k(e,t,r,n){var i=new M(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function T(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,r,n){for(var i=0,a=t,o=r-n;a0&&(n+=e[i-1].length,r.holes.push(n))}return r}},2502:function(e,t,r){var n=r(68664);e.exports=function(e,t){var r,i=[],a=[],o=[],s={},l=[];function u(e){o[e]=!1,s.hasOwnProperty(e)&&Object.keys(s[e]).forEach((function(t){delete s[e][t],o[t]&&u(t)}))}function c(e){var t,n,i=!1;for(a.push(e),o[e]=!0,t=0;t=t}))}(t);for(var r,i=n(e).components.filter((function(e){return e.length>1})),a=1/0,o=0;o=55296&&y<=56319&&(w+=e[++r]),w=k?d.call(k,T,w,v):w,t?(p.value=w,h(m,v,p)):m[v]=w,++v;g=v}if(void 0===g)for(g=o(e.length),t&&(m=new t(g)),r=0;r0?1:-1}},56247:function(e,t,r){"use strict";var n=r(9953),i=Math.abs,a=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?n(e)*a(i(e)):e}},35976:function(e,t,r){"use strict";var n=r(56247),i=Math.max;e.exports=function(e){return i(0,n(e))}},67260:function(e,t,r){"use strict";var n=r(78513),i=r(36672),a=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(r,u){var c,f=arguments[2],d=arguments[3];return r=Object(i(r)),n(u),c=s(r),d&&c.sort("function"===typeof d?a.call(d,r):void 0),"function"!==typeof e&&(e=c[e]),o.call(e,c,(function(e,n){return l.call(r,e)?o.call(u,f,r[e],e,r,n):t}))}}},95879:function(e,t,r){"use strict";e.exports=r(73583)()?Object.assign:r(34205)},73583:function(e){"use strict";e.exports=function(){var e,t=Object.assign;return"function"===typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},34205:function(e,t,r){"use strict";var n=r(68700),i=r(36672),a=Math.max;e.exports=function(e,t){var r,o,s,l=a(arguments.length,2);for(e=Object(i(e)),s=function(n){try{e[n]=t[n]}catch(i){r||(r=i)}},o=1;o-1}},87963:function(e){"use strict";var t=Object.prototype.toString,r=t.call("");e.exports=function(e){return"string"===typeof e||e&&"object"===typeof e&&(e instanceof String||t.call(e)===r)||!1}},43043:function(e){"use strict";var t=Object.create(null),r=Math.random;e.exports=function(){var e;do{e=r().toString(36).slice(2)}while(t[e]);return e}},32411:function(e,t,r){"use strict";var n,i=r(1496),a=r(66741),o=r(62072),s=r(8260),l=r(95426),u=Object.defineProperty;n=e.exports=function(e,t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,e),t=t?a.call(t,"key+value")?"key+value":a.call(t,"key")?"key":"value":"value",u(this,"__kind__",o("",t))},i&&i(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),u(n.prototype,s.toStringTag,o("c","Array Iterator"))},27515:function(e,t,r){"use strict";var n=r(73051),i=r(78513),a=r(87963),o=r(66661),s=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(e,t){var r,c,f,d,p,h,v,m,g=arguments[2];if(s(e)||n(e)?r="array":a(e)?r="string":e=o(e),i(t),f=function(){d=!0},"array"!==r)if("string"!==r)for(c=e.next();!c.done;){if(l.call(t,g,c.value,f),d)return;c=e.next()}else for(h=e.length,p=0;p=55296&&m<=56319&&(v+=e[++p]),l.call(t,g,v,f),!d);++p);else u.call(e,(function(e){return l.call(t,g,e,f),d}))}},66661:function(e,t,r){"use strict";var n=r(73051),i=r(87963),a=r(32411),o=r(259),s=r(58095),l=r(8260).iterator;e.exports=function(e){return"function"===typeof s(e)[l]?e[l]():n(e)?new a(e):i(e)?new o(e):new a(e)}},95426:function(e,t,r){"use strict";var n,i=r(16134),a=r(95879),o=r(78513),s=r(36672),l=r(62072),u=r(55174),c=r(8260),f=Object.defineProperty,d=Object.defineProperties;e.exports=n=function(e,t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");d(this,{__list__:l("w",s(e)),__context__:l("w",t),__nextIndex__:l("w",0)}),t&&(o(t.on),t.on("_add",this._onAdd),t.on("_delete",this._onDelete),t.on("_clear",this._onClear))},delete n.prototype.constructor,d(n.prototype,a({_next:l((function(){var e;if(this.__list__)return this.__redo__&&void 0!==(e=this.__redo__.shift())?e:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(t,r){t>=e&&(this.__redo__[r]=++t)}),this),this.__redo__.push(e)):f(this,"__redo__",l("c",[e])))})),_onDelete:l((function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach((function(t,r){t>e&&(this.__redo__[r]=--t)}),this)))})),_onClear:l((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),f(n.prototype,c.iterator,l((function(){return this})))},35940:function(e,t,r){"use strict";var n=r(73051),i=r(95296),a=r(87963),o=r(8260).iterator,s=Array.isArray;e.exports=function(e){return!!i(e)&&(!!s(e)||!!a(e)||!!n(e)||"function"===typeof e[o])}},259:function(e,t,r){"use strict";var n,i=r(1496),a=r(62072),o=r(8260),s=r(95426),l=Object.defineProperty;n=e.exports=function(e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");e=String(e),s.call(this,e),l(this,"__length__",a("",e.length))},i&&i(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:a((function(){if(this.__list__)return this.__nextIndex__=55296&&t<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,a("c","String Iterator"))},58095:function(e,t,r){"use strict";var n=r(35940);e.exports=function(e){if(!n(e))throw new TypeError(e+" is not iterable");return e}},73523:function(e){"use strict";function t(e,t){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,u=c,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"===typeof l)n(l,this,t);else{var u=l.length,c=h(l,u);for(r=0;r=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},60774:function(e){var t=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}}()},94908:function(e,t,r){"use strict";e.exports=r(51152)()?globalThis:r(60774)},51152:function(e){"use strict";e.exports=function(){return"object"===typeof globalThis&&!!globalThis&&globalThis.Array===Array}},92770:function(e,t,r){"use strict";var n=r(18546);e.exports=function(e){var t=typeof e;if("string"===t){var r=e;if(0===(e=+e)&&n(r))return!1}else if("number"!==t)return!1;return e-e<1}},30120:function(e,t,r){var n=r(90660);e.exports=function(e,t,r){if(!e)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(e)&&e[0]&&"number"===typeof e[0][0]){var i,a,o,s,l=e[0].length,u=e.length*l;t&&"string"!==typeof t||(t=new(n(t||"float32"))(u+r));var c=t.length-r;if(u!==c)throw new Error("source length "+u+" ("+l+"x"+e.length+") does not match destination length "+c);for(i=0,o=r;it[0]-o[0]/2&&(d=o[0]/2,p+=o[1]);return r}},32879:function(e){"use strict";function t(e,a){a||(a={}),("string"===typeof e||Array.isArray(e))&&(a.family=e);var o=Array.isArray(a.family)?a.family.join(", "):a.family;if(!o)throw Error("`family` must be defined");var s=a.size||a.fontSize||a.em||48,l=a.weight||a.fontWeight||"",u=(e=[a.style||a.fontStyle||"",l,s].join(" ")+"px "+o,a.origin||"top");if(t.cache[o]&&s<=t.cache[o].em)return r(t.cache[o],u);var c=a.canvas||t.canvas,f=c.getContext("2d"),d={upper:void 0!==a.upper?a.upper:"H",lower:void 0!==a.lower?a.lower:"x",descent:void 0!==a.descent?a.descent:"p",ascent:void 0!==a.ascent?a.ascent:"h",tittle:void 0!==a.tittle?a.tittle:"i",overshoot:void 0!==a.overshoot?a.overshoot:"O"},p=Math.ceil(1.5*s);c.height=p,c.width=.5*p,f.font=e;var h="H",v={top:0};f.clearRect(0,0,p,p),f.textBaseline="top",f.fillStyle="black",f.fillText(h,0,0);var m=n(f.getImageData(0,0,p,p));f.clearRect(0,0,p,p),f.textBaseline="bottom",f.fillText(h,0,p);var g=n(f.getImageData(0,0,p,p));v.lineHeight=v.bottom=p-g+m,f.clearRect(0,0,p,p),f.textBaseline="alphabetic",f.fillText(h,0,p);var y=p-n(f.getImageData(0,0,p,p))-1+m;v.baseline=v.alphabetic=y,f.clearRect(0,0,p,p),f.textBaseline="middle",f.fillText(h,0,.5*p);var x=n(f.getImageData(0,0,p,p));v.median=v.middle=p-x-1+m-.5*p,f.clearRect(0,0,p,p),f.textBaseline="hanging",f.fillText(h,0,.5*p);var b=n(f.getImageData(0,0,p,p));v.hanging=p-b-1+m-.5*p,f.clearRect(0,0,p,p),f.textBaseline="ideographic",f.fillText(h,0,p);var _=n(f.getImageData(0,0,p,p));if(v.ideographic=p-_-1+m,d.upper&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.upper,0,0),v.upper=n(f.getImageData(0,0,p,p)),v.capHeight=v.baseline-v.upper),d.lower&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.lower,0,0),v.lower=n(f.getImageData(0,0,p,p)),v.xHeight=v.baseline-v.lower),d.tittle&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.tittle,0,0),v.tittle=n(f.getImageData(0,0,p,p))),d.ascent&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.ascent,0,0),v.ascent=n(f.getImageData(0,0,p,p))),d.descent&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.descent,0,0),v.descent=i(f.getImageData(0,0,p,p))),d.overshoot){f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.overshoot,0,0);var w=i(f.getImageData(0,0,p,p));v.overshoot=w-y}for(var k in v)v[k]/=s;return v.em=s,t.cache[o]=v,r(v,u)}function r(e,t){var r={};for(var n in"string"===typeof t&&(t=e[t]),e)"em"!==n&&(r[n]=e[n]-t);return r}function n(e){for(var t=e.height,r=e.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/t)}e.exports=t,t.canvas=document.createElement("canvas"),t.cache={}},31353:function(e,t,r){"use strict";var n=r(85395),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;n1&&"boolean"!==typeof t)throw new o('"allowMissing" argument must be a boolean');if(null===M(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=T(e,0,1),r=T(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return k(e,S,(function(e,t,r,i){n[n.length]=r?k(i,A,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",a=C("%"+n+"%",t),s=a.name,u=a.value,c=!1,f=a.alias;f&&(n=f[0],w(r,_([0,1],f)));for(var d=1,p=!0;d=r.length){var y=l(u,h);u=(p=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:u[h]}else p=b(u,h),u=u[h];p&&!c&&(v[s]=u)}}return u}},85400:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],f=t[9],d=t[10],p=t[11],h=t[12],v=t[13],m=t[14],g=t[15];return e[0]=s*(d*g-p*m)-f*(l*g-u*m)+v*(l*p-u*d),e[1]=-(n*(d*g-p*m)-f*(i*g-a*m)+v*(i*p-a*d)),e[2]=n*(l*g-u*m)-s*(i*g-a*m)+v*(i*u-a*l),e[3]=-(n*(l*p-u*d)-s*(i*p-a*d)+f*(i*u-a*l)),e[4]=-(o*(d*g-p*m)-c*(l*g-u*m)+h*(l*p-u*d)),e[5]=r*(d*g-p*m)-c*(i*g-a*m)+h*(i*p-a*d),e[6]=-(r*(l*g-u*m)-o*(i*g-a*m)+h*(i*u-a*l)),e[7]=r*(l*p-u*d)-o*(i*p-a*d)+c*(i*u-a*l),e[8]=o*(f*g-p*v)-c*(s*g-u*v)+h*(s*p-u*f),e[9]=-(r*(f*g-p*v)-c*(n*g-a*v)+h*(n*p-a*f)),e[10]=r*(s*g-u*v)-o*(n*g-a*v)+h*(n*u-a*s),e[11]=-(r*(s*p-u*f)-o*(n*p-a*f)+c*(n*u-a*s)),e[12]=-(o*(f*m-d*v)-c*(s*m-l*v)+h*(s*d-l*f)),e[13]=r*(f*m-d*v)-c*(n*m-i*v)+h*(n*d-i*f),e[14]=-(r*(s*m-l*v)-o*(n*m-i*v)+h*(n*l-i*s)),e[15]=r*(s*d-l*f)-o*(n*d-i*f)+c*(n*l-i*s),e}},42331:function(e){e.exports=function(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},31042:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},11902:function(e){e.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},89887:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],f=e[10],d=e[11],p=e[12],h=e[13],v=e[14],m=e[15];return(t*o-r*a)*(f*m-d*v)-(t*s-n*a)*(c*m-d*h)+(t*l-i*a)*(c*v-f*h)+(r*s-n*o)*(u*m-d*p)-(r*l-i*o)*(u*v-f*p)+(n*l-i*s)*(u*h-c*p)}},27812:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,f=n*s,d=i*o,p=i*s,h=i*l,v=a*o,m=a*s,g=a*l;return e[0]=1-f-h,e[1]=c+g,e[2]=d-m,e[3]=0,e[4]=c-g,e[5]=1-u-h,e[6]=p+v,e[7]=0,e[8]=d+m,e[9]=p-v,e[10]=1-u-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},34045:function(e){e.exports=function(e,t,r){var n,i,a,o=r[0],s=r[1],l=r[2],u=Math.sqrt(o*o+s*s+l*l);return Math.abs(u)<1e-6?null:(o*=u=1/u,s*=u,l*=u,n=Math.sin(t),i=Math.cos(t),a=1-i,e[0]=o*o*a+i,e[1]=s*o*a+l*n,e[2]=l*o*a-s*n,e[3]=0,e[4]=o*s*a-l*n,e[5]=s*s*a+i,e[6]=l*s*a+o*n,e[7]=0,e[8]=o*l*a+s*n,e[9]=s*l*a-o*n,e[10]=l*l*a+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}},45973:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,l=i+i,u=a+a,c=n*s,f=n*l,d=n*u,p=i*l,h=i*u,v=a*u,m=o*s,g=o*l,y=o*u;return e[0]=1-(p+v),e[1]=f+y,e[2]=d-g,e[3]=0,e[4]=f-y,e[5]=1-(c+v),e[6]=h+m,e[7]=0,e[8]=d+g,e[9]=h-m,e[10]=1-(c+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}},81472:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},14669:function(e){e.exports=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}},75262:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},331:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},11049:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},75195:function(e){e.exports=function(e,t,r,n,i,a,o){var s=1/(r-t),l=1/(i-n),u=1/(a-o);return e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*l,e[10]=(o+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*u,e[15]=0,e}},71551:function(e){e.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},79576:function(e,t,r){e.exports={create:r(11902),clone:r(42331),copy:r(31042),identity:r(71551),transpose:r(88654),invert:r(95874),adjoint:r(85400),determinant:r(89887),multiply:r(91362),translate:r(31283),scale:r(10789),rotate:r(65074),rotateX:r(35545),rotateY:r(94918),rotateZ:r(15692),fromRotation:r(34045),fromRotationTranslation:r(45973),fromScaling:r(81472),fromTranslation:r(14669),fromXRotation:r(75262),fromYRotation:r(331),fromZRotation:r(11049),fromQuat:r(27812),frustum:r(75195),perspective:r(7864),perspectiveFromFieldOfView:r(35279),ortho:r(60378),lookAt:r(65551),str:r(6726)}},95874:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],f=t[9],d=t[10],p=t[11],h=t[12],v=t[13],m=t[14],g=t[15],y=r*s-n*o,x=r*l-i*o,b=r*u-a*o,_=n*l-i*s,w=n*u-a*s,k=i*u-a*l,T=c*v-f*h,M=c*m-d*h,S=c*g-p*h,A=f*m-d*v,C=f*g-p*v,E=d*g-p*m,P=y*E-x*C+b*A+_*S-w*M+k*T;return P?(P=1/P,e[0]=(s*E-l*C+u*A)*P,e[1]=(i*C-n*E-a*A)*P,e[2]=(v*k-m*w+g*_)*P,e[3]=(d*w-f*k-p*_)*P,e[4]=(l*S-o*E-u*M)*P,e[5]=(r*E-i*S+a*M)*P,e[6]=(m*b-h*k-g*x)*P,e[7]=(c*k-d*b+p*x)*P,e[8]=(o*C-s*S+u*T)*P,e[9]=(n*S-r*C-a*T)*P,e[10]=(h*w-v*b+g*y)*P,e[11]=(f*b-c*w-p*y)*P,e[12]=(s*M-o*A-l*T)*P,e[13]=(r*A-n*M+i*T)*P,e[14]=(v*x-h*_-m*y)*P,e[15]=(c*_-f*x+d*y)*P,e):null}},65551:function(e,t,r){var n=r(71551);e.exports=function(e,t,r,i){var a,o,s,l,u,c,f,d,p,h,v=t[0],m=t[1],g=t[2],y=i[0],x=i[1],b=i[2],_=r[0],w=r[1],k=r[2];return Math.abs(v-_)<1e-6&&Math.abs(m-w)<1e-6&&Math.abs(g-k)<1e-6?n(e):(f=v-_,d=m-w,p=g-k,h=1/Math.sqrt(f*f+d*d+p*p),a=x*(p*=h)-b*(d*=h),o=b*(f*=h)-y*p,s=y*d-x*f,(h=Math.sqrt(a*a+o*o+s*s))?(a*=h=1/h,o*=h,s*=h):(a=0,o=0,s=0),l=d*s-p*o,u=p*a-f*s,c=f*o-d*a,(h=Math.sqrt(l*l+u*u+c*c))?(l*=h=1/h,u*=h,c*=h):(l=0,u=0,c=0),e[0]=a,e[1]=l,e[2]=f,e[3]=0,e[4]=o,e[5]=u,e[6]=d,e[7]=0,e[8]=s,e[9]=c,e[10]=p,e[11]=0,e[12]=-(a*v+o*m+s*g),e[13]=-(l*v+u*m+c*g),e[14]=-(f*v+d*m+p*g),e[15]=1,e)}},91362:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],f=t[8],d=t[9],p=t[10],h=t[11],v=t[12],m=t[13],g=t[14],y=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*n+b*s+_*f+w*v,e[1]=x*i+b*l+_*d+w*m,e[2]=x*a+b*u+_*p+w*g,e[3]=x*o+b*c+_*h+w*y,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*n+b*s+_*f+w*v,e[5]=x*i+b*l+_*d+w*m,e[6]=x*a+b*u+_*p+w*g,e[7]=x*o+b*c+_*h+w*y,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*n+b*s+_*f+w*v,e[9]=x*i+b*l+_*d+w*m,e[10]=x*a+b*u+_*p+w*g,e[11]=x*o+b*c+_*h+w*y,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*n+b*s+_*f+w*v,e[13]=x*i+b*l+_*d+w*m,e[14]=x*a+b*u+_*p+w*g,e[15]=x*o+b*c+_*h+w*y,e}},60378:function(e){e.exports=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*u,e[15]=1,e}},7864:function(e){e.exports=function(e,t,r,n,i){var a=1/Math.tan(t/2),o=1/(n-i);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*n*o,e[15]=0,e}},35279:function(e){e.exports=function(e,t,r,n){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(o-s)*l*.5,e[9]=(i-a)*u*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}},65074:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x,b,_,w,k,T,M,S,A,C=n[0],E=n[1],P=n[2],L=Math.sqrt(C*C+E*E+P*P);return Math.abs(L)<1e-6?null:(C*=L=1/L,E*=L,P*=L,i=Math.sin(r),a=Math.cos(r),o=1-a,s=t[0],l=t[1],u=t[2],c=t[3],f=t[4],d=t[5],p=t[6],h=t[7],v=t[8],m=t[9],g=t[10],y=t[11],x=C*C*o+a,b=E*C*o+P*i,_=P*C*o-E*i,w=C*E*o-P*i,k=E*E*o+a,T=P*E*o+C*i,M=C*P*o+E*i,S=E*P*o-C*i,A=P*P*o+a,e[0]=s*x+f*b+v*_,e[1]=l*x+d*b+m*_,e[2]=u*x+p*b+g*_,e[3]=c*x+h*b+y*_,e[4]=s*w+f*k+v*T,e[5]=l*w+d*k+m*T,e[6]=u*w+p*k+g*T,e[7]=c*w+h*k+y*T,e[8]=s*M+f*S+v*A,e[9]=l*M+d*S+m*A,e[10]=u*M+p*S+g*A,e[11]=c*M+h*S+y*A,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}},35545:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],f=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+u*n,e[5]=o*i+c*n,e[6]=s*i+f*n,e[7]=l*i+d*n,e[8]=u*i-a*n,e[9]=c*i-o*n,e[10]=f*i-s*n,e[11]=d*i-l*n,e}},94918:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[8],c=t[9],f=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-u*n,e[1]=o*i-c*n,e[2]=s*i-f*n,e[3]=l*i-d*n,e[8]=a*n+u*i,e[9]=o*n+c*i,e[10]=s*n+f*i,e[11]=l*n+d*i,e}},15692:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],c=t[5],f=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+u*n,e[1]=o*i+c*n,e[2]=s*i+f*n,e[3]=l*i+d*n,e[4]=u*i-a*n,e[5]=c*i-o*n,e[6]=f*i-s*n,e[7]=d*i-l*n,e}},10789:function(e){e.exports=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},6726:function(e){e.exports=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}},31283:function(e){e.exports=function(e,t,r){var n,i,a,o,s,l,u,c,f,d,p,h,v=r[0],m=r[1],g=r[2];return t===e?(e[12]=t[0]*v+t[4]*m+t[8]*g+t[12],e[13]=t[1]*v+t[5]*m+t[9]*g+t[13],e[14]=t[2]*v+t[6]*m+t[10]*g+t[14],e[15]=t[3]*v+t[7]*m+t[11]*g+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],f=t[8],d=t[9],p=t[10],h=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=f,e[9]=d,e[10]=p,e[11]=h,e[12]=n*v+s*m+f*g+t[12],e[13]=i*v+l*m+d*g+t[13],e[14]=a*v+u*m+p*g+t[14],e[15]=o*v+c*m+h*g+t[15]),e}},88654:function(e){e.exports=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},42505:function(e,t,r){"use strict";var n=r(72791),i=r(71299),a=r(98580),o=r(12018),s=r(83522),l=r(25075),u=r(68016),c=r(58404),f=r(18863),d=r(10973),p=r(25677),h=r(75686),v=r(53545),m=r(56131),g=r(32879),y=r(30120),x=r(13547).nextPow2,b=new s,_=!1;if(document.body){var w=document.body.appendChild(document.createElement("div"));w.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(w).fontStretch&&(_=!0),document.body.removeChild(w)}var k=function(e){!function(e){return"function"===typeof e&&e._gl&&e.prop&&e.texture&&e.buffer}(e)?this.gl=o(e):(e={regl:e},this.gl=e.regl._gl),this.shader=b.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=e.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),b.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(d(e)?e:{})};k.prototype.createShader=function(){var e=this.regl,t=e({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:e.prop("count"),offset:e.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:e.this("sizeBuffer")},width:{offset:0,stride:8,buffer:e.this("sizeBuffer")},char:e.this("charBuffer"),position:e.this("position")},uniforms:{atlasSize:function(e,t){return[t.atlas.width,t.atlas.height]},atlasDim:function(e,t){return[t.atlas.cols,t.atlas.rows]},atlas:function(e,t){return t.atlas.texture},charStep:function(e,t){return t.atlas.step},em:function(e,t){return t.atlas.em},color:e.prop("color"),opacity:e.prop("opacity"),viewport:e.this("viewportArray"),scale:e.this("scale"),align:e.prop("align"),baseline:e.prop("baseline"),translate:e.this("translate"),positionOffset:e.prop("positionOffset")},primitive:"points",viewport:e.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:e,draw:t,atlas:{}}},k.prototype.update=function(e){var t=this;if("string"===typeof e)e={text:e};else if(!e)return;null!=(e=i(e,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(e.opacity)?this.opacity=e.opacity.map((function(e){return parseFloat(e)})):this.opacity=parseFloat(e.opacity)),null!=e.viewport&&(this.viewport=f(e.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=e.kerning&&(this.kerning=e.kerning),null!=e.offset&&("number"===typeof e.offset&&(e.offset=[e.offset,0]),this.positionOffset=y(e.offset)),e.direction&&(this.direction=e.direction),e.range&&(this.range=e.range,this.scale=[1/(e.range[2]-e.range[0]),1/(e.range[3]-e.range[1])],this.translate=[-e.range[0],-e.range[1]]),e.scale&&(this.scale=e.scale),e.translate&&(this.translate=e.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||e.font||(e.font=k.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(e.font&&(Array.isArray(e.font)?e.font:[e.font]).forEach((function(e,r){if("string"===typeof e)try{e=n.parse(e)}catch(f){e=n.parse(k.baseFontSize+"px "+e)}else e=n.parse(n.stringify(e));var i=n.stringify({size:k.baseFontSize,family:e.family,stretch:_?e.stretch:void 0,variant:e.variant,weight:e.weight,style:e.style}),s=p(e.size),l=Math.round(s[0]*h(s[1]));if(l!==t.fontSize[r]&&(o=!0,t.fontSize[r]=l),(!t.font[r]||i!=t.font[r].baseString)&&(a=!0,t.font[r]=k.fonts[i],!t.font[r])){var u=e.family.join(", "),c=[e.style];e.style!=e.variant&&c.push(e.variant),e.variant!=e.weight&&c.push(e.weight),_&&e.weight!=e.stretch&&c.push(e.stretch),t.font[r]={baseString:i,family:u,weight:e.weight,stretch:e.stretch,style:e.style,variant:e.variant,width:{},kerning:{},metrics:g(u,{origin:"top",fontSize:k.baseFontSize,fontStyle:c.join(" ")})},k.fonts[i]=t.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:t.fontSize[i],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(t.fontAtlas[i]=t.shader.atlas[a],!t.fontAtlas[i]){var o=r.metrics;t.shader.atlas[a]=t.fontAtlas[i]={fontString:a,step:2*Math.ceil(t.fontSize[i]*o.bottom*.5),em:t.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:t.regl.texture()}}null==e.text&&(e.text=t.text)})),"string"===typeof e.text&&e.position&&e.position.length>2){for(var s=Array(.5*e.position.length),d=0;d2){for(var w=!e.position[0].length,T=c.mallocFloat(2*this.count),M=0,S=0;M1?t.align[r]:t.align[0]:t.align;if("number"===typeof n)return n;switch(n){case"right":case"end":return-e;case"center":case"centre":case"middle":return.5*-e}return 0}))),null==this.baseline&&null==e.baseline&&(e.baseline=0),null!=e.baseline&&(this.baseline=e.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(e,r){var n=(t.font[r]||t.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"===typeof e?e-n.baseline:-n[e],i*=-1}))),null!=e.color)if(e.color||(e.color="transparent"),"string"!==typeof e.color&&isNaN(e.color)){var H;if("number"===typeof e.color[0]&&e.color.length>this.counts.length){var W=e.color.length;H=c.mallocUint8(W);for(var G=(e.color.subarray||e.color.slice).bind(e.color),q=0;q4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var K=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(K);for(var $=0;$1?this.counts[$]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[$]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*$,4*$+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[$]:this.opacity,baseline:null!=this.baselineOffset[$]?this.baselineOffset[$]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[$]?this.alignOffset[$]:this.alignOffset[0]:0,atlas:this.fontAtlas[$]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*$,2*$+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},k.prototype.destroy=function(){},k.prototype.kerning=!0,k.prototype.position={constant:new Float32Array(2)},k.prototype.translate=null,k.prototype.scale=null,k.prototype.font=null,k.prototype.text="",k.prototype.positionOffset=[0,0],k.prototype.opacity=1,k.prototype.color=new Uint8Array([0,0,0,255]),k.prototype.alignOffset=[0,0],k.maxAtlasSize=1024,k.atlasCanvas=document.createElement("canvas"),k.atlasContext=k.atlasCanvas.getContext("2d",{alpha:!1}),k.baseFontSize=64,k.fonts={},e.exports=k},12018:function(e,t,r){"use strict";var n=r(71299);function i(e){if(e.container)if(e.container==document.body)document.body.style.width||(e.canvas.width=e.width||e.pixelRatio*r.g.innerWidth),document.body.style.height||(e.canvas.height=e.height||e.pixelRatio*r.g.innerHeight);else{var t=e.container.getBoundingClientRect();e.canvas.width=e.width||t.right-t.left,e.canvas.height=e.height||t.bottom-t.top}}function a(e){return"function"===typeof e.getContext&&"width"in e&&"height"in e}function o(){var e=document.createElement("canvas");return e.style.position="absolute",e.style.top=0,e.style.left=0,e}e.exports=function(e){var t;if(e?"string"===typeof e&&(e={container:e}):e={},(e=a(e)||"string"===typeof(t=e).nodeName&&"function"===typeof t.appendChild&&"function"===typeof t.getBoundingClientRect?{container:e}:function(e){return"function"===typeof e.drawArrays||"function"===typeof e.drawElements}(e)?{gl:e}:n(e,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(e.pixelRatio=r.g.pixelRatio||1),e.gl)return e.gl;if(e.canvas&&(e.container=e.canvas.parentNode),e.container){if("string"===typeof e.container){var s=document.querySelector(e.container);if(!s)throw Error("Element "+e.container+" is not found");e.container=s}a(e.container)?(e.canvas=e.container,e.container=e.canvas.parentNode):e.canvas||(e.canvas=o(),e.container.appendChild(e.canvas),i(e))}else if(!e.canvas){if("undefined"===typeof document)throw Error("Not DOM environment. Use headless-gl.");e.container=document.body||document.documentElement,e.canvas=o(),e.container.appendChild(e.canvas),i(e)}return e.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(r){try{e.gl=e.canvas.getContext(r,e.attrs)}catch(t){}return e.gl})),e.gl}},56068:function(e){e.exports=function(e){"string"===typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n>1,c=-7,f=r?i-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=h,s/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=h,o/=256,u-=8);e[r+p-h]|=128*v}},42018:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},47216:function(e,t,r){"use strict";var n=r(84543)(),i=r(6614)("Object.prototype.toString"),a=function(e){return!(n&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!a(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,e.exports=s?a:o},54404:function(e){e.exports=!0},85395:function e(t){"use strict";var r,n,i=Function.prototype.toString,a="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof a&&"function"===typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},a((function(){throw 42}),null,r)}catch(e){e!==n&&(a=null)}else a=null;var o=/^\s*class\b/,s=function(e){try{var t=i.call(e);return o.test(t)}catch(r){return!1}},l=function(e){try{return!s(e)&&(i.call(e),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"===typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),d=function(){return!1};if("object"===typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(d=function(e){if((f||!e)&&("undefined"===typeof e||"object"===typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(r){}return!1})}t.exports=a?function(e){if(d(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;try{a(e,null,r)}catch(t){if(t!==n)return!1}return!s(e)&&l(e)}:function(e){if(d(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;if(c)return l(e);if(s(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&l(e)}},65481:function(e,t,r){"use strict";var n,i=Object.prototype.toString,a=Function.prototype.toString,o=/^\s*(?:function)?\*/,s=r(84543)(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!==typeof e)return!1;if(o.test(a.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!l)return!1;if("undefined"===typeof n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}},62683:function(e){"use strict";e.exports="undefined"!==typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},64274:function(e){"use strict";e.exports=function(e){return e!==e}},15567:function(e,t,r){"use strict";var n=r(68222),i=r(17045),a=r(64274),o=r(14922),s=r(22442),l=n(o(),Number);i(l,{getPolyfill:o,implementation:a,shim:s}),e.exports=l},14922:function(e,t,r){"use strict";var n=r(64274);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},22442:function(e,t,r){"use strict";var n=r(17045),i=r(14922);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},64941:function(e){"use strict";e.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},10973:function(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var r;return"[object Object]"===t.call(e)&&(null===(r=Object.getPrototypeOf(e))||r===Object.getPrototypeOf({}))}},18546:function(e){"use strict";e.exports=function(e){for(var t,r=e.length,n=0;n13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},89546:function(e){"use strict";e.exports=function(e){return"string"===typeof e&&(e=e.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(e)&&/[\dz]$/i.test(e)&&e.length>4))}},9187:function(e,t,r){"use strict";var n=r(31353),i=r(72077),a=r(6614),o=a("Object.prototype.toString"),s=r(84543)(),l=r(40383),u="undefined"===typeof globalThis?r.g:globalThis,c=i(),f=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1}return!!l&&function(e){var t=!1;return n(p,(function(r,n){if(!t)try{t=r.call(e)===n}catch(i){}})),t}(e)}},44517:function(e){e.exports=function(){"use strict";var e,t,r;function n(n,i){if(e)if(t){var a="var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk);",o={};e(o),(r=i(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else t=i;else e=i}return n(["exports"],(function(e){function t(e,t){return e(t={exports:{}},t.exports),t.exports}var r="1.10.1",n=i;function i(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=n,this.p2x=r,this.p2y=n}i.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},i.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},i.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},i.prototype.solveCurveX=function(e,t){var r,n,i,a,o;for("undefined"===typeof t&&(t=1e-6),i=e,o=0;o<8;o++){if(a=this.sampleCurveX(i)-e,Math.abs(a)(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var a=o;function o(e,t){this.x=e,this.y=t}function s(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function u(e,t,r,i){var a=new n(e,t,r,i);return function(e){return a.solve(e)}}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),a=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(e){return e instanceof o?e:Array.isArray(e)?new o(e[0],e[1]):e};var c=u(.25,.1,.25,1);function f(e,t,r){return Math.min(r,Math.max(t,e))}function d(e,t,r){var n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function p(e,t,r){if(!e.length)return r(null,[]);var n=e.length,i=new Array(e.length),a=null;e.forEach((function(e,o){t(e,(function(e,t){e&&(a=e),i[o]=t,0===--n&&r(a,i)}))}))}function h(e){var t=[];for(var r in e)t.push(e[r]);return t}function v(e,t){var r=[];for(var n in e)n in t||r.push(n);return r}function m(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}return e()}function _(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function w(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function k(e,t){return-1!==e.indexOf(t,e.length-t.length)}function T(e,t,r){var n={};for(var i in e)n[i]=t.call(r||this,e[i],i,e);return n}function M(e,t,r){var n={};for(var i in e)t.call(r||this,e[i],i,e)&&(n[i]=e[i]);return n}function S(e){return Array.isArray(e)?e.map(S):"object"===typeof e&&e?T(e,S):e}function A(e,t){for(var r=0;r=0)return!0;return!1}var C={};function E(e){C[e]||("undefined"!==typeof console&&console.warn(e),C[e]=!0)}function P(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function L(e){for(var t=0,r=0,n=e.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(e.replace(t,(function(e,t,n,i){var a=n||i;return r[t]=!a||a.toLowerCase(),""})),r["max-age"]){var n=parseInt(r["max-age"],10);isNaN(n)?delete r["max-age"]:r["max-age"]=n}return r}var D=null;function z(e){if(null==D){var t=e.navigator?e.navigator.userAgent:null;D=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return D}function F(e){try{var t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(r){return!1}}function j(e){return self.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(Number("0x"+t))})))}function N(e){return decodeURIComponent(self.atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}var Z,B,V,U,H=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),W=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,G=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,q={now:H,frame:function(e){var t=W(e);return{cancel:function(){return G(t)}}},getImageData:function(e,t){void 0===t&&(t=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return Z||(Z=self.document.createElement("a")),Z.href=e,Z.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==B&&(B=self.matchMedia("(prefers-reduced-motion: reduce)")),B.matches)}},Y={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},X={supported:!1,testSupport:J},K=!1,$=!1;function J(e){!K&&U&&($?Q(e):V=e)}function Q(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,U),e.isContextLost())return;X.supported=!0}catch(r){}e.deleteTexture(t),K=!0}self.document&&((U=self.document.createElement("img")).onload=function(){V&&Q(V),V=null,$=!0},U.onerror=function(){K=!0,V=null},U.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var ee="01";function te(){for(var e="1",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",n=0;n<10;n++)r+=t[Math.floor(62*Math.random())];var i=432e5;return{token:[e,ee,r].join(""),tokenExpiresAt:Date.now()+i}}var re=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function ne(e){return 0===e.indexOf("mapbox:")}re.prototype._createSkuToken=function(){var e=te();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},re.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},re.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},re.prototype.normalizeStyleURL=function(e,t){if(!ne(e))return e;var r=ue(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},re.prototype.normalizeGlyphsURL=function(e,t){if(!ne(e))return e;var r=ue(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},re.prototype.normalizeSourceURL=function(e,t){if(!ne(e))return e;var r=ue(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},re.prototype.normalizeSpriteURL=function(e,t,r,n){var i=ue(e);return ne(e)?(i.path="/styles/v1"+i.path+"/sprite"+t+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+t+r,ce(i))},re.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!ne(e))return e;var r=ue(e),n=/(\.(png|jpg)\d*)(?=$)/,i=/^.+\/v4\//,a=q.devicePixelRatio>=2||512===t?"@2x":"",o=X.supported?".webp":"$1";r.path=r.path.replace(n,""+a+o),r.path=r.path.replace(i,"/"),r.path="/v4"+r.path;var s=this._customAccessToken||se(r.params)||Y.ACCESS_TOKEN;return Y.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,s)},re.prototype.canonicalizeTileURL=function(e,t){var r="/v4/",n=/\.[\w]+$/,i=ue(e);if(!i.path.match(/(^\/v4\/)/)||!i.path.match(n))return e;var a="mapbox://tiles/";a+=i.path.replace(r,"");var o=i.params;return t&&(o=o.filter((function(e){return!e.match(/^access_token=/)}))),o.length&&(a+="?"+o.join("&")),a},re.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&ne(t),n=[],i=0,a=e.tiles||[];i=1&&self.localStorage.setItem(t,JSON.stringify(this.eventData))}catch(n){E("Unable to write to LocalStorage")}},pe.prototype.processRequests=function(e){},pe.prototype.postEvent=function(e,t,n,i){var a=this;if(Y.EVENTS_URL){var o=ue(Y.EVENTS_URL);o.params.push("access_token="+(i||Y.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:ee,userId:this.anonId},l=t?m(s,t):s,u={url:ce(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=Ye(u,(function(e){a.pendingRequest=null,n(e),a.saveEventData(),a.processRequests(i)}))}},pe.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var he,ve,me=function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postMapLoadEvent=function(e,t,r,n){this.skuToken=r,(Y.EVENTS_URL&&n||Y.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return ne(e)||ae(e)})))&&this.queueRequest({id:t,timestamp:Date.now()},n)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),_(this.anonId)||(this.anonId=b()),this.postEvent(i,{skuToken:this.skuToken},(function(e){e||n&&(t.success[n]=!0)}),e))}},t}(pe),ge=function(e){function t(t){e.call(this,"appUserTurnstile"),this._customAccessToken=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postTurnstileEvent=function(e,t){Y.EVENTS_URL&&Y.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return ne(e)||ae(e)}))&&this.queueRequest(Date.now(),t)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=de(Y.ACCESS_TOKEN),n=r?r.u:Y.ACCESS_TOKEN,i=n!==this.eventData.tokenU;_(this.anonId)||(this.anonId=b(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(e){e||(t.eventData.lastSuccess=a,t.eventData.tokenU=n)}),e)}},t}(pe),ye=new ge,xe=ye.postTurnstileEvent.bind(ye),be=new me,_e=be.postMapLoadEvent.bind(be),we="mapbox-tiles",ke=500,Te=50,Me=42e4;function Se(){self.caches&&!he&&(he=self.caches.open(we))}function Ae(e,t){if(void 0===ve)try{new Response(new ReadableStream),ve=!0}catch(r){ve=!1}ve?t(e.body):e.blob().then(t)}function Ce(e,t,r){if(Se(),he){var n={status:t.status,statusText:t.statusText,headers:new self.Headers};t.headers.forEach((function(e,t){return n.headers.set(t,e)}));var i=O(t.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-rDate.now()&&!r["no-cache"]}var Ie,Re=1/0;function Oe(e){++Re>Te&&(e.getActor().send("enforceCacheSizeLimit",ke),Re=0)}function De(e){Se(),he&&he.then((function(t){t.keys().then((function(r){for(var n=0;n=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(i){return t(i)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new Ze(r.statusText,r.status,e.url))},r.send(e.body),{cancel:function(){return r.abort()}}}var We=function(e,t){if(!Ve(e.url)){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return Ue(e,t);if(R()&&self.worker&&self.worker.actor){var r=!0;return self.worker.actor.send("getResource",e,t,void 0,r)}}return He(e,t)},Ge=function(e,t){return We(m(e,{type:"json"}),t)},qe=function(e,t){return We(m(e,{type:"arrayBuffer"}),t)},Ye=function(e,t){return We(m(e,{method:"POST"}),t)};function Xe(e){var t=self.document.createElement("a");return t.href=e,t.protocol===self.document.location.protocol&&t.host===self.document.location.host}var Ke,$e,Je="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Qe(e,t,r,n){var i=new self.Image,a=self.URL;i.onload=function(){t(null,i),a.revokeObjectURL(i.src)},i.onerror=function(){return t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new self.Blob([new Uint8Array(e)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=e.byteLength?a.createObjectURL(o):Je}function et(e,t){var r=new self.Blob([new Uint8Array(e)],{type:"image/png"});self.createImageBitmap(r).then((function(e){t(null,e)})).catch((function(e){t(new Error("Could not load image because of "+e.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}Ke=[],$e=0;var tt=function e(t,r){if(X.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),$e>=Y.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:t,callback:r,cancelled:!1,cancel:function(){this.cancelled=!0}};return Ke.push(n),n}$e++;var i=!1,a=function(){if(!i)for(i=!0,$e--;Ke.length&&$e0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},st.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var lt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},ut=function(e,t,r,n){this.message=(e?e+": ":"")+r,n&&(this.identifier=n),null!==t&&void 0!==t&&t.__line__&&(this.line=t.__line__)};function ct(e){var t=e.key,r=e.value;return r?[new ut(t,r,"constants have been deprecated as of v8")]:[]}function ft(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var Et=[mt,gt,yt,xt,bt,Mt,_t,At(wt),St];function Pt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Pt(e.itemType,t.itemType))&&("number"!==typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var r=0,n=Et;r255?255:e}function i(e){return e<0?0:e>1?1:e}function a(e){return"%"===e[e.length-1]?n(parseFloat(e)/100*255):n(parseInt(e))}function o(e){return"%"===e[e.length-1]?i(parseFloat(e)/100):i(parseFloat(e))}function s(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function l(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=i.indexOf("("),u=i.indexOf(")");if(-1!==l&&u+1===i.length){var c=i.substr(0,l),f=i.substr(l+1,u-(l+1)).split(","),d=1;switch(c){case"rgba":if(4!==f.length)return null;d=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),d];case"hsla":if(4!==f.length)return null;d=o(f.pop());case"hsl":if(3!==f.length)return null;var p=(parseFloat(f[0])%360+360)%360/360,h=o(f[1]),v=o(f[2]),m=v<=.5?v*(h+1):v+h-v*h,g=2*v-m;return[n(255*s(g,m,p+1/3)),n(255*s(g,m,p)),n(255*s(g,m,p-1/3)),d];default:return null}}return null}try{t.parseCSSColor=l}catch(u){}})),Ot=Rt.parseCSSColor,Dt=function(e,t,r,n){void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n};Dt.parse=function(e){if(e){if(e instanceof Dt)return e;if("string"===typeof e){var t=Ot(e);if(t)return new Dt(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Dt.prototype.toString=function(){var e=this.toArray(),t=e[0],r=e[1],n=e[2],i=e[3];return"rgba("+Math.round(t)+","+Math.round(r)+","+Math.round(n)+","+i+")"},Dt.prototype.toArray=function(){var e=this,t=e.r,r=e.g,n=e.b,i=e.a;return 0===i?[0,0,0,0]:[255*t/i,255*r/i,255*n/i,i]},Dt.black=new Dt(0,0,0,1),Dt.white=new Dt(1,1,1,1),Dt.transparent=new Dt(0,0,0,0),Dt.red=new Dt(1,0,0,1);var zt=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};zt.prototype.compare=function(e,t){return this.collator.compare(e,t)},zt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Ft=function(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i},jt=function(e){this.sections=e};jt.fromString=function(e){return new jt([new Ft(e,null,null,null,null)])},jt.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))},jt.factory=function(e){return e instanceof jt?e:jt.fromString(e)},jt.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")},jt.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t=0&&e<=255&&"number"===typeof t&&t>=0&&t<=255&&"number"===typeof r&&r>=0&&r<=255?"undefined"===typeof n||"number"===typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[e,t,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"===typeof n?[e,t,r,n]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Bt(e){if(null===e)return!0;if("string"===typeof e)return!0;if("boolean"===typeof e)return!0;if("number"===typeof e)return!0;if(e instanceof Dt)return!0;if(e instanceof zt)return!0;if(e instanceof jt)return!0;if(e instanceof Nt)return!0;if(Array.isArray(e)){for(var t=0,r=e;t2){var s=e[1];if("string"!==typeof s||!(s in Gt)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=Gt[s],n++}else a=wt;if(e.length>3){if(null!==e[2]&&("number"!==typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=At(a,o)}else r=Gt[i];for(var l=[];n1)&&t.push(n)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var Yt=function(e){this.type=Mt,this.sections=e};Yt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&"object"===typeof r)return t.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=e.length-1;++a){var o=e[a];if(i&&"object"===typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=t.parse(o["font-scale"],1,gt)))return null;var l=null;if(o["text-font"]&&!(l=t.parse(o["text-font"],1,At(yt))))return null;var u=null;if(o["text-color"]&&!(u=t.parse(o["text-color"],1,bt)))return null;var c=n[n.length-1];c.scale=s,c.font=l,c.textColor=u}else{var f=t.parse(e[a],1,wt);if(!f)return null;var d=f.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:f,scale:null,font:null,textColor:null})}}return new Yt(n)},Yt.prototype.evaluate=function(e){var t=function(t){var r=t.content.evaluate(e);return Vt(r)===St?new Ft("",r,null,null,null):new Ft(Ut(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)};return new jt(this.sections.map(t))},Yt.prototype.eachChild=function(e){for(var t=0,r=this.sections;t-1),r},Xt.prototype.eachChild=function(e){e(this.input)},Xt.prototype.outputDefined=function(){return!1},Xt.prototype.serialize=function(){return["image",this.input.serialize()]};var Kt={"to-boolean":xt,"to-color":bt,"to-number":gt,"to-string":yt},$t=function(e,t){this.type=e,this.args=t};$t.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");for(var n=Kt[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":Zt(t[0],t[1],t[2],t[3])))return new Dt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Wt(r||"Could not parse color from value '"+("string"===typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=t[2])&&!(e[1]<=t[1])&&!(e[3]>=t[3])}function lr(e,t){var r=ar(e[0]),n=or(e[1]),i=Math.pow(2,t.z);return[Math.round(r*i*nr),Math.round(n*i*nr)]}function ur(e,t,r){var n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return n*o-a*i===0&&n*a<=0&&i*o<=0}function cr(e,t,r){return t[1]>e[1]!==r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function fr(e,t){for(var r=!1,n=0,i=t.length;n0&&f<0||c<0&&f>0}function vr(e,t,r,n){var i=[t[0]-e[0],t[1]-e[1]];return 0!==pr([n[0]-r[0],n[1]-r[1]],i)&&!(!hr(e,t,r,n)||!hr(r,n,e,t))}function mr(e,t,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=e[0]-r[0]>i?-n:r[0]-e[0]>i?n:0;0===a&&(a=e[0]-r[2]>i?-n:r[2]-e[0]>i?n:0),e[0]+=a}ir(t,e)}function wr(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function kr(e,t,r,n){for(var i=Math.pow(2,n.z)*nr,a=[n.x*nr,n.y*nr],o=[],s=0,l=e;s=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Pr(e,t)&&(r=!1)})),r}Ar.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(Bt(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var n=0;nt))throw new Wt("Input is not a number.");o=s-1}return 0}Ir.prototype.parse=function(e,t,r,n,i){return void 0===i&&(i={}),t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)},Ir.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new qt(t,[e]):"coerce"===r?new $t(t,[e]):e}if(null!==e&&"string"!==typeof e&&"boolean"!==typeof e&&"number"!==typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=e[0];if("string"!==typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,t.typeAnnotation||"coerce");else a=r(a,o,t.typeAnnotation||"assert")}if(!(a instanceof Ht)&&"resolvedImage"!==a.type.kind&&Rr(a)){var l=new Qt;try{a=new Ht(a.type,a.evaluate(l))}catch(u){return this.error(u.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return"undefined"===typeof e?this.error("'undefined' value invalid. Use null instead."):"object"===typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},Ir.prototype.concat=function(e,t,r){var n="number"===typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new Ir(this.registry,n,t||null,i,this.errors)},Ir.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var n=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new ht(n,e))},Ir.prototype.checkSubtype=function(e,t){var r=Pt(e,t);return r&&this.error(r),r};var Dr=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=t.parse(s,u,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new Dr(i,r,n)},Dr.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Or(t,n)].evaluate(e)},Dr.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Nr=Object.freeze({__proto__:null,number:zr,color:Fr,array:jr}),Zr=.95047,Br=1,Vr=1.08883,Ur=4/29,Hr=6/29,Wr=3*Hr*Hr,Gr=Hr*Hr*Hr,qr=Math.PI/180,Yr=180/Math.PI;function Xr(e){return e>Gr?Math.pow(e,1/3):e/Wr+Ur}function Kr(e){return e>Hr?e*e*e:Wr*(e-Ur)}function $r(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Jr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Qr(e){var t=Jr(e.r),r=Jr(e.g),n=Jr(e.b),i=Xr((.4124564*t+.3575761*r+.1804375*n)/Zr),a=Xr((.2126729*t+.7151522*r+.072175*n)/Br);return{l:116*a-16,a:500*(i-a),b:200*(a-Xr((.0193339*t+.119192*r+.9503041*n)/Vr)),alpha:e.a}}function en(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=Br*Kr(t),r=Zr*Kr(r),n=Vr*Kr(n),new Dt($r(3.2404542*r-1.5371385*t-.4985314*n),$r(-.969266*r+1.8760108*t+.041556*n),$r(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function tn(e,t,r){return{l:zr(e.l,t.l,r),a:zr(e.a,t.a,r),b:zr(e.b,t.b,r),alpha:zr(e.alpha,t.alpha,r)}}function rn(e){var t=Qr(e),r=t.l,n=t.a,i=t.b,a=Math.atan2(i,n)*Yr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:e.a}}function nn(e){var t=e.h*qr,r=e.c;return en({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})}function an(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}function on(e,t,r){return{h:an(e.h,t.h,r),c:zr(e.c,t.c,r),l:zr(e.l,t.l,r),alpha:zr(e.alpha,t.alpha,r)}}var sn={forward:Qr,reverse:en,interpolate:tn},ln={forward:rn,reverse:nn,interpolate:on},un=Object.freeze({__proto__:null,lab:sn,hcl:ln}),cn=function(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(!(i=t.parse(i,2,gt)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=bt:t.expectedType&&"value"!==t.expectedType.kind&&(u=t.expectedType);for(var c=0;c=f)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var v=t.parse(d,h,u);if(!v)return null;u=u||v.type,l.push([f,v])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"===typeof u.N?new cn(u,r,n,i,l):t.error("Type "+Ct(u)+" is not interpolatable.")},cn.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);var a=Or(t,n),o=t[a],s=t[a+1],l=cn.interpolationFactor(this.interpolation,n,o,s),u=r[a].evaluate(e),c=r[a+1].evaluate(e);return"interpolate"===this.operator?Nr[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?ln.reverse(ln.interpolate(ln.forward(u),ln.forward(c),l)):sn.reverse(sn.interpolate(sn.forward(u),sn.forward(c),l))},cn.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t=r.length)throw new Wt("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new Wt("Array index must be an integer, but found "+t+" instead.");return r[t]},hn.prototype.eachChild=function(e){e(this.index),e(this.input)},hn.prototype.outputDefined=function(){return!1},hn.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var vn=function(e,t){this.type=xt,this.needle=e,this.haystack=t};vn.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,wt),n=t.parse(e[2],2,wt);return r&&n?Lt(r.type,[xt,yt,gt,mt,wt])?new vn(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+Ct(r.type)+" instead"):null},vn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!It(t,["boolean","string","number","null"]))throw new Wt("Expected first argument to be of type boolean, string, number or null, but found "+Ct(Vt(t))+" instead.");if(!It(r,["string","array"]))throw new Wt("Expected second argument to be of type array or string, but found "+Ct(Vt(r))+" instead.");return r.indexOf(t)>=0},vn.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},vn.prototype.outputDefined=function(){return!0},vn.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var mn=function(e,t,r){this.type=gt,this.needle=e,this.haystack=t,this.fromIndex=r};mn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,wt),n=t.parse(e[2],2,wt);if(!r||!n)return null;if(!Lt(r.type,[xt,yt,gt,mt,wt]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+Ct(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,gt);return i?new mn(r,n,i):null}return new mn(r,n)},mn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!It(t,["boolean","string","number","null"]))throw new Wt("Expected first argument to be of type boolean, string, number or null, but found "+Ct(Vt(t))+" instead.");if(!It(r,["string","array"]))throw new Wt("Expected second argument to be of type array or string, but found "+Ct(Vt(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},mn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},mn.prototype.outputDefined=function(){return!1},mn.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var gn=function(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};gn.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!==1)return t.error("Expected an even number of arguments.");var r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"===typeof d&&Math.floor(d)!==d)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,Vt(d)))return null}else r=Vt(d);if("undefined"!==typeof i[String(d)])return u.error("Branch labels must be unique.");i[String(d)]=a.length}var p=t.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var h=t.parse(e[1],1,wt);if(!h)return null;var v=t.parse(e[e.length-1],e.length-1,n);return v?"value"!==h.type.kind&&t.concat(1).checkSubtype(r,h.type)?null:new gn(r,n,h,i,a,v):null},gn.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(Vt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},gn.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},gn.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},gn.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();ir}function Mn(e,t,r){return t<=r}function Sn(e,t,r){return t>=r}function An(e,t,r,n){return 0===n.compare(t,r)}function Cn(e,t,r,n){return!An(e,t,r,n)}function En(e,t,r,n){return n.compare(t,r)<0}function Pn(e,t,r,n){return n.compare(t,r)>0}function Ln(e,t,r,n){return n.compare(t,r)<=0}function In(e,t,r,n){return n.compare(t,r)>=0}function Rn(e,t,r){var n="=="!==e&&"!="!==e;return function(){function i(e,t,r){this.type=xt,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return i.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],a=t.parse(e[1],1,wt);if(!a)return null;if(!bn(r,a.type))return t.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Ct(a.type)+"'.");var o=t.parse(e[2],2,wt);if(!o)return null;if(!bn(r,o.type))return t.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Ct(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '"+Ct(a.type)+"' and '"+Ct(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new qt(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new qt(a.type,[o])));var s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,Tt)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=Vt(a),l=Vt(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new Wt('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var u=Vt(a),c=Vt(o);if("string"!==u.kind||"string"!==c.kind)return t(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):t(i,a,o)},i.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var t=[e];return this.eachChild((function(e){t.push(e.serialize())})),t},i}()}xn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,wt),n=t.parse(e[2],2,gt);if(!r||!n)return null;if(!Lt(r.type,[At(wt),yt,wt]))return t.error("Expected first argument to be of type array or string, but found "+Ct(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,gt);return i?new xn(r.type,r,n,i):null}return new xn(r.type,r,n)},xn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!It(t,["string","array"]))throw new Wt("Expected first argument to be of type array or string, but found "+Ct(Vt(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},xn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},xn.prototype.outputDefined=function(){return!1},xn.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var On=Rn("==",_n,An),Dn=Rn("!=",wn,Cn),zn=Rn("<",kn,En),Fn=Rn(">",Tn,Pn),jn=Rn("<=",Mn,Ln),Nn=Rn(">=",Sn,In),Zn=function(e,t,r,n,i){this.type=yt,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Zn.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,gt);if(!r)return null;var n=e[2];if("object"!==typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=t.parse(n.locale,1,yt)))return null;var a=null;if(n.currency&&!(a=t.parse(n.currency,1,yt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=t.parse(n["min-fraction-digits"],1,gt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=t.parse(n["max-fraction-digits"],1,gt))?null:new Zn(r,i,a,o,s)},Zn.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},Zn.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},Zn.prototype.outputDefined=function(){return!1},Zn.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Bn=function(e){this.type=gt,this.input=e};Bn.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+Ct(r.type)+" instead."):new Bn(r):null},Bn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"===typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Wt("Expected value to be of type string or array, but found "+Ct(Vt(t))+" instead.")},Bn.prototype.eachChild=function(e){e(this.input)},Bn.prototype.outputDefined=function(){return!1},Bn.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Vn={"==":On,"!=":Dn,">":Fn,"<":zn,">=":Nn,"<=":jn,array:qt,at:hn,boolean:qt,case:yn,coalesce:dn,collator:rr,format:Yt,image:Xt,in:vn,"index-of":mn,interpolate:cn,"interpolate-hcl":cn,"interpolate-lab":cn,length:Bn,let:pn,literal:Ht,match:gn,number:qt,"number-format":Zn,object:qt,slice:xn,step:Dr,string:qt,"to-boolean":$t,"to-color":$t,"to-number":$t,"to-string":$t,var:Lr,within:Ar};function Un(e,t){var r=t[0],n=t[1],i=t[2],a=t[3];r=r.evaluate(e),n=n.evaluate(e),i=i.evaluate(e);var o=a?a.evaluate(e):1,s=Zt(r,n,i,o);if(s)throw new Wt(s);return new Dt(r/255*o,n/255*o,i/255*o,o)}function Hn(e,t){return e in t}function Wn(e,t){var r=t[e];return"undefined"===typeof r?null:r}function Gn(e,t,r,n){for(;r<=n;){var i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}function qn(e){return{type:e}}function Yn(e){return{result:"success",value:e}}function Xn(e){return{result:"error",value:e}}function Kn(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function $n(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Jn(e){return!!e.expression&&e.expression.interpolated}function Qn(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function ei(e){return"object"===typeof e&&null!==e&&!Array.isArray(e)}function ti(e){return e}function ri(e,t){var r,n,i,a="color"===t.type,o=e.stops&&"object"===typeof e.stops[0][0],s=o||void 0!==e.property,l=o||!s,u=e.type||(Jn(t)?"exponential":"interval");if(a&&((e=ft({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],Dt.parse(e[1])]}))),e.default?e.default=Dt.parse(e.default):e.default=Dt.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!un[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)r=oi;else if("interval"===u)r=ai;else if("categorical"===u){r=ii,n=Object.create(null);for(var c=0,f=e.stops;c=e.stops[n-1][0])return e.stops[n-1][1];var i=Or(e.stops.map((function(e){return e[0]})),r);return e.stops[i][1]}function oi(e,t,r){var n=void 0!==e.base?e.base:1;if("number"!==Qn(r))return ni(e.default,t.default);var i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];var a=Or(e.stops.map((function(e){return e[0]})),r),o=li(r,n,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],u=Nr[t.type]||ti;if(e.colorSpace&&"rgb"!==e.colorSpace){var c=un[e.colorSpace];u=function(e,t){return c.reverse(c.interpolate(c.forward(e),c.forward(t),o))}}return"function"===typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return u(r,n,o)}}:u(s,l,o)}function si(e,t,r){return"color"===t.type?r=Dt.parse(r):"formatted"===t.type?r=jt.fromString(r.toString()):"resolvedImage"===t.type?r=Nt.fromString(r.toString()):Qn(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),ni(r,e.default,t.default)}function li(e,t,r,n){var i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}er.register(Vn,{error:[kt,[yt],function(e,t){var r=t[0];throw new Wt(r.evaluate(e))}],typeof:[yt,[wt],function(e,t){return Ct(Vt(t[0].evaluate(e)))}],"to-rgba":[At(gt,4),[bt],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[bt,[gt,gt,gt],Un],rgba:[bt,[gt,gt,gt,gt],Un],has:{type:xt,overloads:[[[yt],function(e,t){return Hn(t[0].evaluate(e),e.properties())}],[[yt,_t],function(e,t){var r=t[0],n=t[1];return Hn(r.evaluate(e),n.evaluate(e))}]]},get:{type:wt,overloads:[[[yt],function(e,t){return Wn(t[0].evaluate(e),e.properties())}],[[yt,_t],function(e,t){var r=t[0],n=t[1];return Wn(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[wt,[yt],function(e,t){return Wn(t[0].evaluate(e),e.featureState||{})}],properties:[_t,[],function(e){return e.properties()}],"geometry-type":[yt,[],function(e){return e.geometryType()}],id:[wt,[],function(e){return e.id()}],zoom:[gt,[],function(e){return e.globals.zoom}],"heatmap-density":[gt,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[gt,[],function(e){return e.globals.lineProgress||0}],accumulated:[wt,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[gt,qn(gt),function(e,t){for(var r=0,n=0,i=t;n":[xt,[yt,wt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>a}],"filter-id->":[xt,[wt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>i}],"filter-<=":[xt,[yt,wt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i<=a}],"filter-id-<=":[xt,[wt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n<=i}],"filter->=":[xt,[yt,wt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>=a}],"filter-id->=":[xt,[wt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>=i}],"filter-has":[xt,[wt],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[xt,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[xt,[At(yt)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[xt,[At(wt)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[xt,[yt,At(wt)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[xt,[yt,At(wt)],function(e,t){var r=t[0],n=t[1];return Gn(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:xt,overloads:[[[xt,xt],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[qn(xt),function(e,t){for(var r=0,n=t;r0&&"string"===typeof e[0]&&e[0]in Vn}function fi(e,t){var r=new Ir(Vn,[],t?yi(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Yn(new ui(n,t)):Xn(r.errors)}ui.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},ui.prototype.evaluate=function(e,t,r,n,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null===o||void 0===o||"number"===typeof o&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new Wt("Expected value to be one of "+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!==typeof console&&console.warn(s.message)),this._defaultValue}};var di=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Er(t.expression)};di.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},di.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)};var pi=function(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Er(t.expression),this.interpolationType=n};function hi(e,t){if("error"===(e=fi(e,t)).result)return e;var r=e.value.expression,n=Cr(r);if(!n&&!Kn(t))return Xn([new ht("","data expressions not supported")]);var i=Pr(r,["zoom"]);if(!i&&!$n(t))return Xn([new ht("","zoom expressions not supported")]);var a=gi(r);if(!a&&!i)return Xn([new ht("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof ht)return Xn([a]);if(a instanceof cn&&!Jn(t))return Xn([new ht("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Yn(new di(n?"constant":"source",e.value));var o=a instanceof cn?a.interpolation:void 0;return Yn(new pi(n?"camera":"composite",e.value,a.labels,o))}pi.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},pi.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)},pi.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?cn.interpolationFactor(this.interpolationType,e,t,r):0};var vi=function(e,t){this._parameters=e,this._specification=t,ft(this,ri(this._parameters,this._specification))};function mi(e,t){if(ei(e))return new vi(e,t);if(ci(e)){var r=hi(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}var n=e;return"string"===typeof e&&"color"===t.type&&(n=Dt.parse(e)),{kind:"constant",evaluate:function(){return n}}}function gi(e){var t=null;if(e instanceof pn)t=gi(e.result);else if(e instanceof dn)for(var r=0,n=e.args;rn.maximum?[new ut(t,r,r+" is greater than the maximum value "+n.maximum)]:[]}function ki(e){var t,r,n,i=e.valueSpec,a=dt(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,u="array"===Qn(e.value.stops)&&"array"===Qn(e.value.stops[0])&&"object"===Qn(e.value.stops[0][0]),c=bi({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:f,default:h}});return"identity"===a&&s&&c.push(new ut(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||c.push(new ut(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!Jn(e.valueSpec)&&c.push(new ut(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Kn(e.valueSpec)?c.push(new ut(e.key,e.value,"property functions not supported")):s&&!$n(e.valueSpec)&&c.push(new ut(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!u||void 0!==e.value.property||c.push(new ut(e.key,e.value,'"property" property is required')),c;function f(e){if("identity"===a)return[new ut(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;return t=t.concat(_i({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:d})),"array"===Qn(r)&&0===r.length&&t.push(new ut(e.key,r,"array must have at least one stop")),t}function d(e){var t=[],a=e.value,s=e.key;if("array"!==Qn(a))return[new ut(s,a,"array expected, "+Qn(a)+" found")];if(2!==a.length)return[new ut(s,a,"array length 2 expected, length "+a.length+" found")];if(u){if("object"!==Qn(a[0]))return[new ut(s,a,"object expected, "+Qn(a[0])+" found")];if(void 0===a[0].zoom)return[new ut(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new ut(s,a,"object stop key must have value")];if(n&&n>dt(a[0].zoom))return[new ut(s,a[0].zoom,"stop zoom values must appear in ascending order")];dt(a[0].zoom)!==n&&(n=dt(a[0].zoom),r=void 0,o={}),t=t.concat(bi({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:wi,value:p}}))}else t=t.concat(p({key:s+"[0]",value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return ci(pt(a[1]))?t.concat([new ut(s+"[1]",a[1],"expressions are not allowed in function stops.")]):t.concat(Qi({key:s+"[1]",value:a[1],valueSpec:i,style:e.style,styleSpec:e.styleSpec}))}function p(e,n){var s=Qn(e.value),l=dt(e.value),u=null!==e.value?e.value:n;if(t){if(s!==t)return[new ut(e.key,u,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ut(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return Kn(i)&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ut(e.key,u,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!==typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);tt?1:0}function Ii(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t"===t||"<="===t||">="===t?Oi(e[1],e[2],t):"any"===t?Di(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(Ri)):"none"===t?["all"].concat(e.slice(1).map(Ri).map(ji)):"in"===t?zi(e[1],e.slice(2)):"!in"===t?ji(zi(e[1],e.slice(2))):"has"===t?Fi(e[1]):"!has"===t?ji(Fi(e[1])):"within"!==t||e}function Oi(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Di(e){return["any"].concat(e.map(Ri))}function zi(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return typeof e!==typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Li)]]:["filter-in-small",e,["literal",t]]}}function Fi(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function ji(e){return["!",e]}function Ni(e){return Ci(pt(e.value))?Ti(ft({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Zi(e)}function Zi(e){var t=e.value,r=e.key;if("array"!==Qn(t))return[new ut(r,t,"array expected, "+Qn(t)+" found")];var n,i=e.styleSpec,a=[];if(t.length<1)return[new ut(r,t,"filter array must have at least 1 element")];switch(a=a.concat(Ai({key:r+"[0]",value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),dt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===dt(t[1])&&a.push(new ut(r,t,'"$type" cannot be use with operator "'+t[0]+'"'));case"==":case"!=":3!==t.length&&a.push(new ut(r,t,'filter array for operator "'+t[0]+'" must have 3 elements'));case"in":case"!in":t.length>=2&&"string"!==(n=Qn(t[1]))&&a.push(new ut(r+"[1]",t[1],"string expected, "+n+" found"));for(var o=2;o=c[p+0]&&n>=c[p+1])?(o[d]=!0,a.push(u[d])):o[d]=!1}}},fa.prototype._forEachCell=function(e,t,r,n,i,a,o,s){for(var l=this._convertToCellCoord(e),u=this._convertToCellCoord(t),c=this._convertToCellCoord(r),f=this._convertToCellCoord(n),d=l;d<=c;d++)for(var p=u;p<=f;p++){var h=this.d*p+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&i.call(this,e,t,r,n,h,a,o,s))return}},fa.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},fa.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},fa.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=ca+this.cells.length+1+1,r=0,n=0;n=0)){var f=e[c];u[c]=ha[l].shallow.indexOf(c)>=0?f:xa(f,t)}e instanceof Error&&(u.message=e.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}throw new Error("can't serialize object of type "+typeof e)}function ba(e){if(null===e||void 0===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||ga(e)||ya(e)||ArrayBuffer.isView(e)||e instanceof da)return e;if(Array.isArray(e))return e.map(ba);if("object"===typeof e){var t=e.$name||"Object",r=ha[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var n=Object.create(r.prototype),i=0,a=Object.keys(e);i=0?s:ba(s)}}return n}throw new Error("can't deserialize object of type "+typeof e)}var _a=function(){this.first=!0};_a.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function ka(e){for(var t=0,r=e;t=65097&&e<=65103)||!!wa["CJK Compatibility Ideographs"](e)||!!wa["CJK Compatibility"](e)||!!wa["CJK Radicals Supplement"](e)||!!wa["CJK Strokes"](e)||!(!wa["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||!!wa["CJK Unified Ideographs Extension A"](e)||!!wa["CJK Unified Ideographs"](e)||!!wa["Enclosed CJK Letters and Months"](e)||!!wa["Hangul Compatibility Jamo"](e)||!!wa["Hangul Jamo Extended-A"](e)||!!wa["Hangul Jamo Extended-B"](e)||!!wa["Hangul Jamo"](e)||!!wa["Hangul Syllables"](e)||!!wa.Hiragana(e)||!!wa["Ideographic Description Characters"](e)||!!wa.Kanbun(e)||!!wa["Kangxi Radicals"](e)||!!wa["Katakana Phonetic Extensions"](e)||!(!wa.Katakana(e)||12540===e)||!(!wa["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!wa["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||!!wa["Unified Canadian Aboriginal Syllabics"](e)||!!wa["Unified Canadian Aboriginal Syllabics Extended"](e)||!!wa["Vertical Forms"](e)||!!wa["Yijing Hexagram Symbols"](e)||!!wa["Yi Syllables"](e)||!!wa["Yi Radicals"](e))}function Ca(e){return!(!wa["Latin-1 Supplement"](e)||167!==e&&169!==e&&174!==e&&177!==e&&188!==e&&189!==e&&190!==e&&215!==e&&247!==e)||!(!wa["General Punctuation"](e)||8214!==e&&8224!==e&&8225!==e&&8240!==e&&8241!==e&&8251!==e&&8252!==e&&8258!==e&&8263!==e&&8264!==e&&8265!==e&&8273!==e)||!!wa["Letterlike Symbols"](e)||!!wa["Number Forms"](e)||!(!wa["Miscellaneous Technical"](e)||!(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215))||!(!wa["Control Pictures"](e)||9251===e)||!!wa["Optical Character Recognition"](e)||!!wa["Enclosed Alphanumerics"](e)||!!wa["Geometric Shapes"](e)||!(!wa["Miscellaneous Symbols"](e)||e>=9754&&e<=9759)||!(!wa["Miscellaneous Symbols and Arrows"](e)||!(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243))||!!wa["CJK Symbols and Punctuation"](e)||!!wa.Katakana(e)||!!wa["Private Use Area"](e)||!!wa["CJK Compatibility Forms"](e)||!!wa["Small Form Variants"](e)||!!wa["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e}function Ea(e){return!(Aa(e)||Ca(e))}function Pa(e){return wa.Arabic(e)||wa["Arabic Supplement"](e)||wa["Arabic Extended-A"](e)||wa["Arabic Presentation Forms-A"](e)||wa["Arabic Presentation Forms-B"](e)}function La(e){return e>=1424&&e<=2303||wa["Arabic Presentation Forms-A"](e)||wa["Arabic Presentation Forms-B"](e)}function Ia(e,t){return!(!t&&La(e))&&!(e>=2304&&e<=3583||e>=3840&&e<=4255||wa.Khmer(e))}function Ra(e){for(var t=0,r=e;t-1&&(Fa=Da.error),za&&za(e)};function Za(){Ba.fire(new at("pluginStateChange",{pluginStatus:Fa,pluginURL:ja}))}var Ba=new st,Va=function(){return Fa},Ua=function(e){return e({pluginStatus:Fa,pluginURL:ja}),Ba.on("pluginStateChange",e),e},Ha=function(e,t,r){if(void 0===r&&(r=!1),Fa===Da.deferred||Fa===Da.loading||Fa===Da.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");ja=q.resolveURL(e),Fa=Da.deferred,za=t,Za(),r||Wa()},Wa=function(){if(Fa!==Da.deferred||!ja)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Fa=Da.loading,Za(),ja&&qe({url:ja},(function(e){e?Na(e):(Fa=Da.loaded,Za())}))},Ga={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Fa===Da.loaded||null!=Ga.applyArabicShaping},isLoading:function(){return Fa===Da.loading},setState:function(e){Fa=e.pluginStatus,ja=e.pluginURL},isParsed:function(){return null!=Ga.applyArabicShaping&&null!=Ga.processBidirectionalText&&null!=Ga.processStyledBidirectionalText},getPluginURL:function(){return ja}},qa=function(){Ga.isLoading()||Ga.isLoaded()||"deferred"!==Va()||Wa()},Ya=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new _a,this.transition={})};Ya.prototype.isSupportedScript=function(e){return Oa(e,Ga.isLoaded())},Ya.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Ya.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Xa=function(e,t){this.property=e,this.value=t,this.expression=mi(void 0===t?e.specification.default:t,e.specification)};Xa.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Xa.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var Ka=function(e){this.property=e,this.value=new Xa(e,void 0)};Ka.prototype.transitioned=function(e,t){return new Ja(this.property,this.value,t,m({},e.transition,this.transition),e.now)},Ka.prototype.untransitioned=function(){return new Ja(this.property,this.value,null,{},0)};var $a=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};$a.prototype.getValue=function(e){return S(this._values[e].value.value)},$a.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ka(this._values[e].property)),this._values[e].value=new Xa(this._values[e].property,null===t?void 0:S(t))},$a.prototype.getTransition=function(e){return S(this._values[e].transition)},$a.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ka(this._values[e].property)),this._values[e].transition=S(t)||void 0},$a.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);tthis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(nn.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},t.prototype.interpolate=function(e){return e},t}(io),oo=function(e){this.specification=e};oo.prototype.possiblyEvaluate=function(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){var i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new Ya(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Ya(Math.floor(t.zoom),t)),e.expression.evaluate(new Ya(Math.floor(t.zoom+1),t)),t)}},oo.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},oo.prototype.interpolate=function(e){return e};var so=function(e){this.specification=e};so.prototype.possiblyEvaluate=function(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)},so.prototype.interpolate=function(){return!1};var lo=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var n=this.defaultPropertyValues[t]=new Xa(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new Ka(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}};va("DataDrivenProperty",io),va("DataConstantProperty",no),va("CrossFadedDataDrivenProperty",ao),va("CrossFadedProperty",oo),va("ColorRampProperty",so);var uo="-transition",co=function(e){function t(t,r){if(e.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new eo(r.layout)),r.paint)){for(var n in this._transitionablePaint=new $a(r.paint),t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ro(r.paint)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".layout."+e;if(this._validate(sa,n,e,t,r))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t},t.prototype.getPaintProperty=function(e){return k(e,uo)?this._transitionablePaint.getTransition(e.slice(0,-uo.length)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".paint."+e;if(this._validate(oa,n,e,t,r))return!1}if(k(e,uo))return this._transitionablePaint.setTransition(e.slice(0,-uo.length),t||void 0),!1;var i=this._transitionablePaint._values[e],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var l=this._transitionablePaint._values[e].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(e,s,l)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype._handleOverridablePaintPropertyUpdate=function(e,t,r){return!1},t.prototype.isHidden=function(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility},t.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)},t.prototype.serialize=function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),M(e,(function(e,t){return void 0!==e&&!("layout"===t&&!Object.keys(e).length)&&!("paint"===t&&!Object.keys(e).length)}))},t.prototype._validate=function(e,t,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&la(this,e.call(ia,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:lt,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof to&&Kn(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1},t}(st),fo={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},po=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},ho=128,vo=5,mo=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function go(e,t){void 0===t&&(t=1);var r=0,n=0;return{members:e.map((function(e){var i=yo(e.type),a=r=xo(r,Math.max(t,i)),o=e.components||1;return n=Math.max(n,i),r+=i*o,{name:e.name,type:e.type,components:o,offset:a}})),size:xo(r,Math.max(n,t)),alignment:t}}function yo(e){return fo[e].BYTES_PER_ELEMENT}function xo(e,t){return Math.ceil(e/t)*t}mo.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},mo.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},mo.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},mo.prototype.clear=function(){this.length=0},mo.prototype.resize=function(e){this.reserve(e),this.length=e},mo.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*vo),ho),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},mo.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var bo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e},t}(mo);bo.prototype.bytesPerElement=4,va("StructArrayLayout2i4",bo);var _o=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e},t}(mo);_o.prototype.bytesPerElement=8,va("StructArrayLayout4i8",_o);var wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(mo);wo.prototype.bytesPerElement=12,va("StructArrayLayout2i4i12",wo);var ko=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,e},t}(mo);ko.prototype.bytesPerElement=8,va("StructArrayLayout2i4ub8",ko);var To=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,u){var c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,a,o,s,l,u)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,u,c){var f=9*e,d=18*e;return this.uint16[f+0]=t,this.uint16[f+1]=r,this.uint16[f+2]=n,this.uint16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.uint8[d+16]=u,this.uint8[d+17]=c,e},t}(mo);To.prototype.bytesPerElement=18,va("StructArrayLayout8ui2ub18",To);var Mo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,u,c,f){var d=this.length;return this.resize(d+1),this.emplace(d,e,t,r,n,i,a,o,s,l,u,c,f)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,u,c,f,d){var p=12*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=u,this.int16[p+9]=c,this.int16[p+10]=f,this.int16[p+11]=d,e},t}(mo);Mo.prototype.bytesPerElement=24,va("StructArrayLayout4i4ui4i24",Mo);var So=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e},t}(mo);So.prototype.bytesPerElement=12,va("StructArrayLayout3f12",So);var Ao=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint32[r+0]=t,e},t}(mo);Ao.prototype.bytesPerElement=4,va("StructArrayLayout1ul4",Ao);var Co=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l){var u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,i,a,o,s,l)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,u){var c=10*e,f=5*e;return this.int16[c+0]=t,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=a,this.int16[c+5]=o,this.uint32[f+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,e},t}(mo);Co.prototype.bytesPerElement=20,va("StructArrayLayout6i1ul2ui20",Co);var Eo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(mo);Eo.prototype.bytesPerElement=12,va("StructArrayLayout2i2i2i12",Eo);var Po=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)},t.prototype.emplace=function(e,t,r,n,i,a){var o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,e},t}(mo);Po.prototype.bytesPerElement=16,va("StructArrayLayout2f1f2i16",Po);var Lo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=12*e,o=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,e},t}(mo);Lo.prototype.bytesPerElement=12,va("StructArrayLayout2ub2f12",Lo);var Io=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e},t}(mo);Io.prototype.bytesPerElement=6,va("StructArrayLayout3ui6",Io);var Ro=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m){var g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m,g){var y=24*e,x=12*e,b=48*e;return this.int16[y+0]=t,this.int16[y+1]=r,this.uint16[y+2]=n,this.uint16[y+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[y+10]=l,this.uint16[y+11]=u,this.uint16[y+12]=c,this.float32[x+7]=f,this.float32[x+8]=d,this.uint8[b+36]=p,this.uint8[b+37]=h,this.uint8[b+38]=v,this.uint32[x+10]=m,this.int16[y+22]=g,e},t}(mo);Ro.prototype.bytesPerElement=48,va("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ro);var Oo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x,b,_,w,k,T,M,S,A){var C=this.length;return this.resize(C+1),this.emplace(C,e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x,b,_,w,k,T,M,S,A)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x,b,_,w,k,T,M,S,A,C){var E=34*e,P=17*e;return this.int16[E+0]=t,this.int16[E+1]=r,this.int16[E+2]=n,this.int16[E+3]=i,this.int16[E+4]=a,this.int16[E+5]=o,this.int16[E+6]=s,this.int16[E+7]=l,this.uint16[E+8]=u,this.uint16[E+9]=c,this.uint16[E+10]=f,this.uint16[E+11]=d,this.uint16[E+12]=p,this.uint16[E+13]=h,this.uint16[E+14]=v,this.uint16[E+15]=m,this.uint16[E+16]=g,this.uint16[E+17]=y,this.uint16[E+18]=x,this.uint16[E+19]=b,this.uint16[E+20]=_,this.uint16[E+21]=w,this.uint16[E+22]=k,this.uint32[P+12]=T,this.float32[P+13]=M,this.float32[P+14]=S,this.float32[P+15]=A,this.float32[P+16]=C,e},t}(mo);Oo.prototype.bytesPerElement=68,va("StructArrayLayout8i15ui1ul4f68",Oo);var Do=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.float32[r+0]=t,e},t}(mo);Do.prototype.bytesPerElement=4,va("StructArrayLayout1f4",Do);var zo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e},t}(mo);zo.prototype.bytesPerElement=6,va("StructArrayLayout3i6",zo);var Fo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=2*e,a=4*e;return this.uint32[i+0]=t,this.uint16[a+2]=r,this.uint16[a+3]=n,e},t}(mo);Fo.prototype.bytesPerElement=8,va("StructArrayLayout1ul2ui8",Fo);var jo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e},t}(mo);jo.prototype.bytesPerElement=4,va("StructArrayLayout2ui4",jo);var No=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint16[r+0]=t,e},t}(mo);No.prototype.bytesPerElement=2,va("StructArrayLayout1ui2",No);var Zo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e},t}(mo);Zo.prototype.bytesPerElement=8,va("StructArrayLayout2f8",Zo);var Bo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e},t}(mo);Bo.prototype.bytesPerElement=16,va("StructArrayLayout4f16",Bo);var Vo=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(po);Vo.prototype.size=20;var Uo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Vo(this,e)},t}(Co);va("CollisionBoxArray",Uo);var Ho=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(po);Ho.prototype.size=48;var Wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Ho(this,e)},t}(Ro);va("PlacedSymbolArray",Wo);var Go=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+12]=e},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(po);Go.prototype.size=68;var qo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Go(this,e)},t}(Oo);va("SymbolInstanceArray",qo);var Yo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t}(Do);va("GlyphOffsetArray",Yo);var Xo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t}(zo);va("SymbolLineVertexArray",Xo);var Ko=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(po);Ko.prototype.size=8;var $o=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Ko(this,e)},t}(Fo);va("FeatureIndexArray",$o);var Jo=go([{name:"a_pos",components:2,type:"Int16"}],4).members,Qo=function(e){void 0===e&&(e=[]),this.segments=e};function es(e,t){return 256*(e=f(Math.floor(e),0,255))+(t=f(Math.floor(t),0,255))}Qo.prototype.prepareSegment=function(e,t,r,n){var i=this.segments[this.segments.length-1];return e>Qo.MAX_VERTEX_ARRAY_LENGTH&&E("Max vertices per segment is "+Qo.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!i||i.vertexLength+e>Qo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Qo.prototype.get=function(){return this.segments},Qo.prototype.destroy=function(){for(var e=0,t=this.segments;e>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}e.exports=t})),ns=t((function(e){function t(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}e.exports=t})),is=rs,as=rs,os=ns;is.murmur3=as,is.murmur2=os;var ss=function(){this.ids=[],this.positions=[],this.indexed=!1};ss.prototype.add=function(e,t,r,n){this.ids.push(us(e)),this.positions.push(t,r,n)},ss.prototype.getPositions=function(e){for(var t=us(e),r=0,n=this.ids.length-1;r>1;this.ids[i]>=t?n=i:r=i+1}for(var a=[];this.ids[r]===t;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},ss.serialize=function(e,t){var r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return cs(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}},ss.deserialize=function(e){var t=new ss;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ls=Math.pow(2,53)-1;function us(e){var t=+e;return!isNaN(t)&&t<=ls?t:is(String(e))}function cs(e,t,r,n){for(;r>1],a=r-1,o=n+1;;){do{a++}while(e[a]i);if(a>=o)break;fs(e,a,o),fs(t,3*a,3*o),fs(t,3*a+1,3*o+1),fs(t,3*a+2,3*o+2)}o-rOs.max||o.yOs.max)&&(E("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=f(o.x,Os.min,Os.max),o.y=f(o.y,Os.min,Os.max))}return r}function zs(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}var Fs=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new bo,this.indexArray=new Io,this.segments=new Qo,this.programConfigurations=new Cs(Jo,e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function js(e,t){for(var r=0;r=3)for(var a=0;a1){if(Us(e,t))return!0;for(var n=0;n1?e.distSqr(r):e.distSqr(r.sub(t)._mult(i)._add(t))}function qs(e,t){for(var r,n,i,a=!1,o=0;ot.y!==i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Ys(e,t){for(var r=!1,n=0,i=e.length-1;nt.y!==o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Xs(e,t,r,n,i){for(var o=0,s=e;o=l.x&&i>=l.y)return!0}var u=[new a(t,r),new a(t,i),new a(n,i),new a(n,r)];if(e.length>2)for(var c=0,f=u;ci.x&&t.x>i.x||e.yi.y&&t.y>i.y)return!1;var a=P(e,t,r[0]);return a!==P(e,t,r[1])||a!==P(e,t,r[2])||a!==P(e,t,r[3])}function $s(e,t,r){var n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Js(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Qs(e,t,r,n,i){if(!t[0]&&!t[1])return e;var o=a.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=Is||c<0||c>=Is)){var f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),d=f.vertexLength;zs(this.layoutVertexArray,u,c,-1,-1),zs(this.layoutVertexArray,u,c,1,-1),zs(this.layoutVertexArray,u,c,1,1),zs(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(d,d+1,d+2),this.indexArray.emplaceBack(d,d+3,d+2),f.vertexLength+=4,f.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)},va("CircleBucket",Fs,{omit:["layers"]});var el=new lo({"circle-sort-key":new io(lt.layout_circle["circle-sort-key"])}),tl={paint:new lo({"circle-radius":new io(lt.paint_circle["circle-radius"]),"circle-color":new io(lt.paint_circle["circle-color"]),"circle-blur":new io(lt.paint_circle["circle-blur"]),"circle-opacity":new io(lt.paint_circle["circle-opacity"]),"circle-translate":new no(lt.paint_circle["circle-translate"]),"circle-translate-anchor":new no(lt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new no(lt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new no(lt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new io(lt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new io(lt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new io(lt.paint_circle["circle-stroke-opacity"])}),layout:el},rl="undefined"!==typeof Float32Array?Float32Array:Array;function nl(){var e=new rl(4);return rl!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function il(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+a*s,e[1]=i*l+o*s,e[2]=n*-s+a*l,e[3]=i*-s+o*l,e}function al(){var e=new rl(9);return rl!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ol(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function sl(){var e=new rl(16);return rl!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function ll(e){var t=new rl(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ul(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function cl(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],f=t[9],d=t[10],p=t[11],h=t[12],v=t[13],m=t[14],g=t[15],y=r*s-n*o,x=r*l-i*o,b=r*u-a*o,_=n*l-i*s,w=n*u-a*s,k=i*u-a*l,T=c*v-f*h,M=c*m-d*h,S=c*g-p*h,A=f*m-d*v,C=f*g-p*v,E=d*g-p*m,P=y*E-x*C+b*A+_*S-w*M+k*T;return P?(P=1/P,e[0]=(s*E-l*C+u*A)*P,e[1]=(i*C-n*E-a*A)*P,e[2]=(v*k-m*w+g*_)*P,e[3]=(d*w-f*k-p*_)*P,e[4]=(l*S-o*E-u*M)*P,e[5]=(r*E-i*S+a*M)*P,e[6]=(m*b-h*k-g*x)*P,e[7]=(c*k-d*b+p*x)*P,e[8]=(o*C-s*S+u*T)*P,e[9]=(n*S-r*C-a*T)*P,e[10]=(h*w-v*b+g*y)*P,e[11]=(f*b-c*w-p*y)*P,e[12]=(s*M-o*A-l*T)*P,e[13]=(r*A-n*M+i*T)*P,e[14]=(v*x-h*_-m*y)*P,e[15]=(c*_-f*x+d*y)*P,e):null}function fl(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],f=t[8],d=t[9],p=t[10],h=t[11],v=t[12],m=t[13],g=t[14],y=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*n+b*s+_*f+w*v,e[1]=x*i+b*l+_*d+w*m,e[2]=x*a+b*u+_*p+w*g,e[3]=x*o+b*c+_*h+w*y,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*n+b*s+_*f+w*v,e[5]=x*i+b*l+_*d+w*m,e[6]=x*a+b*u+_*p+w*g,e[7]=x*o+b*c+_*h+w*y,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*n+b*s+_*f+w*v,e[9]=x*i+b*l+_*d+w*m,e[10]=x*a+b*u+_*p+w*g,e[11]=x*o+b*c+_*h+w*y,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*n+b*s+_*f+w*v,e[13]=x*i+b*l+_*d+w*m,e[14]=x*a+b*u+_*p+w*g,e[15]=x*o+b*c+_*h+w*y,e}function dl(e,t,r){var n,i,a,o,s,l,u,c,f,d,p,h,v=r[0],m=r[1],g=r[2];return t===e?(e[12]=t[0]*v+t[4]*m+t[8]*g+t[12],e[13]=t[1]*v+t[5]*m+t[9]*g+t[13],e[14]=t[2]*v+t[6]*m+t[10]*g+t[14],e[15]=t[3]*v+t[7]*m+t[11]*g+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],f=t[8],d=t[9],p=t[10],h=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=f,e[9]=d,e[10]=p,e[11]=h,e[12]=n*v+s*m+f*g+t[12],e[13]=i*v+l*m+d*g+t[13],e[14]=a*v+u*m+p*g+t[14],e[15]=o*v+c*m+h*g+t[15]),e}function pl(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function hl(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],f=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+u*n,e[5]=o*i+c*n,e[6]=s*i+f*n,e[7]=l*i+d*n,e[8]=u*i-a*n,e[9]=c*i-o*n,e[10]=f*i-s*n,e[11]=d*i-l*n,e}function vl(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],c=t[5],f=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+u*n,e[1]=o*i+c*n,e[2]=s*i+f*n,e[3]=l*i+d*n,e[4]=u*i-a*n,e[5]=c*i-o*n,e[6]=f*i-s*n,e[7]=d*i-l*n,e}function ml(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e}function gl(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*u,e[15]=1,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var yl=fl;function xl(){var e=new rl(3);return rl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function bl(e){var t=new rl(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function _l(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function wl(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function kl(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function Tl(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function Ml(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Sl(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}function Al(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}var Cl=wl;function El(){var e=new rl(4);return rl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Pl(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Ll(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Il(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function Rl(){var e=new rl(2);return rl!=Float32Array&&(e[0]=0,e[1]=0),e}function Ol(e){var t=e[0],r=e[1];return t*t+r*r}xl(),El();var Dl=Ol,zl=(Rl(),function(e){function t(t){e.call(this,t,tl)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new Fs(e)},t.prototype.queryRadius=function(e){var t=e;return $s("circle-radius",this,t)+$s("circle-stroke-width",this,t)+Js(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o,s){for(var l=Qs(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),u=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),c="map"===this.paint.get("circle-pitch-alignment"),f=c?l:jl(l,s),d=c?u*o:u,p=0,h=n;pe.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=e.data,s=t.data,l=0;l80*r){n=a=e[0],i=o=e[1];for(var h=r;ha&&(a=s),l>o&&(o=l);u=0!==(u=Math.max(a-n,o-i))?1/u:0}return ru(d,p,r,n,i,u),p}function eu(e,t,r,n,i){var a,o;if(i===Pu(e,t,r,n)>0)for(a=t;a=t;a-=n)o=Au(a,e[a],e[a+1],o);return o&&xu(o,o.next)&&(Cu(o),o=o.next),o}function tu(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!xu(n,n.next)&&0!==yu(n.prev,n,n.next))n=n.next;else{if(Cu(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function ru(e,t,r,n,i,a,o){if(e){!o&&a&&du(e,n,i,a);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?iu(e,n,i,a):nu(e))t.push(s.i/r),t.push(e.i/r),t.push(l.i/r),Cu(e),e=l.next,u=l.next;else if((e=l)===u){o?1===o?ru(e=au(tu(e),t,r),t,r,n,i,a,2):2===o&&ou(e,t,r,n,i,a):ru(tu(e),t,r,n,i,a,1);break}}}function nu(e){var t=e.prev,r=e,n=e.next;if(yu(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(mu(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&yu(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function iu(e,t,r,n){var i=e.prev,a=e,o=e.next;if(yu(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=hu(s,l,t,r,n),d=hu(u,c,t,r,n),p=e.prevZ,h=e.nextZ;p&&p.z>=f&&h&&h.z<=d;){if(p!==e.prev&&p!==e.next&&mu(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&yu(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,h!==e.prev&&h!==e.next&&mu(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&yu(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;p&&p.z>=f;){if(p!==e.prev&&p!==e.next&&mu(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&yu(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;h&&h.z<=d;){if(h!==e.prev&&h!==e.next&&mu(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&yu(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function au(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!xu(i,a)&&bu(i,n,n.next,a)&&Tu(i,a)&&Tu(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),Cu(n),Cu(n.next),n=e=a),n=n.next}while(n!==e);return tu(n)}function ou(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&gu(o,s)){var l=Su(o,s);return o=tu(o,o.next),l=tu(l,l.next),ru(o,t,r,n,i,a),void ru(l,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function su(e,t,r,n){var i,a,o,s=[];for(i=0,a=t.length;i=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&mu(ar.x||n.x===r.x&&fu(r,n)))&&(r=n,d=l)),n=n.next}while(n!==u);return r}function fu(e,t){return yu(e.prev,e,t.prev)<0&&yu(t.next,e,e.next)<0}function du(e,t,r,n){var i=e;do{null===i.z&&(i.z=hu(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,pu(i)}function pu(e){var t,r,n,i,a,o,s,l,u=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1);return e}function hu(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function vu(e){var t=e,r=e;do{(t.x=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function gu(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!ku(e,t)&&(Tu(e,t)&&Tu(t,e)&&Mu(e,t)&&(yu(e.prev,e,t.prev)||yu(e,t.prev,t))||xu(e,t)&&yu(e.prev,e,e.next)>0&&yu(t.prev,t,t.next)>0)}function yu(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function xu(e,t){return e.x===t.x&&e.y===t.y}function bu(e,t,r,n){var i=wu(yu(e,t,r)),a=wu(yu(e,t,n)),o=wu(yu(r,n,e)),s=wu(yu(r,n,t));return i!==a&&o!==s||!(0!==i||!_u(e,r,t))||!(0!==a||!_u(e,n,t))||!(0!==o||!_u(r,e,n))||!(0!==s||!_u(r,t,n))}function _u(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function wu(e){return e>0?1:e<0?-1:0}function ku(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&bu(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function Tu(e,t){return yu(e.prev,e,e.next)<0?yu(e,t,e.next)>=0&&yu(e,e.prev,t)>=0:yu(e,t,e.prev)<0||yu(e,e.next,t)<0}function Mu(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}function Su(e,t){var r=new Eu(e.i,e.x,e.y),n=new Eu(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Au(e,t,r,n){var i=new Eu(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Cu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Eu(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Pu(e,t,r,n){for(var i=0,a=t,o=r-n;ar;){if(n-r>600){var a=n-r+1,o=t-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Iu(e,t,Math.max(r,Math.floor(t-o*l/a+u)),Math.min(n,Math.floor(t+(a-o)*l/a+u)),i)}var c=e[t],f=r,d=n;for(Ru(e,r,t),i(e[n],c)>0&&Ru(e,r,n);f0;)d--}0===i(e[r],c)?Ru(e,r,d):Ru(e,++d,n),d<=t&&(r=d+1),t<=d&&(n=d-1)}}function Ru(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function Ou(e,t){return et?1:0}function Du(e,t){var r=e.length;if(r<=1)return[e];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=e[i-1].length,r.holes.push(n))}return r},$l.default=Jl;var Nu=500,Zu=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new bo,this.indexArray=new Io,this.indexArray2=new jo,this.programConfigurations=new Cs(Kl,e.layers,e.zoom),this.segments=new Qo,this.segments2=new Qo,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};Zu.prototype.populate=function(e,t,r){this.hasPattern=Fu("fill",this.layers,t);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=e;a>3}if(i--,1===n||2===n)o+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&l.push(t),t=[]),t.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&l.push(t),l},Gu.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;e.pos>3}if(n--,1===r||2===r)(i+=e.readSVarint())s&&(s=i),(a+=e.readSVarint())u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},Gu.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),u=Gu.types[this.type];function c(e){for(var t=0;t>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}function tc(e,t){this.layers=e.readFields(rc,{},t)}function rc(e,t,r){if(3===e){var n=new $u(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}Ju.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Wu(this._pbf,t,this.extent,this._keys,this._values)};var nc={VectorTile:tc,VectorTileFeature:Wu,VectorTileLayer:$u},ic=nc.VectorTileFeature.types,ac=500,oc=Math.pow(2,13);function sc(e,t,r,n,i,a,o,s){e.emplaceBack(t,r,2*Math.floor(n*oc)+o,i*oc*2,a*oc*2,Math.round(s))}var lc=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new wo,this.indexArray=new Io,this.programConfigurations=new Cs(Hu,e.layers,e.zoom),this.segments=new Qo,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function uc(e,t){return e.x===t.x&&(e.x<0||e.x>Is)||e.y===t.y&&(e.y<0||e.y>Is)}function cc(e){return e.every((function(e){return e.x<0}))||e.every((function(e){return e.x>Is}))||e.every((function(e){return e.y<0}))||e.every((function(e){return e.y>Is}))}lc.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=Fu("fill-extrusion",this.layers,t);for(var n=0,i=e;n=1){var y=h[m-1];if(!uc(g,y)){f.vertexLength+4>Qo.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=g.sub(y)._perp()._unit(),b=y.dist(g);v+b>32768&&(v=0),sc(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,v),sc(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,v),v+=b,sc(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,v),sc(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,v);var _=f.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),f.vertexLength+=4,f.primitiveLength+=2}}}}if(f.vertexLength+l>Qo.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===ic[e.type]){for(var w=[],k=[],T=f.vertexLength,M=0,S=s;M=2&&e[l-1].equals(e[l-2]);)l--;for(var u=0;u0;if(k&&g>u){var M=c.dist(p);if(M>2*f){var S=c.sub(c.sub(p)._mult(f/M)._round());this.updateDistance(p,S),this.addCurrentVertex(S,v,0,0,d),p=S}}var A=p&&h,C=A?r:s?"butt":n;if(A&&"round"===C&&(_i&&(C="bevel"),"bevel"===C&&(_>2&&(C="flipbevel"),_100)y=m.mult(-1);else{var E=_*v.add(m).mag()/v.sub(m).mag();y._perp()._mult(E*(T?-1:1))}this.addCurrentVertex(c,y,0,0,d),this.addCurrentVertex(c,y.mult(-1),0,0,d)}else if("bevel"===C||"fakeround"===C){var P=-Math.sqrt(_*_-1),L=T?P:0,I=T?0:P;if(p&&this.addCurrentVertex(c,v,L,I,d),"fakeround"===C)for(var R=Math.round(180*w/Math.PI/kc),O=1;O2*f){var Z=c.add(h.sub(c)._mult(f/N)._round());this.updateDistance(c,Z),this.addCurrentVertex(Z,m,0,0,d),c=Z}}}}},Ac.prototype.addCurrentVertex=function(e,t,r,n,i,a){void 0===a&&(a=!1);var o=t.x+t.y*r,s=t.y-t.x*r,l=-t.x+t.y*n,u=-t.y-t.x*n;this.addHalfVertex(e,o,s,a,!1,r,i),this.addHalfVertex(e,l,u,a,!0,-n,i),this.distance>Sc/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,r,n,i,a))},Ac.prototype.addHalfVertex=function(e,t,r,n,i,a,o){var s=e.x,l=e.y,u=this.scaledDistance*Mc;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(bc*t)+128,Math.round(bc*r)+128,1+(0===a?0:a<0?-1:1)|(63&u)<<2,u>>6);var c=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),o.primitiveLength++),i?this.e2=c:this.e1=c},Ac.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Sc-1):this.distance},Ac.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},va("LineBucket",Ac,{omit:["layers","patternFeatures"]});var Cc=new lo({"line-cap":new no(lt.layout_line["line-cap"]),"line-join":new io(lt.layout_line["line-join"]),"line-miter-limit":new no(lt.layout_line["line-miter-limit"]),"line-round-limit":new no(lt.layout_line["line-round-limit"]),"line-sort-key":new io(lt.layout_line["line-sort-key"])}),Ec={paint:new lo({"line-opacity":new io(lt.paint_line["line-opacity"]),"line-color":new io(lt.paint_line["line-color"]),"line-translate":new no(lt.paint_line["line-translate"]),"line-translate-anchor":new no(lt.paint_line["line-translate-anchor"]),"line-width":new io(lt.paint_line["line-width"]),"line-gap-width":new io(lt.paint_line["line-gap-width"]),"line-offset":new io(lt.paint_line["line-offset"]),"line-blur":new io(lt.paint_line["line-blur"]),"line-dasharray":new oo(lt.paint_line["line-dasharray"]),"line-pattern":new ao(lt.paint_line["line-pattern"]),"line-gradient":new so(lt.paint_line["line-gradient"])}),layout:Cc},Pc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(t,r){return r=new Ya(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),e.prototype.possiblyEvaluate.call(this,t,r)},t.prototype.evaluate=function(t,r,n,i){return r=m({},r,{zoom:Math.floor(r.zoom)}),e.prototype.evaluate.call(this,t,r,n,i)},t}(io),Lc=new Pc(Ec.paint.properties["line-width"].specification);Lc.useIntegerZoom=!0;var Ic=function(e){function t(t){e.call(this,t,Ec)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){"line-gradient"===e&&this._updateGradient()},t.prototype._updateGradient=function(){var e=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Gl(e,"lineProgress"),this.gradientTexture=null},t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r),this.paint._values["line-floorwidth"]=Lc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new Ac(e)},t.prototype.queryRadius=function(e){var t=e,r=Rc($s("line-width",this,t),$s("line-gap-width",this,t)),n=$s("line-offset",this,t);return r/2+Math.abs(n)+Js(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o){var s=Qs(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*Rc(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),u=this.paint.get("line-offset").evaluate(t,r);return u&&(n=Oc(n,u*o)),Bs(s,n,l)},t.prototype.isTileClipped=function(){return!0},t}(co);function Rc(e,t){return t>0?t+2*e:e}function Oc(e,t){for(var r=[],n=new a(0,0),i=0;i":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};function Hc(e){for(var t="",r=0;r>1,c=-7,f=r?i-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},write:function(e,t,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=h,s/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=h,o/=256,u-=8);e[r+p-h]|=128*v}},qc=Yc;function Yc(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Yc.Varint=0,Yc.Fixed64=1,Yc.Bytes=2,Yc.Fixed32=5;var Xc=4294967296,Kc=1/Xc,$c=12,Jc="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function Qc(e,t,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return tf(e,n,t);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return tf(e,n,t);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return tf(e,n,t);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return tf(e,n,t);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return tf(e,n,t);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return tf(e,n,t);throw new Error("Expected varint not more than 10 bytes")}function ef(e){return e.type===Yc.Bytes?e.readVarint()+e.pos:e.pos+1}function tf(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function rf(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),nf(r,n,t),af(n,t)}function nf(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}function af(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}function of(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function sf(e,t){for(var r=0;r>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function yf(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function xf(e,t,r){for(var n="",i=t;i239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128===(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(a=e[i+1],o=e[i+2],128===(192&a)&&128===(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=e[i+1],o=e[i+2],s=e[i+3],128===(192&a)&&128===(192&o)&&128===(192&s)&&((u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c}return n}function bf(e,t,r){return Jc.decode(e.subarray(t,r))}function _f(e,t,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}Yc.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=mf(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=yf(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=mf(this.buf,this.pos)+mf(this.buf,this.pos+4)*Xc;return this.pos+=8,e},readSFixed64:function(){var e=mf(this.buf,this.pos)+yf(this.buf,this.pos+4)*Xc;return this.pos+=8,e},readFloat:function(){var e=Gc.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Gc.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:Qc(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=$c&&Jc?bf(this.buf,t,e):xf(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Yc.Bytes)return e.push(this.readVarint(t));var r=ef(this);for(e=e||[];this.pos127;);else if(t===Yc.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Yc.Fixed32)this.pos+=4;else{if(t!==Yc.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?rf(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=_f(this.buf,e,this.pos);var r=this.pos-t;r>=128&&of(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Gc.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Gc.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&of(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,Yc.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,sf,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,lf,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,ff,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,uf,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,cf,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,df,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,pf,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,hf,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,vf,t)},writeBytesField:function(e,t){this.writeTag(e,Yc.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Yc.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Yc.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Yc.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Yc.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Yc.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Yc.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Yc.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Yc.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Yc.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var wf=3;function kf(e,t,r){1===e&&r.readMessage(Tf,t)}function Tf(e,t,r){if(3===e){var n=r.readMessage(Mf,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,u=n.top,c=n.advance;t.push({id:i,bitmap:new Ul({width:o+2*wf,height:s+2*wf},a),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function Mf(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function Sf(e){return new qc(e).readFields(kf,[])}var Af=wf;function Cf(e){for(var t=0,r=0,n=0,i=e;n=0;d--){var p=o[d];if(!(f.w>p.w||f.h>p.h)){if(f.x=p.x,f.y=p.y,l=Math.max(l,f.y+f.h),s=Math.max(s,f.x+f.w),f.w===p.w&&f.h===p.h){var h=o.pop();d=0&&n>=e&&Vf[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Nf.prototype.substring=function(e,t){var r=new Nf;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Nf.prototype.toString=function(){return this.text},Nf.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},Nf.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(jf.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,n=0;n=Ff?null:++this.imageSectionID:(this.imageSectionID=zf,this.imageSectionID)};var Vf={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Uf={};function Hf(e,t,r,n,i,a){if(t.imageName){var o=n[t.imageName];return o?o.displaySize[0]*t.scale*Wc/a+i:0}var s=r[t.fontStack],l=s&&s[e];return l?l.metrics.advance*t.scale+i:0}function Wf(e,t,r,n,i,a){for(var o=0,s=0;s=0,c=0,f=0;f0&&j>M&&(M=j)}else{var N=r[A.fontStack],Z=N&&N[E];if(Z&&Z.rect)I=Z.rect,L=Z.metrics;else{var B=t[A.fontStack],V=B&&B[E];if(!V)continue;L=V.metrics}P=(_-A.scale)*Wc}D?(e.verticalizable=!0,T.push({glyph:E,imageName:R,x:d,y:p+P,vertical:D,scale:A.scale,fontStack:A.fontStack,sectionIndex:C,metrics:L,rect:I}),d+=O*A.scale+u):(T.push({glyph:E,imageName:R,x:d,y:p+P,vertical:D,scale:A.scale,fontStack:A.fontStack,sectionIndex:C,metrics:L,rect:I}),d+=L.advance*A.scale+u)}if(0!==T.length){var U=d-u;h=Math.max(U,h),Qf(T,0,T.length-1,m,M)}d=0;var H=a*_+M;k.lineOffset=Math.max(M,w),p+=H,v=Math.max(H,v),++g}else p+=a,++g}var W=p-Of,G=$f(o),q=G.horizontalAlign,Y=G.verticalAlign;ed(e.positionedLines,m,q,Y,h,v,a,W,i.length),e.top+=-Y*W,e.bottom=e.top+W,e.left+=-q*h,e.right=e.left+h}function Qf(e,t,r,n,i){if(n||i)for(var a=e[r],o=a.metrics.advance*a.scale,s=(e[r].x+o)*n,l=t;l<=r;l++)e[l].x-=s,e[l].y+=i}function ed(e,t,r,n,i,a,o,s,l){var u=(t-r)*i,c=0;c=a!==o?-s*n-Of:(-n*l+.5)*o;for(var f=0,d=e;f-r/2;){if(--o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;for(var l=[],u=0;sn;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=f.dist(d)}return!0}function cd(e){for(var t=0,r=0;ru){var h=(u-l)/p,v=zr(f.x,d.x,h),m=zr(f.y,d.y,h),g=new nd(v,m,d.angleTo(f),c);return g._round(),!o||ud(e,g,s,o,t)?g:void 0}l+=p}}function hd(e,t,r,n,i,a,o,s,l){var u=fd(n,a,o),c=dd(n,i),f=c*o,d=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-f=0&&b=0&&_=0&&d+u<=c){var w=new nd(b,_,y,h);w._round(),n&&!ud(e,w,a,n,i)||p.push(w)}}f+=g}return s||p.length||o||(p=vd(e,f/2,r,n,i,a,o,!0,l)),p}function md(e,t,r,n,i){for(var o=[],s=0;s=n&&d.x>=n||(f.x>=n?f=new a(n,f.y+(d.y-f.y)*((n-f.x)/(d.x-f.x)))._round():d.x>=n&&(d=new a(n,f.y+(d.y-f.y)*((n-f.x)/(d.x-f.x)))._round()),f.y>=i&&d.y>=i||(f.y>=i?f=new a(f.x+(d.x-f.x)*((i-f.y)/(d.y-f.y)),i)._round():d.y>=i&&(d=new a(f.x+(d.x-f.x)*((i-f.y)/(d.y-f.y)),i)._round()),u&&f.equals(u[u.length-1])||(u=[f],o.push(u)),u.push(d)))))}return o}var gd=Ef;function yd(e,t,r,n){var i=[],o=e.image,s=o.pixelRatio,l=o.paddedRect.w-2*gd,u=o.paddedRect.h-2*gd,c=e.right-e.left,f=e.bottom-e.top,d=o.stretchX||[[0,l]],p=o.stretchY||[[0,u]],h=function(e,t){return e+t[1]-t[0]},v=d.reduce(h,0),m=p.reduce(h,0),g=l-v,y=u-m,x=0,b=v,_=0,w=m,k=0,T=g,M=0,S=y;if(o.content&&n){var A=o.content;x=xd(d,0,A[0]),_=xd(p,0,A[1]),b=xd(d,A[0],A[2]),w=xd(p,A[1],A[3]),k=A[0]-x,M=A[1]-_,T=A[2]-A[0]-b,S=A[3]-A[1]-w}var C=function(n,i,l,u){var d=_d(n.stretch-x,b,c,e.left),p=wd(n.fixed-k,T,n.stretch,v),h=_d(i.stretch-_,w,f,e.top),g=wd(i.fixed-M,S,i.stretch,m),y=_d(l.stretch-x,b,c,e.left),A=wd(l.fixed-k,T,l.stretch,v),C=_d(u.stretch-_,w,f,e.top),E=wd(u.fixed-M,S,u.stretch,m),P=new a(d,h),L=new a(y,h),I=new a(y,C),R=new a(d,C),O=new a(p/s,g/s),D=new a(A/s,E/s),z=t*Math.PI/180;if(z){var F=Math.sin(z),j=Math.cos(z),N=[j,-F,F,j];P._matMult(N),L._matMult(N),R._matMult(N),I._matMult(N)}var Z=n.stretch+n.fixed,B=l.stretch+l.fixed,V=i.stretch+i.fixed,U=u.stretch+u.fixed;return{tl:P,tr:L,bl:R,br:I,tex:{x:o.paddedRect.x+gd+Z,y:o.paddedRect.y+gd+V,w:B-Z,h:U-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:D,minFontScaleX:T/s/c,minFontScaleY:S/s/f,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var E=bd(d,g,v),P=bd(p,y,m),L=0;L0&&(h=Math.max(10,h),this.circleDiameter=h)}else{var v=o.top*s-l,m=o.bottom*s+l,g=o.left*s-l,y=o.right*s+l,x=o.collisionPadding;if(x&&(g-=x[0]*s,v-=x[1]*s,y+=x[2]*s,m+=x[3]*s),c){var b=new a(g,v),_=new a(y,v),w=new a(g,m),k=new a(y,m),T=c*Math.PI/180;b._rotate(T),_._rotate(T),w._rotate(T),k._rotate(T),g=Math.min(b.x,_.x,w.x,k.x),y=Math.max(b.x,_.x,w.x,k.x),v=Math.min(b.y,_.y,w.y,k.y),m=Math.max(b.y,_.y,w.y,k.y)}e.emplaceBack(t.x,t.y,g,v,y,m,r,n,i)}this.boxEndIndex=e.length},Md=function(e,t){if(void 0===e&&(e=[]),void 0===t&&(t=Sd),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Sd(e,t){return et?1:0}function Ad(e,t,r){void 0===t&&(t=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=e[0],u=0;uo)&&(o=c.x),(!u||c.y>s)&&(s=c.y)}var f=o-n,d=s-i,p=Math.min(f,d),h=p/2,v=new Md([],Cd);if(0===p)return new a(n,i);for(var m=n;my.d||!y.d)&&(y=b,r&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-y.d<=t||(h=b.h/2,v.push(new Ed(b.p.x-h,b.p.y-h,h,e)),v.push(new Ed(b.p.x+h,b.p.y-h,h,e)),v.push(new Ed(b.p.x-h,b.p.y+h,h,e)),v.push(new Ed(b.p.x+h,b.p.y+h,h,e)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+y.d)),y.p}function Cd(e,t){return t.max-e.max}function Ed(e,t,r,n){this.p=new a(e,t),this.h=r,this.d=Pd(this.p,n),this.max=this.d+this.h*Math.SQRT2}function Pd(e,t){for(var r=!1,n=1/0,i=0;ie.y!==c.y>e.y&&e.x<(c.x-u.x)*(e.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,Gs(e,u,c))}return(r?1:-1)*Math.sqrt(n)}function Ld(e){for(var t=0,r=0,n=0,i=e[0],a=0,o=i.length,s=o-1;a0&&(this.data[0]=t,this._down(0)),e}},Md.prototype.peek=function(){return this.data[0]},Md.prototype._up=function(e){for(var t=this,r=t.data,n=t.compare,i=r[e];e>0;){var a=e-1>>1,o=r[a];if(n(i,o)>=0)break;r[e]=o,e=a}r[e]=i},Md.prototype._down=function(e){for(var t=this,r=t.data,n=t.compare,i=this.length>>1,a=r[e];e=0)break;r[e]=s,e=o}r[e]=a};var Id=7,Rd=Number.POSITIVE_INFINITY;function Od(e,t){function r(e,t){var r=0,n=0;t<0&&(t=0);var i=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":n=i-Id;break;case"bottom-right":case"bottom-left":n=-i+Id;break;case"bottom":n=-t+Id;break;case"top":n=t-Id}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}function n(e,t,r){var n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-Id;break;case"bottom-right":case"bottom-left":case"bottom":i=-r+Id}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}return t[1]!==Rd?n(e,t[0],t[1]):r(e,t[0])}function Dd(e,t,r,n,i,a,o){e.createArrays();var s=512*e.overscaling;e.tilePixelRatio=Is/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,u=e.layers[0]._unevaluatedLayout._values,c={};if("composite"===e.textSizeData.kind){var f=e.textSizeData,d=f.minZoom,p=f.maxZoom;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new Ya(d),o),u["text-size"].possiblyEvaluate(new Ya(p),o)]}if("composite"===e.iconSizeData.kind){var h=e.iconSizeData,v=h.minZoom,m=h.maxZoom;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new Ya(v),o),u["icon-size"].possiblyEvaluate(new Ya(m),o)]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new Ya(e.zoom+1),o),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new Ya(e.zoom+1),o),c.textMaxSize=u["text-size"].possiblyEvaluate(new Ya(18));for(var g=l.get("text-line-height")*Wc,y="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),b=l.get("text-size"),_=function(){var a=k[w],s=l.get("text-font").evaluate(a,{},o).join(","),u=b.evaluate(a,{},o),f=c.layoutTextSize.evaluate(a,{},o),d=c.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},h=a.text,v=[0,0];if(h){var m=h.toString(),_=l.get("text-letter-spacing").evaluate(a,{},o)*Wc,T=Ta(m)?_:0,M=l.get("text-anchor").evaluate(a,{},o),S=l.get("text-variable-anchor");if(!S){var A=l.get("text-radial-offset").evaluate(a,{},o);v=A?Od(M,[A*Wc,Rd]):l.get("text-offset").evaluate(a,{},o).map((function(e){return e*Wc}))}var C=y?"center":l.get("text-justify").evaluate(a,{},o),P=l.get("symbol-placement"),L="point"===P?l.get("text-max-width").evaluate(a,{},o)*Wc:0,I=function(){e.allowVerticalPlacement&&ka(m)&&(p.vertical=Bf(h,t,r,i,s,L,g,M,"left",T,v,Rf.vertical,!0,P,f,u))};if(!y&&S){for(var R="auto"===C?S.map((function(e){return zd(e)})):[C],O=!1,D=0;D=Is||f.y<0||f.y>=Is||Vd(e,f,s,r,n,i,d,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,y,w,M,l,b,k,S,h,t,a,u,c,o)};if("line"===A)for(var L=0,I=md(t.geometry,0,0,Is,Is);L1){var Z=pd(N,T,r.vertical||v,n,m,x);Z&&P(N,Z)}}else if("Polygon"===t.type)for(var B=0,V=Du(t.geometry,0);BNd&&E(e.layerIds[0]+': Value for "text-size" is >= '+jd+'. Reduce your "text-size".'):"composite"===m.kind&&((g=[id*p.compositeTextSizes[0].evaluate(o,{},h),id*p.compositeTextSizes[1].evaluate(o,{},h)])[0]>Nd||g[1]>Nd)&&E(e.layerIds[0]+': Value for "text-size" is >= '+jd+'. Reduce your "text-size".'),e.addSymbols(e.text,v,g,s,a,o,u,t,l.lineStartIndex,l.lineLength,d,h);for(var y=0,x=c;yNd&&E(e.layerIds[0]+': Value for "icon-size" is >= '+jd+'. Reduce your "icon-size".'):"composite"===Y.kind&&((X=[id*_.compositeIconSizes[0].evaluate(b,{},k),id*_.compositeIconSizes[1].evaluate(b,{},k)])[0]>Nd||X[1]>Nd)&&E(e.layerIds[0]+': Value for "icon-size" is >= '+jd+'. Reduce your "icon-size".'),e.addSymbols(e.icon,G,X,x,y,b,!1,t,L.lineStartIndex,L.lineLength,-1,k),z=e.icon.placedSymbolArray.length-1,q&&(R=4*q.length,e.addSymbols(e.icon,q,X,x,y,b,Rf.vertical,t,L.lineStartIndex,L.lineLength,-1,k),F=e.icon.placedSymbolArray.length-1)}for(var K in n.horizontal){var $=n.horizontal[K];if(!S){N=is($.text);var J=s.layout.get("text-rotate").evaluate(b,{},k);S=new Td(l,t,u,c,f,$,d,p,h,J)}var Q=1===$.positionedLines.length;if(O+=Zd(e,t,$,a,s,h,b,v,L,n.vertical?Rf.horizontal:Rf.horizontalOnly,Q?Object.keys(n.horizontal):[K],j,z,_,k),Q)break}n.vertical&&(D+=Zd(e,t,n.vertical,a,s,h,b,v,L,Rf.vertical,["vertical"],j,F,_,k));var ee=S?S.boxStartIndex:e.collisionBoxArray.length,te=S?S.boxEndIndex:e.collisionBoxArray.length,re=C?C.boxStartIndex:e.collisionBoxArray.length,ne=C?C.boxEndIndex:e.collisionBoxArray.length,ie=A?A.boxStartIndex:e.collisionBoxArray.length,ae=A?A.boxEndIndex:e.collisionBoxArray.length,oe=P?P.boxStartIndex:e.collisionBoxArray.length,se=P?P.boxEndIndex:e.collisionBoxArray.length,le=-1,ue=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};le=ue(S,le),le=ue(C,le),le=ue(A,le);var ce=(le=ue(P,le))>-1?1:0;ce&&(le*=T/Wc),e.glyphOffsetArray.length>=$d.MAX_GLYPHS&&E("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,j.right>=0?j.right:-1,j.center>=0?j.center:-1,j.left>=0?j.left:-1,j.vertical||-1,z,F,N,ee,te,re,ne,ie,ae,oe,se,u,O,D,I,R,ce,0,d,Z,B,le)}function Ud(e,t,r,n){var i=e.compareText;if(t in i){for(var a=i[t],o=a.length-1;o>=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],l||u){for(var f=t.iconDependencies,d=t.glyphDependencies,p=t.availableImages,h=new Ya(this.zoom),v=0,m=e;v=0;for(var R=0,O=T.sections;R=0;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=t[s-1].dist(t[s]));for(var l=0;l0},$d.prototype.hasIconData=function(){return this.icon.segments.get().length>0},$d.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},$d.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},$d.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},$d.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(e)===r&&t.addIndicesForPlacedSymbol(t.text,e)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},va("SymbolBucket",$d,{omit:["layers","collisionBoxArray","features","compareText"]}),$d.MAX_GLYPHS=65535,$d.addDynamicAttributes=qd;var Qd=new lo({"symbol-placement":new no(lt.layout_symbol["symbol-placement"]),"symbol-spacing":new no(lt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new no(lt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new io(lt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new no(lt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new no(lt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new no(lt.layout_symbol["icon-ignore-placement"]),"icon-optional":new no(lt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new no(lt.layout_symbol["icon-rotation-alignment"]),"icon-size":new io(lt.layout_symbol["icon-size"]),"icon-text-fit":new no(lt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new no(lt.layout_symbol["icon-text-fit-padding"]),"icon-image":new io(lt.layout_symbol["icon-image"]),"icon-rotate":new io(lt.layout_symbol["icon-rotate"]),"icon-padding":new no(lt.layout_symbol["icon-padding"]),"icon-keep-upright":new no(lt.layout_symbol["icon-keep-upright"]),"icon-offset":new io(lt.layout_symbol["icon-offset"]),"icon-anchor":new io(lt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new no(lt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new no(lt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new no(lt.layout_symbol["text-rotation-alignment"]),"text-field":new io(lt.layout_symbol["text-field"]),"text-font":new io(lt.layout_symbol["text-font"]),"text-size":new io(lt.layout_symbol["text-size"]),"text-max-width":new io(lt.layout_symbol["text-max-width"]),"text-line-height":new no(lt.layout_symbol["text-line-height"]),"text-letter-spacing":new io(lt.layout_symbol["text-letter-spacing"]),"text-justify":new io(lt.layout_symbol["text-justify"]),"text-radial-offset":new io(lt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new no(lt.layout_symbol["text-variable-anchor"]),"text-anchor":new io(lt.layout_symbol["text-anchor"]),"text-max-angle":new no(lt.layout_symbol["text-max-angle"]),"text-writing-mode":new no(lt.layout_symbol["text-writing-mode"]),"text-rotate":new io(lt.layout_symbol["text-rotate"]),"text-padding":new no(lt.layout_symbol["text-padding"]),"text-keep-upright":new no(lt.layout_symbol["text-keep-upright"]),"text-transform":new io(lt.layout_symbol["text-transform"]),"text-offset":new io(lt.layout_symbol["text-offset"]),"text-allow-overlap":new no(lt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new no(lt.layout_symbol["text-ignore-placement"]),"text-optional":new no(lt.layout_symbol["text-optional"])}),ep={paint:new lo({"icon-opacity":new io(lt.paint_symbol["icon-opacity"]),"icon-color":new io(lt.paint_symbol["icon-color"]),"icon-halo-color":new io(lt.paint_symbol["icon-halo-color"]),"icon-halo-width":new io(lt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new io(lt.paint_symbol["icon-halo-blur"]),"icon-translate":new no(lt.paint_symbol["icon-translate"]),"icon-translate-anchor":new no(lt.paint_symbol["icon-translate-anchor"]),"text-opacity":new io(lt.paint_symbol["text-opacity"]),"text-color":new io(lt.paint_symbol["text-color"],{runtimeType:bt,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new io(lt.paint_symbol["text-halo-color"]),"text-halo-width":new io(lt.paint_symbol["text-halo-width"]),"text-halo-blur":new io(lt.paint_symbol["text-halo-blur"]),"text-translate":new no(lt.paint_symbol["text-translate"]),"text-translate-anchor":new no(lt.paint_symbol["text-translate-anchor"])}),layout:Qd},tp=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:mt,this.defaultValue=e};tp.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},tp.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},tp.prototype.outputDefined=function(){return!1},tp.prototype.serialize=function(){return null},va("FormatSectionOverride",tp,{omit:["defaultValue"]});var rp=function(e){function t(t){e.call(this,t,ep)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){if(e.prototype.recalculate.call(this,t,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},yp.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(""===t.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else R()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},yp.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},yp.prototype.processTask=function(e,t){var r=this;if(""===t.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n(ba(t.error)):n(null,ba(t.data)))}else{var i=!1,a=z(this.globalScope)?void 0:[],o=t.hasCallback?function(t,n){i=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"",sourceMapId:r.mapId,error:t?xa(t):null,data:xa(n,a)},a)}:function(e){i=!0},s=null,l=ba(t.data);if(this.parent[t.type])s=this.parent[t.type](t.sourceMapId,l,o);else if(this.parent.getWorkerSource){var u=t.type.split(".");s=this.parent.getWorkerSource(t.sourceMapId,u[0],l.source)[u[1]](l,o)}else o(new Error("Could not find function "+t.type));!i&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}},yp.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var _p=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};_p.prototype.setNorthEast=function(e){return this._ne=e instanceof kp?new kp(e.lng,e.lat):kp.convert(e),this},_p.prototype.setSouthWest=function(e){return this._sw=e instanceof kp?new kp(e.lng,e.lat):kp.convert(e),this},_p.prototype.extend=function(e){var t,r,n=this._sw,i=this._ne;if(e instanceof kp)t=e,r=e;else{if(!(e instanceof _p)){if(Array.isArray(e)){if(4===e.length||e.every(Array.isArray)){var a=e;return this.extend(_p.convert(a))}var o=e;return this.extend(kp.convert(o))}return this}if(t=e._sw,r=e._ne,!t||!r)return this}return n||i?(n.lng=Math.min(t.lng,n.lng),n.lat=Math.min(t.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new kp(t.lng,t.lat),this._ne=new kp(r.lng,r.lat)),this},_p.prototype.getCenter=function(){return new kp((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},_p.prototype.getSouthWest=function(){return this._sw},_p.prototype.getNorthEast=function(){return this._ne},_p.prototype.getNorthWest=function(){return new kp(this.getWest(),this.getNorth())},_p.prototype.getSouthEast=function(){return new kp(this.getEast(),this.getSouth())},_p.prototype.getWest=function(){return this._sw.lng},_p.prototype.getSouth=function(){return this._sw.lat},_p.prototype.getEast=function(){return this._ne.lng},_p.prototype.getNorth=function(){return this._ne.lat},_p.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},_p.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},_p.prototype.isEmpty=function(){return!(this._sw&&this._ne)},_p.prototype.contains=function(e){var t=kp.convert(e),r=t.lng,n=t.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},_p.convert=function(e){return!e||e instanceof _p?e:new _p(e)};var wp=6371008.8,kp=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};kp.prototype.wrap=function(){return new kp(d(this.lng,-180,180),this.lat)},kp.prototype.toArray=function(){return[this.lng,this.lat]},kp.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},kp.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return wp*Math.acos(Math.min(i,1))},kp.prototype.toBounds=function(e){void 0===e&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new _p(new kp(this.lng-r,this.lat-t),new kp(this.lng+r,this.lat+t))},kp.convert=function(e){if(e instanceof kp)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new kp(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"===typeof e&&null!==e)return new kp(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Tp=2*Math.PI*wp;function Mp(e){return Tp*Math.cos(e*Math.PI/180)}function Sp(e){return(180+e)/360}function Ap(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Cp(e,t){return e/Mp(t)}function Ep(e){return 360*e-180}function Pp(e){var t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function Lp(e,t){return e*Mp(Pp(t))}function Ip(e){return 1/Math.cos(e*Math.PI/180)}var Rp=function(e,t,r){void 0===r&&(r=0),this.x=+e,this.y=+t,this.z=+r};Rp.fromLngLat=function(e,t){void 0===t&&(t=0);var r=kp.convert(e);return new Rp(Sp(r.lng),Ap(r.lat),Cp(t,r.lat))},Rp.prototype.toLngLat=function(){return new kp(Ep(this.x),Pp(this.y))},Rp.prototype.toAltitude=function(){return Lp(this.z,this.y)},Rp.prototype.meterInMercatorCoordinateUnits=function(){return 1/Tp*Ip(Pp(this.y))};var Op=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Fp(0,e,e,t,r)};Op.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Op.prototype.url=function(e,t){var r=xp(this.x,this.y,this.z),n=jp(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)},Op.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new a((e.x*t-this.x)*Is,(e.y*t-this.y)*Is)},Op.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Dp=function(e,t){this.wrap=e,this.canonical=t,this.key=Fp(e,t.z,t.z,t.x,t.y)},zp=function(e,t,r,n,i){this.overscaledZ=e,this.wrap=t,this.canonical=new Op(r,+n,+i),this.key=Fp(t,e,r,n,i)};function Fp(e,t,r,n,i){(e*=2)<0&&(e=-1*e-1);var a=1<0;a--)i+=(t&(n=1<this.canonical.z?new zp(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new zp(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},zp.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Fp(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Fp(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},zp.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t},zp.prototype.children=function(e){if(this.overscaledZ>=e)return[new zp(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new zp(t,this.wrap,t,r,n),new zp(t,this.wrap,t,r+1,n),new zp(t,this.wrap,t,r,n+1),new zp(t,this.wrap,t,r+1,n+1)]},zp.prototype.isLessThan=function(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Np.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Np.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Np.prototype.getPixels=function(){return new Hl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Np.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var n=t*this.dim,i=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-t*this.dim,l=-r*this.dim,u=a;u=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}},Wp.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new nc.VectorTile(new qc(this.rawTileData)).layers,this.sourceLayerCoder=new Bp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Wp.prototype.query=function(e,t,r,n){var i=this;this.loadVTLayers();for(var a=e.params||{},o=Is/e.tileSize/e.scale,s=Pi(a.filter),l=e.queryGeometry,u=e.queryPadding*o,c=qp(l),f=this.grid.query(c.minX-u,c.minY-u,c.maxX+u,c.maxY+u),d=qp(e.cameraQueryGeometry),p=0,h=this.grid3D.query(d.minX-u,d.minY-u,d.maxX+u,d.maxY+u,(function(t,r,n,i){return Xs(e.cameraQueryGeometry,t-u,r-u,n+u,i+u)}));pn)i=!1;else if(t)if(this.expirationTime=C.maxzoom||"none"!==C.visibility&&(l(A,this.zoom,n),(v[C.id]=C.createBucket({index:c.bucketLayerIDs.length,layers:A,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(_,m,this.tileID.canonical),c.bucketLayerIDs.push(A.map((function(e){return e.id}))))}}}var E=e.mapObject(m.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(E).length?i.send("getGlyphs",{uid:this.uid,stacks:E},(function(e,t){f||(f=e,d=t,I.call(s))})):d={};var P=Object.keys(m.iconDependencies);P.length?i.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){f||(f=e,p=t,I.call(s))})):p={};var L=Object.keys(m.patternDependencies);function I(){if(f)return a(f);if(d&&p&&h){var t=new o(d),r=new e.ImageAtlas(p,h);for(var i in v){var s=v[i];s instanceof e.SymbolBucket?(l(s.layers,this.zoom,n),e.performSymbolLayout(s,d,t.positions,p,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):s.hasPattern&&(s instanceof e.LineBucket||s instanceof e.FillBucket||s instanceof e.FillExtrusionBucket)&&(l(s.layers,this.zoom,n),s.addFeatures(m,this.tileID.canonical,r.patternPositions))}this.status="done",a(null,{buckets:e.values(v).filter((function(e){return!e.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?t.positions:null})}}L.length?i.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){f||(f=e,h=t,I.call(s))})):h={},I.call(this)};var c=function(e,t,r,n){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=n||u,this.loading={},this.loaded={}};c.prototype.loadTile=function(t,r){var n=this,i=t.uid;this.loading||(this.loading={});var a=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),o=this.loading[i]=new s(t);o.abort=this.loadVectorData(t,(function(t,s){if(delete n.loading[i],t||!s)return o.status="done",n.loaded[i]=o,r(t);var l=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl);var c={};if(a){var f=a.finish();f&&(c.resourceTiming=JSON.parse(JSON.stringify(f)))}o.vectorTile=s.vectorTile,o.parse(s.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(t,n){if(t||!n)return r(t);r(null,e.extend({rawTileData:l.slice(0)},n,u,c))})),n.loaded=n.loaded||{},n.loaded[i]=o}))},c.prototype.reloadTile=function(e,t){var r=this,n=this.loaded,i=e.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),t(e,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},c.prototype.abortTile=function(e,t){var r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),t()},c.prototype.removeTile=function(e,t){var r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t()};var f=e.window.ImageBitmap,d=function(){this.loaded={}};d.prototype.loadTile=function(t,r){var n=t.uid,i=t.encoding,a=t.rawImageData,o=f&&a instanceof f?this.getImageData(a):a,s=new e.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},d.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)},d.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]};var p=h;function h(e,t){var r,n=e&&e.type;if("FeatureCollection"===n)for(r=0;r=0!==!!t&&e.reverse()}var g=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,y=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};y.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,n=this._feature.geometry;r>31}function z(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,a=0,o=r.length,s=0;s>1;N(e,t,o,n,i,a%2),j(e,t,r,n,o-1,a+1),j(e,t,r,o+1,i,a+1)}}function N(e,t,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);N(e,t,r,Math.max(n,Math.floor(r-s*u/o+c)),Math.min(i,Math.floor(r+(o-s)*u/o+c)),a)}var f=t[2*r+a],d=n,p=i;for(Z(e,t,n,r),t[2*i+a]>f&&Z(e,t,n,i);df;)p--}t[2*n+a]===f?Z(e,t,n,p):Z(e,t,++p,i),p<=r&&(n=p+1),r<=p&&(i=p-1)}}function Z(e,t,r,n){B(e,r,n),B(t,2*r,2*n),B(t,2*r+1,2*n+1)}function B(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function V(e,t,r,n,i,a,o){for(var s,l,u=[0,e.length-1,0],c=[];u.length;){var f=u.pop(),d=u.pop(),p=u.pop();if(d-p<=o)for(var h=p;h<=d;h++)s=t[2*h],l=t[2*h+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(e[h]);else{var v=Math.floor((p+d)/2);s=t[2*v],l=t[2*v+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(e[v]);var m=(f+1)%2;(0===f?r<=s:n<=l)&&(u.push(p),u.push(v-1),u.push(m)),(0===f?i>=s:a>=l)&&(u.push(v+1),u.push(d),u.push(m))}}return c}function U(e,t,r,n,i,a){for(var o=[0,e.length-1,0],s=[],l=i*i;o.length;){var u=o.pop(),c=o.pop(),f=o.pop();if(c-f<=a)for(var d=f;d<=c;d++)H(t[2*d],t[2*d+1],r,n)<=l&&s.push(e[d]);else{var p=Math.floor((f+c)/2),h=t[2*p],v=t[2*p+1];H(h,v,r,n)<=l&&s.push(e[p]);var m=(u+1)%2;(0===u?r-i<=h:n-i<=v)&&(o.push(f),o.push(p-1),o.push(m)),(0===u?r+i>=h:n+i>=v)&&(o.push(p+1),o.push(c),o.push(m))}}return s}function H(e,t,r,n){var i=e-r,a=t-n;return i*i+a*a}T.fromVectorTileJs=M,T.fromGeojsonVt=S,T.GeoJSONWrapper=A;var W=function(e){return e[0]},G=function(e){return e[1]},q=function(e,t,r,n,i){void 0===t&&(t=W),void 0===r&&(r=G),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=e;for(var a=e.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(e.length),s=this.coords=new i(2*e.length),l=0;l=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return ie(ie({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function ee(e){return e/360+.5}function te(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function re(e){return 360*(e-.5)}function ne(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function ie(e,t){for(var r in t)e[r]=t[r];return e}function ae(e){return e.x}function oe(e){return e.y}function se(e,t,r,n){for(var i,a=n,o=r-t>>1,s=r-t,l=e[t],u=e[t+1],c=e[r],f=e[r+1],d=t+3;da)i=d,a=p;else if(p===a){var h=Math.abs(d-o);hn&&(i-t>3&&se(e,t,i,n),e[i+2]=a,r-i>3&&se(e,i,r,n))}function le(e,t,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((e-r)*o+(t-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=e-r)*o+(s=t-n)*s}function ue(e,t,r,n){var i={id:"undefined"===typeof e?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return ce(i),i}function ce(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)fe(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*u-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(u-a,2))),i=l,a=u}var c=t.length-3;t[2]=1,se(t,0,c,r),t[c+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function me(e,t,r,n){for(var i=0;i1?1:r}function xe(e,t,r,n,i,a,o,s){if(n/=t,a>=(r/=t)&&o=n)return null;for(var l=[],u=0;u=r&&h=n)){var v=[];if("Point"===d||"MultiPoint"===d)be(f,v,r,n,i);else if("LineString"===d)_e(f,v,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===d)ke(f,v,r,n,i,!1);else if("Polygon"===d)ke(f,v,r,n,i,!0);else if("MultiPolygon"===d)for(var m=0;m=r&&o<=n&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function _e(e,t,r,n,i,a,o){for(var s,l,u=we(e),c=0===i?Me:Se,f=e.start,d=0;dr&&(l=c(u,p,h,m,g,r),o&&(u.start=f+s*l)):y>n?x=r&&(l=c(u,p,h,m,g,r),b=!0),x>n&&y<=n&&(l=c(u,p,h,m,g,n),b=!0),!a&&b&&(o&&(u.end=f+s*l),t.push(u),u=we(e)),o&&(f+=s)}var _=e.length-3;p=e[_],h=e[_+1],v=e[_+2],(y=0===i?p:h)>=r&&y<=n&&Te(u,p,h,v),_=u.length-3,a&&_>=3&&(u[_]!==u[0]||u[_+1]!==u[1])&&Te(u,u[0],u[1],u[2]),u.length&&t.push(u)}function we(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ke(e,t,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=c),f>o.maxY&&(o.maxY=f)}return o}function Re(e,t,r,n){var i=t.geometry,a=t.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&t.size<(i?o:n))r.numPoints+=t.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;i&&De(s,a),e.push(s)}}function De(e,t){for(var r=0,n=0,i=e.length,a=i-2;n0===t)for(n=0,i=e.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=de(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=Ae(n,t)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function je(e,t,r){return 32*((1<=n;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new q(s,ae,oe,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},X.prototype.getClusters=function(e,t){var r=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],t),s=this.getClusters([-180,n,i,a],t);return o.concat(s)}for(var l=this.trees[this._limitZoom(t)],u=[],c=0,f=l.range(ee(r),te(a),ee(i),te(n));c1?this._map(u,!0):null,m=(l<<5)+(t+1)+this.points.length,g=0,y=f;g>5},X.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},X.prototype._map=function(e,t){if(e.numPoints)return t?ie({},e.properties):e.properties;var r=this.points[e.index].properties,n=this.options.map(r);return t&&n===r?ie({},n):n},Fe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Fe.prototype.splitTile=function(e,t,r,n,i,a,o){for(var s=[e,t,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var c=1<1&&console.time("creation"),d=this.tiles[f]=Ie(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var p="z"+t;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(d.source=e,i){if(t===l.maxZoom||t===i)continue;var h=1<1&&console.time("clipping");var v,m,g,y,x,b,_=.5*l.buffer/l.extent,w=.5-_,k=.5+_,T=1+_;v=m=g=y=null,x=xe(e,c,r-_,r+k,0,d.minX,d.maxX,l),b=xe(e,c,r+w,r+T,0,d.minX,d.maxX,l),e=null,x&&(v=xe(x,c,n-_,n+k,1,d.minY,d.maxY,l),m=xe(x,c,n+w,n+T,1,d.minY,d.maxY,l),x=null),b&&(g=xe(b,c,n-_,n+k,1,d.minY,d.maxY,l),y=xe(b,c,n+w,n+T,1,d.minY,d.maxY,l),b=null),u>1&&console.timeEnd("clipping"),s.push(v||[],t+1,2*r,2*n),s.push(m||[],t+1,2*r,2*n+1),s.push(g||[],t+1,2*r+1,2*n),s.push(y||[],t+1,2*r+1,2*n+1)}}},Fe.prototype.getTile=function(e,t,r){var n=this.options,i=n.extent,a=n.debug;if(e<0||e>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,u=e,c=t,f=r;!l&&u>0;)u--,c=Math.floor(c/2),f=Math.floor(f/2),l=this.tiles[je(u,c,f)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",u,c,f),a>1&&console.time("drilling down"),this.splitTile(l.source,u,c,f,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?Pe(this.tiles[s],i):null):null};var Be=function(t){function r(e,r,n,i){t.call(this,e,r,n,Ze),i&&(this.loadGeoJSON=i)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new e.RequestPerformance(n.request);this.loadGeoJSON(n,(function(e,a){if(e||!a)return r(e);if("object"!==typeof a)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));p(a,!0);try{t._geoJSONIndex=n.cluster?new X(Ve(n)).load(a.features):ze(a,n.geojsonVtOptions)}catch(e){return r(e)}t.loaded={};var o={};if(i){var s=i.finish();s&&(o.resourceTiming={},o.resourceTiming[n.source]=JSON.parse(JSON.stringify(s)))}r(null,o)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(e,r){var n=this.loaded,i=e.uid;return n&&n[i]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},r.prototype.loadGeoJSON=function(t,r){if(t.request)e.getJSON(t.request,r);else{if("string"!==typeof t.data)return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(t.data))}catch(n){return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()},r.prototype.getClusterExpansionZoom=function(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(r){t(r)}},r.prototype.getClusterChildren=function(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(r){t(r)}},r.prototype.getClusterLeaves=function(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(r){t(r)}},r}(c);function Ve(t){var r=t.superclusterOptions,n=t.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),u=0,c=l;u1?"@2x":"",l=e.getJSON(r.transformRequest(r.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),(function(e,t){l=null,o||(o=e,i=t,c())})),u=e.getImage(r.transformRequest(r.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),(function(e,t){u=null,o||(o=e,a=t,c())}));function c(){if(o)n(o);else if(i&&a){var t=e.browser.getImageData(a),r={};for(var s in i){var l=i[s],u=l.width,c=l.height,f=l.x,d=l.y,p=l.sdf,h=l.pixelRatio,v=l.stretchX,m=l.stretchY,g=l.content,y=new e.RGBAImage({width:u,height:c});e.RGBAImage.copy(t,y,{x:f,y:d},{x:0,y:0},{width:u,height:c}),r[s]={data:y,pixelRatio:h,sdf:p,stretchX:v,stretchY:m,content:g}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}function d(e){var t=e.userImage;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}r.suppressClick=function(){e.window.addEventListener("click",c,!0),e.window.setTimeout((function(){e.window.removeEventListener("click",c,!0)}),0)},r.mousePos=function(t,r){var n=t.getBoundingClientRect();return new e.Point(r.clientX-n.left-t.clientLeft,r.clientY-n.top-t.clientTop)},r.touchPos=function(t,r){for(var n=t.getBoundingClientRect(),i=[],a=0;a=0?0:t.button},r.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var p=1,h=function(t){function r(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,r=this.requestors;t=0?1.2:1))}function b(e,t,r,n,i,a,o){for(var s=0;s65535)t(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])t(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],w.loadGlyphRange(r,s,n.url,n.requestManager,(function(e,t){if(t){for(var r in t)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=t[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=e[++s]);var c=Math.abs(u-l.left),f=Math.abs(u-l.right),d=Math.min(c,f),p=void 0,h=i/r*(n+1);if(l.isDash){var v=n-Math.abs(h);p=Math.sqrt(d*d+v*v)}else p=n-Math.sqrt(d*d+h*h);this.data[o+u]=Math.max(0,Math.min(255,p+128))}},A.prototype.addRegularDash=function(e){for(var t=e.length-1;t>=0;--t){var r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}var i=e[0],a=e[e.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=e[s],u=0;u1&&(l=e[++s]);var c=Math.abs(u-l.left),f=Math.abs(u-l.right),d=Math.min(c,f),p=l.isDash?d:-d;this.data[o+u]=Math.max(0,Math.min(255,p+128))}},A.prototype.addDash=function(t,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n.minX&&t.x=n.minY&&t.y0&&(l[new e.OverscaledTileID(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new e.Event("data",n))}}))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setData=function(t){var r=this;return this._data=t,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)r.fire(new e.ErrorEvent(t));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new e.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this},r.prototype.getClusterChildren=function(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this},r.prototype.getClusterLeaves=function(e,t,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:r},n),this},r.prototype._updateWorkerData=function(t){var r=this;this._loaded=!1;var n=e.extend({},this.workerOptions),i=this._data;"string"===typeof i?(n.request=this.map._requestManager.transformRequest(e.browser.resolveURL(i),e.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(e,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),t(e))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(t,r){var n=this,i=t.actor?"reloadTile":"loadTile";t.actor=this.actor;var a={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(i,a,(function(e,a){return delete t.request,t.unloadVectorData(),t.aborted?r(null):e?r(e):(t.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0},r.prototype.unloadTile=function(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(e.Evented),D=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),z=function(t){function r(e,r,n,i){t.call(this),this.id=e,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(t,r){var n=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new e.ErrorEvent(i)):a&&(n.image=a,t&&(n.coordinates=t),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(e){var t=this;return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,(function(){t.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setCoordinates=function(t){var r=this;this.coordinates=t;var n=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=F(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map((function(e){return r.tileID.getTilePoint(e)._round()}));return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,D.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.loadTile=function(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(e.Evented);function F(t){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=t;or.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=t}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,D.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(z),N=function(t){function r(r,n,i,a){t.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(e){return!Array.isArray(e)||2!==e.length||e.some((function(e){return"number"!==typeof e}))}))||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!==typeof n.animate&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"===typeof n.canvas||n.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,D.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var e=0,t=[this.canvas.width,this.canvas.height];ethis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},$.prototype.has=function(e){return e.wrapped().key in this.data},$.prototype.getAndRemove=function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null},$.prototype._getAndRemoveByKey=function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value},$.prototype.getByKey=function(e){var t=this.data[e];return t?t[0].value:null},$.prototype.get=function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null},$.prototype.remove=function(e,t){if(!this.has(e))return this;var r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},$.prototype.setMaxSize=function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this},$.prototype.filter=function(e){var t=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(e){return this.getTileByID(e.key)},r.prototype.getTileByID=function(e){return this._tiles[e]},r.prototype._retainLoadedChildren=function(e,t,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>t+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>t;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(e,t){if(e.key in this._loadedParentTiles){var r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(var n=e.overscaledZ-1;n>=t;n--){var i=e.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)},r.prototype.updateCacheSize=function(e){var t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),r=5,n=Math.floor(t*r),i="number"===typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(e){var t=(e-(void 0===this._prevLng?e:this._prevLng))/360,r=Math.round(t);if(this._prevLng=e,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(t){var n=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(e){return n._source.hasTile(e)})))):i=[];var a=t.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Je(this._source.type)){for(var u={},c={},f=0,d=Object.keys(l);fthis._source.maxzoom){var m=h.children(this._source.maxzoom)[0],g=this.getTile(m);if(g&&g.hasData()){n[m.key]=m;continue}}else{var y=h.children(this._source.maxzoom);if(n[y[0].key]&&n[y[1].key]&&n[y[2].key]&&n[y[3].key])continue}for(var x=v.wasRequested(),b=h.overscaledZ-1;b>=a;--b){var _=h.scaledTo(b);if(i[_.key])break;if(i[_.key]=!0,!(v=this.getTile(_))&&x&&(v=this._addTile(_)),v&&(n[_.key]=_,x=v.wasRequested(),v.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],r=void 0,n=this._tiles[e].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=t;a0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))},r.prototype.clearTiles=function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()},r.prototype.tilesIn=function(t,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(t):t,l=t.map((function(e){return o.pointCoordinate(e)})),u=s.map((function(e){return o.pointCoordinate(e)})),c=this.getIds(),f=1/0,d=1/0,p=-1/0,h=-1/0,v=0,m=u;v=0&&g[1].y+m>=0){var y=l.map((function(e){return s.getTilePoint(e)})),x=u.map((function(e){return s.getTilePoint(e)}));a.push({tile:n,tileID:s,queryGeometry:y,cameraQueryGeometry:x,scale:v})}}},x=0;x=e.browser.now())return!0}return!1},r.prototype.setFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.updateState(e,t,r)},r.prototype.removeFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.removeFeatureState(e,t,r)},r.prototype.getFeatureState=function(e,t){return e=e||"_geojsonTileLayer",this._state.getState(e,t)},r.prototype.setDependencies=function(e,t,r){var n=this._tiles[e];n&&n.setDependencies(t,r)},r.prototype.reloadTilesForDependencies=function(e,t){for(var r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(e,t)}))},r}(e.Evented);function $e(e,t){var r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Je(e){return"raster"===e||"image"===e||"video"===e}function Qe(){return new e.window.Worker(cs.workerUrl)}Ke.maxOverzooming=10,Ke.maxUnderzooming=3;var et="mapboxgl_preloaded_worker_pool",tt=function(){this.active={}};tt.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var wt=function(e,t,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(var a=0;a=-t[0]&&r<=t[0]&&n>=-t[1]&&n<=t[1]}function Ct(t,r,n,i,a,o,s,l){var u=i?t.textSizeData:t.iconSizeData,c=e.evaluateSizeForZoom(u,n.transform.zoom),f=[256/n.width*2+1,256/n.height*2+1],d=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;d.clear();for(var p=t.lineVertexArray,h=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,v=n.transform.width/n.transform.height,m=!1,g=0;gMath.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function Lt(t,r,n,i,a,o,s,l,u,c,f,d,p,h){var v,m=r/24,g=t.lineOffsetX*m,y=t.lineOffsetY*m;if(t.numGlyphs>1){var x=t.glyphStartIndex+t.numGlyphs,b=t.lineStartIndex,_=t.lineStartIndex+t.lineLength,w=Et(m,l,g,y,n,f,d,t,u,o,p);if(!w)return{notEnoughRoom:!0};var k=Mt(w.first.point,s).point,T=Mt(w.last.point,s).point;if(i&&!n){var M=Pt(t.writingMode,k,T,h);if(M)return M}v=[w.first];for(var S=t.glyphStartIndex+1;S0?P.point:It(d,E,A,1,a),I=Pt(t.writingMode,A,L,h);if(I)return I}var R=Rt(m*l.getoffsetX(t.glyphStartIndex),g,y,n,f,d,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,u,o,p);if(!R)return{notEnoughRoom:!0};v=[R]}for(var O=0,D=v;O0?1:-1,v=0;i&&(h*=-1,v=Math.PI),h<0&&(v+=Math.PI);for(var m=h>0?l+s:l+s+1,g=a,y=a,x=0,b=0,_=Math.abs(p),w=[];x+b<=_;){if((m+=h)=u)return null;if(y=g,w.push(g),void 0===(g=d[m])){var k=new e.Point(c.getx(m),c.gety(m)),T=Mt(k,f);if(T.signedDistanceFromCamera>0)g=d[m]=T.point;else{var M=m-h;g=It(0===x?o:new e.Point(c.getx(M),c.gety(M)),k,y,_-x+1,f)}}x+=b,b=y.dist(g)}var S=(_-x)/b,A=g.sub(y),C=A.mult(S)._add(y);C._add(A._unit()._perp()._mult(n*h));var E=v+Math.atan2(g.y-y.y,g.x-y.x);return w.push(C),{point:C,angle:E,path:w}}wt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},wt.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},wt.prototype.insertCircle=function(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)},wt.prototype._insertBoxCell=function(e,t,r,n,i,a){this.boxCells[i].push(a)},wt.prototype._insertCircleCell=function(e,t,r,n,i,a){this.circleCells[i].push(a)},wt.prototype._query=function(e,t,r,n,i,a){if(r<0||e>this.width||n<0||t>this.height)return!i&&[];var o=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},wt.prototype._queryCircle=function(e,t,r,n,i){var a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var u=[],c={hitTest:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,u,c,i),n?u.length>0:u},wt.prototype.query=function(e,t,r,n,i){return this._query(e,t,r,n,!1,i)},wt.prototype.hitTest=function(e,t,r,n,i){return this._query(e,t,r,n,!0,i)},wt.prototype.hitTestCircle=function(e,t,r,n){return this._queryCircle(e,t,r,!0,n)},wt.prototype._queryCell=function(e,t,r,n,i,a,o,s){var l=o.seenUids,u=this.boxCells[i];if(null!==u)for(var c=this.bboxes,f=0,d=u;f=c[h+0]&&n>=c[h+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:c[h],y1:c[h+1],x2:c[h+2],y2:c[h+3]})}}}var v=this.circleCells[i];if(null!==v)for(var m=this.circles,g=0,y=v;go*o+s*s},wt.prototype._circleAndRectCollide=function(e,t,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;var u=(o-i)/2,c=Math.abs(t-(i+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var f=l-s,d=c-u;return f*f+d*d<=r*r};var Ot=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Dt(e,t){for(var r=0;r=1;I--)L.push(E.path[I]);for(var R=1;R0){for(var F=L[0].clone(),j=L[0].clone(),N=1;N=S.x&&j.x<=A.x&&F.y>=S.y&&j.y<=A.y?[L]:j.xA.x||j.yA.y?[]:e.clipLine([L],S.x,S.y,A.x,A.y)}for(var Z=0,B=z;Z=this.screenRightBoundary||nthis.screenBottomBoundary},jt.prototype.isInsideGrid=function(e,t,r,n){return r>=0&&e=0&&t0?(this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(v=this.prevPlacement.variableOffsets[f.crossTileID].anchor),this.variableOffsets[f.crossTileID]={textOffset:m,width:r,height:n,anchor:e,textBoxScale:i,prevAnchor:v},this.markUsedJustification(d,e,f,p),d.allowVerticalPlacement&&(this.markUsedOrientation(d,p,f),this.placedOrientations[f.crossTileID]=p),{shift:g,placedGlyphBoxes:y}):void 0},Yt.prototype.placeLayerBucketPart=function(t,r,n){var i=this,a=t.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,u=a.textLabelPlaneMatrix,c=a.labelToScreenMatrix,f=a.textPixelRatio,d=a.holdingForFade,p=a.collisionBoxArray,h=a.partiallyEvaluatedTextSize,v=a.collisionGroup,m=s.get("text-optional"),g=s.get("icon-optional"),y=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),_="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),k="viewport-y"===s.get("symbol-z-order"),T=y&&(x||!o.hasIconData()||g),M=x&&(y||!o.hasTextData()||m);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var S=function(t,a){if(!r[t.crossTileID])if(d)i.placements[t.crossTileID]=new Vt(!1,!1,!1);else{var p=!1,k=!1,S=!0,A=null,C={box:null,offscreen:null},E={box:null,offscreen:null},P=null,L=null,I=null,R=0,O=0,D=0;a.textFeatureIndex?R=a.textFeatureIndex:t.useRuntimeCollisionCircles&&(R=t.featureIndex),a.verticalTextFeatureIndex&&(O=a.verticalTextFeatureIndex);var z=a.textBox;if(z){var F=function(r){var n=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[t.crossTileID];a&&(i.placedOrientations[t.crossTileID]=a,n=a,i.markUsedOrientation(o,n,t))}return n},j=function(r,n){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(N=N.filter((function(e){return e!==Z.anchor}))).unshift(Z.anchor)}var B=function(e,r,n){for(var a=e.x2-e.x1,s=e.y2-e.y1,u=t.textBoxScale,c=w&&!x?r:null,d={box:[],offscreen:!1},h=y?2*N.length:N.length,m=0;m=N.length,T=i.attemptAnchorPlacement(g,e,a,s,u,b,_,f,l,v,k,t,o,n,c);if(T&&(d=T.placedGlyphBoxes)&&d.box&&d.box.length){p=!0,A=T.shift;break}}return d};j((function(){return B(z,a.iconBox,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=C&&C.box&&C.box.length;return o.allowVerticalPlacement&&!n&&t.numVerticalGlyphVertices>0&&r?B(r,a.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}})),C&&(p=C.box,S=C.offscreen);var V=F(C&&C.box);if(!p&&i.prevPlacement){var U=i.prevPlacement.variableOffsets[t.crossTileID];U&&(i.variableOffsets[t.crossTileID]=U,i.markUsedJustification(o,U.anchor,t,V))}}else{var H=function(e,r){var n=i.collisionIndex.placeCollisionBox(e,y,f,l,v.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,t),i.placedOrientations[t.crossTileID]=r),n};j((function(){return H(z,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?H(r,e.WritingMode.vertical):{box:null,offscreen:null}})),F(C&&C.box&&C.box.length)}}if(p=(P=C)&&P.box&&P.box.length>0,S=P&&P.offscreen,t.useRuntimeCollisionCircles){var W=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),G=e.evaluateSizeForFeature(o.textSizeData,h,W),q=s.get("text-padding"),Y=t.collisionCircleDiameter;L=i.collisionIndex.placeCollisionCircles(y,W,o.lineVertexArray,o.glyphOffsetArray,G,l,u,c,n,_,v.predicate,Y,q),p=y||L.circles.length>0&&!L.collisionDetected,S=S&&L.offscreen}if(a.iconFeatureIndex&&(D=a.iconFeatureIndex),a.iconBox){var X=function(e){var t=w&&A?qt(e,A.x,A.y,b,_,i.transform.angle):e;return i.collisionIndex.placeCollisionBox(t,x,f,l,v.predicate)};k=E&&E.box&&E.box.length&&a.verticalIconBox?(I=X(a.verticalIconBox)).box.length>0:(I=X(a.iconBox)).box.length>0,S=S&&I.offscreen}var K=m||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,$=g||0===t.numIconVertices;if(K||$?$?K||(k=k&&p):p=k&&p:k=p=k&&p,p&&P&&P.box&&(E&&E.box&&O?i.collisionIndex.insertCollisionBox(P.box,s.get("text-ignore-placement"),o.bucketInstanceId,O,v.ID):i.collisionIndex.insertCollisionBox(P.box,s.get("text-ignore-placement"),o.bucketInstanceId,R,v.ID)),k&&I&&i.collisionIndex.insertCollisionBox(I.box,s.get("icon-ignore-placement"),o.bucketInstanceId,D,v.ID),L&&(p&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),o.bucketInstanceId,R,v.ID),n)){var J=o.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new Ut);for(var ee=0;ee=0;--C){var E=A[C];S(o.symbolInstances.get(E),o.collisionArrays[E])}else for(var P=t.symbolInstanceStart;P=0&&(t.text.placedSymbolArray.get(u).crossTileID=a>=0&&u!==a?0:n.crossTileID)}},Yt.prototype.markUsedOrientation=function(t,r,n){for(var i=r===e.WritingMode.horizontal||r===e.WritingMode.horizontalOnly?r:0,a=r===e.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,x=a.numIconVertices>0,b=i.placedOrientations[a.crossTileID],_=b===e.WritingMode.vertical,w=b===e.WritingMode.horizontal||b===e.WritingMode.horizontalOnly;if(y){var k=nr(g.text),T=_?ir:k;h(t.text,s,T);var M=w?ir:k;h(t.text,l,M);var S=g.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=S||_?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=S||w?1:0);var A=i.variableOffsets[a.crossTileID];A&&i.markUsedJustification(t,A.anchor,a,b);var C=i.placedOrientations[a.crossTileID];C&&(i.markUsedJustification(t,"left",a,C),i.markUsedOrientation(t,C,a))}if(x){var E=nr(g.icon),P=!(d&&a.verticalPlacedIconSymbolIndex&&_);if(a.placedIconSymbolIndex>=0){var L=P?E:ir;h(t.icon,a.numIconVertices,L),t.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=g.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var I=P?ir:E;h(t.icon,a.numVerticalIconVertices,I),t.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden()}}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var R=t.collisionArrays[n];if(R){var O=new e.Point(0,0);if(R.textBox||R.verticalTextBox){var D=!0;if(u){var z=i.variableOffsets[v];z?(O=Gt(z.anchor,z.width,z.height,z.textOffset,z.textBoxScale),c&&O._rotate(f?i.transform.angle:-i.transform.angle)):D=!1}R.textBox&&Xt(t.textCollisionBox.collisionVertexArray,g.text.placed,!D||_,O.x,O.y),R.verticalTextBox&&Xt(t.textCollisionBox.collisionVertexArray,g.text.placed,!D||w,O.x,O.y)}var F=Boolean(!w&&R.verticalIconBox);R.iconBox&&Xt(t.iconCollisionBox.collisionVertexArray,g.icon.placed,F,d?O.x:0,d?O.y:0),R.verticalIconBox&&Xt(t.iconCollisionBox.collisionVertexArray,g.icon.placed,!F,d?O.x:0,d?O.y:0)}}},m=0;me},Yt.prototype.setStale=function(){this.stale=!0};var Kt=Math.pow(2,25),$t=Math.pow(2,24),Jt=Math.pow(2,17),Qt=Math.pow(2,16),er=Math.pow(2,9),tr=Math.pow(2,8),rr=Math.pow(2,1);function nr(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*Kt+t*$t+r*Jt+t*Qt+r*er+t*tr+r*rr+t}var ir=0,ar=function(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ar.prototype.continuePlacement=function(e,t,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new ar(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},or.prototype.commit=function(e){return this.placement.commit(e),this.placement};var sr=512/e.EXTENT/2,lr=function(e,t,r){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;ne.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,i)}else{var u=o[e.scaledTo(Number(a)).key];u&&u.findMatches(t.symbolInstances,e,i)}}for(var c=0;c0)throw new Error("Unimplemented: "+i.map((function(e){return e.command})).join(", ")+".");return n.forEach((function(e){"setTransition"!==e.command&&r[e.command].apply(r,e.args)})),this.stylesheet=t,!0},r.prototype.addImage=function(t,r){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(t,r),this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.fire(new e.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(e,t){this.imageManager.updateImage(e,t)},r.prototype.getImage=function(e){return this.imageManager.getImage(e)},r.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.fire(new e.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(t,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(e.validateStyle.source,"sources."+t,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[t]=new Ke(t,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:t}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'+t+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},r.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},r.prototype.addLayer=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new e.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===t.type){if(dr(this,e.validateCustomStyleLayer(t)))return;a=e.createStyleLayer(t)}else{if("object"===typeof t.source&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateStyle.layer,"layers."+i,t,{arrayIndex:-1},n))return;a=e.createStyleLayer(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(t,r){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==r){var n=this._order.indexOf(t);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(t){this._checkLoaded();var r=this._layers[t];if(r){r.setEventedParent(null);var n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(e){return this._layers[e]},r.prototype.hasLayer=function(e){return e in this._layers},r.prototype.setLayerZoomRange=function(t,r,n){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(t);if(i){if(!e.deepEqual(i.filter,r))return null===r||void 0===r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=e.clone$1(r),this._updateLayer(i)))}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(t){return e.clone$1(this.getLayer(t).filter)},r.prototype.setLayoutProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(t,r){var n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},r.prototype.setFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!==typeof t.id&&"number"!==typeof t.id?this.fire(new e.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(t){this._checkLoaded();var r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,(function(e){return e.serialize()})),layers:this._serializeLayers(this._order)},(function(e){return void 0!==e}))},r.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(e){for(var t=this,r=function(e){return"fill-extrusion"===t._layers[e].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=e;s=0;h--){var v=this._order[h];if(r(v))for(var m=i.length-1;m>=0;m--){var g=i[m].feature;if(n[g.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}",Lr="attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}",Ir="varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}",Rr="attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}",Or="uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}",Dr="attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}",zr="#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Fr="attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}",jr="varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Nr="attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}",Zr="uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Br="uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}",Vr="uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Ur="uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}",Hr="varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Wr="uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}",Gr="uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",qr="uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}",Yr="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Xr="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",Kr="uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",$r="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",Jr="uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Qr="\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}",en="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",tn="\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}",rn="uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",nn="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}",an="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",on="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}",sn="uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",ln="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",un="uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",cn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}",fn="#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",dn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}",pn="#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",hn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}",vn=Bn("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),mn=Bn(yr,xr),gn=Bn(br,_r),yn=Bn(wr,kr),xn=Bn(Tr,Mr),bn=Bn(Sr,Ar),_n=Bn(Cr,Er),wn=Bn(Pr,Lr),kn=Bn(Ir,Rr),Tn=Bn(Or,Dr),Mn=Bn(zr,Fr),Sn=Bn(jr,Nr),An=Bn(Zr,Br),Cn=Bn(Vr,Ur),En=Bn(Hr,Wr),Pn=Bn(Gr,qr),Ln=Bn(Yr,Xr),In=Bn(Kr,$r),Rn=Bn(Jr,Qr),On=Bn(en,tn),Dn=Bn(rn,nn),zn=Bn(an,on),Fn=Bn(sn,ln),jn=Bn(un,cn),Nn=Bn(fn,dn),Zn=Bn(pn,hn);function Bn(e,t){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:e=e.replace(r,(function(e,t,r,i,a){return n[a]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"})),vertexSource:t=t.replace(r,(function(e,t,r,i,a){var o="float"===i?"vec2":"vec4",s=a.match(/color/)?"color":o;return n[a]?"define"===t?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"define"===t?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"}))}}var Vn=Object.freeze({__proto__:null,prelude:vn,background:mn,backgroundPattern:gn,circle:yn,clippingMask:xn,heatmap:bn,heatmapTexture:_n,collisionBox:wn,collisionCircle:kn,debug:Tn,fill:Mn,fillOutline:Sn,fillOutlinePattern:An,fillPattern:Cn,fillExtrusion:En,fillExtrusionPattern:Pn,hillshadePrepare:Ln,hillshade:In,line:Rn,lineGradient:On,linePattern:Dn,lineSDF:zn,raster:Fn,symbolIcon:jn,symbolSDF:Nn,symbolTextAndIcon:Zn}),Un=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Un.prototype.bind=function(e,t,r,n,i,a,o,s){this.context=e;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}function Gn(e,t,r,n){var i=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,u=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/u,f=c*(n.tileID.canonical.x+n.tileID.wrap*u),d=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/Nt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[f>>16,d>>16],u_pixel_coord_lower:[65535&f,65535&d]}}Hn.prototype.draw=function(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v){var m,g=e.gl;if(!this.failedToCreate){for(var y in e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),e.setColorMode(i),e.setCullFace(a),this.fixedUniforms)this.fixedUniforms[y].set(o[y]);p&&p.setUniforms(e,this.binderUniforms,f,{zoom:d});for(var x=(m={},m[g.LINES]=2,m[g.TRIANGLES]=3,m[g.LINE_STRIP]=1,m)[t],b=0,_=c.get();b<_.length;b+=1){var w=_[b],k=w.vaos||(w.vaos={});(k[s]||(k[s]=new Un)).bind(e,this,l,p?p.getPaintVertexBuffers():[],u,w.vertexOffset,h,v),g.drawElements(t,w.primitiveLength*x,g.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var qn=function(t,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=e.create$1();"viewport"===a.properties.get("anchor")&&e.fromRotation(l,-r.transform.angle),e.transformMat3(s,s,l);var u=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:i}},Yn=function(t,r,n,i,a,o,s){return e.extend(qn(t,r,n,i),Wn(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Xn=function(e){return{u_matrix:e}},Kn=function(t,r,n,i){return e.extend(Xn(t),Wn(n,r,i))},$n=function(e,t){return{u_matrix:e,u_world:t}},Jn=function(t,r,n,i,a){return e.extend(Kn(t,r,n,i),{u_world:a})},Qn=function(t,r,n,i){var a,o,s=t.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=Nt(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:o}},ei=function(e,t,r){var n=Nt(r,1,t.zoom),i=Math.pow(2,t.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[t.pixelsToGLUnits[0]/(n*i),t.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},ti=function(e,t,r){return{u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},ri=function(e,t,r){return void 0===r&&(r=1),{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:r}},ni=function(e){return{u_matrix:e}},ii=function(e,t,r,n){return{u_matrix:e,u_extrude_scale:Nt(t,1,r),u_intensity:n}},ai=function(t,r,n,i){var a=e.create();e.ortho(a,0,t.width,t.height,0,0,1);var o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}},oi=function(e,t,r){var n=r.paint.get("hillshade-shadow-color"),i=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),o=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(o-=e.transform.angle);var s=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),s),u_image:0,u_latrange:li(e,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:i,u_accent:a}},si=function(t,r,n){var i=r.stride,a=e.create();return e.ortho(a,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(a,a,[0,-e.EXTENT,0]),{u_matrix:a,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_maxzoom:n,u_unpack:r.getUnpackVector()}};function li(t,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.MercatorCoordinate(0,i/n).toLngLat().lat,new e.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var ui=function(t,r,n){var i=t.transform;return{u_matrix:hi(t,r,n),u_ratio:1/Nt(r,1,i.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},ci=function(t,r,n){return e.extend(ui(t,r,n),{u_image:0})},fi=function(t,r,n,i){var a=t.transform,o=pi(r,a);return{u_matrix:hi(t,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/Nt(r,1,a.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},di=function(t,r,n,i,a){var o=t.transform,s=t.lineAtlas,l=pi(r,o),u="round"===n.layout.get("line-cap"),c=s.getDash(i.from,u),f=s.getDash(i.to,u),d=c.width*a.fromScale,p=f.width*a.toScale;return e.extend(ui(t,r,n),{u_patternscale_a:[l/d,-c.height/2],u_patternscale_b:[l/p,-f.height/2],u_sdfgamma:s.width/(256*Math.min(d,p)*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:f.y,u_mix:a.t})};function pi(e,t){return 1/Nt(e,1,t.tileZoom)}function hi(e,t,r){return e.translatePosMatrix(t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var vi=function(e,t,r,n,i){return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:yi(i.paint.get("raster-saturation")),u_contrast_factor:gi(i.paint.get("raster-contrast")),u_spin_weights:mi(i.paint.get("raster-hue-rotate"))}};function mi(e){e*=Math.PI/180;var t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}function gi(e){return e>0?1/(1-e):1+e}function yi(e){return e>0?1-1/(1.001-e):-e}var xi,bi=function(e,t,r,n,i,a,o,s,l,u){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:u,u_texture:0}},_i=function(t,r,n,i,a,o,s,l,u,c,f){var d=a.transform;return e.extend(bi(t,r,n,i,a,o,s,l,u,c),{u_gamma_scale:i?Math.cos(d._pitch)*d.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+f})},wi=function(t,r,n,i,a,o,s,l,u,c){return e.extend(_i(t,r,n,i,a,o,s,l,!0,u,!0),{u_texsize_icon:c,u_texture_icon:1})},ki=function(e,t,r){return{u_matrix:e,u_opacity:t,u_color:r}},Ti=function(t,r,n,i,a,o){return e.extend(Gn(i,o,n,a),{u_matrix:t,u_opacity:r})},Mi={fillExtrusion:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fillExtrusionPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,r.u_height_factor),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fill:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},fillPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},fillOutline:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world)}},fillOutlinePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},circle:function(t,r){return{u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,r.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},collisionBox:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,r.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,r.u_overscale_factor)}},collisionCircle:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,r.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,r.u_viewport_size)}},debug:function(t,r){return{u_color:new e.UniformColor(t,r.u_color),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_overlay:new e.Uniform1i(t,r.u_overlay),u_overlay_scale:new e.Uniform1f(t,r.u_overlay_scale)}},clippingMask:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmap:function(t,r){return{u_extrude_scale:new e.Uniform1f(t,r.u_extrude_scale),u_intensity:new e.Uniform1f(t,r.u_intensity),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmapTexture:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_color_ramp:new e.Uniform1i(t,r.u_color_ramp),u_opacity:new e.Uniform1f(t,r.u_opacity)}},hillshade:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_latrange:new e.Uniform2f(t,r.u_latrange),u_light:new e.Uniform2f(t,r.u_light),u_shadow:new e.UniformColor(t,r.u_shadow),u_highlight:new e.UniformColor(t,r.u_highlight),u_accent:new e.UniformColor(t,r.u_accent)}},hillshadePrepare:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_dimension:new e.Uniform2f(t,r.u_dimension),u_zoom:new e.Uniform1f(t,r.u_zoom),u_maxzoom:new e.Uniform1f(t,r.u_maxzoom),u_unpack:new e.Uniform4f(t,r.u_unpack)}},line:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels)}},lineGradient:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_image:new e.Uniform1i(t,r.u_image)}},linePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texsize:new e.Uniform2f(t,r.u_texsize),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_image:new e.Uniform1i(t,r.u_image),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},lineSDF:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,r.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,r.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,r.u_sdfgamma),u_image:new e.Uniform1i(t,r.u_image),u_tex_y_a:new e.Uniform1f(t,r.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,r.u_tex_y_b),u_mix:new e.Uniform1f(t,r.u_mix)}},raster:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_tl_parent:new e.Uniform2f(t,r.u_tl_parent),u_scale_parent:new e.Uniform1f(t,r.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,r.u_buffer_scale),u_fade_t:new e.Uniform1f(t,r.u_fade_t),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image0:new e.Uniform1i(t,r.u_image0),u_image1:new e.Uniform1i(t,r.u_image1),u_brightness_low:new e.Uniform1f(t,r.u_brightness_low),u_brightness_high:new e.Uniform1f(t,r.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,r.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,r.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,r.u_spin_weights)}},symbolIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture)}},symbolSDF:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},symbolTextAndIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texsize_icon:new e.Uniform2f(t,r.u_texsize_icon),u_texture:new e.Uniform1i(t,r.u_texture),u_texture_icon:new e.Uniform1i(t,r.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},background:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_color:new e.UniformColor(t,r.u_color)}},backgroundPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image:new e.Uniform1i(t,r.u_image),u_pattern_tl_a:new e.Uniform2f(t,r.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,r.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,r.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,r.u_pattern_br_b),u_texsize:new e.Uniform2f(t,r.u_texsize),u_mix:new e.Uniform1f(t,r.u_mix),u_pattern_size_a:new e.Uniform2f(t,r.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,r.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,r.u_scale_a),u_scale_b:new e.Uniform1f(t,r.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,r.u_tile_units_to_pixels)}}};function Si(t,r,n,i,a,o,s){for(var l=t.context,u=l.gl,c=t.useProgram("collisionBox"),f=[],d=0,p=0,h=0;h0){var _=e.create(),w=y;e.mul(_,g.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(_,_,g.placementViewportMatrix),f.push({circleArray:b,circleOffset:p,transform:w,invTransform:_}),p=d+=b.length/4}x&&c.draw(l,u.LINES,je.disabled,Be.disabled,t.colorModeForRenderPass(),Ye.disabled,ei(y,t.transform,m),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,t.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&f.length){var k=t.useProgram("collisionCircle"),T=new e.StructArrayLayout2f1f2i16;T.resize(4*d),T._trim();for(var M=0,S=0,A=f;S=0&&(v[g.associatedIconIndex]={shiftedAnchor:A,angle:C})}else Dt(g.numGlyphs,p)}if(f){h.clear();for(var P=t.icon.placedSymbolArray,L=0;L0){var s=e.browser.now(),l=(s-t.timeAdded)/o,u=r?(s-r.timeAdded)/o:-1,c=n.getSource(),f=a.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),d=!r||Math.abs(r.tileID.overscaledZ-f)>Math.abs(t.tileID.overscaledZ-f),p=d&&t.refreshedUponExpiration?1:e.clamp(d?l:1-u,0,1);return t.refreshedUponExpiration&&l>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}function $i(e,t,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var a=e.context,o=a.gl,s=e.transform,l=s.tileSize,u=r.paint.get("background-pattern");if(!e.isPatternMissing(u)){var c=!u&&1===n.a&&1===i&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass===c){var f=Be.disabled,d=e.depthModeForSublayer(0,"opaque"===c?je.ReadWrite:je.ReadOnly),p=e.colorModeForRenderPass(),h=e.useProgram(u?"backgroundPattern":"background"),v=s.coveringTiles({tileSize:l});u&&(a.activeTexture.set(o.TEXTURE0),e.imageManager.bind(e.context));for(var m=r.getCrossfadeParameters(),g=0,y=v;g "+n.overscaledZ),ca(t,g+" "+h+"kb"),s.draw(i,a.TRIANGLES,l,u,We.alphaBlended,Ye.disabled,ri(o,e.Color.transparent,m),f,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}function ca(e,t){e.initDebugOverlayCanvas();var r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}function fa(e,t,r){var n=e.context,i=r.implementation;if("offscreen"===e.renderPass){var a=i.prerender;a&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),a.call(i,n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Be.disabled);var o="3d"===i.renderingMode?new je(e.context.gl.LEQUAL,je.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,je.ReadOnly);n.setDepthMode(o),i.render(n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}}var da={symbol:Ei,circle:zi,heatmap:Fi,line:Bi,fill:Vi,"fill-extrusion":Hi,hillshade:Gi,raster:Xi,background:$i,debug:la,custom:fa},pa=function(e,t){this.context=new Xe(e),this.transform=t,this._tileTextures={},this.setup(),this.numSublayers=Ke.maxUnderzooming+Ke.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new fr,this.gpuTimers={}};pa.prototype.resize=function(t,r){if(this.width=t*e.browser.devicePixelRatio,this.height=r*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n256&&this.clearStencil(),r.setColorMode(We.disabled),r.setDepthMode(je.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=t;a256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new Be({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)},pa.prototype.stencilModeForClipping=function(e){var t=this.context.gl;return new Be({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)},pa.prototype.stencilConfigForOverlap=function(e){var t,r=this.context.gl,n=e.sort((function(e,t){return t.overscaledZ-e.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],k=a[w.source],T=c[w.source];this._renderTileClippingMasks(w,T),this.renderLayer(this,k,w,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?t.pop():null},pa.prototype.isPatternMissing=function(e){if(!e)return!1;if(!e.from||!e.to)return!0;var t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r},pa.prototype.useProgram=function(e,t){this.cache=this.cache||{};var r=""+e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Hn(this.context,Vn[e],t,Mi[e],this._showOverdrawInspector)),this.cache[r]},pa.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},pa.prototype.setBaseState=function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)},pa.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var t=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,t.RGBA)}},pa.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var ha=function(e,t){this.points=e,this.planes=t};ha.fromInvProjectionMatrix=function(t,r,n){var i=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],a=Math.pow(2,n),o=i.map((function(r){return e.transformMat4([],r,t)})).map((function(t){return e.scale$1([],t,1/t[3]/r*a)})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var r=e.sub([],o[t[0]],o[t[1]]),n=e.sub([],o[t[2]],o[t[1]]),i=e.normalize([],e.cross([],r,n)),a=-e.dot(i,o[t[1]]);return i.concat(a)}));return new ha(o,s)};var va=function(t,r){this.min=t,this.max=r,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};va.prototype.quadrant=function(t){for(var r=[t%2===0,t<2],n=e.clone$2(this.min),i=e.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,c=-Number.MAX_VALUE,f=0;fthis.max[l]-this.min[l])return 0}return 1};var ma=function(e,t,r,n){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n};ma.prototype.interpolate=function(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.number(t.right,r.right,n)),this},ma.prototype.getCenter=function(t,r){var n=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+r-this.bottom)/2,0,r);return new e.Point(n,i)},ma.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right},ma.prototype.clone=function(){return new ma(this.top,this.bottom,this.left,this.right)},ma.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var ga=function(t,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=void 0===n||null===n?0:n,this._maxPitch=void 0===i||null===i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ma,this._posMatrixCache={},this._alignedPosMatrixCache={}},ya={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};function xa(e,t){var r=!1,n=null,i=function i(){n=null,r&&(e(),n=setTimeout(i,t),r=!1)};return function(){return r=!0,n||i(),n}}ga.prototype.clone=function(){var e=new ga(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._calcMatrices(),e},ya.minZoom.get=function(){return this._minZoom},ya.minZoom.set=function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))},ya.maxZoom.get=function(){return this._maxZoom},ya.maxZoom.set=function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))},ya.minPitch.get=function(){return this._minPitch},ya.minPitch.set=function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))},ya.maxPitch.get=function(){return this._maxPitch},ya.maxPitch.set=function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))},ya.renderWorldCopies.get=function(){return this._renderWorldCopies},ya.renderWorldCopies.set=function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e},ya.worldSize.get=function(){return this.tileSize*this.scale},ya.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},ya.size.get=function(){return new e.Point(this.width,this.height)},ya.bearing.get=function(){return-this.angle/Math.PI*180},ya.bearing.set=function(t){var r=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},ya.pitch.get=function(){return this._pitch/Math.PI*180},ya.pitch.set=function(t){var r=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},ya.fov.get=function(){return this._fov/Math.PI*180},ya.fov.set=function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())},ya.zoom.get=function(){return this._zoom},ya.zoom.set=function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},ya.center.get=function(){return this._center},ya.center.set=function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())},ya.padding.get=function(){return this._edgeInsets.toJSON()},ya.padding.set=function(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())},ya.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},ga.prototype.isPaddingEqual=function(e){return this._edgeInsets.equals(e)},ga.prototype.interpolatePadding=function(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()},ga.prototype.coveringZoomLevel=function(e){var t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)},ga.prototype.getVisibleUnwrappedCoordinates=function(t){var r=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),a=this.pointCoordinate(new e.Point(this.width,this.height)),o=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),u=1,c=s-u;c<=l+u;c++)0!==c&&r.push(new e.UnwrappedTileID(c,t));return r},ga.prototype.coveringTiles=function(t){var r=this.coveringZoomLevel(t),n=r;if(void 0!==t.minzoom&&rt.maxzoom&&(r=t.maxzoom);var i=e.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=ha.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var u=3,c=function(e){return{aabb:new va([e*a,0,0],[(e+1)*a,a,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}},f=[],d=[],p=r,h=t.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var v=1;v<=3;v++)f.push(c(-v)),f.push(c(v));for(f.push(c(0));f.length>0;){var m=f.pop(),g=m.x,y=m.y,x=m.fullyVisible;if(!x){var b=m.aabb.intersects(s);if(0===b)continue;x=2===b}var _=m.aabb.distanceX(o),w=m.aabb.distanceY(o),k=Math.max(Math.abs(_),Math.abs(w)),T=u+(1<T&&m.zoom>=l)d.push({tileID:new e.OverscaledTileID(m.zoom===p?h:m.zoom,m.wrap,m.zoom,g,y),distanceSq:e.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var M=0;M<4;M++){var S=(g<<1)+M%2,A=(y<<1)+(M>>1);f.push({aabb:m.aabb.quadrant(M),zoom:m.zoom+1,x:S,y:A,wrap:m.wrap,fullyVisible:x})}}return d.sort((function(e,t){return e.distanceSq-t.distanceSq})).map((function(e){return e.tileID}))},ga.prototype.resize=function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()},ya.unmodified.get=function(){return this._unmodified},ga.prototype.zoomScale=function(e){return Math.pow(2,e)},ga.prototype.scaleZoom=function(e){return Math.log(e)/Math.LN2},ga.prototype.project=function(t){var r=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(r)*this.worldSize)},ga.prototype.unproject=function(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},ya.point.get=function(){return this.project(this.center)},ga.prototype.setLocationAtPoint=function(t,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},ga.prototype.locationPoint=function(e){return this.coordinatePoint(this.locationCoordinate(e))},ga.prototype.pointLocation=function(e){return this.coordinateLocation(this.pointCoordinate(e))},ga.prototype.locationCoordinate=function(t){return e.MercatorCoordinate.fromLngLat(t)},ga.prototype.coordinateLocation=function(e){return e.toLngLat()},ga.prototype.pointCoordinate=function(t){var r=0,n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];e.transformMat4(n,n,this.pixelMatrixInverse),e.transformMat4(i,i,this.pixelMatrixInverse);var a=n[3],o=i[3],s=n[0]/a,l=i[0]/o,u=n[1]/a,c=i[1]/o,f=n[2]/a,d=i[2]/o,p=f===d?0:(r-f)/(d-f);return new e.MercatorCoordinate(e.number(s,l,p)/this.worldSize,e.number(u,c,p)/this.worldSize)},ga.prototype.coordinatePoint=function(t){var r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix),new e.Point(r[0]/r[3],r[1]/r[3])},ga.prototype.getBounds=function(){return(new e.LngLatBounds).extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},ga.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},ga.prototype.setMaxBounds=function(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},ga.prototype.calculatePosMatrix=function(t,r){void 0===r&&(r=!1);var n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*t.wrap,l=e.identity(new Float64Array(16));return e.translate(l,l,[s*o,a.y*o,0]),e.scale(l,l,[o/e.EXTENT,o/e.EXTENT,1]),e.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},ga.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},ga.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,r,n,i,a=-90,o=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var f=this.latRange;a=e.mercatorYfromLat(f[1])*this.worldSize,t=(o=e.mercatorYfromLat(f[0])*this.worldSize)-ao&&(i=o-m)}if(this.lngRange){var g=p.x,y=u.x/2;g-yl&&(n=l-y)}void 0===n&&void 0===i||(this.center=this.unproject(new e.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=c,this._constraining=!1}},ga.prototype._calcMatrices=function(){if(this.height){var t=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(t)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),c=this.height/50,f=new Float64Array(16);e.perspective(f,this._fov,this.width/this.height,c,u),f[8]=2*-r.x/this.width,f[9]=2*r.y/this.height,e.scale(f,f,[1,-1,1]),e.translate(f,f,[0,0,-this.cameraToCenterDistance]),e.rotateX(f,f,this._pitch),e.rotateZ(f,f,this.angle),e.translate(f,f,[-s,-l,0]),this.mercatorMatrix=e.scale([],f,[this.worldSize,this.worldSize,this.worldSize]),e.scale(f,f,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=f,this.invProjMatrix=e.invert([],this.projMatrix);var d=this.width%2/2,p=this.height%2/2,h=Math.cos(this.angle),v=Math.sin(this.angle),m=s-Math.round(s)+h*d+v*p,g=l-Math.round(l)+h*p+v*d,y=new Float64Array(f);if(e.translate(y,y,[m>.5?m-1:m,g>.5?g-1:g,0]),this.alignedProjMatrix=y,f=e.create(),e.scale(f,f,[this.width/2,-this.height/2,1]),e.translate(f,f,[1,-1,0]),this.labelPlaneMatrix=f,f=e.create(),e.scale(f,f,[1,-1,1]),e.translate(f,f,[-1,-1,0]),e.scale(f,f,[2/this.width,2/this.height,1]),this.glCoordMatrix=f,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(f=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=f,this._posMatrixCache={},this._alignedPosMatrixCache={}}},ga.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.Point(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},ga.prototype.getCameraPoint=function(){var t=this._pitch,r=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,r))},ga.prototype.getCameraQueryGeometry=function(t){var r=this.getCameraPoint();if(1===t.length)return[t[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=t;s=3&&!e.some((function(e){return isNaN(e)}))){var t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},ba.prototype._updateHashUnthrottled=function(){var t=this.getHashString();try{e.window.history.replaceState(e.window.history.state,"",t)}catch(r){}};var _a={linearity:.3,easing:e.bezier(0,0,.3,1)},wa=e.extend({deceleration:2500,maxSpeed:1400},_a),ka=e.extend({deceleration:20,maxSpeed:1400},_a),Ta=e.extend({deceleration:1e3,maxSpeed:360},_a),Ma=e.extend({deceleration:1e3,maxSpeed:90},_a),Sa=function(e){this._map=e,this.clear()};function Aa(e,t){(!e.duration||e.duration0&&r-t[0].time>n;)t.shift()},Sa.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Ea(e.type,this._map,e))},Ia.prototype.dblclick=function(e){return this._firePreventable(new Ea(e.type,this._map,e))},Ia.prototype.mouseover=function(e){this._map.fire(new Ea(e.type,this._map,e))},Ia.prototype.mouseout=function(e){this._map.fire(new Ea(e.type,this._map,e))},Ia.prototype.touchstart=function(e){return this._firePreventable(new Pa(e.type,this._map,e))},Ia.prototype.touchmove=function(e){this._map.fire(new Pa(e.type,this._map,e))},Ia.prototype.touchend=function(e){this._map.fire(new Pa(e.type,this._map,e))},Ia.prototype.touchcancel=function(e){this._map.fire(new Pa(e.type,this._map,e))},Ia.prototype._firePreventable=function(e){if(this._map.fire(e),e.defaultPrevented)return{}},Ia.prototype.isEnabled=function(){return!0},Ia.prototype.isActive=function(){return!1},Ia.prototype.enable=function(){},Ia.prototype.disable=function(){};var Ra=function(e){this._map=e};Ra.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Ra.prototype.mousemove=function(e){this._map.fire(new Ea(e.type,this._map,e))},Ra.prototype.mousedown=function(){this._delayContextMenu=!0},Ra.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ea("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Ra.prototype.contextmenu=function(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new Ea(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()},Ra.prototype.isEnabled=function(){return!0},Ra.prototype.isActive=function(){return!1},Ra.prototype.enable=function(){},Ra.prototype.disable=function(){};var Oa=function(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1};function Da(e,t){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=za(t),this.touches=Da(r,t)))},Za.prototype.touchmove=function(e,t,r){if(!this.aborted&&this.centroid){var n=Da(r,t);for(var i in this.touches){var a=this.touches[i],o=n[i];(!o||o.dist(a)>Na)&&(this.aborted=!0)}}},Za.prototype.touchend=function(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>ja)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Ba=function(e){this.singleTap=new Za(e),this.numTaps=e.numTaps,this.reset()};Ba.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ba.prototype.touchstart=function(e,t,r){this.singleTap.touchstart(e,t,r)},Ba.prototype.touchmove=function(e,t,r){this.singleTap.touchmove(e,t,r)},Ba.prototype.touchend=function(e,t,r){var n=this.singleTap.touchend(e,t,r);if(n){var i=e.timeStamp-this.lastTime0&&(this._active=!0);var i=Da(n,r),a=new e.Point(0,0),o=new e.Point(0,0),s=0;for(var l in i){var u=i[l],c=this._touches[l];c&&(a._add(u),o._add(u.sub(c)),s++,i[l]=u)}if(this._touches=i,!(sMath.abs(e.x)}var ao=100,oo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},t.prototype._start=function(e){this._lastPoints=e,io(e[0].sub(e[1]))&&(this._valid=!1)},t.prototype._move=function(e,t,r){var n=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},t.prototype.gestureBeginsVertically=function(e,t,r){if(void 0!==this._valid)return this._valid;var n=2,i=e.mag()>=n,a=t.mag()>=n;if(i||a){if(!i||!a)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove0===t.y>0;return io(e)&&io(t)&&o}},t}(Ka),so={panStep:100,bearingStep:15,pitchStep:10},lo=function(){var e=so;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep};function uo(e){return e*(2-e)}lo.prototype.reset=function(){this._active=!1},lo.prototype.keydown=function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:uo,zoom:r?Math.round(l)+r*(e.shiftKey?2:1):l,bearing:s.getBearing()+n*t._bearingStep,pitch:s.getPitch()+i*t._pitchStep,offset:[-a*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}},lo.prototype.enable=function(){this._enabled=!0},lo.prototype.disable=function(){this._enabled=!1,this.reset()},lo.prototype.isEnabled=function(){return this._enabled},lo.prototype.isActive=function(){return this._active};var co=4.000244140625,fo=.01,po=1/450,ho=2,vo=function(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=fo,this._wheelZoomRate=po,e.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};vo.prototype.setZoomRate=function(e){this._defaultZoomRate=e},vo.prototype.setWheelZoomRate=function(e){this._wheelZoomRate=e},vo.prototype.isEnabled=function(){return!!this._enabled},vo.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},vo.prototype.isZooming=function(){return!!this._zooming},vo.prototype.enable=function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&"center"===e.around)},vo.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},vo.prototype.wheel=function(t){if(this.isEnabled()){var r=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,n=e.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%co===0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}},vo.prototype._onTimeout=function(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},vo.prototype._start=function(t){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},vo.prototype.renderFrame=function(){return this._onScrollFrame()},vo.prototype._onScrollFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>co?this._wheelZoomRate:this._defaultZoomRate,i=ho/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"===typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"===typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&l&&u){var f=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),d=u(f);o=e.number(l,s,d),f<1?this._frameId||(this._frameId=!0):c=!0}else o=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},vo.prototype._smoothOutEasing=function(t){var r=e.ease;if(this._prevEase){var n=this._prevEase,i=(e.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.bezier(o,s,.25,1)}return this._prevEase={start:e.browser.now(),duration:t,easing:r},r},vo.prototype.reset=function(){this._active=!1};var mo=function(e,t){this._clickZoom=e,this._tapZoom=t};mo.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},mo.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},mo.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},mo.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var go=function(){this.reset()};go.prototype.reset=function(){this._active=!1},go.prototype.dblclick=function(e,t){return e.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}},go.prototype.enable=function(){this._enabled=!0},go.prototype.disable=function(){this._enabled=!1,this.reset()},go.prototype.isEnabled=function(){return this._enabled},go.prototype.isActive=function(){return this._active};var yo=function(){this._tap=new Ba({numTouches:1,numTaps:1}),this.reset()};yo.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},yo.prototype.touchstart=function(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>Fa&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))},yo.prototype.touchmove=function(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)},yo.prototype.touchend=function(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)},yo.prototype.touchcancel=function(){this.reset()},yo.prototype.enable=function(){this._enabled=!0},yo.prototype.disable=function(){this._enabled=!1,this.reset()},yo.prototype.isEnabled=function(){return this._enabled},yo.prototype.isActive=function(){return this._active};var xo=function(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r};xo.prototype.enable=function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},xo.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},xo.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},xo.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var bo=function(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r};bo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},bo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},bo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},bo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var _o=function(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};_o.prototype.enable=function(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},_o.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},_o.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},_o.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},_o.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},_o.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var wo=function(e){return e.zoom||e.drag||e.pitch||e.rotate},ko=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(e.Event);function To(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var Mo=function(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Sa(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),e.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!1}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[e.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,_):Math.max(.5,_),w=Math.pow(m,1-t),k=i.unproject(x.add(b.mult(t*w)).mult(v));i.setLocationAtPoint(i.renderWorldCopies?k.wrap():k,h)}n._fireMoveEvents(r)}),(function(e){n._afterEase(r,e)}),t),this},r.prototype._prepareEase=function(t,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.Event("pitchstart",t))},r.prototype._fireMoveEvents=function(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))},r.prototype._afterEase=function(t,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.Event("zoomend",t)),i&&this.fire(new e.Event("rotateend",t)),a&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}},r.prototype.flyTo=function(t,r){var n=this;if(!t.essential&&e.browser.prefersReducedMotion){var i=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),c="zoom"in t?e.clamp(+t.zoom,a.minZoom,a.maxZoom):o,f="bearing"in t?this._normalizeBearing(t.bearing,s):s,d="pitch"in t?+t.pitch:l,p="padding"in t?t.padding:a.padding,h=a.zoomScale(c-o),v=e.Point.convert(t.offset),m=a.centerPoint.add(v),g=a.pointLocation(m),y=e.LngLat.convert(t.center||g);this._normalizeCenter(y);var x=a.project(g),b=a.project(y).sub(x),_=t.curve,w=Math.max(a.width,a.height),k=w/h,T=b.mag();if("minZoom"in t){var M=e.clamp(Math.min(t.minZoom,o,c),a.minZoom,a.maxZoom),S=w/a.zoomScale(M-o);_=Math.sqrt(S/T*2)}var A=_*_;function C(e){var t=(k*k-w*w+(e?-1:1)*A*A*T*T)/(2*(e?k:w)*A*T);return Math.log(Math.sqrt(t*t+1)-t)}function E(e){return(Math.exp(e)-Math.exp(-e))/2}function P(e){return(Math.exp(e)+Math.exp(-e))/2}function L(e){return E(e)/P(e)}var I=C(0),R=function(e){return P(I)/P(I+_*e)},O=function(e){return w*((P(I)*L(I+_*e)-E(I))/A)/T},D=(C(1)-I)/_;if(Math.abs(T)<1e-6||!isFinite(D)){if(Math.abs(w-k)<1e-6)return this.easeTo(t,r);var z=kt.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==f,this._pitching=d!==l,this._padding=!a.isPaddingEqual(p),this._prepareEase(r,!1),this._ease((function(t){var i=t*D,h=1/R(i);a.zoom=1===t?c:o+a.scaleZoom(h),n._rotating&&(a.bearing=e.number(s,f,t)),n._pitching&&(a.pitch=e.number(l,d,t)),n._padding&&(a.interpolatePadding(u,p,t),m=a.centerPoint.add(v));var g=1===t?y:a.unproject(x.add(b.mult(O(i))).mult(h));a.setLocationAtPoint(a.renderWorldCopies?g.wrap():g,m),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),t),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}if(!e){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(t,r,n){!1===n.animate||0===n.duration?(t(1),r()):(this._easeStart=e.browser.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var t=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(t,r){t=e.wrap(t,-180,180);var n=Math.abs(t-r);return Math.abs(t-360-r)180?-360:r<-180?360:0}},r}(e.Evented),Ao=function(t){void 0===t&&(t={}),this.options=t,e.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};Ao.prototype.getDefaultPosition=function(){return"bottom-right"},Ao.prototype.onAdd=function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Ao.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Ao.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){var n=r.reduce((function(e,t,n){return t.value&&(e+=t.key+"="+t.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,e.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Ao.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var Co=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Co.prototype.onAdd=function(e){this._map=e,this._container=r.create("div","mapboxgl-ctrl");var t=r.create("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Co.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Co.prototype.getDefaultPosition=function(){return"bottom-left"},Co.prototype._updateLogo=function(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Co.prototype._logoRequired=function(){if(this._map.style){var e=this._map.style.sourceCaches;for(var t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},Co.prototype._updateCompact=function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}};var Eo=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Eo.prototype.add=function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t},Eo.prototype.remove=function(e){for(var t=this._currentlyRunning,r=0,n=t?this._queue.concat(t):this._queue;rt.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitchFo)throw new Error("maxPitch must be less than or equal to "+Fo);var i=new ga(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies);if(n.call(this,i,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new Eo,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Po,t.locale),this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken),"string"===typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error("Container '"+t.container+"' not found.")}else{if(!(t.container instanceof Io))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),"undefined"!==typeof e.window&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new Mo(this,t);var a="string"===typeof t.hash&&t.hash||void 0;this._hash=t.hash&&new ba(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new Ao({customAttribution:t.customAttribution})),this.addControl(new Co,t.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(t){r._update("style"===t.dataType),r.fire(new e.Event(t.dataType+"data",t))})),this.on("dataloading",(function(t){r.fire(new e.Event(t.dataType+"dataloading",t))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(t,r){if(void 0===r&&t.getDefaultPosition&&(r=t.getDefaultPosition()),void 0===r&&(r="top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this},i.prototype.resize=function(t){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t))),this.fire(new e.Event("resize",t)),a&&this.fire(new e.Event("moveend",t)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()},i.prototype.setMinZoom=function(e){if((e=null===e||void 0===e?Oo:e)>=Oo&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(e){if((e=null===e||void 0===e?zo:e)=zo&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()Fo)throw new Error("maxPitch must be less than or equal to "+Fo);if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(e){return this.transform.renderWorldCopies=e,this._update()},i.prototype.project=function(t){return this.transform.locationPoint(e.LngLat.convert(t))},i.prototype.unproject=function(t){return this.transform.pointLocation(e.Point.convert(t))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(e,t,r){var n,i=this;if("mouseenter"===e||"mouseover"===e){var a=!1,o=function(n){var o=i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[];o.length?a||(a=!0,r.call(i,new Ea(e,i,n.originalEvent,{features:o}))):a=!1};return{layer:t,listener:r,delegates:{mousemove:o,mouseout:function(){a=!1}}}}if("mouseleave"===e||"mouseout"===e){var s=!1,l=function(n){(i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[]).length?s=!0:s&&(s=!1,r.call(i,new Ea(e,i,n.originalEvent)))},u=function(t){s&&(s=!1,r.call(i,new Ea(e,i,t.originalEvent)))};return{layer:t,listener:r,delegates:{mousemove:l,mouseout:u}}}var c=function(e){var n=i.getLayer(t)?i.queryRenderedFeatures(e.point,{layers:[t]}):[];n.length&&(e.features=n,r.call(i,e),delete e.features)};return{layer:t,listener:r,delegates:(n={},n[e]=c,n)}},i.prototype.on=function(e,t,r){if(void 0===r)return n.prototype.on.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(e,t,r){if(void 0===r)return n.prototype.once.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(e,t,r){var i=this;if(void 0===r)return n.prototype.off.call(this,e,t);var a=function(n){for(var a=n[e],o=0;o180;){var s=n.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}Uo.prototype.down=function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),r.disableDrag()},Uo.prototype.move=function(e,t){var r=this.map,n=this.mouseRotate.mousemoveWindow(e,t);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(e,t);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Uo.prototype.off=function(){var e=this.element;r.removeEventListener(e,"mousedown",this.mousedown),r.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(e,"touchmove",this.touchmove),r.removeEventListener(e,"touchend",this.touchend),r.removeEventListener(e,"touchcancel",this.reset),this.offTemp()},Uo.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(e.window,"mousemove",this.mousemove),r.removeEventListener(e.window,"mouseup",this.mouseup)},Uo.prototype.mousedown=function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),r.mousePos(this.element,t)),r.addEventListener(e.window,"mousemove",this.mousemove),r.addEventListener(e.window,"mouseup",this.mouseup)},Uo.prototype.mousemove=function(e){this.move(e,r.mousePos(this.element,e))},Uo.prototype.mouseup=function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()},Uo.prototype.touchstart=function(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos))},Uo.prototype.touchmove=function(e){1!==e.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos))},Uo.prototype.touchend=function(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)t.getEast()||r.latitudet.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}},n.prototype._updateCamera=function(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(t){if(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),r=this._map.unproject([1,e]),n=t.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Jo)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(t){var n=this;if(this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Yo(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Yo({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(t){var r=t.originalEvent&&"resize"===t.originalEvent.type;t.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new e.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":$o--,Jo=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++$o>1?(t={maximumAge:6e5,timeout:0},Jo=!0):(t=this.options.positionOptions,Jo=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(e.Evented),es={maxWidth:100,unit:"metric"},ts=function(t){this.options=e.extend({},es,t),e.bindAll(["_onMove","setUnit"],this)};function rs(e,t,r){var n=r&&r.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?ns(t,n,l/5280,e._getUIString("ScaleControl.Miles")):ns(t,n,l,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?ns(t,n,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?ns(t,n,s/1e3,e._getUIString("ScaleControl.Kilometers")):ns(t,n,s,e._getUIString("ScaleControl.Meters"))}function ns(e,t,r,n){var i=as(r),a=i/r;e.style.width=t*a+"px",e.innerHTML=i+" "+n}function is(e){var t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}function as(e){var t=Math.pow(10,(""+Math.floor(e)).length-1),r=e/t;return t*(r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:is(r))}ts.prototype.getDefaultPosition=function(){return"bottom-left"},ts.prototype._onMove=function(){rs(this._map,this._container,this.options)},ts.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},ts.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},ts.prototype.setUnit=function(e){this.options.unit=e,rs(this._map,this._container,this.options)};var os=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};os.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},os.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},os.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},os.prototype._setupUI=function(){var t=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden",!0),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},os.prototype._updateTitle=function(){var e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e},os.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},os.prototype._isFullscreen=function(){return this._fullscreen},os.prototype._changeIcon=function(){(e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},os.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var ss={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},ls=function(t){function n(r){t.call(this),this.options=e.extend(Object.create(ss),r),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(t){return this.setDOMContent(e.window.document.createTextNode(t))},n.prototype.setHTML=function(t){var r,n=e.window.document.createDocumentFragment(),i=e.window.document.createElement("body");for(i.innerHTML=t;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(e){return this.options.maxWidth=e,this._update(),this},n.prototype.setDOMContent=function(e){return this._createContent(),this._content.appendChild(e),this._update(),this},n.prototype.addClassName=function(e){this._container&&this._container.classList.add(e)},n.prototype.removeClassName=function(e){this._container&&this._container.classList.remove(e)},n.prototype.toggleClassName=function(e){if(this._container)return this._container.classList.toggle(e)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(e){this._update(e.point)},n.prototype._onMouseMove=function(e){this._update(e.point)},n.prototype._onDrag=function(e){this._update(e.point)},n.prototype._update=function(e){var t=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(e){return t._container.classList.add(e)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ho(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,o=us(this.options.offset);if(!a){var s,l=this._container.offsetWidth,u=this._container.offsetHeight;s=i.y+o.bottom.ythis._map.transform.height-u?["bottom"]:[],i.xthis._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var c=i.add(o[a]).round();r.setTransform(this._container,Wo[a]+" translate("+c.x+"px,"+c.y+"px)"),Go(this._container,a,"popup")}},n.prototype._onClose=function(){this.remove()},n}(e.Evented);function us(t){if(t){if("number"===typeof t){var r=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{center:new e.Point(0,0),top:new e.Point(0,t),"top-left":new e.Point(r,r),"top-right":new e.Point(-r,r),bottom:new e.Point(0,-t),"bottom-left":new e.Point(r,-r),"bottom-right":new e.Point(-r,-r),left:new e.Point(t,0),right:new e.Point(-t,0)}}if(t instanceof e.Point||Array.isArray(t)){var n=e.Point.convert(t);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:e.Point.convert(t.center||[0,0]),top:e.Point.convert(t.top||[0,0]),"top-left":e.Point.convert(t["top-left"]||[0,0]),"top-right":e.Point.convert(t["top-right"]||[0,0]),bottom:e.Point.convert(t.bottom||[0,0]),"bottom-left":e.Point.convert(t["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(t["bottom-right"]||[0,0]),left:e.Point.convert(t.left||[0,0]),right:e.Point.convert(t.right||[0,0])}}return us(new e.Point(0,0))}var cs={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:No,NavigationControl:Vo,GeolocateControl:Qo,AttributionControl:Ao,ScaleControl:ts,FullscreenControl:os,Popup:ls,Marker:Yo,Style:mr,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:at,clearPrewarmedResources:ot,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return tt.workerCount},set workerCount(e){tt.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){e.clearTileCache(t)},workerUrl:""};return cs})),r}()},27084:function(e){"use strict";e.exports=Math.log2||function(e){return Math.log(e)*Math.LOG2E}},16825:function(e,t,r){"use strict";e.exports=function(e,t){t||(t=e,e=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function u(e,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||u!==i||c!==a||l(s))&&(r=0|e,i=u||0,a=c||0,t&&t(r,i,a,o))}function c(e){u(0,e)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function d(e){l(e)&&t&&t(r,i,a,o)}function p(e){0===n.buttons(e)?u(0,e):u(r,e)}function h(e){u(r|n.buttons(e),e)}function v(e){u(r&~n.buttons(e),e)}function m(){s||(s=!0,e.addEventListener("mousemove",p),e.addEventListener("mousedown",h),e.addEventListener("mouseup",v),e.addEventListener("mouseleave",c),e.addEventListener("mouseenter",c),e.addEventListener("mouseout",c),e.addEventListener("mouseover",c),e.addEventListener("blur",f),e.addEventListener("keyup",d),e.addEventListener("keydown",d),e.addEventListener("keypress",d),e!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",d),window.addEventListener("keydown",d),window.addEventListener("keypress",d)))}m();var g={element:e};return Object.defineProperties(g,{enabled:{get:function(){return s},set:function(t){t?m():s&&(s=!1,e.removeEventListener("mousemove",p),e.removeEventListener("mousedown",h),e.removeEventListener("mouseup",v),e.removeEventListener("mouseleave",c),e.removeEventListener("mouseenter",c),e.removeEventListener("mouseout",c),e.removeEventListener("mouseover",c),e.removeEventListener("blur",f),e.removeEventListener("keyup",d),e.removeEventListener("keydown",d),e.removeEventListener("keypress",d),e!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",d),window.removeEventListener("keydown",d),window.removeEventListener("keypress",d)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),g};var n=r(74311)},48956:function(e){var t={left:0,top:0};e.exports=function(e,r,n){r=r||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=e.clientX||0,o=e.clientY||0,s=(i=r)===window||i===document||i===document.body?t:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},74311:function(e,t){"use strict";function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"===typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<=0)return 1<0&&a(s,r))}catch(m){c.call(new d(r),m)}}}function c(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function f(e,t,r,n){for(var i=0;i1&&(i*=g=Math.sqrt(g),s*=g);var y=i*i,x=s*s,b=(u==c?-1:1)*Math.sqrt(Math.abs((y*x-y*m*m-x*v*v)/(y*m*m+x*v*v)));b==1/0&&(b=1);var _=b*i*m/s+(e+f)/2,w=b*-s*v/i+(n+d)/2,k=Math.asin(((n-w)/s).toFixed(9)),T=Math.asin(((d-w)/s).toFixed(9));(k=e<_?t-k:k)<0&&(k=2*t+k),(T=f<_?t-T:T)<0&&(T=2*t+T),c&&k>T&&(k-=2*t),!c&&T>k&&(T-=2*t)}if(Math.abs(T-k)>r){var M=T,S=f,A=d;T=k+r*(c&&T>k?1:-1);var C=a(f=_+i*Math.cos(T),d=w+s*Math.sin(T),i,s,l,0,c,S,A,[T,M,_,w])}var E=Math.tan((T-k)/4),P=4/3*i*E,L=4/3*s*E,I=[2*e-(e+P*Math.sin(k)),2*n-(n-L*Math.cos(k)),f+P*Math.sin(T),d-L*Math.cos(T),f,d];if(p)return I;C&&(I=I.concat(C));for(var R=0;R7&&(r.push(g.splice(0,7)),g.unshift("C"));break;case"S":var x=p,b=h;"C"!=t&&"S"!=t||(x+=x-o,b+=b-l),g=["C",x,b,g[1],g[2],g[3],g[4]];break;case"T":"Q"==t||"T"==t?(f=2*p-f,d=2*h-d):(f=p,d=h),g=i(p,h,f,d,g[1],g[2]);break;case"Q":f=g[1],d=g[2],g=i(p,h,g[1],g[2],g[3],g[4]);break;case"L":g=n(p,h,g[1],g[2]);break;case"H":g=n(p,h,g[1],h);break;case"V":g=n(p,h,p,g[1]);break;case"Z":g=n(p,h,u,c)}t=y,p=g[g.length-2],h=g[g.length-1],g.length>4?(o=g[g.length-4],l=g[g.length-3]):(o=p,l=h),r.push(g)}return r}},56131:function(e){"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(e,i){for(var a,o,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l0&&!i.call(e,0))for(var v=0;v0)for(var m=0;m=0&&"[object Function]"===t.call(e.callee)),n}},88641:function(e){"use strict";function t(e,t){if("string"!==typeof e)return[e];var r=[e];"string"===typeof t||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],i=t.escape||"___",a=!!t.flat;n.forEach((function(e){var t=new RegExp(["\\",e[0],"[^\\",e[0],"\\",e[1],"]*\\",e[1]].join("")),n=[];function a(t,a,o){var s=r.push(t.slice(e[0].length,-e[1].length))-1;return n.push(s),i+s+i}r.forEach((function(e,n){for(var i,o=0;e!=i;)if(i=e,e=e.replace(t,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=e})),n=n.reverse(),r=r.map((function(t){return n.forEach((function(r){t=t.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),e[0]+"$1"+e[1])})),t}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function e(t,r,n){for(var i,a=[],s=0;i=o.exec(t);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(t.slice(0,i.index)),a.push(e(r[i[1]],r)),t=t.slice(i.index+i[0].length)}return a.push(t),a}(r[0],r)}function r(e,t){if(t&&t.flat){var r,n=t&&t.escape||"___",i=e[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+e);r=i,i=i.replace(a,s)}return i}return e.reduce((function e(t,r){return Array.isArray(r)&&(r=r.reduce(e,"")),t+r}),"");function s(t,r){if(null==e[r])throw Error("Reference "+r+"is undefined");return e[r]}}function n(e,n){return Array.isArray(e)?r(e,n):t(e,n)}n.parse=t,n.stringify=r,e.exports=n},18863:function(e,t,r){"use strict";var n=r(71299);e.exports=function(e){var t;return arguments.length>1&&(e=arguments),"string"===typeof e?e=e.split(/\s/).map(parseFloat):"number"===typeof e&&(e=[e]),e.length&&"number"===typeof e[0]?t=1===e.length?{width:e[0],height:e[0],x:0,y:0}:2===e.length?{width:e[0],height:e[1],x:0,y:0}:{x:e[0],y:e[1],width:e[2]-e[0]||0,height:e[3]-e[1]||0}:e&&(t={x:(e=n(e,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:e.top||0},null==e.width?e.right?t.width=e.right-t.x:t.width=0:t.width=e.width,null==e.height?e.bottom?t.height=e.bottom-t.y:t.height=0:t.height=e.height),t}},95616:function(e){e.exports=function(e){var i=[];return e.replace(r,(function(e,r,a){var o=r.toLowerCase();for(a=function(e){var t=e.match(n);return t?t.map(Number):[]}(a),"m"==o&&a.length>2&&(i.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==t[o])return a.unshift(r),i.push(a);if(a.lengtha!==p>a&&i<(d-c)*(a-f)/(p-f)+c&&(o=!o)}return o}},52142:function(e,t,r){var n,i=r(69444),a=r(29023),o=r(87263),s=r(11328),l=r(55968),u=r(10670),c=!1,f=a();function d(e,t,r){var i=n.segments(e),a=n.segments(t),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(e){return!0===e?c=i():!1===e&&(c=!1),!1!==c&&c.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,c);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,c).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:l.union(e.combined,c),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:l.intersect(e.combined,c),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:l.difference(e.combined,c),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:l.differenceRev(e.combined,c),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:l.xor(e.combined,c),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:s(e.segments,f,c),inverted:e.inverted}},polygonFromGeoJSON:function(e){return u.toPolygon(n,e)},polygonToGeoJSON:function(e){return u.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"===typeof window&&(window.PolyBool=n),e.exports=n},69444:function(e){e.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!==typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},29023:function(e){e.exports=function(e){"number"!==typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"===typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=t[0];return(o-i)*(t[1]-a)-(s-a)*(l-i)>=-e},pointBetween:function(t,r,n){var i=t[1]-r[1],a=n[0]-r[0],o=t[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-i>e&&(a-u)*(i-c)/(o-c)+u-n>e&&(s=!s),a=u,o=c}return s}};return t}},10670:function(e){var t={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),i=1;i0}))}function c(e,n){var i=e.seg,a=n.seg,o=i.start,s=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);var f=t.linesIntersect(o,s,u,c);if(!1===f){if(!t.pointsCollinear(o,s,u))return!1;if(t.pointsSame(o,c)||t.pointsSame(s,u))return!1;var d=t.pointsSame(o,u),p=t.pointsSame(s,c);if(d&&p)return n;var h=!d&&t.pointBetween(o,u,c),v=!p&&t.pointBetween(s,u,c);if(d)return v?l(n,s):l(e,c),n;h&&(p||(v?l(n,s):l(e,c)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(e,u):0===f.alongB?l(e,f.pt):1===f.alongB&&l(e,c)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[],d=function(){if(p=a.getHead(),r&&r.vert(p.pt[0]),p.isStart){if(r&&r.segmentNew(p.seg,p.primary),h=u(p),v=h.before?h.before.ev:null,m=h.after?h.after.ev:null,r&&r.tempStatus(p.seg,!!v&&v.seg,!!m&&m.seg),(g=function(){if(v){var e=c(p,v);if(e)return e}return!!m&&c(p,m)}())&&(e?(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above):g.seg.otherFill=p.seg.myFill,r&&r.segmentUpdate(g.seg),p.other.remove(),p.remove()),a.getHead()!==p)return r&&r.rewind(p.seg),"continue";e?(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=m?m.seg.myFill.above:i,p.seg.myFill.above=y?!p.seg.myFill.below:p.seg.myFill.below):null===p.seg.otherFill&&(x=m?p.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:p.primary?o:i,p.seg.otherFill={above:x,below:x}),r&&r.status(p.seg,!!v&&v.seg,!!m&&m.seg),p.other.status=h.insert(n.node({ev:p}))}else{if(null===(b=p.status))throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");s.exists(b.prev)&&s.exists(b.next)&&c(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),p.primary||(_=p.seg.myFill,p.seg.myFill=p.seg.otherFill,p.seg.otherFill=_),f.push(p.seg)}a.getHead().remove()};!a.isEmpty();){var p,h,v,m,g,y,x,b,_;d()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,i,a,o=e[e.length-1],l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},n.prototype.read_uint16=function(e){var r=this.input;if(e+2>r.length)throw t("unexpected EOF","EBADDATA");return this.big_endian?256*r[e]+r[e+1]:r[e]+256*r[e+1]},n.prototype.read_uint32=function(e){var r=this.input;if(e+4>r.length)throw t("unexpected EOF","EBADDATA");return this.big_endian?16777216*r[e]+65536*r[e+1]+256*r[e+2]+r[e+3]:r[e]+256*r[e+1]+65536*r[e+2]+16777216*r[e+3]},n.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},n.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},n.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return r=this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return r=this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return r=this.read_uint32(t);case 9:return 0|(r=this.read_uint32(t));default:return null}},n.prototype.scan_ifd=function(e,n,i){var a=this.read_uint16(n);n+=2;for(var o=0;othis.input.length)throw t("unexpected EOF","EBADDATA");for(var h=[],v=d,m=0;m0&&(this.ifds_to_read.push({id:s,offset:h[0]}),p=!0),!1===i({is_big_endian:this.big_endian,ifd:e,tag:s,format:l,count:u,entry_offset:n+this.start,data_length:f,data_offset:d+this.start,value:h,is_subifd_link:p}))return void(this.aborted=!0);n+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(n)})},e.exports.ExifParser=n,e.exports.get_orientation=function(e){var t=0;try{return new n(e,0,e.length).each((function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch(r){return-1}}},76767:function(e,t,r){"use strict";var n=r(14847).n8,i=r(14847).Ag;function a(e,t){if(e.length<4+t)return null;var r=i(e,t);return e.length>4&15,i=15&e[4],a=e[5]>>4&15,o=n(e,6),l=8,u=0;ut.width||e.width===t.width&&e.height>t.height?e:t})),r=e.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t}));return t.width>r.height||t.width===r.height&&t.height>r.width?t:r}(t.sizes),n=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(n=0===e.value?r[n]:t[n=t[n=r[n]]]),"irot"===e.type)for(var i=0;i1&&(d.variants=f.variants),f.orientation&&(d.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=e.length){var p=a(e,f.exif_location.offset),h=e.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),v=s.get_orientation(h);v>0&&(d.orientation=v)}return d}}}}}}},2504:function(e,t,r){"use strict";var n=r(14847).eG,i=r(14847).OF,a=r(14847).mP,o=n("BM");e.exports=function(e){if(!(e.length<26)&&i(e,0,o))return{width:a(e,18),height:a(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},47342:function(e,t,r){"use strict";var n=r(14847).eG,i=r(14847).OF,a=r(14847).mP,o=n("GIF87a"),s=n("GIF89a");e.exports=function(e){if(!(e.length<10)&&(i(e,0,o)||i(e,0,s)))return{width:a(e,6),height:a(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},31355:function(e,t,r){"use strict";var n=r(14847).mP;e.exports=function(e){var t=n(e,0),r=n(e,2),i=n(e,4);if(0===t&&1===r&&i){for(var a=[],o={width:0,height:0},s=0;so.width||u>o.height)&&(o=c)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},54261:function(e,t,r){"use strict";var n=r(14847).n8,i=r(14847).eG,a=r(14847).OF,o=r(71371),s=i("Exif\0\0");e.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1]&&255===e[2])for(var t=2;;){for(;;){if(e.length-t<2)return;if(255===e[t++])break}for(var r,i,l=e[t++];255===l;)l=e[t++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(e.length-t<2)return;r=n(e,t)-2,t+=2}if(217===l||218===l)return;if(225===l&&r>=10&&a(e,t,s)&&(i=o.get_orientation(e.slice(t+6,t+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(e.length-t0&&(u.orientation=i),u}t+=r}}},6303:function(e,t,r){"use strict";var n=r(14847).eG,i=r(14847).OF,a=r(14847).Ag,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(e){if(!(e.length<24)&&i(e,0,o)&&i(e,12,s))return{width:a(e,16),height:a(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},38689:function(e,t,r){"use strict";var n=r(14847).eG,i=r(14847).OF,a=r(14847).Ag,o=n("8BPS\0\x01");e.exports=function(e){if(!(e.length<22)&&i(e,0,o))return{width:a(e,18),height:a(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},6881:function(e){"use strict";function t(e){return"number"===typeof e&&isFinite(e)&&e>0}var r=/<[-_.:a-zA-Z0-9][^>]*>/,n=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,i=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,a=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,s=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function l(e){return s.test(e)?e.match(s)[0]:"px"}e.exports=function(e){if(function(e){var t,r=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function d(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<e.length)){for(;t+8=10?r=r||c(e,t+8):"VP8L"===p&&h>=9?r=r||f(e,t+8):"VP8X"===p&&h>=10?r=r||d(e,t+8):"EXIF"===p&&(n=s.get_orientation(e.slice(t+8,t+8+h)),t=1/0),t+=8+h}else t++;if(r)return n>0&&(r.orientation=n),r}}}},91497:function(e,t,r){"use strict";e.exports={avif:r(24461),bmp:r(2504),gif:r(47342),ico:r(31355),jpeg:r(54261),png:r(6303),psd:r(38689),svg:r(6881),tiff:r(66278),webp:r(90784)}},33575:function(e,t,r){"use strict";var n=r(91497);e.exports=function(e){return function(e){for(var t=Object.keys(n),r=0;r1)for(var r=1;r1&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],r(e),e.after&&e.after(e))}function k(e){if(e){null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var t=0,r=0;if(b.groups=x=e.map((function(e,u){var c=x[u];return e?("function"===typeof e?e={after:e}:"number"===typeof e[0]&&(e={positions:e}),e=o(e,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),c||(x[u]=c={id:u,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},e=s({},y,e)),a(c,e,[{lineWidth:function(e){return.5*+e},capSize:function(e){return.5*+e},opacity:parseFloat,errors:function(e){return e=l(e),r+=e.length,e},positions:function(e,r){return e=l(e,"float64"),r.count=Math.floor(e.length/2),r.bounds=n(e,2),r.offset=t,t+=r.count,e}},{color:function(e,t){var r=t.count;if(e||(e="transparent"),!Array.isArray(e)||"number"===typeof e[0]){var n=e;e=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:e.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(s){t=i}return{fill:e({primitive:"triangle",elements:function(e,t){return t.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:e.prop("scale"),color:e.prop("fill"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),viewport:function(e,t){return[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]}},attributes:{position:{buffer:e.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:t}},g.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},g.prototype.render=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];t.length&&(e=this).update.apply(e,t),this.draw()},g.prototype.draw=function(){for(var e=this,t=[],r=arguments.length;r--;)t[r]=arguments[r];return(t.length?t:this.passes).forEach((function(t,r){var n;if(t&&Array.isArray(t))return(n=e).draw.apply(n,t);"number"===typeof t&&(t=e.passes[t]),t&&t.count>1&&t.opacity&&(e.regl._refresh(),t.fill&&t.triangles&&t.triangles.length>2&&e.shaders.fill(t),t.thickness&&(t.scale[0]*t.viewport.width>g.precisionThreshold||t.scale[1]*t.viewport.height>g.precisionThreshold||"rect"===t.join||!t.join&&(t.thickness<=2||t.count>=g.maxPoints)?e.shaders.rect(t):e.shaders.miter(t)))})),this},g.prototype.update=function(e){var t=this;if(e){null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var r=this.regl,o=this.gl;if(e.forEach((function(e,f){var h=t.passes[f];if(void 0!==e)if(null!==e){if("number"===typeof e[0]&&(e={positions:e}),e=s(e,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),h||(t.passes[f]=h={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},e=a({},g.defaults,e)),null!=e.thickness&&(h.thickness=parseFloat(e.thickness)),null!=e.opacity&&(h.opacity=parseFloat(e.opacity)),null!=e.miterLimit&&(h.miterLimit=parseFloat(e.miterLimit)),null!=e.overlay&&(h.overlay=!!e.overlay,f=D}));(I=I.slice(0,z)).push(D)}for(var F=function(e){var t=T.slice(2*O,2*I[e]).concat(D?T.slice(2*D):[]),r=(h.hole||[]).map((function(t){return t-D+(I[e]-O)})),n=u(t,r);n=n.map((function(t){return t+O+(t+Oe.length)&&(t=e.length);for(var r=0,n=new Array(t);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),u.vert=d(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(u.frag=u.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=e(u)}b.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},b.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},b.prototype.draw=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;nn)?t.tree=c(e,{bounds:f}):n&&n.length&&(t.tree=n),t.tree){var d={primitive:"points",usage:"static",data:t.tree,type:"uint32"};t.elements?t.elements(d):t.elements=o.elements(d)}var p=g.float32(e);return i({data:p,usage:"dynamic"}),a({data:g.fract32(e,p),usage:"dynamic"}),s({data:new Uint8Array(u),type:"uint8",usage:"stream"}),e}},{marker:function(t,r,n){var i=r.activation;if(i.forEach((function(e){return e&&e.destroy&&e.destroy()})),i.length=0,t&&"number"!==typeof t[0]){for(var a=[],s=0,l=Math.min(t.length,r.count);s=0)return a;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)t=e;else{t=new Uint8Array(e.length);for(var o=0,s=e.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},b.prototype.updatePalette=function(e){if(!this.tooManyColors){var t=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*e.length/t);if(n>1)for(var i=.25*(e=e.slice()).length%t;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x,s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y,l.height),[a,n,o,i]}function p(e){if("number"===typeof e)return[e,e,e,e];if(2===e.length)return[e[0],e[1],e[0],e[1]];var t=l(e);return[t.x,t.y,t.x+t.width,t.y+t.height]}e.exports=c,c.prototype.render=function(){for(var e,t=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(e=this).update.apply(e,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){t.draw(),t.dirty=!0,t.planned=null}))):(this.draw(),this.dirty=!0,o((function(){t.dirty=!1}))),this)},c.prototype.update=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t.length){for(var n=0;nT))&&(s.lower||!(k>>=t))<<3,(t|=r=(15<(e>>>=r))<<2)|(r=(3<(e>>>=r))<<1)|e>>>r>>1}function p(){function e(e){e:{for(var t=16;268435456>=t;t*=16)if(e<=t){e=t;break e}e=0}return 0<(t=r[d(e)>>2]).length?t.pop():new ArrayBuffer(e)}function t(e){r[d(e.byteLength)>>2].push(e)}var r=f(8,(function(){return[]}));return{alloc:e,free:t,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(e){t(e.buffer)}}}function h(e){return!!e&&"object"===typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"===typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||oe(e.data))}function v(e,t,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===c?i>>=1:5125===c&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(e){n.elementsCount--,delete s[e.id],e.buffer.destroy(),e.buffer=null}var s={},l=0,u={uint8:5121,uint16:5123};t.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var c=[];return{create:function(e,t){function s(e){if(e)if("number"===typeof e)l(e),c.primType=4,c.vertCount=0|e,c.type=5121;else{var t=null,r=35044,n=-1,i=-1,o=0,f=0;Array.isArray(e)||oe(e)||h(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(r=fe[e.usage]),"primitive"in e&&(n=ve[e.primitive]),"count"in e&&(i=0|e.count),"type"in e&&(f=u[e.type]),"length"in e?o=0|e.length:(o=i,5123===f||5122===f?o*=2:5125!==f&&5124!==f||(o*=4))),a(c,t,r,n,i,o,f)}else l(),c.primType=4,c.vertCount=0,c.type=5121;return s}var l=r.create(null,34963,!0),c=new i(l._buffer);return n.elementsCount++,s(e),s._reglType="elements",s._elements=c,s.subdata=function(e,t){return l.subdata(e,t),s},s.destroy=function(){o(c)},s},createStream:function(e){var t=c.pop();return t||(t=new i(r.create(null,34963,!0,!1)._buffer)),a(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){c.push(e)},getElements:function(e){return"function"===typeof e&&e._elements instanceof i?e._elements:null},clear:function(){se(s).forEach(o)}}}function w(e){for(var t=ie.allocType(5123,e.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;t[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,d(r,n[i]),e.mipmask|=1<t;++t)e.images[t]=null;return e}function T(e){for(var t=e.images,r=0;rt){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var e=0;return Object.keys(ae).forEach((function(t){e+=ae[t].stats.size})),e}),{create2D:function(t,r){function n(e,t){var r=i.texInfo;L.call(r);var a=_();return"number"===typeof e?y(a,0|e,"number"===typeof t?0|t:0|e):e?(I(r,e),x(a,e)):y(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,l(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,D(i),b(a,3553),R(r,3553),z(),T(a),o.profile&&(i.stats.size=P(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=Y[i.internalformat],n.type=X[i.type],n.mag=K[r.magFilter],n.min=$[r.minFilter],n.wrapS=J[r.wrapS],n.wrapT=J[r.wrapT],n}var i=new O(3553);return ae[i.id]=i,a.textureCount++,n(t,r),n.subimage=function(e,t,r,a){t|=0,r|=0,a|=0;var o=v();return l(o,i),o.width=0,o.height=0,d(o,e),o.width=o.width||(i.width>>a)-t,o.height=o.height||(i.height>>a)-r,D(i),p(o,3553,t,r,a),z(),m(o),n},n.resize=function(t,r){var a=0|t,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,D(i);for(var l=0;i.mipmask>>l;++l){var u=a>>l,c=s>>l;if(!u||!c)break;e.texImage2D(3553,l,i.format,u,c,0,i.format,i.type,null)}return z(),o.profile&&(i.stats.size=P(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(t,r,n,i,s,c){function f(e,t,r,n,i,a){var s,c=h.texInfo;for(L.call(c),s=0;6>s;++s)g[s]=_();if("number"!==typeof e&&e){if("object"===typeof e)if(t)x(g[0],e),x(g[1],t),x(g[2],r),x(g[3],n),x(g[4],i),x(g[5],a);else if(I(c,e),u(h,e),"faces"in e)for(e=e.faces,s=0;6>s;++s)l(g[s],h),x(g[s],e[s]);else for(s=0;6>s;++s)x(g[s],e)}else for(e=0|e||1,s=0;6>s;++s)y(g[s],e,e);for(l(h,g[0]),h.mipmask=c.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,D(h),s=0;6>s;++s)b(g[s],34069+s);for(R(c,34067),z(),o.profile&&(h.stats.size=P(h.internalformat,h.type,f.width,f.height,c.genMipmaps,!0)),f.format=Y[h.internalformat],f.type=X[h.type],f.mag=K[c.magFilter],f.min=$[c.minFilter],f.wrapS=J[c.wrapS],f.wrapT=J[c.wrapT],s=0;6>s;++s)T(g[s]);return f}var h=new O(34067);ae[h.id]=h,a.cubeCount++;var g=Array(6);return f(t,r,n,i,s,c),f.subimage=function(e,t,r,n,i){r|=0,n|=0,i|=0;var a=v();return l(a,h),a.width=0,a.height=0,d(a,t),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,D(h),p(a,34069+e,r,n,i),z(),m(a),f},f.resize=function(t){if((t|=0)!==h.width){f.width=h.width=t,f.height=h.height=t,D(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)e.texImage2D(34069+r,n,h.format,t>>n,t>>n,0,h.format,h.type,null);return z(),o.profile&&(h.stats.size=P(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var t=0;tr;++r)if(0!==(t.mipmask&1<>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;6>n;++n)e.texImage2D(34069+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);R(t.texInfo,t.target)}))},refresh:function(){for(var t=0;ti;++i){for(u=0;ue;++e)r[e].resize(n);return t.width=t.height=n,t},_reglType:"framebufferCube",destroy:function(){r.forEach((function(e){e.destroy()}))}})},clear:function(){se(T).forEach(m)},restore:function(){x.cur=null,x.next=null,x.dirty=!0,se(T).forEach((function(t){t.framebuffer=e.createFramebuffer(),g(t)}))}})}function R(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function O(e,t,r,n,i,a,o){function s(e){if(e!==g.currentVAO){var r=t.oes_vertex_array_object;e?r.bindVertexArrayOES(e.vao):r.bindVertexArrayOES(null),g.currentVAO=e}}function l(r){if(r!==g.currentVAO){if(r)r.bindAttrs();else{for(var n=t.angle_instanced_arrays,i=0;i=f.byteLength?l.subdata(f):(l.destroy(),r.buffers[s]=null)),r.buffers[s]||(l=r.buffers[s]=i.create(u,34962,!1,!0)),c.buffer=i.getBuffer(l),c.size=0|c.buffer.dimension,c.normalized=!1,c.type=c.buffer.dtype,c.offset=0,c.stride=0,c.divisor=0,c.state=1,e[s]=1):i.getBuffer(u)?(c.buffer=i.getBuffer(u),c.size=0|c.buffer.dimension,c.normalized=!1,c.type=c.buffer.dtype,c.offset=0,c.stride=0,c.divisor=0,c.state=1):i.getBuffer(u.buffer)?(c.buffer=i.getBuffer(u.buffer),c.size=0|(+u.size||c.buffer.dimension),c.normalized=!!u.normalized||!1,c.type="type"in u?ce[u.type]:c.buffer.dtype,c.offset=0|(u.offset||0),c.stride=0|(u.stride||0),c.divisor=0|(u.divisor||0),c.state=1):"x"in u&&(c.x=+u.x||0,c.y=+u.y||0,c.z=+u.z||0,c.w=+u.w||0,c.state=2)}for(l=0;le&&(e=t.stats.uniformsCount)})),e},r.getMaxAttributesCount=function(){var e=0;return d.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var t=e.deleteShader.bind(e);se(u).forEach(t),u={},se(c).forEach(t),c={},d.forEach((function(t){e.deleteProgram(t.program)})),d.length=0,f={},r.shaderCount=0},program:function(t,n,i,a){var o=f[n];o||(o=f[n]={});var p=o[t];if(p&&(p.refCount++,!a))return p;var h=new s(n,t);return r.shaderCount++,l(h,i,a),p||(o[t]=h),d.push(h),Q(h,{destroy:function(){if(h.refCount--,0>=h.refCount){e.deleteProgram(h.program);var t=d.indexOf(h);d.splice(t,1),r.shaderCount--}0>=o[h.vertId].refCount&&(e.deleteShader(c[h.vertId]),delete c[h.vertId],delete f[h.fragId][h.vertId]),Object.keys(f[h.fragId]).length||(e.deleteShader(u[h.fragId]),delete u[h.fragId],delete f[h.fragId])}})},restore:function(){u={},c={};for(var e=0;e>2),r=0;r>5]|=(255&e.charCodeAt(r/8))<<24-r%32;var n,i,a,o,s,l,u,c,f,d,p,h=8*e.length;for(e=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),t[h>>5]|=128<<24-h%32,t[15+(h+64>>9<<4)]=h,c=0;cf;f++){var v;16>f?r[f]=t[f+c]:(d=f,p=B(p=Z(p=r[f-2],17)^Z(p,19)^p>>>10,r[f-7]),v=Z(v=r[f-15],7)^Z(v,18)^v>>>3,r[d]=B(B(p,v),r[f-16])),d=B(B(B(B(u,d=Z(d=o,6)^Z(d,11)^Z(d,25)),o&s^~o&l),Oe[f]),r[f]),p=B(u=Z(u=h,2)^Z(u,13)^Z(u,22),h&n^h&i^n&i),u=l,l=s,s=o,o=B(a,d),a=i,i=n,n=h,h=B(d,p)}e[0]=B(h,e[0]),e[1]=B(n,e[1]),e[2]=B(i,e[2]),e[3]=B(a,e[3]),e[4]=B(o,e[4]),e[5]=B(s,e[5]),e[6]=B(l,e[6]),e[7]=B(u,e[7])}for(t="",r=0;r<32*e.length;r+=8)t+=String.fromCharCode(e[r>>5]>>>24-r%32&255);return t}function j(e){for(var t,r="",n=0;n>>4&15)+"0123456789abcdef".charAt(15&t);return r}function N(e){for(var t,r,n="",i=-1;++i=t&&56320<=r&&57343>=r&&(t=65536+((1023&t)<<10)+(1023&r),i++),127>=t?n+=String.fromCharCode(t):2047>=t?n+=String.fromCharCode(192|t>>>6&31,128|63&t):65535>=t?n+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):2097151>=t&&(n+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return n}function Z(e,t){return e>>>t|e<<32-t}function B(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function V(e){return Array.prototype.slice.call(e)}function U(e){return V(e).join("")}function H(e){function t(){var e=[],t=[];return Q((function(){e.push.apply(e,V(arguments))}),{def:function(){var r="v"+i++;return t.push(r),0"+t+"?"+i+".constant["+t+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",c,"=",a,".createStream(",34962,",",i,".buffer);","}else{",c,"=",a,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",c,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",c,");","}"),l}))})),o}function L(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r=t[e];n[e]=X((function(e,t){return"number"===typeof r||"boolean"===typeof r?""+r:e.link(r)}))})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=K(t,(function(e,r){return e.invoke(r,t)}))})),n}function I(e,t,n,i,a){function o(e){var t=l[e];t&&(f[e]=t)}var s=M(e,t),l=T(e,p=w(e,a),a),c=A(e,a),f=C(e,a),d=S(e,a,s);o("viewport"),o(g("scissor.box"));var p,h=0>1)",s],");")}function t(){r(l,".drawArraysInstancedANGLE(",[h,v,m,s],");")}p&&"null"!==p?y?e():(r("if(",p,"){"),e(),r("}else{"),t(),r("}")):t()}function o(){function e(){r(c+".drawElements("+[h,m,g,v+"<<(("+g+"-5121)>>1)"]+");")}function t(){r(c+".drawArrays("+[h,v,m]+");")}p&&"null"!==p?y?e():(r("if(",p,"){"),e(),r("}else{"),t(),r("}")):t()}var s,l,u=e.shared,c=u.gl,f=u.draw,d=n.draw,p=function(){var i=d.elements,a=t;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(e,a),d.elementsActive&&a("if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",f,".","elements",";","if(",i,"){",c,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",u.vao,".currentVAO){",i,"=",e.shared.elements+".getElements("+u.vao,".currentVAO.elements);",fe?"":"if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),h=i("primitive"),v=i("offset"),m=function(){var i=d.count,a=t;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(e,a)):i=a.def(f,".","count"),i}();if("number"===typeof m){if(0===m)return}else r("if(",m,"){"),r.exit("}");le&&(s=i("instances"),l=e.instancing);var g=p+".type",y=d.elements&&Y(d.elements)&&!d.vaoActive;le&&("number"!==typeof s||0<=s)?"string"===typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function V(e,t,r,n,i){return i=(t=b()).proc("body",i),le&&(t.instancing=i.def(t.shared.extensions,".angle_instanced_arrays")),e(t,i,r,n),t.compile().body}function U(e,t,r,n){F(e,t),r.useVAO?r.drawVAO?t(e.shared.vao,".setVAO(",r.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),N(e,t,r,n.attributes,(function(){return!0}))),Z(e,t,r,n.uniforms,(function(){return!0}),!1),B(e,t,t,r)}function $(e,t){var r=e.proc("draw",1);F(e,r),R(e,r,t.context),O(e,r,t.framebuffer),D(e,r,t),z(e,r,t.state),j(e,r,t,!1,!0);var n=t.shader.progVar.append(e,r);if(r(e.shared.gl,".useProgram(",n,".program);"),t.shader.program)U(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var i=e.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(e.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",e.link((function(r){return V(U,e,t,r,1)})),"(",n,");",o,".call(this,a0);"))}0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var e=0;return Object.keys(c).forEach((function(t){e+=c[t].stats.size})),e}),{create:function(t,r){function o(t,r){var n=0,a=0,c=32854;if("object"===typeof t&&t?("shape"in t?(n=0|(a=t.shape)[0],a=0|a[1]):("radius"in t&&(n=a=0|t.radius),"width"in t&&(n=0|t.width),"height"in t&&(a=0|t.height)),"format"in t&&(c=s[t.format])):"number"===typeof t?(n=0|t,a="number"===typeof r?0|r:n):t||(n=a=1),n!==u.width||a!==u.height||c!==u.format)return o.width=u.width=n,o.height=u.height=a,u.format=c,e.bindRenderbuffer(36161,u.renderbuffer),e.renderbufferStorage(36161,c,n,a),i.profile&&(u.stats.size=Pe[u.format]*u.width*u.height),o.format=l[u.format],o}var u=new a(e.createRenderbuffer());return c[u.id]=u,n.renderbufferCount++,o(t,r),o.resize=function(t,r){var n=0|t,a=0|r||n;return n===u.width&&a===u.height||(o.width=u.width=n,o.height=u.height=a,e.bindRenderbuffer(36161,u.renderbuffer),e.renderbufferStorage(36161,u.format,n,a),i.profile&&(u.stats.size=Pe[u.format]*u.width*u.height)),o},o._reglType="renderbuffer",o._renderbuffer=u,i.profile&&(o.stats=u.stats),o.destroy=function(){u.decRef()},o},clear:function(){se(c).forEach(o)},restore:function(){se(c).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)})),e.bindRenderbuffer(36161,null)}}},Ie=[];Ie[6408]=4,Ie[6407]=3;var Re=[];Re[5121]=1,Re[5126]=4,Re[36193]=2;var Oe=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],De=["x","y","z","w"],ze="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Fe={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},je={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ne={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ze={cw:2304,ccw:2305},Be=new q(!1,!1,!1,(function(){})),Ve=function(e,t){function r(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null}function n(e,t,n){var i=o.pop()||new r;i.startQueryIndex=e,i.endQueryIndex=t,i.sum=0,i.stats=n,s.push(i)}if(!t.ext_disjoint_timer_query)return null;var i=[],a=[],o=[],s=[],l=[],u=[];return{beginQuery:function(e){var r=i.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,r),a.push(r),n(a.length-1,a.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:n,update:function(){var e,r;if(0!==(e=a.length)){u.length=Math.max(u.length,e+1),l.length=Math.max(l.length,e+1),l[0]=0;var n=u[0]=0;for(r=e=0;r=G.length&&n()}var r=J(G,e);G[r]=t}}}function d(){var e=H.viewport,t=H.scissor_box;e[0]=e[1]=t[0]=t[1]=0,E.viewportWidth=E.framebufferWidth=E.drawingBufferWidth=e[2]=t[2]=m.drawingBufferWidth,E.viewportHeight=E.framebufferHeight=E.drawingBufferHeight=e[3]=t[3]=m.drawingBufferHeight}function p(){E.tick+=1,E.time=v(),d(),U.procs.poll()}function h(){Z.refresh(),d(),U.procs.refresh(),M&&M.update()}function v(){return(ne()-S)/1e3}if(!(e=u(e)))return null;var m=e.gl,g=m.getContextAttributes();m.isContextLost();var y=c(m,e);if(!y)return null;var x=i(),w={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},k=e.cachedCode||{},T=y.extensions,M=Ve(m,T),S=ne(),A=m.drawingBufferWidth,C=m.drawingBufferHeight,E={tick:0,time:0,viewportWidth:A,viewportHeight:C,framebufferWidth:A,framebufferHeight:C,drawingBufferWidth:A,drawingBufferHeight:C,pixelRatio:e.pixelRatio},P=(A={elements:null,primitive:4,count:-1,offset:0,instances:-1},ae(m,T)),R=b(m,w,e,(function(e){return j.destroyBuffer(e)})),F=_(m,T,R,w),j=O(m,T,P,w,R,F,A),N=D(m,x,w,e),Z=L(m,T,P,(function(){U.procs.poll()}),E,w,e),B=Le(m,T,P,w,e),V=I(m,T,P,Z,B,w),U=$(m,x,T,P,R,F,Z,V,{},j,N,A,E,M,k,e),H=(x=z(m,V,U.procs.poll,E,g,T,P),U.next),W=m.canvas,G=[],q=[],Y=[],X=[e.onDestroy],K=null;W&&(W.addEventListener("webglcontextlost",a,!1),W.addEventListener("webglcontextrestored",o,!1));var ee=V.setFBO=s({framebuffer:te.define.call(null,1,"framebuffer")});return h(),g=Q(s,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var t=0;6>t;++t)ee(Q({framebuffer:e.framebuffer.faces[t]},e),l);else ee(e,l);else l(null,e)},prop:te.define.bind(null,1),context:te.define.bind(null,2),this:te.define.bind(null,3),draw:s({}),buffer:function(e){return R.create(e,34962,!1,!1)},elements:function(e){return F.create(e,!1)},texture:Z.create2D,cube:Z.createCube,renderbuffer:B.create,framebuffer:V.create,framebufferCube:V.createCube,vao:j.createVAO,attributes:g,frame:f,on:function(e,t){var r;switch(e){case"frame":return f(t);case"lost":r=q;break;case"restore":r=Y;break;case"destroy":r=X}return r.push(t),{cancel:function(){for(var e=0;e2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,a,o,s;if("string"===typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var l=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(n(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},37865:function(e,t,r){"use strict";var n=r(90386),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var a=r(40410),o=r(37493);r(42018)(c,a);for(var s=i(o.prototype),l=0;l0)if("string"===typeof t||s.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)s.endEmitted?w(e,new _):A(e,s,t,!0);else if(s.ended)w(e,new x);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?A(e,s,t,!1):I(e,s)):A(e,s,t,!1)}else n||(s.reading=!1,I(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function P(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(L,e))}function L(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,F(e)}function I(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){a("readable nexttick read 0"),e.read(0)}function z(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),F(e),t.flowing&&!t.reading&&e.read(0)}function F(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function j(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function N(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(Z,t,e))}function Z(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function B(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return a("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):P(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&N(this),null;var n,i=t.needReadable;return a("need readable",i),(0===t.length||t.length-e0?j(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&N(this)),null!==n&&this.emit("data",n),n},M.prototype._read=function(e){w(this,new b("_read()"))},M.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===i.stdout||e===i.stderr?m:u;function l(t,i){a("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,a("cleanup"),e.removeListener("close",h),e.removeListener("finish",v),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",l),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",d),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function u(){a("onend"),e.end()}n.endEmitted?i.nextTick(s):r.once("end",s),e.on("unpipe",l);var c=function(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,F(e))}}(r);e.on("drain",c);var f=!1;function d(t){a("ondata");var i=e.write(t);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==B(n.pipes,e))&&!f&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(t){a("onerror",t),m(),e.removeListener("error",p),0===o(e,"error")&&w(e,t)}function h(){e.removeListener("finish",v),m()}function v(){a("onfinish"),e.removeListener("close",h),m()}function m(){a("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",h),e.once("finish",v),e.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),e},M.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?P(this):n.reading||i.nextTick(D,this))),r},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(O,this),r},M.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(O,this),t},M.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(z,e,t))}(this,e)),e.paused=!1,this},M.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!==i&&void 0!==i)&&(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(e,t,r){r(new v("_write()"))},M.prototype._writev=null,M.prototype.end=function(e,t,r){var n=this._writableState;return"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,L(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),M.prototype.destroy=f.destroy,M.prototype._undestroy=f.undestroy,M.prototype._destroy=function(e,t){t(e)}},68221:function(e,t,r){"use strict";var n,i=r(90386);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(12726),s=Symbol("lastResolve"),l=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),p=Symbol("stream");function h(e,t){return{value:e,done:t}}function v(e){var t=e[s];if(null!==t){var r=e[p].read();null!==r&&(e[f]=null,e[s]=null,e[l]=null,t(h(r,!1)))}}function m(e){i.nextTick(v,e)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((a(n={get stream(){return this[p]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[p].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[u]?r(e[u]):t(h(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(h(void 0,!0)):t[d](r,n)}),n)}}(n,this));else{var a=this[p].read();if(null!==a)return Promise.resolve(h(a,!1));r=new Promise(this[d])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),g);e.exports=function(e){var t,r=Object.create(y,(a(t={},p,{value:e,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,l,{value:null,writable:!0}),a(t,u,{value:null,writable:!0}),a(t,c,{value:e._readableState.endEmitted,writable:!0}),a(t,d,{value:function(e,t){var n=r[p].read();n?(r[f]=null,r[s]=null,r[l]=null,e(h(n,!1))):(r[s]=e,r[l]=t)},writable:!0}),t));return r[f]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[f]=null,r[s]=null,r[l]=null,t(e)),void(r[u]=e)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[l]=null,n(h(void 0,!0))),r[c]=!0})),e.on("readable",m.bind(null,r)),r}},31125:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,i=o.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=i,n=s,o.prototype.copy.call(t,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0===(e-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&d.forEach(l),a||(d.forEach(l),f(c))}))}));return t.reduce(u)}},56306:function(e,t,r){"use strict";var n=r(74322).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},71405:function(e,t,r){e.exports=r(15398).EventEmitter},68019:function(e,t,r){"use strict";var n=r(71665).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!==typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.s=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},90715:function(e,t,r){var n=r(32791),i=r(41633)("stream-parser");e.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),e._bytes=c,e._skipBytes=f,t&&(e._passthrough=d),t?e._transform=h:e._write=p};var a=-1,o=0,s=1,l=2;function u(e){i("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=a,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function c(e,t){n(!this._parserCallback,'there is already a "callback" set!'),n(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||u(this),i("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=o}function f(e,t){n(!this._parserCallback,'there is already a "callback" set!'),n(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||u(this),i("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=s}function d(e,t){n(!this._parserCallback,'There is already a "callback" set!'),n(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||u(this),i("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=l}function p(e,t,r){this._parserInit||u(this),i("write(%o bytes)",e.length),"function"==typeof t&&(r=t),m(this,e,null,r)}function h(e,t,r){this._parserInit||u(this),i("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),m(this,e,t,r)}function v(e,t,r,n){if(e._parserBytesLeft-=t.length,i("%o bytes left for stream piece",e._parserBytesLeft),e._parserState===o?(e._parserBuffers.push(t),e._parserBuffered+=t.length):e._parserState===l&&r(t),0!==e._parserBytesLeft)return n;var s=e._parserCallback;if(s&&e._parserState===o&&e._parserBuffers.length>1&&(t=Buffer.concat(e._parserBuffers,e._parserBuffered)),e._parserState!==o&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=a,e._parserBuffers.splice(0),s){var u=[];t&&u.push(t),r&&u.push(r);var c=s.length>u.length;c&&u.push(g(n));var f=s.apply(e,u);if(!c||n===f)return n}}var m=g((function e(t,r,n,i){return t._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return v(t,r,n,i)}:function(){var a=r.slice(0,t._parserBytesLeft);return v(t,a,n,(function(o){return o?i(o):r.length>a.length?function(){return e(t,r.slice(a.length),n,i)}:void 0}))}}));function g(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}},41633:function(e,t,r){var n=r(90386);function i(){var e;try{e=t.storage.debug}catch(r){}return!e&&"undefined"!==typeof n&&"env"in n&&(e=n.env.DEBUG),e}(t=e.exports=r(74469)).log=function(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,a=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))})),e.splice(a,0,n)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(r){}},t.load=i,t.useColors=function(){return!("undefined"===typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(i())},74469:function(e,t,r){var n;function i(e){function r(){if(r.enabled){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s0)return function(e){if(!((e=String(e)).length>100)){var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*a;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===u&&!1===isNaN(e))return s.long?o(l=e,i,"day")||o(l,n,"hour")||o(l,r,"minute")||o(l,t,"second")||l+" ms":function(e){return e>=i?Math.round(e/i)+"d":e>=n?Math.round(e/n)+"h":e>=r?Math.round(e/r)+"m":e>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},99011:function(e,t,r){"use strict";var n=r(88641);e.exports=function(e,t,r){if(null==e)throw Error("First argument should be a string");if(null==t)throw Error("Separator should be a string or a RegExp");r?("string"===typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"===typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(e){return 1===e.length&&(e+=e),e})));var i=n.parse(e,{flat:!0,brackets:r.ignore}),a=i[0].split(t);if(r.escape){for(var o=[],s=0;s0;){t=u[u.length-1];var p=e[t];if(a[t]=0&&s[t].push(o[v])}a[t]=h}else{if(n[t]===r[t]){var m=[],g=[],y=0;for(h=l.length-1;h>=0;--h){var x=l[h];if(i[x]=!1,m.push(x),g.push(s[x]),y+=s[x].length,o[x]=f.length,x===t){l.length=h;break}}f.push(m);var b=new Array(y);for(h=0;h1&&(i=1),i<-1&&(i=-1),(e*n-t*r<0?-1:1)*Math.acos(i)};t.default=function(e){var t=e.px,r=e.py,l=e.cx,u=e.cy,c=e.rx,f=e.ry,d=e.xAxisRotation,p=void 0===d?0:d,h=e.largeArcFlag,v=void 0===h?0:h,m=e.sweepFlag,g=void 0===m?0:m,y=[];if(0===c||0===f)return[];var x=Math.sin(p*i/360),b=Math.cos(p*i/360),_=b*(t-l)/2+x*(r-u)/2,w=-x*(t-l)/2+b*(r-u)/2;if(0===_&&0===w)return[];c=Math.abs(c),f=Math.abs(f);var k=Math.pow(_,2)/Math.pow(c,2)+Math.pow(w,2)/Math.pow(f,2);k>1&&(c*=Math.sqrt(k),f*=Math.sqrt(k));var T=function(e,t,r,n,a,o,l,u,c,f,d,p){var h=Math.pow(a,2),v=Math.pow(o,2),m=Math.pow(d,2),g=Math.pow(p,2),y=h*v-h*g-v*m;y<0&&(y=0),y/=h*g+v*m;var x=(y=Math.sqrt(y)*(l===u?-1:1))*a/o*p,b=y*-o/a*d,_=f*x-c*b+(e+r)/2,w=c*x+f*b+(t+n)/2,k=(d-x)/a,T=(p-b)/o,M=(-d-x)/a,S=(-p-b)/o,A=s(1,0,k,T),C=s(k,T,M,S);return 0===u&&C>0&&(C-=i),1===u&&C<0&&(C+=i),[_,w,A,C]}(t,r,l,u,c,f,v,g,x,b,_,w),M=n(T,4),S=M[0],A=M[1],C=M[2],E=M[3],P=Math.abs(E)/(i/4);Math.abs(1-P)<1e-7&&(P=1);var L=Math.max(Math.ceil(P),1);E/=L;for(var I=0;It[2]&&(t[2]=u[c+0]),u[c+1]>t[3]&&(t[3]=u[c+1]);return t}},29988:function(e,t,r){"use strict";e.exports=function(e){for(var t,r=[],o=0,s=0,l=0,u=0,c=null,f=null,d=0,p=0,h=0,v=e.length;h4?(o=m[m.length-4],s=m[m.length-3]):(o=d,s=p),r.push(m)}return r};var n=r(7095);function i(e,t,r,n){return["C",e,t,r,n,r,n]}function a(e,t,r,n,i,a){return["C",e/3+2/3*r,t/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},82019:function(e,t,r){"use strict";var n,i=r(1750),a=r(95616),o=r(31457),s=r(89546),l=r(44781),u=document.createElement("canvas"),c=u.getContext("2d");e.exports=function(e,t){if(!s(e))throw Error("Argument should be valid svg path string");var r,f;t||(t={}),t.shape?(r=t.shape[0],f=t.shape[1]):(r=u.width=t.w||t.width||200,f=u.height=t.h||t.height||200);var d=Math.min(r,f),p=t.stroke||0,h=t.viewbox||t.viewBox||i(e),v=[r/(h[2]-h[0]),f/(h[3]-h[1])],m=Math.min(v[0]||0,v[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,r,f),c.fillStyle="white",p&&("number"!=typeof p&&(p=1),c.strokeStyle=p>0?"white":"black",c.lineWidth=Math.abs(p)),c.translate(.5*r,.5*f),c.scale(m,m),function(){if(null!=n)return n;var e=document.createElement("canvas").getContext("2d");if(e.canvas.width=e.canvas.height=1,!window.Path2D)return n=!1;var t=new Path2D("M0,0h1v1h-1v-1Z");e.fillStyle="black",e.fill(t);var r=e.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var g=new Path2D(e);c.fill(g),p&&c.stroke(g)}else{var y=a(e);o(c,y),c.fill(),p&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=t.cutoff?t.cutoff:.5,radius:null!=t.radius?t.radius:.5*d})}},84267:function(e,t,r){var n;!function(i){var a=/^\s+/,o=/\s+$/,s=0,l=i.round,u=i.min,c=i.max,f=i.random;function d(e,t){if(t=t||{},(e=e||"")instanceof d)return e;if(!(this instanceof d))return new d(e,t);var r=function(e){var t,r,n,s={r:0,g:0,b:0},l=1,f=null,d=null,p=null,h=!1,v=!1;return"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(o,"").toLowerCase();var t,r=!1;if(P[e])e=P[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=Z.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=Z.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Z.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Z.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Z.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Z.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Z.hex8.exec(e))?{r:D(t[1]),g:D(t[2]),b:D(t[3]),a:N(t[4]),format:r?"name":"hex8"}:(t=Z.hex6.exec(e))?{r:D(t[1]),g:D(t[2]),b:D(t[3]),format:r?"name":"hex"}:(t=Z.hex4.exec(e))?{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),a:N(t[4]+""+t[4]),format:r?"name":"hex8"}:!!(t=Z.hex3.exec(e))&&{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),format:r?"name":"hex"}}(e)),"object"==typeof e&&(B(e.r)&&B(e.g)&&B(e.b)?(t=e.r,r=e.g,n=e.b,s={r:255*R(t,255),g:255*R(r,255),b:255*R(n,255)},h=!0,v="%"===String(e.r).substr(-1)?"prgb":"rgb"):B(e.h)&&B(e.s)&&B(e.v)?(f=F(e.s),d=F(e.v),s=function(e,t,r){e=6*R(e,360),t=R(t,100),r=R(r,100);var n=i.floor(e),a=e-n,o=r*(1-t),s=r*(1-a*t),l=r*(1-(1-a)*t),u=n%6,c=[r,s,o,o,l,r][u],f=[l,r,r,s,o,o][u],d=[o,o,l,r,r,s][u];return{r:255*c,g:255*f,b:255*d}}(e.h,f,d),h=!0,v="hsv"):B(e.h)&&B(e.s)&&B(e.l)&&(f=F(e.s),p=F(e.l),s=function(e,t,r){var n,i,a;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=R(e,360),t=R(t,100),r=R(r,100),0===t)n=i=a=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),i=o(l,s,e),a=o(l,s,e-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,f,p),h=!0,v="hsl"),e.hasOwnProperty("a")&&(l=e.a)),l=I(l),{ok:h,format:e.format||v,r:u(255,c(s.r,0)),g:u(255,c(s.g,0)),b:u(255,c(s.b,0)),a:l}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=l(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=r.ok,this._tc_id=s++}function p(e,t,r){e=R(e,255),t=R(t,255),r=R(r,255);var n,i,a=c(e,t,r),o=u(e,t,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case e:n=(t-r)/l+(t>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(d(n));return a}function E(e,t){t=t||6;for(var r=d(e).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/t;t--;)o.push(d({h:n,s:i,v:a})),a=(a+s)%1;return o}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:i.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=I(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=p(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return v(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,i){var a=[z(l(e).toString(16)),z(l(t).toString(16)),z(l(r).toString(16)),z(j(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*R(this._r,255))+"%",g:l(100*R(this._g,255))+"%",b:l(100*R(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*R(this._r,255))+"%, "+l(100*R(this._g,255))+"%, "+l(100*R(this._b,255))+"%)":"rgba("+l(100*R(this._r,255))+"%, "+l(100*R(this._g,255))+"%, "+l(100*R(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[v(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+m(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=d(e);r="#"+m(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(k,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(C,arguments)},complement:function(){return this._applyCombination(T,arguments)},monochromatic:function(){return this._applyCombination(E,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(M,arguments)},tetrad:function(){return this._applyCombination(S,arguments)}},d.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:F(e[n]));e=r}return d(e,t)},d.equals=function(e,t){return!(!e||!t)&&d(e).toRgbString()==d(t).toRgbString()},d.random=function(){return d.fromRatio({r:f(),g:f(),b:f()})},d.mix=function(e,t,r){r=0===r?0:r||50;var n=d(e).toRgb(),i=d(t).toRgb(),a=r/100;return d({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},d.readability=function(e,t){var r=d(e),n=d(t);return(i.max(r.getLuminance(),n.getLuminance())+.05)/(i.min(r.getLuminance(),n.getLuminance())+.05)},d.isReadable=function(e,t,r){var n,i,a=d.readability(e,t);switch(i=!1,(n=function(e){var t,r;return t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},d.mostReadable=function(e,t,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=d(t[u]));return d.isReadable(e,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,d.mostReadable(e,["#fff","#000"],r))};var P=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},L=d.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(P);function I(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function R(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"===typeof e&&-1!=e.indexOf("%")}(e);return e=u(t,c(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),i.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function O(e){return u(1,c(0,e))}function D(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function F(e){return e<=1&&(e=100*e+"%"),e}function j(e){return i.round(255*parseFloat(e)).toString(16)}function N(e){return D(e)/255}var Z=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",r="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function B(e){return!!Z.CSS_UNIT.exec(e)}e.exports?e.exports=d:void 0===(n=function(){return d}.call(t,r,t,e))||(e.exports=n)}(Math)},57060:function(e){"use strict";e.exports=r,e.exports.float32=e.exports.float=r,e.exports.fract32=e.exports.fract=function(e,t){if(e.length){if(e instanceof Float32Array)return new Float32Array(e.length);t instanceof Float32Array||(t=r(e));for(var n=0,i=t.length;n":(t.length>100&&(t=t.slice(0,99)+"\u2026"),t=t.replace(i,(function(e){switch(e){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},47403:function(e,t,r){"use strict";var n=r(24582),i={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!n(e)&&hasOwnProperty.call(i,typeof e)}},82527:function(e,t,r){"use strict";var n=r(69190),i=r(84985);e.exports=function(e){return i(e)?e:n(e,"%v is not a plain function",arguments[1])}},84985:function(e,t,r){"use strict";var n=r(73116),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(e){return!!n(e)&&!i.test(a.call(e))}},24511:function(e,t,r){"use strict";var n=r(47403);e.exports=function(e){if(!n(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(t){return!1}}},9234:function(e,t,r){"use strict";var n=r(24582),i=r(47403),a=Object.prototype.toString;e.exports=function(e){if(!n(e))return null;if(i(e)){var t=e.toString;if("function"!==typeof t)return null;if(t===a)return null}try{return""+e}catch(r){return null}}},10424:function(e,t,r){"use strict";var n=r(69190),i=r(24582);e.exports=function(e){return i(e)?e:n(e,"Cannot use %v",arguments[1])}},24582:function(e){"use strict";e.exports=function(e){return void 0!==e&&null!==e}},58404:function(e,t,r){"use strict";var n=r(13547),i=r(12129),a=r(12856).Buffer;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!==typeof Uint8ClampedArray,s="undefined"!==typeof BigUint64Array,l="undefined"!==typeof BigInt64Array,u=r.g.__TYPEDARRAY_POOL;u.UINT8C||(u.UINT8C=i([32,0])),u.BIGUINT64||(u.BIGUINT64=i([32,0])),u.BIGINT64||(u.BIGINT64=i([32,0])),u.BUFFER||(u.BUFFER=i([32,0]));var c=u.DATA,f=u.BUFFER;function d(e){if(e){var t=e.length||e.byteLength,r=n.log2(t);c[r].push(e)}}function p(e){e=n.nextPow2(e);var t=n.log2(e),r=c[t];return r.length>0?r.pop():new ArrayBuffer(e)}function h(e){return new Uint8Array(p(e),0,e)}function v(e){return new Uint16Array(p(2*e),0,e)}function m(e){return new Uint32Array(p(4*e),0,e)}function g(e){return new Int8Array(p(e),0,e)}function y(e){return new Int16Array(p(2*e),0,e)}function x(e){return new Int32Array(p(4*e),0,e)}function b(e){return new Float32Array(p(4*e),0,e)}function _(e){return new Float64Array(p(8*e),0,e)}function w(e){return o?new Uint8ClampedArray(p(e),0,e):h(e)}function k(e){return s?new BigUint64Array(p(8*e),0,e):null}function T(e){return l?new BigInt64Array(p(8*e),0,e):null}function M(e){return new DataView(p(e),0,e)}function S(e){e=n.nextPow2(e);var t=n.log2(e),r=f[t];return r.length>0?r.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))f[n.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|n.log2(t);c[r].push(e)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(e){d(e.buffer)},t.freeArrayBuffer=d,t.freeBuffer=function(e){f[n.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return p(e);switch(t){case"uint8":return h(e);case"uint16":return v(e);case"uint32":return m(e);case"int8":return g(e);case"int16":return y(e);case"int32":return x(e);case"float":case"float32":return b(e);case"double":case"float64":return _(e);case"uint8_clamped":return w(e);case"bigint64":return T(e);case"biguint64":return k(e);case"buffer":return S(e);case"data":case"dataview":return M(e);default:return null}return null},t.mallocArrayBuffer=p,t.mallocUint8=h,t.mallocUint16=v,t.mallocUint32=m,t.mallocInt8=g,t.mallocInt16=y,t.mallocInt32=x,t.mallocFloat32=t.mallocFloat=b,t.mallocFloat64=t.mallocDouble=_,t.mallocUint8Clamped=w,t.mallocBigUint64=k,t.mallocBigInt64=T,t.mallocDataView=M,t.mallocBuffer=S,t.clearCache=function(){for(var e=0;e<32;++e)u.UINT8[e].length=0,u.UINT16[e].length=0,u.UINT32[e].length=0,u.INT8[e].length=0,u.INT16[e].length=0,u.INT32[e].length=0,u.FLOAT[e].length=0,u.DOUBLE[e].length=0,u.BIGUINT64[e].length=0,u.BIGINT64[e].length=0,u.UINT8C[e].length=0,c[e].length=0,f[e].length=0}},90448:function(e){var t=/[\'\"]/;e.exports=function(e){return e?(t.test(e.charAt(0))&&(e=e.substr(1)),t.test(e.charAt(e.length-1))&&(e=e.substr(0,e.length-1)),e):""}},93447:function(e){"use strict";e.exports=function(e,t,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),d(n,e,n.depth)}function c(e,t){var r=u.styles[t];return r?"\x1b["+u.colors[r][0]+"m"+e+"\x1b["+u.colors[r][1]+"m":e}function f(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&M(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return x(i)||(i=d(e,i,n)),i}var a=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(x(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return y(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),T(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return p(r);if(0===o.length){if(M(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return e.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var u,c="",f=!1,w=["{","}"];return v(r)&&(f=!0,w=["[","]"]),M(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(c=" "+RegExp.prototype.toString.call(r)),k(r)&&(c=" "+Date.prototype.toUTCString.call(r)),T(r)&&(c=" "+p(r)),0!==o.length||f&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=f?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(u,c,w)):w[0]+c+w[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),E(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=g(r)?d(e,l.value,null):d(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),b(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function v(e){return Array.isArray(e)}function m(e){return"boolean"===typeof e}function g(e){return null===e}function y(e){return"number"===typeof e}function x(e){return"string"===typeof e}function b(e){return void 0===e}function _(e){return w(e)&&"[object RegExp]"===S(e)}function w(e){return"object"===typeof e&&null!==e}function k(e){return w(e)&&"[object Date]"===S(e)}function T(e){return w(e)&&("[object Error]"===S(e)||e instanceof Error)}function M(e){return"function"===typeof e}function S(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!o[e])if(s.test(e)){var r=n.pid;o[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else o[e]=function(){};return o[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(4936),t.isArray=v,t.isBoolean=m,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=x,t.isSymbol=function(e){return"symbol"===typeof e},t.isUndefined=b,t.isRegExp=_,t.types.isRegExp=_,t.isObject=w,t.isDate=k,t.types.isDate=k,t.isError=T,t.types.isNativeError=T,t.isFunction=M,t.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=r(45920);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",function(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),C[e.getMonth()],t].join(" ")}(),t.format.apply(t,arguments))},t.inherits=r(42018),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function L(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!==typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],a=0;a2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var i=this.intercalaryMonth(e);if(r&&t!==i||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&t<=i?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13;return t},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var i,o=this._validateYear(e,n.local.invalidyear),s=d[o-d[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(i=a.newDate(l,u,c)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);var i=r&1<<12-t?30:29;return i},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,s,r,n.local.invalidDate);e=this._validateYear(i.year()),t=i.month(),r=i.day();var o=this.isIntercalaryMonth(e,t),s=this.toChineseMonth(e,t),l=function(e,t,r,n,i){var a,o,s;if("object"===typeof e)o=e,a=t||{};else{var l;if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"===typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:e,month:t,day:r,isIntercalary:l}}s=o.day-1;var u,c=f[o.year-f[0]],p=c>>13;u=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(v>>5&15)-1,(31&v)+s);return a.year=m.getFullYear(),a.month=1+m.getMonth(),a.day=m.getDate(),a}(e,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(e){var t=a.fromJD(e),r=function(e,t,r,n){var i,a;if("object"===typeof e)i=e,a=t||{};else{if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:e,month:t,day:r},a=n||{}}var o=d[i.year-d[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=d[a.year-d[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(i.year,i.month-1,i.day);l=Math.round((c-u)/864e5);var p,h=f[a.year-f[0]];for(p=0;p<13;p++){var v=h&1<<12-p?30:29;if(l>13;return!m||p=2&&n<=6},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year()+(i.year()<0?1:0),t=i.month(),(r=i.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},37715:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4===3||e%4===-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return(e=i.year())<0&&e++,i.day()+30*(i.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,i=t-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},99384:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=e<=0?e+1:e,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(t<7){for(var s=7;s<=this.monthsInYear(e);s++)o+=this.daysInMonth(e,s);for(s=1;s=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=a},43805:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year(),t=i.month(),e=e<=0?e+1:e,(r=i.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=a},88874:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4===0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year(),t=i.month(),r=i.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((t-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=t-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},83290:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function s(e,t){return o(e-1,t)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o(8+(e-=this.jdEpoch)+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[s(20+(e-=this.jdEpoch),20),s(e+4,13)]},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=a},29108:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidMonth);(e=i.year())<0&&e++;for(var a=i.day(),s=1;s=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=a},55422:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),"undefined"===typeof this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),"undefined"===typeof this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=n.instance(),o=0,s=t,l=e;this._createMissingCalendarData(e);var u=e-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==t&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),i=t.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var u=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,u)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=e-(e>=0?474:473),s=474+o(a,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var u=e-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),f=e-this.toJD(l,c,1)+1;return this.newDate(l,c,f)}}),n.calendars.persian=a,n.calendars.jalali=a},31320:function(e,t,r){var n=r(63489),i=r(56131),a=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(t.year()),a.leapYear(e)},weekOfYear:function(e,t,r){var i=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(i.year()),a.weekOfYear(e,i.month(),i.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=this._t2gYear(i.year()),a.toJD(e,i.month(),i.day())},fromJD:function(e){var t=a.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},51367:function(e,t,r){var n=r(63489),i=r(56131),a=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(t.year()),a.leapYear(e)},weekOfYear:function(e,t,r){var i=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(i.year()),a.weekOfYear(e,i.month(),i.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=this._t2gYear(i.year()),a.toJD(e,i.month(),i.day())},fromJD:function(e){var t=a.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},21457:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,u=t-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(e,t,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(e=null!=e.year?e.year:e)>=1276&&e<=1500),i},_validate:function(e,t,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},63489:function(e,t,r){var n=r(56131);function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function s(){this.shortYearCutoff="+10"}function l(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(i.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,i){return(n=(null!=e&&e.year?e.calendar():"string"===typeof n?this.instance(n,i):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":e[a]+t[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(a.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new a(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),i=e.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);i=e.day(),"y"===r?(e.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(e){for(;ot-1+e.minMonth;)a++,o-=t,t=e.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(l){throw this._validateLevel--,l}},_correctAdd:function(e,t,r,n){if(!this.hasYearZero&&("y"===n||"m"===n)&&(0===t[0]||e.year()>0!==t[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;t=this._add(e,r*i[0]+a*i[1],i[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),i="m"===r?t:e.month(),a="d"===r?t:e.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),e.date(n,i,a)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var i=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var u=e.exports=new i;u.cdate=a,u.baseCalendar=s,u.calendars.gregorian=l},94338:function(e,t,r){var n=r(56131),i=r(63489);n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(e,t){return"string"!==typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!==typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n=(r=r||{}).dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,u=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;x+n1}),c=function(e,t,r,n){var i=""+t;if(u(e,n))for(;i.length1},x=function(e,r){var n=y(e,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=t.substring(M).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"===typeof l){y("m");var e=l.call(b,t.substring(M));return M+=e.length,e}return x("m")},w=function(e,r,n,a){for(var o=y(e,a)?n:r,s=0;s-1){p=1,h=v;for(var C=this.daysInMonth(d,p);h>C;C=this.daysInMonth(d,p))p++,h-=C}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,i){r&&"object"!==typeof r&&(i=n,n=r,r=null),"string"!==typeof n&&(i=n,n="");var a=this;return t=t?t.newDate():null,e=null==e?t:"string"===typeof e?function(e){try{return a.parseDate(n,e,i)}catch(l){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(e);s;)t.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(e);return t}(e):"number"===typeof e?isNaN(e)||e===1/0||e===-1/0?t:a.today().add(e,"d"):a.newDate(e)}})},69862:function(){},40964:function(){},72077:function(e,t,r){"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"===typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?k(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?k(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=d.exec(e))?new M(t[1],t[2],t[3],1):(t=p.exec(e))?new M(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=h.exec(e))?k(t[1],t[2],t[3],t[4]):(t=v.exec(e))?k(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=m.exec(e))?L(t[1],t[2]/100,t[3]/100,1):(t=g.exec(e))?L(t[1],t[2]/100,t[3]/100,t[4]):y.hasOwnProperty(e)?w(y[e]):"transparent"===e?new M(NaN,NaN,NaN,0):null}function w(e){return new M(e>>16&255,e>>8&255,255&e,1)}function k(e,t,r,n){return n<=0&&(e=t=r=NaN),new M(e,t,r,n)}function T(e,t,r,n){return 1===arguments.length?((i=e)instanceof a||(i=_(i)),i?new M((i=i.rgb()).r,i.g,i.b,i.opacity):new M):new M(e,t,r,null==n?1:n);var i}function M(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function S(){return"#".concat(P(this.r)).concat(P(this.g)).concat(P(this.b))}function A(){var e=C(this.opacity);return"".concat(1===e?"rgb(":"rgba(").concat(E(this.r),", ").concat(E(this.g),", ").concat(E(this.b)).concat(1===e?")":", ".concat(e,")"))}function C(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function E(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function P(e){return((e=E(e))<16?"0":"")+e.toString(16)}function L(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new R(e,t,r,n)}function I(e){if(e instanceof R)return new R(e.h,e.s,e.l,e.opacity);if(e instanceof a||(e=_(e)),!e)return new R;if(e instanceof R)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=NaN,l=o-i,u=(o+i)/2;return l?(s=t===o?(r-n)/l+6*(r0&&u<1?0:s,new R(s,l,u,e.opacity)}function R(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function O(e){return(e=(e||0)%360)<0?e+360:e}function D(e){return Math.max(0,Math.min(1,e||0))}function z(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function F(e,t,r,n,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*r+(1+3*e+3*a-3*o)*n+o*i)/6}n(a,_,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:x,formatHex:x,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return I(this).formatHsl()},formatRgb:b,toString:b}),n(M,T,i(a,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new M(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?o:Math.pow(o,e),new M(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},clamp:function(){return new M(E(this.r),E(this.g),E(this.b),C(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:S,formatHex:S,formatHex8:function(){return"#".concat(P(this.r)).concat(P(this.g)).concat(P(this.b)).concat(P(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:A,toString:A})),n(R,(function(e,t,r,n){return 1===arguments.length?I(e):new R(e,t,r,null==n?1:n)}),i(a,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new R(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?o:Math.pow(o,e),new R(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new M(z(e>=240?e-240:e+120,i,n),z(e,i,n),z(e<120?e+240:e-120,i,n),this.opacity)},clamp:function(){return new R(O(this.h),D(this.s),D(this.l),C(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=C(this.opacity);return"".concat(1===e?"hsl(":"hsla(").concat(O(this.h),", ").concat(100*D(this.s),"%, ").concat(100*D(this.l),"%").concat(1===e?")":", ".concat(e,")"))}}));var j=function(e){return function(){return e}};function N(e,t){return function(r){return e+r*t}}function Z(e){return 1===(e=+e)?B:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):j(isNaN(t)?r:t)}}function B(e,t){var r=t-e;return r?N(e,r):j(isNaN(e)?t:e)}var V=function e(t){var r=Z(t);function n(e,t){var n=r((e=T(e)).r,(t=T(t)).r),i=r(e.g,t.g),a=r(e.b,t.b),o=B(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return n.gamma=e,n}(1);function U(e){return function(t){var r,n,i=t.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;r=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=na&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:G(r,n)})),a=K.lastIndex;return a
contributors',o=['\xa9 Carto',a].join(" "),s=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),l={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:a,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:o,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:o,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:s,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:s,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},u=n(l);e.exports={requiredVersion:i,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:l,styleValuesNonMapbox:u,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@"+i+"."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",u.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},13056:function(e,t,r){"use strict";var n=r(71828);e.exports=function(e,t){var r=e.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(t)?n.mean(t):t,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}},50101:function(e,t,r){"use strict";var n=r(44517),i=r(71828),a=i.strTranslate,o=i.strScale,s=r(27659).AU,l=r(77922),u=r(39898),c=r(91424),f=r(63893),d=r(10481),p="mapbox",h=t.constants=r(77734);function v(e){return"string"===typeof e&&(-1!==h.styleValuesMapbox.indexOf(e)||0===e.indexOf("mapbox://"))}t.name=p,t.attr="subplot",t.idRoot=p,t.idRegex=t.attrRegex=i.counterRegex(p),t.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},t.layoutAttributes=r(23585),t.supplyLayoutDefaults=r(77882),t.plot=function(e){var t=e._fullLayout,r=e.calcdata,a=t._subplots[p];if(n.version!==h.requiredVersion)throw new Error(h.wrongVersionErrorMsg);var o=function(e,t){var r=e._fullLayout,n=e._context;if(""===n.mapboxAccessToken)return"";for(var a=[],o=[],s=!1,l=!1,u=0;u1&&i.warn(h.multipleTokensErrorMsg),a[0]):(o.length&&i.log(["Listed mapbox access token(s)",o.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(e,a);n.accessToken=o;for(var l=0;lw/2){var k=y.split("|").join("
");b.text(k).attr("data-unformatted",k).call(f.convertToTspans,e),_=c.bBox(b.node())}b.attr("transform",a(-3,8-_.height)),x.insert("rect",".static-attribution").attr({x:-_.width-6,y:-_.height-3,width:_.width+6,height:_.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;_.width+6>w&&(T=w/(_.width+6));var M=[n.l+n.w*d.x[1],n.t+n.h*(1-d.y[0])];x.attr("transform",a(M[0],M[1])+o(T))}},t.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[p],n=0;n0){for(var r=0;r0}function c(e){var t={},r={};switch(e.type){case"circle":n.extendFlat(r,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":n.extendFlat(r,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case"symbol":var i=e.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(t,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":e.color,"text-color":i.textfont.color,"text-opacity":e.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:r}}l.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=u(e)},l.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},l.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},l.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapboxLayerId(this.lookupBelow());null!==t&&this.subplot.map.moveLayer(this.idLayer,t)},l.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,u(e)){var r=function(e){var t,r=e.sourcetype,n=e.source,a={type:r};return"geojson"===r?t="data":"vector"===r?t="string"===typeof n?"url":"tiles":"raster"===r?(t="tiles",a.tileSize=256):"image"===r&&(t="url",a.coordinates=e.coordinates),a[t]=n,e.sourceattribution&&(a.attribution=i(e.sourceattribution)),a}(e);t.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&m(t.originalEvent,n,[r.xaxis],[r.yaxis],r.id,e),i.indexOf("event")>-1&&u.click(n,t.originalEvent)}}},b.updateFx=function(e){var t=this,r=t.map,n=t.gd;if(!t.isStatic){var a,o=e.dragmode;a=function(e,r){r.isRect?(e.range={})[t.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]:(e.lassoPoints={})[t.id]=r.map(u)};var s=t.dragOptions;t.dragOptions=i.extendDeep(s||{},{dragmode:e.dragmode,element:t.div,gd:n,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:a},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),d(o)||f(o)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(e,r,n){p(e,r,n,t.dragOptions,o)},l.init(t.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener("touchstart",t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),r.on("click",t.onClickInPanHandler))}function u(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},b.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},b.updateLayers=function(e){var t,r=e[this.id].layers,n=this.layerList;if(r.length!==n.length){for(t=0;t=t.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=t._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){_.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(e,o),s.text(o.text()&&l.text()?" - ":"")}},_.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=_.graphJson(e,!1,"keepdata"),i.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function S(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,i={};function a(e){for(var r=!0,a=0;a1&&O.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&O.length>15&&0===l.shapes.length&&0===l.images.length,_.linkSubplots(d,l,f,n),_.cleanPlot(d,l,f,n);var N=!(!n._has||!n._has("gl2d")),Z=!(!l._has||!l._has("gl2d")),B=!(!n._has||!n._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||Z;B&&!V?n._bgLayer.remove():V&&!B&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var d=_.layoutAttributes.width.min,p=_.layoutAttributes.height.min;n1,v=!t.height&&Math.abs(r.height-i)>1;(v||h)&&(h&&(r.width=n),v&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),_.sanitizeMargins(r)},_.supplyLayoutModuleDefaults=function(e,t,r,n){var i,a,o,l=s.componentsRegistry,u=t._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(c.subplotSort);for(a=0;a1&&(r.l/=g,r.r/=g)}if(p){var y=(r.t+r.b)/p;y>1&&(r.t/=y,r.b/=y)}var x=void 0!==r.xl?r.xl:r.x,b=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,k=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:x,size:r.l+m},r:{val:b,size:r.r+m},b:{val:k,size:r.b+m},t:{val:w,size:r.t+m}},v[t]=1}else delete h[t],delete v[t];if(!n._replotting)return _.doAutoMargin(e)}},_.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),L(t);var i=t._size,a=t.margin,l={t:0,b:0,l:0,r:0},u=c.extendFlat({},i),f=a.l,d=a.r,h=a.t,v=a.b,m=t._pushmargin,g=t._pushmarginIds,y=t.minreducedwidth,x=t.minreducedheight;if(!1!==a.autoexpand){for(var b in m)g[b]||delete m[b];var w=e._fullLayout._reservedMargin;for(var k in w)for(var T in w[k]){var M=w[k][T];l[T]=Math.max(l[T],M)}for(var S in m.base={l:{val:0,size:f},r:{val:1,size:d},t:{val:1,size:h},b:{val:0,size:v}},l){var A=0;for(var C in m)"base"!==C&&o(m[C][S].size)&&(A=m[C][S].size>A?m[C][S].size:A);var E=Math.max(0,a[S]-A);l[S]=Math.max(0,l[S]-E)}for(var P in m){var I=m[P].l||{},R=m[P].b||{},O=I.val,D=I.size,z=R.val,F=R.size,j=r-l.r-l.l,N=n-l.t-l.b;for(var Z in m){if(o(D)&&m[Z].r){var B=m[Z].r.val,V=m[Z].r.size;if(B>O){var U=(D*B+(V-j)*O)/(B-O),H=(V*(1-O)+(D-j)*(1-B))/(B-O);U+H>f+d&&(f=U,d=H)}}if(o(F)&&m[Z].t){var W=m[Z].t.val,G=m[Z].t.size;if(W>z){var q=(F*W+(G-N)*z)/(W-z),Y=(G*(1-z)+(F-N)*(1-W))/(W-z);q+Y>v+h&&(v=q,h=Y)}}}}}var X=c.constrain(r-a.l-a.r,2,y),K=c.constrain(n-a.t-a.b,2,x),$=Math.max(0,r-X),J=Math.max(0,n-K);if($){var Q=(f+d)/$;Q>1&&(f/=Q,d/=Q)}if(J){var ee=(v+h)/J;ee>1&&(v/=ee,h/=ee)}if(i.l=Math.round(f)+l.l,i.r=Math.round(d)+l.r,i.t=Math.round(h)+l.t,i.b=Math.round(v)+l.b,i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!t._replotting&&(_.didMarginChange(u,i)||function(e){if("_redrawFromAutoMarginCount"in e._fullLayout)return!1;var t=p.list(e,"",!0);for(var r in t)if(t[r].autoshift||t[r].shift)return!0;return!1}(e))){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var te=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return s.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){var t;o++,n||o!==a||(t=i,e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)))}}r.runFn(l),setTimeout(l())}))}],a=c.syncOrAsync(i,e);return a&&a.then||(a=Promise.resolve()),a.then((function(){return e}))}_.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},_.graphJson=function(e,t,r,n,i,a){(i&&t&&!e._fullData||i&&!t&&!e._fullLayout)&&_.supplyDefaults(e);var o=i?e._fullData:e.data,s=i?e._fullLayout:e.layout,l=(e._transitionData||{})._frames;function u(e,t){if("function"===typeof e)return t?"_function_":null;if(c.isPlainObject(e)){var n,i={};return Object.keys(e).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!==typeof e[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0)return;i[a]=u(e[a],t)}else t&&(i[a]="_function")})),i}return Array.isArray(e)?e.map((function(e){return u(e,t)})):c.isTypedArray(e)?c.simpleMap(e,c.identity):c.isJSDate(e)?c.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=u(s),i)){var d=s._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return l&&(f.frames=u(l)),a&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},_.modifyFrames=function(e,t){var r,n,i,a=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(D(o,u,f),i=0;i1e-10?e:0}function d(e,t,r){t=t||0,r=r||0;for(var n=e.length,i=new Array(n),a=0;a0?r:1/0})),i=n.mod(r+1,t.length);return[t[r],t[i]]},findIntersectionXY:u,findXYatLength:function(e,t,r,n){var i=-t*r,a=t*t+1,o=2*(t*i-r),s=i*i+r*r-e*e,l=Math.sqrt(o*o-4*a*s),u=(-o+l)/(2*a),c=(-o-l)/(2*a);return[[u,t*u+i+n],[c,t*c+i+n]]},clampTiny:f,pathPolygon:function(e,t,r,n,i,a){return"M"+d(c(e,t,r,n),i,a).join("L")},pathPolygonAnnulus:function(e,t,r,n,i,a,o){var s,l;e=90||l>90&&u>=450?1:f<=0&&p<=0?0:Math.max(f,p),t=l<=180&&u>=180||l>180&&u>=540?-1:c>=0&&d>=0?0:Math.min(c,d),r=l<=270&&u>=270||l>270&&u>=630?-1:f>=0&&p>=0?0:Math.min(f,p),n=u>=360?1:c<=0&&d<=0?0:Math.max(c,d),[t,r,n,i]}(h),_=b[2]-b[0],w=b[3]-b[1],k=p/d,T=Math.abs(w/_);k>T?(v=d,x=(p-(m=d*T))/i.h/2,g=[s[0],s[1]],y=[f[0]+x,f[1]-x]):(m=p,x=(d-(v=p/T))/i.w/2,g=[s[0]+x,s[1]-x],y=[f[0],f[1]]),r.xLength2=v,r.yLength2=m,r.xDomain2=g,r.yDomain2=y;var M,S=r.xOffset2=i.l+i.w*g[0],A=r.yOffset2=i.t+i.h*(1-y[1]),C=r.radius=v/_,E=r.innerRadius=r.getHole(t)*C,P=r.cx=S-C*b[0],L=r.cy=A+C*b[3],I=r.cxx=P-S,R=r.cyy=L-A,O=a.side;"counterclockwise"===O?(M=O,O="top"):"clockwise"===O&&(M=O,O="bottom"),r.radialAxis=r.mockAxis(e,t,a,{_id:"x",side:O,_trueSide:M,domain:[E/i.w,C/i.w]}),r.angularAxis=r.mockAxis(e,t,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(e,t),r.updateAngularAxis(e,t),r.updateRadialAxis(e,t),r.updateRadialAxisTitle(e,t),r.xaxis=r.mockCartesianAxis(e,t,{_id:"x",domain:g}),r.yaxis=r.mockCartesianAxis(e,t,{_id:"y",domain:y});var F=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",F).attr("transform",l(I,R)),n.frontplot.attr("transform",l(S,A)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",F).attr("transform",l(P,L)).call(u.fill,t.bgcolor)},N.mockAxis=function(e,t,r,n){var i=o.extendFlat({},r,n);return h(i,t,e),i},N.mockCartesianAxis=function(e,t,r){var n=this,i=n.isSmith,a=r._id,s=o.extendFlat({type:"linear"},r);p(s,e);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var e=n.sectorBBox,r=l[a],i=n.radialAxis._rl,o=(i[1]-i[0])/(1-n.getHole(t));s.range=[e[r[0]]*o,e[r[1]]*o]},s.isPtWithinRange="x"!==a||i?function(){return!0}:function(e){return n.isPtInside(e)},s.setRange(),s.setScale(),s},N.doAutoRange=function(e,t){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(t);v(n,i);var o=i.range;a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")]},N.updateRadialAxis=function(e,t){var r=this,n=r.gd,i=r.layers,a=r.radius,c=r.innerRadius,f=r.cx,p=r.cy,h=r.getRadial(t),v=D(r.getSector(t)[0],360),m=r.radialAxis,g=c90&&v<=270&&(m.tickangle=180);var x=y?function(e){var t=R(r,P([e.x,0]));return l(t[0]-f,t[1]-p)}:function(e){return l(m.l2p(e.x)+c,0)},b=y?function(e){return I(r,e.x,-1/0,1/0)}:function(e){return r.pathArc(m.r2p(e.x)+c)},_=Z(h);if(r.radialTickLayout!==_&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),g){m.setScale();var w=0,k=y?(m.tickvals||[]).filter((function(e){return e>=0})).map((function(e){return d.tickText(m,e,!0,!1)})):d.calcTicks(m),T=y?k:d.clipEnds(m,k),M=d.getTickSigns(m)[2];y&&(("top"===m.ticks&&"bottom"===m.side||"bottom"===m.ticks&&"top"===m.side)&&(M=-M),"top"===m.ticks&&"top"===m.side&&(w=-m.ticklen),"bottom"===m.ticks&&"bottom"===m.side&&(w=m.ticklen)),d.drawTicks(n,m,{vals:k,layer:i["radial-axis"],path:d.makeTickPath(m,0,M),transFn:x,crisp:!1}),d.drawGrid(n,m,{vals:T,layer:i["radial-grid"],path:b,transFn:o.noop,crisp:!1}),d.drawLabels(n,m,{vals:k,layer:i["radial-axis"],transFn:x,labelFns:d.makeLabelFns(m,w)})}var S=r.radialAxisAngle=r.vangles?F(B(z(h.angle),r.vangles)):h.angle,A=l(f,p),C=A+s(-S);V(i["radial-axis"],g&&(h.showticklabels||h.ticks),{transform:C}),V(i["radial-grid"],g&&h.showgrid,{transform:y?"":A}),V(i["radial-line"].select("line"),g&&h.showline,{x1:y?-a:c,y1:0,x2:a,y2:0,transform:C}).attr("stroke-width",h.linewidth).call(u.stroke,h.linecolor)},N.updateRadialAxisTitle=function(e,t,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(t),u=n.id+"title",f=0;if(l.title){var d=c.bBox(n.layers["radial-axis"].node()).height,p=l.title.font.size,h=l.side;f="top"===h?p:"counterclockwise"===h?-(d+.4*p):d+.8*p}var v=void 0!==r?r:n.radialAxisAngle,m=z(v),g=Math.cos(m),y=Math.sin(m),b=o+a/2*g+f*y,_=s-a/2*y+f*g;n.layers["radial-axis-title"]=x.draw(i,u,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:O(i,"Click to enter radial axis title"),attributes:{x:b,y:_,"text-anchor":"middle"},transform:{rotate:-v}})}},N.updateAngularAxis=function(e,t){var r=this,n=r.gd,i=r.layers,a=r.radius,c=r.innerRadius,f=r.cx,p=r.cy,h=r.getAngular(t),v=r.angularAxis,m=r.isSmith;m||(r.fillViewInitialKey("angularaxis.rotation",h.rotation),v.setGeometry(),v.setScale());var g=m?function(e){var t=R(r,P([0,e.x]));return Math.atan2(t[0]-f,t[1]-p)-Math.PI/2}:function(e){return v.t2g(e.x)};"linear"===v.type&&"radians"===v.thetaunit&&(v.tick0=F(v.tick0),v.dtick=F(v.dtick));var y=function(e){return l(f+a*Math.cos(e),p-a*Math.sin(e))},x=m?function(e){var t=R(r,P([0,e.x]));return l(t[0],t[1])}:function(e){return y(g(e))},b=m?function(e){var t=R(r,P([0,e.x])),n=Math.atan2(t[0]-f,t[1]-p)-Math.PI/2;return l(t[0],t[1])+s(-F(n))}:function(e){var t=g(e);return y(t)+s(-F(t))},_=m?function(e){return L(r,e.x,0,1/0)}:function(e){var t=g(e),r=Math.cos(t),n=Math.sin(t);return"M"+[f+c*r,p-c*n]+"L"+[f+a*r,p-a*n]},w=d.makeLabelFns(v,0).labelStandoff,k={xFn:function(e){var t=g(e);return Math.cos(t)*w},yFn:function(e){var t=g(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(w+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*S)},anchorFn:function(e){var t=g(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(e,t,r){var n=g(e);return-.5*(1+Math.sin(n))*r}},T=Z(h);r.angularTickLayout!==T&&(i["angular-axis"].selectAll("."+v._id+"tick").remove(),r.angularTickLayout=T);var M,A=m?[1/0].concat(v.tickvals||[]).map((function(e){return d.tickText(v,e,!0,!1)})):d.calcTicks(v);if(m&&(A[0].text="\u221e",A[0].fontSize*=1.75),"linear"===t.gridshape?(M=A.map(g),o.angleDelta(M[0],M[1])<0&&(M=M.slice().reverse())):M=null,r.vangles=M,"category"===v.type&&(A=A.filter((function(e){return o.isAngleInsideSector(g(e),r.sectorInRad)}))),v.visible){var C="inside"===v.ticks?-1:1,E=(v.linewidth||1)/2;d.drawTicks(n,v,{vals:A,layer:i["angular-axis"],path:"M"+C*E+",0h"+C*v.ticklen,transFn:b,crisp:!1}),d.drawGrid(n,v,{vals:A,layer:i["angular-grid"],path:_,transFn:o.noop,crisp:!1}),d.drawLabels(n,v,{vals:A,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:k})}V(i["angular-line"].select("path"),h.showline,{d:r.pathSubplot(),transform:l(f,p)}).attr("stroke-width",h.linewidth).call(u.stroke,h.linecolor)},N.updateFx=function(e,t){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(e),this.updateRadialDrag(e,t,0),this.updateRadialDrag(e,t,1)),this.updateHoverAndMainDrag(e))},N.updateHoverAndMainDrag=function(e){var t,r,s=this,u=s.isSmith,c=s.gd,f=s.layers,d=e._zoomlayer,p=A.MINZOOM,h=A.OFFEDGE,v=s.radius,x=s.innerRadius,k=s.cx,T=s.cy,M=s.cxx,S=s.cyy,E=s.sectorInRad,P=s.vangles,L=s.radialAxis,I=C.clampTiny,R=C.findXYatLength,O=C.findEnclosingVertexAngles,D=A.cornerHalfWidth,z=A.cornerLen/2,F=m.makeDragger(f,"path","maindrag",!1===e.dragmode?"none":"crosshair");n.select(F).attr("d",s.pathSubplot()).attr("transform",l(k,T)),F.onmousemove=function(e){y.hover(c,e,s.id),c._fullLayout._lasthover=F,c._fullLayout._hoversubplot=s.id},F.onmouseout=function(e){c._dragging||g.unhover(c,e)};var j,N,Z,B,V,U,H,W,G,q={element:F,gd:c,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function Y(e,t){return Math.sqrt(e*e+t*t)}function X(e,t){return Y(e-M,t-S)}function K(e,t){return Math.atan2(S-t,e-M)}function $(e,t){return[e*Math.cos(t),e*Math.sin(-t)]}function J(e,t){if(0===e)return s.pathSector(2*D);var r=z/e,n=t-r,i=t+r,a=Math.max(0,Math.min(e,v)),o=a-D,l=a+D;return"M"+$(o,n)+"A"+[o,o]+" 0,0,0 "+$(o,i)+"L"+$(l,i)+"A"+[l,l]+" 0,0,1 "+$(l,n)+"Z"}function Q(e,t,r){if(0===e)return s.pathSector(2*D);var n,i,a=$(e,t),o=$(e,r),l=I((a[0]+o[0])/2),u=I((a[1]+o[1])/2);if(l&&u){var c=u/l,f=-1/c,d=R(D,c,l,u);n=R(z,f,d[0][0],d[0][1]),i=R(z,f,d[1][0],d[1][1])}else{var p,h;u?(p=z,h=D):(p=D,h=z),n=[[l-p,u-h],[l+p,u-h]],i=[[l-p,u+h],[l+p,u+h]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function ee(e,t){return t=Math.max(Math.min(t,v),x),ep?(e-1&&1===e&&_(t,c,[s.xaxis],[s.yaxis],s.id,q),r.indexOf("event")>-1&&y.click(c,t,s.id)}q.prepFn=function(e,n,a){var l=c._fullLayout.dragmode,f=F.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var p=c._fullLayout._invTransform;t=c._fullLayout._invScaleX,r=c._fullLayout._invScaleY;var h=o.apply3DTransform(p)(n-f.left,a-f.top);if(j=h[0],N=h[1],P){var g=C.findPolygonOffset(v,E[0],E[1],P);j+=M+g[0],N+=S+g[1]}switch(l){case"zoom":q.clickFn=se,u||(q.moveFn=P?ie:re,q.doneFn=ae,function(){Z=null,B=null,V=s.pathSubplot(),U=!1;var e=c._fullLayout[s.id];H=i(e.bgcolor).getLuminance(),(W=m.makeZoombox(d,H,k,T,V)).attr("fill-rule","evenodd"),G=m.makeCorners(d,k,T),w(c)}());break;case"select":case"lasso":b(e,n,a,q,l)}},g.init(q)},N.updateRadialDrag=function(e,t,r){var i=this,u=i.gd,c=i.layers,f=i.radius,d=i.innerRadius,p=i.cx,h=i.cy,v=i.radialAxis,y=A.radialDragBoxSize,x=y/2;if(v.visible){var b,_,k,S=z(i.radialAxisAngle),C=v._rl,E=C[0],P=C[1],L=C[r],I=.75*(C[1]-C[0])/(1-i.getHole(t))/f;r?(b=p+(f+x)*Math.cos(S),_=h-(f+x)*Math.sin(S),k="radialdrag"):(b=p+(d-x)*Math.cos(S),_=h-(d-x)*Math.sin(S),k="radialdrag-inner");var R,O,D,j=m.makeRectDragger(c,k,"crosshair",-x,-x,y,y),N={element:j,gd:u};!1===e.dragmode&&(N.dragmode=!1),V(n.select(j),v.visible&&d0===(r?D>E:Dn?function(e){return e<=0}:function(e){return e>=0};e.c2g=function(r){var n=e.c2l(r)-t;return(s(n)?n:0)+o},e.g2c=function(r){return e.l2c(r+t-o)},e.g2p=function(e){return e*a},e.c2p=function(t){return e.g2p(e.c2g(t))}}}(e,t);break;case"angularaxis":!function(e,t){var r=e.type;if("linear"===r){var i=e.d2c,s=e.c2d;e.d2c=function(e,t){return function(e,t){return"degrees"===t?a(e):e}(i(e),t)},e.c2d=function(e,t){return s(function(e,t){return"degrees"===t?o(e):e}(e,t))}}e.makeCalcdata=function(t,i){var a,o,s=t[i],l=t._length,u=function(r){return e.d2c(r,t.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(a=new Array(l),o=0;o0?1:0}function r(e){var t=e[0],r=e[1];if(!isFinite(t)||!isFinite(r))return[1,0];var n=(t+1)*(t+1)+r*r;return[(t*t+r*r-1)/n,2*r/n]}function n(e,t){var r=t[0],n=t[1];return[r*e.radius+e.cx,-n*e.radius+e.cy]}function i(e,t){return t*e.radius}e.exports={smith:r,reactanceArc:function(e,t,a,o){var s=n(e,r([a,t])),l=s[0],u=s[1],c=n(e,r([o,t])),f=c[0],d=c[1];if(0===t)return["M"+l+","+u,"L"+f+","+d].join(" ");var p=i(e,1/Math.abs(t));return["M"+l+","+u,"A"+p+","+p+" 0 0,"+(t<0?1:0)+" "+f+","+d].join(" ")},resistanceArc:function(e,a,o,s){var l=i(e,1/(a+1)),u=n(e,r([a,o])),c=u[0],f=u[1],d=n(e,r([a,s])),p=d[0],h=d[1];if(t(o)!==t(s)){var v=n(e,r([a,0]));return["M"+c+","+f,"A"+l+","+l+" 0 0,"+(00){for(var n=[],i=0;i=c&&(d.min=0,h.min=0,m.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function v(e,t,r,n){var i=d[t._name];function o(r,n){return a.coerce(e,t,i,r,n)}o("uirevision",n.uirevision),t.type="linear";var p=o("color"),h=p!==i.color.dflt?p:r.font.color,v=t._name.charAt(0).toUpperCase(),m="Component "+v,g=o("title.text",m);t._hovertitle=g===m?g:v,a.coerceFont(o,"title.font",{family:r.font.family,size:a.bigFont(r.font.size),color:h}),o("min"),c(e,t,o,"linear"),l(e,t,o,"linear"),s(e,t,o,"linear"),u(e,t,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:h}),o("tickangle"),o("tickformat")),f(e,t,o,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(e,t,r){o(e,t,r,{type:"ternary",attributes:d,handleDefaults:h,font:t.font,paper_bgcolor:t.paper_bgcolor})}},64380:function(e,t,r){"use strict";var n=r(39898),i=r(84267),a=r(73972),o=r(71828),s=o.strTranslate,l=o._,u=r(7901),c=r(91424),f=r(21994),d=r(1426).extendFlat,p=r(74875),h=r(89298),v=r(28569),m=r(30211),g=r(64505),y=g.freeMode,x=g.rectMode,b=r(92998),_=r(47322).prepSelect,w=r(47322).selectOnClick,k=r(47322).clearOutline,T=r(47322).clearSelectionsCache,M=r(85555);function S(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=S;var A=S.prototype;A.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},A.plot=function(e,t){var r=this,n=t[r.id],i=t._size;r._hasClipOnAxisFalse=!1;for(var a=0;aC*b?i=(a=b)*C:a=(i=x)/C,o=g*i/x,l=y*a/b,r=t.l+t.w*v-i/2,n=t.t+t.h*(1-m)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=_,p.xaxis={type:"linear",range:[w+2*T-_,_-w-2*k],domain:[v-o/2,v+o/2],_id:"x"},f(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(e){return e.a>=p.aaxis.range[0]&&e.a<=p.aaxis.range[1]&&e.b>=p.baxis.range[1]&&e.b<=p.baxis.range[0]&&e.c>=p.caxis.range[1]&&e.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-k-T],domain:[m-l/2,m+l/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var M=p.yaxis.domain[0],S=p.aaxis=d({},e.aaxis,{range:[w,_-k-T],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[M,M+l*C],anchor:"free",position:0,_id:"y",_length:i});f(S,p.graphDiv._fullLayout),S.setScale();var A=p.baxis=d({},e.baxis,{range:[_-w-T,k],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});f(A,p.graphDiv._fullLayout),A.setScale();var E=p.caxis=d({},e.caxis,{range:[_-w-k,T],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[M,M+l*C],anchor:"free",position:0,_id:"y",_length:i});f(E,p.graphDiv._fullLayout),E.setScale();var P="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",P),p.layers.plotbg.select("path").attr("d",P);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",L);var I=s(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),p.clipDefRelative.select("path").attr("transform",null);var R=s(r-A._offset,n+a);p.layers.baxis.attr("transform",R),p.layers.bgrid.attr("transform",R);var O=s(r+i/2,n)+"rotate(30)"+s(0,-S._offset);p.layers.aaxis.attr("transform",O),p.layers.agrid.attr("transform",O);var D=s(r+i/2,n)+"rotate(-30)"+s(0,-E._offset);p.layers.caxis.attr("transform",D),p.layers.cgrid.attr("transform",D),p.drawAxes(!0),p.layers.aline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",A.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),c.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},A.drawAxes=function(e){var t=this,r=t.graphDiv,n=t.id.substr(7)+"title",i=t.layers,a=t.aaxis,o=t.baxis,s=t.caxis;if(t.drawAx(a),t.drawAx(o),t.drawAx(s),e){var u=Math.max(a.showticklabels?a.tickfont.size/2:0,(s.showticklabels?.75*s.tickfont.size:0)+("outside"===s.ticks?.87*s.ticklen:0)),c=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=b.draw(r,"a"+n,{propContainer:a,propName:t.id+".aaxis.title",placeholder:l(r,"Click to enter Component A title"),attributes:{x:t.x0+t.w/2,y:t.y0-a.title.font.size/3-u,"text-anchor":"middle"}}),i["b-title"]=b.draw(r,"b"+n,{propContainer:o,propName:t.id+".baxis.title",placeholder:l(r,"Click to enter Component B title"),attributes:{x:t.x0-c,y:t.y0+t.h+.83*o.title.font.size+c,"text-anchor":"middle"}}),i["c-title"]=b.draw(r,"c"+n,{propContainer:s,propName:t.id+".caxis.title",placeholder:l(r,"Click to enter Component C title"),attributes:{x:t.x0+t.w+c,y:t.y0+t.h+.83*s.title.font.size+c,"text-anchor":"middle"}})}},A.drawAx=function(e){var t,r=this,n=r.graphDiv,i=e._name,a=i.charAt(0),s=e._id,l=r.layers[i],u=a+"tickLayout",c=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);r[u]!==c&&(l.selectAll("."+s+"tick").remove(),r[u]=c),e.setScale();var f=h.calcTicks(e),d=h.clipEnds(e,f),p=h.makeTransTickFn(e),v=h.getTickSigns(e)[2],m=o.deg2rad(30),g=v*(e.linewidth||1)/2,y=v*e.ticklen,x=r.w,b=r.h,_="b"===a?"M0,"+g+"l"+Math.sin(m)*y+","+Math.cos(m)*y:"M"+g+",0l"+Math.cos(m)*y+","+-Math.sin(m)*y,w={a:"M0,0l"+b+",-"+x/2,b:"M0,0l-"+x/2+",-"+b,c:"M0,0l-"+b+","+x/2}[a];h.drawTicks(n,e,{vals:"inside"===e.ticks?d:f,layer:l,path:_,transFn:p,crisp:!1}),h.drawGrid(n,e,{vals:d,layer:r.layers[a+"grid"],path:w,transFn:p,crisp:!1}),h.drawLabels(n,e,{vals:f,layer:l,transFn:p,labelFns:h.makeLabelFns(e,0,30)})};var E=M.MINZOOM/2+.87,P="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(.87*E+4.5)+"l2.6,1.5l-"+E/2+","+.87*E+"Z",L="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-2.6,1.5l"+E/2+","+.87*E+"Z",I="m0,1l"+E/2+","+.87*E+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-"+(E/2+2.6)+","+(.87*E+4.5)+"l2.6,1.5l"+E/2+",-"+.87*E+"Z",R=!0;function O(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}A.clearOutline=function(){T(this.dragOptions),k(this.dragOptions.gd)},A.initInteractions=function(){var e,t,r,n,f,d,p,h,g,b,k,T,S=this,A=S.layers.plotbg.select("path").node(),E=S.graphDiv,D=E._fullLayout._zoomlayer;function z(e){var t={};return t[S.id+".aaxis.min"]=e.a,t[S.id+".baxis.min"]=e.b,t[S.id+".caxis.min"]=e.c,t}function F(e,t){var r=E._fullLayout.clickmode;O(E),2===e&&(E.emit("plotly_doubleclick",null),a.call("_guiRelayout",E,z({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&w(t,E,[S.xaxis],[S.yaxis],S.id,S.dragOptions),r.indexOf("event")>-1&&m.click(E,t,S.id)}function j(e,t){return 1-t/S.h}function N(e,t){return 1-(e+(S.h-t)/Math.sqrt(3))/S.w}function Z(e,t){return(e-(S.h-t)/Math.sqrt(3))/S.w}function B(i,a){var o=r+i*e,s=n+a*t,l=Math.max(0,Math.min(1,j(0,n),j(0,s))),u=Math.max(0,Math.min(1,N(r,n),N(o,s))),c=Math.max(0,Math.min(1,Z(r,n),Z(o,s))),v=(l/2+c)*S.w,m=(1-l/2-u)*S.w,y=(v+m)/2,x=m-v,_=(1-l)*S.h,w=_-x/C;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),T.transition().style("opacity",1).duration(200),b=!0),E.emit("plotly_relayouting",z(p))}function V(){O(E),p!==f&&(a.call("_guiRelayout",E,z(p)),R&&E.data&&E._context.showTips&&(o.notifier(l(E,"Double-click to zoom back out"),"long"),R=!1))}function U(e,t){var r=e/S.xaxis._m,n=t/S.yaxis._m,i=[(p={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,p.b,p.c].sort(o.sorterAsc),a=i.indexOf(p.a),l=i.indexOf(p.b),u=i.indexOf(p.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),p={a:i[a],b:i[l],c:i[u]},t=(f.a-p.a)*S.yaxis._m,e=(f.c-p.c-f.b+p.b)*S.xaxis._m);var d=s(S.x0+e,S.y0+t);S.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",d);var h=s(-e,-t);S.clipDefRelative.select("path").attr("transform",h),S.aaxis.range=[p.a,S.sum-p.b-p.c],S.baxis.range=[S.sum-p.a-p.c,p.b],S.caxis.range=[S.sum-p.a-p.b,p.c],S.drawAxes(!1),S._hasClipOnAxisFalse&&S.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,S),E.emit("plotly_relayouting",z(p))}function H(){a.call("_guiRelayout",E,z(p))}this.dragOptions={element:A,gd:E,plotinfo:{id:S.id,domain:E._fullLayout[S.id].domain,xaxis:S.xaxis,yaxis:S.yaxis},subplot:S.id,prepFn:function(a,l,c){S.dragOptions.xaxes=[S.xaxis],S.dragOptions.yaxes=[S.yaxis],e=E._fullLayout._invScaleX,t=E._fullLayout._invScaleY;var v=S.dragOptions.dragmode=E._fullLayout.dragmode;y(v)?S.dragOptions.minDrag=1:S.dragOptions.minDrag=void 0,"zoom"===v?(S.dragOptions.moveFn=B,S.dragOptions.clickFn=F,S.dragOptions.doneFn=V,function(e,t,a){var l=A.getBoundingClientRect();r=t-l.left,n=a-l.top,E._fullLayout._calcInverseTransform(E);var c=E._fullLayout._invTransform,v=o.apply3DTransform(c)(r,n);r=v[0],n=v[1],f={a:S.aaxis.range[0],b:S.baxis.range[1],c:S.caxis.range[1]},p=f,d=S.aaxis.range[1]-f.a,h=i(S.graphDiv._fullLayout[S.id].bgcolor).getLuminance(),g="M0,"+S.h+"L"+S.w/2+", 0L"+S.w+","+S.h+"Z",b=!1,k=D.append("path").attr("class","zoombox").attr("transform",s(S.x0,S.y0)).style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",g),T=D.append("path").attr("class","zoombox-corners").attr("transform",s(S.x0,S.y0)).style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),S.clearOutline(E)}(0,l,c)):"pan"===v?(S.dragOptions.moveFn=U,S.dragOptions.clickFn=F,S.dragOptions.doneFn=H,f={a:S.aaxis.range[0],b:S.baxis.range[1],c:S.caxis.range[1]},p=f,S.clearOutline(E)):(x(v)||y(v))&&_(a,l,c,S.dragOptions,v)}},A.onmousemove=function(e){m.hover(E,e,S.id),E._fullLayout._lasthover=A,E._fullLayout._hoversubplot=S.id},A.onmouseout=function(e){E._dragging||v.unhover(E,e)},v.init(this.dragOptions)}},73972:function(e,t,r){"use strict";var n=r(47769),i=r(64213),a=r(75138),o=r(41965),s=r(24401).addStyleRule,l=r(1426),u=r(9012),c=r(10820),f=l.extendFlat,d=l.extendDeepAll;function p(e){var r=e.name,i=e.categories,a=e.meta;if(t.modules[r])n.log("Type "+r+" already registered");else{t.subplotsRegistry[e.basePlotModule.name]||function(e){var r=e.name;if(t.subplotsRegistry[r])n.log("Plot type "+r+" already registered.");else for(var i in g(e),t.subplotsRegistry[r]=e,t.componentsRegistry)b(i,e.name)}(e.basePlotModule);for(var o={},l=0;l-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(w)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},75341:function(e,t,r){"use strict";var n=r(71828);e.exports=function(e,t){for(var r=0;rf+u||!n(c))}for(var p=0;pa))return t}return void 0!==r?r:e.dflt},t.coerceColor=function(e,t,r){return i(t).isValid()?t:void 0!==r?r:e.dflt},t.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},t.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:c<0&&(t-=r)}return t}function O(e){var t=c,r=e.b,i=R(e);return n.inbox(r-t,i-t,_+(i-t)/(i-r)-1)}var D=e[f+"a"],z=e[d+"a"];v=Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0]));var F=n.getDistanceFunction(i,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(m,F,e),!1!==e.index&&m[e.index].p!==u){T||(E=function(e){return Math.min(M(e),e.p-y.bargroupwidth/2)},P=function(e){return Math.max(S(e),e.p+y.bargroupwidth/2)});var j=m[e.index],N=g.base?j.b+j.s:j.s;e[d+"0"]=e[d+"1"]=z.c2p(j[d],!0),e[d+"LabelVal"]=N;var Z=y.extents[y.extents.round(j.p)];e[f+"0"]=D.c2p(x?E(j):Z[0],!0),e[f+"1"]=D.c2p(x?P(j):Z[1],!0);var B=void 0!==j.orig_p;return e[f+"LabelVal"]=B?j.orig_p:j.p,e.labelLabel=l(D,e[f+"LabelVal"],g[f+"hoverformat"]),e.valueLabel=l(z,e[d+"LabelVal"],g[d+"hoverformat"]),e.baseLabel=l(z,j.b,g[d+"hoverformat"]),e.spikeDistance=(function(e){var t=c,r=e.b,i=R(e);return n.inbox(r-t,i-t,w+(i-t)/(i-r)-1)}(j)+function(e){return L(M(e),S(e),w)}(j))/2,e[f+"Spike"]=D.c2p(j.p,!0),o(j,g,e),e.hovertemplate=g.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,i=s(e,t);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}e.exports={hoverPoints:function(e,t,r,n,a){var o=c(e,t,r,n,a);if(o){var s=o.cd,l=s[0].trace,u=s[o.index];return o.color=f(l,u),i.getComponentMethod("errorbars","hoverInfo")(u,l,o),[o]}},hoverOnBars:c,getTraceColor:f}},60822:function(e,t,r){"use strict";e.exports={attributes:r(1486),layoutAttributes:r(43641),supplyDefaults:r(90769).supplyDefaults,crossTraceDefaults:r(90769).crossTraceDefaults,supplyLayoutDefaults:r(13957),calc:r(92290),crossTraceCalc:r(11661).crossTraceCalc,colorbar:r(4898),arraysToCalcdata:r(75341),plot:r(17295).plot,style:r(16688).style,styleOnSelect:r(16688).styleOnSelect,hoverPoints:r(95423).hoverPoints,eventData:r(58065),selectPoints:r(81974),moduleType:"trace",name:"bar",basePlotModule:r(93612),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},43641:function(e){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},13957:function(e,t,r){"use strict";var n=r(73972),i=r(89298),a=r(71828),o=r(43641);e.exports=function(e,t,r){function s(r,n){return a.coerce(e,t,o,r,n)}for(var l=!1,u=!1,c=!1,f={},d=s("barmode"),p=0;p0}function A(e){return"auto"===e?0:e}function C(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:e.width*i+e.height*n,y:e.width*n+e.height*i}}function E(e,t,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,u=a.anchor||"end",c="end"===u,f="start"===u,d=((a.leftToRight||0)+1)/2,p=1-d,h=i.width,v=i.height,m=Math.abs(t-e),g=Math.abs(n-r),y=m>2*_&&g>2*_?_:0;m-=2*y,g-=2*y;var x=A(l);"auto"!==l||h<=m&&v<=g||!(h>m||v>g)||(h>g||v>m)&&h.01?W:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?W(e):e>t?Math.ceil(e):Math.floor(e)};N=G(N,Z,z),Z=G(Z,N,z),B=G(B,V,!z),V=G(V,B,!z)}var q=M(a.ensureSingle(R,"path"),L,m,g);if(q.style("vector-effect",I?"none":"non-scaling-stroke").attr("d",isNaN((Z-N)*(V-B))||U&&e._context.staticPlot?"M0,0Z":"M"+N+","+B+"V"+V+"H"+Z+"V"+B+"Z").call(l.setClipUrl,t.layerClipId,e),!L.uniformtext.mode&&F){var Y=l.makePointStyleFns(f);l.singlePointStyle(u,q,f,Y,e)}!function(e,t,r,n,i,s,u,f,p,m,g){var w,k=t.xaxis,S=t.yaxis,P=e._fullLayout;function L(t,r,n){return a.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,e)}var I=n[0].trace,R="h"===I.orientation,O=function(e,t,r,n,i){var o,s=t[0].trace,l=s.texttemplate;return o=l?function(e,t,r,n,i){var o=t[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,u,f,d,p="histogram"===o.type,h="waterfall"===o.type,v="funnel"===o.type,m="h"===o.orientation;function g(e){return c(u,u.c2l(e),!0).text}function y(e){return c(d,d.c2l(e),!0).text}m?(l="y",u=i,f="x",d=n):(l="x",u=n,f="y",d=i);var x=t[r],_={};_.label=x.p,_.labelLabel=_[l+"Label"]=g(x.p);var w=a.castOption(o,x.i,"text");(0===w||w)&&(_.text=w),_.value=x.s,_.valueLabel=_[f+"Label"]=y(x.s);var k={};b(k,o,x.i),(p||void 0===k.x)&&(k.x=m?_.value:_.label),(p||void 0===k.y)&&(k.y=m?_.label:_.value),(p||void 0===k.xLabel)&&(k.xLabel=m?_.valueLabel:_.labelLabel),(p||void 0===k.yLabel)&&(k.yLabel=m?_.labelLabel:_.valueLabel),h&&(_.delta=+x.rawS||x.s,_.deltaLabel=y(_.delta),_.final=x.v,_.finalLabel=y(_.final),_.initial=_.final-_.delta,_.initialLabel=y(_.initial)),v&&(_.value=x.s,_.valueLabel=y(_.value),_.percentInitial=x.begR,_.percentInitialLabel=a.formatPercent(x.begR),_.percentPrevious=x.difR,_.percentPreviousLabel=a.formatPercent(x.difR),_.percentTotal=x.sumR,_.percenTotalLabel=a.formatPercent(x.sumR));var T=a.castOption(o,x.i,"customdata");return T&&(_.customdata=T),a.texttemplateString(s,_,e._d3locale,k,_,o._meta||{})}(e,t,r,n,i):s.textinfo?function(e,t,r,n){var i=e[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function u(e){return c(o?n:r,e,!0).text}function f(e){return c(o?r:n,+e,!0).text}var d,p=i.textinfo,h=e[t],v=p.split("+"),m=[],g=function(e){return-1!==v.indexOf(e)};if(g("label")&&m.push(u(e[t].p)),g("text")&&(0===(d=a.castOption(i,h.i,"text"))||d)&&m.push(d),s){var y=+h.rawS||h.s,x=h.v,b=x-y;g("initial")&&m.push(f(b)),g("delta")&&m.push(f(y)),g("final")&&m.push(f(x))}if(l){g("value")&&m.push(f(h.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var w=_>1;g("percent initial")&&(d=a.formatPercent(h.begR),w&&(d+=" of initial"),m.push(d)),g("percent previous")&&(d=a.formatPercent(h.difR),w&&(d+=" of previous"),m.push(d)),g("percent total")&&(d=a.formatPercent(h.sumR),w&&(d+=" of total"),m.push(d))}return m.join("
")}(t,r,n,i):v.getValue(s.text,r),v.coerceString(y,o)}(P,n,i,k,S);w=function(e,t){var r=v.getValue(e.textposition,t);return v.coerceEnumerated(x,r)}(I,i);var D="stack"===m.mode||"relative"===m.mode,z=n[i],F=!D||z._outmost;if(O&&"none"!==w&&(!z.isBlank&&s!==u&&f!==p||"auto"!==w&&"inside"!==w)){var j=P.font,N=h.getBarColor(n[i],I),Z=h.getInsideTextFont(I,i,j,N),B=h.getOutsideTextFont(I,i,j),V=r.datum();R?"log"===k.type&&V.s0<=0&&(s=k.range[0]0&&G>0&&(W<=Y&&G<=X||W<=X&&G<=Y||(R?Y>=W*(X/G):X>=G*(Y/W)))?w="inside":(w="outside",U.remove(),U=null)):w="inside"),!U){var K=(U=L(r,O,q=a.ensureUniformFontSize(e,"outside"===w?B:Z))).attr("transform");if(U.attr("transform",""),W=(H=l.bBox(U.node())).width,G=H.height,U.attr("transform",K),W<=0||G<=0)return void U.remove()}var $,J=I.textangle;$="outside"===w?function(e,t,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,u=a.angle||0,c=i.width,f=i.height,d=Math.abs(t-e),p=Math.abs(n-r);o=s?p>2*_?_:0:d>2*_?_:0;var h=1;l&&(h=s?Math.min(1,p/f):Math.min(1,d/c));var v=A(u),m=C(i,v),g=(s?m.x:m.y)/2,y=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(e+t)/2,w=(r+n)/2,k=0,M=0,S=s?T(t,e):T(r,n);return s?(b=t-S*o,k=S*g):(w=n+S*o,M=-S*g),{textX:y,textY:x,targetX:b,targetY:w,anchorX:k,anchorY:M,scale:h,rotate:v}}(s,u,f,p,H,{isHorizontal:R,constrained:"both"===I.constraintext||"outside"===I.constraintext,angle:J}):E(s,u,f,p,H,{isHorizontal:R,constrained:"both"===I.constraintext||"inside"===I.constraintext,angle:J,anchor:I.insidetextanchor}),$.fontSize=q.size,d("histogram"===I.type?"bar":I.type,$,P),z.transform=$;var Q=M(U,P,m,g);a.setTransormAndDisplay(Q,$)}else r.select("text").remove()}(e,t,R,r,p,N,Z,B,V,m,g),t.layerClipId&&l.hideOutsideRangePoint(u,R.select("text"),w,P,f.xcalendar,f.ycalendar)}));var B=!1===f.cliponaxis;l.setClipUrl(u,B?null:t.layerClipId,e)}));u.getComponentMethod("errorbars","plot")(e,R,t,m)},toMoveInsideBar:E}},81974:function(e){"use strict";function t(e,t,r,n,i){var a=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),s=r.c2p(n?e.p0:e.s0,!0),l=r.c2p(n?e.p1:e.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(e,r){var n,i=e.cd,a=e.xaxis,o=e.yaxis,s=i[0].trace,l="funnel"===s.type,u="h"===s.orientation,c=[];if(!1===r)for(n=0;n1||0===i.bargap&&0===i.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),s.getComponentMethod("errorbars","style")(t)},styleTextPoints:v,styleOnSelect:function(e,t,r){var i=t[0].trace;i.selectedpoints?function(e,t,r){a.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var i,s=n.select(this);if(e.selected){i=o.ensureUniformFontSize(r,m(s,e,t,r));var l=t.selected.textfont&&t.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,t)}))}(e.selectAll("text"),t,r)}(r,i,e):(h(r,i,e),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:l}},98340:function(e,t,r){"use strict";var n=r(7901),i=r(52075).hasColorscale,a=r(1586),o=r(71828).coercePattern;e.exports=function(e,t,r,s,l){var u=r("marker.color",s),c=i(e,"marker");c&&a(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(e,"marker.line")&&a(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",u,c),r("selected.marker.color"),r("unselected.marker.color")}},72597:function(e,t,r){"use strict";var n=r(39898),i=r(71828);function a(e){return"_"+e+"Text_minsize"}e.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=a(e),i=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=od.range[1]&&(x+=Math.PI),n.getClosest(u,(function(e){return v(y,x,[e.rp0,e.rp1],[e.thetag0,e.thetag1],h)?m+Math.min(1,Math.abs(e.thetag1-e.thetag0)/g)-1+(e.rp1-y)/(e.rp1-e.rp0)-1:1/0}),e),!1!==e.index){var b=u[e.index];e.x0=e.x1=b.ct[0],e.y0=e.y1=b.ct[1];var _=i.extendFlat({},b,{r:b.s,theta:b.p});return o(b,c,e),s(_,c,f,e),e.hovertemplate=c.hovertemplate,e.color=a(c,b),e.xLabelVal=e.yLabelVal=void 0,b.s<0&&(e.idealAlign="left"),[e]}}},23381:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:r(23580),categories:["polar","bar","showLegend"],attributes:r(55023),layoutAttributes:r(40151),supplyDefaults:r(6135),supplyLayoutDefaults:r(19860),calc:r(74692).calc,crossTraceCalc:r(74692).crossTraceCalc,plot:r(60173),colorbar:r(4898),formatLabels:r(98608),style:r(16688).style,styleOnSelect:r(16688).styleOnSelect,hoverPoints:r(27379),selectPoints:r(81974),meta:{}}},40151:function(e){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},19860:function(e,t,r){"use strict";var n=r(71828),i=r(40151);e.exports=function(e,t,r){var a,o={};function s(r,o){return n.coerce(e[a]||{},t[a],i,r,o)}for(var l=0;l0?(u=o,c=l):(u=l,c=o);var f=[s.findEnclosingVertexAngles(u,e.vangles)[0],(u+c)/2,s.findEnclosingVertexAngles(c,e.vangles)[1]];return s.pathPolygonAnnulus(n,i,u,c,f,t,r)}:function(e,n,i,o){return a.pathAnnulus(e,n,i,o,t,r)}}(t),h=t.layers.frontplot.select("g.barlayer");a.makeTraceGroups(h,r,"trace bars").each((function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(e){var t,r=n.select(this),o=e.rp0=f.c2p(e.s0),s=e.rp1=f.c2p(e.s1),l=e.thetag0=d.c2g(e.p0),h=e.thetag1=d.c2g(e.p1);if(i(o)&&i(s)&&i(l)&&i(h)&&o!==s&&l!==h){var v=f.c2g(e.s1),m=(l+h)/2;e.ct=[u.c2p(v*Math.cos(m)),c.c2p(v*Math.sin(m))],t=p(o,s,l,h)}else t="M0,0Z";a.ensureSingle(r,"path").attr("d",t)})),o.setClipUrl(r,t._hasClipOnAxisFalse?t.clipIds.forTraces:null,e)}))}},53522:function(e,t,r){"use strict";var n=r(82196),i=r(1486),a=r(22399),o=r(12663).axisHoverFormat,s=r(5386).fF,l=r(1426).extendFlat,u=n.marker,c=u.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},u.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},u.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},u.angle,{arrayOk:!1,editType:"calc"}),size:l({},u.size,{arrayOk:!1,editType:"calc"}),color:l({},u.color,{arrayOk:!1,editType:"style"}),line:{color:l({},c.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},c.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},48518:function(e,t,r){"use strict";var n=r(92770),i=r(89298),a=r(42973),o=r(71828),s=r(50606).BADNUM,l=o._;e.exports=function(e,t){var r,u,y,x,b,_,w,k=e._fullLayout,T=i.getFromId(e,t.xaxis||"x"),M=i.getFromId(e,t.yaxis||"y"),S=[],A="violin"===t.type?"_numViolins":"_numBoxes";"h"===t.orientation?(y=T,x="x",b=M,_="y",w=!!t.yperiodalignment):(y=M,x="y",b=T,_="x",w=!!t.xperiodalignment);var C,E,P,L,I,R,O=function(e,t,r,i){var s,l=t in e,u=t+"0"in e,c="d"+t in e;if(l||u&&c){var f=r.makeCalcdata(e,t);return[a(e,r,t,f).vals,f]}s=u?e[t+"0"]:"name"in e&&("category"===r.type||n(e.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(e.name)&&"date"===r.type)?e.name:i;for(var d="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,e[t+"calendar"]),p=e._length,h=new Array(p),v=0;vC.uf};if(t._hasPreCompStats){var B=t[x],V=function(e){return y.d2c((t[e]||[])[r])},U=1/0,H=-1/0;for(r=0;r=C.q1&&C.q3>=C.med){var G=V("lowerfence");C.lf=G!==s&&G<=C.q1?G:p(C,P,L);var q=V("upperfence");C.uf=q!==s&&q>=C.q3?q:h(C,P,L);var Y=V("mean");C.mean=Y!==s?Y:L?o.mean(P,L):(C.q1+C.q3)/2;var X=V("sd");C.sd=Y!==s&&X>=0?X:L?o.stdev(P,L,C.mean):C.q3-C.q1,C.lo=v(C),C.uo=m(C);var K=V("notchspan");K=K!==s&&K>0?K:g(C,L),C.ln=C.med-K,C.un=C.med+K;var $=C.lf,J=C.uf;t.boxpoints&&P.length&&($=Math.min($,P[0]),J=Math.max(J,P[L-1])),t.notched&&($=Math.min($,C.ln),J=Math.max(J,C.un)),C.min=$,C.max=J}else{var Q;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+C.q1,"median = "+C.med,"q3 = "+C.q3].join("\n")),Q=C.med!==s?C.med:C.q1!==s?C.q3!==s?(C.q1+C.q3)/2:C.q1:C.q3!==s?C.q3:0,C.med=Q,C.q1=C.q3=Q,C.lf=C.uf=Q,C.mean=C.sd=Q,C.ln=C.un=Q,C.min=C.max=Q}U=Math.min(U,C.min),H=Math.max(H,C.max),C.pts2=E.filter(Z),S.push(C)}}t._extremes[y._id]=i.findExtremes(y,[U,H],{padded:!0})}else{var ee=y.makeCalcdata(t,x),te=function(e,t){for(var r=e.length,n=new Array(r+1),i=0;i=0&&ie0){var ce,fe;(C={}).pos=C[_]=j[r],E=C.pts=ne[r].sort(f),L=(P=C[x]=E.map(d)).length,C.min=P[0],C.max=P[L-1],C.mean=o.mean(P,L),C.sd=o.stdev(P,L,C.mean)*t.sdmultiple,C.med=o.interp(P,.5),L%2&&(le||ue)?(le?(ce=P.slice(0,L/2),fe=P.slice(L/2+1)):ue&&(ce=P.slice(0,L/2+1),fe=P.slice(L/2)),C.q1=o.interp(ce,.5),C.q3=o.interp(fe,.5)):(C.q1=o.interp(P,.25),C.q3=o.interp(P,.75)),C.lf=p(C,P,L),C.uf=h(C,P,L),C.lo=v(C),C.uo=m(C);var de=g(C,L);C.ln=C.med-de,C.un=C.med+de,ae=Math.min(ae,C.ln),oe=Math.max(oe,C.un),C.pts2=E.filter(Z),S.push(C)}t._extremes[y._id]=i.findExtremes(y,t.notched?ee.concat([ae,oe]):ee,{padded:!0})}return function(e,t){if(o.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(S[0].t={num:k[A],dPos:N,posLetter:_,valLetter:x,labels:{med:l(e,"median:"),min:l(e,"min:"),q1:l(e,"q1:"),q3:l(e,"q3:"),max:l(e,"max:"),mean:"sd"===t.boxmean||"sd"===t.sizemode?l(e,"mean \xb1 \u03c3:").replace("\u03c3",1===t.sdmultiple?"\u03c3":t.sdmultiple+"\u03c3"):l(e,"mean:"),lf:l(e,"lower fence:"),uf:l(e,"upper fence:")}},k[A]++,S):[{t:{empty:!0}}]};var u={text:"tx",hovertext:"htx"};function c(e,t,r){for(var n in u)o.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(t[n][r[0]])&&(e[u[n]]=t[n][r[0]][r[1]]):e[u[n]]=t[n][r])}function f(e,t){return e.v-t.v}function d(e){return e.v}function p(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(o.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function h(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(o.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function v(e){return 4*e.q1-3*e.q3}function m(e){return 4*e.q3-3*e.q1}function g(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}},37188:function(e,t,r){"use strict";var n=r(89298),i=r(71828),a=r(99082).getAxisGroup,o=["v","h"];function s(e,t,r,o){var s,l,u,c=t.calcdata,f=t._fullLayout,d=o._id,p=d.charAt(0),h=[],v=0;for(s=0;s1,b=1-f[e+"gap"],_=1-f[e+"groupgap"];for(s=0;s0){var H=C.pointpos,W=C.jitter,G=C.marker.size/2,q=0;H+W>=0&&((q=V*(H+W))>S?(U=!0,Z=G,j=q):q>z&&(Z=G,j=S)),q<=S&&(j=S);var Y=0;H-W<=0&&((Y=-V*(H-W))>A?(U=!0,B=G,N=Y):Y>F&&(B=G,N=A)),Y<=A&&(N=A)}else j=S,N=A;var X=new Array(u.length);for(l=0;l0?(m="v",g=x>0?Math.min(_,b):Math.min(b)):x>0?(m="h",g=Math.min(_)):g=0;if(g){t._length=g;var A=r("orientation",m);t._hasPreCompStats?"v"===A&&0===x?(r("x0",0),r("dx",1)):"h"===A&&0===y&&(r("y0",0),r("dy",1)):"v"===A&&0===x?r("x0"):"h"===A&&0===y&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],a)}else t.visible=!1}function f(e,t,r,i){var a=i.prefix,o=n.coerce2(e,t,u,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";t._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var c=r(a+"points",l);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.angle"),r("marker.color",t.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",t.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete t.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(t,r)}e.exports={supplyDefaults:function(e,t,r,i){function s(r,i){return n.coerce(e,t,u,r,i)}if(c(e,t,s,i),!1!==t.visible){o(e,t,i,s),s("xhoverformat"),s("yhoverformat");var l=t._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(e.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(t.line.color,.5));var d=!1;if(l){var p=s("mean"),h=s("sd");p&&p.length&&(d=!0,h&&h.length&&(d="sd"))}s("whiskerwidth");var v,m=s("sizemode");"quartiles"===m&&(v=s("boxmean",d)),s("showwhiskers","quartiles"===m),"sd"!==m&&"sd"!==v||s("sdmultiple"),s("width"),s("quartilemethod");var g=!1;if(l){var y=s("notchspan");y&&y.length&&(g=!0)}else n.validate(e.notchwidth,u.notchwidth)&&(g=!0);s("notched",g)&&s("notchwidth"),f(e,t,s,{prefix:"box"})}},crossTraceDefaults:function(e,t){var r,i;function a(e){return n.coerce(i._input,i,u,e)}for(var o=0;oe.lo&&(_.so=!0)}return a}));h.enter().append("path").classed("point",!0),h.exit().remove(),h.call(a.translatePoints,l,u)}function c(e,t,r,a){var o,s,l=t.val,u=t.pos,c=!!u.rangebreaks,f=a.bPos,d=a.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var h=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);h.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),h.exit().remove(),h.each((function(e){var t=u.c2l(e.pos+f,!0),i=u.l2p(t-o)+d,a=u.l2p(t+s)+d,h=c?(i+a)/2:u.l2p(t)+d,v=l.c2p(e.mean,!0),m=l.c2p(e.mean-e.sd,!0),g=l.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+v+","+i+"V"+a+("sd"===p?"m0,0L"+m+","+h+"L"+v+","+i+"L"+g+","+h+"Z":"")):n.select(this).attr("d","M"+i+","+v+"H"+a+("sd"===p?"m0,0L"+h+","+m+"L"+i+","+v+"L"+h+","+g+"Z":""))}))}e.exports={plot:function(e,t,r,a){var o=e._context.staticPlot,s=t.xaxis,f=t.yaxis;i.makeTraceGroups(a,r,"trace boxes").each((function(e){var t,r,i=n.select(this),a=e[0],d=a.t,p=a.trace;d.wdPos=d.bdPos*p.whiskerwidth,!0!==p.visible||d.empty?i.remove():("h"===p.orientation?(t=f,r=s):(t=s,r=f),l(i,{pos:t,val:r},p,d,o),u(i,{x:s,y:f},p,d),c(i,{pos:t,val:r},p,d))}))},plotBoxAndWhiskers:l,plotPoints:u,plotBoxMean:c}},24626:function(e){"use strict";e.exports=function(e,t){var r,n,i=e.cd,a=e.xaxis,o=e.yaxis,s=[];if(!1===t)for(r=0;r=10)return null;for(var r=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,I=E>0?Math.ceil:Math.floor,R=E>0?Math.min:Math.max,O=E>0?Math.max:Math.min,D=L(A+P),z=I(C-P),F=[[f=S(A)]];for(a=D;a*E=0;i--)a[c-i]=e[f][i],o[c-i]=t[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=e[i][0],o[f-i]=t[i][0];return s.push({x:a,y:o,bicubic:u}),s}},20347:function(e,t,r){"use strict";var n=r(89298),i=r(1426).extendFlat;e.exports=function(e,t,r){var a,o,s,l,u,c,f,d,p,h,v,m,g,y,x=e["_"+t],b=e[t+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],k=b._boundarylines=[],T=e["_"+r],M=e[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var S=e._xctrl,A=e._yctrl,C=S[0].length,E=S.length,P=e._a.length,L=e._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function R(n){var i,a,o,s,l,u,c,f,p,h,v,m,g=[],y=[],x={};if("b"===t)for(a=e.b2j(n),o=Math.floor(Math.max(0,Math.min(L-2,a))),s=a-o,x.length=L,x.crossLength=P,x.xy=function(t){return e.evalxy([],t,a)},x.dxy=function(t,r){return e.dxydi([],t,o,r,s)},i=0;i0&&(p=e.dxydi([],i-1,o,0,s),g.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),h=e.dxydi([],i-1,o,1,s),g.push(f[0]-h[0]/3),y.push(f[1]-h[1]/3)),g.push(f[0]),y.push(f[1]),l=f;else for(i=e.a2i(n),u=Math.floor(Math.max(0,Math.min(P-2,i))),c=i-u,x.length=P,x.crossLength=L,x.xy=function(t){return e.evalxy([],i,t)},x.dxy=function(t,r){return e.dxydj([],u,t,c,r)},a=0;a0&&(v=e.dxydj([],u,a-1,c,0),g.push(l[0]+v[0]/3),y.push(l[1]+v[1]/3),m=e.dxydj([],u,a-1,c,1),g.push(f[0]-m[0]/3),y.push(f[1]-m[1]/3)),g.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=t,x.axis=b,x.crossAxis=M,x.value=n,x.constvar=r,x.index=d,x.x=g,x.y=y,x.smoothing=M.smoothing,x}function O(n){var i,a,o,s,l,u=[],c=[],f={};if(f.length=x.length,f.crossLength=T.length,"b"===t)for(o=Math.max(0,Math.min(L-2,n)),l=Math.min(1,Math.max(0,n-o)),f.xy=function(t){return e.evalxy([],t,n)},f.dxy=function(t,r){return e.dxydi([],t,o,r,l)},i=0;ix.length-1||_.push(i(O(o),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(d=c;dx.length-1)&&!(v<0||v>x.length-1))for(m=x[s],g=x[v],a=0;ax[x.length-1]||w.push(i(R(h),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&k.push(i(O(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(i(O(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,c=(u=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(e,t){return e-t})))[0],f=u[1],d=c;d<=f;d++)p=b.tick0+b.dtick*d,_.push(i(R(p),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(d=c-1;dx[x.length-1]||w.push(i(R(h),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&k.push(i(R(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(i(R(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},83311:function(e,t,r){"use strict";var n=r(89298),i=r(1426).extendFlat;e.exports=function(e,t){var r,a,o,s=t._labels=[],l=t._gridlines;for(r=0;rt.length&&(e=e.slice(0,t.length)):e=[],i=0;i90&&(p-=180,l=-l),{angle:p,flip:l,p:e.c2p(n,t,r),offsetMultplier:u}}},89740:function(e,t,r){"use strict";var n=r(39898),i=r(91424),a=r(27669),o=r(67961),s=r(11651),l=r(63893),u=r(71828),c=u.strRotate,f=u.strTranslate,d=r(18783);function p(e,t,r,s,l,u,c){var f="const-"+l+"-lines",d=r.selectAll("."+f).data(u);d.enter().append("path").classed(f,!0).style("vector-effect",c?"none":"non-scaling-stroke"),d.each((function(r){var s=r,l=s.x,u=s.y,c=a([],l,e.c2p),f=a([],u,t.c2p),d="M"+o(c,f,s.smoothing);n.select(this).attr("d",d).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",i.dashStyle(s.dash,s.width)).style("fill","none")})),d.exit().remove()}function h(e,t,r,a,o,u,d,p){var h=u.selectAll("text."+p).data(d);h.enter().append("text").classed(p,!0);var v=0,m={};return h.each((function(o,u){var d;if("auto"===o.axis.tickangle)d=s(a,t,r,o.xy,o.dxy);else{var p=(o.axis.tickangle+180)*Math.PI/180;d=s(a,t,r,o.xy,[Math.cos(p),Math.sin(p)])}u||(m={angle:d.angle,flip:d.flip});var h=(o.endAnchor?-1:1)*d.flip,g=n.select(this).attr({"text-anchor":h>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,e),y=i.bBox(this);g.attr("transform",f(d.p[0],d.p[1])+c(d.angle)+f(o.axis.labelpadding*h,.3*y.height)),v=Math.max(v,y.width+o.axis.labelpadding)})),h.exit().remove(),m.maxExtent=v,m}e.exports=function(e,t,r,i){var l=e._context.staticPlot,c=t.xaxis,f=t.yaxis,d=e._fullLayout._clips;u.makeTraceGroups(i,r,"trace").each((function(t){var r=n.select(this),i=t[0],v=i.trace,m=v.aaxis,y=v.baxis,x=u.ensureSingle(r,"g","minorlayer"),b=u.ensureSingle(r,"g","majorlayer"),_=u.ensureSingle(r,"g","boundarylayer"),w=u.ensureSingle(r,"g","labellayer");r.style("opacity",v.opacity),p(c,f,b,0,"a",m._gridlines,!0),p(c,f,b,0,"b",y._gridlines,!0),p(c,f,x,0,"a",m._minorgridlines,!0),p(c,f,x,0,"b",y._minorgridlines,!0),p(c,f,_,0,"a-boundary",m._boundarylines,l),p(c,f,_,0,"b-boundary",y._boundarylines,l);var k=h(e,c,f,v,0,w,m._labels,"a-label"),T=h(e,c,f,v,0,w,y._labels,"b-label");!function(e,t,r,n,i,a,o,l){var c,f,d,p,h=u.aggNums(Math.min,null,r.a),v=u.aggNums(Math.max,null,r.a),m=u.aggNums(Math.min,null,r.b),y=u.aggNums(Math.max,null,r.b);c=.5*(h+v),f=m,d=r.ab2xy(c,f,!0),p=r.dxyda_rough(c,f),void 0===o.angle&&u.extendFlat(o,s(r,i,a,d,r.dxydb_rough(c,f))),g(e,t,r,0,d,p,r.aaxis,i,a,o,"a-title"),c=h,f=.5*(m+y),d=r.ab2xy(c,f,!0),p=r.dxydb_rough(c,f),void 0===l.angle&&u.extendFlat(l,s(r,i,a,d,r.dxyda_rough(c,f))),g(e,t,r,0,d,p,r.baxis,i,a,l,"b-title")}(e,w,v,0,c,f,k,T),function(e,t,r,n,i){var s,l,c,f,d=r.select("#"+e._clipPathId);d.size()||(d=r.append("clipPath").classed("carpetclip",!0));var p=u.ensureSingle(d,"path","carpetboundary"),h=t.clipsegments,v=[];for(f=0;f90&&y<270,b=n.select(this);b.text(d.title.text).call(l.convertToTspans,e),x&&(_=(-l.lineCount(b)+m)*v*a-_),b.attr("transform",f(t.p[0],t.p[1])+c(t.angle)+f(0,_)).attr("text-anchor","middle").call(i.font,d.title.font)})),b.exit().remove()}},11435:function(e,t,r){"use strict";var n=r(35509),i=r(65888).findBin,a=r(45664),o=r(20349),s=r(54495),l=r(73057);e.exports=function(e){var t=e._a,r=e._b,u=t.length,c=r.length,f=e.aaxis,d=e.baxis,p=t[0],h=t[u-1],v=r[0],m=r[c-1],g=t[t.length-1]-t[0],y=r[r.length-1]-r[0],x=g*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,h+=x,v-=b,m+=b,e.isVisible=function(e,t){return e>p&&ev&&th||tm},e.setScale=function(){var t=e._x,r=e._y,n=a(e._xctrl,e._yctrl,t,r,f.smoothing,d.smoothing);e._xctrl=n[0],e._yctrl=n[1],e.evalxy=o([e._xctrl,e._yctrl],u,c,f.smoothing,d.smoothing),e.dxydi=s([e._xctrl,e._yctrl],f.smoothing,d.smoothing),e.dxydj=l([e._xctrl,e._yctrl],f.smoothing,d.smoothing)},e.i2a=function(e){var r=Math.max(0,Math.floor(e[0]),u-2),n=e[0]-r;return(1-n)*t[r]+n*t[r+1]},e.j2b=function(e){var t=Math.max(0,Math.floor(e[1]),u-2),n=e[1]-t;return(1-n)*r[t]+n*r[t+1]},e.ij2ab=function(t){return[e.i2a(t[0]),e.j2b(t[1])]},e.a2i=function(e){var r=Math.max(0,Math.min(i(e,t),u-2)),n=t[r],a=t[r+1];return Math.max(0,Math.min(u-1,r+(e-n)/(a-n)))},e.b2j=function(e){var t=Math.max(0,Math.min(i(e,r),c-2)),n=r[t],a=r[t+1];return Math.max(0,Math.min(c-1,t+(e-n)/(a-n)))},e.ab2ij=function(t){return[e.a2i(t[0]),e.b2j(t[1])]},e.i2c=function(t,r){return e.evalxy([],t,r)},e.ab2xy=function(n,i,a){if(!a&&(nt[u-1]|ir[c-1]))return[!1,!1];var o=e.a2i(n),s=e.b2j(i),l=e.evalxy([],o,s);if(a){var f,d,p,h,v=0,m=0,g=[];nt[u-1]?(f=u-2,d=1,v=(n-t[u-1])/(t[u-1]-t[u-2])):d=o-(f=Math.max(0,Math.min(u-2,Math.floor(o)))),ir[c-1]?(p=c-2,h=1,m=(i-r[c-1])/(r[c-1]-r[c-2])):h=s-(p=Math.max(0,Math.min(c-2,Math.floor(s)))),v&&(e.dxydi(g,f,p,d,h),l[0]+=g[0]*v,l[1]+=g[1]*v),m&&(e.dxydj(g,f,p,d,h),l[0]+=g[0]*m,l[1]+=g[1]*m)}return l},e.c2p=function(e,t,r){return[t.c2p(e[0]),r.c2p(e[1])]},e.p2x=function(e,t,r){return[t.p2c(e[0]),r.p2c(e[1])]},e.dadi=function(e){var r=Math.max(0,Math.min(t.length-2,e));return t[r+1]-t[r]},e.dbdj=function(e){var t=Math.max(0,Math.min(r.length-2,e));return r[t+1]-r[t]},e.dxyda=function(t,r,n,i){var a=e.dxydi(null,t,r,n,i),o=e.dadi(t,n);return[a[0]/o,a[1]/o]},e.dxydb=function(t,r,n,i){var a=e.dxydj(null,t,r,n,i),o=e.dbdj(r,i);return[a[0]/o,a[1]/o]},e.dxyda_rough=function(t,r,n){var i=g*(n||.1),a=e.ab2xy(t+i,r,!0),o=e.ab2xy(t-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dxydb_rough=function(t,r,n){var i=y*(n||.1),a=e.ab2xy(t,r+i,!0),o=e.ab2xy(t,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dpdx=function(e){return e._m},e.dpdy=function(e){return e._m}}},72505:function(e,t,r){"use strict";var n=r(71828);e.exports=function(e,t,r){var i,a,o,s=[],l=[],u=e[0].length,c=e.length;function f(t,r){var n,i=0,a=0;return t>0&&void 0!==(n=e[r][t-1])&&(a++,i+=n),t0&&void 0!==(n=e[r-1][t])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",T,"after",M,"iterations"),e}},19237:function(e,t,r){"use strict";var n=r(71828).isArray1D;e.exports=function(e,t,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(t._cheater=!i,a&&!n(i)||s&&!n(o))t._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),t.a&&t.a.length&&(l=Math.min(l,t.a.length)),t.b&&t.b.length&&(l=Math.min(l,t.b.length)),t._length=l}return!0}},69568:function(e,t,r){"use strict";var n=r(5386).fF,i=r(19316),a=r(50693),o=r(9012),s=r(22399).defaultLine,l=r(1426).extendFlat,u=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},u.color,{dflt:s}),width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},38675:function(e,t,r){"use strict";var n=r(92770),i=r(50606).BADNUM,a=r(78803),o=r(75225),s=r(66279);function l(e){return e&&"string"===typeof e}e.exports=function(e,t){var r,u=t._length,c=new Array(u);r=t.geojson?function(e){return l(e)||n(e)}:l;for(var f=0;f")}}(e,f,o),[e]}},51319:function(e,t,r){"use strict";e.exports={attributes:r(69568),supplyDefaults:r(61869),colorbar:r(61243),calc:r(38675),calcGeoJSON:r(99841).calcGeoJSON,plot:r(99841).plot,style:r(99636).style,styleOnSelect:r(99636).styleOnSelect,hoverPoints:r(42300),eventData:r(92069),selectPoints:r(81253),moduleType:"trace",name:"choropleth",basePlotModule:r(44622),categories:["geo","noOpacity","showLegend"],meta:{}}},99841:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=r(41327),o=r(90973).getTopojsonFeatures,s=r(71739).findExtremes,l=r(99636).style;e.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],i=n._subplot,l=r.locationmode,u=r._length,c="geojson-id"===l?a.extractTraceFeature(e):o(r,i.topojson),f=[],d=[],p=0;p=0;n--){var i=r[n].id;if("string"===typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)e.removeLayer(t[r][1])},s.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},e.exports=function(e,t){var r=t[0].trace,i=new o(e,r.uid),a=i.sourceId,s=n(t),l=i.below=e.belowLookup["trace-"+r.uid];return e.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),t[0].trace._glTrace=i,i}},12674:function(e,t,r){"use strict";var n=r(50693),i=r(12663).axisHoverFormat,a=r(5386).fF,o=r(2418),s=r(9012),l=r(1426).extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(u,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(e){u[e]=o[e]})),u.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),u.transforms=void 0,e.exports=u},31371:function(e,t,r){"use strict";var n=r(78803);e.exports=function(e,t){for(var r=t.u,i=t.v,a=t.w,o=Math.min(t.x.length,t.y.length,t.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,u=0;uo.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,u=-1/0,c=1/0;for(r=0;r":p>u&&(n.prefixBoundary=!0);break;case"<":(pu||n.starts.length&&d===c)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),d=Math.max(p[0],p[1]),fu&&(n.prefixBoundary=!0)}}}},90654:function(e,t,r){"use strict";var n=r(21081),i=r(86068),a=r(53572);e.exports={min:"zmin",max:"zmax",calc:function(e,t,r){var o=t.contours,s=t.line,l=o.size||1,u=o.coloring,c=i(t,{isColorbar:!0});if("heatmap"===u){var f=n.extractOpts(t);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===u&&(r._fillcolor=c);r._line={color:"lines"===u?c:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},36914:function(e){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},83179:function(e,t,r){"use strict";var n=r(92770),i=r(14523),a=r(7901),o=a.addOpacity,s=a.opacity,l=r(74808),u=l.CONSTRAINT_REDUCTION,c=l.COMPARISON_OPS2;e.exports=function(e,t,r,a,l,f){var d,p,h,v=t.contours,m=r("contours.operation");v._operation=u[m],function(e,t){var r;-1===c.indexOf(t.operation)?(e("contours.value",[0,1]),Array.isArray(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e("contours.value",0),n(t.value)||(Array.isArray(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(r,v),"="===m?d=v.showlines=!0:(d=r("contours.showlines"),h=r("fillcolor",o((e.line||{}).color||l,.5))),d&&(p=r("line.color",h&&s(h)?o(t.fillcolor,1):l),r("line.width",2),r("line.dash")),r("line.smoothing"),i(r,a,p,f)}},64237:function(e,t,r){"use strict";var n=r(74808),i=r(92770);function a(e,t){var r,a=Array.isArray(t);function o(e){return i(e)?+e:null}return-1!==n.COMPARISON_OPS2.indexOf(e)?r=o(a?t[0]:t):-1!==n.INTERVAL_OPS.indexOf(e)?r=a?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==n.SET_OPS.indexOf(e)&&(r=a?t.map(o):[o(t)]),r}function o(e){return function(t){t=a(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function s(e){return function(t){return{start:t=a(e,t),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},67217:function(e){"use strict";e.exports=function(e,t,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},84857:function(e,t,r){"use strict";var n=r(71828);function i(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}e.exports=function(e,t){var r,a,o,s=function(e){return e.reverse()},l=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&n.warn("Contour data invalid for the specified inequality operation."),a=e[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",e);break}return l}},53572:function(e){"use strict";e.exports=function(e){return e.end+e.size/1e6}},81696:function(e,t,r){"use strict";var n=r(71828),i=r(36914);function a(e,t,r,n){return Math.abs(e[0]-t[0])20&&t?208===e||1114===e?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(e)?a=1:-1!==i.LEFTSTART.indexOf(e)?n=1:-1!==i.TOPSTART.indexOf(e)?a=-1:n=-1,[n,a]}(d,r,t),h=[l(e,t,[-p[0],-p[1]])],v=e.z.length,m=e.z[0].length,g=t.slice(),y=p.slice();for(c=0;c<1e4;c++){if(d>20?(d=i.CHOOSESADDLE[d][(p[0]||p[1])<0?0:1],e.crossings[f]=i.SADDLEREMAINDER[d]):delete e.crossings[f],!(p=i.NEWDELTA[d])){n.log("Found bad marching index:",d,t,e.level);break}h.push(l(e,t,p)),t[0]+=p[0],t[1]+=p[1],f=t.join(","),a(h[h.length-1],h[h.length-2],s,u)&&h.pop();var x=p[0]&&(t[0]<0||t[0]>m-2)||p[1]&&(t[1]<0||t[1]>v-2);if(t[0]===g[0]&&t[1]===g[1]&&p[0]===y[0]&&p[1]===y[1]||r&&x)break;d=e.crossings[f]}1e4===c&&n.log("Infinite loop in contour?");var b,_,w,k,T,M,S,A,C,E,P,L=a(h[0],h[h.length-1],s,u),I=0,R=.2*e.smoothing,O=[],D=0;for(c=1;c=D;c--)if((b=O[c])=D&&b+O[_]A&&C--,e.edgepaths[C]=P.concat(h,E));break}N||(e.edgepaths[A]=h.concat(E))}for(A=0;A=y)&&(r<=g&&(r=g),o>=y&&(o=y),l=Math.floor((o-r)/s)+1,u=0),d=0;dg&&(v.unshift(g),m.unshift(m[0])),v[v.length-1]e?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(e){var t,r,a,o,s,l,u,c,f,d=e[0].z,p=d.length,h=d[0].length,v=2===p||2===h;for(r=0;r=0&&(n=y,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;f+="L"+n}if(s===e.edgepaths.length){i.log("unclosed perimeter path");break}d=s,(h=-1===p.indexOf(d))&&(d=p[0],f+="Z")}for(d=0;dn.center?n.right-s:s-n.left)/(c+Math.abs(Math.sin(u)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(u)*o);if(d<1||p<1)return 1/0;var h=g.EDGECOST*(1/(d-1)+1/(p-1));h+=g.ANGLECOST*u*u;for(var v=s-c,m=l-f,y=s+c,x=l+f,b=0;b2*g.MAXCOST)break;p&&(s/=2),l=(o=u-s/2)+1.5*s}if(d<=g.MAXCOST)return c},t.addLabelData=function(e,t,r,n){var i=t.fontSize,a=t.width+i/3,o=Math.max(0,t.height-i/3),s=e.x,l=e.y,u=e.theta,c=Math.sin(u),f=Math.cos(u),d=function(e,t){return[s+e*f-t*c,l+e*c+t*f]},p=[d(-a/2,-o/2),d(-a/2,o/2),d(a/2,o/2),d(a/2,-o/2)];r.push({text:t.text,x:s,y:l,dy:t.dy,theta:u,level:t.level,width:a,height:o}),n.push(p)},t.drawLabels=function(e,t,r,a,o){var l=e.selectAll("text").data(t,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var t=e.x+Math.sin(e.theta)*e.dy,i=e.y-Math.cos(e.theta)*e.dy;n.select(this).text(e.text).attr({x:t,y:i,transform:"rotate("+180*e.theta/Math.PI+" "+t+" "+i+")"}).call(s.convertToTspans,r)})),o){for(var u="",c=0;cr.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),i.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if("constraint"!==r.type){var u,c=r.start,f=r.end,d=e._input.contours;c>f&&(r.start=d.start=f,f=r.end=d.end=c,c=r.start),r.size>0||(u=c===f?1:a(c,f,e.ncontours).dtick,d.size=r.size=u)}}},84426:function(e,t,r){"use strict";var n=r(39898),i=r(91424),a=r(70035),o=r(86068);e.exports=function(e){var t=n.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=n.select(this),r=e[0].trace,a=r.contours,s=r.line,l=a.size||1,u=a.start,c="constraint"===a.type,f=!c&&"lines"===a.coloring,d=!c&&"fill"===a.coloring,p=f||d?o(r):null;t.selectAll("g.contourlevel").each((function(e){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,f?p(e.level):s.color,s.dash)}));var h=a.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){i.font(n.select(this),{family:h.family,size:h.size,color:h.color||(f?p(e.level):s.color)})})),c)t.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var v;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===v&&(v=e.level),p(e.level+.5*l)})),void 0===v&&(v=u),t.selectAll("g.contourbg path").style("fill",p(v-.5*l))}})),a(e)}},8724:function(e,t,r){"use strict";var n=r(1586),i=r(14523);e.exports=function(e,t,r,a,o){var s,l=r("contours.coloring"),u="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(u=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,u,o)}},88085:function(e,t,r){"use strict";var n=r(21606),i=r(70600),a=r(50693),o=r(1426).extendFlat,s=i.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},59885:function(e,t,r){"use strict";var n=r(78803),i=r(71828),a=r(68296),o=r(4742),s=r(824),l=r(43907),u=r(70769),c=r(75005),f=r(22882),d=r(18670);e.exports=function(e,t){var r=t._carpetTrace=f(e,t);if(r&&r.visible&&"legendonly"!==r.visible){if(!t.a||!t.b){var p=e.data[r.index],h=e.data[t.index];h.a||(h.a=p.a),h.b||(h.b=p.b),c(h,t,t._defaultColor,e._fullLayout)}var v=function(e,t){var r,c,f,d,p,h,v,m=t._carpetTrace,g=m.aaxis,y=m.baxis;g._minDtick=0,y._minDtick=0,i.isArray1D(t.z)&&a(t,g,y,"a","b",["z"]),r=t._a=t._a||t.a,d=t._b=t._b||t.b,r=r?g.makeCalcdata(t,"_a"):[],d=d?y.makeCalcdata(t,"_b"):[],c=t.a0||0,f=t.da||1,p=t.b0||0,h=t.db||1,v=t._z=o(t._z||t.z,t.transpose),t._emptypoints=l(v),s(v,t._emptypoints);var x=i.maxRowLength(v),b="scaled"===t.xtype?"":r,_=u(t,b,c,f,x,g),w="scaled"===t.ytype?"":d,k=u(t,w,p,h,v.length,y),T={a:_,b:k,z:v};return"levels"===t.contours.type&&"none"!==t.contours.coloring&&n(e,t,{vals:v,containerStr:"",cLetter:"z"}),[T]}(e,t);return d(t,t._z),v}}},75005:function(e,t,r){"use strict";var n=r(71828),i=r(67684),a=r(88085),o=r(83179),s=r(67217),l=r(8724);e.exports=function(e,t,r,u){function c(r,i){return n.coerce(e,t,a,r,i)}if(c("carpet"),e.a&&e.b){if(!i(e,t,c,u,"a","b"))return void(t.visible=!1);c("text"),"constraint"===c("contours.type")?o(e,t,c,u,r,{hasHover:!1}):(s(e,t,c,(function(r){return n.coerce2(e,t,a,r)})),l(e,t,c,u,{hasHover:!1}))}else t._defaultColor=r,t._length=null}},93740:function(e,t,r){"use strict";e.exports={attributes:r(88085),supplyDefaults:r(75005),colorbar:r(90654),calc:r(59885),plot:r(51048),style:r(84426),moduleType:"trace",name:"contourcarpet",basePlotModule:r(93612),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},51048:function(e,t,r){"use strict";var n=r(39898),i=r(27669),a=r(67961),o=r(91424),s=r(71828),l=r(87678),u=r(81696),c=r(29854),f=r(36914),d=r(84857),p=r(87558),h=r(20083),v=r(22882),m=r(4536);function g(e,t,r){var n=e.getPointAtLength(t),i=e.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function y(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}function x(e,t){var r=Math.abs(e[0]*t[0]+e[1]*t[1]);return Math.sqrt(1-r*r)/r}e.exports=function(e,t,r,b){var _=t.xaxis,w=t.yaxis;s.makeTraceGroups(b,r,"contour").each((function(r){var b=n.select(this),k=r[0],T=k.trace,M=T._carpetTrace=v(e,T),S=e.calcdata[M.index][0];if(M.visible&&"legendonly"!==M.visible){var A=k.a,C=k.b,E=T.contours,P=p(E,t,k),L="constraint"===E.type,I=E._operation,R=L?"="===I?"lines":"fill":E.coloring,O=[[A[0],C[C.length-1]],[A[A.length-1],C[C.length-1]],[A[A.length-1],C[0]],[A[0],C[0]]];l(P);var D=1e-8*(A[A.length-1]-A[0]),z=1e-8*(C[C.length-1]-C[0]);u(P,D,z);var F,j,N,Z,B=P;"constraint"===E.type&&(B=d(P,I)),function(e,t){var r,n,i,a,o,s,l,u,c;for(r=0;r=0;Z--)F=S.clipsegments[Z],j=i([],F.x,_.c2p),N=i([],F.y,w.c2p),j.reverse(),N.reverse(),V.push(a(j,N,F.bicubic));var U="M"+V.join("L")+"Z";!function(e,t,r,n,o,l){var u,c,f,d,p=s.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var h=[];for(d=0;d=0&&(d=E,h=v):Math.abs(f[1]-d[1])=0&&(d=E,h=v):s.log("endpt to newendpt is not vert. or horz.",f,d,E)}if(h>=0)break;y+=A(f,d),f=d}if(h===t.edgepaths.length){s.log("unclosed perimeter path");break}c=h,(b=-1===x.indexOf(c))&&(c=x[0],y+=A(f,d)+"Z",f=null)}for(c=0;cv&&(n.max=v),n.len=n.max-n.min}function m(e,t){var r,n=0,o=.1;return(Math.abs(e[0]-l)0?+p[c]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:g},properties:y})}}var b=o.extractOpts(t),_=b.reversescale?o.flipScale(b.colorscale):b.colorscale,w=_[0][1],k=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(c=1;c<_.length;c++)k.push(_[c][0],_[c][1]);var T=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return i.extendFlat(u.heatmap.paint,{"heatmap-weight":h?T:1/(b.max-b.min),"heatmap-color":k,"heatmap-radius":v?{type:"identity",property:"r"}:t.radius,"heatmap-opacity":t.opacity}),u.geojson={type:"FeatureCollection",features:f},u.heatmap.layout.visibility="visible",u}},79429:function(e,t,r){"use strict";var n=r(71828),i=r(1586),a=r(64096);e.exports=function(e,t,r,o){function s(r,i){return n.coerce(e,t,a,r,i)}var l=s("lon")||[],u=s("lat")||[],c=Math.min(l.length,u.length);c?(t._length=c,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),i(e,t,o,s,{prefix:"",cLetter:"z"})):t.visible=!1}},62474:function(e){"use strict";e.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}},84684:function(e,t,r){"use strict";var n=r(89298),i=r(28178).hoverPoints,a=r(28178).getExtraText;e.exports=function(e,t,r){var o=i(e,t,r);if(o){var s=o[0],l=s.cd,u=l[0].trace,c=l[s.index];if(delete s.color,"z"in c){var f=s.subplot.mockAxis;s.z=c.z,s.zLabel=n.tickText(f,f.c2l(c.z),"hover").text}return s.extraText=a(u,c,l[0].t.labels),[s]}}},93814:function(e,t,r){"use strict";e.exports={attributes:r(64096),supplyDefaults:r(79429),colorbar:r(61243),formatLabels:r(15636),calc:r(85070),plot:r(7336),hoverPoints:r(84684),eventData:r(62474),getBelow:function(e,t){for(var r=t.getMapLayers(),n=0;n=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},e.exports=function(e,t){var r=t[0].trace,i=new a(e,r.uid),o=i.sourceId,s=n(t),l=i.below=e.belowLookup["trace-"+r.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},49789:function(e,t,r){"use strict";var n=r(71828);e.exports=function(e,t){for(var r=0;r"),l.color=function(e,t){var r=e.marker,i=t.mc||r.color,a=t.mlc||r.line.color,o=t.mlw||r.line.width;return n(i)?i:n(a)&&o?a:void 0}(c,d),[l]}}},51759:function(e,t,r){"use strict";e.exports={attributes:r(1285),layoutAttributes:r(10440),supplyDefaults:r(26199).supplyDefaults,crossTraceDefaults:r(26199).crossTraceDefaults,supplyLayoutDefaults:r(93138),calc:r(9532),crossTraceCalc:r(8984),plot:r(80461),style:r(68266).style,hoverPoints:r(63341),eventData:r(34598),selectPoints:r(81974),moduleType:"trace",name:"funnel",basePlotModule:r(93612),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},10440:function(e){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},93138:function(e,t,r){"use strict";var n=r(71828),i=r(10440);e.exports=function(e,t,r){var a=!1;function o(r,a){return n.coerce(e,t,i,r,a)}for(var s=0;s path").each((function(e){if(!e.isBlank){var t=s.marker;n.select(this).call(a.fill,e.mc||t.color).call(a.stroke,e.mlc||t.line.color).call(i.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",s.selectedpoints&&!e.selected?o:1)}})),u(r,s,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},86807:function(e,t,r){"use strict";var n=r(34e3),i=r(9012),a=r(27670).Y,o=r(5386).fF,s=r(5386).si,l=r(1426).extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},pattern:n.marker.pattern,editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},6452:function(e,t,r){"use strict";var n=r(74875);t.name="funnelarea",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},89574:function(e,t,r){"use strict";var n=r(32354);e.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},86282:function(e,t,r){"use strict";var n=r(71828),i=r(86807),a=r(27670).c,o=r(90769).handleText,s=r(37434).handleLabelsAndValues,l=r(37434).handleMarkerDefaults;e.exports=function(e,t,r,u){function c(r,a){return n.coerce(e,t,i,r,a)}var f=c("labels"),d=c("values"),p=s(f,d),h=p.len;if(t._hasLabels=p.hasLabels,t._hasValues=p.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),h){t._length=h,l(e,t,u,c),c("scalegroup");var v,m=c("text"),g=c("texttemplate");if(g||(v=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),g||v&&"none"!==v){var y=c("textposition");o(e,t,u,c,y,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}a(t,u,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",u.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},10421:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:r(6452),categories:["pie-like","funnelarea","showLegend"],attributes:r(86807),layoutAttributes:r(80097),supplyDefaults:r(86282),supplyLayoutDefaults:r(57402),calc:r(89574).calc,crossTraceCalc:r(89574).crossTraceCalc,plot:r(79187),style:r(71858),styleOne:r(63463),meta:{}}},80097:function(e,t,r){"use strict";var n=r(92774).hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},57402:function(e,t,r){"use strict";var n=r(71828),i=r(80097);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},79187:function(e,t,r){"use strict";var n=r(39898),i=r(91424),a=r(71828),o=a.strScale,s=a.strTranslate,l=r(63893),u=r(17295).toMoveInsideBar,c=r(72597),f=c.recordMinTextSize,d=c.clearMinTextSize,p=r(53581),h=r(14575),v=h.attachFxHandlers,m=h.determineInsideTextFont,g=h.layoutAreas,y=h.prerenderTitles,x=h.positionTitleOutside,b=h.formatSliceLabel;function _(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}function w(e,t){return[.5*(e[0]+t[0]),.5*(e[1]+t[1])]}e.exports=function(e,t){var r=e._context.staticPlot,c=e._fullLayout;d("funnelarea",c),y(t,e),g(t,c._size),a.makeTraceGroups(c._funnelarealayer,t,"trace").each((function(t){var d=n.select(this),h=t[0],g=h.trace;!function(e){if(e.length){var t=e[0],r=t.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),u=t.vTotal,c=u,f=u*l/(1-l)/u,d=[];for(d.push(C()),o=e.length-1;o>-1;o--)if(!(s=e[o]).hidden){var p=s.v/c;f+=p,d.push(C())}var h=1/0,v=-1/0;for(o=0;o-1;o--)if(!(s=e[o]).hidden){var M=d[T+=1][0],S=d[T][1];s.TL=[-M,S],s.TR=[M,S],s.BL=_,s.BR=k,s.pxmid=w(s.TR,s.BR),_=s.TL,k=s.TR}}function A(){var e=Math.sqrt(f);return{x:e,y:-e}}function C(){var e=A();return[e.x,e.y]}}(t),d.each((function(){var d=n.select(this).selectAll("g.slice").data(t);d.enter().append("g").classed("slice",!0),d.exit().remove(),d.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=g.index;var d=h.cx,y=h.cy,x=n.select(this),w=x.selectAll("path.surface").data([o]);w.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),x.call(v,e,t);var k="M"+(d+o.TR[0])+","+(y+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";w.attr("d",k),b(e,o,h);var T=p.castOption(g.textposition,o.pts),M=x.selectAll("g.slicetext").data(o.text&&"none"!==T?[0]:[]);M.enter().append("g").classed("slicetext",!0),M.exit().remove(),M.each((function(){var r=a.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),p=a.ensureUniformFontSize(e,m(g,o,c.font));r.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,p).call(l.convertToTspans,e);var h,v,x,b=i.bBox(r.node()),_=Math.min(o.BL[1],o.BR[1])+y,w=Math.max(o.TL[1],o.TR[1])+y;v=Math.max(o.TL[0],o.BL[0])+d,x=Math.min(o.TR[0],o.BR[0])+d,(h=u(v,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,f(g.type,h,c),t[s].transform=h,a.setTransormAndDisplay(r,h)}))}}));var y=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);y.enter().append("g").classed("titletext",!0),y.exit().remove(),y.each((function(){var t=a.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),r=g.title.text;g._meta&&(r=a.templateString(r,g._meta)),t.text(r).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,g.title.font).call(l.convertToTspans,e);var u=x(h,c._size);t.attr("transform",s(u.x,u.y)+o(Math.min(1,u.scale))+s(u.tx,u.ty))}))}))}))}},71858:function(e,t,r){"use strict";var n=r(39898),i=r(63463),a=r(72597).resizeText;e.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");a(e,t,"funnelarea"),t.each((function(t){var r=t[0].trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each((function(t){n.select(this).call(i,t,r,e)}))}))}},21606:function(e,t,r){"use strict";var n=r(82196),i=r(9012),a=r(41940),o=r(12663).axisHoverFormat,s=r(5386).fF,l=r(5386).si,u=r(50693),c=r(1426).extendFlat;e.exports=c({z:{valType:"data_array",editType:"calc"},x:c({},n.x,{impliedEdits:{xtype:"array"}}),x0:c({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:c({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:c({},n.y,{impliedEdits:{ytype:"array"}}),y0:c({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:c({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:c({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:c({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:c({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:c({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:c({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:c({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:a({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:c({},i.showlegend,{dflt:!1})},{transforms:void 0},u("",{cLetter:"z",autoColorDflt:!1}))},90757:function(e,t,r){"use strict";var n=r(73972),i=r(71828),a=r(89298),o=r(42973),s=r(17562),l=r(78803),u=r(68296),c=r(4742),f=r(824),d=r(43907),p=r(70769),h=r(50606).BADNUM;function v(e){for(var t=[],r=e.length,n=0;n1){var t=(e[e.length-1]-e[0])/(e.length-1),r=Math.abs(t/100);for(T=0;Tr)return!1}return!0}(S.rangebreaks||A.rangebreaks)&&(k=function(e,t,r){for(var n=[],i=-1,a=0;a=0;o--)(s=((f[[(r=(a=d[o])[0])-1,i=a[1]]]||v)[2]+(f[[r+1,i]]||v)[2]+(f[[r,i-1]]||v)[2]+(f[[r,i+1]]||v)[2])/20)&&(l[a]=[r,i,s],d.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],c.push(l[a])}return c.sort((function(e,t){return t[2]-e[2]}))}},46248:function(e,t,r){"use strict";var n=r(30211),i=r(71828),a=r(89298),o=r(21081).extractOpts;e.exports=function(e,t,r,s,l){l||(l={});var u,c,f,d,p=l.isContour,h=e.cd[0],v=h.trace,m=e.xa,g=e.ya,y=h.x,x=h.y,b=h.z,_=h.xCenter,w=h.yCenter,k=h.zmask,T=v.zhoverformat,M=y,S=x;if(!1!==e.index){try{f=Math.round(e.index[1]),d=Math.round(e.index[0])}catch(N){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(f<0||f>=b[0].length||d<0||d>b.length)return}else{if(n.inbox(t-y[0],t-y[y.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(p){var A;for(M=[2*y[0]-y[1]],A=1;Av&&(g=Math.max(g,Math.abs(e[a][o]-h)/(m-v))))}return g}e.exports=function(e,t){var r,i=1;for(o(e,t),r=0;r.01;r++)i=o(e,t,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),e}},58623:function(e,t,r){"use strict";var n=r(71828);e.exports=function(e,t){e("texttemplate");var r=n.extendFlat({},t.font,{color:"auto",size:"auto"});n.coerceFont(e,"textfont",r)}},70769:function(e,t,r){"use strict";var n=r(73972),i=r(71828).isArrayOrTypedArray;e.exports=function(e,t,r,a,o,s){var l,u,c,f=[],d=n.traceIs(e,"contour"),p=n.traceIs(e,"histogram"),h=n.traceIs(e,"gl2d");if(i(t)&&t.length>1&&!p&&"category"!==s.type){var v=t.length;if(!(v<=o))return d?t.slice(0,o):t.slice(0,o+1);if(d||h)f=t.slice(0,o);else if(1===o)f=[t[0]-.5,t[0]+.5];else{for(f=[1.5*t[0]-.5*t[1]],c=1;c0;)T=M.c2p(N[P]),P--;for(T0;)E=S.c2p(Z[P]),P--;E=M._length||T<=0||C>=S._length||E<=0)return R.selectAll("image").data([]).exit().remove(),void b(R);"fast"===X?($=G,J=W):($=Q,J=ee);var te=document.createElement("canvas");te.width=$,te.height=J;var re,ne,ie=te.getContext("2d"),ae=p(D,{noNumericCheck:!0,returnArray:!0});"fast"===X?(re=q?function(e){return G-1-e}:l.identity,ne=Y?function(e){return W-1-e}:l.identity):(re=function(e){return l.constrain(Math.round(M.c2p(N[e])-r),0,Q)},ne=function(e){return l.constrain(Math.round(S.c2p(Z[e])-C),0,ee)});var oe,se,le,ue,ce=ne(0),fe=[ce,ce],de=q?0:1,pe=Y?0:1,he=0,ve=0,me=0,ge=0;function ye(e,t){if(void 0!==e){var r=ae(e);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),he+=t,ve+=r[0]*t,me+=r[1]*t,ge+=r[2]*t,r}return[0,0,0,0]}function xe(e,t,r,n){var i=e[r.bin0];if(void 0===i)return ye(void 0,1);var a,o=e[r.bin1],s=t[r.bin0],l=t[r.bin1],u=o-i||0,c=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,ye(i+r.frac*u+n.frac*(c+r.frac*a))}if("default"!==X){var be,_e=0;try{be=new Uint8Array($*J*4)}catch(gt){be=new Array($*J*4)}if("smooth"===X){var we,ke,Te,Me=B||N,Se=V||Z,Ae=new Array(Me.length),Ce=new Array(Se.length),Ee=new Array(Q),Pe=B?w:_,Le=V?w:_;for(P=0;PXe||Xe>S._length))for(L=We;L$e||$e>M._length)){var Je=c({x:Ke,y:Ye},D,e._fullLayout);Je.x=Ke,Je.y=Ye;var Qe=O.z[P][L];void 0===Qe?(Je.z="",Je.zLabel=""):(Je.z=Qe,Je.zLabel=s.tickText(Be,Qe,"hover").text);var et=O.text&&O.text[P]&&O.text[P][L];void 0!==et&&!1!==et||(et=""),Je.text=et;var tt=l.texttemplateString(Ne,Je,e._fullLayout._d3locale,Je,D._meta||{});if(tt){var rt=tt.split("
"),nt=rt.length,it=0;for(I=0;I0&&(a=!0);for(var l=0;la){var o=a-r[e];return r[e]=a,o}}return 0},max:function(e,t,r,i){var a=i[t];if(n(a)){if(a=Number(a),!n(r[e]))return r[e]=a,a;if(r[e]u?e>o?e>1.1*i?i:e>1.1*a?a:o:e>s?s:e>l?l:u:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,a,s){if(n&&e>o){var l=h(t,a,s),u=h(r,a,s),c=e===i?0:1;return l[c]!==u[c]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(e,t,r,n,a){var s,l,u=-1.1*t,d=-.1*t,p=e-d,h=r[0],v=r[1],m=Math.min(f(h+d,h+p,n,a),f(v+d,v+p,n,a)),g=Math.min(f(h+u,h+d,n,a),f(v+u,v+d,n,a));if(m>g&&go){var y=s===i?1:6,x=s===i?"M12":"M1";return function(t,r){var o=n.c2d(t,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var u=n.d2c(o,0,a);if(ur.r2l(j)&&(Z=o.tickIncrement(Z,b.size,!0,p)),O.start=r.l2r(Z),F||i.nestedProperty(t,g+".start").set(O.start)}var B=b.end,V=r.r2l(R.end),U=void 0!==V;if((b.endFound||U)&&V!==r.r2l(B)){var H=U?V:i.aggNums(Math.max,null,h);O.end=r.l2r(H),U||i.nestedProperty(t,g+".start").set(O.end)}var W="autobin"+s;return!1===t._input[W]&&(t._input[g]=i.extendFlat({},t[g]||{}),delete t._input[W],delete t[W]),[O,h]}e.exports={calc:function(e,t){var r,a,p,h,v=[],m=[],g="h"===t.orientation,y=o.getFromId(e,g?t.yaxis:t.xaxis),x=g?"y":"x",b={x:"y",y:"x"}[x],_=t[x+"calendar"],w=t.cumulative,k=d(e,t,y,x),T=k[0],M=k[1],S="string"===typeof T.size,A=[],C=S?A:T,E=[],P=[],L=[],I=0,R=t.histnorm,O=t.histfunc,D=-1!==R.indexOf("density");w.enabled&&D&&(R=R.replace(/ ?density$/,""),D=!1);var z,F="max"===O||"min"===O?null:0,j=l.count,N=u[R],Z=!1,B=function(e){return y.r2c(e,0,_)};for(i.isArrayOrTypedArray(t[b])&&"count"!==O&&(z=t[b],Z="avg"===O,j=l[O]),r=B(T.start),p=B(T.end)+(r-o.tickIncrement(r,T.size,!1,_))/1e6;r=0&&h=0;n--)s(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(m,w.direction,w.currentbin);var $=Math.min(v.length,m.length),J=[],Q=0,ee=$-1;for(r=0;r<$;r++)if(m[r]){Q=r;break}for(r=$-1;r>=Q;r--)if(m[r]){ee=r;break}for(r=Q;r<=ee;r++)if(n(v[r])&&n(m[r])){var te={p:v[r],s:m[r],b:0};w.enabled||(te.pts=L[r],G?te.ph0=te.ph1=L[r].length?M[L[r][0]]:v[r]:(t._computePh=!0,te.ph0=H(A[r]),te.ph1=H(A[r+1],!0))),J.push(te)}return 1===J.length&&(J[0].width1=o.tickIncrement(J[0].p,T.size,!1,_)-J[0].p),s(J,t),i.isArrayOrTypedArray(t.selectedpoints)&&i.tagSelected(J,t,X),J},calcAllAutoBins:d}},72406:function(e){"use strict";e.exports={eventDataKeys:["binNumber"]}},82222:function(e,t,r){"use strict";var n=r(71828),i=r(41675),a=r(73972).traceIs,o=r(26125),s=n.nestedProperty,l=r(99082).getAxisGroup,u=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],c=["x","y"];e.exports=function(e,t){var r,f,d,p,h,v,m,g=t._histogramBinOpts={},y=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function k(e,r,a){var o=e.uid+"__"+a;r||(r=o);var s=function(e,r){return i.getFromTrace({_fullLayout:t},e,r).type}(e,a),l=e[a+"calendar"]||"",u=g[r],c=!0;u&&(s===u.axType&&l===u.calendar?(c=!1,u.traces.push(e),u.dirs.push(a)):(r=o,s!==u.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+s,"axis","with bins on","type:"+u.axType,"axis."].join(" ")),l!==u.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",l,"calendar","with bins",u.calendar?"on a "+u.calendar+" calendar":"w/o a set calendar"].join(" ")))),c&&(g[r]={traces:[e],dirs:[a],axType:s,calendar:e[a+"calendar"]||""}),e["_"+a+"bingroup"]=r}for(h=0;hA&&k.splice(A,k.length-A),S.length>A&&S.splice(A,S.length-A);var C=[],E=[],P=[],L="string"===typeof w.size,I="string"===typeof M.size,R=[],O=[],D=L?R:w,z=I?O:M,F=0,j=[],N=[],Z=t.histnorm,B=t.histfunc,V=-1!==Z.indexOf("density"),U="max"===B||"min"===B?null:0,H=a.count,W=o[Z],G=!1,q=[],Y=[],X="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";X&&"count"!==B&&(G="avg"===B,H=a[B]);var K=w.size,$=x(w.start),J=x(w.end)+($-i.tickIncrement($,K,!1,g))/1e6;for(r=$;r=0&&p=0&&h-1,flipY:P.tiling.flip.indexOf("y")>-1,orientation:P.tiling.orientation,pad:{inner:P.tiling.pad},maxDepth:P._maxDepth}).descendants(),D=1/0,z=-1/0;O.forEach((function(e){var t=e.depth;t>=P._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(D=Math.min(D,t),z=Math.max(z,t))})),h=h.data(O,c.getPtId),P._maxVisibleLayers=isFinite(z)?z-D+1:0,h.enter().append("g").classed("slice",!0),T(h,p,{},[m,g],b),h.order();var F=null;if(k&&A){var j=c.getPtId(A);h.each((function(e){null===F&&c.getPtId(e)===j&&(F={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var N=function(){return F||{x0:0,x1:m,y0:0,y1:g}},Z=h;return k&&(Z=Z.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),Z.each((function(s){s._x0=y(s.x0),s._x1=y(s.x1),s._y0=x(s.y0),s._y1=x(s.y1),s._hoverX=y(s.x1-P.tiling.pad),s._hoverY=x(R?s.y1-P.tiling.pad/2:s.y0+P.tiling.pad/2);var h=n.select(this),v=i.ensureSingle(h,"path","surface",(function(e){e.style("pointer-events",C?"none":"all")}));k?v.transition().attrTween("d",(function(e){var t=M(e,p,N(),[m,g],{orientation:P.tiling.orientation,flipX:P.tiling.flip.indexOf("x")>-1,flipY:P.tiling.flip.indexOf("y")>-1});return function(e){return b(t(e))}})):v.attr("d",b),h.call(f,r,e,t,{styleOne:l,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),v.call(l,s,P,e,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=d(s,r,P,t,E)||"";var T=i.ensureSingle(h,"g","slicetext"),A=i.ensureSingle(T,"text","",(function(e){e.attr("data-notex",1)})),O=i.ensureUniformFontSize(e,c.determineTextFont(P,s,E.font));A.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",I?"end":L?"start":"middle").call(a.font,O).call(o.convertToTspans,e),s.textBB=a.bBox(A.node()),s.transform=_(s,{fontSize:O.size}),s.transform.fontSize=O.size,k?A.transition().attrTween("transform",(function(e){var t=S(e,p,N(),[m,g]);return function(e){return w(t(e))}})):A.attr("transform",w(s))})),F}},69816:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:r(96346),categories:[],animatable:!0,attributes:r(46291),layoutAttributes:r(92894),supplyDefaults:r(56524),supplyLayoutDefaults:r(21070),calc:r(46584).y,crossTraceCalc:r(46584).T,plot:r(85596),style:r(82454).style,colorbar:r(4898),meta:{}}},92894:function(e){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},21070:function(e,t,r){"use strict";var n=r(71828),i=r(92894);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("iciclecolorway",t.colorway),r("extendiciclecolors")}},21538:function(e,t,r){"use strict";var n=r(674),i=r(14102);e.exports=function(e,t,r){var a=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,u=t[0],c=t[1];l&&(u=(e.height+1)*t[0]/Math.min(e.height+1,l),c=(e.height+1)*t[1]/Math.min(e.height+1,l));var f=n.partition().padding(r.pad.inner).size(s?[t[1],u]:[t[0],c])(e);return(s||a||o)&&i(f,t,{swapXY:s,flipX:a,flipY:o}),f}},85596:function(e,t,r){"use strict";var n=r(80694),i=r(90666);e.exports=function(e,t,r,a){return n(e,t,r,a,{type:"icicle",drawDescendants:i})}},82454:function(e,t,r){"use strict";var n=r(39898),i=r(7901),a=r(71828),o=r(72597).resizeText,s=r(43467);function l(e,t,r,n){var o=t.data.data,l=!t.children,u=o.i,c=a.castOption(r,u,"marker.line.color")||i.defaultLine,f=a.castOption(r,u,"marker.line.width")||0;e.call(s,t,r,n).style("stroke-width",f).call(i.stroke,c).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(e){var t=e._fullLayout._iciclelayer.selectAll(".trace");o(e,t,"icicle"),t.each((function(t){var r=n.select(this),i=t[0].trace;r.style("opacity",i.opacity),r.selectAll("path.surface").each((function(t){n.select(this).call(l,t,i,e)}))}))},styleOne:l}},17230:function(e,t,r){"use strict";for(var n=r(9012),i=r(5386).fF,a=r(1426).extendFlat,o=r(51877).colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],u=[],c=0;c0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var c,f=Math.floor((t-o.x0)/s.dx),d=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?c=o.z[d][f]:s._hasSource&&(c=s._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,d,1,1).data),c){var p,h=o.hi||s.hoverinfo;if(h){var v=h.split("+");-1!==v.indexOf("all")&&(v=["color"]),-1!==v.indexOf("color")&&(p=!0)}var m,g=a.colormodel[s.colormodel],y=g.colormodel||s.colormodel,x=y.length,b=s._scaler(c),_=g.suffix,w=[];(s.hovertemplate||p)&&(w.push("["+[b[0]+_[0],b[1]+_[1],b[2]+_[2]].join(", ")),4===x&&w.push(", "+b[3]+_[3]),w.push("]"),w=w.join(""),e.extraText=y.toUpperCase()+": "+w),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[d])?m=s.hovertext[d][f]:Array.isArray(s.text)&&Array.isArray(s.text[d])&&(m=s.text[d][f]);var k=u.c2p(o.y0+(d+.5)*s.dy),T=o.x0+(f+.5)*s.dx,M=o.y0+(d+.5)*s.dy,S="["+c.slice(0,s.colormodel.length).join(", ")+"]";return[i.extendFlat(e,{index:[d,f],x0:l.c2p(o.x0+f*s.dx),x1:l.c2p(o.x0+(f+1)*s.dx),y0:k,y1:k,color:b,xVal:T,xLabelVal:T,yVal:M,yLabelVal:M,zLabelVal:S,text:m,hovertemplateLabels:{zLabel:S,colorLabel:w,"color[0]Label":b[0]+_[0],"color[1]Label":b[1]+_[1],"color[2]Label":b[2]+_[2],"color[3]Label":b[3]+_[3]}})]}}}},94507:function(e,t,r){"use strict";e.exports={attributes:r(17230),supplyDefaults:r(13245),calc:r(71113),plot:r(60775),style:r(12826),hoverPoints:r(28749),eventData:r(30835),moduleType:"trace",name:"image",basePlotModule:r(93612),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},60775:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=i.strTranslate,o=r(77922),s=r(51877),l=r(3883),u=r(32396).STYLE;e.exports=function(e,t,r,c){var f=t.xaxis,d=t.yaxis,p=!e._context._exportedPlot&&l();i.makeTraceGroups(c,r,"im").each((function(t){var r=n.select(this),l=t[0],c=l.trace,h=("fast"===c.zsmooth||!1===c.zsmooth&&p)&&!c._hasZ&&c._hasSource&&"linear"===f.type&&"linear"===d.type;c._realImage=h;var v,m,g,y,x,b,_=l.z,w=l.x0,k=l.y0,T=l.w,M=l.h,S=c.dx,A=c.dy;for(b=0;void 0===v&&b0;)m=f.c2p(w+b*S),b--;for(b=0;void 0===y&&b0;)x=d.c2p(k+b*A),b--;mR[0];if(O||D){var z=v+C/2,F=y+E/2;L+="transform:"+a(z+"px",F+"px")+"scale("+(O?-1:1)+","+(D?-1:1)+")"+a(-z+"px",-F+"px")+";"}}P.attr("style",L);var j=new Promise((function(e){if(c._hasZ)e();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===M&&c._canvas.source===c.source)e();else{var t=document.createElement("canvas");t.width=T,t.height=M;var r=t.getContext("2d",{willReadFrequently:!0});c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:t,source:c.source},e()},n.setAttribute("src",c.source)}})).then((function(){var e,t;if(c._hasZ)t=N((function(e,t){return _[t][e]})),e=t.toDataURL("image/png");else if(c._hasSource)if(h)e=c.source;else{var r=c._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,T,M).data;t=N((function(e,t){var n=4*(t*T+e);return[r[n],r[n+1],r[n+2],r[n+3]]})),e=t.toDataURL("image/png")}P.attr({"xlink:href":e,height:E,width:C,x:v,y:y})}));e._promises.push(j)}function N(e){var t=document.createElement("canvas");t.width=C,t.height=E;var r,n=t.getContext("2d",{willReadFrequently:!0}),a=function(e){return i.constrain(Math.round(f.c2p(w+e*S)-v),0,C)},o=function(e){return i.constrain(Math.round(d.c2p(k+e*A)-y),0,E)},u=s.colormodel[c.colormodel],p=u.colormodel||c.colormodel,h=u.fmt;for(b=0;b0}function k(e){e.each((function(e){y.stroke(n.select(this),e.line.color)})).each((function(e){y.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function T(e,t,r){var n=e._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),a={type:"linear",_id:"x"+t._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(e,t){return o.coerce(i,a,g,e,t)}return v(i,a,l,s,n),m(i,a,l,s),a}function M(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function S(e,t,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(p.convertToTspans,i).call(f.font,t),f.bBox(o.node())}function A(e,t,r,n,i,a){var s="_cache"+t;e[s]&&e[s].key===i||(e[s]={key:i,value:r});var l=o.aggNums(a,null,[e[s].value,n],2);return e[s].value=l,l}e.exports=function(e,t,r,v){var m,g=e._fullLayout;w(r)&&v&&(m=v()),o.makeTraceGroups(g._indicatorlayer,t,"trace").each((function(t){var v,C,E,P,L,I=t[0].trace,R=n.select(this),O=I._hasGauge,D=I._isAngular,z=I._isBullet,F=I.domain,j={w:g._size.w*(F.x[1]-F.x[0]),h:g._size.h*(F.y[1]-F.y[0]),l:g._size.l+g._size.w*F.x[0],r:g._size.r+g._size.w*(1-F.x[1]),t:g._size.t+g._size.h*(1-F.y[1]),b:g._size.b+g._size.h*F.y[0]},N=j.l+j.w/2,Z=j.t+j.h/2,B=Math.min(j.w/2,j.h),V=d.innerRadius*B,U=I.align||"center";if(C=Z,O){if(D&&(v=N,C=Z+B/2,E=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height),n=t/r;return[n,e,t]}(e,.9*V)}),z){var H=d.bulletPadding,W=1-d.bulletNumberDomainSize+H;v=j.l+(W+(1-W)*b[U])*j.w,E=function(e){return M(e,(d.bulletNumberDomainSize-H)*j.w,j.h)}}}else v=j.l+b[U]*j.w,E=function(e){return M(e,j.w,j.h)};!function(e,t,r,i){var u,c,d,v=r[0].trace,m=i.numbersX,g=i.numbersY,k=v.align||"center",M=x[k],C=i.transitionOpts,E=i.onComplete,P=o.ensureSingle(t,"g","numbers"),L=[];v._hasNumber&&L.push("number"),v._hasDelta&&(L.push("delta"),"left"===v.delta.position&&L.reverse());var I=P.selectAll("text").data(L);function R(t,r,n,i){if(!t.match("s")||n>=0===i>=0||r(n).slice(-1).match(_)||r(i).slice(-1).match(_))return r;var a=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=T(e,{tickformat:a});return function(e){return Math.abs(e)<1?h.tickText(o,e).text:r(e)}}function O(){var t=T(e,{tickformat:v.number.valueformat},v._range);t.setScale(),h.prepTicks(t);var i=function(e){return h.tickText(t,e).text},o=v.number.suffix,s=v.number.prefix,l=P.select("text.number");function c(){var t="number"===typeof r[0].y?s+i(r[0].y)+o:"-";l.text(t).call(f.font,v.number.font).call(p.convertToTspans,e)}return w(C)?l.transition().duration(C.duration).ease(C.easing).each("end",(function(){c(),E&&E()})).each("interrupt",(function(){c(),E&&E()})).attrTween("text",(function(){var e=n.select(this),t=a(r[0].lastY,r[0].y);v._lastValue=r[0].y;var l=R(v.number.valueformat,i,r[0].lastY,r[0].y);return function(r){e.text(s+l(t(r))+o)}})):c(),u=S(s+i(r[0].y)+o,v.number.font,M,e),l}function D(){var t=T(e,{tickformat:v.delta.valueformat},v._range);t.setScale(),h.prepTicks(t);var i=function(e){return h.tickText(t,e).text},o=v.delta.suffix,s=v.delta.prefix,l=function(e){return v.delta.relative?e.relativeDelta:e.delta},u=function(e,t){return 0===e||"number"!==typeof e||isNaN(e)?"-":(e>0?v.delta.increasing.symbol:v.delta.decreasing.symbol)+s+t(e)+o},d=function(e){return e.delta>=0?v.delta.increasing.color:v.delta.decreasing.color};void 0===v._deltaLastValue&&(v._deltaLastValue=l(r[0]));var m=P.select("text.delta");function g(){m.text(u(l(r[0]),i)).call(y.fill,d(r[0])).call(p.convertToTspans,e)}return m.call(f.font,v.delta.font).call(y.fill,d({delta:v._deltaLastValue})),w(C)?m.transition().duration(C.duration).ease(C.easing).tween("text",(function(){var e=n.select(this),t=l(r[0]),o=v._deltaLastValue,s=R(v.delta.valueformat,i,o,t),c=a(o,t);return v._deltaLastValue=t,function(t){e.text(u(c(t),s)),e.call(y.fill,d({delta:c(t)}))}})).each("end",(function(){g(),E&&E()})).each("interrupt",(function(){g(),E&&E()})):g(),c=S(u(l(r[0]),i),v.delta.font,M,e),m}I.enter().append("text"),I.attr("text-anchor",(function(){return M})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),I.exit().remove();var z,F=v.mode+v.align;if(v._hasDelta&&(z=D(),F+=v.delta.position+v.delta.font.size+v.delta.font.family+v.delta.valueformat,F+=v.delta.increasing.symbol+v.delta.decreasing.symbol,d=c),v._hasNumber&&(O(),F+=v.number.font.size+v.number.font.family+v.number.valueformat+v.number.suffix+v.number.prefix,d=u),v._hasDelta&&v._hasNumber){var j,N,Z=[(u.left+u.right)/2,(u.top+u.bottom)/2],B=[(c.left+c.right)/2,(c.top+c.bottom)/2],V=.75*v.delta.font.size;"left"===v.delta.position&&(j=A(v,"deltaPos",0,-1*(u.width*b[v.align]+c.width*(1-b[v.align])+V),F,Math.min),N=Z[1]-B[1],d={width:u.width+c.width+V,height:Math.max(u.height,c.height),left:c.left+j,right:u.right,top:Math.min(u.top,c.top+N),bottom:Math.max(u.bottom,c.bottom+N)}),"right"===v.delta.position&&(j=A(v,"deltaPos",0,u.width*(1-b[v.align])+c.width*b[v.align]+V,F,Math.max),N=Z[1]-B[1],d={width:u.width+c.width+V,height:Math.max(u.height,c.height),left:u.left,right:c.right+j,top:Math.min(u.top,c.top+N),bottom:Math.max(u.bottom,c.bottom+N)}),"bottom"===v.delta.position&&(j=null,N=c.height,d={width:Math.max(u.width,c.width),height:u.height+c.height,left:Math.min(u.left,c.left),right:Math.max(u.right,c.right),top:u.bottom-u.height,bottom:u.bottom+c.height}),"top"===v.delta.position&&(j=null,N=u.top,d={width:Math.max(u.width,c.width),height:u.height+c.height,left:Math.min(u.left,c.left),right:Math.max(u.right,c.right),top:u.bottom-u.height-c.height,bottom:u.bottom}),z.attr({dx:j,dy:N})}(v._hasNumber||v._hasDelta)&&P.attr("transform",(function(){var e=i.numbersScaler(d);F+=e[2];var t,r=A(v,"numbersScale",1,e[0],F,Math.min);v._scaleNumbers||(r=1),t=v._isAngular?g-r*d.bottom:g-r*(d.top+d.bottom)/2,v._numbersTop=r*d.top+t;var n=d[k];"center"===k&&(n=(d.left+d.right)/2);var a=m-r*n;return a=A(v,"numbersTranslate",0,a,F,Math.max),l(a,t)+s(r)}))}(e,R,t,{numbersX:v,numbersY:C,numbersScaler:E,transitionOpts:r,onComplete:m}),O&&(P={range:I.gauge.axis.range,color:I.gauge.bgcolor,line:{color:I.gauge.bordercolor,width:0},thickness:1},L={range:I.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:I.gauge.bordercolor,width:I.gauge.borderwidth},thickness:1});var G=R.selectAll("g.angular").data(D?t:[]);G.exit().remove();var q=R.selectAll("g.angularaxis").data(D?t:[]);q.exit().remove(),D&&function(e,t,r,a){var o,s,f,d,p=r[0].trace,v=a.size,m=a.radius,g=a.innerRadius,y=a.gaugeBg,x=a.gaugeOutline,b=[v.l+v.w/2,v.t+v.h/2+m/2],_=a.gauge,M=a.layer,S=a.transitionOpts,A=a.onComplete,C=Math.PI/2;function E(e){var t=p.gauge.axis.range[0],r=(e-t)/(p.gauge.axis.range[1]-t)*Math.PI-C;return r<-C?-C:r>C?C:r}function P(e){return n.svg.arc().innerRadius((g+m)/2-e/2*(m-g)).outerRadius((g+m)/2+e/2*(m-g)).startAngle(-C)}function L(e){e.attr("d",(function(e){return P(e.thickness).startAngle(E(e.range[0])).endAngle(E(e.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",l(b[0],b[1])),M.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),M.selectAll("g.xangularaxistick,path,text").remove(),(o=T(e,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var I=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},R={},O=h.makeLabelFns(o,0).labelStandoff;R.xFn=function(e){var t=I(e);return Math.cos(t)*O},R.yFn=function(e){var t=I(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(O+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*c)},R.anchorFn=function(e){var t=I(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},R.heightFn=function(e,t,r){var n=I(e);return-.5*(1+Math.sin(n))*r};var D=function(e){return l(b[0]+m*Math.cos(e),b[1]-m*Math.sin(e))};f=function(e){return D(I(e))};var z=function(e){var t=I(e);return D(t)+"rotate("+-u(t)+")"};if(s=h.calcTicks(o),d=h.getTickSigns(o)[2],o.visible){d="inside"===o.ticks?-1:1;var F=(o.linewidth||1)/2;h.drawTicks(e,o,{vals:s,layer:M,path:"M"+d*F+",0h"+d*o.ticklen,transFn:z}),h.drawLabels(e,o,{vals:s,layer:M,transFn:f,labelFns:R})}var j=[y].concat(p.gauge.steps),N=_.selectAll("g.bg-arc").data(j);N.enter().append("g").classed("bg-arc",!0).append("path"),N.select("path").call(L).call(k),N.exit().remove();var Z=P(p.gauge.bar.thickness),B=_.selectAll("g.value-arc").data([p.gauge.bar]);B.enter().append("g").classed("value-arc",!0).append("path");var V,U,H,W=B.select("path");w(S)?(W.transition().duration(S.duration).ease(S.easing).each("end",(function(){A&&A()})).each("interrupt",(function(){A&&A()})).attrTween("d",(V=Z,U=E(r[0].lastY),H=E(r[0].y),function(){var e=i(U,H);return function(t){return V.endAngle(e(t))()}})),p._lastValue=r[0].y):W.attr("d","number"===typeof r[0].y?Z.endAngle(E(r[0].y)):"M0,0Z"),W.call(k),B.exit().remove(),j=[];var G=p.gauge.threshold.value;(G||0===G)&&j.push({range:[G,G],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var q=_.selectAll("g.threshold-arc").data(j);q.enter().append("g").classed("threshold-arc",!0).append("path"),q.select("path").call(L).call(k),q.exit().remove();var Y=_.selectAll("g.gauge-outline").data([x]);Y.enter().append("g").classed("gauge-outline",!0).append("path"),Y.select("path").call(L).call(k),Y.exit().remove()}(e,0,t,{radius:B,innerRadius:V,gauge:G,layer:q,size:j,gaugeBg:P,gaugeOutline:L,transitionOpts:r,onComplete:m});var Y=R.selectAll("g.bullet").data(z?t:[]);Y.exit().remove();var X=R.selectAll("g.bulletaxis").data(z?t:[]);X.exit().remove(),z&&function(e,t,r,n){var i,a,o,s,u,c=r[0].trace,f=n.gauge,p=n.layer,v=n.gaugeBg,m=n.gaugeOutline,g=n.size,x=c.domain,b=n.transitionOpts,_=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",l(g.l,g.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var M=g.h,S=c.gauge.bar.thickness*M,A=x.x[0],C=x.x[0]+(x.x[1]-x.x[0])*(c._hasNumber||c._hasDelta?1-d.bulletNumberDomainSize:1);function E(e){e.attr("width",(function(e){return Math.max(0,i.c2p(e.range[1])-i.c2p(e.range[0]))})).attr("x",(function(e){return i.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*M})).attr("height",(function(e){return e.thickness*M}))}(i=T(e,c.gauge.axis))._id="xbulletaxis",i.domain=[A,C],i.setScale(),a=h.calcTicks(i),o=h.makeTransTickFn(i),s=h.getTickSigns(i)[2],u=g.t+g.h,i.visible&&(h.drawTicks(e,i,{vals:"inside"===i.ticks?h.clipEnds(i,a):a,layer:p,path:h.makeTickPath(i,u,s),transFn:o}),h.drawLabels(e,i,{vals:a,layer:p,transFn:o,labelFns:h.makeLabelFns(i,u)}));var P=[v].concat(c.gauge.steps),L=f.selectAll("g.bg-bullet").data(P);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(E).call(k),L.exit().remove();var I=f.selectAll("g.value-bullet").data([c.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",S).attr("y",(M-S)/2).call(k),w(b)?I.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y)))):I.select("rect").attr("width","number"===typeof r[0].y?Math.max(0,i.c2p(Math.min(c.gauge.axis.range[1],r[0].y))):0),I.exit().remove();var R=r.filter((function(){return c.gauge.threshold.value||0===c.gauge.threshold.value})),O=f.selectAll("g.threshold-bullet").data(R);O.enter().append("g").classed("threshold-bullet",!0).append("line"),O.select("line").attr("x1",i.c2p(c.gauge.threshold.value)).attr("x2",i.c2p(c.gauge.threshold.value)).attr("y1",(1-c.gauge.threshold.thickness)/2*M).attr("y2",(1-(1-c.gauge.threshold.thickness)/2)*M).call(y.stroke,c.gauge.threshold.line.color).style("stroke-width",c.gauge.threshold.line.width),O.exit().remove();var D=f.selectAll("g.gauge-outline").data([m]);D.enter().append("g").classed("gauge-outline",!0).append("rect"),D.select("rect").call(E).call(k),D.exit().remove()}(e,0,t,{gauge:Y,layer:X,size:j,gaugeBg:P,gaugeOutline:L,transitionOpts:r,onComplete:m});var K=R.selectAll("text.title").data(t);K.exit().remove(),K.enter().append("text").classed("title",!0),K.attr("text-anchor",(function(){return z?x.right:x[I.title.align]})).text(I.title.text).call(f.font,I.title.font).call(p.convertToTspans,e),K.attr("transform",(function(){var e,t=j.l+j.w*b[I.title.align],r=d.titlePadding,n=f.bBox(K.node());return O?(D&&(e=I.gauge.axis.visible?f.bBox(q.node()).top-r-n.bottom:j.t+j.h/2-B/2-n.bottom-r),z&&(e=C-(n.top+n.bottom)/2,t=j.l-d.bulletPadding*j.w)):e=I._numbersTop-r-n.bottom,l(t,e)}))}))}},16249:function(e,t,r){"use strict";var n=r(50693),i=r(12663).axisHoverFormat,a=r(5386).fF,o=r(2418),s=r(9012),l=r(1426).extendFlat,u=r(30962).overrideAll,c=e.exports=u(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes",c.transforms=void 0},56959:function(e,t,r){"use strict";var n=r(78803),i=r(88489).processGrid,a=r(88489).filter;e.exports=function(e,t){t._len=Math.min(t.x.length,t.y.length,t.z.length,t.value.length),t._x=a(t.x,t._len),t._y=a(t.y,t._len),t._z=a(t.z,t._len),t._value=a(t.value,t._len);var r=i(t);t._gridFill=r.fill,t._Xs=r.Xs,t._Ys=r.Ys,t._Zs=r.Zs,t._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(t[r],t[r-1]),i=Math.max(t[r],t[r-1]);if(i>n&&n-1}function z(e,t){return null===e?t:e}function F(t,r,n){P();var i,a,o,l=[r],u=[n];if(s>=1)l=[r],u=[n];else if(s>0){var c=function(e,t){var r=e[0],n=e[1],i=e[2],a=function(e,t,r){for(var n=[],i=0;i-1?n[p]:E(h,v,g);d[p]=x>-1?x:I(h,v,g,z(t,y))}i=d[0],a=d[1],o=d[2],e._meshI.push(i),e._meshJ.push(a),e._meshK.push(o),++m}}function j(e,t,r,n){var i=e[3];in&&(i=n);for(var a=(e[3]-i)/(e[3]-t[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*e[s]+a*t[s];return o}function N(e,t,r){return e>=t&&e<=r}function Z(e){var t=.001*(C-A);return e>=A-t&&e<=C+t}function B(t){for(var r=[],n=0;n<4;n++){var i=t[n];r.push([e._x[i],e._y[i],e._z[i],e._value[i]])}return r}var V=3;function U(e,t,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[N(t[0][3],n,i),N(t[1][3],n,i),N(t[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(e,t,r){return Z(t[0][3])&&Z(t[1][3])&&Z(t[2][3])?(F(e,t,r),!0):aMath.abs(k-S)?[M,k]:[k,S];ee(r,E[0],E[1])}}var P=[[Math.min(A,S),Math.max(A,S)],[Math.min(M,C),Math.max(M,C)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i0&&(f.push(h.id),"x"===r?d.push([h.distRatio,0,0]):"y"===r?d.push([0,h.distRatio,0]):d.push([0,0,h.distRatio]))}else c=ie(1,"x"===r?b-1:"y"===r?_-1:w-1);f.length>0&&(n[a]="x"===r?te(t,f,o,s,d,n[a]):"y"===r?re(t,f,o,s,d,n[a]):ne(t,f,o,s,d,n[a]),a++),c.length>0&&(n[a]="x"===r?K(t,c,o,s,n[a]):"y"===r?$(t,c,o,s,n[a]):J(t,c,o,s,n[a]),a++)}var v=e.caps[r];v.show&&v.fill&&(O(v.fill),n[a]="x"===r?K(t,[0,b-1],o,s,n[a]):"y"===r?$(t,[0,_-1],o,s,n[a]):J(t,[0,w-1],o,s,n[a]),a++)}})),0===m&&L(),e._meshX=n,e._meshY=i,e._meshZ=a,e._meshIntensity=o,e._Xs=g,e._Ys=y,e._Zs=x}(),e}e.exports={findNearestOnAxis:l,generateIsoMeshes:d,createIsosurfaceTrace:function(e,t){var r=e.glplot.gl,i=n({gl:r}),a=new u(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}},82738:function(e,t,r){"use strict";var n=r(71828),i=r(73972),a=r(16249),o=r(1586);function s(e,t,r,n,a){var s=a("isomin"),l=a("isomax");void 0!==l&&null!==l&&void 0!==s&&null!==s&&s>l&&(t.isomin=null,t.isomax=null);var u=a("x"),c=a("y"),f=a("z"),d=a("value");u&&u.length&&c&&c.length&&f&&f.length&&d&&d.length?(i.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(e){a(e+"hoverformat");var t="caps."+e;a(t+".show")&&a(t+".fill");var r="slices."+e;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(e){a(e)})),o(e,t,n,a,{prefix:"",cLetter:"c"}),t._length=null):t.visible=!1}e.exports={supplyDefaults:function(e,t,r,i){s(e,t,0,i,(function(r,i){return n.coerce(e,t,a,r,i)}))},supplyIsoDefaults:s}},64943:function(e,t,r){"use strict";e.exports={attributes:r(16249),supplyDefaults:r(82738).supplyDefaults,calc:r(56959),colorbar:{min:"cmin",max:"cmax"},plot:r(22674).createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:r(58547),categories:["gl3d","showLegend"],meta:{}}},2418:function(e,t,r){"use strict";var n=r(50693),i=r(12663).axisHoverFormat,a=r(5386).fF,o=r(54532),s=r(9012),l=r(1426).extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},82932:function(e,t,r){"use strict";var n=r(78803);e.exports=function(e,t){t.intensity&&n(e,t,{vals:t.intensity,containerStr:"",cLetter:"c"})}},91134:function(e,t,r){"use strict";var n=r(9330).gl_mesh3d,i=r(9330).delaunay_triangulate,a=r(9330).alpha_shape,o=r(9330).convex_hull,s=r(81697).parseColorScale,l=r(78614),u=r(21081).extractOpts,c=r(90060);function f(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var d=f.prototype;function p(e){for(var t=[],r=e.length,n=0;n=t-.5)return!1;return!0}d.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index;e.data._cellCenter?e.traceCoordinate=e.data.dataCoordinate:e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[t]?e.textLabel=r[t]:r&&(e.textLabel=r),!0}},d.update=function(e){var t=this.scene,r=t.fullSceneLayout;this.data=e;var n,f=e.x.length,d=c(h(r.xaxis,e.x,t.dataScale[0],e.xcalendar),h(r.yaxis,e.y,t.dataScale[1],e.ycalendar),h(r.zaxis,e.z,t.dataScale[2],e.zcalendar));if(e.i&&e.j&&e.k){if(e.i.length!==e.j.length||e.j.length!==e.k.length||!m(e.i,f)||!m(e.j,f)||!m(e.k,f))return;n=c(v(e.i),v(e.j),v(e.k))}else n=0===e.alphahull?o(d):e.alphahull>0?a(e.alphahull,d):function(e,t){for(var r=["x","y","z"].indexOf(e),n=[],a=t.length,o=0;og):m=M>w,g=M;var S=u(w,k,T,M);S.pos=_,S.yc=(w+M)/2,S.i=b,S.dir=m?"increasing":"decreasing",S.x=S.pos,S.y=[T,k],y&&(S.orig_p=r[b]),h&&(S.tx=t.text[b]),v&&(S.htx=t.hovertext[b]),x.push(S)}else x.push({pos:_,empty:!0})}return t._extremes[l._id]=a.findExtremes(l,n.concat(d,f),{padded:!0}),x.length&&(x[0].t={labels:{open:i(e,"open:")+" ",high:i(e,"high:")+" ",low:i(e,"low:")+" ",close:i(e,"close:")+" "}}),x}e.exports={calc:function(e,t){var r=a.getFromId(e,t.xaxis),i=a.getFromId(e,t.yaxis),s=function(e,t,r){var i=r._minDiff;if(!i){var a,s=e._fullData,l=[];for(i=1/0,a=0;a"+u.labels[x]+n.hoverLabelText(s,b,l.yhoverformat):((y=i.extendFlat({},d)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=u.labels[x]+n.hoverLabelText(s,b,l.yhoverformat),y.name="",f.push(y),m[b]=y)}return f}function d(e,t,r,i){var a=e.cd,o=e.ya,l=a[0].trace,f=a[0].t,d=c(e,t,r,i);if(!d)return[];var p=a[d.index],h=d.index=p.i,v=p.dir;function m(e){return f.labels[e]+n.hoverLabelText(o,l[e][h],l.yhoverformat)}var g=p.hi||l.hoverinfo,y=g.split("+"),x="all"===g,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[m("open"),m("high"),m("low"),m("close")+" "+u[v]]:[];return _&&s(p,l,w),d.extraText=w.join("
"),d.y0=d.y1=o.c2p(p.yc,!0),[d]}e.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?f(e,t,r,n):d(e,t,r,n)},hoverSplit:f,hoverOnPoints:d}},54186:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:r(93612),categories:["cartesian","svg","showLegend"],meta:{},attributes:r(2522),supplyDefaults:r(16169),calc:r(3485).calc,plot:r(72314),style:r(53101),hoverPoints:r(66449).hoverPoints,selectPoints:r(67324)}},14555:function(e,t,r){"use strict";var n=r(73972),i=r(71828);e.exports=function(e,t,r,a){var o=r("x"),s=r("open"),l=r("high"),u=r("low"),c=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],a),s&&l&&u&&c){var f=Math.min(s.length,l.length,u.length,c.length);return o&&(f=Math.min(f,i.minRowLength(o))),t._length=f,f}}},72314:function(e,t,r){"use strict";var n=r(39898),i=r(71828);e.exports=function(e,t,r,a){var o=t.yaxis,s=t.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],a=r.t;if(!0!==r.trace.visible||a.empty)t.remove();else{var u=a.tickLen,c=t.selectAll("path").data(i.identity);c.enter().append("path"),c.exit().remove(),c.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=s.c2p(e.pos-u,!0),r=s.c2p(e.pos+u,!0),n=l?(t+r)/2:s.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}},67324:function(e){"use strict";e.exports=function(e,t){var r,n=e.cd,i=e.xaxis,a=e.yaxis,o=[],s=n[0].t.bPos||0;if(!1===t)for(r=0;r=e.length)return!1;if(void 0!==t[e[r]])return!1;t[e[r]]=!0}return!0}(r))for(t=0;t0;u&&(o="array");var c=r("categoryorder",o);"array"===c?(r("categoryarray"),r("ticktext")):(delete e.categoryarray,delete e.ticktext),u||"array"!==c||(t.categoryorder="trace")}}e.exports=function(e,t,r,f){function d(r,i){return n.coerce(e,t,l,r,i)}var p=s(e,t,{name:"dimensions",handleItemDefaults:c}),h=function(e,t,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(e,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=r}return 1/0}(e,t,r,f,d);o(t,f,d),Array.isArray(p)&&p.length||(t.visible=!1),u(t,p,"values",h),d("hoveron"),d("hovertemplate"),d("arrangement"),d("bundlecolors"),d("sortpaths"),d("counts");var v={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(d,"labelfont",v);var m={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(d,"tickfont",m)}},94873:function(e,t,r){"use strict";e.exports={attributes:r(99506),supplyDefaults:r(14647),calc:r(28699),plot:r(45784),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:r(27677),categories:["noOpacity"],meta:{}}},45460:function(e,t,r){"use strict";var n=r(39898),i=r(81684).k4,a=r(72391),o=r(30211),s=r(71828),l=s.strTranslate,u=r(91424),c=r(84267),f=r(63893);function d(e,t,r,i){var a=t._context.staticPlot,o=e.map(F.bind(0,t,r)),c=i.selectAll("g.parcatslayer").data([null]);c.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var d=c.selectAll("g.trace.parcats").data(o,p),y=d.enter().append("g").attr("class","trace parcats");d.attr("transform",(function(e){return l(e.x,e.y)})),y.append("g").attr("class","paths");var x=d.select("g.paths").selectAll("path.path").data((function(e){return e.paths}),p);x.attr("fill",(function(e){return e.model.color}));var w=x.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(e){return e.model.color})).attr("fill-opacity",0);_(w),x.attr("d",(function(e){return e.svgD})),w.empty()||x.sort(v),x.exit().remove(),x.on("mouseover",m).on("mouseout",g).on("click",b),y.append("g").attr("class","dimensions");var M=d.select("g.dimensions").selectAll("g.dimension").data((function(e){return e.dimensions}),p);M.enter().append("g").attr("class","dimension"),M.attr("transform",(function(e){return l(e.x,0)})),M.exit().remove();var S=M.selectAll("g.category").data((function(e){return e.categories}),p),A=S.enter().append("g").attr("class","category");S.attr("transform",(function(e){return l(0,e.y)})),A.append("rect").attr("class","catrect").attr("pointer-events","none"),S.select("rect.catrect").attr("fill","none").attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})),k(A);var C=S.selectAll("rect.bandrect").data((function(e){return e.bands}),p);C.each((function(){s.raiseToTop(this)})),C.attr("fill",(function(e){return e.color}));var O=C.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(e){return e.color})).attr("fill-opacity",0);C.attr("fill",(function(e){return e.color})).attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).attr("y",(function(e){return e.y})).attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"perpendicular"===e.parcatsViewModel.arrangement?"ns-resize":"move"})),T(O),C.exit().remove(),A.append("text").attr("class","catlabel").attr("pointer-events","none");var D=t._fullLayout.paper_bgcolor;S.select("text.catlabel").attr("text-anchor",(function(e){return h(e)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",f.makeTextShadow(D)).style("fill","rgb(0, 0, 0)").attr("x",(function(e){return h(e)?e.width+5:-5})).attr("y",(function(e){return e.height/2})).text((function(e){return e.model.categoryLabel})).each((function(e){u.font(n.select(this),e.parcatsViewModel.categorylabelfont),f.convertToTspans(n.select(this),t)})),A.append("text").attr("class","dimlabel"),S.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(e){return e.width/2})).attr("y",-5).text((function(e,t){return 0===t?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null})).each((function(e){u.font(n.select(this),e.parcatsViewModel.labelfont)})),S.selectAll("rect.bandrect").on("mouseover",E).on("mouseout",P),S.exit().remove(),M.call(n.behavior.drag().origin((function(e){return{x:e.x,y:0}})).on("dragstart",L).on("drag",I).on("dragend",R)),d.each((function(e){e.traceSelection=n.select(this),e.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),e.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),d.exit().remove()}function p(e){return e.key}function h(e){var t=e.parcatsViewModel.dimensions.length,r=e.parcatsViewModel.dimensions[t-1].model.dimensionInd;return e.model.dimensionInd===r}function v(e,t){return e.model.rawColor>t.model.rawColor?1:e.model.rawColor"),E=n.mouse(f)[0];o.loneHover({trace:d,x:b-h.left+v.left,y:_-h.top+v.top,text:C,color:e.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:k,idealAlign:E1&&d.displayInd===f.dimensions.length-1?(i=u.left,a="left"):(i=u.left+u.width,a="right");var v=c.model.count,m=c.model.categoryLabel,g=v/c.parcatsViewModel.model.count,y={countLabel:v,categoryLabel:m,probabilityLabel:g.toFixed(3)},x=[];-1!==c.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",y.countLabel].join(" ")),-1!==c.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+y.categoryLabel+"):",y.probabilityLabel].join(" "));var b=x.join("
");return{trace:p,x:o*(i-t.left),y:s*(h-t.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:y,eventData:[{data:p._input,fullData:p,count:v,category:m,probability:g}]}}function E(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var t,r=e.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=e.parcatsViewModel.hoveron,u=this;"color"===l?(function(e){var t=n.select(e).datum(),r=M(t);w(r),r.each((function(){s.raiseToTop(this)})),n.select(e.parentNode).selectAll("rect.bandrect").filter((function(e){return e.color===t.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(u),A(u,"plotly_hover",n.event)):(function(e){n.select(e.parentNode).selectAll("rect.bandrect").each((function(e){var t=M(e);w(t),t.each((function(){s.raiseToTop(this)}))})),n.select(e.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(u),S(u,"plotly_hover",n.event)),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?t=C(r,a,u):"color"===l?t=function(e,t,r){e._fullLayout._calcInverseTransform(e);var i,a,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=r.getBoundingClientRect(),u=n.select(r).datum(),f=u.categoryViewModel,d=f.parcatsViewModel,p=d.model.dimensions[f.model.dimensionInd],h=d.trace,v=l.y+l.height/2;d.dimensions.length>1&&p.displayInd===d.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var m=f.model.categoryLabel,g=u.parcatsViewModel.model.count,y=0;u.categoryViewModel.bands.forEach((function(e){e.color===u.color&&(y+=e.count)}));var x=f.model.count,b=0;d.pathSelection.each((function(e){e.model.color===u.color&&(b+=e.model.count)}));var _=y/g,w=y/b,k=y/x,T={countLabel:g,categoryLabel:m,probabilityLabel:_.toFixed(3)},M=[];-1!==f.parcatsViewModel.hoverinfoItems.indexOf("count")&&M.push(["Count:",T.countLabel].join(" ")),-1!==f.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(M.push("P(color \u2229 "+m+"): "+T.probabilityLabel),M.push("P("+m+" | color): "+w.toFixed(3)),M.push("P(color | "+m+"): "+k.toFixed(3)));var S=M.join("
"),A=c.mostReadable(u.color,["black","white"]);return{trace:h,x:o*(i-t.left),y:s*(v-t.top),text:S,color:u.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:A,fontSize:10,idealAlign:a,hovertemplate:h.hovertemplate,hovertemplateLabels:T,eventData:[{data:h._input,fullData:h,category:m,count:g,probability:_,categorycount:x,colorcount:b,bandcolorcount:y}]}}(r,a,u):"dimension"===l&&(t=function(e,t,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(C(e,t,this))})),i}(r,a,u)),t&&o.loneHover(t,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r}))}}function P(e){var t=e.parcatsViewModel;t.dragDimension||(_(t.pathSelection),k(t.dimensionSelection.selectAll("g.category")),T(t.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(t.graphDiv._fullLayout._hoverlayer.node()),t.pathSelection.sort(v),-1!==t.hoverinfoItems.indexOf("skip"))||("color"===e.parcatsViewModel.hoveron?A(this,"plotly_unhover",n.event):S(this,"plotly_unhover",n.event))}function L(e){"fixed"!==e.parcatsViewModel.arrangement&&(e.dragDimensionDisplayInd=e.model.displayInd,e.initialDragDimensionDisplayInds=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),e.dragHasMoved=!1,e.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(t){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=t.width+2&&-2<=i&&i<=t.height+2&&(e.dragCategoryDisplayInd=t.model.displayInd,e.initialDragCategoryDisplayInds=e.model.categories.map((function(e){return e.displayInd})),t.model.dragY=t.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(t){t.yf.y+f.height/2&&(o.model.displayInd=f.model.displayInd,f.model.displayInd=l),e.dragCategoryDisplayInd=o.model.displayInd}if(null===e.dragCategoryDisplayInd||"freeform"===e.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var d=e.parcatsViewModel.dimensions[r],p=e.parcatsViewModel.dimensions[i];void 0!==d&&a.model.dragXp.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=e.dragDimensionDisplayInd),e.dragDimensionDisplayInd=a.model.displayInd}Z(e.parcatsViewModel),N(e.parcatsViewModel),z(e.parcatsViewModel),D(e.parcatsViewModel)}}function R(e){if("fixed"!==e.parcatsViewModel.arrangement&&null!==e.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var t={},r=O(e.parcatsViewModel),i=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),o=e.initialDragDimensionDisplayInds.some((function(e,t){return e!==i[t]}));o&&i.forEach((function(r,n){var i=e.parcatsViewModel.model.dimensions[n].containerInd;t["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==e.dragCategoryDisplayInd){var l=e.model.categories.map((function(e){return e.displayInd}));if(s=e.initialDragCategoryDisplayInds.some((function(e,t){return e!==l[t]}))){var u=e.model.categories.slice().sort((function(e,t){return e.displayInd-t.displayInd})),c=u.map((function(e){return e.categoryValue})),f=u.map((function(e){return e.categoryLabel}));t["dimensions["+e.model.containerInd+"].categoryarray"]=[c],t["dimensions["+e.model.containerInd+"].ticktext"]=[f],t["dimensions["+e.model.containerInd+"].categoryorder"]="array"}}-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!e.dragHasMoved&&e.potentialClickBand&&("color"===e.parcatsViewModel.hoveron?A(e.potentialClickBand,"plotly_click",n.event.sourceEvent):S(e.potentialClickBand,"plotly_click",n.event.sourceEvent)),e.model.dragX=null,null!==e.dragCategoryDisplayInd&&(e.parcatsViewModel.dimensions[e.dragDimensionDisplayInd].categories[e.dragCategoryDisplayInd].model.dragY=null,e.dragCategoryDisplayInd=null),e.dragDimensionDisplayInd=null,e.parcatsViewModel.dragDimension=null,e.dragHasMoved=null,e.potentialClickBand=null,Z(e.parcatsViewModel),N(e.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){z(e.parcatsViewModel,!0),D(e.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(e.parcatsViewModel.graphDiv,t,[r])}))}}function O(e){for(var t,r=e.graphDiv._fullData,n=0;n=0;s--)c+="C"+u[s]+","+(t[s+1]+n)+" "+l[s]+","+(t[s]+n)+" "+(e[s]+r[s])+","+(t[s]+n),c+="l-"+r[s]+",0 ";return c+="Z"}function N(e){var t=e.dimensions,r=e.model,n=t.map((function(e){return e.categories.map((function(e){return e.y}))})),i=e.model.dimensions.map((function(e){return e.categories.map((function(e){return e.displayInd}))})),a=e.model.dimensions.map((function(e){return e.displayInd})),o=e.dimensions.map((function(e){return e.model.dimensionInd})),s=t.map((function(e){return e.x})),l=t.map((function(e){return e.width})),u=[];for(var c in r.paths)r.paths.hasOwnProperty(c)&&u.push(r.paths[c]);function f(e){var t=e.categoryInds.map((function(e,t){return i[t][e]}));return o.map((function(e){return t[e]}))}u.sort((function(t,r){var n=f(t),i=f(r);return"backward"===e.sortpaths&&(n.reverse(),i.reverse()),n.push(t.valueInds[0]),i.push(r.valueInds[0]),e.bundlecolors&&(n.unshift(t.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var d=new Array(u.length),p=t[0].model.count,h=t[0].categories.map((function(e){return e.height})).reduce((function(e,t){return e+t})),v=0;v0?h*(g.count/p):0;for(var y,x=new Array(n.length),b=0;b1?(e.width-80-16)/(n-1):0)*i;var a,o,s,l,u,c=[],f=e.model.maxCats,d=t.categories.length,p=t.count,h=e.height-8*(f-1),v=8*(f-d)/2,m=t.categories.map((function(e){return{displayInd:e.displayInd,categoryInd:e.categoryInd}}));for(m.sort((function(e,t){return e.displayInd-t.displayInd})),u=0;u0?o.count/p*h:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:v,bands:[],parcatsViewModel:e},v=v+a+8,c.push(s);return{key:t.dimensionInd,x:null!==t.dragX?t.dragX:r,y:0,width:16,model:t,categories:c,parcatsViewModel:e,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(e,t,r,n){d(r,e,n,t)}},45784:function(e,t,r){"use strict";var n=r(45460);e.exports=function(e,t,r,i){var a=e._fullLayout,o=a._paper,s=a._size;n(e,o,t,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},73362:function(e,t,r){"use strict";var n=r(50693),i=r(13838),a=r(41940),o=r(27670).Y,s=r(1426).extendFlat,l=r(44467).templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:a({editType:"plot"}),tickfont:a({editType:"plot"}),rangefont:a({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},i.tickvals,{editType:"plot"}),ticktext:s({},i.ticktext,{editType:"plot"}),tickformat:s({},i.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}},57920:function(e,t,r){"use strict";var n=r(25706),i=r(39898),a=r(28984).keyFun,o=r(28984).repeat,s=r(71828).sorterAsc,l=r(71828).strTranslate,u=n.bar.snapRatio;function c(e,t){return e*(1-u)+t*u}var f=n.bar.snapClose;function d(e,t){return e*(1-f)+t*f}function p(e,t,r,n){if(function(e,t){for(var r=0;r=t[r][0]&&e<=t[r][1])return!0;return!1}(r,n))return r;var i=e?-1:1,a=0,o=t.length-1;if(i<0){var s=a;a=o,o=s}for(var l=t[a],u=l,f=a;i*ft){d=r;break}}if(a=c,isNaN(a)&&(a=isNaN(f)||isNaN(d)?isNaN(f)?d:f:t-u[f][1]e[1]+r||t=.9*e[1]+.1*e[0]?"n":t<=.9*e[0]+.1*e[1]?"s":"ns"}(h,t);v&&(o.interval=l[a],o.intervalPix=h,o.region=v)}}if(e.ordinal&&!o.region){var m=e.unitTickvals,y=e.unitToPaddedPx.invert(t);for(r=0;r=x[0]&&y<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(e,t){i.event.sourceEvent.stopPropagation();var r=t.height-i.mouse(e)[1]-2*n.verticalPadding,a=t.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(t.unitToPaddedPx.invert):a.newExtent=[a.startExtent,t.unitToPaddedPx.invert(r)].sort(s),t.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(t),b(e.parentNode)}function k(e,t){var r=_(t,t.height-i.mouse(e)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function T(e){e.on("mousemove",(function(e){i.event.preventDefault(),e.parent.inBrushDrag||k(this,e)})).on("mouseleave",(function(e){e.parent.inBrushDrag||y()})).call(i.behavior.drag().on("dragstart",(function(e){!function(e,t){i.event.sourceEvent.stopPropagation();var r=t.height-i.mouse(e)[1]-2*n.verticalPadding,a=t.unitToPaddedPx.invert(r),o=t.brush,s=_(t,r),l=s.interval,u=o.svgBrush;if(u.wasDragged=!1,u.grabbingBar="ns"===s.region,u.grabbingBar){var c=l.map(t.unitToPaddedPx);u.grabPoint=r-c[0]-n.verticalPadding,u.barLength=c[1]-c[0]}u.clickableOrdinalRange=s.clickableOrdinalRange,u.stayingIntervals=t.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(u.stayingIntervals=u.stayingIntervals.filter((function(e){return e[0]!==l[0]&&e[1]!==l[1]}))),u.startExtent=s.region?l["s"===s.region?1:0]:a,t.parent.inBrushDrag=!0,u.brushStartCallback()}(this,e)})).on("drag",(function(e){w(this,e)})).on("dragend",(function(e){!function(e,t){var r=t.brush,n=r.filter,a=r.svgBrush;a._dragging||(k(e,t),w(e,t),t.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,t.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&t.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&S(r)):S(r),a.brushCallback(t),b(e.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(t.ordinal){var l=t.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(u?[a.newExtent]:[]),a.extent.length||S(r),a.brushCallback(t),u?b(e.parentNode,s):(s(),b(e.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,e)})))}function M(e,t){return e[0]-t[0]}function S(e){e.filterSpecified=!1,e.svgBrush.extent=[[-1/0,1/0]]}function A(e){for(var t,r=e.slice(),n=[],i=r.shift();i;){for(t=i.slice();(i=r.shift())&&i[0]<=t[1];)t[1]=Math.max(t[1],i[1]);n.push(t)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(e,t,r,n,i,a){var o,l=function(){var e,t,r=[];return{set:function(n){1===(r=n.map((function(e){return e.slice().sort(s)})).sort(M)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),e=A(r),t=r.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return e},getBounds:function(){return t}}}();return l.set(r),{filter:l,filterSpecified:t,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(e){var t=e.brush,r=function(e){return e.svgBrush.extent.map((function(e){return e.slice()}))}(t),n=r.slice();t.filter.set(n),o()}),brushEndCallback:a}}},ensureAxisBrush:function(e,t,r){var i=e.selectAll("."+n.cn.axisBrush).data(o,a);i.enter().append("g").classed(n.cn.axisBrush,!0),function(e,t,r){var i=r._context.staticPlot,a=e.selectAll(".background").data(o);a.enter().append("rect").classed("background",!0).call(h).call(v).style("pointer-events",i?"none":"auto").attr("transform",l(0,n.verticalPadding)),a.call(T).attr("height",(function(e){return e.height-n.verticalPadding}));var s=e.selectAll(".highlight-shadow").data(o);s.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",t).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),s.attr("y1",(function(e){return e.height})).call(x);var u=e.selectAll(".highlight").data(o);u.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),u.attr("y1",(function(e){return e.height})).call(x)}(i,t,r)},cleanRanges:function(e,t){if(Array.isArray(e[0])?(e=e.map((function(e){return e.sort(s)})),e=t.multiselect?A(e.sort(M)):[e[0]]):e=[e.sort(s)],t.tickvals){var r=t.tickvals.slice().sort(s);if(!(e=e.map((function(e){var t=[p(0,r,e[0],[]),p(1,r,e[1],[])];if(t[1]>t[0])return t})).filter((function(e){return e}))).length)return}return e.length>1?e:e[0]}}},71791:function(e,t,r){"use strict";e.exports={attributes:r(73362),supplyDefaults:r(3633),calc:r(24639),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:r(49351),categories:["gl","regl","noOpacity","noHover"],meta:{}}},49351:function(e,t,r){"use strict";var n=r(39898),i=r(27659).a0,a=r(21341),o=r(77922);t.name="parcoords",t.plot=function(e){var t=i(e.calcdata,"parcoords")[0];t.length&&a(e,t)},t.clean=function(e,t,r,n){var i=n._has&&n._has("parcoords"),a=t._has&&t._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},t.toSVG=function(e){var t=e._fullLayout._glimages,r=n.select(e).selectAll(".svg-container");r.filter((function(e,t){return t===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this,r=e.toDataURL("image/png");t.append("svg:image").attr({xmlns:o.svg,"xlink:href":r,preserveAspectRatio:"none",x:0,y:0,width:e.style.width,height:e.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},24639:function(e,t,r){"use strict";var n=r(71828).isArrayOrTypedArray,i=r(21081),a=r(28984).wrap;e.exports=function(e,t){var r,o;return i.hasColorscale(t,"line")&&n(t.line.color)?(r=t.line.color,o=i.extractOpts(t.line).colorscale,i.calc(e,t,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(e){for(var t=new Array(e),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),h.splice(f));var v=s(e,t,{name:"dimensions",layout:l,handleItemDefaults:p}),m=function(e,t,r,o,s){var l=s("line.color",r);if(i(e,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=r}return 1/0}(e,t,r,l,c);o(t,l,c),Array.isArray(v)&&v.length||(t.visible=!1),d(t,v,"values",m);var g={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(c,"labelfont",g),n.coerceFont(c,"tickfont",g),n.coerceFont(c,"rangefont",g),c("labelangle"),c("labelside"),c("unselected.line.color"),c("unselected.line.opacity")}},1602:function(e,t,r){"use strict";var n=r(71828).isTypedArray;t.convertTypedArray=function(e){return n(e)?Array.prototype.slice.call(e):e},t.isOrdinal=function(e){return!!e.tickvals},t.isVisible=function(e){return e.visible||!("visible"in e)}},67618:function(e,t,r){"use strict";var n=r(71791);n.plot=r(21341),e.exports=n},83398:function(e,t,r){"use strict";var n=r(56068),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=r(25706).maxDimensionCount,s=r(71828),l=1e-6,u=2048,c=new Uint8Array(4),f=new Uint8Array(4),d={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function p(e,t,r,n,i){var a=e._gl;a.enable(a.SCISSOR_TEST),a.scissor(t,r,n,i),e.clear({color:[0,0,0,0],depth:1})}function h(e,t,r,n,i,a){var o=a.key;r.drawCompleted||(function(e){e.read({x:0,y:0,width:1,height:1,data:c})}(e),r.drawCompleted=!0),function s(l){var u=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],p(e,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*u,a.offset=2*l*n,t(a),l*n+u>>8*t)%256/255}function g(e,t,r){for(var n=new Array(8*t),i=0,a=0;af&&(f=e[i].dim1.canvasX,o=i);0===s&&p(M,0,0,r.canvasWidth,r.canvasHeight);var d=function(e){var t,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!e&&no._length&&(A=A.slice(0,o._length));var E,P=o.tickvals;function L(e,t){return{val:e,text:E[t]}}function I(e,t){return e.val-t.val}if(Array.isArray(P)&&P.length){E=o.ticktext,Array.isArray(E)&&E.length?E.length>P.length?E=E.slice(0,P.length):P.length>E.length&&(P=P.slice(0,E.length)):E=P.map(a(o.tickformat));for(var R=1;R=r||l>=i)return;var u=e.lineLayer.readPixel(s,i-1-l),c=0!==u[3],f=c?u[2]+256*(u[1]+256*u[0]):null,d={x:s,y:l,clientX:t.clientX,clientY:t.clientY,dataIndex:e.model.key,curveNumber:f};f!==F&&(c?a.hover(d):a.unhover&&a.unhover(d),F=f)}})),z.style("opacity",(function(e){return e.pick?0:1})),p.style("background","rgba(255, 255, 255, 0)");var j=p.selectAll("."+y.cn.parcoords).data(A,h);j.exit().remove(),j.enter().append("g").classed(y.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),j.attr("transform",(function(e){return u(e.model.translateX,e.model.translateY)}));var N=j.selectAll("."+y.cn.parcoordsControlView).data(v,h);N.enter().append("g").classed(y.cn.parcoordsControlView,!0),N.attr("transform",(function(e){return u(e.model.pad.l,e.model.pad.t)}));var Z=N.selectAll("."+y.cn.yAxis).data((function(e){return e.dimensions}),h);Z.enter().append("g").classed(y.cn.yAxis,!0),N.each((function(e){R(Z,e,k)})),z.each((function(e){if(e.viewModel){!e.lineLayer||a?e.lineLayer=b(this,e):e.lineLayer.update(e),(e.key||0===e.key)&&(e.viewModel[e.key]=e.lineLayer);var t=!e.context||a;e.lineLayer.render(e.viewModel.panels,t)}})),Z.attr("transform",(function(e){return u(e.xScale(e.xIndex),0)})),Z.call(n.behavior.drag().origin((function(e){return e})).on("drag",(function(e){var t=e.parent;S.linePickActive(!1),e.x=Math.max(-y.overdrag,Math.min(e.model.width+y.overdrag,n.event.x)),e.canvasX=e.x*e.model.canvasPixelRatio,Z.sort((function(e,t){return e.x-t.x})).each((function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio})),R(Z,t,k),Z.filter((function(t){return 0!==Math.abs(e.xIndex-t.xIndex)})).attr("transform",(function(e){return u(e.xScale(e.xIndex),0)})),n.select(this).attr("transform",u(e.x,0)),Z.each((function(r,n,i){i===e.parent.key&&(t.dimensions[n]=r)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!C(t)),t.focusLayer.render&&t.focusLayer.render(t.panels)})).on("dragend",(function(e){var t=e.parent;e.x=e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio,R(Z,t,k),n.select(this).attr("transform",(function(e){return u(e.x,0)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!C(t)),t.focusLayer&&t.focusLayer.render(t.panels),t.pickLayer&&t.pickLayer.render(t.panels,!0),S.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(t.key,t.dimensions.map((function(e){return e.crossfilterDimensionIndex})))}))),Z.exit().remove();var B=Z.selectAll("."+y.cn.axisOverlays).data(v,h);B.enter().append("g").classed(y.cn.axisOverlays,!0),B.selectAll("."+y.cn.axis).remove();var V=B.selectAll("."+y.cn.axis).data(v,h);V.enter().append("g").classed(y.cn.axis,!0),V.each((function(e){var t=e.model.height/e.model.tickDistance,r=e.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(t,e.tickFormat).tickValues(e.ordinal?i:null).tickFormat((function(t){return g.isOrdinal(e)?t:O(e.model.dimensions[e.visibleIndex],t)})).scale(r)),f.font(V.selectAll("text"),e.model.tickFont)})),V.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),V.selectAll("text").style("text-shadow",c.makeTextShadow(M)).style("cursor","default");var U=B.selectAll("."+y.cn.axisHeading).data(v,h);U.enter().append("g").classed(y.cn.axisHeading,!0);var H=U.selectAll("."+y.cn.axisTitle).data(v,h);H.enter().append("text").classed(y.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),H.text((function(e){return e.label})).each((function(t){var r=n.select(this);f.font(r,t.model.labelFont),c.convertToTspans(r,e)})).attr("transform",(function(e){var t=I(e.model.labelAngle,e.model.labelSide),r=y.axisTitleOffset;return(t.dir>0?"":u(0,2*r+e.model.height))+l(t.degrees)+u(-r*t.dx,-r*t.dy)})).attr("text-anchor",(function(e){var t=I(e.model.labelAngle,e.model.labelSide);return 2*Math.abs(t.dx)>Math.abs(t.dy)?t.dir*t.dx<0?"start":"end":"middle"}));var W=B.selectAll("."+y.cn.axisExtent).data(v,h);W.enter().append("g").classed(y.cn.axisExtent,!0);var G=W.selectAll("."+y.cn.axisExtentTop).data(v,h);G.enter().append("g").classed(y.cn.axisExtentTop,!0),G.attr("transform",u(0,-y.axisExtentOffset));var q=G.selectAll("."+y.cn.axisExtentTopText).data(v,h);q.enter().append("text").classed(y.cn.axisExtentTopText,!0).call(L),q.text((function(e){return D(e,!0)})).each((function(e){f.font(n.select(this),e.model.rangeFont)}));var Y=W.selectAll("."+y.cn.axisExtentBottom).data(v,h);Y.enter().append("g").classed(y.cn.axisExtentBottom,!0),Y.attr("transform",(function(e){return u(0,e.model.height+y.axisExtentOffset)}));var X=Y.selectAll("."+y.cn.axisExtentBottomText).data(v,h);X.enter().append("text").classed(y.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(L),X.text((function(e){return D(e,!1)})).each((function(e){f.font(n.select(this),e.model.rangeFont)})),x.ensureAxisBrush(B,M,e)}},21341:function(e,t,r){"use strict";var n=r(17171),i=r(79749),a=r(1602).isVisible,o={};function s(e,t,r){var n=t.indexOf(r),i=e.indexOf(n);return-1===i&&(i+=t.length),i}(e.exports=function(e,t){var r=e._fullLayout;if(i(e,[],o)){var l={},u={},c={},f={},d=r._size;t.forEach((function(t,r){var n=t[0].trace;c[r]=n.index;var i=f[r]=n._fullInput.index;l[r]=e.data[i].dimensions,u[r]=e.data[i].dimensions.slice()})),n(e,t,{width:d.w,height:d.h,margin:{t:d.t,r:d.r,b:d.b,l:d.l}},{filterChanged:function(t,n,i){var a=u[t][n],o=i.map((function(e){return e.slice()})),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[e._fullData[c[t]]._fullInput.uid];if(void 0===l[s]){var d=a.constraintrange;l[s]=d||null}var p=e._fullData[c[t]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,p.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete p.constraintrange,o=null);var h={};h[s]=o,e.emit("plotly_restyle",[h,[f[t]]])},hover:function(t){e.emit("plotly_hover",t)},unhover:function(t){e.emit("plotly_unhover",t)},axesMoved:function(t,r){var n=function(e,t){return function(r,n){return s(e,t,r)-s(e,t,n)}}(r,u[t].filter(a));l[t].sort(n),u[t].filter((function(e){return!a(e)})).sort((function(e){return u[t].indexOf(e)})).forEach((function(e){l[t].splice(l[t].indexOf(e),1),l[t].splice(u[t].indexOf(e),0,e)})),e.emit("plotly_restyle",[{dimensions:[l[t]]},[f[t]]])}})}}).reglPrecompiled=o},34e3:function(e,t,r){"use strict";var n=r(9012),i=r(27670).Y,a=r(41940),o=r(22399),s=r(5386).fF,l=r(5386).si,u=r(1426).extendFlat,c=r(79952).u,f=a({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:u({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:u({},f,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:u({},f,{}),outsidetextfont:u({},f,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:u({},f,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:i({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:u({},f,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},13584:function(e,t,r){"use strict";var n=r(74875);t.name="pie",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},32354:function(e,t,r){"use strict";var n=r(92770),i=r(84267),a=r(7901),o={};function s(e){return function(t,r){return!!t&&!!(t=i(t)).isValid()&&(t=a.addOpacity(t,t.getAlpha()),e[r]||(e[r]=t),t)}}function l(e,t){var r,n=JSON.stringify(e),a=t[n];if(!a){for(a=e.slice(),r=0;r=0})),("funnelarea"===t.type?g:t.sort)&&a.sort((function(e,t){return t.v-e.v})),a[0]&&(a[0].vTotal=m),a},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,i=e.calcdata,a=n[r+"colorway"],s=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=l(a,o));for(var u=0,c=0;c0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}function c(e,t,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");l(n,"marker.pattern",a),e.marker&&!t.marker.pattern.fgcolor&&(t.marker.pattern.fgcolor=e.marker.colors),t.marker.pattern.bgcolor||(t.marker.pattern.bgcolor=r.paper_bgcolor)}e.exports={handleLabelsAndValues:u,handleMarkerDefaults:c,supplyDefaults:function(e,t,r,n){function l(r,n){return i.coerce(e,t,a,r,n)}var f=u(l("labels"),l("values")),d=f.len;if(t._hasLabels=f.hasLabels,t._hasValues=f.hasValues,!t._hasLabels&&t._hasValues&&(l("label0"),l("dlabel")),d){t._length=d,c(e,t,n,l,!0),l("scalegroup");var p,h=l("text"),v=l("texttemplate");if(v||(p=l("textinfo",Array.isArray(h)?"text+percent":"percent")),l("hovertext"),l("hovertemplate"),v||p&&"none"!==p){var m=l("textposition");s(e,t,n,l,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&l("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&l("insidetextorientation")}o(t,n,l);var g=l("hole");if(l("title.text")){var y=l("title.position",g?"middle center":"top center");g||"middle center"!==y||(t.title.position="top center"),i.coerceFont(l,"title.font",n.font)}l("sort"),l("direction"),l("rotation"),l("pull")}else t.visible=!1}}},20007:function(e,t,r){"use strict";var n=r(23469).appendArrayMultiPointValues;e.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},22209:function(e,t,r){"use strict";var n=r(91424),i=r(7901);e.exports=function(e,t,r,a){var o=r.marker.pattern;o&&o.shape?n.pointStyle(e,r,a,t):i.fill(e,t.color)}},53581:function(e,t,r){"use strict";var n=r(71828);function i(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}t.formatPiePercent=function(e,t){var r=i((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},t.formatPieValue=function(e,t){var r=i(e.toPrecision(10));return n.numSeparate(r,t)},t.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:f.hovertemplate||-1!==d.indexOf("name")?f.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:m.castOption(_.bgcolor,e.pts)||e.color,borderColor:m.castOption(_.bordercolor,e.pts),fontFamily:m.castOption(w.family,e.pts),fontSize:m.castOption(w.size,e.pts),fontColor:m.castOption(w.color,e.pts),nameLength:m.castOption(_.namelength,e.pts),textAlign:m.castOption(_.align,e.pts),hovertemplate:m.castOption(f.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:k}),e.bbox=k[0],u._hasHoverLabel=!0}u._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,f)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,i=t._fullData[u.index],o=n.select(this).datum();u._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(o,i)],event:n.event}),u._hasHoverEvent=!1),u._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),u._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,i=t._fullData[u.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,i)],a.click(t,n.event))}))}function b(e,t,r){var n=m.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=m.castOption(e._input.textfont.color,t.pts));var i=m.castOption(e.insidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,a=m.castOption(e.insidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:i,size:a}}function _(e,t){for(var r,n,i=0;it&&t>n||r=-4;m-=2)g(Math.PI*m,"tan");for(m=4;m>=-4;m-=2)g(Math.PI*(m+1),"tan")}if(f||p){for(m=4;m>=-4;m-=2)g(Math.PI*(m+1.5),"rad");for(m=4;m>=-4;m-=2)g(Math.PI*(m+.5),"rad")}}if(s||h||f){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((a={scale:i*n*2/y,rCenter:1-i,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,a.scale>=1)return a;v.push(a)}(h||p)&&((a=k(e,n,o,l,u)).textPosAngle=(t.startangle+t.stopangle)/2,v.push(a)),(h||d)&&((a=T(e,n,o,l,u)).textPosAngle=(t.startangle+t.stopangle)/2,v.push(a));for(var x=0,b=0,_=0;_=1)break}return v[x]}function k(e,t,r,n,i){t=Math.max(0,t-2*v);var a=e.width/e.height,o=A(a,n,t,r);return{scale:2*o/e.height,rCenter:M(a,o/t),rotate:S(i)}}function T(e,t,r,n,i){t=Math.max(0,t-2*v);var a=e.height/e.width,o=A(a,n,t,r);return{scale:2*o/e.width,rCenter:M(a,o/t),rotate:S(i+Math.PI/2)}}function M(e,t){return Math.cos(t)-e*t}function S(e){return(180/Math.PI*e+720)%180-90}function A(e,t,r,n){var i=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(e*e+n/2)+e))}function C(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function E(e,t){var r=t.pxmid[0],n=t.pxmid[1],i=e.width/2,a=e.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function P(e,t){var r,n,i,a=e.trace,o={x:e.cx,y:e.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=I(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*e.r,s.ty-=e.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*e.r);var l,u,c=(l=e.r,u=e.trace.aspectratio,l/(void 0===u?1:u)),f=t.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(f+=c,o.x-=(1+i)*c,s.tx+=e.titleBox.width/2):-1!==a.title.position.indexOf("center")?f*=2:-1!==a.title.position.indexOf("right")&&(f+=c,o.x+=(1+i)*c,s.tx-=e.titleBox.width/2),r=f/e.titleBox.width,n=L(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function L(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function I(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function R(e,t){for(var r=[],n=0;n1?c=(u=r.r)/i.aspectratio:u=(c=r.r)*i.aspectratio,l=(u*=(1+i.baseratio)/2)*c}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var x=l.castOption(i,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:m.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:m.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:l.castOption(i,e.i,"customdata")}}(t),_=m.getFirstFilled(i.text,t.pts);(y(_)||""===_)&&(b.text=_),t.text=l.texttemplateString(x,b,e._fullLayout._d3locale,b,i._meta||{})}else t.text=""}}function z(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=a*n-o*i,e.textY=a*i+o*n,e.noCenter=!0}e.exports={plot:function(e,t){var r=e._context.staticPlot,a=e._fullLayout,d=a._size;h("pie",a),_(t,e),R(t,d);var v=l.makeTraceGroups(a._pielayer,t,"trace").each((function(t){var h=n.select(this),v=t[0],g=v.trace;!function(e){var t,r,n,i=e[0],a=i.r,o=i.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,u="px0",c="px1";if("counterclockwise"===o.direction){for(t=0;ti.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=C(r,i))}(t),h.attr("stroke-linejoin","round"),h.each((function(){var y=n.select(this).selectAll("g.slice").data(t);y.enter().append("g").classed("slice",!0),y.exit().remove();var _=[[[],[]],[[],[]]],k=!1;y.each((function(i,o){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=g.index,_[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var u=v.cx,c=v.cy,d=n.select(this),h=d.selectAll("path.surface").data([i]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),d.call(x,e,t),g.pull){var y=+m.castOption(g.pull,i.pts)||0;y>0&&(u+=y*i.pxmid[0],c+=y*i.pxmid[1])}i.cxFinal=u,i.cyFinal=c;var T=g.hole;if(i.v===v.vTotal){var M="M"+(u+i.px0[0])+","+(c+i.px0[1])+L(i.px0,i.pxmid,!0,1)+L(i.pxmid,i.px0,!0,1)+"Z";T?h.attr("d","M"+(u+T*i.px0[0])+","+(c+T*i.px0[1])+L(i.px0,i.pxmid,!1,T)+L(i.pxmid,i.px0,!1,T)+"Z"+M):h.attr("d",M)}else{var S=L(i.px0,i.px1,!0,1);if(T){var A=1-T;h.attr("d","M"+(u+T*i.px1[0])+","+(c+T*i.px1[1])+L(i.px1,i.px0,!1,T)+"l"+A*i.px0[0]+","+A*i.px0[1]+S+"Z")}else h.attr("d","M"+u+","+c+"l"+i.px0[0]+","+i.px0[1]+S+"Z")}D(e,i,v);var C=m.castOption(g.textposition,i.pts),P=d.selectAll("g.slicetext").data(i.text&&"none"!==C?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each((function(){var r=l.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),d=l.ensureUniformFontSize(e,"outside"===C?function(e,t,r){var n=m.castOption(e.outsidetextfont.color,t.pts)||m.castOption(e.textfont.color,t.pts)||r.color,i=m.castOption(e.outsidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,a=m.castOption(e.outsidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:i,size:a}}(g,i,a.font):b(g,i,a.font));r.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,d).call(f.convertToTspans,e);var h,y=s.bBox(r.node());if("outside"===C)h=E(y,i);else if(h=w(y,i,v),"auto"===C&&h.scale<1){var x=l.ensureUniformFontSize(e,g.outsidetextfont);r.call(s.font,x),h=E(y=s.bBox(r.node()),i)}var _=h.textPosAngle,T=void 0===_?i.pxmid:O(v.r,_);if(h.targetX=u+T[0]*h.rCenter+(h.x||0),h.targetY=c+T[1]*h.rCenter+(h.y||0),z(h,y),h.outside){var M=h.targetY;i.yLabelMin=M-y.height/2,i.yLabelMid=M,i.yLabelMax=M+y.height/2,i.labelExtraX=0,i.labelExtraY=0,k=!0}h.fontSize=d.size,p(g.type,h,a),t[o].transform=h,l.setTransormAndDisplay(r,h)}))}function L(e,t,r,n){var a=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*v.r+","+n*v.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var T=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,r=l.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),i=g.title.text;g._meta&&(i=l.templateString(i,g._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,g.title.font).call(f.convertToTspans,e),t="middle center"===g.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(v):P(v,d),r.attr("transform",c(t.x,t.y)+u(Math.min(1,t.scale))+c(t.tx,t.ty))})),k&&function(e,t){var r,n,i,a,o,s,l,u,c,f,d,p,h;function v(e,t){return e.pxmid[1]-t.pxmid[1]}function g(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var i,u,c,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,v=n?e.yLabelMax:e.yLabelMin,g=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-h;if(y*l>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(u=0;u=(m.castOption(t.pull,c.pts)||0)||((e.pxmid[1]-c.pxmid[1])*l>0?(y=c.cyFinal+o(c.px0[1],c.px1[1])-h-e.labelExtraY)*l>0&&(e.labelExtraY+=y):(v+e.labelExtraY-g)*l>0&&(i=3*s*Math.abs(u-f.indexOf(e)),(d=c.cxFinal+a(c.px0[0],c.px1[0])+i-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*s>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(i=n?v:g,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(u=e[n][r]).sort(i),c=e[1-n][r],f=c.concat(u),p=[],d=0;dMath.abs(f)?s+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(a+e.labelExtraX+u):s+="l"+e.labelExtraX+","+c+"v"+(f-c)+"h"+u}else s+="V"+(e.yLabelMid+e.labelExtraY)+"h"+u;l.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(y,g),k&&g.automargin){var M=s.bBox(h.node()),S=g.domain,A=d.w*(S.x[1]-S.x[0]),C=d.h*(S.y[1]-S.y[0]),L=(.5*A-v.r)/d.w,I=(.5*C-v.r)/d.h;i.autoMargin(e,"pie."+g.uid+".automargin",{xl:S.x[0]-L,xr:S.x[1]+L,yb:S.y[0]-I,yt:S.y[1]+I,l:Math.max(v.cx-v.r-M.left,0),r:Math.max(M.right-(v.cx+v.r),0),b:Math.max(M.bottom-(v.cy+v.r),0),t:Math.max(v.cy-v.r-M.top,0),pad:5})}}))}));setTimeout((function(){v.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:D,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:P,prerenderTitles:_,layoutAreas:R,attachFxHandlers:x,computeTransform:z}},68357:function(e,t,r){"use strict";var n=r(39898),i=r(63463),a=r(72597).resizeText;e.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");a(e,t,"pie"),t.each((function(t){var r=t[0].trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each((function(t){n.select(this).call(i,t,r,e)}))}))}},63463:function(e,t,r){"use strict";var n=r(7901),i=r(53581).castOption,a=r(22209);e.exports=function(e,t,r,o){var s=r.marker.line,l=i(s.color,t.pts)||n.defaultLine,u=i(s.width,t.pts)||0;e.call(a,t,r,o).style("stroke-width",u).call(n.stroke,l)}},10959:function(e,t,r){"use strict";var n=r(82196);e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},42743:function(e,t,r){"use strict";var n=r(9330).gl_pointcloud2d,i=r(78614),a=r(71739).findExtremes,o=r(34603);function s(e,t){this.scene=e,this.uid=t,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(e.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(e){var t=this.idToIndex[e.pointId];return{trace:this,dataCoord:e.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*t],this.pickXYData[2*t+1]]:[this.pickXData[t],this.pickYData[t]],textLabel:Array.isArray(this.textLabels)?this.textLabels[t]:this.textLabels,color:this.color,name:this.name,pointIndex:t,hoverinfo:this.hoverinfo}},l.update=function(e){this.index=e.index,this.textLabels=e.text,this.name=e.name,this.hoverinfo=e.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(e),this.color=o(e,{})},l.updateFast=function(e){var t,r,n,o,s,l,u=this.xData=this.pickXData=e.x,c=this.yData=this.pickYData=e.y,f=this.pickXYData=e.xy,d=e.xbounds&&e.ybounds,p=e.indices,h=this.bounds;if(f){if(n=f,t=f.length>>>1,d)h[0]=e.xbounds[0],h[2]=e.xbounds[1],h[1]=e.ybounds[0],h[3]=e.ybounds[1];else for(l=0;lh[2]&&(h[2]=o),sh[3]&&(h[3]=s);if(p)r=p;else for(r=new Int32Array(t),l=0;lh[2]&&(h[2]=o),sh[3]&&(h[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var v=i(e.marker.color),m=i(e.marker.border.color),g=e.opacity*e.marker.opacity;v[3]*=g,this.pointcloudOptions.color=v;var y=e.marker.blend;null===y&&(y=u.length<100||c.length<100),this.pointcloudOptions.blend=y,m[3]*=g,this.pointcloudOptions.borderColor=m;var x=e.marker.sizemin,b=Math.max(e.marker.sizemax,e.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=e.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,k=b/2||.5;e._extremes[_._id]=a(_,[h[0],h[2]],{ppad:k}),e._extremes[w._id]=a(w,[h[1],h[3]],{ppad:k})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(e,t){var r=new s(e,t.uid);return r.update(t),r}},33876:function(e,t,r){"use strict";var n=r(71828),i=r(10959);e.exports=function(e,t,r){function a(r,a){return n.coerce(e,t,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),e.xy&&e.xy instanceof Float32Array&&(t.xy=e.xy),e.indices&&e.indices instanceof Int32Array&&(t.indices=e.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),t._length=null}},20593:function(e,t,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" "),e.exports={attributes:r(10959),supplyDefaults:r(33876),calc:r(36563),plot:r(42743),moduleType:"trace",name:"pointcloud",basePlotModule:r(4796),categories:["gl","gl2d","showLegend"],meta:{}}},39953:function(e,t,r){"use strict";var n=r(41940),i=r(9012),a=r(22399),o=r(77914),s=r(27670).Y,l=r(5386).fF,u=r(50693),c=r(44467).templatedArray,f=r(12663).descriptionOnlyNumbers,d=r(1426).extendFlat,p=r(30962).overrideAll;(e.exports=p({hoverinfo:d({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:f("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:c("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:d(u().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},75536:function(e,t,r){"use strict";var n=r(30962).overrideAll,i=r(27659).a0,a=r(60436),o=r(528),s=r(6964),l=r(28569),u=r(47322).prepSelect,c=r(71828),f=r(73972),d="sankey";function p(e,t){var r=e._fullData[t],n=e._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if(o&&"pan"!==i&&"zoom"!==i){s(o,a);var d={_id:"x",c2p:c.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:c.identity,_offset:r._sankey.translateY,_length:r._sankey.height},h={gd:e,element:o.node(),plotinfo:{id:t,xaxis:d,yaxis:p,fillRangeItems:c.noop},subplot:t,xaxes:[d],yaxes:[p],doneFnCompleted:function(r){var n,i=e._fullData[t],a=i.node.groups.slice(),o=[];function s(e){for(var t=i._sankey.graph.nodes,r=0;ry&&(y=a.source[t]),a.target[t]>y&&(y=a.target[t]);var x,b=y+1;e.node._count=b;var _=e.node.groups,w={};for(t=0;t<_.length;t++){var k=_[t];for(x=0;x0&&s(C,b)&&s(E,b)&&(!w.hasOwnProperty(C)||!w.hasOwnProperty(E)||w[C]!==w[E])){w.hasOwnProperty(E)&&(E=w[E]),w.hasOwnProperty(C)&&(C=w[C]),E=+E,d[C=+C]=d[E]=!0;var P="";a.label&&a.label[t]&&(P=a.label[t]);var L=null;P&&p.hasOwnProperty(P)&&(L=p[P]),u.push({pointNumber:t,label:P,color:c?a.color[t]:a.color,customdata:f?a.customdata[t]:a.customdata,concentrationscale:L,source:C,target:E,value:+A}),S.source.push(C),S.target.push(E)}}var I=b+_.length,R=o(r.color),O=o(r.customdata),D=[];for(t=0;tb-1,childrenNodes:[],pointNumber:t,label:z,color:R?r.color[t]:r.color,customdata:O?r.customdata[t]:r.customdata})}var F=!1;return function(e,t,r){for(var a=i.init2dArray(e,0),o=0;o1}))}(I,S.source,S.target)&&(F=!0),{circular:F,links:u,nodes:D,groups:_,groupLookup:w}}e.exports=function(e,t){var r=u(t);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},85247:function(e){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},26857:function(e,t,r){"use strict";var n=r(71828),i=r(39953),a=r(7901),o=r(84267),s=r(27670).c,l=r(38048),u=r(44467),c=r(85501);function f(e,t){function r(r,a){return n.coerce(e,t,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(e,t,r,d){function p(r,a){return n.coerce(e,t,i,r,a)}var h=n.extendDeep(d.hoverlabel,e.hoverlabel),v=e.node,m=u.newContainer(t,"node");function g(e,t){return n.coerce(v,m,i.node,e,t)}g("label"),g("groups"),g("x"),g("y"),g("pad"),g("thickness"),g("line.color"),g("line.width"),g("hoverinfo",e.hoverinfo),l(v,m,g,h),g("hovertemplate");var y=d.colorway;g("color",m.label.map((function(e,t){return a.addOpacity(function(e){return y[e%y.length]}(t),.8)}))),g("customdata");var x=e.link||{},b=u.newContainer(t,"link");function _(e,t){return n.coerce(x,b,i.link,e,t)}_("label"),_("arrowlen"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",e.hoverinfo),l(x,b,_,h),_("hovertemplate");var w,k=o(d.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(k,b.value.length)),_("customdata"),c(x,b,{name:"colorscales",handleItemDefaults:f}),s(t,d,p),p("orientation"),p("valueformat"),p("valuesuffix"),m.x.length&&m.y.length&&(w="freeform"),p("arrangement",w),n.coerceFont(p,"textfont",n.extendFlat({},d.font)),t._length=null}},29396:function(e,t,r){"use strict";e.exports={attributes:r(39953),supplyDefaults:r(26857),calc:r(92930),plot:r(60436),moduleType:"trace",name:"sankey",basePlotModule:r(75536),selectPoints:r(84564),categories:["noOpacity"],meta:{}}},60436:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=i.numberFormat,o=r(3393),s=r(30211),l=r(7901),u=r(85247).cn,c=i._;function f(e){return""!==e}function d(e,t){return e.filter((function(e){return e.key===t.traceId}))}function p(e,t){n.select(e).select("path").style("fill-opacity",t),n.select(e).select("rect").style("fill-opacity",t)}function h(e){n.select(e).select("text.name").style("fill","black")}function v(e){return function(t){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function m(e){return function(t){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(e,t,r){t&&r&&d(r,t).selectAll("."+u.sankeyLink).filter(v(t)).call(x.bind(0,t,r,!1))}function y(e,t,r){t&&r&&d(r,t).selectAll("."+u.sankeyLink).filter(v(t)).call(b.bind(0,t,r,!1))}function x(e,t,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(e){if(!e.link.concentrationscale)return.4})),i&&d(t,e).selectAll("."+u.sankeyLink).filter((function(e){return e.link.label===i})).style("fill-opacity",(function(e){if(!e.link.concentrationscale)return.4})),r&&d(t,e).selectAll("."+u.sankeyNode).filter(m(e)).call(g)}function b(e,t,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(e){return e.tinyColorAlpha})),i&&d(t,e).selectAll("."+u.sankeyLink).filter((function(e){return e.link.label===i})).style("fill-opacity",(function(e){return e.tinyColorAlpha})),r&&d(t,e).selectAll(u.sankeyNode).filter(m(e)).call(y)}function _(e,t){var r=e.hoverlabel||{},n=i.nestedProperty(r,t).get();return!Array.isArray(n)&&n}e.exports=function(e,t){for(var r=e._fullLayout,i=r._paper,d=r._size,v=0;v"),color:_(o,"bgcolor")||l.addOpacity(v.color,1),borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:n.event.x"),color:_(o,"bgcolor")||i.tinyColorHue,borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:y,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e});p(w,.85),h(w)}}},unhover:function(t,i,a){!1!==e._fullLayout.hovermode&&(n.select(t).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,e.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(t,r,i){var a=r.node;a.originalEvent=n.event,e._hoverdata=[a],n.select(t).call(y,r,i),s.click(e,{target:!0})}}})}},3393:function(e,t,r){"use strict";var n=r(49887),i=r(81684).k4,a=r(39898),o=r(30838),s=r(86781),l=r(85247),u=r(84267),c=r(7901),f=r(91424),d=r(71828),p=d.strTranslate,h=d.strRotate,v=r(28984),m=v.keyFun,g=v.repeat,y=v.unwrap,x=r(63893),b=r(73972),_=r(18783),w=_.CAP_SHIFT,k=_.LINE_SPACING;function T(e,t,r){var n,i=y(t),a=i.trace,c=a.domain,f="h"===a.orientation,p=a.node.pad,h=a.node.thickness,v=e.width*(c.x[1]-c.x[0]),m=e.height*(c.y[1]-c.y[0]),g=i._nodes,x=i._links,b=i.circular;(n=b?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(f?[v,m]:[m,v]).nodeWidth(h).nodePadding(p).nodeId((function(e){return e.pointNumber})).nodes(g).links(x);var _,w,k,T=n();for(var M in n.nodePadding()=i||(r=i-t.y0)>1e-6&&(t.y0+=r,t.y1+=r),i=t.y1+p}))}(function(e){var t,r,n=e.map((function(e,t){return{x0:e.x0,index:t}})).sort((function(e,t){return e.x0-t.x0})),i=[],a=-1,o=-1/0;for(_=0;_o+h&&(a+=1,t=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=t-s.x0,s.x0+=r,s.x1+=r}return i}(g=T.nodes)),n.update(T)}return{circular:b,key:r,trace:a,guid:d.randstr(),horizontal:f,width:v,height:m,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,linkArrowLength:a.link.arrowlen,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:c.x[0]*e.width+e.margin.l,translateY:e.height-c.y[1]*e.height+e.margin.t,dragParallel:f?m:v,dragPerpendicular:f?v:m,arrangement:a.arrangement,sankey:n,graph:T,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function M(e,t,r){var n=u(t.color),i=t.source.label+"|"+t.target.label+"__"+r;return t.trace=e.trace,t.curveNumber=e.trace.index,{circular:e.circular,key:i,traceId:e.key,pointNumber:t.pointNumber,link:t,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:S,linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,linkArrowLength:e.linkArrowLength,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,parent:e,interactionState:e.interactionState,flow:t.flow}}function S(){return function(e){var t=e.linkArrowLength;if(e.link.circular)return function(e,t){var r=e.width/2,n=e.circularPathData;return"top"===e.circularLinkType?"M "+(n.targetX-t)+" "+(n.targetY+r)+" L"+(n.rightInnerExtent-t)+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r-t)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-t)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r-t)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-t)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+(n.rightInnerExtent-t)+" "+(n.targetY-r)+"L"+(n.targetX-t)+" "+(n.targetY-r)+(t>0?"L"+n.targetX+" "+n.targetY:"")+"Z":"M "+(n.targetX-t)+" "+(n.targetY-r)+" L"+(n.rightInnerExtent-t)+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r-t)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-t)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+(n.rightInnerExtent-t)+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r-t)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-t)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+(n.rightInnerExtent-t)+" "+(n.targetY+r)+"L"+(n.targetX-t)+" "+(n.targetY+r)+(t>0?"L"+n.targetX+" "+n.targetY:"")+"Z"}(e.link,t);var r=Math.abs((e.link.target.x0-e.link.source.x1)/2);t>r&&(t=r);var n=e.link.source.x1,a=e.link.target.x0-t,o=i(n,a),s=o(.5),l=o(.5),u=e.link.y0-e.link.width/2,c=e.link.y0+e.link.width/2,f=e.link.y1-e.link.width/2,d=e.link.y1+e.link.width/2,p="M"+n+","+u,h="C"+s+","+u+" "+l+","+f+" "+a+","+f,v="C"+l+","+d+" "+s+","+c+" "+n+","+c,m=t>0?"L"+(a+t)+","+(f+e.link.width/2):"";return p+h+(m+="L"+a+","+d)+v+"Z"}}function A(e,t){var r=u(t.color),n=l.nodePadAcross,i=e.nodePad/2;t.dx=t.x1-t.x0,t.dy=t.y1-t.y0;var a=t.dx,o=Math.max(.5,t.dy),s="node_"+t.pointNumber;return t.group&&(s=d.randstr()),t.trace=e.trace,t.curveNumber=e.trace.index,{index:t.pointNumber,key:s,partOfGroup:t.partOfGroup||!1,group:t.group,traceId:e.key,trace:e.trace,node:t,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:e.horizontal?t.dy/2+1:t.dx/2+1,left:1===t.originalLayer,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,graph:e.graph,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,s].join("_"),interactionState:e.interactionState,figure:e}}function C(e){e.attr("transform",(function(e){return p(e.node.x0.toFixed(3),e.node.y0.toFixed(3))}))}function E(e){e.call(C)}function P(e,t){e.call(E),t.attr("d",S())}function L(e){e.attr("width",(function(e){return e.node.x1-e.node.x0})).attr("height",(function(e){return e.visibleHeight}))}function I(e){return e.link.width>1||e.linkLineWidth>0}function R(e){return p(e.translateX,e.translateY)+(e.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function O(e,t,r){e.on(".basic",null).on("mouseover.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.hover(this,e,t),e.interactionState.hovered=[this,e])})).on("mousemove.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.follow(this,e),e.interactionState.hovered=[this,e])})).on("mouseout.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.unhover(this,e,t),e.interactionState.hovered=!1)})).on("click.basic",(function(e){e.interactionState.hovered&&(r.unhover(this,e,t),e.interactionState.hovered=!1),e.interactionState.dragInProgress||e.partOfGroup||r.select(this,e,t)}))}function D(e,t,r,i){var o=a.behavior.drag().origin((function(e){return{x:e.node.x0+e.visibleWidth/2,y:e.node.y0+e.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(d.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(e){i._fullLayout._dragCover=e})),d.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(e,t,r,i){!function(e){for(var t=0;t0&&n.forceLayouts[t].alpha(0)}}(0,t,a,r)).stop()}(0,o,a),function(e,t,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,z(r,i)}}))}(e,t,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),P(e.filter(j(r)),t))}})).on("dragend",(function(e){if("fixed"!==e.arrangement){e.interactionState.dragInProgress=!1;for(var t=0;tl&&P[g].gap;)g--;for(x=P[g].s,v=P.length-1;v>g;v--)P[v].s=x;for(;lA[f]&&f=0;f--){var d=e[f];if("scatter"===d.type&&d.xaxis===u.xaxis&&d.yaxis===u.yaxis){d.opacity=void 0;break}}}}}},17438:function(e,t,r){"use strict";var n=r(71828),i=r(73972),a=r(82196),o=r(47581),s=r(34098),l=r(67513),u=r(73927),c=r(565),f=r(49508),d=r(11058),p=r(94039),h=r(82410),v=r(28908),m=r(71828).coercePattern;e.exports=function(e,t,r,g){function y(r,i){return n.coerce(e,t,a,r,i)}var x=l(e,t,g,y);if(x||(t.visible=!1),t.visible){u(e,t,g,y),y("xhoverformat"),y("yhoverformat");var b=c(e,t,g,y);"group"===g.scattermode&&void 0===t.orientation&&y("orientation","v");var _=!b&&x=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(d.c2p(e.x)-h);return a=Math.min(t,r)&&v<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(p.c2p(e.y)-v);return aq!==(N=O[I][1])>=q&&(z=O[I-1][0],F=O[I][0],N-j&&(D=z+(F-z)*(q-j)/(N-j),U=Math.min(U,D),H=Math.max(H,D)));U=Math.max(U,0),H=Math.min(H,d._length);var Y=s.defaultLine;return s.opacity(f.fillcolor)?Y=f.fillcolor:s.opacity((f.line||{}).color)&&(Y=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:U,x1:H,y0:q,y1:q,color:Y,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},67368:function(e,t,r){"use strict";var n=r(34098);e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:r(82196),layoutAttributes:r(21479),supplyDefaults:r(17438),crossTraceDefaults:r(34936),supplyLayoutDefaults:r(79334),calc:r(47761).calc,crossTraceCalc:r(72626),arraysToCalcdata:r(75225),plot:r(32663),colorbar:r(4898),formatLabels:r(8225),style:r(16296).style,styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(33720),selectPoints:r(98002),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:r(93612),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},21479:function(e){"use strict";e.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}},79334:function(e,t,r){"use strict";var n=r(71828),i=r(21479);e.exports=function(e,t){var r,a,o="group"===t.barmode;"group"===t.scattermode&&(r="scattergap",a=o?t.bargap:.2,n.coerce(e,t,i,r,a))}},11058:function(e,t,r){"use strict";var n=r(71828).isArrayOrTypedArray,i=r(52075).hasColorscale,a=r(1586);e.exports=function(e,t,r,o,s,l){l||(l={});var u=(e.marker||{}).color;s("line.color",r),i(e,"line")?a(e,t,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r),s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},34621:function(e,t,r){"use strict";var n=r(91424),i=r(50606),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,u=r(71828),c=u.segmentsIntersect,f=u.constrain,d=r(47581);e.exports=function(e,t){var r,i,o,p,h,v,m,g,y,x,b,_,w,k,T,M,S,A,C=t.trace||{},E=t.xaxis,P=t.yaxis,L="log"===E.type,I="log"===P.type,R=E._length,O=P._length,D=t.backoff,z=C.marker,F=t.connectGaps,j=t.baseTolerance,N=t.shape,Z="linear"===N,B=C.fill&&"none"!==C.fill,V=[],U=d.minTolerance,H=e.length,W=new Array(H),G=0;function q(r){var n=e[r];if(!n)return!1;var i=t.linearized?E.l2p(n.x):E.c2p(n.x),o=t.linearized?P.l2p(n.y):P.c2p(n.y);if(i===a){if(L&&(i=E.c2p(n.x,!0)),i===a)return!1;I&&o===a&&(i*=Math.abs(E._m*O*(E._m>0?s:l)/(P._m*R*(P._m>0?s:l)))),i*=1e3}if(o===a){if(I&&(o=P.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function Y(e,t,r,n){var i=r-e,a=n-t,o=.5-e,s=.5-t,l=i*i+a*a,u=i*o+a*s;if(u>0&&uoe||e[1]le)return[f(e[0],ae,oe),f(e[1],se,le)]}function fe(e,t){return e[0]===t[0]&&(e[0]===ae||e[0]===oe)||e[1]===t[1]&&(e[1]===se||e[1]===le)||void 0}function de(e,t,r){return function(n,i){var a=ce(n),o=ce(i),s=[];if(a&&o&&fe(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*u.constrain((n[e]+i[e])/2,t,r)-((a||n)[e]+(o||i)[e]);return l&&((a&&o?l>0===a[e]>o[e]?a:o:a||o)[e]+=l),s}}function pe(e){var t=e[0],r=e[1],n=t===W[G-1][0],i=r===W[G-1][1];if(!n||!i)if(G>1){var a=t===W[G-2][0],o=r===W[G-2][1];n&&(t===ae||t===oe)&&a?o?G--:W[G-1]=e:i&&(r===se||r===le)&&o?a?G--:W[G-1]=e:W[G++]=e}else W[G++]=e}function he(e){W[G-1][0]!==e[0]&&W[G-1][1]!==e[1]&&pe([Q,ee]),pe(e),te=null,Q=ee=0}"linear"===N||"spline"===N?ne=function(e,t){for(var r=[],n=0,i=0;i<4;i++){var a=ue[i],o=c(e[0],e[1],t[0],t[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&K(o,e)oe?oe:0,J=t[1]le?le:0,$||J){if(G)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),W[G++]=n[1])}else re=ne(W[G-1],t)[0],W[G++]=re;else W[G++]=[$||t[0],J||t[1]];var i=W[G-1];$&&J&&(i[0]!==$||i[1]!==J)?(te&&(Q!==$&&ee!==J?pe(Q&&ee?function(e,t){var r=t[0]-e[0],n=(t[1]-e[1])/r;return(e[1]*t[0]-t[1]*e[0])/r>0?[n>0?ae:oe,le]:[n>0?oe:ae,se]}(te,t):[Q||$,ee||J]):Q&&ee&&pe([Q,ee])),pe([$,J])):Q-$&&ee-J&&pe([$||Q,J||ee]),te=t,Q=$,ee=J}else te&&he(ne(te,t)[0]),W[G++]=t}for(r=0;rX(v,ge))break;o=v,(w=y[0]*g[0]+y[1]*g[1])>b?(b=w,p=v,m=!1):w<_&&(_=w,h=v,m=!0)}if(m?(me(p),o!==h&&me(h)):(h!==i&&me(h),o!==p&&me(p)),me(o),r>=e.length||!v)break;me(v),i=v}}else me(p)}te&&pe([Q||te[0],ee||te[1]]),V.push(W.slice(0,G))}var ye=N.slice(N.length-1);if(D&&"h"!==ye&&"v"!==ye){for(var xe=!1,be=-1,_e=[],we=0;we=0?l=p:(l=p=d,d++),l0?Math.max(r,a):0}}},4898:function(e){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},49508:function(e,t,r){"use strict";var n=r(7901),i=r(52075).hasColorscale,a=r(1586),o=r(34098);e.exports=function(e,t,r,s,l,u){var c=o.isBubble(e),f=(e.line||{}).color;u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),u.noAngle||(l("marker.angle"),u.noAngleRef||l("marker.angleref"),u.noStandOff||l("marker.standoff")),l("marker.color",r),i(e,"marker")&&a(e,t,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:c?n.background:n.defaultLine),i(e,"marker.line")&&a(e,t,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}},73927:function(e,t,r){"use strict";var n=r(71828).dateTick0,i=r(50606).ONEWEEK;function a(e,t){return n(t,e%i===0?1:0)}e.exports=function(e,t,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,t.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,t.ycalendar)),n("yperiodalignment"))}}},32663:function(e,t,r){"use strict";var n=r(39898),i=r(73972),a=r(71828),o=a.ensureSingle,s=a.identity,l=r(91424),u=r(34098),c=r(34621),f=r(68687),d=r(61082).tester;function p(e,t,r,f,p,h,v){var m,g=e._context.staticPlot;!function(e,t,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),d=i[0].trace;if(u.hasMarkers(d)){var p=d.marker.maxdisplayed;if(0!==p){var h=i.filter((function(e){return e.x>=c[0]&&e.x<=c[1]&&e.y>=f[0]&&e.y<=f[1]})),v=Math.ceil(h.length/p),m=0;o.forEach((function(e,r){var n=e[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function x(e){return y?e.transition():e}var b=r.xaxis,_=r.yaxis,w=f[0].trace,k=w.line,T=n.select(h),M=o(T,"g","errorbars"),S=o(T,"g","lines"),A=o(T,"g","points"),C=o(T,"g","text");if(i.getComponentMethod("errorbars","plot")(e,M,r,v),!0===w.visible){var E,P;x(T).style("opacity",w.opacity);var L=w.fill.charAt(w.fill.length-1);"x"!==L&&"y"!==L&&(L=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var I,R,O="",D=[],z=w._prevtrace;z&&(O=z._prevRevpath||"",P=z._nextFill,D=z._polygons);var F,j,N,Z,B,V,U,H="",W="",G=[],q=a.noop;if(E=w._ownFill,u.hasLines(w)||"none"!==w.fill){for(P&&P.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(k.shape)?(F=l.steps(k.shape),j=l.steps(k.shape.split("").reverse().join(""))):F=j="spline"===k.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?l.smoothclosed(e.slice(1),k.smoothing):l.smoothopen(e,k.smoothing)}:function(e){return"M"+e.join("L")},N=function(e){return j(e.reverse())},G=c(f,{xaxis:b,yaxis:_,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(k.width||1,3)/4,shape:k.shape,backoff:k.backoff,simplify:k.simplify,fill:w.fill}),U=w._polygons=new Array(G.length),m=0;m0,m=f(e,t,r);(c=i.selectAll("g.trace").data(m,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(e,t,r){t.each((function(t){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,e);var a=t[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(e){a[e]=null})).remove(),c.order().each((function(e){a[e]=o(n.select(this),"path","js-fill")}))}))}(e,c,t),v?(u&&(d=u()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){i.selectAll("g.trace").each((function(r,n){p(e,n,t,r,m,this,a)}))}))):c.each((function(r,n){p(e,n,t,r,m,this,a)})),h&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},98002:function(e,t,r){"use strict";var n=r(34098);e.exports=function(e,t){var r,i,a,o,s=e.cd,l=e.xaxis,u=e.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r0){var d=i.c2l(c);i._lowerLogErrorBound||(i._lowerLogErrorBound=d),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,d)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(e,t,r){var n=[i(e.x,e.error_x,t[0],r.xaxis),i(e.y,e.error_y,t[1],r.yaxis),i(e.z,e.error_z,t[2],r.zaxis)],a=function(e){for(var t=0;t-1?-1:e.indexOf("right")>-1?1:0}function b(e){return null===e||void 0===e?0:e.indexOf("top")>-1?-1:e.indexOf("bottom")>-1?1:0}function _(e,t){return t(4*e)}function w(e){return p[e]}function k(e,t,r,n,i){var a=null;if(l.isArrayOrTypedArray(e)){a=[];for(var o=0;o=0){var v=function(e,t,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",p||h);for(var v=["x","y","z"],m=0;m<3;++m){var g="projection."+v[m];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}var y=n.getComponentMethod("errorbars","supplyDefaults");y(e,t,p||h||r,{axis:"z"}),y(e,t,p||h||r,{axis:"y",inherit:"z"}),y(e,t,p||h||r,{axis:"x",inherit:"z"})}else t.visible=!1}},13551:function(e,t,r){"use strict";e.exports={plot:r(58925),attributes:r(44542),markerSymbols:r(87381),supplyDefaults:r(21428),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:r(36563),moduleType:"trace",name:"scatter3d",basePlotModule:r(58547),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},97001:function(e,t,r){"use strict";var n=r(82196),i=r(9012),a=r(5386).fF,o=r(5386).si,s=r(50693),l=r(1426).extendFlat,u=n.marker,c=n.line,f=u.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:c.color,width:c.width,dash:c.dash,backoff:c.backoff,shape:l({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,angle:u.angle,angleref:u.angleref,standoff:u.standoff,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:l({width:f.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},34618:function(e,t,r){"use strict";var n=r(92770),i=r(36922),a=r(75225),o=r(66279),s=r(47761).calcMarkerSize,l=r(22882);e.exports=function(e,t){var r=t._carpetTrace=l(e,t);if(r&&r.visible&&"legendonly"!==r.visible){var u;t.xaxis=r.xaxis,t.yaxis=r.yaxis;var c,f,d=t._length,p=new Array(d),h=!1;for(u=0;u")}return o}function y(e,t){var r;r=e.labelprefix&&e.labelprefix.length>0?e.labelprefix.replace(/ = $/,""):e._hovertitle,m.push(r+": "+t.toFixed(3)+e.labelsuffix)}}},46858:function(e,t,r){"use strict";e.exports={attributes:r(97001),supplyDefaults:r(98965),colorbar:r(4898),formatLabels:r(48953),calc:r(34618),plot:r(1913),style:r(16296).style,styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(22931),selectPoints:r(98002),eventData:r(16165),moduleType:"trace",name:"scattercarpet",basePlotModule:r(93612),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},1913:function(e,t,r){"use strict";var n=r(32663),i=r(89298),a=r(91424);e.exports=function(e,t,r,o){var s,l,u,c=r[0][0].carpet,f=i.getFromId(e,c.xaxis||"x"),d=i.getFromId(e,c.yaxis||"y"),p={xaxis:f,yaxis:d,plot:t.plot};for(s=0;s")}function p(e){return e+"\xb0"}}(u,v,e,l[0].t.labels),e.hovertemplate=u.hovertemplate,[e]}}},17988:function(e,t,r){"use strict";e.exports={attributes:r(19316),supplyDefaults:r(10659),colorbar:r(4898),formatLabels:r(82719),calc:r(84622),calcGeoJSON:r(89171).calcGeoJSON,plot:r(89171).plot,style:r(33095),styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(14977),eventData:r(84084),selectPoints:r(20548),moduleType:"trace",name:"scattergeo",basePlotModule:r(44622),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},89171:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=r(90973).getTopojsonFeatures,o=r(18214),s=r(41327),l=r(71739).findExtremes,u=r(50606).BADNUM,c=r(47761).calcMarkerSize,f=r(34098),d=r(33095);e.exports={calcGeoJSON:function(e,t){var r,n,i=e[0].trace,o=t[i.geo],f=o._subplot,d=i._length;if(Array.isArray(i.locations)){var p=i.locationmode,h="geojson-id"===p?s.extractTraceFeature(e):a(i,f.topojson);for(r=0;r=m,w=2*b,k={},T=l.makeCalcdata(t,"x"),M=y.makeCalcdata(t,"y"),S=s(t,l,"x",T),A=s(t,y,"y",M),C=S.vals,E=A.vals;t._x=C,t._y=E,t.xperiodalignment&&(t._origX=T,t._xStarts=S.starts,t._xEnds=S.ends),t.yperiodalignment&&(t._origY=M,t._yStarts=A.starts,t._yEnds=A.ends);var P=new Array(w),L=new Array(b);for(r=0;r1&&i.extendFlat(s.line,p.linePositions(e,r,n)),s.errorX||s.errorY){var l=p.errorBarPositions(e,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}return s.text&&(i.extendFlat(s.text,{positions:n},p.textPosition(e,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},p.textPosition(e,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},p.textPosition(e,r,s.text,s.markerUnsel))),s}(e,0,t,P,C,E),O=h(e,x);return f(o,t),_?R.marker&&(I=R.marker.sizeAvg||Math.max(R.marker.size,3)):I=u(t,b),c(e,t,l,y,C,E,I),R.errorX&&g(t,l,R.errorX),R.errorY&&g(t,y,R.errorY),R.fill&&!O.fill2d&&(O.fill2d=!0),R.marker&&!O.scatter2d&&(O.scatter2d=!0),R.line&&!O.line2d&&(O.line2d=!0),!R.errorX&&!R.errorY||O.error2d||(O.error2d=!0),R.text&&!O.glText&&(O.glText=!0),R.marker&&(R.marker.snap=b),O.lineOptions.push(R.line),O.errorXOptions.push(R.errorX),O.errorYOptions.push(R.errorY),O.fillOptions.push(R.fill),O.markerOptions.push(R.marker),O.markerSelectedOptions.push(R.markerSel),O.markerUnselectedOptions.push(R.markerUnsel),O.textOptions.push(R.text),O.textSelectedOptions.push(R.textSel),O.textUnselectedOptions.push(R.textUnsel),O.selectBatch.push([]),O.unselectBatch.push([]),k._scene=O,k.index=O.count,k.x=C,k.y=E,k.positions=P,O.count++,[{x:!1,y:!1,t:k,trace:t}]}},78232:function(e){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},19635:function(e,t,r){"use strict";var n=r(92770),i=r(82019),a=r(25075),o=r(73972),s=r(71828),l=r(91424),u=r(41675),c=r(81697).formatColor,f=r(34098),d=r(39984),p=r(68645),h=r(78232),v=r(37822).DESELECTDIM,m={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},g=r(23469).appendArrayPointValue;function y(e,t){var r,i=e._fullLayout,a=t._length,o=t.textfont,l=t.textposition,u=Array.isArray(l)?l:[l],c=o.color,f=o.size,d=o.family,p={},h=e._context.plotGlPixelRatio,v=t.texttemplate;if(v){p.text=[];var m=i._d3locale,y=Array.isArray(v),x=y?Math.min(v.length,a):a,b=y?function(e){return v[e]}:function(){return v};for(r=0;rh.TOO_MANY_POINTS||f.hasMarkers(t)?"rect":"round";if(u&&t.connectgaps){var d=n[0],p=n[1];for(i=0;i1?l[i]:l[0]:l,h=Array.isArray(u)?u.length>1?u[i]:u[0]:u,v=m[p],g=m[h],y=c?c/.8+1:0,x=-g*y-.5*g;o.offset[i]=[v*y/d,x/d]}}return o}}},47148:function(e,t,r){"use strict";var n=r(71828),i=r(73972),a=r(68645),o=r(42341),s=r(47581),l=r(34098),u=r(67513),c=r(73927),f=r(49508),d=r(11058),p=r(28908),h=r(82410);e.exports=function(e,t,r,v){function m(r,i){return n.coerce(e,t,o,r,i)}var g=!!e.marker&&a.isOpenSymbol(e.marker.symbol),y=l.isBubble(e),x=u(e,t,v,m);if(x){c(e,t,v,m),m("xhoverformat"),m("yhoverformat");var b=x100},t.isDotSymbol=function(e){return"string"===typeof e?n.DOT_RE.test(e):e>200}},20794:function(e,t,r){"use strict";var n=r(73972),i=r(71828),a=r(34603);function o(e,t,r,o){var s=e.xa,l=e.ya,u=e.distance,c=e.dxy,f=e.index,d={pointNumber:f,x:t[f],y:r[f]};d.tx=Array.isArray(o.text)?o.text[f]:o.text,d.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,d.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,d.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var p=o.textfont;p&&(d.ts=i.isArrayOrTypedArray(p.size)?p.size[f]:p.size,d.tc=Array.isArray(p.color)?p.color[f]:p.color,d.tf=Array.isArray(p.family)?p.family[f]:p.family);var h=o.marker;h&&(d.ms=i.isArrayOrTypedArray(h.size)?h.size[f]:h.size,d.mo=i.isArrayOrTypedArray(h.opacity)?h.opacity[f]:h.opacity,d.mx=i.isArrayOrTypedArray(h.symbol)?h.symbol[f]:h.symbol,d.ma=i.isArrayOrTypedArray(h.angle)?h.angle[f]:h.angle,d.mc=i.isArrayOrTypedArray(h.color)?h.color[f]:h.color);var v=h&&h.line;v&&(d.mlc=Array.isArray(v.color)?v.color[f]:v.color,d.mlw=i.isArrayOrTypedArray(v.width)?v.width[f]:v.width);var m=h&&h.gradient;m&&"none"!==m.type&&(d.mgt=Array.isArray(m.type)?m.type[f]:m.type,d.mgc=Array.isArray(m.color)?m.color[f]:m.color);var g=s.c2p(d.x,!0),y=l.c2p(d.y,!0),x=d.mrc||1,b=o.hoverlabel;b&&(d.hbg=Array.isArray(b.bgcolor)?b.bgcolor[f]:b.bgcolor,d.hbc=Array.isArray(b.bordercolor)?b.bordercolor[f]:b.bordercolor,d.hts=i.isArrayOrTypedArray(b.font.size)?b.font.size[f]:b.font.size,d.htc=Array.isArray(b.font.color)?b.font.color[f]:b.font.color,d.htf=Array.isArray(b.font.family)?b.font.family[f]:b.font.family,d.hnl=i.isArrayOrTypedArray(b.namelength)?b.namelength[f]:b.namelength);var _=o.hoverinfo;_&&(d.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(d.ht=Array.isArray(w)?w[f]:w);var k={};k[e.index]=d;var T=o._origX,M=o._origY,S=i.extendFlat({},e,{color:a(o,d),x0:g-x,x1:g+x,xLabelVal:T?T[f]:d.x,y0:y-x,y1:y+x,yLabelVal:M?M[f]:d.y,cd:k,distance:u,spikeDistance:c,hovertemplate:d.ht});return d.htx?S.text=d.htx:d.tx?S.text=d.tx:o.text&&(S.text=o.text),i.fillText(d,o,S),n.getComponentMethod("errorbars","hoverInfo")(d,o,S),S}e.exports={hoverPoints:function(e,t,r,n){var i,a,s,l,u,c,f,d,p,h,v=e.cd,m=v[0].t,g=v[0].trace,y=e.xa,x=e.ya,b=m.x,_=m.y,w=y.c2p(t),k=x.c2p(r),T=e.distance;if(m.tree){var M=y.p2c(w-T),S=y.p2c(w+T),A=x.p2c(k-T),C=x.p2c(k+T);i="x"===n?m.tree.range(Math.min(M,S),Math.min(x._rl[0],x._rl[1]),Math.max(M,S),Math.max(x._rl[0],x._rl[1])):m.tree.range(Math.min(M,S),Math.min(A,C),Math.max(M,S),Math.max(A,C))}else i=m.ids;var E=T;if("x"===n){var P=!!g.xperiodalignment,L=!!g.yperiodalignment;for(c=0;c=Math.min(I,R)&&w<=Math.max(I,R)?0:1/0}if(f=Math.min(O,D)&&k<=Math.max(O,D)?0:1/0}h=Math.sqrt(f*f+d*d),s=i[c]}}}else for(c=i.length-1;c>-1;c--)l=b[a=i[c]],u=_[a],f=y.c2p(l)-w,d=x.c2p(u)-k,(p=Math.sqrt(f*f+d*d))y.glText.length){var k=_-y.glText.length;for(v=0;vr&&(isNaN(t[n])||isNaN(t[n+1]));)n-=2;e.positions=t.slice(r,n+2)}return e})),y.line2d.update(y.lineOptions)),y.error2d){var M=(y.errorXOptions||[]).concat(y.errorYOptions||[]);y.error2d.update(M)}y.scatter2d&&y.scatter2d.update(y.markerOptions),y.fillOrder=s.repeat(null,_),y.fill2d&&(y.fillOptions=y.fillOptions.map((function(e,t){var n=r[t];if(e&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,u=y.lineOptions[t],c=[];s._ownfill&&c.push(t),s._nexttrace&&c.push(t+1),c.length&&(y.fillOrder[t]=c);var f,d,p=[],h=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(h[d+1]);)d-=2;0!==h[f+1]&&(p=[h[f],0]),p=p.concat(h.slice(f,d+2)),0!==h[d+1]&&(p=p.concat([h[d],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(h[d]);)d-=2;0!==h[f]&&(p=[0,h[f+1]]),p=p.concat(h.slice(f,d+2)),0!==h[d]&&(p=p.concat([0,h[d+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(p=[],i=0,e.splitNull=!0,a=0;a-1;for(v=0;v<_;v++){var E=r[v][0],P=E.trace,L=E.t,I=L.index,R=P._length,O=L.x,D=L.y;if(P.selectedpoints||A||C){if(A||(A=!0),P.selectedpoints){var z=y.selectBatch[I]=s.selIndices2selPoints(P),F={};for(m=0;m")}function c(e){return e+"\xb0"}}e.exports={hoverPoints:function(e,t,r){var o=e.cd,c=o[0].trace,f=e.xa,d=e.ya,p=e.subplot,h=[],v=l+c.uid+"-circle",m=c.cluster&&c.cluster.enabled;if(m){var g=p.map.queryRenderedFeatures(null,{layers:[v]});h=g.map((function(e){return e.id}))}var y=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),x=t-y;if(n.getClosest(o,(function(e){var t=e.lonlat;if(t[0]===s)return 1/0;if(m&&-1===h.indexOf(e.i+1))return 1/0;var n=i.modHalf(t[0],360),a=t[1],o=p.project([n,a]),l=o.x-f.c2p([x,a]),u=o.y-d.c2p([n,r]),c=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-c,1-3/c)}),e),!1!==e.index){var b=o[e.index],_=b.lonlat,w=[i.modHalf(_[0],360)+y,_[1]],k=f.c2p(w),T=d.c2p(w),M=b.mrc||1;e.x0=k-M,e.x1=k+M,e.y0=T-M,e.y1=T+M;var S={};S[c.subplot]={_subplot:p};var A=c._module.formatLabels(b,c,S);return e.lonLabel=A.lonLabel,e.latLabel=A.latLabel,e.color=a(c,b),e.extraText=u(c,b,o[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}},getExtraText:u}},20467:function(e,t,r){"use strict";e.exports={attributes:r(99181),supplyDefaults:r(76645),colorbar:r(4898),formatLabels:r(15636),calc:r(84622),plot:r(86951),hoverPoints:r(28178).hoverPoints,eventData:r(53353),selectPoints:r(86387),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.update(t)},moduleType:"trace",name:"scattermapbox",basePlotModule:r(50101),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},86951:function(e,t,r){"use strict";var n=r(71828),i=r(15790),a=r(77734).traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(e,t,r,n){this.type="scattermapbox",this.subplot=e,this.uid=t,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+t+"-fill",line:"source-"+t+"-line",circle:"source-"+t+"-circle",symbol:"source-"+t+"-symbol",cluster:"source-"+t+"-circle",clusterCount:"source-"+t+"-circle"},this.layerIds={fill:a+t+"-fill",line:a+t+"-line",circle:a+t+"-circle",symbol:a+t+"-symbol",cluster:a+t+"-cluster",clusterCount:a+t+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(e,t,r){var i={type:"geojson",data:t.geojson};r&&r.enabled&&n.extendFlat(i,{cluster:!0,clusterMaxZoom:r.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[e]);a?a.setData(t.geojson):this.subplot.map.addSource(this.sourceIds[e],i)},l.setSourceData=function(e,t){this.subplot.map.getSource(this.sourceIds[e]).setData(t.geojson)},l.addLayer=function(e,t,r){var n={type:t.type,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint};t.filter&&(n.filter=t.filter);for(var i,a=this.layerIds[e],o=this.subplot.getMapLayers(),s=0;s=0;r--){var i=t[r];n.removeLayer(c.layerIds[i])}e||n.removeSource(c.sourceIds.circle)}(e):function(e){for(var t=o.nonCluster,r=t.length-1;r>=0;r--){var i=t[r];n.removeLayer(c.layerIds[i]),e||n.removeSource(c.sourceIds[i])}}(e)}function d(e){l?function(e){e||c.addSource("circle",a.circle,t.cluster);for(var r=o.cluster,n=0;n=0;r--){var n=t[r];e.removeLayer(this.layerIds[n]),e.removeSource(this.sourceIds[n])}},e.exports=function(e,t){var r,n,a,l=t[0].trace,u=l.cluster&&l.cluster.enabled,c=!0!==l.visible,f=new s(e,l.uid,u,c),d=i(e.gd,t),p=f.below=e.belowLookup["trace-"+l.uid];if(u)for(f.addSource("circle",d.circle,l.cluster),r=0;r")}}e.exports={hoverPoints:function(e,t,r,a){var o=n(e,t,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(u,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}},91271:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:r(23580),categories:["polar","symbols","showLegend","scatter-like"],attributes:r(81245),supplyDefaults:r(22184).supplyDefaults,colorbar:r(4898),formatLabels:r(98608),calc:r(26442),plot:r(45162),style:r(16296).style,styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(59150).hoverPoints,selectPoints:r(98002),meta:{}}},45162:function(e,t,r){"use strict";var n=r(32663),i=r(50606).BADNUM;e.exports=function(e,t,r){for(var a=t.layers.frontplot.select("g.scatterlayer"),o=t.xaxis,s=t.yaxis,l={xaxis:o,yaxis:s,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},u=t.radialAxis,c=t.angularAxis,f=0;f=u&&(y.marker.cluster=h.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=_),y.line&&_.length>1&&l.extendFlat(y.line,s.linePositions(e,p,_)),y.text&&(l.extendFlat(y.text,{positions:_},s.textPosition(e,p,y.text,y.marker)),l.extendFlat(y.textSel,{positions:_},s.textPosition(e,p,y.text,y.markerSel)),l.extendFlat(y.textUnsel,{positions:_},s.textPosition(e,p,y.text,y.markerUnsel))),y.fill&&!d.fill2d&&(d.fill2d=!0),y.marker&&!d.scatter2d&&(d.scatter2d=!0),y.line&&!d.line2d&&(d.line2d=!0),y.text&&!d.glText&&(d.glText=!0),d.lineOptions.push(y.line),d.fillOptions.push(y.fill),d.markerOptions.push(y.marker),d.markerSelectedOptions.push(y.markerSel),d.markerUnselectedOptions.push(y.markerUnsel),d.textOptions.push(y.text),d.textSelectedOptions.push(y.textSel),d.textUnselectedOptions.push(y.textUnsel),d.selectBatch.push([]),d.unselectBatch.push([]),h.x=w,h.y=k,h.rawx=w,h.rawy=k,h.r=m,h.theta=g,h.positions=_,h._scene=d,h.index=d.count,d.count++}})),a(e,t,r)}},e.exports.reglPrecompiled={}},48300:function(e,t,r){"use strict";var n=r(5386).fF,i=r(5386).si,a=r(1426).extendFlat,o=r(82196),s=r(9012),l=o.line;e.exports={mode:o.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:i({editType:"plot"},{keys:["real","imag","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:a({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:a({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:a({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o.fillcolor,hoverinfo:a({},s.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:o.hoveron,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},30621:function(e,t,r){"use strict";var n=r(92770),i=r(50606).BADNUM,a=r(36922),o=r(75225),s=r(66279),l=r(47761).calcMarkerSize;e.exports=function(e,t){for(var r=e._fullLayout,u=t.subplot,c=r[u].realaxis,f=r[u].imaginaryaxis,d=c.makeCalcdata(t,"real"),p=f.makeCalcdata(t,"imag"),h=t._length,v=new Array(h),m=0;m")}}e.exports={hoverPoints:function(e,t,r,a){var o=n(e,t,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(u,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}},85956:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:r(7504),categories:["smith","symbols","showLegend","scatter-like"],attributes:r(48300),supplyDefaults:r(65269),colorbar:r(4898),formatLabels:r(62047),calc:r(30621),plot:r(12480),style:r(16296).style,styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(11350).hoverPoints,selectPoints:r(98002),meta:{}}},12480:function(e,t,r){"use strict";var n=r(32663),i=r(50606).BADNUM,a=r(23893).smith;e.exports=function(e,t,r){for(var o=t.layers.frontplot.select("g.scatterlayer"),s=t.xaxis,l=t.yaxis,u={xaxis:s,yaxis:l,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},c=0;c"),o.hovertemplate=d.hovertemplate,a}function x(e,t){g.push(e._hovertitle+": "+t)}}},52979:function(e,t,r){"use strict";e.exports={attributes:r(50413),supplyDefaults:r(46008),colorbar:r(4898),formatLabels:r(93645),calc:r(54337),plot:r(7507),style:r(16296).style,styleOnSelect:r(16296).styleOnSelect,hoverPoints:r(47250),selectPoints:r(98002),eventData:r(4524),moduleType:"trace",name:"scatterternary",basePlotModule:r(61639),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},7507:function(e,t,r){"use strict";var n=r(32663);e.exports=function(e,t,r){var i=t.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=t.xaxis,o=t.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},l=t.layers.frontplot.select("g.scatterlayer"),u=0;ud?b.sizeAvg||Math.max(b.size,3):a(t,x),p=0;pa&&l||i-1,L=!0;if(o(x)||p.selectedpoints||P){var I=p._length;if(p.selectedpoints){v.selectBatch=p.selectedpoints;var R=p.selectedpoints,O={};for(l=0;l1&&(c=v[y-1],d=m[y-1],h=g[y-1]),t=0;tc?"-":"+")+"x")).replace("y",(f>d?"-":"+")+"y")).replace("z",(p>h?"-":"+")+"z");var E=function(){y=0,S=[],A=[],C=[]};(!y||y2?e.slice(1,t-1):2===t?[(e[0]+e[1])/2]:e}function p(e){var t=e.length;return 1===t?[.5,.5]:[e[1]-e[0],e[t-1]-e[t-2]]}function h(e,t){var r=e.fullSceneLayout,i=e.dataScale,c=t._len,f={};function h(e,t){var n=r[t],o=i[u[t]];return a.simpleMap(e,(function(e){return n.d2l(e)*o}))}if(f.vectors=l(h(t._u,"xaxis"),h(t._v,"yaxis"),h(t._w,"zaxis"),c),!c)return{positions:[],cells:[]};var v=h(t._Xs,"xaxis"),m=h(t._Ys,"yaxis"),g=h(t._Zs,"zaxis");if(f.meshgrid=[v,m,g],f.gridFill=t._gridFill,t._slen)f.startingPositions=l(h(t._startsX,"xaxis"),h(t._startsY,"yaxis"),h(t._startsZ,"zaxis"));else{for(var y=m[0],x=d(v),b=d(g),_=new Array(x.length*b.length),w=0,k=0;k=0};y?(r=Math.min(g.length,b.length),l=function(e){return S(g[e])&&A(e)},f=function(e){return String(g[e])}):(r=Math.min(x.length,b.length),l=function(e){return S(x[e])&&A(e)},f=function(e){return String(x[e])}),w&&(r=Math.min(r,_.length));for(var C=0;C1){for(var I=a.randstr(),R=0;R=0){t.i=s.i;var c=r.marker;c.pattern&&c.colors&&c.pattern.shape||(c.color=u,t.color=u),n.pointStyle(e,r,a,t)}else i.fill(e,u)}},83523:function(e,t,r){"use strict";var n=r(39898),i=r(73972),a=r(23469).appendArrayPointValue,o=r(30211),s=r(71828),l=r(11086),u=r(2791),c=r(53581).formatPieValue;function f(e,t,r){for(var n=e.data.data,i={curveNumber:t.index,pointNumber:n.i,data:t._input,fullData:t},o=0;o"),name:M||O("name")?y.name:void 0,color:T("hoverlabel.bgcolor")||x.color,borderColor:T("hoverlabel.bordercolor"),fontFamily:T("hoverlabel.font.family"),fontSize:T("hoverlabel.font.size"),fontColor:T("hoverlabel.font.color"),nameLength:T("hoverlabel.namelength"),textAlign:T("hoverlabel.align"),hovertemplate:M,hovertemplateLabels:L,eventData:l};m&&(F.x0=C-i.rInscribed*i.rpx1,F.x1=C+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),g&&(F.x=C,F.idealAlign=C<0?"left":"right");var j=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:j}),l[0].bbox=j[0],h._hasHoverLabel=!0}if(g){var N=e.select("path.surface");d.styleOne(N,i,y,r,{hovered:!0})}h._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[f(i,y,d.eventDataKeys)],event:n.event})}})),e.on("mouseout",(function(t){var i=r._fullLayout,a=r._fullData[h.index],s=n.select(this).datum();if(h._hasHoverEvent&&(t.originalEvent=n.event,r.emit("plotly_unhover",{points:[f(s,a,d.eventDataKeys)],event:n.event}),h._hasHoverEvent=!1),h._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),h._hasHoverLabel=!1),g){var l=e.select("path.surface");d.styleOne(l,s,a,r,{hovered:!1})}})),e.on("click",(function(e){var t=r._fullLayout,a=r._fullData[h.index],s=m&&(u.isHierarchyRoot(e)||u.isLeaf(e)),c=u.getPtId(e),p=u.isEntry(e)?u.findEntryWithChild(v,c):u.findEntryWithLevel(v,c),g=u.getPtId(p),y={points:[f(e,a,d.eventDataKeys)],event:n.event};s||(y.nextLevel=g);var x=l.triggerHandler(r,"plotly_"+h.type+"click",y);if(!1!==x&&t.hovermode&&(r._hoverdata=[f(e,a,d.eventDataKeys)],o.click(r,n.event)),!s&&!1!==x&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,t._tracePreGUI[a.uid],{level:a.level});var b={data:[{level:g}],traces:[h.index]},_={frame:{redraw:!1,duration:d.transitionTime},transition:{duration:d.transitionTime,easing:d.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(t._hoverlayer.node()),i.call("animate",r,b,_)}}))}},2791:function(e,t,r){"use strict";var n=r(71828),i=r(7901),a=r(6964),o=r(53581);function s(e){return e.data.data.pid}t.findEntryWithLevel=function(e,r){var n;return r&&e.eachAfter((function(e){if(t.getPtId(e)===r)return n=e.copy()})),n||e},t.findEntryWithChild=function(e,r){var n;return e.eachAfter((function(e){for(var i=e.children||[],a=0;a0)},t.getMaxDepth=function(e){return e.maxdepth>=0?e.maxdepth:1/0},t.isHeader=function(e,r){return!(t.isLeaf(e)||e.depth===r._maxDepth-1)},t.getParent=function(e,r){return t.findEntryWithLevel(e,s(r))},t.listPath=function(e,r){var n=e.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return t.listPath(n,r).concat(i)},t.getPath=function(e){return t.listPath(e,"label").join("/")+"/"},t.formatValue=o.formatPieValue,t.formatPercent=function(e,t){var r=n.formatPercent(e,0);return"0%"===r&&(r=o.formatPiePercent(e,t)),r}},87619:function(e,t,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:r(66888),categories:[],animatable:!0,attributes:r(57564),layoutAttributes:r(2654),supplyDefaults:r(17094),supplyLayoutDefaults:r(57034),calc:r(52147).calc,crossTraceCalc:r(52147).crossTraceCalc,plot:r(24714).plot,style:r(29969).style,colorbar:r(4898),meta:{}}},2654:function(e){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},57034:function(e,t,r){"use strict";var n=r(71828),i=r(2654);e.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("sunburstcolorway",t.colorway),r("extendsunburstcolors")}},24714:function(e,t,r){"use strict";var n=r(39898),i=r(674),a=r(81684).sX,o=r(91424),s=r(71828),l=r(63893),u=r(72597),c=u.recordMinTextSize,f=u.clearMinTextSize,d=r(14575),p=r(53581).getRotationAngle,h=d.computeTransform,v=d.transformInsideText,m=r(29969).styleOne,g=r(16688).resizeText,y=r(83523),x=r(7055),b=r(2791);function _(e,r,u,f){var d=e._context.staticPlot,g=e._fullLayout,_=!g.uniformtext.mode&&b.hasTransition(f),k=n.select(u).selectAll("g.slice"),T=r[0],M=T.trace,S=T.hierarchy,A=b.findEntryWithLevel(S,M.level),C=b.getMaxDepth(M),E=g._size,P=M.domain,L=E.w*(P.x[1]-P.x[0]),I=E.h*(P.y[1]-P.y[0]),R=.5*Math.min(L,I),O=T.cx=E.l+E.w*(P.x[1]+P.x[0])/2,D=T.cy=E.t+E.h*(1-P.y[0])-I/2;if(!A)return k.remove();var z=null,F={};_&&k.each((function(e){F[b.getPtId(e)]={rpx0:e.rpx0,rpx1:e.rpx1,x0:e.x0,x1:e.x1,transform:e.transform},!z&&b.isEntry(e)&&(z=e)}));var j=function(e){return i.partition().size([2*Math.PI,e.height+1])(e)}(A).descendants(),N=A.height+1,Z=0,B=C;T.hasMultipleRoots&&b.isHierarchyRoot(A)&&(j=j.slice(1),N-=1,Z=1,B+=1),j=j.filter((function(e){return e.y1<=B}));var V=p(M.rotation);V&&j.forEach((function(e){e.x0+=V,e.x1+=V}));var U=Math.min(N,C),H=function(e){return(e-Z)/U*R},W=function(e,t){return[e*Math.cos(t),-e*Math.sin(t)]},G=function(e){return s.pathAnnulus(e.rpx0,e.rpx1,e.x0,e.x1,O,D)},q=function(e){return O+w(e)[0]*(e.transform.rCenter||0)+(e.transform.x||0)},Y=function(e){return D+w(e)[1]*(e.transform.rCenter||0)+(e.transform.y||0)};(k=k.data(j,b.getPtId)).enter().append("g").classed("slice",!0),_?k.exit().transition().each((function(){var e=n.select(this);e.select("path.surface").transition().attrTween("d",(function(e){var t=function(e){var t,r=b.getPtId(e),n=F[r],i=F[b.getPtId(A)];if(i){var o=(e.x1>i.x1?2*Math.PI:0)+V;t=e.rpx1X?2*Math.PI:0)+V;t={x0:i,x1:i}}else t={rpx0:R,rpx1:R},s.extendFlat(t,J(e));else t={rpx0:0,rpx1:0};else t={x0:V,x1:V};return a(t,n)}(e);return function(e){return G(t(e))}})):f.attr("d",G),u.call(y,A,e,r,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,e,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:e._transitioning}),f.call(m,i,M,e);var p=s.ensureSingle(u,"g","slicetext"),w=s.ensureSingle(p,"text","",(function(e){e.attr("data-notex",1)})),k=s.ensureUniformFontSize(e,b.determineTextFont(M,i,g.font));w.text(t.formatSliceLabel(i,A,M,r,g)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,k).call(l.convertToTspans,e);var S=o.bBox(w.node());i.transform=v(S,i,T),i.transform.targetX=q(i),i.transform.targetY=Y(i);var C=function(e,t){var r=e.transform;return h(r,t),r.fontSize=k.size,c(M.type,r,g),s.getTextTransform(r)};_?w.transition().attrTween("transform",(function(e){var t=function(e){var t,r=F[b.getPtId(e)],n=e.transform;if(r)t=r;else if(t={rpx1:e.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},z)if(e.parent)if(X){var i=e.x1>X?2*Math.PI:0;t.x0=t.x1=i}else s.extendFlat(t,J(e));else t.x0=t.x1=V;else t.x0=t.x1=V;var o=a(t.transform.textPosAngle,e.transform.textPosAngle),l=a(t.rpx1,e.rpx1),u=a(t.x0,e.x0),f=a(t.x1,e.x1),d=a(t.transform.scale,n.scale),p=a(t.transform.rotate,n.rotate),h=0===n.rCenter?3:0===t.transform.rCenter?1/3:1,v=a(t.transform.rCenter,n.rCenter),m=function(e){return v(Math.pow(e,h))};return function(e){var t=l(e),r=u(e),i=f(e),a=m(e),s={pxmid:W(t,(r+i)/2),rpx1:t,transform:{textPosAngle:o(e),rCenter:a,x:n.x,y:n.y}};return c(M.type,n,g),{transform:{targetX:q(s),targetY:Y(s),scale:d(e),rotate:p(e),rCenter:a}}}}(e);return function(e){return C(t(e),S)}})):w.attr("transform",C(i,S))}))}function w(e){return t=e.rpx1,r=e.transform.textPosAngle,[t*Math.sin(r),-t*Math.cos(r)];var t,r}t.plot=function(e,t,r,i){var a,o,s=e._fullLayout,l=s._sunburstlayer,u=!r,c=!s.uniformtext.mode&&b.hasTransition(r);f("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),c?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(t){_(e,t,this,r)}))}))):(a.each((function(t){_(e,t,this,r)})),s.uniformtext.mode&&g(e,s._sunburstlayer.selectAll(".trace"),"sunburst")),u&&a.exit().remove()},t.formatSliceLabel=function(e,t,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!a&&(!o||"none"===o))return"";var l=i.separators,u=n[0],c=e.data.data,f=u.hierarchy,d=b.isHierarchyRoot(e),p=b.getParent(f,e),h=b.getValue(e);if(!a){var v,m=o.split("+"),g=function(e){return-1!==m.indexOf(e)},y=[];if(g("label")&&c.label&&y.push(c.label),c.hasOwnProperty("v")&&g("value")&&y.push(b.formatValue(c.v,l)),!d){g("current path")&&y.push(b.getPath(e.data));var x=0;g("percent parent")&&x++,g("percent entry")&&x++,g("percent root")&&x++;var _=x>1;if(x){var w,k=function(e){v=b.formatPercent(w,l),_&&(v+=" of "+e),y.push(v)};g("percent parent")&&!d&&(w=h/b.getValue(p),k("parent")),g("percent entry")&&(w=h/b.getValue(t),k("entry")),g("percent root")&&(w=h/b.getValue(f),k("root"))}}return g("text")&&(v=s.castOption(r,c.i,"text"),s.isValidTextValue(v)&&y.push(v)),y.join("
")}var T=s.castOption(r,c.i,"texttemplate");if(!T)return"";var M={};c.label&&(M.label=c.label),c.hasOwnProperty("v")&&(M.value=c.v,M.valueLabel=b.formatValue(c.v,l)),M.currentPath=b.getPath(e.data),d||(M.percentParent=h/b.getValue(p),M.percentParentLabel=b.formatPercent(M.percentParent,l),M.parent=b.getPtLabel(p)),M.percentEntry=h/b.getValue(t),M.percentEntryLabel=b.formatPercent(M.percentEntry,l),M.entry=b.getPtLabel(t),M.percentRoot=h/b.getValue(f),M.percentRootLabel=b.formatPercent(M.percentRoot,l),M.root=b.getPtLabel(f),c.hasOwnProperty("color")&&(M.color=c.color);var S=s.castOption(r,c.i,"text");return(s.isValidTextValue(S)||""===S)&&(M.text=S),M.customdata=s.castOption(r,c.i,"customdata"),s.texttemplateString(T,M,i._d3locale,M,r._meta||{})}},29969:function(e,t,r){"use strict";var n=r(39898),i=r(7901),a=r(71828),o=r(72597).resizeText,s=r(43467);function l(e,t,r,n){var o=t.data.data,l=!t.children,u=o.i,c=a.castOption(r,u,"marker.line.color")||i.defaultLine,f=a.castOption(r,u,"marker.line.width")||0;e.call(s,t,r,n).style("stroke-width",f).call(i.stroke,c).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(e){var t=e._fullLayout._sunburstlayer.selectAll(".trace");o(e,t,"sunburst"),t.each((function(t){var r=n.select(this),i=t[0].trace;r.style("opacity",i.opacity),r.selectAll("path.surface").each((function(t){n.select(this).call(l,t,i,e)}))}))},styleOne:l}},54532:function(e,t,r){"use strict";var n=r(7901),i=r(50693),a=r(12663).axisHoverFormat,o=r(5386).fF,s=r(9012),l=r(1426).extendFlat,u=r(30962).overrideAll;function c(e){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var f=e.exports=u(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");f.x.editType=f.y.editType=f.z.editType="calc+clearAxisTypes",f.transforms=void 0},18396:function(e,t,r){"use strict";var n=r(78803);e.exports=function(e,t){t.surfacecolor?n(e,t,{vals:t.surfacecolor,containerStr:"",cLetter:"c"}):n(e,t,{vals:t.z,containerStr:"",cLetter:"c"})}},43768:function(e,t,r){"use strict";var n=r(9330).gl_surface3d,i=r(9330).ndarray,a=r(9330).ndarray_linear_interpolate.d2,o=r(824),s=r(43907),l=r(71828).isArrayOrTypedArray,u=r(81697).parseColorScale,c=r(78614),f=r(21081).extractOpts;function d(e,t,r){this.scene=e,this.uid=r,this.surface=t,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var p=d.prototype;p.getXat=function(e,t,r,n){var i=l(this.data.x)?l(this.data.x[0])?this.data.x[t][e]:this.data.x[e]:e;return void 0===r?i:n.d2l(i,0,r)},p.getYat=function(e,t,r,n){var i=l(this.data.y)?l(this.data.y[0])?this.data.y[t][e]:this.data.y[t]:t;return void 0===r?i:n.d2l(i,0,r)},p.getZat=function(e,t,r,n){var i=this.data.z[t][e];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[t][e]),void 0===r?i:n.d2l(i,0,r)},p.handlePick=function(e){if(e.object===this.surface){var t=(e.data.index[0]-1)/this.dataScaleX-1,r=(e.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(t),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);e.index=[n,i],e.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],e.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=e.dataCoordinate[a];null!==o&&void 0!==o&&(e.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[i]&&void 0!==s[i][n]?e.textLabel=s[i][n]:e.textLabel=s||"",e.data.dataCoordinate=e.dataCoordinate.slice(),this.surface.highlight(e.data),this.scene.glplot.spikes.position=e.dataCoordinate,!0}};var h=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function v(e,t){if(e0){r=h[n];break}return r}function y(e,t){if(!(e<1||t<1)){for(var r=m(e),n=m(t),i=1,a=0;a_;)r--,r/=g(r),++r1?n:1},p.refineCoords=function(e){for(var t=this.dataScaleX,r=this.dataScaleY,n=e[0].shape[0],a=e[0].shape[1],o=0|Math.floor(e[0].shape[0]*t+1),s=0|Math.floor(e[0].shape[1]*r+1),l=1+n+1,u=1+a+1,c=i(new Float32Array(l*u),[l,u]),f=[1/t,0,0,0,1/r,0,0,0,1],d=0;d0&&null!==this.contourStart[e]&&null!==this.contourEnd[e]&&this.contourEnd[e]>this.contourStart[e]))for(i[e]=!0,t=this.contourStart[e];ta&&(this.minValues[t]=a),this.maxValues[t]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},51018:function(e,t,r){"use strict";var n=r(49850),i=r(1426).extendFlat,a=r(92770);function o(e){if(Array.isArray(e)){for(var t=0,r=0;r=t||u===e.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=u,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=u+1,a=0);return n}e.exports=function(e,t){var r=l(t.cells.values),p=function(e){return e.slice(t.header.values.length,e.length)},h=l(t.header.values);h.length&&!h[0].length&&(h[0]=[""],h=l(h));var v=h.concat(p(r).map((function(){return u((h[0]||[""]).length)}))),m=t.domain,g=Math.floor(e._fullLayout._size.w*(m.x[1]-m.x[0])),y=Math.floor(e._fullLayout._size.h*(m.y[1]-m.y[0])),x=t.header.values.length?v[0].map((function(){return t.header.height})):[n.emptyHeaderHeight],b=r.length?r[0].map((function(){return t.cells.height})):[],_=x.reduce(s,0),w=d(b,y-_+n.uplift),k=f(d(x,_),[]),T=f(w,k),M={},S=t._fullInput.columnorder.concat(p(r.map((function(e,t){return t})))),A=v.map((function(e,r){var n=Array.isArray(t.columnwidth)?t.columnwidth[Math.min(r,t.columnwidth.length-1)]:t.columnwidth;return a(n)?Number(n):1})),C=A.reduce(s,0);A=A.map((function(e){return e/C*g}));var E=Math.max(o(t.header.line.width),o(t.cells.line.width)),P={key:t.uid+e._context.staticPlot,translateX:m.x[0]*e._fullLayout._size.w,translateY:e._fullLayout._size.h*(1-m.y[1]),size:e._fullLayout._size,width:g,maxLineWidth:E,height:y,columnOrder:S,groupHeight:y,rowBlocks:T,headerRowBlocks:k,scrollY:0,cells:i({},t.cells,{values:r}),headerCells:i({},t.header,{values:v}),gdColumns:v.map((function(e){return e[0]})),gdColumnsOriginalOrder:v.map((function(e){return e[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:v.map((function(e,t){var r=M[e];return M[e]=(r||0)+1,{key:e+"__"+M[e],label:e,specIndex:t,xIndex:S[t],xScale:c,x:void 0,calcdata:void 0,columnWidth:A[t]}}))};return P.columns.forEach((function(e){e.calcdata=P,e.x=c(e)})),P}},56269:function(e,t,r){"use strict";var n=r(1426).extendFlat;t.splitToPanels=function(e){var t=[0,0],r=n({},e,{key:"header",type:"header",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!0,values:e.calcdata.headerCells.values[e.specIndex],rowBlocks:e.calcdata.headerRowBlocks,calcdata:n({},e.calcdata,{cells:e.calcdata.headerCells})});return[n({},e,{key:"cells1",type:"cells",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),n({},e,{key:"cells2",type:"cells",page:1,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),r]},t.splitToCells=function(e){var t=function(e){var t=e.rowBlocks[e.page],r=t?t.rows[0].rowIndex:0,n=t?r+t.rows.length:0;return[r,n]}(e);return(e.values||[]).slice(t[0],t[1]).map((function(r,n){return{keyWithinBlock:n+("string"===typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:t[0]+n,column:e,calcdata:e.calcdata,page:e.page,rowBlocks:e.rowBlocks,value:r}}))}},39754:function(e,t,r){"use strict";var n=r(71828),i=r(44464),a=r(27670).c;e.exports=function(e,t,r,o){function s(r,a){return n.coerce(e,t,i,r,a)}a(t,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(e,t){for(var r=e.columnorder||[],n=e.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(e,t){return e-t})),o=i.map((function(e){return a.indexOf(e)})),s=o.length;s/i),l=!o||s;e.mayHaveMarkup=o&&i.match(/[<&>]/);var u,c="string"===typeof(u=i)&&u.match(n.latexCheck);e.latex=c;var f,d,p=c?"":k(e.calcdata.cells.prefix,t,r)||"",h=c?"":k(e.calcdata.cells.suffix,t,r)||"",v=c?null:k(e.calcdata.cells.format,t,r)||null,m=p+(v?a(v)(e.value):e.value)+h;if(e.wrappingNeeded=!e.wrapped&&!l&&!c&&(f=w(m)),e.cellHeightMayIncrease=s||c||e.mayHaveMarkup||(void 0===f?w(m):f),e.needsConvertToTspans=e.mayHaveMarkup||e.wrappingNeeded||e.latex,e.wrappingNeeded){var g=(" "===n.wrapSplitCharacter?m.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===u.length&&(u[0]===i.length-1?u.unshift(u[0]-1):u.push(u[0]+1)),u[0]%2&&u.reverse(),t.each((function(e,t){e.page=u[t],e.scrollY=l})),t.attr("transform",(function(e){var t=D(e.rowBlocks,e.page)-e.scrollY;return c(0,t)})),e&&(P(e,r,t,u,n.prevPages,n,0),P(e,r,t,u,n.prevPages,n,1),x(r,e))}}function E(e,t,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=t.filter((function(e){return s.key===e.key})),u=r||s.scrollbarState.dragMultiplier,c=s.scrollY;s.scrollY=void 0===a?s.scrollY+u*i.event.dy:a;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(M);return C(e,f,l),s.scrollY===c}}function P(e,t,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(e,t){return t===o&&n[t]!==i[t]}));b(e,t,a,r),i[o]=n[o]})))}function L(e,t,r,a){return function(){var o=i.select(t.parentNode);o.each((function(e){var t=e.fragments;o.selectAll("tspan.line").each((function(e,r){t[r].width=this.getComputedTextLength()}));var r,i,a=t[t.length-1].width,s=t.slice(0,-1),l=[],u=0,c=e.column.columnWidth-2*n.cellPad;for(e.value="";s.length;)u+(i=(r=s.shift()).width+a)>c&&(e.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],u=0),l.push(r.text),u+=i;u&&(e.value+=l.join(n.wrapSpacer)),e.wrapped=!0})),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,e,a),i.select(t.parentNode.parentNode).call(O)}}function I(e,t,r,a,o){return function(){if(!o.settledY){var s=i.select(t.parentNode),l=j(o),u=o.key-l.firstRowIndex,f=l.rows[u].rowHeight,d=o.cellHeightMayIncrease?t.parentNode.getBoundingClientRect().height+2*n.cellPad:f,p=Math.max(d,f);p-l.rows[u].rowHeight&&(l.rows[u].rowHeight=p,e.selectAll("."+n.cn.columnCell).call(O),C(null,e.filter(M),0),x(r,a,!0)),s.attr("transform",(function(){var e=this,t=e.parentNode.getBoundingClientRect(),r=i.select(e.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),a=e.transform.baseVal.consolidate(),s=r.top-t.top+(a?a.matrix.f:n.cellPad);return c(R(o,i.select(e.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function R(e,t){switch(e.align){case"left":default:return n.cellPad;case"right":return e.column.columnWidth-(t||0)-n.cellPad;case"center":return(e.column.columnWidth-(t||0))/2}}function O(e){e.attr("transform",(function(e){var t=e.rowBlocks[0].auxiliaryBlocks.reduce((function(e,t){return e+z(t,1/0)}),0),r=z(j(e),e.key);return c(0,r+t)})).selectAll("."+n.cn.cellRect).attr("height",(function(e){return(t=j(e),r=e.key,t.rows[r-t.firstRowIndex]).rowHeight;var t,r}))}function D(e,t){for(var r=0,n=t-1;n>=0;n--)r+=F(e[n]);return r}function z(e,t){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:u.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},78018:function(e,t,r){"use strict";var n=r(74875);t.name="treemap",t.plot=function(e,r,i,a){n.plotBasePlot(t.name,e,r,i,a)},t.clean=function(e,r,i,a){n.cleanBasePlot(t.name,e,r,i,a)}},65039:function(e,t,r){"use strict";var n=r(52147);t.y=function(e,t){return n.calc(e,t)},t.T=function(e){return n._runCrossTraceCalc("treemap",e)}},43473:function(e){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},91174:function(e,t,r){"use strict";var n=r(71828),i=r(45802),a=r(7901),o=r(27670).c,s=r(90769).handleText,l=r(97313).TEXTPAD,u=r(37434).handleMarkerDefaults,c=r(21081),f=c.hasColorscale,d=c.handleDefaults;e.exports=function(e,t,r,c){function p(r,a){return n.coerce(e,t,i,r,a)}var h=p("labels"),v=p("parents");if(h&&h.length&&v&&v.length){var m=p("values");m&&m.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var g=p("text");p("texttemplate"),t.texttemplate||p("textinfo",Array.isArray(g)?"text+label":"label"),p("hovertext"),p("hovertemplate");var y=p("pathbar.visible");s(e,t,c,p,"auto",{hasPathbar:y,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var x=-1!==t.textposition.indexOf("bottom");u(e,t,c,p),(t._hasColorscale=f(e,"marker","colors")||(e.marker||{}).coloraxis)?d(e,t,c,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(t.marker.colors||[]).length);var b=2*t.textfont.size;p("marker.pad.t",x?b/4:b),p("marker.pad.l",b/4),p("marker.pad.r",b/4),p("marker.pad.b",x?b:b/4),p("marker.cornerradius"),t._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},y&&(p("pathbar.thickness",t.pathbar.textfont.size+2*l),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),o(t,c,p),t._length=null}else t.visible=!1}},80694:function(e,t,r){"use strict";var n=r(39898),i=r(2791),a=r(72597).clearMinTextSize,o=r(16688).resizeText,s=r(46650);e.exports=function(e,t,r,l,u){var c,f,d=u.type,p=u.drawDescendants,h=e._fullLayout,v=h["_"+d+"layer"],m=!r;a(d,h),(c=v.selectAll("g.trace."+d).data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(d,!0),c.order(),!h.uniformtext.mode&&i.hasTransition(r)?(l&&(f=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){v.selectAll("g.trace").each((function(t){s(e,t,this,r,p)}))}))):(c.each((function(t){s(e,t,this,r,p)})),h.uniformtext.mode&&o(e,v.selectAll(".trace"),d)),m&&c.exit().remove()}},66209:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=r(91424),o=r(63893),s=r(37210),l=r(96362).styleOne,u=r(43473),c=r(2791),f=r(83523),d=!0;e.exports=function(e,t,r,p,h){var v=h.barDifY,m=h.width,g=h.height,y=h.viewX,x=h.viewY,b=h.pathSlice,_=h.toMoveInsideSlice,w=h.strTransform,k=h.hasTransition,T=h.handleSlicesExit,M=h.makeUpdateSliceInterpolator,S=h.makeUpdateTextInterpolator,A={},C=e._context.staticPlot,E=e._fullLayout,P=t[0],L=P.trace,I=P.hierarchy,R=m/L._entryDepth,O=c.listPath(r.data,"id"),D=s(I.copy(),[m,g],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(D=D.filter((function(e){var t=O.indexOf(e.data.id);return-1!==t&&(e.x0=R*t,e.x1=R*(t+1),e.y0=v,e.y1=v+g,e.onPathbar=!0,!0)}))).reverse(),(p=p.data(D,c.getPtId)).enter().append("g").classed("pathbar",!0),T(p,d,A,[m,g],b),p.order();var z=p;k&&(z=z.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),z.each((function(s){s._x0=y(s.x0),s._x1=y(s.x1),s._y0=x(s.y0),s._y1=x(s.y1),s._hoverX=y(s.x1-Math.min(m,g)/2),s._hoverY=x(s.y1-g/2);var p=n.select(this),h=i.ensureSingle(p,"path","surface",(function(e){e.style("pointer-events",C?"none":"all")}));k?h.transition().attrTween("d",(function(e){var t=M(e,d,A,[m,g]);return function(e){return b(t(e))}})):h.attr("d",b),p.call(f,r,e,t,{styleOne:l,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:e._transitioning}),h.call(l,s,L,e,{hovered:!1}),s._text=(c.getPtLabel(s)||"").split("
").join(" ")||"";var v=i.ensureSingle(p,"g","slicetext"),T=i.ensureSingle(v,"text","",(function(e){e.attr("data-notex",1)})),P=i.ensureUniformFontSize(e,c.determineTextFont(L,s,E.font,{onPathbar:!0}));T.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,P).call(o.convertToTspans,e),s.textBB=a.bBox(T.node()),s.transform=_(s,{fontSize:P.size,onPathbar:!0}),s.transform.fontSize=P.size,k?T.transition().attrTween("transform",(function(e){var t=S(e,d,A,[m,g]);return function(e){return w(t(e))}})):T.attr("transform",w(s))}))}},52583:function(e,t,r){"use strict";var n=r(39898),i=r(71828),a=r(91424),o=r(63893),s=r(37210),l=r(96362).styleOne,u=r(43473),c=r(2791),f=r(83523),d=r(24714).formatSliceLabel,p=!1;e.exports=function(e,t,r,h,v){var m=v.width,g=v.height,y=v.viewX,x=v.viewY,b=v.pathSlice,_=v.toMoveInsideSlice,w=v.strTransform,k=v.hasTransition,T=v.handleSlicesExit,M=v.makeUpdateSliceInterpolator,S=v.makeUpdateTextInterpolator,A=v.prevEntry,C=e._context.staticPlot,E=e._fullLayout,P=t[0].trace,L=-1!==P.textposition.indexOf("left"),I=-1!==P.textposition.indexOf("right"),R=-1!==P.textposition.indexOf("bottom"),O=!R&&!P.marker.pad.t||R&&!P.marker.pad.b,D=s(r,[m,g],{packing:P.tiling.packing,squarifyratio:P.tiling.squarifyratio,flipX:P.tiling.flip.indexOf("x")>-1,flipY:P.tiling.flip.indexOf("y")>-1,pad:{inner:P.tiling.pad,top:P.marker.pad.t,left:P.marker.pad.l,right:P.marker.pad.r,bottom:P.marker.pad.b}}).descendants(),z=1/0,F=-1/0;D.forEach((function(e){var t=e.depth;t>=P._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(z=Math.min(z,t),F=Math.max(F,t))})),h=h.data(D,c.getPtId),P._maxVisibleLayers=isFinite(F)?F-z+1:0,h.enter().append("g").classed("slice",!0),T(h,p,{},[m,g],b),h.order();var j=null;if(k&&A){var N=c.getPtId(A);h.each((function(e){null===j&&c.getPtId(e)===N&&(j={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var Z=function(){return j||{x0:0,x1:m,y0:0,y1:g}},B=h;return k&&(B=B.transition().each("end",(function(){var t=n.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),B.each((function(s){var h=c.isHeader(s,P);s._x0=y(s.x0),s._x1=y(s.x1),s._y0=x(s.y0),s._y1=x(s.y1),s._hoverX=y(s.x1-P.marker.pad.r),s._hoverY=x(R?s.y1-P.marker.pad.b/2:s.y0+P.marker.pad.t/2);var v=n.select(this),T=i.ensureSingle(v,"path","surface",(function(e){e.style("pointer-events",C?"none":"all")}));k?T.transition().attrTween("d",(function(e){var t=M(e,p,Z(),[m,g]);return function(e){return b(t(e))}})):T.attr("d",b),v.call(f,r,e,t,{styleOne:l,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),T.call(l,s,P,e,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h?O?"":c.getPtLabel(s)||"":d(s,r,P,t,E)||"";var A=i.ensureSingle(v,"g","slicetext"),D=i.ensureSingle(A,"text","",(function(e){e.attr("data-notex",1)})),z=i.ensureUniformFontSize(e,c.determineTextFont(P,s,E.font));D.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",I?"end":L||h?"start":"middle").call(a.font,z).call(o.convertToTspans,e),s.textBB=a.bBox(D.node()),s.transform=_(s,{fontSize:z.size,isHeader:h}),s.transform.fontSize=z.size,k?D.transition().attrTween("transform",(function(e){var t=S(e,p,Z(),[m,g]);return function(e){return w(t(e))}})):D.attr("transform",w(s))})),j}},14102:function(e){"use strict";e.exports=function e(t,r,n){var i;n.swapXY&&(i=t.x0,t.x0=t.y0,t.y0=i,i=t.x1,t.x1=t.y1,t.y1=i),n.flipX&&(i=t.x0,t.x0=r[0]-t.x1,t.x1=r[0]-i),n.flipY&&(i=t.y0,t.y0=r[1]-t.y1,t.y1=r[1]-i);var a=t.children;if(a)for(var o=0;o-1?P+R:-(I+R):0,D={x0:L,x1:L,y0:O,y1:O+I},z=function(e,t,r){var n=g.tiling.pad,i=function(e){return e-n<=t.x0},a=function(e){return e+n>=t.x1},o=function(e){return e-n<=t.y0},s=function(e){return e+n>=t.y1};return e.x0===t.x0&&e.x1===t.x1&&e.y0===t.y0&&e.y1===t.y1?{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1}:{x0:i(e.x0-n)?0:a(e.x0-n)?r[0]:e.x0,x1:i(e.x1+n)?0:a(e.x1+n)?r[0]:e.x1,y0:o(e.y0-n)?0:s(e.y0-n)?r[1]:e.y0,y1:o(e.y1+n)?0:s(e.y1+n)?r[1]:e.y1}},F=null,j={},N={},Z=null,B=function(e,t){return t?j[d(e)]:N[d(e)]},V=function(e,t,r,n){if(t)return j[d(x)]||D;var i=N[g.level]||r;return function(e){return e.data.depth-b.data.depth=(n-=(y?te:te.r)-s)){var p=(r+n)/2;r=p,n=p}var h;oe?i<(h=a-(y?te:te.b))&&h"===ee?(l.x-=a,u.x-=a,c.x-=a,f.x-=a):"/"===ee?(c.x-=a,f.x-=a,o.x-=a/2,s.x-=a/2):"\\"===ee?(l.x-=a,u.x-=a,o.x-=a/2,s.x-=a/2):"<"===ee&&(o.x-=a,s.x-=a),Q(l),Q(f),Q(o),Q(u),Q(c),Q(s),"M"+$(l.x,l.y)+"L"+$(u.x,u.y)+"L"+$(s.x,s.y)+"L"+$(c.x,c.y)+"L"+$(f.x,f.y)+"L"+$(o.x,o.y)+"Z"},toMoveInsideSlice:se,makeUpdateSliceInterpolator:ue,makeUpdateTextInterpolator:ce,handleSlicesExit:fe,hasTransition:M,strTransform:de}):w.remove()}},96362:function(e,t,r){"use strict";var n=r(39898),i=r(7901),a=r(71828),o=r(2791),s=r(72597).resizeText,l=r(43467);function u(e,t,r,n,s){var u,c,f=(s||{}).hovered,d=t.data.data,p=d.i,h=d.color,v=o.isHierarchyRoot(t),m=1;if(f)u=r._hovered.marker.line.color,c=r._hovered.marker.line.width;else if(v&&h===r.root.color)m=100,u="rgba(0,0,0,0)",c=0;else if(u=a.castOption(r,p,"marker.line.color")||i.defaultLine,c=a.castOption(r,p,"marker.line.width")||0,!r._hasColorscale&&!t.onPathbar){var g=r.marker.depthfade;if(g){var y,x=i.combine(i.addOpacity(r._backgroundColor,.75),h);if(!0===g){var b=o.getMaxDepth(r);y=isFinite(b)?o.isLeaf(t)?0:r._maxVisibleLayers-(t.data.depth-r._entryDepth):t.data.height+1}else y=t.data.depth-r._entryDepth,r._atRootLevel||y++;if(y>0)for(var _=0;_0){var b,_,w,k,T,M=e.xa,S=e.ya;"h"===h.orientation?(T=t,b="y",w=S,_="x",k=M):(T=r,b="x",w=M,_="y",k=S);var A=p[e.index];if(T>=A.span[0]&&T<=A.span[1]){var C=i.extendFlat({},e),E=k.c2p(T,!0),P=s.getKdeValue(A,h,T),L=s.getPositionOnKdePath(A,h,E),I=w._offset,R=w._length;C[b+"0"]=L[0],C[b+"1"]=L[1],C[_+"0"]=C[_+"1"]=E,C[_+"Label"]=_+": "+a.hoverLabelText(k,T,h[_+"hoverformat"])+", "+p[0].t.labels.kde+" "+P.toFixed(3);for(var O=0,D=0;D")),c.color=function(e,t){var r=e[t.dir].marker,n=r.color,a=r.line.color,o=r.line.width;return i(n)?n:i(a)&&o?a:void 0}(d,m),[c]}function T(e){return n(v,e,d[h+"hoverformat"])}}},19990:function(e,t,r){"use strict";e.exports={attributes:r(43037),layoutAttributes:r(13494),supplyDefaults:r(83266).supplyDefaults,crossTraceDefaults:r(83266).crossTraceDefaults,supplyLayoutDefaults:r(5176),calc:r(52752),crossTraceCalc:r(70766),plot:r(30436),style:r(55750).style,hoverPoints:r(61326),eventData:r(58593),selectPoints:r(81974),moduleType:"trace",name:"waterfall",basePlotModule:r(93612),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},13494:function(e){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},5176:function(e,t,r){"use strict";var n=r(71828),i=r(13494);e.exports=function(e,t,r){var a=!1;function o(r,a){return n.coerce(e,t,i,r,a)}for(var s=0;s0&&(m+=d?"M"+f[0]+","+h[1]+"V"+h[0]:"M"+f[1]+","+h[0]+"H"+f[0]),"between"!==p&&(r.isSum||s path").each((function(e){if(!e.isBlank){var t=s[e.dir].marker;n.select(this).call(a.fill,t.color).call(a.stroke,t.line.color).call(i.dashLine,t.line.dash,t.line.width).style("opacity",s.selectedpoints&&!e.selected?o:1)}})),u(r,s,e),r.selectAll(".lines").each((function(){var e=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},82887:function(e,t,r){"use strict";var n=r(89298),i=r(71828),a=r(86281),o=r(79344).p,s=r(50606).BADNUM;t.moduleType="transform",t.name="aggregate";var l=t.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},u=l.aggregations;function c(e,t,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(t,o),u=l.get(),c=function(e,t){var r=e.func,n=t.d2c,a=t.c2d;switch(r){case"count":return f;case"first":return d;case"last":return p;case"sum":return function(e,t){for(var r=0,i=0;ii&&(i=c,o=u)}}return i?a(o):s};case"rms":return function(e,t){for(var r=0,i=0,o=0;o":return function(e){return d(e)>s};case">=":return function(e){return d(e)>=s};case"[]":return function(e){var t=d(e);return t>=s[0]&&t<=s[1]};case"()":return function(e){var t=d(e);return t>s[0]&&t=s[0]&&ts[0]&&t<=s[1]};case"][":return function(e){var t=d(e);return t<=s[0]||t>=s[1]};case")(":return function(e){var t=d(e);return ts[1]};case"](":return function(e){var t=d(e);return t<=s[0]||t>s[1]};case")[":return function(e){var t=d(e);return t=s[1]};case"{}":return function(e){return-1!==s.indexOf(d(e))};case"}{":return function(e){return-1===s.indexOf(d(e))}}}(r,a.getDataToCoordFunc(e,t,s,i),d),x={},b={},_=0;h?(m=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},g=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(m=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},g=function(e,t){var r=x[e.astr][t];e.get().push(r)}),T(m);for(var w=o(t.transforms,r),k=0;k1?"%{group} (%{trace})":"%{group}");var l=e.styles,u=o.styles=[];if(l)for(a=0;ad)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,h.prototype),t}function h(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return g(e)}return v(e,t,r)}function v(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!h.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|_(e,t),n=p(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(te(e,Uint8Array)){var t=new Uint8Array(e);return x(t.buffer,t.byteOffset,t.byteLength)}return y(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(e));if(te(e,ArrayBuffer)||e&&te(e.buffer,ArrayBuffer))return x(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(te(e,SharedArrayBuffer)||e&&te(e.buffer,SharedArrayBuffer)))return x(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return h.from(n,t,r);var i=function(e){if(h.isBuffer(e)){var t=0|b(e.length),r=p(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||re(e.length)?p(0):y(e):"Buffer"===e.type&&Array.isArray(e.data)?y(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return h.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(e))}function m(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function g(e){return m(e),p(e<0?0:0|b(e))}function y(e){for(var t=e.length<0?0:0|b(e.length),r=p(t),n=0;n=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return 0|e}function _(e,t){if(h.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||te(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+l(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return J(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(e).length;default:if(i)return n?-1:J(e).length;t=(""+t).toLowerCase(),i=!0}}function w(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return z(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return L(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function k(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function T(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),re(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=h.from(t,n)),h.isBuffer(t))return 0===t.length?-1:M(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):M(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function M(e,t,r,n,i){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,d=0;di&&(n=i):n=i;var a,o=t.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function L(e,t,r){return 0===t&&r===e.length?u.fromByteArray(e):u.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,u=void 0,c=void 0,f=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128===(192&(l=e[i+1]))&&(f=(31&a)<<6|63&l)>127&&(o=f);break;case 3:l=e[i+1],u=e[i+2],128===(192&l)&&128===(192&u)&&(f=(15&a)<<12|(63&l)<<6|63&u)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=e[i+1],u=e[i+2],c=e[i+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(f=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?(h.isBuffer(a)||(a=h.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!h.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},h.byteLength=_,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},f&&(h.prototype[f]=h.prototype.inspect),h.prototype.compare=function(e,t,r,n,i){if(te(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+l(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(n,i),c=e.slice(t,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return C(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function O(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,a){if(!h.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function Z(e,t,r,n,i){Y(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function B(e,t,r,n,i){Y(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function V(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,i){return t=+t,r>>>=0,i||V(e,0,r,4),c.write(e,t,r,n,23,4),r+4}function H(e,t,r,n,i){return t=+t,r>>>=0,i||V(e,0,r,8),c.write(e,t,r,n,52,8),r+8}h.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||j(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||j(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},h.prototype.readUint8=h.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readBigUInt64LE=ie((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,t>>>=0,r||j(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},h.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},h.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readBigInt64LE=ie((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<>>=0,t||j(e,4,this.length),c.read(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),c.read(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),c.read(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),c.read(this,e,!1,52,8)},h.prototype.writeUintLE=h.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},h.prototype.writeUint8=h.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeBigUInt64LE=ie((function(e){return Z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeBigUInt64BE=ie((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},h.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},h.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},h.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},h.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeBigInt64LE=ie((function(e){return Z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeBigInt64BE=ie((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},h.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},h.prototype.writeDoubleLE=function(e,t,r){return H(this,e,t,!0,r)},h.prototype.writeDoubleBE=function(e,t,r){return H(this,e,t,!1,r)},h.prototype.copy=function(e,t,r,n){if(!h.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function Y(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(r).concat(s),new W.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){X(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,i,a)}function X(e,t){if("number"!==typeof e)throw new W.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw X(e,r),new W.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new W.ERR_BUFFER_OUT_OF_BOUNDS;throw new W.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}G("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),G("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(l(t))}),TypeError),G("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=q(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=q(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var $=/[^+/0-9A-Za-z-_]/g;function J(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Q(e){return u.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function ee(e,t,r,n){var i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function te(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function re(e){return e!==e}var ne=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function ie(e){return"undefined"===typeof BigInt?ae:e}function ae(){throw new Error("BigInt not supported")}},2321:function(e){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});var i=e.ua;if(i||"undefined"===typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"===typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!==typeof i)return!1;var a=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},3910:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=s(e),o=a[0],l=a[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,l)),c=0,f=l>0?o-4:o;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3187:function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,c=-7,f=r?i-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=h,s/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=h,o/=256,u-=8);e[r+p-h]|=128*v}},1152:function(e,t,r){"use strict";e.exports=function(e){var t=(e=e||{}).eye||[0,0,1],r=e.center||[0,0,0],s=e.up||[0,1,0],l=e.distanceLimits||[0,1/0],u=e.mode||"turntable",c=n(),f=i(),d=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,t,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,t,r,s),d.setDistanceLimits(l[0],l[1]),d.lookAt(0,t,r,s),new o({turntable:c,orbit:f,matrix:d},u)};var n=r(3440),i=r(7774),a=r(9298);function o(e,t){this._controllerNames=Object.keys(e),this._controllerList=this._controllerNames.map((function(t){return e[t]})),this._mode=t,this._active=e[t],this._active||(this._mode="turntable",this._active=e.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(e){for(var t=this._controllerList,r=0;r0?u=u.ushln(f):f<0&&(c=c.ushln(-f)),s(u,c)}},234:function(e,t,r){"use strict";var n=r(3218);e.exports=function(e){return Array.isArray(e)&&2===e.length&&n(e[0])&&n(e[1])}},4275:function(e,t,r){"use strict";var n=r(1928);e.exports=function(e){return e.cmp(new n(0))}},9958:function(e,t,r){"use strict";var n=r(4275);e.exports=function(e){var t=e.length,r=e.words,i=0;if(1===t)i=r[0];else if(2===t)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},3218:function(e,t,r){"use strict";r(1928),e.exports=function(e){return e&&"object"===typeof e&&Boolean(e.words)}},5514:function(e,t,r){"use strict";var n=r(1928),i=r(8362);e.exports=function(e){var t=i.exponent(e);return t<52?new n(e):new n(e*Math.pow(2,52-t)).ushln(t-52)}},8524:function(e,t,r){"use strict";var n=r(5514),i=r(4275);e.exports=function(e,t){var r=i(e),a=i(t);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(e=e.neg(),t=t.neg());var o=e.gcd(t);return o.cmpn(1)?[e.div(o),t.div(o)]:[e,t]}},2813:function(e,t,r){"use strict";var n=r(1928);e.exports=function(e){return new n(e)}},3962:function(e,t,r){"use strict";var n=r(8524);e.exports=function(e,t){return n(e[0].mul(t[0]),e[1].mul(t[1]))}},4951:function(e,t,r){"use strict";var n=r(4275);e.exports=function(e){return n(e[0])*n(e[1])}},4354:function(e,t,r){"use strict";var n=r(8524);e.exports=function(e,t){return n(e[0].mul(t[1]).sub(e[1].mul(t[0])),e[1].mul(t[1]))}},7999:function(e,t,r){"use strict";var n=r(9958),i=r(1112);e.exports=function(e){var t=e[0],r=e[1];if(0===t.cmpn(0))return 0;var a=t.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,u=t.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=i(s)+4;return u*(s+(d=n(l.ushln(c).divRound(r)))*Math.pow(2,-c))}var f=r.bitLength()-l.bitLength()+53,d=n(l.ushln(f).divRound(r));return f<1023?u*d*Math.pow(2,-f):u*(d*=Math.pow(2,-1023))*Math.pow(2,1023-f)}},5070:function(e){"use strict";function t(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}e.exports={ge:function(e,r,n,i,a){return o(e,r,n,i,a,t)},gt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},lt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},le:function(e,t,r,n,a){return o(e,t,r,n,a,i)},eq:function(e,t,r,n,i){return o(e,t,r,n,i,a)}}},2288:function(e,t){"use strict";function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},1928:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"===typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(6601).Buffer}catch(M){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=l(e,t,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,d=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=d;p++){var h=u-p|0;c+=(o=(i=0|e.words[h])*(a=0|t.words[p])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=f[e],p=d[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var v=h.modn(p).toString(e);r=(h=h.idivn(p)).isZero()?v+r:c[u-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n("undefined"!==typeof o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===t,u=new e(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,p=0|o[1],h=8191&p,v=p>>>13,m=0|o[2],g=8191&m,y=m>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],k=8191&w,T=w>>>13,M=0|o[5],S=8191&M,A=M>>>13,C=0|o[6],E=8191&C,P=C>>>13,L=0|o[7],I=8191&L,R=L>>>13,O=0|o[8],D=8191&O,z=O>>>13,F=0|o[9],j=8191&F,N=F>>>13,Z=0|s[0],B=8191&Z,V=Z>>>13,U=0|s[1],H=8191&U,W=U>>>13,G=0|s[2],q=8191&G,Y=G>>>13,X=0|s[3],K=8191&X,$=X>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],le=8191&se,ue=se>>>13,ce=0|s[8],fe=8191&ce,de=ce>>>13,pe=0|s[9],he=8191&pe,ve=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(n=Math.imul(f,B))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(d,B)|0))<<13)|0;u=((a=Math.imul(d,V))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(h,B),i=(i=Math.imul(h,V))+Math.imul(v,B)|0,a=Math.imul(v,V);var ge=(u+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,H)|0))<<13)|0;u=((a=a+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,B),i=(i=Math.imul(g,V))+Math.imul(y,B)|0,a=Math.imul(y,V),n=n+Math.imul(h,H)|0,i=(i=i+Math.imul(h,W)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,W)|0;var ye=(u+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,q)|0))<<13)|0;u=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(b,B),i=(i=Math.imul(b,V))+Math.imul(_,B)|0,a=Math.imul(_,V),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,W)|0,n=n+Math.imul(h,q)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(v,q)|0,a=a+Math.imul(v,Y)|0;var xe=(u+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(d,K)|0))<<13)|0;u=((a=a+Math.imul(d,$)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(k,B),i=(i=Math.imul(k,V))+Math.imul(T,B)|0,a=Math.imul(T,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(g,q)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,Y)|0,n=n+Math.imul(h,K)|0,i=(i=i+Math.imul(h,$)|0)+Math.imul(v,K)|0,a=a+Math.imul(v,$)|0;var be=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;u=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(S,B),i=(i=Math.imul(S,V))+Math.imul(A,B)|0,a=Math.imul(A,V),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,W)|0,n=n+Math.imul(b,q)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,$)|0,n=n+Math.imul(h,Q)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,ee)|0;var _e=(u+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,B),i=(i=Math.imul(E,V))+Math.imul(P,B)|0,a=Math.imul(P,V),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(A,H)|0,a=a+Math.imul(A,W)|0,n=n+Math.imul(k,q)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(T,q)|0,a=a+Math.imul(T,Y)|0,n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,ee)|0,n=n+Math.imul(h,re)|0,i=(i=i+Math.imul(h,ne)|0)+Math.imul(v,re)|0,a=a+Math.imul(v,ne)|0;var we=(u+(n=n+Math.imul(f,ae)|0)|0)+((8191&(i=(i=i+Math.imul(f,oe)|0)+Math.imul(d,ae)|0))<<13)|0;u=((a=a+Math.imul(d,oe)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,B),i=(i=Math.imul(I,V))+Math.imul(R,B)|0,a=Math.imul(R,V),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,W)|0,n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(A,q)|0,a=a+Math.imul(A,Y)|0,n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(T,K)|0,a=a+Math.imul(T,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0,n=n+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,oe)|0;var ke=(u+(n=n+Math.imul(f,le)|0)|0)+((8191&(i=(i=i+Math.imul(f,ue)|0)+Math.imul(d,le)|0))<<13)|0;u=((a=a+Math.imul(d,ue)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,B),i=(i=Math.imul(D,V))+Math.imul(z,B)|0,a=Math.imul(z,V),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,W)|0,n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(P,q)|0,a=a+Math.imul(P,Y)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(T,Q)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(g,ae)|0,i=(i=i+Math.imul(g,oe)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(h,le)|0,i=(i=i+Math.imul(h,ue)|0)+Math.imul(v,le)|0,a=a+Math.imul(v,ue)|0;var Te=(u+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(j,B),i=(i=Math.imul(j,V))+Math.imul(N,B)|0,a=Math.imul(N,V),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,W)|0,n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(R,q)|0,a=a+Math.imul(R,Y)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,$)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(g,le)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(y,le)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(v,fe)|0,a=a+Math.imul(v,de)|0;var Me=(u+(n=n+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(d,he)|0))<<13)|0;u=((a=a+Math.imul(d,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(j,H),i=(i=Math.imul(j,W))+Math.imul(N,H)|0,a=Math.imul(N,W),n=n+Math.imul(D,q)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(z,q)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(R,K)|0,a=a+Math.imul(R,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ne)|0,n=n+Math.imul(k,ae)|0,i=(i=i+Math.imul(k,oe)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(b,le)|0,i=(i=i+Math.imul(b,ue)|0)+Math.imul(_,le)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(y,fe)|0,a=a+Math.imul(y,de)|0;var Se=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(v,he)|0))<<13)|0;u=((a=a+Math.imul(v,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(j,q),i=(i=Math.imul(j,Y))+Math.imul(N,q)|0,a=Math.imul(N,Y),n=n+Math.imul(D,K)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,$)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(P,re)|0,a=a+Math.imul(P,ne)|0,n=n+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,n=n+Math.imul(k,le)|0,i=(i=i+Math.imul(k,ue)|0)+Math.imul(T,le)|0,a=a+Math.imul(T,ue)|0,n=n+Math.imul(b,fe)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(_,fe)|0,a=a+Math.imul(_,de)|0;var Ae=(u+(n=n+Math.imul(g,he)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(y,he)|0))<<13)|0;u=((a=a+Math.imul(y,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(j,K),i=(i=Math.imul(j,$))+Math.imul(N,K)|0,a=Math.imul(N,$),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(R,re)|0,a=a+Math.imul(R,ne)|0,n=n+Math.imul(E,ae)|0,i=(i=i+Math.imul(E,oe)|0)+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(A,le)|0,a=a+Math.imul(A,ue)|0,n=n+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,de)|0)+Math.imul(T,fe)|0,a=a+Math.imul(T,de)|0;var Ce=(u+(n=n+Math.imul(b,he)|0)|0)+((8191&(i=(i=i+Math.imul(b,ve)|0)+Math.imul(_,he)|0))<<13)|0;u=((a=a+Math.imul(_,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(j,Q),i=(i=Math.imul(j,ee))+Math.imul(N,Q)|0,a=Math.imul(N,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,oe)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,oe)|0,n=n+Math.imul(E,le)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(P,le)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(A,fe)|0,a=a+Math.imul(A,de)|0;var Ee=(u+(n=n+Math.imul(k,he)|0)|0)+((8191&(i=(i=i+Math.imul(k,ve)|0)+Math.imul(T,he)|0))<<13)|0;u=((a=a+Math.imul(T,ve)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,re),i=(i=Math.imul(j,ne))+Math.imul(N,re)|0,a=Math.imul(N,ne),n=n+Math.imul(D,ae)|0,i=(i=i+Math.imul(D,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(R,le)|0,a=a+Math.imul(R,ue)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(P,fe)|0,a=a+Math.imul(P,de)|0;var Pe=(u+(n=n+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,ve)|0)+Math.imul(A,he)|0))<<13)|0;u=((a=a+Math.imul(A,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(j,ae),i=(i=Math.imul(j,oe))+Math.imul(N,ae)|0,a=Math.imul(N,oe),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,ue)|0)+Math.imul(z,le)|0,a=a+Math.imul(z,ue)|0,n=n+Math.imul(I,fe)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(R,fe)|0,a=a+Math.imul(R,de)|0;var Le=(u+(n=n+Math.imul(E,he)|0)|0)+((8191&(i=(i=i+Math.imul(E,ve)|0)+Math.imul(P,he)|0))<<13)|0;u=((a=a+Math.imul(P,ve)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(j,le),i=(i=Math.imul(j,ue))+Math.imul(N,le)|0,a=Math.imul(N,ue),n=n+Math.imul(D,fe)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(z,fe)|0,a=a+Math.imul(z,de)|0;var Ie=(u+(n=n+Math.imul(I,he)|0)|0)+((8191&(i=(i=i+Math.imul(I,ve)|0)+Math.imul(R,he)|0))<<13)|0;u=((a=a+Math.imul(R,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(j,fe),i=(i=Math.imul(j,de))+Math.imul(N,fe)|0,a=Math.imul(N,de);var Re=(u+(n=n+Math.imul(D,he)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(z,he)|0))<<13)|0;u=((a=a+Math.imul(z,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Oe=(u+(n=Math.imul(j,he))|0)+((8191&(i=(i=Math.imul(j,ve))+Math.imul(N,he)|0))<<13)|0;return u=((a=Math.imul(N,ve))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l[0]=me,l[1]=ge,l[2]=ye,l[3]=xe,l[4]=be,l[5]=_e,l[6]=we,l[7]=ke,l[8]=Te,l[9]=Me,l[10]=Se,l[11]=Ae,l[12]=Ce,l[13]=Ee,l[14]=Pe,l[15]=Le,l[16]=Ie,l[17]=Re,l[18]=Oe,0!==u&&(l[19]=u,r.length++),r};function v(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=p),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?p(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):v(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var f=0|this.words[u];this.words[u]=c<<26-a|f>>>a,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==t){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var h=0,v=1;0===(r.words[0]&v)&&h<26;++h,v<<=1);if(h>0)for(r.iushrn(h);h-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(l)):(r.isub(t),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0===(t.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(t.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,d=1;0===(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new k(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"===typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(x,y),x.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new x;else if("p224"===e)t=new b;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=o;0!==p.cmp(s);){for(var v=p,m=0;0!==v.cmp(s);m++)v=v.redSqr();n(m=0;n--){for(var u=t.words[n],c=l-1;c>=0;c--){var f=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new T(e)},i(T,k),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},2692:function(e){"use strict";e.exports=function(e){var t,r,n,i=e.length,a=0;for(t=0;t>>1;if(!(c<=0)){var f,d=i.mallocDouble(2*c*s),p=i.mallocInt32(s);if((s=l(e,c,d,p))>0){if(1===c&&n)a.init(s),f=a.sweepComplete(c,r,0,s,d,p,0,s,d,p);else{var h=i.mallocDouble(2*c*u),v=i.mallocInt32(u);(u=l(t,c,h,v))>0&&(a.init(s+u),f=1===c?a.sweepBipartite(c,r,0,s,d,p,0,u,h,v):o(c,r,n,s,d,p,u,h,v),i.free(h),i.free(v))}i.free(d),i.free(p)}return f}}}function c(e,t){n.push([e,t])}},7333:function(e,t){"use strict";function r(e){return e?function(e,t,r,n,i,a,o,s,l,u,c){return i-n>l-s?function(e,t,r,n,i,a,o,s,l,u,c){for(var f=2*e,d=n,p=f*n;du-l?n?function(e,t,r,n,i,a,o,s,l,u,c){for(var f=2*e,d=n,p=f*n;d0;){var O=(I-=1)*b,D=w[O],z=w[O+1],F=w[O+2],j=w[O+3],N=w[O+4],Z=w[O+5],B=I*_,V=k[B],U=k[B+1],H=1&Z,W=!!(16&Z),G=c,q=A,Y=E,X=P;if(H&&(G=E,q=P,Y=c,X=A),!(2&Z&&z>=(F=m(e,D,z,F,G,q,U)))&&!(4&Z&&(z=g(e,D,z,F,G,q,V))>=F)){var K=F-z,$=N-j;if(W){if(e*K*(K+$)=p0)&&!(p1>=hi)"),v=c("lo===p0"),m=c("lo>>1,d=2*e,p=f,h=s[d*f+t];u=x?(p=y,h=x):g>=_?(p=m,h=g):(p=b,h=_):x>=_?(p=y,h=x):_>=g?(p=m,h=g):(p=b,h=_);for(var w=d*(c-1),k=d*p,T=0;Tr&&i[f+t]>u;--c,f-=o){for(var d=f,p=f+o,h=0;hd;++d,l+=s)if(i[l+f]===o)if(c===d)c+=1,u+=s;else{for(var p=0;s>p;++p){var h=i[l+p];i[l+p]=i[u],i[u++]=h}var v=a[d];a[d]=a[c],a[c++]=v}return c},"lod;++d,l+=s)if(i[l+f]p;++p){var h=i[l+p];i[l+p]=i[u],i[u++]=h}var v=a[d];a[d]=a[c],a[c++]=v}return c},"lo<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,u=l,c=r,f=e+t,d=r;n>d;++d,l+=s)if(i[l+f]<=o)if(c===d)c+=1,u+=s;else{for(var p=0;s>p;++p){var h=i[l+p];i[l+p]=i[u],i[u++]=h}var v=a[d];a[d]=a[c],a[c++]=v}return c},"hi<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,u=l,c=r,f=e+t,d=r;n>d;++d,l+=s)if(i[l+f]<=o)if(c===d)c+=1,u+=s;else{for(var p=0;s>p;++p){var h=i[l+p];i[l+p]=i[u],i[u++]=h}var v=a[d];a[d]=a[c],a[c++]=v}return c},"lop;++p,l+=s){var h=i[l+f],v=i[l+d];if(hm;++m){var g=i[l+m];i[l+m]=i[u],i[u++]=g}var y=a[p];a[p]=a[c],a[c++]=y}}return c},"lo<=p0&&p0<=hi":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,u=l,c=r,f=t,d=e+t,p=r;n>p;++p,l+=s){var h=i[l+f],v=i[l+d];if(h<=o&&o<=v)if(c===p)c+=1,u+=s;else{for(var m=0;s>m;++m){var g=i[l+m];i[l+m]=i[u],i[u++]=g}var y=a[p];a[p]=a[c],a[c++]=y}}return c},"!(lo>=p0)&&!(p1>=hi)":function(e,t,r,n,i,a,o,s){for(var l=2*e,u=l*r,c=u,f=r,d=t,p=e+t,h=r;n>h;++h,u+=l){var v=i[u+d],m=i[u+p];if(!(v>=o)&&!(s>=m))if(f===h)f+=1,c+=l;else{for(var g=0;l>g;++g){var y=i[u+g];i[u+g]=i[c],i[c++]=y}var x=a[h];a[h]=a[f],a[f++]=x}}return f}}},309:function(e){"use strict";e.exports=function(e,n){n<=4*t?r(0,n-1,e):u(0,n-1,e)};var t=32;function r(e,t,r){for(var n=2*(e+1),i=e+1;i<=t;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >e;){var u=r[l-2],c=r[l-1];if(ur[t+1])}function l(e,t,r,n){var i=n[e*=2];return i>1,m=v-d,g=v+d,y=p,x=m,b=v,_=g,w=h,k=e+1,T=c-1,M=0;s(y,x,f)&&(M=y,y=x,x=M),s(_,w,f)&&(M=_,_=w,w=M),s(y,b,f)&&(M=y,y=b,b=M),s(x,b,f)&&(M=x,x=b,b=M),s(y,_,f)&&(M=y,y=_,_=M),s(b,_,f)&&(M=b,b=_,_=M),s(x,w,f)&&(M=x,x=w,w=M),s(x,b,f)&&(M=x,x=b,b=M),s(_,w,f)&&(M=_,_=w,w=M);for(var S=f[2*x],A=f[2*x+1],C=f[2*_],E=f[2*_+1],P=2*y,L=2*b,I=2*w,R=2*p,O=2*v,D=2*h,z=0;z<2;++z){var F=f[P+z],j=f[L+z],N=f[I+z];f[R+z]=F,f[O+z]=j,f[D+z]=N}i(m,e,f),i(g,c,f);for(var Z=k;Z<=T;++Z)if(l(Z,S,A,f))Z!==k&&n(Z,k,f),++k;else if(!l(Z,C,E,f))for(;;){if(l(T,C,E,f)){l(T,S,A,f)?(a(Z,k,T,f),++k,--T):(n(Z,T,f),--T);break}if(--T>>1;a(h,A);var C=0,E=0;for(k=0;k=o)v(c,f,E--,P=P-o|0);else if(P>=0)v(l,u,C--,P);else if(P<=-o){P=-P-o|0;for(var L=0;L>>1;a(h,C);var E=0,P=0,L=0;for(T=0;T>1===h[2*T+3]>>1&&(R=2,T+=1),I<0){for(var O=-(I>>1)-1,D=0;D>1)-1,0===R?v(l,u,E--,O):1===R?v(c,f,P--,O):2===R&&v(d,p,L--,O)}},scanBipartite:function(e,t,r,n,i,s,c,f,d,p,g,y){var x=0,b=2*e,_=t,w=t+e,k=1,T=1;n?T=o:k=o;for(var M=i;M>>1;a(h,E);var P=0;for(M=0;M=o?(I=!n,S-=o):(I=!!n,S-=1),I)m(l,u,P++,S);else{var R=y[S],O=b*S,D=g[O+t+1],z=g[O+t+1+e];e:for(var F=0;F>>1;a(h,k);var T=0;for(x=0;x=o)l[T++]=b-o;else{var S=p[b-=1],A=m*b,C=d[A+t+1],E=d[A+t+1+e];e:for(var P=0;P=0;--P)if(l[P]===b){for(O=P+1;O0;){for(var p=r.pop(),h=(c=-1,f=-1,l=o[s=r.pop()],1);h=0||(t.flip(s,p),i(e,t,r,c,s,f),i(e,t,r,s,f,c),i(e,t,r,f,p,c),i(e,t,r,p,c,f))}}},7098:function(e,t,r){"use strict";var n=r(5070);function i(e,t,r,n,i,a,o){this.cells=e,this.neighbor=t,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function a(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]}e.exports=function(e,t,r){var n=function(e,t){for(var r=e.cells(),n=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var p=s.pop();if(u[p]!==-o){u[p]=o,c[p];for(var h=0;h<3;++h){var v=d[3*p+h];v>=0&&0===u[v]&&(f[3*p+h]?l.push(v):(s.push(v),u[v]=o))}}}var m=l;l=s,s=m,l.length=0,o=-o}var g=function(e,t,r){for(var n=0,i=0;i1&&i(r[d[p-2]],r[d[p-1]],a)>0;)e.push([d[p-1],d[p-2],o]),p-=1;d.length=p,d.push(o);var h=f.upperIds;for(p=h.length;p>1&&i(r[h[p-2]],r[h[p-1]],a)<0;)e.push([h[p-2],h[p-1],o]),p-=1;h.length=p,h.push(o)}}function f(e,t){var r;return(r=e.a[0]v[0]&&i.push(new s(v,h,2,u),new s(h,v,1,u))}i.sort(l);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new o([m,1],[m,0],-1,[],[],[],[])],y=[],x=(u=0,i.length);u=0}}(),a.removeTriangle=function(e,t,r){var n=this.stars;o(n[e],t,r),o(n[t],r,e),o(n[r],e,t)},a.addTriangle=function(e,t,r){var n=this.stars;n[e].push(t,r),n[t].push(r,e),n[r].push(e,t)},a.opposite=function(e,t){for(var r=this.stars[t],n=1,i=r.length;nt[2]?1:0)}function g(e,t,r){if(0!==e.length){if(t)for(var n=0;n=0;--a){var x=t[c=(A=n[a])[0]],b=x[0],_=x[1],w=e[b],k=e[_];if((w[0]-k[0]||w[1]-k[1])<0){var T=b;b=_,_=T}x[0]=b;var M,S=x[1]=A[1];for(i&&(M=x[2]);a>0&&n[a-1][0]===c;){var A,C=(A=n[--a])[1];i?t.push([S,C,M]):t.push([S,C]),S=C}i?t.push([S,_,M]):t.push([S,_])}return d}(e,t,d,m,r),x=h(e,y);return g(t,x,r),!!x||d.length>0||m.length>0}},5528:function(e,t,r){"use strict";e.exports=function(e,t,r,n){var a=s(t,e),f=s(n,r),d=c(a,f);if(0===o(d))return null;var p=s(e,r),h=c(f,p),v=i(h,d),m=u(a,v);return l(e,m)};var n=r(3962),i=r(9189),a=r(4354),o=r(4951),s=r(6695),l=r(7584),u=r(4469);function c(e,t){return a(n(e[0],t[1]),n(e[1],t[0]))}},5692:function(e){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},9156:function(e,t,r){"use strict";var n=r(5692),i=r(3578);function a(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function o(e){for(var t,r="#",n=0;n<3;++n)r+=("00"+(t=(t=e[n]).toString(16))).substr(t.length);return r}function s(e){return"rgba("+e.join(",")+")"}e.exports=function(e){var t,r,l,u,c,f,d,p,h,v;if(e||(e={}),p=(e.nshades||72)-1,d=e.format||"hex",(f=e.colormap)||(f="jet"),"string"===typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");c=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);c=f.slice()}if(c.length>p+1)throw new Error(f+" map requires nshades to be at least size "+c.length);h=Array.isArray(e.alpha)?2!==e.alpha.length?[1,1]:e.alpha.slice():"number"===typeof e.alpha?[e.alpha,e.alpha]:[1,1],t=c.map((function(e){return Math.round(e.index*p)})),h[0]=Math.min(Math.max(h[0],0),1),h[1]=Math.min(Math.max(h[1],0),1);var m=c.map((function(e,t){var r=c[t].index,n=c[t].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=h[0]+(h[1]-h[0])*r),n})),g=[];for(v=0;v0||l(e,t,a)?-1:1:0===s?u>0||l(e,t,r)?1:-1:i(u-s)}var f=n(e,t,r);return f>0?o>0&&n(e,t,a)>0?1:-1:f<0?o>0||n(e,t,a)>0?1:-1:n(e,t,a)>0||l(e,t,r)?1:-1};var n=r(417),i=r(7538),a=r(87),o=r(2019),s=r(9662);function l(e,t,r){var n=a(e[0],-t[0]),i=a(e[1],-t[1]),l=a(r[0],-t[0]),u=a(r[1],-t[1]),c=s(o(n,l),o(i,u));return c[c.length-1]>=0}},7538:function(e){"use strict";e.exports=function(e){return e<0?-1:e>0?1:0}},9209:function(e){e.exports=function(e,n){var i=e.length,a=e.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return e[0]-n[0];case 2:return e[0]+e[1]-n[0]-n[1]||t(e[0],e[1])-t(n[0],n[1]);case 3:var o=e[0]+e[1],s=n[0]+n[1];if(a=o+e[2]-(s+n[2]))return a;var l=t(e[0],e[1]),u=t(n[0],n[1]);return t(l,e[2])-t(u,n[2])||t(l+e[2],o)-t(u+n[2],s);case 4:var c=e[0],f=e[1],d=e[2],p=e[3],h=n[0],v=n[1],m=n[2],g=n[3];return c+f+d+p-(h+v+m+g)||t(c,f,d,p)-t(h,v,m,g,h)||t(c+f,c+d,c+p,f+d,f+p,d+p)-t(h+v,h+m,h+g,v+m,v+g,m+g)||t(c+f+d,c+f+p,c+d+p,f+d+p)-t(h+v+m,h+v+g,h+m+g,v+m+g);default:for(var y=e.slice().sort(r),x=n.slice().sort(r),b=0;be[r][0]&&(r=n);return tr?[[r],[t]]:[[t]]}},8722:function(e,t,r){"use strict";e.exports=function(e){var t=n(e),r=t.length;if(r<=2)return[];for(var i=new Array(r),a=t[r-1],o=0;o=t[l]&&(s+=1);a[o]=s}}return e}(n(a,!0),r)}};var n=r(2183),i=r(2153)},9680:function(e){"use strict";e.exports=function(e,t,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,f=s*(3-2*i),d=s*o;if(e.length){a||(a=new Array(e.length));for(var p=e.length-1;p>=0;--p)a[p]=u*e[p]+c*t[p]+f*r[p]+d*n[p];return a}return u*e+c*t+f*r+d*n},e.exports.derivative=function(e,t,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(e.length){a||(a=new Array(e.length));for(var c=e.length-1;c>=0;--c)a[c]=o*e[c]+s*t[c]+l*r[c]+u*n[c];return a}return o*e+s*t+l*r[c]+u*n}},4419:function(e,t,r){"use strict";var n=r(2183),i=r(1215);function a(e,t){this.point=e,this.index=t}function o(e,t){for(var r=e.point,n=t.point,i=r.length,a=0;a=2)return!1;e[r]=n}return!0})):_.filter((function(e){for(var t=0;t<=s;++t){var r=g[e[t]];if(r<0)return!1;e[t]=r}return!0})),1&s)for(c=0;c<_.length;++c)d=(b=_[c])[0],b[0]=b[1],b[1]=d;return _}},8362:function(e){var t=!1;if("undefined"!==typeof Float64Array){var r=new Float64Array(1),n=new Uint32Array(r.buffer);r[0]=1,t=!0,1072693248===n[1]?(e.exports=function(e){return r[0]=e,[n[0],n[1]]},e.exports.pack=function(e,t){return n[0]=e,n[1]=t,r[0]},e.exports.lo=function(e){return r[0]=e,n[0]},e.exports.hi=function(e){return r[0]=e,n[1]}):1072693248===n[0]?(e.exports=function(e){return r[0]=e,[n[1],n[0]]},e.exports.pack=function(e,t){return n[1]=e,n[0]=t,r[0]},e.exports.lo=function(e){return r[0]=e,n[1]},e.exports.hi=function(e){return r[0]=e,n[0]}):t=!1}if(!t){var i=new Buffer(8);e.exports=function(e){return i.writeDoubleLE(e,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},e.exports.pack=function(e,t){return i.writeUInt32LE(e,0,!0),i.writeUInt32LE(t,4,!0),i.readDoubleLE(0,!0)},e.exports.lo=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(0,!0)},e.exports.hi=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}},3094:function(e){"use strict";function t(e,r,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a0)return function(e,t){var r,n;for(r=new Array(e),n=0;n=r-1){d=l.length-1;var h=e-t[r-1];for(p=0;p=r-1)for(var c=s.length-1,f=(t[r-1],0);f=0;--r)if(e[--t])return!1;return!0},s.jump=function(e){var t=this.lastT(),r=this.dimension;if(!(e0;--f)n.push(a(l[f-1],u[f-1],arguments[f])),i.push(0)}},s.push=function(e){var t=this.lastT(),r=this.dimension;if(!(e1e-6?1/s:0;this._time.push(e);for(var d=r;d>0;--d){var p=a(u[d-1],c[d-1],arguments[d]);n.push(p),i.push((p-n[o++])*f)}}},s.set=function(e){var t=this.dimension;if(!(e0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(e){var t=this.lastT(),r=this.dimension;if(!(e<=t||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=e-t,f=c>1e-6?1/c:0;this._time.push(e);for(var d=r;d>0;--d){var p=arguments[d];n.push(a(l[d-1],u[d-1],n[o++]+p)),i.push(p*f)}}},s.idle=function(e){var t=this.lastT();if(!(e=0;--f)n.push(a(l[f],u[f],n[o]+c*i[o])),i.push(0),o+=1}}},7080:function(e){"use strict";function t(e,t,r,n,i,a){this._color=e,this.key=t,this.value=r,this.left=n,this.right=i,this._count=a}function r(e){return new t(e._color,e.key,e.value,e.left,e.right,e._count)}function n(e,r){return new t(e,r.key,r.value,r.left,r.right,r._count)}function i(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function a(e,t){this._compare=e,this.root=t}e.exports=function(e){return new a(e||p,null)};var o=a.prototype;function s(e,t){var r;return t.left&&(r=s(e,t.left))?r:(r=e(t.key,t.value))||(t.right?s(e,t.right):void 0)}function l(e,t,r,n){if(t(e,n.key)<=0){var i;if(n.left&&(i=l(e,t,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(e,t,r,n.right)}function u(e,t,r,n,i){var a,o=r(e,i.key),s=r(t,i.key);if(o<=0){if(i.left&&(a=u(e,t,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return u(e,t,r,n,i.right)}function c(e,t){this.tree=e,this._stack=t}Object.defineProperty(o,"keys",{get:function(){var e=[];return this.forEach((function(t,r){e.push(t)})),e}}),Object.defineProperty(o,"values",{get:function(){var e=[];return this.forEach((function(t,r){e.push(r)})),e}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(e,r){for(var o=this._compare,s=this.root,l=[],u=[];s;){var c=o(e,s.key);l.push(s),u.push(c),s=c<=0?s.left:s.right}l.push(new t(0,e,r,null,null,1));for(var f=l.length-2;f>=0;--f)s=l[f],u[f]<=0?l[f]=new t(s._color,s.key,s.value,l[f+1],s.right,s._count+1):l[f]=new t(s._color,s.key,s.value,s.left,l[f+1],s._count+1);for(f=l.length-1;f>1;--f){var d=l[f-1];if(s=l[f],1===d._color||1===s._color)break;var p=l[f-2];if(p.left===d)if(d.left===s){if(!(h=p.right)||0!==h._color){p._color=0,p.left=d.right,d._color=1,d.right=p,l[f-2]=d,l[f-1]=s,i(p),i(d),f>=3&&((v=l[f-3]).left===p?v.left=d:v.right=d);break}d._color=1,p.right=n(1,h),p._color=0,f-=1}else{if(!(h=p.right)||0!==h._color){d.right=s.left,p._color=0,p.left=s.right,s._color=1,s.left=d,s.right=p,l[f-2]=s,l[f-1]=d,i(p),i(d),i(s),f>=3&&((v=l[f-3]).left===p?v.left=s:v.right=s);break}d._color=1,p.right=n(1,h),p._color=0,f-=1}else if(d.right===s){if(!(h=p.left)||0!==h._color){p._color=0,p.right=d.left,d._color=1,d.left=p,l[f-2]=d,l[f-1]=s,i(p),i(d),f>=3&&((v=l[f-3]).right===p?v.right=d:v.left=d);break}d._color=1,p.left=n(1,h),p._color=0,f-=1}else{var h;if(!(h=p.left)||0!==h._color){var v;d.left=s.right,p._color=0,p.right=s.left,s._color=1,s.right=d,s.left=p,l[f-2]=s,l[f-1]=d,i(p),i(d),i(s),f>=3&&((v=l[f-3]).right===p?v.right=s:v.left=s);break}d._color=1,p.left=n(1,h),p._color=0,f-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(e,t,r){if(this.root)switch(arguments.length){case 1:return s(e,this.root);case 2:return l(t,this._compare,e,this.root);case 3:if(this._compare(t,r)>=0)return;return u(t,r,this._compare,e,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new c(this,e)}}),Object.defineProperty(o,"end",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new c(this,e)}}),o.at=function(e){if(e<0)return new c(this,[]);for(var t=this.root,r=[];;){if(r.push(t),t.left){if(e=t.right._count)break;t=t.right}return new c(this,[])},o.ge=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.gt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.lt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.le=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.find=function(e){for(var t=this._compare,r=this.root,n=[];r;){var i=t(e,r.key);if(n.push(r),0===i)return new c(this,n);r=i<=0?r.left:r.right}return new c(this,[])},o.remove=function(e){var t=this.find(e);return t?t.remove():this},o.get=function(e){for(var t=this._compare,r=this.root;r;){var n=t(e,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var f=c.prototype;function d(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e._color=t._color,e._count=t._count}function p(e,t){return et?1:0}Object.defineProperty(f,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(f,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),f.clone=function(){return new c(this.tree,this._stack.slice())},f.remove=function(){var e=this._stack;if(0===e.length)return this.tree;var o=new Array(e.length),s=e[e.length-1];o[o.length-1]=new t(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=e.length-2;l>=0;--l)(s=e[l]).left===e[l+1]?o[l]=new t(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var u=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var c=o[u-1];for(o.push(new t(s._color,c.key,c.value,s.left,s.right,s._count)),o[u-1].key=s.key,o[u-1].value=s.value,l=o.length-2;l>=u;--l)s=o[l],o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);o[u-1].left=o[u]}if(0===(s=o[o.length-1])._color){var f=o[o.length-2];for(f.left===s?f.left=null:f.right===s&&(f.right=null),o.pop(),l=0;l=0;--l){if(t=e[l],0===l)return void(t._color=1);if((a=e[l-1]).left===t){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,t._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((u=e[l-2]).left===a?u.left=o:u.right=o),void(e[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((u=e[l-2]).left===a?u.left=s:u.right=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((u=e[l-2]).left===a?u.left=o:u.right=o),e[l-1]=o,e[l]=a,l+11&&((u=e[l-2]).right===a?u.right=o:u.left=o),void(e[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((u=e[l-2]).right===a?u.right=s:u.left=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var u;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((u=e[l-2]).right===a?u.right=o:u.left=o),e[l-1]=o,e[l]=a,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(f,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(f,"index",{get:function(){var e=0,t=this._stack;if(0===t.length){var r=this.tree.root;return r?r._count:0}t[t.length-1].left&&(e=t[t.length-1].left._count);for(var n=t.length-2;n>=0;--n)t[n+1]===t[n].right&&(++e,t[n].left&&(e+=t[n].left._count));return e},enumerable:!0}),f.next=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.right)for(t=t.right;t;)e.push(t),t=t.left;else for(e.pop();e.length>0&&e[e.length-1].right===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(f,"hasNext",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].right)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}}),f.update=function(e){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new t(i._color,i.key,e,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new t(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new t(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},f.prev=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.left)for(t=t.left;t;)e.push(t),t=t.right;else for(e.pop();e.length>0&&e[e.length-1].left===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(f,"hasPrev",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].left)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}})},7453:function(e,t,r){"use strict";e.exports=function(e,t){var r=new c(e);return r.update(t),r};var n=r(9557),i=r(1681),a=r(1011),o=r(2864),s=r(8468),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function u(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function c(e){this.gl=e,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(e)}var f=c.prototype;function d(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.update=function(e){function t(t,r,n){if(n in e){var i,a=e[n],o=this[n];(t?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}e=e||{};var r,a=t.bind(this,!1,Number),o=t.bind(this,!1,Boolean),l=t.bind(this,!1,String),u=t.bind(this,!0,(function(e){if(Array.isArray(e)){if(3===e.length)return[+e[0],+e[1],+e[2],1];if(4===e.length)return[+e[0],+e[1],+e[2],+e[3]]}return[0,0,0,1]})),c=!1,f=!1;if("bounds"in e)for(var d=e.bounds,p=0;p<2;++p)for(var h=0;h<3;++h)d[p][h]!==this.bounds[p][h]&&(f=!0),this.bounds[p][h]=d[p][h];if("ticks"in e)for(r=e.ticks,c=!0,this.autoTicks=!1,p=0;p<3;++p)this.tickSpacing[p]=0;else a("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in e||"tickSpacing"in e||(this.autoTicks=!0),f=!0,c=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),c=!0),c){for(p=0;p<3;++p)r[p].sort((function(e,t){return e.x-t.x}));s.equal(r,this.ticks)?c=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(c=!0),a("tickSize"),a("tickAngle"),a("tickPad"),u("tickColor");var v=l("labels");l("labelFont")&&(v=!0),o("labelEnable"),a("labelSize"),a("labelPad"),u("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),u("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),u("lineTickColor"),o("gridEnable"),a("gridWidth"),u("gridColor"),o("zeroEnable"),u("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),u("backgroundColor"),this._text?this._text&&(v||c)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=n(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var p=[new d,new d,new d];function h(e,t,r,n,i){for(var a=e.primalOffset,o=e.primalMinor,s=e.mirrorOffset,l=e.mirrorMinor,u=n[t],c=0;c<3;++c)if(t!==c){var f=a,d=s,p=o,h=l;u&1<0?(p[c]=-1,h[c]=0):(p[c]=0,h[c]=1)}}var v=[0,0,0],m={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(e){};var g=[0,0,0],y=[0,0,0],x=[0,0,0];f.draw=function(e){e=e||m;for(var t=this.gl,r=e.model||l,n=e.view||l,i=e.projection||l,a=this.bounds,s=e._ortho||!1,c=o(r,n,i,a,s),f=c.cubeEdges,d=c.axis,b=n[12],_=n[13],w=n[14],k=n[15],T=(s?2:1)*this.pixelRatio*(i[3]*b+i[7]*_+i[11]*w+i[15]*k)/t.drawingBufferHeight,M=0;M<3;++M)this.lastCubeProps.cubeEdges[M]=f[M],this.lastCubeProps.axis[M]=d[M];var S=p;for(M=0;M<3;++M)h(p[M],M,this.bounds,f,d);t=this.gl;var A,C,E,P=v;for(M=0;M<3;++M)this.backgroundEnable[M]?P[M]=d[M]:P[M]=0;for(this._background.draw(r,n,i,a,P,this.backgroundColor),this._lines.bind(r,n,i,this),M=0;M<3;++M){var L=[0,0,0];d[M]>0?L[M]=a[1][M]:L[M]=a[0][M];for(var I=0;I<2;++I){var R=(M+1+I)%3,O=(M+1+(1^I))%3;this.gridEnable[R]&&this._lines.drawGrid(R,O,this.bounds,L,this.gridColor[R],this.gridWidth[R]*this.pixelRatio)}for(I=0;I<2;++I)R=(M+1+I)%3,O=(M+1+(1^I))%3,this.zeroEnable[O]&&Math.min(a[0][O],a[1][O])<=0&&Math.max(a[0][O],a[1][O])>=0&&this._lines.drawZero(R,O,this.bounds,L,this.zeroLineColor[O],this.zeroLineWidth[O]*this.pixelRatio)}for(M=0;M<3;++M){this.lineEnable[M]&&this._lines.drawAxisLine(M,this.bounds,S[M].primalOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio),this.lineMirror[M]&&this._lines.drawAxisLine(M,this.bounds,S[M].mirrorOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio);var D=u(g,S[M].primalMinor),z=u(y,S[M].mirrorMinor),F=this.lineTickLength;for(I=0;I<3;++I){var j=T/r[5*I];D[I]*=F[I]*j,z[I]*=F[I]*j}this.lineTickEnable[M]&&this._lines.drawAxisTicks(M,S[M].primalOffset,D,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio),this.lineTickMirror[M]&&this._lines.drawAxisTicks(M,S[M].mirrorOffset,z,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio)}function N(e){(E=[0,0,0])[e]=1}function Z(e,t,r){var n=(e+1)%3,i=(e+2)%3,a=t[n],o=t[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?N(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&N(i)}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),M=0;M<3;++M){var B=S[M].primalMinor,V=S[M].mirrorMinor,U=u(x,S[M].primalOffset);for(I=0;I<3;++I)this.lineTickEnable[M]&&(U[I]+=T*B[I]*Math.max(this.lineTickLength[I],0)/r[5*I]);var H=[0,0,0];if(H[M]=1,this.tickEnable[M]){for(-3600===this.tickAngle[M]?(this.tickAngle[M]=0,this.tickAlign[M]="auto"):this.tickAlign[M]=-1,C=1,"auto"===(A=[this.tickAlign[M],.5,C])[0]?A[0]=0:A[0]=parseInt(""+A[0]),E=[0,0,0],Z(M,B,V),I=0;I<3;++I)U[I]+=T*B[I]*this.tickPad[I]/r[5*I];this._text.drawTicks(M,this.tickSize[M],this.tickAngle[M],U,this.tickColor[M],H,E,A)}if(this.labelEnable[M]){for(C=0,E=[0,0,0],this.labels[M].length>4&&(N(M),C=1),"auto"===(A=[this.labelAlign[M],.5,C])[0]?A[0]=0:A[0]=parseInt(""+A[0]),I=0;I<3;++I)U[I]+=T*B[I]*this.labelPad[I]/r[5*I];U[M]+=.5*(a[0][M]+a[1][M]),this._text.drawLabel(M,this.labelSize[M],this.labelAngle[M],U,this.labelColor[M],[0,0,0],E,A)}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},1011:function(e,t,r){"use strict";e.exports=function(e){for(var t=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],d=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=p,d[l]=p;for(var h=-1;h<=1;h+=2){f[u]=h;for(var v=-1;v<=1;v+=2)f[c]=v,t.push(f[0],f[1],f[2],d[0],d[1],d[2]),s+=1}var m=u;u=c,c=m}var g=n(e,new Float32Array(t)),y=n(e,new Uint16Array(r),e.ELEMENT_ARRAY_BUFFER),x=i(e,[{buffer:g,type:e.FLOAT,size:3,offset:0,stride:24},{buffer:g,type:e.FLOAT,size:3,offset:12,stride:24}],y),b=a(e);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(e,g,x,b)};var n=r(5827),i=r(2944),a=r(1943).bg;function o(e,t,r,n){this.gl=e,this.buffer=t,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(e,t,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:e,view:t,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},2864:function(e,t,r){"use strict";e.exports=function(e,t,r,a,p){i(s,t,e),i(s,r,s);for(var y=0,x=0;x<2;++x){c[2]=a[x][2];for(var b=0;b<2;++b){c[1]=a[b][1];for(var _=0;_<2;++_)c[0]=a[_][0],d(l[y],c,s),y+=1}}var w=-1;for(x=0;x<8;++x){for(var k=l[x][3],T=0;T<3;++T)u[x][T]=l[x][T]/k;p&&(u[x][2]*=-1),k<0&&(w<0||u[x][2]C&&(w|=1<C&&(w|=1<u[x][1])&&(z=x);var F=-1;for(x=0;x<3;++x)(N=z^1<u[j][0]&&(j=N))}var Z=v;Z[0]=Z[1]=Z[2]=0,Z[n.log2(F^z)]=z&F,Z[n.log2(z^j)]=z&j;var B=7^j;B===w||B===D?(B=7^F,Z[n.log2(j^B)]=B&j):Z[n.log2(F^B)]=B&F;var V=m,U=w;for(M=0;M<3;++M)V[M]=U&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);t.f=function(e){return i(e,s,l,null,[{name:"position",type:"vec3"}])};var u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);t.bg=function(e){return i(e,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},9557:function(e,t,r){"use strict";e.exports=function(e,t,r,i,o,l){var u=n(e),f=a(e,[{buffer:u,size:3}]),d=s(e);d.attributes.position.location=0;var p=new c(e,d,u,f);return p.update(t,r,i,o,l),p};var n=r(5827),a=r(2944),o=r(875),s=r(1943).f,l=window||i.global||{},u=l.__TEXT_CACHE||{};function c(e,t,r,n){this.gl=e,this.shader=t,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}l.__TEXT_CACHE={};var f=c.prototype,d=[0,0];f.bind=function(e,t,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=e,i.view=t,i.projection=r,i.pixelScale=n,d[0]=this.gl.drawingBufferWidth,d[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=d},f.unbind=function(){this.vao.unbind()},f.update=function(e,t,r,n,i){var a=[];function s(e,t,r,n,i,s){var l=u[r];l||(l=u[r]={});var c=l[t];c||(c=l[t]=function(e,t){try{return o(e,t)}catch(r){return console.warn('error vectorizing text:"'+e+'" error:',r),{cells:[],positions:[]}}}(t,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,d=c.positions,p=c.cells,h=0,v=p.length;h=0;--g){var y=d[m[g]];a.push(f*y[0],-f*y[1],e)}}for(var l=[0,0,0],c=[0,0,0],f=[0,0,0],d=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},h=0;h<3;++h){f[h]=a.length/3|0,s(.5*(e[0][h]+e[1][h]),t[h],r[h],12,1.25,p),d[h]=(a.length/3|0)-f[h],l[h]=a.length/3|0;for(var v=0;v=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(e*t*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var f=""+u;f.length=e[0][i];--o)a.push({x:o*t[i],text:r(t[i],o)});n.push(a)}return n},t.equal=function(e,t){for(var r=0;r<3;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return e.bufferSubData(t,a,i),r}function c(e,t){for(var r=n.malloc(e.length,t),i=e.length,a=0;a=0;--n){if(t[n]!==r)return!1;r*=e[n]}return!0}(e.shape,e.stride))0===e.offset&&e.data.length===e.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,e.data,t):this.length=u(this.gl,this.type,this.length,this.usage,e.data.subarray(e.offset,e.shape[0]),t);else{var s=n.malloc(e.size,r),l=a(s,e.shape);i.assign(l,e),this.length=u(this.gl,this.type,this.length,this.usage,t<0?s:s.subarray(0,e.size),t),n.free(s)}}else if(Array.isArray(e)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(e,"uint16"):c(e,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,t<0?f:f.subarray(0,e.length),t),n.free(f)}else if("object"===typeof e&&"number"===typeof e.length)this.length=u(this.gl,this.type,this.length,this.usage,e,t);else{if("number"!==typeof e&&void 0!==e)throw new Error("gl-buffer: Invalid data type");if(t>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(e|=0)<=0&&(e=1),this.gl.bufferData(this.type,0|e,this.usage),this.length=e}},e.exports=function(e,t,r,n){if(r=r||e.ARRAY_BUFFER,n=n||e.DYNAMIC_DRAW,r!==e.ARRAY_BUFFER&&r!==e.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==e.DYNAMIC_DRAW&&n!==e.STATIC_DRAW&&n!==e.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=e.createBuffer(),a=new s(e,r,i,0,n);return a.update(t),a}},1140:function(e,t,r){"use strict";var n=r(2858);e.exports=function(e,t){var r=e.positions,i=e.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:e.vertexIntensityBounds,vectors:[],cells:[],coneOffset:e.coneOffset,colormap:e.colormap};if(0===e.positions.length)return t&&(t[0]=[0,0,0],t[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,u=1/0,c=-1/0,f=1/0,d=-1/0,p=null,h=null,v=[],m=1/0,g=!1,y=0;yo&&(o=n.length(b)),y){var _=2*n.distance(p,x)/(n.length(h)+n.length(b));_?(m=Math.min(m,_),g=!1):g=!0}g||(p=x,h=b),v.push(b)}var w=[s,u,f],k=[l,c,d];t&&(t[0]=w,t[1]=k),0===o&&(o=1);var T=1/o;isFinite(m)||(m=1),a.vectorScale=m;var M=e.coneSize||.5;e.absoluteConeSize&&(M=e.absoluteConeSize*T),a.coneScale=M,y=0;for(var S=0;y=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(e){this.pickId=e},p.update=function(e){e=e||{};var t=this.gl;this.dirty=!0,"lightPosition"in e&&(this.lightPosition=e.lightPosition),"opacity"in e&&(this.opacity=e.opacity),"ambient"in e&&(this.ambientLight=e.ambient),"diffuse"in e&&(this.diffuseLight=e.diffuse),"specular"in e&&(this.specularLight=e.specular),"roughness"in e&&(this.roughness=e.roughness),"fresnel"in e&&(this.fresnel=e.fresnel),void 0!==e.tubeScale&&(this.tubeScale=e.tubeScale),void 0!==e.vectorScale&&(this.vectorScale=e.vectorScale),void 0!==e.coneScale&&(this.coneScale=e.coneScale),void 0!==e.coneOffset&&(this.coneOffset=e.coneOffset),e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(function(e){for(var t=c({colormap:e,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=t[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return u(r,[256,256,4],[4,0,1])}(e.colormap)),this.texture.generateMipmap());var r=e.cells,n=e.positions,i=e.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=i;var d=e.meshColor||[1,1,1,1],p=e.vertexIntensity,h=1/0,v=-1/0;if(p)if(e.vertexIntensityBounds)h=+e.vertexIntensityBounds[0],v=+e.vertexIntensityBounds[1];else for(var m=0;m0){var v=this.triShader;v.bind(),v.uniforms=u,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||f,n=e.view||f,i=e.projection||f,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=t),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(e,t,r){var s=r.shaders;1===arguments.length&&(e=(t=e).gl);var l=function(e,t){var r=n(e,t.meshShader.vertex,t.meshShader.fragment,null,t.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(e,s),c=function(e,t){var r=n(e,t.pickShader.vertex,t.pickShader.fragment,null,t.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(e,s),f=o(e,u(new Uint8Array([255,255,255,255]),[1,1,4]));f.generateMipmap(),f.minFilter=e.LINEAR_MIPMAP_LINEAR,f.magFilter=e.LINEAR;var p=i(e),h=i(e),v=i(e),m=i(e),g=i(e),y=new d(e,f,l,c,p,h,g,v,m,a(e,[{buffer:p,type:e.FLOAT,size:4},{buffer:g,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:v,type:e.FLOAT,size:4},{buffer:m,type:e.FLOAT,size:2},{buffer:h,type:e.FLOAT,size:4}]),r.traceType||"cone");return y.update(t),y}},7234:function(e,t,r){var n=r(6832),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},1950:function(e){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},6603:function(e,t,r){var n=r(1950);e.exports=function(e){return n[e]}},3110:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl,r=n(t),o=i(t,[{buffer:r,type:t.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:t.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:t.FLOAT,size:3,offset:28,stride:40}]),l=a(t);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(t,r,o,l);return u.update(e),u};var n=r(5827),i=r(2944),a=r(7667),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,n){this.gl=e,this.shader=n,this.buffer=t,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function u(e,t){for(var r=0;r<3;++r)e[0][r]=Math.min(e[0][r],t[r]),e[1][r]=Math.max(e[1][r],t[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(e){var t=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=e.view||o,i=r.projection=e.projection||o;r.model=e.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],u=n[15],c=(e._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*u)/t.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)t.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*c,this.lineCount[f]&&t.drawArrays(t.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var c=function(){for(var e=new Array(3),t=0;t<3;++t){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+t)%3]=i,r.push(a)}e[t]=r}return e}();function f(e,t,r,n){for(var i=c[n],a=0;a0&&((p=c.slice())[s]+=h[1][s],i.push(c[0],c[1],c[2],v[0],v[1],v[2],v[3],0,0,0,p[0],p[1],p[2],v[0],v[1],v[2],v[3],0,0,0),u(this.bounds,p),o+=2+f(i,p,v,s)))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},7667:function(e,t,r){"use strict";var n=r(6832),i=r(5158),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},4234:function(e,t,r){"use strict";var n=r(8931);e.exports=function(e,t,r,n){i||(i=e.FRAMEBUFFER_UNSUPPORTED,a=e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=e.getExtension("WEBGL_draw_buffers");if(!l&&u&&function(e,t){var r=e.getParameter(t.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;ac||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>e.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var d=e.UNSIGNED_BYTE,p=e.getExtension("OES_texture_float");if(n.float&&f>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");d=e.FLOAT}else n.preferFloat&&f>0&&p&&(d=e.FLOAT);var v=!0;"depth"in n&&(v=!!n.depth);var m=!1;return"stencil"in n&&(m=!!n.stencil),new h(e,t,r,d,f,v,m,u)};var i,a,o,s,l=null;function u(e){return[e.getParameter(e.FRAMEBUFFER_BINDING),e.getParameter(e.RENDERBUFFER_BINDING),e.getParameter(e.TEXTURE_BINDING_2D)]}function c(e,t){e.bindFramebuffer(e.FRAMEBUFFER,t[0]),e.bindRenderbuffer(e.RENDERBUFFER,t[1]),e.bindTexture(e.TEXTURE_2D,t[2])}function f(e){switch(e){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function d(e,t,r,i,a,o){if(!i)return null;var s=n(e,t,r,a,i);return s.magFilter=e.NEAREST,s.minFilter=e.NEAREST,s.mipSamples=1,s.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,o,e.TEXTURE_2D,s.handle,0),s}function p(e,t,r,n,i){var a=e.createRenderbuffer();return e.bindRenderbuffer(e.RENDERBUFFER,a),e.renderbufferStorage(e.RENDERBUFFER,n,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,a),a}function h(e,t,r,n,i,a,o,s){this.gl=e,this._shape=[0|t,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var h=0;h1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?h?e.depth=d(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):v&&(e.depth=d(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):v&&h?e._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):v?e._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):h&&(e._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(e._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(e.handle),e.handle=null,e.depth&&(e.depth.dispose(),e.depth=null),e._depth_rb&&(r.deleteRenderbuffer(e._depth_rb),e._depth_rb=null),g=0;gi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");e._shape[0]=t,e._shape[1]=r;for(var a=u(n),o=0;o>8*p&255;this.pickOffset=r,i.bind();var h=i.uniforms;h.viewTransform=e,h.pickOffset=t,h.shape=this.shape;var v=i.attributes;return this.positionBuffer.bind(),v.position.pointer(),this.weightBuffer.bind(),v.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),v.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),c.pick=function(e,t,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},c.update=function(e){var t=(e=e||{}).shape||[0,0],r=e.x||i(t[0]),o=e.y||i(t[1]),s=e.z||new Float32Array(t[0]*t[1]),l=!1!==e.zsmooth;this.xData=r,this.yData=o;var u,c,d,p,h=e.colorLevels||[0],v=e.colorValues||[0,0,0,1],m=h.length,g=this.bounds;l?(u=g[0]=r[0],c=g[1]=o[0],d=g[2]=r[r.length-1],p=g[3]=o[o.length-1]):(u=g[0]=r[0]+(r[1]-r[0])/2,c=g[1]=o[0]+(o[1]-o[0])/2,d=g[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,p=g[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(d-u),x=1/(p-c),b=t[0],_=t[1];this.shape=[b,_];var w=(l?(b-1)*(_-1):b*_)*(f.length>>>1);this.numVertices=w;for(var k=a.mallocUint8(4*w),T=a.mallocFloat32(2*w),M=a.mallocUint8(2*w),S=a.mallocUint32(w),A=0,C=l?b-1:b,E=l?_-1:_,P=0;P max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(e){return i(e,a,o,null,l)},t.createPickShader=function(e){return i(e,a,s,null,l)}},6086:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl||e.scene&&e.scene.gl,r=f(t);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=d(t);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(t),l=i(t,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),c=u(new Array(1024),[256,1,4]),p=0;p<1024;++p)c.data[p]=255;var h=a(t,c);h.wrap=t.REPEAT;var v=new g(t,r,o,s,l,h);return v.update(e),v};var n=r(5827),i=r(2944),a=r(8931),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(5070),u=r(5050),c=r(248),f=c.createShader,d=c.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(e,t){for(var r=0,n=0;n<3;++n){var i=e[n]-t[n];r+=i*i}return Math.sqrt(r)}function v(e){for(var t=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)t[0][r]=Math.max(e[0][r],t[0][r]),t[1][r]=Math.min(e[1][r],t[1][r]);return t}function m(e,t,r,n){this.arcLength=e,this.position=t,this.index=r,this.dataCoordinate=n}function g(e,t,r,n,i,a){this.gl=e,this.shader=t,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=g.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(e){this.pickId=e},y.drawTransparent=y.draw=function(e){if(this.vertexCount){var t=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:e.model||p,view:e.view||p,projection:e.projection||p,clipBounds:v(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.drawPick=function(e){if(this.vertexCount){var t=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:e.model||p,view:e.view||p,projection:e.projection||p,pickId:this.pickId,clipBounds:v(this.clipBounds),screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(e){var t,r;this.dirty=!0;var n=!!e.connectGaps;"dashScale"in e&&(this.dashScale=e.dashScale),this.hasAlpha=!1,"opacity"in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,c=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],d=e.position||e.positions;if(d){var p=e.color||e.colors||[0,0,0,1],v=e.lineWidth||1,m=!1;e:for(t=1;t0){for(var w=0;w<24;++w)i.push(i[i.length-12]);c+=2,m=!0}continue e}f[0][r]=Math.min(f[0][r],b[r],_[r]),f[1][r]=Math.max(f[1][r],b[r],_[r])}Array.isArray(p[0])?(g=p.length>t-1?p[t-1]:p.length>0?p[p.length-1]:[0,0,0,1],y=p.length>t?p[t]:p.length>0?p[p.length-1]:[0,0,0,1]):g=y=p,3===g.length&&(g=[g[0],g[1],g[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&g[3]<1&&(this.hasAlpha=!0),x=Array.isArray(v)?v.length>t-1?v[t-1]:v.length>0?v[v.length-1]:[0,0,0,1]:v;var k=s;if(s+=h(b,_),m){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,g[0],g[1],g[2],g[3]);c+=2,m=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,g[0],g[1],g[2],g[3],b[0],b[1],b[2],_[0],_[1],_[2],k,-x,g[0],g[1],g[2],g[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,y[0],y[1],y[2],y[3]),c+=4}}if(this.buffer.update(i),a.push(s),o.push(d[d.length-1].slice()),this.bounds=f,this.vertexCount=c,this.points=o,this.arcLength=a,"dashes"in e){var T=e.dashes.slice();for(T.unshift(0),t=1;t1.0001)return null;g+=m[f]}return Math.abs(g-1)>.001?null:[d,s(e,m),m]}},2056:function(e,t,r){var n=r(6832),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:d,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:p,fragment:h,attributes:[{name:"position",type:"vec3"}]}},8116:function(e,t,r){"use strict";var n=r(5158),i=r(5827),a=r(2944),o=r(8931),s=r(115),l=r(104),u=r(7437),c=r(5050),f=r(9156),d=r(7212),p=r(5306),h=r(2056),v=r(4340),m=h.meshShader,g=h.wireShader,y=h.pointShader,x=h.pickShader,b=h.pointPickShader,_=h.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function k(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x,b,_,k,T,M,S,A){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=d,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=h,this.edgeColors=m,this.edgeUVs=g,this.edgeIds=v,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=k,this.pointSizes=T,this.pointIds=b,this.pointVAO=M,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=S,this.contourVAO=A,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var T=k.prototype;function M(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;re&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}function S(e){var t=n(e,y.vertex,y.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.pointSize.location=4,t}function A(e){var t=n(e,x.vertex,x.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t}function C(e){var t=n(e,b.vertex,b.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t.attributes.pointSize.location=4,t}function E(e){var t=n(e,_.vertex,_.fragment);return t.attributes.position.location=0,t}T.isOpaque=function(){return!this.hasAlpha},T.isTransparent=function(){return this.hasAlpha},T.pickSlots=1,T.setPickBase=function(e){this.pickId=e},T.highlight=function(e){if(e&&this.contourEnable){for(var t=d(this.cells,this.intensity,e.intensity),r=t.cells,n=t.vertexIds,i=t.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),t.drawArrays(t.LINES,0,this.contourCount),this.contourVAO.unbind())},T.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||w,n=e.view||w,i=e.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind())},T.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;for(var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions,i=new Array(r.length),a=0;al[T]&&(a.uniforms.dataAxis=e,a.uniforms.screenOffset=t,a.uniforms.color=m[n],a.uniforms.angle=g[n],u.drawArrays(u.TRIANGLES,l[T],l[M]-l[T]))),y[n]&&k&&(t[1^n]-=S*p*x[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=t,a.uniforms.color=b[n],a.uniforms.angle=_[n],u.drawArrays(u.TRIANGLES,w,k)),t[1^n]=S*c[2+(1^n)]-1,h[n+2]&&(t[1^n]+=S*p*v[n+2],Tl[T]&&(a.uniforms.dataAxis=e,a.uniforms.screenOffset=t,a.uniforms.color=m[n+2],a.uniforms.angle=g[n+2],u.drawArrays(u.TRIANGLES,l[T],l[M]-l[T]))),y[n+2]&&k&&(t[1^n]+=S*p*x[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=t,a.uniforms.color=b[n+2],a.uniforms.angle=_[n+2],u.drawArrays(u.TRIANGLES,w,k))}}(),u.drawTitle=function(){var e=[0,0],t=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)t[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=e,n.uniforms.screenOffset=t,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),u.bind=function(){var e=[0,0],t=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var u=0;u<2;++u){var c=a[u],f=a[u+2]-c,d=.5*(o[u+2]+o[u]),p=o[u+2]-o[u],h=l[u],v=l[u+2]-h,m=s[u],g=s[u+2]-m;t[u]=2*f/p*v/g,e[u]=2*(c-d)/p*v/g}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=t,i.uniforms.dataShift=e,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),u.update=function(e){var t,r,n,i,o,s=[],l=e.ticks,u=e.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],f=[-1/0],d=l[o];for(t=0;t=0){var v=t[h]-n[h]*(t[h+2]-t[h])/(n[h+2]-n[h]);0===h?o.drawLine(v,t[1],v,t[3],p[h],d[h]):o.drawLine(t[0],v,t[2],v,p[h],d[h])}}for(h=0;h=0;--e)this.objects[e].dispose();for(this.objects.length=0,e=this.overlays.length-1;e>=0;--e)this.overlays[e].dispose();this.overlays.length=0,this.gl=null},u.addObject=function(e){this.objects.indexOf(e)<0&&(this.objects.push(e),this.setDirty())},u.removeObject=function(e){for(var t=this.objects,r=0;rMath.abs(t))u.rotate(a,0,0,-e*r*Math.PI*h.rotateSpeed/window.innerWidth);else if(!h._ortho){var o=-h.zoomSpeed*i*t/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,f*(Math.exp(o)-1))}}}),!0)},h.enableMouseListeners(),h};var n=r(8161),i=r(1152),a=r(6145),o=r(6475),s=r(2565),l=r(5233)},8245:function(e,t,r){var n=r(6832),i=r(5158),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec2"}])}},1059:function(e,t,r){"use strict";var n=r(4296),i=r(7453),a=r(2771),o=r(6496),s=r(2611),l=r(4234),u=r(8126),c=r(6145),f=r(1120),d=r(5268),p=r(8245),h=r(2321)({tablet:!0,featureDetect:!0});function v(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function m(e){var t=Math.round(Math.log(Math.abs(e))/Math.log(10));if(t<0){var r=Math.round(Math.pow(10,-t));return Math.ceil(e*r)/r}return t>0?(r=Math.round(Math.pow(10,t)),Math.ceil(e/r)*r):Math.ceil(e)}function g(e){return"boolean"!==typeof e||e}e.exports={createScene:function(e){(e=e||{}).camera=e.camera||{};var t=e.canvas;t||(t=document.createElement("canvas"),e.container?e.container.appendChild(t):document.body.appendChild(t));var r=e.gl;if(r||(e.glOptions&&(h=!!e.glOptions.preserveDrawingBuffer),r=function(e,t){var r=null;try{(r=e.getContext("webgl",t))||(r=e.getContext("experimental-webgl",t))}catch(n){return null}return r}(t,e.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:h})),!r)throw new Error("webgl not supported");var y=e.bounds||[[-10,-10,-10],[10,10,10]],x=new v,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!h}),_=p(r),w=e.cameraObject&&!0===e.cameraObject._ortho||e.camera.projection&&"orthographic"===e.camera.projection.type||!1,k={eye:e.camera.eye||[2,0,0],center:e.camera.center||[0,0,0],up:e.camera.up||[0,1,0],zoomMin:e.camera.zoomMax||.1,zoomMax:e.camera.zoomMin||100,mode:e.camera.mode||"turntable",_ortho:w},T=e.axes||{},M=i(r,T);M.enable=!T.disable;var S=e.spikes||{},A=o(r,S),C=[],E=[],P=[],L=[],I=!0,R=!0,O=new Array(16),D=new Array(16),z={view:null,projection:O,model:D,_ortho:!1},F=(R=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),j=e.cameraObject||n(t,k),N={gl:r,contextLost:!1,pixelRatio:e.pixelRatio||1,canvas:t,selection:x,camera:j,axes:M,axesPixels:null,spikes:A,bounds:y,objects:C,shape:F,aspect:e.aspectRatio||[1,1,1],pickRadius:e.pickRadius||10,zNear:e.zNear||.01,zFar:e.zFar||1e3,fovy:e.fovy||Math.PI/4,clearColor:e.clearColor||[0,0,0,0],autoResize:g(e.autoResize),autoBounds:g(e.autoBounds),autoScale:!!e.autoScale,autoCenter:g(e.autoCenter),clipToBounds:g(e.clipToBounds),snapToData:!!e.snapToData,onselect:e.onselect||null,onrender:e.onrender||null,onclick:e.onclick||null,cameraParams:z,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(e){this.aspect[0]=e.x,this.aspect[1]=e.y,this.aspect[2]=e.z,R=!0},setBounds:function(e,t){this.bounds[0][e]=t.min,this.bounds[1][e]=t.max},setClearColor:function(e){this.clearColor=e},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},Z=[r.drawingBufferWidth/N.pixelRatio|0,r.drawingBufferHeight/N.pixelRatio|0];function B(){if(!N._stopped&&N.autoResize){var e=t.parentNode,r=1,n=1;e&&e!==document.body?(r=e.clientWidth,n=e.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*N.pixelRatio),a=0|Math.ceil(n*N.pixelRatio);if(i!==t.width||a!==t.height){t.width=i,t.height=a;var o=t.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",I=!0}}}function V(){for(var e=C.length,t=L.length,n=0;n0&&0===P[t-1];)P.pop(),L.pop().dispose()}function U(){if(N.contextLost)return!0;r.isContextLost()&&(N.contextLost=!0,N.mouseListener.enabled=!1,N.selection.object=null,N.oncontextloss&&N.oncontextloss())}N.autoResize&&B(),window.addEventListener("resize",B),N.update=function(e){N._stopped||(e=e||{},I=!0,R=!0)},N.add=function(e){N._stopped||(e.axes=M,C.push(e),E.push(-1),I=!0,R=!0,V())},N.remove=function(e){if(!N._stopped){var t=C.indexOf(e);t<0||(C.splice(t,1),E.pop(),I=!0,R=!0,V())}},N.dispose=function(){if(!N._stopped&&(N._stopped=!0,window.removeEventListener("resize",B),t.removeEventListener("webglcontextlost",U),N.mouseListener.enabled=!1,!N.contextLost)){M.dispose(),A.dispose();for(var e=0;ex.distance)continue;for(var u=0;u 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),t.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),t.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},8271:function(e,t,r){"use strict";var n=r(5158),i=r(5827),a=r(5306),o=r(8023);function s(e,t,r,n,i){this.plot=e,this.offsetBuffer=t,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(e,t){var r=e.gl,a=i(r),l=i(r),u=n(r,o.pointVertex,o.pointFragment),c=n(r,o.pickVertex,o.pickFragment),f=new s(e,a,l,u,c);return f.update(t),e.addObject(f),f};var l=s.prototype;l.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},l.update=function(e){var t;function r(t,r){return t in e?e[t]:r}e=e||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=e.positions.length>>>1,i=e.positions instanceof Float32Array,o=e.idToIndex instanceof Int32Array&&e.idToIndex.length>=n,s=e.positions,l=i?s:a.mallocFloat32(s.length),u=o?e.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),t=0;t>>1;for(r=0;r=t[0]&&a<=t[2]&&o>=t[1]&&o<=t[3]&&n++}return n}(this.points,o),c=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(u,.33333)));e[0]=2/s,e[4]=2/l,e[6]=-2*o[0]/s-1,e[7]=-2*o[1]/l-1,this.offsetBuffer.bind(),i.bind(),i.attributes.position.pointer(),i.uniforms.matrix=e,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointCloud=c<5,i.uniforms.pointSize=c,i.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(t[0]=255&r,t[1]=r>>8&255,t[2]=r>>16&255,t[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(a.UNSIGNED_BYTE),i.uniforms.pickOffset=t,this.pickOffset=r);var f=a.getParameter(a.BLEND),d=a.getParameter(a.DITHER);return f&&!this.blend&&a.disable(a.BLEND),d&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),f&&!this.blend&&a.enable(a.BLEND),d&&a.enable(a.DITHER),r+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.pick=function(e,t,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},6093:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,u=t[0],c=t[1],f=t[2],d=t[3],p=r[0],h=r[1],v=r[2],m=r[3];return(a=u*p+c*h+f*v+d*m)<0&&(a=-a,p=-p,h=-h,v=-v,m=-m),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),e[0]=s*u+l*p,e[1]=s*c+l*h,e[2]=s*f+l*v,e[3]=s*d+l*m,e}},8240:function(e){"use strict";e.exports=function(e){return e||0===e?e.toString():""}},4123:function(e,t,r){"use strict";var n=r(875);e.exports=function(e,t,r){var a=i[t];if(a||(a=i[t]={}),e in a)return a[e];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:t,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(e,o);o.triangles=!1;var l,u,c=n(e,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),u=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:c},d={vertex:o,fragment:l,attributes:c},p={vertex:s,fragment:l,attributes:c},h={vertex:a,fragment:u,attributes:c},v={vertex:o,fragment:u,attributes:c},m={vertex:s,fragment:u,attributes:c};function g(e,t){var r=n(e,t),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}t.createPerspective=function(e){return g(e,f)},t.createOrtho=function(e){return g(e,d)},t.createProject=function(e){return g(e,p)},t.createPickPerspective=function(e){return g(e,h)},t.createPickOrtho=function(e){return g(e,v)},t.createPickProject=function(e){return g(e,m)}},2182:function(e,t,r){"use strict";var n=r(3596),i=r(5827),a=r(2944),o=r(5306),s=r(104),l=r(9282),u=r(4123),c=r(8240),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];return e[0]=t[0]*r+t[4]*n+t[8]*i+t[12]*a,e[1]=t[1]*r+t[5]*n+t[9]*i+t[13]*a,e[2]=t[2]*r+t[6]*n+t[10]*i+t[14]*a,e[3]=t[3]*r+t[7]*n+t[11]*i+t[15]*a,e}function p(e,t,r,n){return d(n,n),d(n,n),d(n,n)}function h(e,t){this.index=e,this.dataCoordinate=this.position=t}function v(e){return!0===e||e>1?1:e}function m(e,t,r,n,i,a,o,s,l,u,c,f){this.gl=e,this.pixelRatio=1,this.shader=t,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=c,this.pickProjectShader=f,this.points=[],this._selectResult=new h(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(e){var t=e.gl,r=l.createPerspective(t),n=l.createOrtho(t),o=l.createProject(t),s=l.createPickPerspective(t),u=l.createPickOrtho(t),c=l.createPickProject(t),f=i(t),d=i(t),p=i(t),h=i(t),v=a(t,[{buffer:f,size:3,type:t.FLOAT},{buffer:d,size:4,type:t.FLOAT},{buffer:p,size:2,type:t.FLOAT},{buffer:h,size:4,type:t.UNSIGNED_BYTE,normalized:!0}]),g=new m(t,r,n,o,f,d,p,h,v,s,u,c);return g.update(e),g};var g=m.prototype;g.pickSlots=1,g.setPickBase=function(e){this.pickId=e},g.isTransparent=function(){if(this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&this.projectHasAlpha)return!0;return!1},g.isOpaque=function(){if(!this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],k=f.slice(),T=[0,0,0],M=[[0,0,0],[0,0,0]];function S(e){return e[0]=e[1]=e[2]=0,e}function A(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=1,e}function C(e,t,r,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[r]=n,e}function E(e,t,r,n){var i,a=t.axesProject,o=t.gl,l=e.uniforms,u=r.model||f,c=r.view||f,d=r.projection||f,h=t.axesBounds,v=function(e){for(var t=M,r=0;r<2;++r)for(var n=0;n<3;++n)t[r][n]=Math.max(Math.min(e[r][n],1e8),-1e8);return t}(t.clipBounds);i=t.axes&&t.axes.lastCubeProps?t.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,e.bind(),l.view=c,l.projection=d,l.screenSize=y,l.highlightId=t.highlightId,l.highlightScale=t.highlightScale,l.clipBounds=v,l.pickGroup=t.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=t.projectScale[m],l.opacity=t.projectOpacity[m];for(var g=k,E=0;E<16;++E)g[E]=0;for(E=0;E<4;++E)g[5*E]=1;g[5*m]=0,i[m]<0?g[12+m]=h[0][m]:g[12+m]=h[1][m],s(g,u,g),l.model=g;var P=(m+1)%3,L=(m+2)%3,I=S(x),R=S(b);I[P]=1,R[L]=1;var O=p(0,0,0,A(_,I)),D=p(0,0,0,A(w,R));if(Math.abs(O[1])>Math.abs(D[1])){var z=O;O=D,D=z,z=I,I=R,R=z;var F=P;P=L,L=F}O[0]<0&&(I[P]=-1),D[1]>0&&(R[L]=-1);var j=0,N=0;for(E=0;E<4;++E)j+=Math.pow(u[4*P+E],2),N+=Math.pow(u[4*L+E],2);I[P]/=Math.sqrt(j),R[L]/=Math.sqrt(N),l.axes[0]=I,l.axes[1]=R,l.fragClipBounds[0]=C(T,v[0],m,-1e8),l.fragClipBounds[1]=C(T,v[1],m,1e8),t.vao.bind(),t.vao.draw(o.TRIANGLES,t.vertexCount),t.lineWidth>0&&(o.lineWidth(t.lineWidth*n),t.vao.draw(o.LINES,t.lineVertexCount,t.vertexCount)),t.vao.unbind()}}var P=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function L(e,t,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&E(t,r,n,i),a===r.hasAlpha||o){e.bind();var l=e.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=P,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function I(e,t,r,i){var a;a=Array.isArray(e)?t=this.pointCount||t<0)return null;var r=this.points[t],n=this._selectResult;n.index=t;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},g.highlight=function(e){if(e){var t=e.index,r=255&t,n=t>>8&255,i=t>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},g.update=function(e){if("perspective"in(e=e||{})&&(this.useOrtho=!e.perspective),"orthographic"in e&&(this.useOrtho=!!e.orthographic),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"project"in e)if(Array.isArray(e.project))this.axesProject=e.project;else{var t=!!e.project;this.axesProject=[t,t,t]}if("projectScale"in e)if(Array.isArray(e.projectScale))this.projectScale=e.projectScale.slice();else{var r=+e.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in e){Array.isArray(e.projectOpacity)?this.projectOpacity=e.projectOpacity.slice():(r=+e.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in e&&(this.opacity=v(e.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=e.position,l=e.font||"normal",u=e.alignment||[0,0];if(2===u.length)i=u[0],a=u[1];else for(i=[],a=[],n=0;n0){var R=0,O=x,D=[0,0,0,1],z=[0,0,0,1],F=Array.isArray(p)&&Array.isArray(p[0]),j=Array.isArray(g)&&Array.isArray(g[0]);e:for(n=0;n<_;++n){for(y+=1,w=s[n],k=0;k<3;++k){if(isNaN(w[k])||!isFinite(w[k]))continue e;f[k]=Math.max(f[k],w[k]),c[k]=Math.min(c[k],w[k])}T=(N=I(d,n,l,this.pixelRatio)).mesh,M=N.lines,S=N.bounds;var N,Z=N.visible;if(Z)if(Array.isArray(p)){if(3===(B=F?n0?1-S[0][0]:G<0?1+S[1][0]:1,q*=q>0?1-S[0][1]:q<0?1+S[1][1]:1],X=T.cells||[],K=T.positions||[];for(k=0;k0){var g=r*c;o.drawBox(f-g,d-g,p+g,d+g,a),o.drawBox(f-g,h-g,p+g,h+g,a),o.drawBox(f-g,d-g,f+g,h+g,a),o.drawBox(p-g,d-g,p+g,h+g,a)}}}},s.update=function(e){e=e||{},this.innerFill=!!e.innerFill,this.outerFill=!!e.outerFill,this.innerColor=(e.innerColor||[0,0,0,.5]).slice(),this.outerColor=(e.outerColor||[0,0,0,.5]).slice(),this.borderColor=(e.borderColor||[0,0,0,1]).slice(),this.borderWidth=e.borderWidth||0,this.selectBox=(e.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},2611:function(e,t,r){"use strict";e.exports=function(e,t){var r=t[0],a=t[1],o=n(e,r,a,{}),s=i.mallocUint8(r*a*4);return new l(e,o,s)};var n=r(4234),i=r(5306),a=r(5050),o=r(2288).nextPow2;function s(e,t,r,n,i){this.coord=[e,t],this.id=r,this.value=n,this.distance=i}function l(e,t,r){this.gl=e,this.fbo=t,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(t.bind(),e.readPixels(0,0,t.shape[0],t.shape[1],e.RGBA,e.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var u=l.prototype;Object.defineProperty(u,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(e){if(this.gl){this.fbo.shape=e;var t=this.fbo.shape[0],r=this.fbo.shape[1];if(r*t*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*t*4)),a=0;ar)for(e=r;et)for(e=t;e=0){for(var k=0|w.type.charAt(w.type.length-1),T=new Array(k),M=0;M=0;)S+=1;_[y]=S}var A=new Array(r.length);function C(){d.program=o.program(p,d._vref,d._fref,b,_);for(var e=0;e=0){if((h=d.charCodeAt(d.length-1)-48)<2||h>4)throw new n("","Invalid data type for attribute "+f+": "+d);s(e,t,p[0],i,h,a,f)}else{if(!(d.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+d);var h;if((h=d.charCodeAt(d.length-1)-48)<2||h>4)throw new n("","Invalid data type for attribute "+f+": "+d);l(e,t,p,i,h,a,f)}}}return a};var n=r(9068);function i(e,t,r,n,i,a){this._gl=e,this._wrapper=t,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(e,t,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,e||a.FLOAT,!!t,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(e,t,r,n){return this._constFunc(this._locations[this._index],e,t,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(e){return e!==this._locations[this._index]&&(this._locations[this._index]=0|e,this._wrapper.program=null),0|e}});var o=[function(e,t,r){return void 0===r.length?e.vertexAttrib1f(t,r):e.vertexAttrib1fv(t,r)},function(e,t,r,n){return void 0===r.length?e.vertexAttrib2f(t,r,n):e.vertexAttrib2fv(t,r)},function(e,t,r,n,i){return void 0===r.length?e.vertexAttrib3f(t,r,n,i):e.vertexAttrib3fv(t,r)},function(e,t,r,n,i,a){return void 0===r.length?e.vertexAttrib4f(t,r,n,i,a):e.vertexAttrib4fv(t,r)}];function s(e,t,r,n,a,s,l){var u=o[a],c=new i(e,t,r,n,a,u);Object.defineProperty(s,l,{set:function(t){return e.disableVertexAttribArray(n[r]),u(e,n[r],t),t},get:function(){return c},enumerable:!0})}function l(e,t,r,n,i,a,o){for(var l=new Array(i),u=new Array(i),c=0;c4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+y);e["uniformMatrix"+g+"fv"](s[f],!1,d);break}throw new i("","Unknown uniform data type for "+name+": "+y)}if((g=y.charCodeAt(y.length-1)-48)<2||g>4)throw new i("","Invalid data type");switch(y.charAt(0)){case"b":case"i":e["uniform"+g+"iv"](s[f],d);break;case"v":e["uniform"+g+"fv"](s[f],d);break;default:throw new i("","Unrecognized data type for vector "+name+": "+y)}}}}}}function u(e,t){if("object"!==typeof t)return[[e,t]];var r=[];for(var n in t){var i=t[n],a=e;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"===typeof i?r.push.apply(r,u(a,i)):r.push([a,i])}return r}function c(e,t,n){if("object"===typeof n){var u=f(n);Object.defineProperty(e,t,{get:a(u),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(e,t,{get:(c=n,function(e,t,r){return e.getUniform(t.program,r[c])}),set:l(n),enumerable:!0,configurable:!1}):e[t]=function(e){switch(e){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var t=e.indexOf("vec");if(0<=t&&t<=1&&e.length===4+t){if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===e.charAt(0)?o(r,!1):o(r,0)}if(0===e.indexOf("mat")&&4===e.length){var r;if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+e);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+e)}}(r[n].type);var c}function f(e){var t;if(Array.isArray(e)){t=new Array(e.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7307:function(e,t,r){"use strict";var n=r(2858),i=r(4020),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(e,t,r,a){for(var o=0,s=0;s0)for(k=0;k<8;k++){var T=(k+1)%8;u.push(d[k],p[k],p[T],p[T],d[T],d[k]),f.push(y,g,g,g,y,y),h.push(v,m,m,m,v,v);var M=u.length;c.push([M-6,M-5,M-4],[M-3,M-2,M-1])}var S=d;d=p,p=S;var A=y;y=g,g=A;var C=v;v=m,m=C}return{positions:u,cells:c,vectors:f,vertexIntensity:h}}(e,r,a,o)})),f=[],d=[],p=[],h=[];for(s=0;st)return r-1}return r},l=function(e,t,r){return er?r:e},u=function(e){var t=1/0;e.sort((function(e,t){return e-t}));for(var r=e.length,n=1;nf-1||y>d-1||x>p-1)return n.create();var b,_,w,k,T,M,S=a[0][h],A=a[0][g],C=a[1][v],E=a[1][y],P=a[2][m],L=(o-S)/(A-S),I=(u-C)/(E-C),R=(c-P)/(a[2][x]-P);switch(isFinite(L)||(L=.5),isFinite(I)||(I=.5),isFinite(R)||(R=.5),r.reversedX&&(h=f-1-h,g=f-1-g),r.reversedY&&(v=d-1-v,y=d-1-y),r.reversedZ&&(m=p-1-m,x=p-1-x),r.filled){case 5:T=m,M=x,w=v*p,k=y*p,b=h*p*d,_=g*p*d;break;case 4:T=m,M=x,b=h*p,_=g*p,w=v*p*f,k=y*p*f;break;case 3:w=v,k=y,T=m*d,M=x*d,b=h*d*p,_=g*d*p;break;case 2:w=v,k=y,b=h*d,_=g*d,T=m*d*f,M=x*d*f;break;case 1:b=h,_=g,T=m*f,M=x*f,w=v*f*p,k=y*f*p;break;default:b=h,_=g,w=v*f,k=y*f,T=m*f*d,M=x*f*d}var O=i[b+w+T],D=i[b+w+M],z=i[b+k+T],F=i[b+k+M],j=i[_+w+T],N=i[_+w+M],Z=i[_+k+T],B=i[_+k+M],V=n.create(),U=n.create(),H=n.create(),W=n.create();n.lerp(V,O,j,L),n.lerp(U,D,N,L),n.lerp(H,z,Z,L),n.lerp(W,F,B,L);var G=n.create(),q=n.create();n.lerp(G,V,H,I),n.lerp(q,U,W,I);var Y=n.create();return n.lerp(Y,G,q,R),Y}(t,e,p)},v=e.getDivergence||function(e,t){var r=n.create(),i=1e-4;n.add(r,e,[i,0,0]);var a=h(r);n.subtract(a,a,t),n.scale(a,a,1/i),n.add(r,e,[0,i,0]);var o=h(r);n.subtract(o,o,t),n.scale(o,o,1/i),n.add(r,e,[0,0,i]);var s=h(r);return n.subtract(s,s,t),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},m=[],g=t[0][0],y=t[0][1],x=t[0][2],b=t[1][0],_=t[1][1],w=t[1][2],k=function(e){var t=e[0],r=e[1],n=e[2];return!(tb||r_||nw)},T=10*n.distance(t[0],t[1])/i,M=T*T,S=1,A=0,C=r.length;C>1&&(S=function(e){for(var t=[],r=[],n=[],i={},a={},o={},s=e.length,l=0;lA&&(A=F),D.push(F),m.push({points:L,velocities:I,divergences:D});for(var j=0;j<100*i&&L.lengthM&&n.scale(N,N,T/Math.sqrt(Z)),n.add(N,N,P),R=h(N),n.squaredDistance(O,N)-M>-1e-4*M&&(L.push(N),O=N,I.push(R),z=v(N,R),F=n.length(z),isFinite(F)&&F>A&&(A=F),D.push(F)),P=N}}var B=o(m,e.colormap,A,S);return f?B.tubeScale=f:(0===A&&(A=1),B.tubeScale=.5*c*S/A),B};var c=r(9578),f=r(1140).createMesh;e.exports.createTubeMesh=function(e,t){return f(e,t,{shaders:c,traceType:"streamtube"})}},9054:function(e,t,r){var n=r(5158),i=r(6832),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);t.createShader=function(e){var t=n(e,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createPickShader=function(e){var t=n(e,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createContourShader=function(e){var t=n(e,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t},t.createPickContourShader=function(e){var t=n(e,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t}},3754:function(e,t,r){"use strict";e.exports=function(e){var t=e.gl,r=y(t),n=b(t),s=x(t),l=_(t),u=i(t),c=a(t,[{buffer:u,size:4,stride:w,offset:0},{buffer:u,size:3,stride:w,offset:16},{buffer:u,size:3,stride:w,offset:28}]),f=i(t),d=a(t,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),p=i(t),h=a(t,[{buffer:p,size:2,type:t.FLOAT}]),v=o(t,1,A,t.RGBA,t.UNSIGNED_BYTE);v.minFilter=t.LINEAR,v.magFilter=t.LINEAR;var m=new C(t,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,v,s,l,f,d,p,h,[0,0,0]),g={levels:[[],[],[]]};for(var k in e)g[k]=e[k];return g.colormap=g.colormap||"jet",m.update(g),m};var n=r(2288),i=r(5827),a=r(2944),o=r(8931),s=r(5306),l=r(9156),u=r(7498),c=r(7382),f=r(5050),d=r(4162),p=r(104),h=r(7437),v=r(5070),m=r(9144),g=r(9054),y=g.createShader,x=g.createContourShader,b=g.createPickShader,_=g.createPickContourShader,w=40,k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],M=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function S(e,t,r,n,i){this.position=e,this.index=t,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var e=0;e<3;++e){var t=M[e],r=(e+2)%3;t[(e+1)%3+0]=1,t[r+3]=1,t[e+6]=1}}();var A=256;function C(e,t,r,n,i,a,o,l,u,c,d,p,h,v,m){this.gl=e,this.shape=t,this.bounds=r,this.objectOffset=m,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=d,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new S([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=h,this._dynamicVAO=v,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var E=C.prototype;E.genColormap=function(e,t){var r=!1,n=c([l({colormap:e,nshades:A,format:"rgba"}).map((function(e,n){var i=t?function(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;re&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}(n/255,t):e[3];return i<1&&(r=!0),[e[0],e[1],e[2],255*i]}))]);return u.divseq(n,255),this.hasAlphaScale=r,n},E.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},E.isOpaque=function(){return!this.isTransparent()},E.pickSlots=1,E.setPickBase=function(e){this.pickId=e};var P=[0,0,0],L={showSurface:!1,showContour:!1,projections:[k.slice(),k.slice(),k.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function I(e,t){var r,n,i,a=t.axes&&t.axes.lastCubeProps.axis||P,o=t.showSurface,s=t.showContour;for(r=0;r<3;++r)for(o=o||t.surfaceProject[r],n=0;n<3;++n)s=s||t.contourProject[r][n];for(r=0;r<3;++r){var l=L.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=t.axesBounds[+(a[r]>0)][r],p(l,e.model,l);var u=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=e.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var R={model:k,view:k,projection:k,inverseModel:k.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},O=k.slice(),D=[1,0,0,0,1,0,0,0,1];function z(e,t){e=e||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=R;n.model=e.model||k,n.view=e.view||k,n.projection=e.projection||k,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=h(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=D,n.vertexColor=this.vertexColor;var s=O;for(p(s,n.view,n.model),p(s,n.projection,s),h(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var u=s[12+i];for(o=0;o<3;++o)u+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=u/l}var c=I(n,this);if(c.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[i],this._shader.uniforms.clipBounds=c.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(f.uniforms.permutation=M[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=t[1]*(e.value[1]+(15&e.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var f=c?a:1-a,d=0;d<2;++d)for(var p=i+c,h=s+d,m=f*(d?l:1-l),g=0;g<3;++g)u[g]+=this._field[g].get(p,h)*m;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=v.le(this.contourLevels[x],u[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]Math.abs(_-u[x])&&(y[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/t[0],r.uv[1]=o/t[1],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},E.padField=function(e,t){var r=t.shape.slice(),n=e.shape.slice();u.assign(e.lo(1,1).hi(r[0],r[1]),t),u.assign(e.lo(1).hi(r[0],1),t.hi(r[0],1)),u.assign(e.lo(1,n[1]-1).hi(r[0],1),t.lo(0,r[1]-1).hi(r[0],1)),u.assign(e.lo(0,1).hi(1,r[1]),t.hi(1)),u.assign(e.lo(n[0]-1,1).hi(1,r[1]),t.lo(r[0]-1)),e.set(0,0,t.get(0,0)),e.set(0,n[1]-1,t.get(0,r[1]-1)),e.set(n[0]-1,0,t.get(r[0]-1,0)),e.set(n[0]-1,n[1]-1,t.get(r[0]-1,r[1]-1))},E.update=function(e){e=e||{},this.objectOffset=e.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in e&&(this.contourWidth=j(e.contourWidth,Number)),"showContour"in e&&(this.showContour=j(e.showContour,Boolean)),"showSurface"in e&&(this.showSurface=!!e.showSurface),"contourTint"in e&&(this.contourTint=j(e.contourTint,Boolean)),"contourColor"in e&&(this.contourColor=Z(e.contourColor)),"contourProject"in e&&(this.contourProject=j(e.contourProject,(function(e){return j(e,Boolean)}))),"surfaceProject"in e&&(this.surfaceProject=e.surfaceProject),"dynamicColor"in e&&(this.dynamicColor=Z(e.dynamicColor)),"dynamicTint"in e&&(this.dynamicTint=j(e.dynamicTint,Number)),"dynamicWidth"in e&&(this.dynamicWidth=j(e.dynamicWidth,Number)),"opacity"in e&&(this.opacity=e.opacity),"opacityscale"in e&&(this.opacityscale=e.opacityscale),"colorBounds"in e&&(this.colorBounds=e.colorBounds),"vertexColor"in e&&(this.vertexColor=e.vertexColor?1:0),"colormap"in e&&this._colorMap.setPixels(this.genColormap(e.colormap,this.opacityscale));var t=e.field||e.coords&&e.coords[2]||null,r=!1;if(t||(t=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in e||"coords"in e){var i=(t.shape[0]+2)*(t.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[t.shape[0]+2,t.shape[1]+2]),this.padField(this._field[2],t),this.shape=t.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(e.coords){var l=e.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var u=l[o];for(g=0;g<2;++g)if(u.shape[g]!==a[g])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],u)}}else if(e.ticks){var c=e.ticks;if(!Array.isArray(c)||2!==c.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=c[o];if((Array.isArray(p)||p.length)&&(p=f(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var h=f(p.data,a);h.stride[o]=p.stride[0],h.stride[1^o]=0,this.padField(this._field[o],h)}}else{for(o=0;o<2;++o){var v=[0,0];v[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],v,0)}this._field[0].set(0,0,0);for(var g=0;g0){for(var xe=0;xe<5;++xe)J.pop();B-=1}continue e}J.push(ne[0],ne[1],oe[0],oe[1],ne[2]),B+=1}}re.push(B)}this._contourOffsets[Q]=te,this._contourCounts[Q]=re}var be=s.mallocFloat(J.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=h(o,t.stride.slice()),u=0;"float32"===r?u=e.FLOAT:"float64"===r?(u=e.FLOAT,l=!1,r="float32"):"uint8"===r?u=e.UNSIGNED_BYTE:(u=e.UNSIGNED_BYTE,l=!1,r="uint8");var f,p,m=0;if(2===o.length)m=e.LUMINANCE,o=[o[0],o[1],1],t=n(t.data,o,[t.stride[0],t.stride[1],1],t.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])m=e.ALPHA;else if(2===o[2])m=e.LUMINANCE_ALPHA;else if(3===o[2])m=e.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");m=e.RGBA}}u!==e.FLOAT||e.getExtension("OES_texture_float")||(u=e.UNSIGNED_BYTE,l=!1);var g=t.size;if(l)f=0===t.offset&&t.data.length===g?t.data:t.data.subarray(t.offset,t.offset+g);else{var y=[o[2],o[2]*o[0],1];p=a.malloc(g,r);var x=n(p,o,y,0);"float32"!==r&&"float64"!==r||u!==e.UNSIGNED_BYTE?i.assign(x,t):c(x,t),f=p.subarray(0,g)}var b=v(e);return e.texImage2D(e.TEXTURE_2D,0,m,o[0],o[1],0,m,u,f),l||a.free(p),new d(e,b,o[0],o[1],m,u)}(e,t)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(e){return"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&e instanceof ImageData}var c=function(e,t){i.muls(e,t,255)};function f(e,t,r){var n=e.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(t<0||t>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return e._shape=[t,r],e.bind(),n.texImage2D(n.TEXTURE_2D,0,e.format,t,r,0,e.format,e.type,null),e._mipLevels=[0],e}function d(e,t,r,n,i,a){this.gl=e,this.handle=t,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=e.NEAREST,this._minFilter=e.NEAREST,this._wrapS=e.CLAMP_TO_EDGE,this._wrapT=e.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(e){return o.wrapS=e}},{get:function(){return o._wrapT},set:function(e){return o.wrapT=e}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(e){return o.width=e}},{get:function(){return o._shape[1]},set:function(e){return o.height=e}}]),this._shapeVector=l}var p=d.prototype;function h(e,t){return 3===e.length?1===t[2]&&t[1]===e[0]*e[2]&&t[0]===e[2]:1===t[0]&&t[1]===e[0]}function v(e){var t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t}function m(e,t,r,n,i){var a=e.getParameter(e.MAX_TEXTURE_SIZE);if(t<0||t>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===e.FLOAT&&!e.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=v(e);return e.texImage2D(e.TEXTURE_2D,0,n,t,r,0,n,i,null),new d(e,o,t,r,n,i)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),this._minFilter=e}},magFilter:{get:function(){return this._magFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),this._magFilter=e}},mipSamples:{get:function(){return this._anisoSamples},set:function(e){var t=this._anisoSamples;if(this._anisoSamples=0|Math.max(e,1),t!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,e),this._wrapS=e}},wrapT:{get:function(){return this._wrapT},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,e),this._wrapT=e}},wrap:{get:function(){return this._wrapVector},set:function(e){if(Array.isArray(e)||(e=[e,e]),2!==e.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var t=0;t<2;++t)if(l.indexOf(e[t])<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);this._wrapS=e[0],this._wrapT=e[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),e}},shape:{get:function(){return this._shapeVector},set:function(e){if(Array.isArray(e)){if(2!==e.length)throw new Error("gl-texture2d: Invalid texture shape")}else e=[0|e,0|e];return f(this,0|e[0],0|e[1]),[0|e[0],0|e[1]]}},width:{get:function(){return this._shape[0]},set:function(e){return f(this,e|=0,this._shape[1]),e}},height:{get:function(){return this._shape[1]},set:function(e){return e|=0,f(this,this._shape[0],e),e}}}),p.bind=function(e){var t=this.gl;return void 0!==e&&t.activeTexture(t.TEXTURE0+(0|e)),t.bindTexture(t.TEXTURE_2D,this.handle),void 0!==e?0|e:t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var e=Math.min(this._shape[0],this._shape[1]),t=0;e>0;++t,e>>>=1)this._mipLevels.indexOf(t)<0&&this._mipLevels.push(t)},p.setPixels=function(e,t,r,o){var s=this.gl;this.bind(),Array.isArray(t)?(o=r,r=0|t[1],t=0|t[0]):(t=t||0,r=r||0),o=o||0;var l=u(e)?e:e.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,t,r,this.format,this.type,l);else{if(!(e.shape&&e.stride&&e.data))throw new Error("gl-texture2d: Unsupported data type");if(e.shape.length<2||t+e.shape[1]>this._shape[1]>>>o||r+e.shape[0]>this._shape[0]>>>o||t<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(e,t,r,o,s,l,u,f){var d=f.dtype,p=f.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var v=0,m=0,g=h(p,f.stride.slice());if("float32"===d?v=e.FLOAT:"float64"===d?(v=e.FLOAT,g=!1,d="float32"):"uint8"===d?v=e.UNSIGNED_BYTE:(v=e.UNSIGNED_BYTE,g=!1,d="uint8"),2===p.length)m=e.LUMINANCE,p=[p[0],p[1],1],f=n(f.data,p,[f.stride[0],f.stride[1],1],f.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])m=e.ALPHA;else if(2===p[2])m=e.LUMINANCE_ALPHA;else if(3===p[2])m=e.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");m=e.RGBA}p[2]}if(m!==e.LUMINANCE&&m!==e.ALPHA||s!==e.LUMINANCE&&s!==e.ALPHA||(m=s),m!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=f.size,x=u.indexOf(o)<0;if(x&&u.push(o),v===l&&g)0===f.offset&&f.data.length===y?x?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,l,f.data):e.texSubImage2D(e.TEXTURE_2D,o,t,r,p[0],p[1],s,l,f.data):x?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,l,f.data.subarray(f.offset,f.offset+y)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,p[0],p[1],s,l,f.data.subarray(f.offset,f.offset+y));else{var b;b=l===e.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(b,p,[p[2],p[2]*p[0],1]);v===e.FLOAT&&l===e.UNSIGNED_BYTE?c(_,f):i.assign(_,f),x?e.texImage2D(e.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,y)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,p[0],p[1],s,l,b.subarray(0,y)),l===e.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,t,r,o,this.format,this.type,this._mipLevels,e)}}},3056:function(e){"use strict";e.exports=function(e,t,r){t?t.bind():e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null);var n=0|e.getParameter(e.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=r(5415),i=r(899),a=r(9305)},8827:function(e){e.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}},7622:function(e){e.exports=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},8782:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},8501:function(e){e.exports=function(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},903:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}},5981:function(e,t,r){e.exports=r(8288)},8288:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}},8629:function(e,t,r){e.exports=r(7979)},7979:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}},9305:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},154:function(e){e.exports=1e-6},4932:function(e,t,r){e.exports=function(e,t){var r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(154)},5777:function(e){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},3306:function(e){e.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}},7447:function(e,t,r){e.exports=function(e,t,r,i,a,o){var s,l;for(t||(t=3),r||(r=0),l=i?Math.min(i*t+r,e.length):e.length,s=r;s0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e}},6660:function(e){e.exports=function(e,t){t=t||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}},392:function(e){e.exports=function(e,t,r,n){var i=r[1],a=r[2],o=t[1]-i,s=t[2]-a,l=Math.sin(n),u=Math.cos(n);return e[0]=t[0],e[1]=i+o*u-s*l,e[2]=a+o*l+s*u,e}},3222:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[2],o=t[0]-i,s=t[2]-a,l=Math.sin(n),u=Math.cos(n);return e[0]=i+s*l+o*u,e[1]=t[1],e[2]=a+s*u-o*l,e}},3388:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[1],o=t[0]-i,s=t[1]-a,l=Math.sin(n),u=Math.cos(n);return e[0]=i+o*u-s*l,e[1]=a+o*l+s*u,e[2]=t[2],e}},1624:function(e){e.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}},5685:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}},6722:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}},831:function(e){e.exports=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}},5294:function(e,t,r){e.exports=r(6403)},3303:function(e,t,r){e.exports=r(4337)},6403:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}},4337:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}},8921:function(e,t,r){e.exports=r(911)},911:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}},9908:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}},3255:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}},6568:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,d=u*a+o*i-s*n,p=-o*n-s*i-l*a;return e[0]=c*u+p*-o+f*-l-d*-s,e[1]=f*u+p*-s+d*-o-c*-l,e[2]=d*u+p*-l+c*-s-f*-o,e}},3433:function(e){e.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}},1413:function(e){e.exports=function(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},3470:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},5313:function(e){e.exports=function(){var e=new Float32Array(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}},5446:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},205:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}},4242:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}},5680:function(e){e.exports=function(e,t,r,n){var i=new Float32Array(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}},4020:function(e,t,r){e.exports={create:r(5313),clone:r(1413),fromValues:r(5680),copy:r(3470),set:r(6453),add:r(3433),subtract:r(2705),multiply:r(746),divide:r(205),min:r(2170),max:r(3030),scale:r(5510),scaleAndAdd:r(4224),distance:r(5446),squaredDistance:r(1542),length:r(8177),squaredLength:r(9037),negate:r(6459),inverse:r(8057),normalize:r(381),dot:r(4242),lerp:r(8746),random:r(3770),transformMat4:r(6342),transformQuat:r(5022)}},8057:function(e){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}},8177:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}},8746:function(e){e.exports=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}},3030:function(e){e.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}},2170:function(e){e.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}},746:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}},6459:function(e){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}},381:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o),e}},3770:function(e,t,r){var n=r(381),i=r(5510);e.exports=function(e,t){return t=t||1,e[0]=Math.random(),e[1]=Math.random(),e[2]=Math.random(),e[3]=Math.random(),n(e,e),i(e,e,t),e}},5510:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}},4224:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e}},6453:function(e){e.exports=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}},1542:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return r*r+n*n+i*i+a*a}},9037:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}},2705:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}},6342:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}},5022:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,d=u*a+o*i-s*n,p=-o*n-s*i-l*a;return e[0]=c*u+p*-o+f*-l-d*-s,e[1]=f*u+p*-s+d*-o-c*-l,e[2]=d*u+p*-l+c*-s-f*-o,e[3]=t[3],e}},9365:function(e,t,r){var n=r(8096),i=r(7896);e.exports=function(e){for(var t=Array.isArray(e)?e:n(e),r=0;r0)continue;r=e.slice(0,1).join("")}return N(r),L+=r.length,(A=A.slice(r.length)).length}}function q(){return/[^a-fA-F0-9]/.test(t)?(N(A.join("")),S=l,T):(A.push(t),r=t,T+1)}function Y(){return"."===t||/[eE]/.test(t)?(A.push(t),S=v,r=t,T+1):"x"===t&&1===A.length&&"0"===A[0]?(S=_,A.push(t),r=t,T+1):/[^\d]/.test(t)?(N(A.join("")),S=l,T):(A.push(t),r=t,T+1)}function X(){return"f"===t&&(A.push(t),r=t,T+=1),/[eE]/.test(t)?(A.push(t),r=t,T+1):("-"!==t&&"+"!==t||!/[eE]/.test(r))&&/[^\d]/.test(t)?(N(A.join("")),S=l,T):(A.push(t),r=t,T+1)}function K(){if(/[^\d\w_]/.test(t)){var e=A.join("");return S=j[e]?y:F[e]?g:m,N(A.join("")),S=l,T}return A.push(t),r=t,T+1}};var n=r(399),i=r(9746),a=r(9525),o=r(9458),s=r(3585),l=999,u=9999,c=0,f=1,d=2,p=3,h=4,v=5,m=6,g=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3585:function(e,t,r){var n=r(9525);n=n.slice().filter((function(e){return!/^(gl\_|texture)/.test(e)})),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},9525:function(e){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},9458:function(e,t,r){var n=r(399);e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},399:function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},9746:function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},8096:function(e,t,r){var n=r(3193);e.exports=function(e,t){var r=n(t),i=[];return i=(i=i.concat(r(e))).concat(r(null))}},6832:function(e){e.exports=function(e){"string"===typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n0;)for(var s=(e=o.pop()).adjacent,l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;f<=r;++f){var d=c[f];i[f]=d<0?t:a[d]}var p=this.orient();if(p>0)return u;u.lastVisited=-n,0===p&&o.push(u)}}return null},c.walk=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=t?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];e:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];for(s.lastVisited=r,c=0;c<=n;++c){var f=u[c];if(!(f.lastVisited>=r)){var d=a[c];a[c]=e;var p=this.orient();if(a[c]=d,p<0){s=f;continue e}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},c.addPeaks=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[t];t.lastVisited=r,t.vertices[t.vertices.indexOf(-1)]=r,t.boundary=!1,u.push(t);for(var d=[];f.length>0;){var p=(t=f.pop()).vertices,h=t.adjacent,v=p.indexOf(r);if(!(v<0))for(var m=0;m<=n;++m)if(m!==v){var g=h[m];if(g.boundary&&!(g.lastVisited>=r)){var y=g.vertices;if(g.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=e):l[b]=i[y[b]];if(this.orient()>0){y[x]=r,g.boundary=!1,u.push(g),f.push(g),g.lastVisited=r;continue}g.lastVisited=-r}var _=g.adjacent,w=p.slice(),k=h.slice(),T=new a(w,k,!0);c.push(T);var M=_.indexOf(t);if(!(M<0))for(_[M]=T,k[v]=g,w[m]=-1,k[m]=t,h[m]=T,T.flip(),b=0;b<=n;++b){var S=w[b];if(!(S<0||S===r)){for(var A=new Array(n-1),C=0,E=0;E<=n;++E){var P=w[E];P<0||E===b||(A[C++]=P)}d.push(new o(A,T,b))}}}}}for(d.sort(s),m=0;m+1=0?o[l++]=s[c]:u=1&c;if(u===(1&e)){var f=o[0];o[0]=o[1],o[1]=f}t.push(o)}}return t}},9014:function(e,t,r){"use strict";var n=r(5070);function i(e,t,r,n,i){this.mid=e,this.left=t,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(t?t.count:0)+(r?r.count:0)+n.length}e.exports=function(e){return e&&0!==e.length?new g(m(e)):new g(null)};var a=i.prototype;function o(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function s(e,t){var r=m(t);e.mid=r.mid,e.left=r.left,e.right=r.right,e.leftPoints=r.leftPoints,e.rightPoints=r.rightPoints,e.count=r.count}function l(e,t){var r=e.intervals([]);r.push(t),s(e,r)}function u(e,t){var r=e.intervals([]),n=r.indexOf(t);return n<0?0:(r.splice(n,1),s(e,r),1)}function c(e,t,r){for(var n=0;n=0&&e[n][1]>=t;--n){var i=r(e[n]);if(i)return i}}function d(e,t){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(t+1)?l(this,e):this.left.insert(e):this.left=m([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?l(this,e):this.right.insert(e):this.right=m([e]);else{var r=n.ge(this.leftPoints,e,h),i=n.ge(this.rightPoints,e,v);this.leftPoints.splice(r,0,e),this.rightPoints.splice(i,0,e)}},a.remove=function(e){var t=this.count-this.leftPoints;if(e[1]3*(t-1)?u(this,e):2===(s=this.left.remove(e))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(e[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(t-1)?u(this,e):2===(s=this.right.remove(e))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===e?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===e){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,e,h);athis.mid?this.right&&(r=this.right.queryPoint(e,t))?r:f(this.rightPoints,e,t):d(this.leftPoints,t);var r},a.queryInterval=function(e,t,r){var n;return ethis.mid&&this.right&&(n=this.right.queryInterval(e,t,r))?n:tthis.mid?f(this.rightPoints,e,r):d(this.leftPoints,r)};var y=g.prototype;y.insert=function(e){this.root?this.root.insert(e):this.root=new i(e[0],null,null,[e],[e])},y.remove=function(e){if(this.root){var t=this.root.remove(e);return 2===t&&(this.root=null),0!==t}return!1},y.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},y.queryInterval=function(e,t,r){if(e<=t&&this.root)return this.root.queryInterval(e,t,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9560:function(e){"use strict";e.exports=function(e){for(var t=new Array(e),r=0;r13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},3578:function(e){e.exports=function(e,t,r){return e*(1-r)+t*r}},7191:function(e,t,r){var n=r(4690),i=r(9823),a=r(7332),o=r(7787),s=r(7437),l=r(2142),u={length:r(4693),normalize:r(899),dot:r(9305),cross:r(903)},c=i(),f=i(),d=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],h=[0,0,0];function v(e,t,r,n,i){e[0]=t[0]*n+r[0]*i,e[1]=t[1]*n+r[1]*i,e[2]=t[2]*n+r[2]*i}e.exports=function(e,t,r,i,m,g){if(t||(t=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),m||(m=[0,0,0,1]),g||(g=[0,0,0,1]),!n(c,e))return!1;if(a(f,c),f[3]=0,f[7]=0,f[11]=0,f[15]=1,Math.abs(o(f)<1e-8))return!1;var y,x,b=c[3],_=c[7],w=c[11],k=c[12],T=c[13],M=c[14],S=c[15];if(0!==b||0!==_||0!==w){if(d[0]=b,d[1]=_,d[2]=w,d[3]=S,!s(f,f))return!1;l(f,f),function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o}(m,d,f)}else m[0]=m[1]=m[2]=0,m[3]=1;if(t[0]=k,t[1]=T,t[2]=M,x=c,(y=p)[0][0]=x[0],y[0][1]=x[1],y[0][2]=x[2],y[1][0]=x[4],y[1][1]=x[5],y[1][2]=x[6],y[2][0]=x[8],y[2][1]=x[9],y[2][2]=x[10],r[0]=u.length(p[0]),u.normalize(p[0],p[0]),i[0]=u.dot(p[0],p[1]),v(p[1],p[1],p[0],1,-i[0]),r[1]=u.length(p[1]),u.normalize(p[1],p[1]),i[0]/=r[1],i[1]=u.dot(p[0],p[2]),v(p[2],p[2],p[0],1,-i[1]),i[2]=u.dot(p[1],p[2]),v(p[2],p[2],p[1],1,-i[2]),r[2]=u.length(p[2]),u.normalize(p[2],p[2]),i[1]/=r[2],i[2]/=r[2],u.cross(h,p[1],p[2]),u.dot(p[0],h)<0)for(var A=0;A<3;A++)r[A]*=-1,p[A][0]*=-1,p[A][1]*=-1,p[A][2]*=-1;return g[0]=.5*Math.sqrt(Math.max(1+p[0][0]-p[1][1]-p[2][2],0)),g[1]=.5*Math.sqrt(Math.max(1-p[0][0]+p[1][1]-p[2][2],0)),g[2]=.5*Math.sqrt(Math.max(1-p[0][0]-p[1][1]+p[2][2],0)),g[3]=.5*Math.sqrt(Math.max(1+p[0][0]+p[1][1]+p[2][2],0)),p[2][1]>p[1][2]&&(g[0]=-g[0]),p[0][2]>p[2][0]&&(g[1]=-g[1]),p[1][0]>p[0][1]&&(g[2]=-g[2]),!0}},4690:function(e){e.exports=function(e,t){var r=t[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)e[i]=t[i]*n;return!0}},7649:function(e,t,r){var n=r(1868),i=r(1102),a=r(7191),o=r(7787),s=r(1116),l=f(),u=f(),c=f();function f(){return{translate:d(),scale:d(1),skew:d(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function d(e){return[e||0,e||0,e||0]}e.exports=function(e,t,r,f){if(0===o(t)||0===o(r))return!1;var d=a(t,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!d||!p)&&(n(c.translate,l.translate,u.translate,f),n(c.skew,l.skew,u.skew,f),n(c.scale,l.scale,u.scale,f),n(c.perspective,l.perspective,u.perspective,f),s(c.quaternion,l.quaternion,u.quaternion,f),i(e,c.translate,c.scale,c.skew,c.perspective,c.quaternion),!0)}},1102:function(e,t,r){var n={identity:r(9947),translate:r(998),multiply:r(104),create:r(9823),scale:r(3668),fromRotationTranslation:r(7280)},i=(n.create(),n.create());e.exports=function(e,t,r,a,o,s){return n.identity(e),n.fromRotationTranslation(e,s,t),e[3]=o[0],e[7]=o[1],e[11]=o[2],e[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(e,e,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(e,e,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(e,e,i)),n.scale(e,e,r),e}},9298:function(e,t,r){"use strict";var n=r(5070),i=r(7649),a=r(7437),o=r(6109),s=r(7115),l=r(5240),u=r(3012),c=r(998),f=(r(3668),r(899)),d=[0,0,0];function p(e){this._components=e.slice(),this._time=[0],this.prevMatrix=e.slice(),this.nextMatrix=e.slice(),this.computedMatrix=e.slice(),this.computedInverse=e.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}e.exports=function(e){return new p((e=e||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var h=p.prototype;h.recalcMatrix=function(e){var t=this._time,r=n.le(t,e),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===t.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{var c=t[r+1]-t[r],d=(l=16*r,this.prevMatrix),p=!0;for(u=0;u<16;++u)d[u]=s[l++];var h=this.nextMatrix;for(u=0;u<16;++u)h[u]=s[l++],p=p&&d[u]===h[u];if(c<1e-6||p)for(u=0;u<16;++u)o[u]=d[u];else i(o,d,h,(e-t[r])/c)}var v=this.computedUp;v[0]=o[1],v[1]=o[5],v[2]=o[9],f(v,v);var m=this.computedInverse;a(m,o);var g=this.computedEye,y=m[15];g[0]=m[12]/y,g[1]=m[13]/y,g[2]=m[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(u=0;u<3;++u)x[u]=g[u]-o[2+4*u]*b}},h.idle=function(e){if(!(e1&&n(e[o[c-2]],e[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(e[s[c-2]],e[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var f=0,d=(i=0,o.length);i0;--p)r[f++]=s[p];return r};var n=r(417)[3]},6145:function(e,t,r){"use strict";e.exports=function(e,t){t||(t=e,e=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function u(e,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||u!==i||c!==a||l(s))&&(r=0|e,i=u||0,a=c||0,t&&t(r,i,a,o))}function c(e){u(0,e)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function d(e){l(e)&&t&&t(r,i,a,o)}function p(e){0===n.buttons(e)?u(0,e):u(r,e)}function h(e){u(r|n.buttons(e),e)}function v(e){u(r&~n.buttons(e),e)}function m(){s||(s=!0,e.addEventListener("mousemove",p),e.addEventListener("mousedown",h),e.addEventListener("mouseup",v),e.addEventListener("mouseleave",c),e.addEventListener("mouseenter",c),e.addEventListener("mouseout",c),e.addEventListener("mouseover",c),e.addEventListener("blur",f),e.addEventListener("keyup",d),e.addEventListener("keydown",d),e.addEventListener("keypress",d),e!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",d),window.addEventListener("keydown",d),window.addEventListener("keypress",d)))}m();var g={element:e};return Object.defineProperties(g,{enabled:{get:function(){return s},set:function(t){t?m():s&&(s=!1,e.removeEventListener("mousemove",p),e.removeEventListener("mousedown",h),e.removeEventListener("mouseup",v),e.removeEventListener("mouseleave",c),e.removeEventListener("mouseenter",c),e.removeEventListener("mouseout",c),e.removeEventListener("mouseover",c),e.removeEventListener("blur",f),e.removeEventListener("keyup",d),e.removeEventListener("keydown",d),e.removeEventListener("keypress",d),e!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",d),window.removeEventListener("keydown",d),window.removeEventListener("keypress",d)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),g};var n=r(4110)},2565:function(e){var t={left:0,top:0};e.exports=function(e,r,n){r=r||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=e.clientX||0,o=e.clientY||0,s=(i=r)===window||i===document||i===document.body?t:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},4110:function(e,t){"use strict";function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"===typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<=0)return 1< 0"),"function"!==typeof e.vertex&&t("Must specify vertex creation function"),"function"!==typeof e.cell&&t("Must specify cell creation function"),"function"!==typeof e.phase&&t("Must specify phase function");for(var s=e.getters||[],l=new Array(a),u=0;u=0?l[u]=!0:l[u]=!1;return function(e,t,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(e,t,r,n.mallocUint32,n.freeUint32)}(e.vertex,e.cell,e.phase,0,r,l)};var i={"false,0,1":function(e,t,r,n,i){return function(a,o,s,l){var u,c=0|a.shape[0],f=0|a.shape[1],d=a.data,p=0|a.offset,h=0|a.stride[0],v=0|a.stride[1],m=p,g=0|-h,y=0,x=0|-v,b=0,_=-h-v|0,w=0,k=0|h,T=v-h*c|0,M=0,S=0,A=0,C=2*c|0,E=n(C),P=n(C),L=0,I=0,R=-1,O=-1,D=0,z=0|-c,F=0|c,j=0,N=-c-1|0,Z=c-1|0,B=0,V=0,U=0;for(M=0;M0){if(S=1,E[L++]=r(d[m],o,s,l),m+=k,c>0)for(M=1,u=d[m],I=E[L]=r(u,o,s,l),D=E[L+R],j=E[L+z],B=E[L+N],I===D&&I===j&&I===B||(y=d[m+g],b=d[m+x],w=d[m+_],e(M,S,u,y,b,w,I,D,j,B,o,s,l),V=P[L]=A++),L+=1,m+=k,M=2;M0)for(M=1,u=d[m],I=E[L]=r(u,o,s,l),D=E[L+R],j=E[L+z],B=E[L+N],I===D&&I===j&&I===B||(y=d[m+g],b=d[m+x],w=d[m+_],e(M,S,u,y,b,w,I,D,j,B,o,s,l),V=P[L]=A++,B!==j&&t(P[L+z],V,b,w,j,B,o,s,l)),L+=1,m+=k,M=2;M0){if(M=1,E[L++]=r(d[m],o,s,l),m+=k,f>0)for(S=1,u=d[m],I=E[L]=r(u,o,s,l),j=E[L+z],D=E[L+R],B=E[L+N],I===j&&I===D&&I===B||(y=d[m+g],b=d[m+x],w=d[m+_],e(M,S,u,y,b,w,I,j,D,B,o,s,l),V=P[L]=A++),L+=1,m+=k,S=2;S0)for(S=1,u=d[m],I=E[L]=r(u,o,s,l),j=E[L+z],D=E[L+R],B=E[L+N],I===j&&I===D&&I===B||(y=d[m+g],b=d[m+x],w=d[m+_],e(M,S,u,y,b,w,I,j,D,B,o,s,l),V=P[L]=A++,B!==j&&t(P[L+z],V,w,y,B,j,o,s,l)),L+=1,m+=k,S=2;S2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),e.pick(0,-1,1).lo(1).hi(a[1]-2)),t(e.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),e.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),t(e.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),e.pick(-1,0,0).lo(1).hi(a[0]-2)),t(e.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),e.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),t(e.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),e.set(0,0,0,0),e.set(0,0,1,0),e.set(a[0]-1,0,0,0),e.set(a[0]-1,0,1,0),e.set(0,a[1]-1,0,0),e.set(0,a[1]-1,1,0),e.set(a[0]-1,a[1]-1,0,0),e.set(a[0]-1,a[1]-1,1,0),e}}e.exports=function(e,t,r){return Array.isArray(r)||(r=n(t.dimension,"string"===typeof r?r:"clamp")),0===t.size?e:0===t.dimension?(e.set(0),e):function(e){var t=e.join();if(a=c[t])return a;for(var r=e.length,n=[f,d],i=1;i<=r;++i)n.push(p(i));var a=h.apply(void 0,n);return c[t]=a,a}(r)(e,t)}},3581:function(e){"use strict";function t(e,t){var r=Math.floor(t),n=t-r,i=0<=r&&r0;){x<64?(l=x,x=0):(l=64,x-=64);for(var b=0|e[1];b>0;){b<64?(u=b,b=0):(u=64,b-=64),n=g+x*f+b*d,o=y+x*h+b*v;var _=0,w=0,k=0,T=p,M=f-c*p,S=d-l*f,A=m,C=h-c*m,E=v-l*h;for(k=0;k0;){v<64?(l=v,v=0):(l=64,v-=64);for(var m=0|e[0];m>0;){m<64?(s=m,m=0):(s=64,m-=64),n=p+v*c+m*u,o=h+v*d+m*f;var g=0,y=0,x=c,b=u-l*c,_=d,w=f-l*d;for(y=0;y0;){y<64?(u=y,y=0):(u=64,y-=64);for(var x=0|e[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var b=0|e[1];b>0;){b<64?(l=b,b=0):(l=64,b-=64),n=m+y*d+x*c+b*f,o=g+y*v+x*p+b*h;var _=0,w=0,k=0,T=d,M=c-u*d,S=f-s*c,A=v,C=p-u*v,E=h-s*p;for(k=0;kr;){g=0,y=v-o;t:for(m=0;mb)break t;y+=f,g+=d}for(g=v,y=v-o,m=0;m>1,H=U-Z,W=U+Z,G=B,q=H,Y=U,X=W,K=V,$=i+1,J=a-1,Q=!0,ee=0,te=0,re=0,ne=f,ie=t(ne),ae=t(ne);M=l*G,S=l*q,N=s;e:for(T=0;T0){m=G,G=q,q=m;break e}if(re<0)break e;N+=p}M=l*X,S=l*K,N=s;e:for(T=0;T0){m=X,X=K,K=m;break e}if(re<0)break e;N+=p}M=l*G,S=l*Y,N=s;e:for(T=0;T0){m=G,G=Y,Y=m;break e}if(re<0)break e;N+=p}M=l*q,S=l*Y,N=s;e:for(T=0;T0){m=q,q=Y,Y=m;break e}if(re<0)break e;N+=p}M=l*G,S=l*X,N=s;e:for(T=0;T0){m=G,G=X,X=m;break e}if(re<0)break e;N+=p}M=l*Y,S=l*X,N=s;e:for(T=0;T0){m=Y,Y=X,X=m;break e}if(re<0)break e;N+=p}M=l*q,S=l*K,N=s;e:for(T=0;T0){m=q,q=K,K=m;break e}if(re<0)break e;N+=p}M=l*q,S=l*Y,N=s;e:for(T=0;T0){m=q,q=Y,Y=m;break e}if(re<0)break e;N+=p}M=l*X,S=l*K,N=s;e:for(T=0;T0){m=X,X=K,K=m;break e}if(re<0)break e;N+=p}for(M=l*G,S=l*q,A=l*Y,C=l*X,E=l*K,P=l*B,L=l*U,I=l*V,j=0,N=s,T=0;T0)){if(re<0){for(M=l*b,S=l*$,A=l*J,N=s,T=0;T0)for(;;){for(_=s+J*l,j=0,T=0;T0)){for(_=s+J*l,j=0,T=0;TV){e:for(;;){for(_=s+$*l,j=0,N=s,T=0;T1&&n?s(r,n[0],n[1]):s(r)}(e,t,l);return n(l,u)}},8729:function(e,t,r){"use strict";var n=r(8139),i={};e.exports=function(e){var t=e.order,r=e.dtype,a=[t,r].join(":"),o=i[a];return o||(i[a]=o=n(t,r)),o(e),e}},5050:function(e,t,r){var n=r(4780),i="undefined"!==typeof Float64Array;function a(e,t){return e[0]-t[0]}function o(){var e,t=this.stride,r=new Array(t.length);for(e=0;e=0&&(t+=a*(r=0|e),i-=r),new n(this.data,i,a,t)},i.step=function(e){var t=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"===typeof e&&((a=0|e)<0?(i+=r*(t-1),t=o(-t/a)):t=o(t/a),r*=a),new n(this.data,t,r,i)},i.transpose=function(e){e=void 0===e?0:0|e;var t=this.shape,r=this.stride;return new n(this.data,t[e],r[e],this.offset)},i.pick=function(e){var r=[],n=[],i=this.offset;return"number"===typeof e&&e>=0?i=i+this.stride[0]*e|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,t[r.length+1])(this.data,r,n,i)},function(e,t,r,i){return new n(e,t[0],r[0],i)}},2:function(e,t,r){function n(e,t,r,n,i,a){this.data=e,this.shape=[t,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=e,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(t,r,n){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]=n},i.get=function(t,r){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]},i.index=function(e,t){return this.offset+this.stride[0]*e+this.stride[1]*t},i.hi=function(e,t){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,this.stride[0],this.stride[1],this.offset)},i.lo=function(e,t){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"===typeof e&&e>=0&&(r+=s*(i=0|e),a-=i),"number"===typeof t&&t>=0&&(r+=l*(i=0|t),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(e,t){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,u=Math.ceil;return"number"===typeof e&&((l=0|e)<0?(s+=a*(r-1),r=u(-r/l)):r=u(r/l),a*=l),"number"===typeof t&&((l=0|t)<0?(s+=o*(i-1),i=u(-i/l)):i=u(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(e,t){e=void 0===e?0:0|e,t=void 0===t?1:0|t;var r=this.shape,i=this.stride;return new n(this.data,r[e],r[t],i[e],i[t],this.offset)},i.pick=function(e,r){var n=[],i=[],a=this.offset;return"number"===typeof e&&e>=0?a=a+this.stride[0]*e|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"===typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,t[n.length+1])(this.data,n,i,a)},function(e,t,r,i){return new n(e,t[0],t[1],r[0],r[1],i)}},3:function(e,t,r){function n(e,t,r,n,i,a,o,s){this.data=e,this.shape=[t,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=e,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var e=Math.abs(this.stride[0]),t=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return e>t?t>r?[2,1,0]:e>r?[1,2,0]:[1,0,2]:e>r?[2,0,1]:r>t?[0,1,2]:[0,2,1]}}),i.set=function(t,r,n,i){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(t,r,n){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]},i.index=function(e,t,r){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r},i.hi=function(e,t,r){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(e,t,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.stride[0],c=this.stride[1],f=this.stride[2];return"number"===typeof e&&e>=0&&(i+=u*(a=0|e),o-=a),"number"===typeof t&&t>=0&&(i+=c*(a=0|t),s-=a),"number"===typeof r&&r>=0&&(i+=f*(a=0|r),l-=a),new n(this.data,o,s,l,u,c,f,i)},i.step=function(e,t,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],u=this.stride[2],c=this.offset,f=0,d=Math.ceil;return"number"===typeof e&&((f=0|e)<0?(c+=s*(i-1),i=d(-i/f)):i=d(i/f),s*=f),"number"===typeof t&&((f=0|t)<0?(c+=l*(a-1),a=d(-a/f)):a=d(a/f),l*=f),"number"===typeof r&&((f=0|r)<0?(c+=u*(o-1),o=d(-o/f)):o=d(o/f),u*=f),new n(this.data,i,a,o,s,l,u,c)},i.transpose=function(e,t,r){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[e],i[t],i[r],a[e],a[t],a[r],this.offset)},i.pick=function(e,r,n){var i=[],a=[],o=this.offset;return"number"===typeof e&&e>=0?o=o+this.stride[0]*e|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"===typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"===typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,t[i.length+1])(this.data,i,a,o)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],r[0],r[1],r[2],i)}},4:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,u){this.data=e,this.shape=[t,r,n,i],this.stride=[a,o,s,l],this.offset=0|u}var i=n.prototype;return i.dtype=e,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(t,r,n,i){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(e,t,r,n){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n},i.hi=function(e,t,r,i){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(e,t,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],u=this.shape[2],c=this.shape[3],f=this.stride[0],d=this.stride[1],p=this.stride[2],h=this.stride[3];return"number"===typeof e&&e>=0&&(a+=f*(o=0|e),s-=o),"number"===typeof t&&t>=0&&(a+=d*(o=0|t),l-=o),"number"===typeof r&&r>=0&&(a+=p*(o=0|r),u-=o),"number"===typeof i&&i>=0&&(a+=h*(o=0|i),c-=o),new n(this.data,s,l,u,c,f,d,p,h,a)},i.step=function(e,t,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],u=this.stride[0],c=this.stride[1],f=this.stride[2],d=this.stride[3],p=this.offset,h=0,v=Math.ceil;return"number"===typeof e&&((h=0|e)<0?(p+=u*(a-1),a=v(-a/h)):a=v(a/h),u*=h),"number"===typeof t&&((h=0|t)<0?(p+=c*(o-1),o=v(-o/h)):o=v(o/h),c*=h),"number"===typeof r&&((h=0|r)<0?(p+=f*(s-1),s=v(-s/h)):s=v(s/h),f*=h),"number"===typeof i&&((h=0|i)<0?(p+=d*(l-1),l=v(-l/h)):l=v(l/h),d*=h),new n(this.data,a,o,s,l,u,c,f,d,p)},i.transpose=function(e,t,r,i){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[e],a[t],a[r],a[i],o[e],o[t],o[r],o[i],this.offset)},i.pick=function(e,r,n,i){var a=[],o=[],s=this.offset;return"number"===typeof e&&e>=0?s=s+this.stride[0]*e|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"===typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"===typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"===typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,t[a.length+1])(this.data,a,o,s)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],r[0],r[1],r[2],r[3],i)}},5:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,u,c,f){this.data=e,this.shape=[t,r,n,i,a],this.stride=[o,s,l,u,c],this.offset=0|f}var i=n.prototype;return i.dtype=e,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a,o){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(t,r,n,i,a){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(e,t,r,n,i){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(e,t,r,i,a){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,"number"!==typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(e,t,r,i,a){var o=this.offset,s=0,l=this.shape[0],u=this.shape[1],c=this.shape[2],f=this.shape[3],d=this.shape[4],p=this.stride[0],h=this.stride[1],v=this.stride[2],m=this.stride[3],g=this.stride[4];return"number"===typeof e&&e>=0&&(o+=p*(s=0|e),l-=s),"number"===typeof t&&t>=0&&(o+=h*(s=0|t),u-=s),"number"===typeof r&&r>=0&&(o+=v*(s=0|r),c-=s),"number"===typeof i&&i>=0&&(o+=m*(s=0|i),f-=s),"number"===typeof a&&a>=0&&(o+=g*(s=0|a),d-=s),new n(this.data,l,u,c,f,d,p,h,v,m,g,o)},i.step=function(e,t,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.shape[3],c=this.shape[4],f=this.stride[0],d=this.stride[1],p=this.stride[2],h=this.stride[3],v=this.stride[4],m=this.offset,g=0,y=Math.ceil;return"number"===typeof e&&((g=0|e)<0?(m+=f*(o-1),o=y(-o/g)):o=y(o/g),f*=g),"number"===typeof t&&((g=0|t)<0?(m+=d*(s-1),s=y(-s/g)):s=y(s/g),d*=g),"number"===typeof r&&((g=0|r)<0?(m+=p*(l-1),l=y(-l/g)):l=y(l/g),p*=g),"number"===typeof i&&((g=0|i)<0?(m+=h*(u-1),u=y(-u/g)):u=y(u/g),h*=g),"number"===typeof a&&((g=0|a)<0?(m+=v*(c-1),c=y(-c/g)):c=y(c/g),v*=g),new n(this.data,o,s,l,u,c,f,d,p,h,v,m)},i.transpose=function(e,t,r,i,a){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[e],o[t],o[r],o[i],o[a],s[e],s[t],s[r],s[i],s[a],this.offset)},i.pick=function(e,r,n,i,a){var o=[],s=[],l=this.offset;return"number"===typeof e&&e>=0?l=l+this.stride[0]*e|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"===typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"===typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"===typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"===typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,t[o.length+1])(this.data,o,s,l)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],t[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(e,t){var r=-1===t?"T":String(t),n=s[r];return-1===t?n(e):0===t?n(e,u[e][0]):n(e,u[e],o)}var u={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(e,t,r,a){if(void 0===e)return(0,u.array[0])([]);"number"===typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var o=t.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=t[s]}if(void 0===a)for(a=0,s=0;s>>0;e.exports=function(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(0===e)return t<0?-i:i;var r=n.hi(e),o=n.lo(e);return t>e===e>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},115:function(e,t){t.vertexNormals=function(e,t,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var b=i[u],_=1/Math.sqrt(m*y);for(x=0;x<3;++x){var w=(x+1)%3,k=(x+2)%3;b[x]+=_*(g[w]*v[k]-g[k]*v[w])}}}for(o=0;oa)for(_=1/Math.sqrt(T),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},t.faceNormals=function(e,t,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(p):0,u=0;u<3;++u)d[u]*=p;i[o]=d}return i}},567:function(e){"use strict";e.exports=function(e,t,r,n,i,a,o,s,l,u){var c=t+a+u;if(f>0){var f=Math.sqrt(c+1);e[0]=.5*(o-l)/f,e[1]=.5*(s-n)/f,e[2]=.5*(r-a)/f,e[3]=.5*f}else{var d=Math.max(t,a,u);f=Math.sqrt(2*d-c+1),t>=d?(e[0]=.5*f,e[1]=.5*(i+r)/f,e[2]=.5*(s+n)/f,e[3]=.5*(o-l)/f):a>=d?(e[0]=.5*(r+i)/f,e[1]=.5*f,e[2]=.5*(l+o)/f,e[3]=.5*(s-n)/f):(e[0]=.5*(n+s)/f,e[1]=.5*(o+l)/f,e[2]=.5*f,e[3]=.5*(r-i)/f)}return e}},7774:function(e,t,r){"use strict";e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.rotation||[0,0,0,1],n=e.radius||1;t=[].slice.call(t,0,3),c(r=[].slice.call(r,0,4),r);var i=new f(r,t,Math.log(n));return i.setDistanceLimits(e.zoomMin,e.zoomMax),("eye"in e||"up"in e)&&i.lookAt(0,e.eye,e.center,e.up),i};var n=r(8444),i=r(3012),a=r(5950),o=r(7437),s=r(567);function l(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function u(e,t,r,n){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2)+Math.pow(n,2))}function c(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=u(r,n,i,a);o>1e-6?(e[0]=r/o,e[1]=n/o,e[2]=i/o,e[3]=a/o):(e[0]=e[1]=e[2]=0,e[3]=1)}function f(e,t,r){this.radius=n([r]),this.center=n(t),this.rotation=n(e),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var d=f.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(e){this.radius.curve(e),this.center.curve(e),this.rotation.curve(e);var t=this.computedRotation;c(t,t);var r=this.computedMatrix;a(r,t);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,f=0;f<3;++f)u+=r[l+4*f]*i[f];r[12+l]=-u}},d.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r},d.idle=function(e){this.center.idle(e),this.radius.idle(e),this.rotation.idle(e)},d.flush=function(e){this.center.flush(e),this.radius.flush(e),this.rotation.flush(e)},d.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],u=l(a,o,s);a/=u,o/=u,s/=u;var c=i[0],f=i[4],d=i[8],p=c*a+f*o+d*s,h=l(c-=a*p,f-=o*p,d-=s*p);c/=h,f/=h,d/=h;var v=i[2],m=i[6],g=i[10],y=v*a+m*o+g*s,x=v*c+m*f+g*d,b=l(v-=y*a+x*c,m-=y*o+x*f,g-=y*s+x*d);v/=b,m/=b,g/=b;var _=c*t+a*r,w=f*t+o*r,k=d*t+s*r;this.center.move(e,_,w,k);var T=Math.exp(this.computedRadius[0]);T=Math.max(1e-4,T+n),this.radius.set(e,Math.log(T))},d.rotate=function(e,t,r,n){this.recalcMatrix(e),t=t||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],c=i[1],f=i[5],d=i[9],p=i[2],h=i[6],v=i[10],m=t*a+r*c,g=t*o+r*f,y=t*s+r*d,x=-(h*y-v*g),b=-(v*m-p*y),_=-(p*g-h*m),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),k=u(x,b,_,w);k>1e-6?(x/=k,b/=k,_/=k,w/=k):(x=b=_=0,w=1);var T=this.computedRotation,M=T[0],S=T[1],A=T[2],C=T[3],E=M*w+C*x+S*_-A*b,P=S*w+C*b+A*x-M*_,L=A*w+C*_+M*b-S*x,I=C*w-M*x-S*b-A*_;if(n){x=p,b=h,_=v;var R=Math.sin(n)/l(x,b,_);x*=R,b*=R,_*=R,I=I*(w=Math.cos(t))-(E=E*w+I*x+P*_-L*b)*x-(P=P*w+I*b+L*x-E*_)*b-(L=L*w+I*_+E*b-P*x)*_}var O=u(E,P,L,I);O>1e-6?(E/=O,P/=O,L/=O,I/=O):(E=P=L=0,I=1),this.rotation.set(e,E,P,L,I)},d.lookAt=function(e,t,r,n){this.recalcMatrix(e),r=r||this.computedCenter,t=t||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,t,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),c(o,o),this.rotation.set(e,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-t[u],2);this.radius.set(e,.5*Math.log(Math.max(l,1e-6))),this.center.set(e,r[0],r[1],r[2])},d.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},d.setMatrix=function(e,t){var r=this.computedRotation;s(r,t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]),c(r,r),this.rotation.set(e,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,t);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,u=n[14]/i;this.recalcMatrix(e);var f=Math.exp(this.computedRadius[0]);this.center.set(e,a-n[2]*f,l-n[6]*f,u-n[10]*f),this.radius.idle(e)}else this.center.idle(e),this.radius.idle(e)},d.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},d.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},d.getDistanceLimits=function(e){var t=this.radius.bounds;return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(e){var t=this.lastT(),r=e.center;r&&this.center.set(t,r[0],r[1],r[2]);var n=e.rotation;n&&this.rotation.set(t,n[0],n[1],n[2],n[3]);var i=e.distance;i&&i>0&&this.radius.set(t,Math.log(i)),this.setDistanceLimits(e.zoomMin,e.zoomMax)}},4930:function(e,t,r){"use strict";var n=r(6184);e.exports=function(e,t,r){return n(r="undefined"!==typeof r?r+"":" ",t)+e}},4405:function(e){e.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},4166:function(e,t,r){"use strict";e.exports=function(e,t){for(var r=0|t.length,i=e.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var d=a[f][r],p=0;p0&&(o=h,s=v,l=f)}return i||o&&u(o,l),s}function f(e,r){var i=a[r][e][0],o=[e];u(i,r);for(var s=i[1^r];;){for(;s!==e;)o.push(s),s=c(o[o.length-2],s,!1);if(a[0][e].length+a[1][e].length===0)break;var l=o[o.length-1],f=e,d=o[1],p=c(l,f,!0);if(n(t[l],t[f],t[d],t[p])<0)break;o.push(e),s=c(l,f)}return o}function d(e,t){return t[1]===t[t.length-1]}for(o=0;o0;){a[0][o].length;var v=f(o,p);d(0,v)?h.push.apply(h,v):(h.length>0&&l.push(h),h=v)}h.length>0&&l.push(h)}return l};var n=r(9398)},3959:function(e,t,r){"use strict";e.exports=function(e,t){for(var r=n(e,t.length),i=new Array(t.length),a=new Array(t.length),o=[],s=0;s0;){i[p=o.pop()]=!1;var u=r[p];for(s=0;s0}))).length,m=new Array(v),g=new Array(v);for(p=0;p0;){var j=z.pop(),N=C[j];l(N,(function(e,t){return e-t}));var Z,B=N.length,V=F[j];for(0===V&&(Z=[U=h[j]]),p=0;p=0||(F[H]=1^V,z.push(H),0===V&&(D(U=h[H])||(U.reverse(),Z.push(U))))}0===V&&r.push(Z)}return r};var n=r(8348),i=r(4166),a=r(211),o=r(9660),s=r(9662),l=r(1215),u=r(3959);function c(e,t){for(var r=new Array(e),n=0;n0&&t[i]===r[0]))return 1;a=e[i-1]}for(var s=1;a;){var l=a.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(u>0)a=a.left;else{if(!(u<0))return 0;s=1,a=a.right}}return s}}(g.slabs,g.coordinates);return 0===a.length?y:function(e,t){return function(r){return e(r[0],r[1])?0:t(r)}}(l(a),y)};var n=r(417)[3],i=r(4385),a=r(9014),o=r(5070);function s(){return!0}function l(e){for(var t={},r=0;r=u?(T=1,y=u+2*d+h):y=d*(T=-d/u)+h):(T=0,p>=0?(M=0,y=h):-p>=f?(M=1,y=f+2*p+h):y=p*(M=-p/f)+h);else if(M<0)M=0,d>=0?(T=0,y=h):-d>=u?(T=1,y=u+2*d+h):y=d*(T=-d/u)+h;else{var S=1/k;y=(T*=S)*(u*T+c*(M*=S)+2*d)+M*(c*T+f*M+2*p)+h}else T<0?(b=f+p)>(x=c+d)?(_=b-x)>=(w=u-2*c+f)?(T=1,M=0,y=u+2*d+h):y=(T=_/w)*(u*T+c*(M=1-T)+2*d)+M*(c*T+f*M+2*p)+h:(T=0,b<=0?(M=1,y=f+2*p+h):p>=0?(M=0,y=h):y=p*(M=-p/f)+h):M<0?(b=u+d)>(x=c+p)?(_=b-x)>=(w=u-2*c+f)?(M=1,T=0,y=f+2*p+h):y=(T=1-(M=_/w))*(u*T+c*M+2*d)+M*(c*T+f*M+2*p)+h:(M=0,b<=0?(T=1,y=u+2*d+h):d>=0?(T=0,y=h):y=d*(T=-d/u)+h):(_=f+p-c-d)<=0?(T=0,M=1,y=f+2*p+h):_>=(w=u-2*c+f)?(T=1,M=0,y=u+2*d+h):y=(T=_/w)*(u*T+c*(M=1-T)+2*d)+M*(c*T+f*M+2*p)+h;var A=1-T-M;for(l=0;l0){var u=e[r-1];if(0===n(s,u)&&a(u)!==l){r-=1;continue}}e[r++]=s}}return e.length=r,e}},6184:function(e){"use strict";var t,r="";e.exports=function(e,n){if("string"!==typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var i=e.length*n;if(t!==e||"undefined"===typeof t)t=e,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,i)}},8161:function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},402:function(e){"use strict";e.exports=function(e){for(var t=e.length,r=e[e.length-1],n=t,i=t-2;i>=0;--i){var a=r;(l=(s=e[i])-((r=a+s)-a))&&(e[--n]=r,r=l)}var o=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(e,t,r)},function(e,t,r,n){var i=e[0]-n[0],a=t[0]-n[0],o=r[0]-n[0],s=e[1]-n[1],l=t[1]-n[1],u=r[1]-n[1],c=e[2]-n[2],f=t[2]-n[2],p=r[2]-n[2],h=a*u,v=o*l,m=o*s,g=i*u,y=i*l,x=a*s,b=c*(h-v)+f*(m-g)+p*(y-x),_=7771561172376103e-31*((Math.abs(h)+Math.abs(v))*Math.abs(c)+(Math.abs(m)+Math.abs(g))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(p));return b>_||-b>_?b:d(e,t,r,n)}];function h(e){var t=p[e.length];return t||(t=p[e.length]=c(e.length)),t.apply(void 0,e)}function v(e,t,r,n,i,a,o){return function(t,r,s,l,u){switch(arguments.length){case 0:case 1:return 0;case 2:return n(t,r);case 3:return i(t,r,s);case 4:return a(t,r,s,l);case 5:return o(t,r,s,l,u)}for(var c=new Array(arguments.length),f=0;f0&&o>0||a<0&&o<0)return!1;var s=n(r,e,t),l=n(i,e,t);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(e,t,r,n){for(var i=0;i<2;++i){var a=e[i],o=t[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],f=Math.min(u,c);if(Math.max(u,c)=n?(i=f,(l+=1)=n?(i=f,(l+=1)>1,u=t[2*l+1];if(u===a)return l;a>1,u=t[2*l+1];if(u===a)return l;a>1,u=t[2*l+1];if(u===a)return l;a0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},6656:function(e,t,r){"use strict";var n=r(9392),i=r(9521);function a(e,t){var r=e.length,n=e.length-t.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:return(s=e[0]+e[1]-t[0]-t[1])||i(e[0],e[1])-i(t[0],t[1]);case 3:var a=e[0]+e[1],o=t[0]+t[1];if(s=a+e[2]-(o+t[2]))return s;var s,l=i(e[0],e[1]),u=i(t[0],t[1]);return(s=i(l,e[2])-i(u,t[2]))||i(l+e[2],a)-i(u+t[2],o);default:var c=e.slice(0);c.sort();var f=t.slice(0);f.sort();for(var d=0;d>1,s=a(e[o],t);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(e,t){for(var r=new Array(e.length),i=0,o=r.length;i=e.length||0!==a(e[m],s)););}return r}function f(e,t){if(t<0)return[];for(var r=[],i=(1<>>c&1&&u.push(i[c]);t.push(u)}return s(t)},t.skeleton=f,t.boundary=function(e){for(var t=[],r=0,n=e.length;r>1:(e>>1)-1}function x(e){for(var t=g(e);;){var r=t,n=2*e+1,i=2*(e+1),a=e;if(n0;){var r=y(e);if(!(r>=0&&t0){var e=T[0];return m(0,S-1),S-=1,x(0),e}return-1}function w(e,t){var r=T[e];return u[r]===t?e:(u[r]=-1/0,b(e),_(),u[r]=t,b((S+=1)-1))}function k(e){if(!c[e]){c[e]=!0;var t=s[e],r=l[e];s[r]>=0&&(s[r]=t),l[t]>=0&&(l[t]=r),M[t]>=0&&w(M[t],v(t)),M[r]>=0&&w(M[r],v(r))}}var T=[],M=new Array(a);for(f=0;f>1;f>=0;--f)x(f);for(;;){var A=_();if(A<0||u[A]>r)break;k(A)}var C=[];for(f=0;f=0&&r>=0&&t!==r){var n=M[t],i=M[r];n!==i&&P.push([n,i])}})),i.unique(i.normalize(P)),{positions:C,edges:P}};var n=r(417),i=r(6656)},6638:function(e,t,r){"use strict";e.exports=function(e,t){var r,a,o,s;if(t[0][0]t[1][0]))return i(t,e);r=t[1],a=t[0]}if(e[0][0]e[1][0]))return-i(e,t);o=e[1],s=e[0]}var l=n(r,a,s),u=n(r,a,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,a),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return a[0]-s[0]};var n=r(417);function i(e,t){var r,i,a,o;if(t[0][0]t[1][0])){var s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]),u=Math.min(t[0][1],t[1][1]),c=Math.max(t[0][1],t[1][1]);return lc?s-c:l-c}r=t[1],i=t[0]}e[0][1]0)if(t[0]!==o[1][0])r=e,e=e.right;else{if(l=u(e.right,t))return l;e=e.left}else{if(t[0]!==o[1][0])return e;var l;if(l=u(e.right,t))return l;e=e.left}}return r}function c(e,t,r,n){this.y=e,this.index=t,this.start=r,this.closed=n}function f(e,t,r,n){this.x=e,this.segment=t,this.create=r,this.index=n}s.prototype.castUp=function(e){var t=n.le(this.coordinates,e[0]);if(t<0)return-1;this.slabs[t];var r=u(this.slabs[t],e),i=-1;if(r&&(i=r.value),this.coordinates[t]===e[0]){var s=null;if(r&&(s=r.key),t>0){var c=u(this.slabs[t-1],e);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var f=this.horizontal[t];if(f.length>0){var d=n.ge(f,e[1],l);if(d=f.length)return i;p=f[d]}}if(p.start)if(s){var h=a(s[0],s[1],[e[0],p.y]);s[0][0]>s[1][0]&&(h=-h),h>0&&(i=p.index)}else i=p.index;else p.y!==e[1]&&(i=p.index)}}}return i}},4670:function(e,t,r){"use strict";var n=r(9130),i=r(9662);function a(e,t){var r=i(n(e,t),[t[t.length-1]]);return r[r.length-1]}function o(e,t,r,n){var i=-t/(n-t);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=e.length,s=new Array(o),l=0;l0||i>0&&c<0){var f=o(s,c,l,i);r.push(f),n.push(f.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},e.exports.positive=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},e.exports.negative=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},8974:function(e,t,r){var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(e){return function(e,t){var r,n,o,s,l,u,c,f,d,p=1,h=e.length,v="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?v+=r:(!i.number.test(s.type)||f&&!s.sign?d="":(d=f?"+":"-",r=r.toString().replace(i.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(d+r).length,l=s.width&&c>0?u.repeat(c):"",v+=s.align?d+r+l:"0"===u?d+l+r:l+d+r)}return v}(function(e){if(s[e])return s[e];for(var t,r=e,n=[],a=0;r;){if(null!==(t=i.text.exec(r)))n.push(t[0]);else if(null!==(t=i.modulo.exec(r)))n.push("%");else{if(null===(t=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){a|=1;var o=[],l=t[2],u=[];if(null===(u=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=i.key_access.exec(l)))o.push(u[1]);else{if(null===(u=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}t[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return s[e]=n}(e),arguments)}function o(e,t){return a.apply(null,[e].concat(t||[]))}var s=Object.create(null);t.sprintf=a,t.vsprintf=o,"undefined"!==typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(t,r,t,e))||(e.exports=n))}()},4162:function(e,t,r){"use strict";e.exports=function(e,t){if(e.dimension<=0)return{positions:[],cells:[]};if(1===e.dimension)return function(e,t){for(var r=i(e,t),n=r.length,a=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(e,t,r,n,i,a,o,s,l,u,c,f,d){var p=(o<<0)+(s<<1)+(l<<2)+(u<<3)|0;if(0!==p&&15!==p)switch(p){case 0:case 15:c.push([e-.5,t-.5]);break;case 1:c.push([e-.25-.25*(n+r-2*d)/(r-n),t-.25-.25*(i+r-2*d)/(r-i)]);break;case 2:c.push([e-.75-.25*(-n-r+2*d)/(n-r),t-.25-.25*(a+n-2*d)/(n-a)]);break;case 3:c.push([e-.5,t-.5-.5*(i+r+a+n-4*d)/(r-i+n-a)]);break;case 4:c.push([e-.25-.25*(a+i-2*d)/(i-a),t-.75-.25*(-i-r+2*d)/(i-r)]);break;case 5:c.push([e-.5-.5*(n+r+a+i-4*d)/(r-n+i-a),t-.5]);break;case 6:c.push([e-.5-.25*(-n-r+a+i)/(n-r+i-a),t-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:c.push([e-.75-.25*(a+i-2*d)/(i-a),t-.75-.25*(a+n-2*d)/(n-a)]);break;case 8:c.push([e-.75-.25*(-a-i+2*d)/(a-i),t-.75-.25*(-a-n+2*d)/(a-n)]);break;case 9:c.push([e-.5-.25*(n+r+-a-i)/(r-n+a-i),t-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:c.push([e-.5-.5*(-n-r-a-i+4*d)/(n-r+a-i),t-.5]);break;case 11:c.push([e-.25-.25*(-a-i+2*d)/(a-i),t-.75-.25*(i+r-2*d)/(r-i)]);break;case 12:c.push([e-.5,t-.5-.5*(-i-r-a-n+4*d)/(i-r+a-n)]);break;case 13:c.push([e-.75-.25*(n+r-2*d)/(r-n),t-.25-.25*(-a-n+2*d)/(a-n)]);break;case 14:c.push([e-.25-.25*(-n-r+2*d)/(n-r),t-.25-.25*(-i-r+2*d)/(i-r)])}},cell:function(e,t,r,n,i,a,o,s,l){i?s.push([e,t]):s.push([t,e])}});return function(e,t){var r=[],i=[];return n(e,r,i,t),{positions:r,cells:i}}}},o={}},6946:function(e,t,r){"use strict";e.exports=function e(t,r,i){i=i||{};var a=o[t];a||(a=o[t]={" ":{data:new Float32Array(0),shape:.2}});var s=a[r];if(!s)if(r.length<=1||!/\d/.test(r))s=a[r]=function(e){for(var t=e.cells,r=e.positions,n=new Float32Array(6*t.length),i=0,a=0,o=0;o0&&(f+=.02);var p=new Float32Array(c),h=0,v=-.5*f;for(d=0;dMath.max(r,n)?i[2]=1:r>Math.max(t,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=e[l]*e[l],o+=i[l]*e[l];for(l=0;l<3;++l)i[l]-=o/a*e[l];return s(i,i),i}function d(e,t,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(e,t),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}var p=d.prototype;p.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},p.getDistanceLimits=function(e){var t=this.radius.bounds[0];return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},p.recalcMatrix=function(e){this.center.curve(e),this.up.curve(e),this.right.curve(e),this.radius.curve(e),this.angle.curve(e);for(var t=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=t[a]*r[a],n+=t[a]*t[a];var l=Math.sqrt(n),c=0;for(a=0;a<3;++a)r[a]-=t[a]*i/n,c+=r[a]*r[a],t[a]/=l;var f=Math.sqrt(c);for(a=0;a<3;++a)r[a]/=f;var d=this.computedToward;o(d,t,r),s(d,d);var p=Math.exp(this.computedRadius[0]),h=this.computedAngle[0],v=this.computedAngle[1],m=Math.cos(h),g=Math.sin(h),y=Math.cos(v),x=Math.sin(v),b=this.computedCenter,_=m*y,w=g*y,k=x,T=-m*x,M=-g*x,S=y,A=this.computedEye,C=this.computedMatrix;for(a=0;a<3;++a){var E=_*r[a]+w*d[a]+k*t[a];C[4*a+1]=T*r[a]+M*d[a]+S*t[a],C[4*a+2]=E,C[4*a+3]=0}var P=C[1],L=C[5],I=C[9],R=C[2],O=C[6],D=C[10],z=L*D-I*O,F=I*R-P*D,j=P*O-L*R,N=u(z,F,j);for(z/=N,F/=N,j/=N,C[0]=z,C[4]=F,C[8]=j,a=0;a<3;++a)A[a]=b[a]+C[2+4*a]*p;for(a=0;a<3;++a){c=0;for(var Z=0;Z<3;++Z)c+=C[a+4*Z]*A[Z];C[12+a]=-c}C[15]=1},p.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r};var h=[0,0,0];p.rotate=function(e,t,r,n){if(this.angle.move(e,t,r),n){this.recalcMatrix(e);var i=this.computedMatrix;h[0]=i[2],h[1]=i[6],h[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)i[4*u]=o[u],i[4*u+1]=s[u],i[4*u+2]=l[u];for(a(i,i,n,h),u=0;u<3;++u)o[u]=i[4*u],s[u]=i[4*u+1];this.up.set(e,o[0],o[1],o[2]),this.right.set(e,s[0],s[1],s[2])}},p.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=u(a,o,s);a/=l,o/=l,s/=l;var c=i[0],f=i[4],d=i[8],p=c*a+f*o+d*s,h=u(c-=a*p,f-=o*p,d-=s*p),v=(c/=h)*t+a*r,m=(f/=h)*t+o*r,g=(d/=h)*t+s*r;this.center.move(e,v,m,g);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(e,Math.log(y))},p.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},p.setMatrix=function(e,t,r,n){var a=1;"number"===typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;t||(this.recalcMatrix(e),t=this.computedMatrix);var s=t[a],l=t[a+4],f=t[a+8];if(n){var d=Math.abs(s),p=Math.abs(l),h=Math.abs(f),v=Math.max(d,p,h);d===v?(s=s<0?-1:1,l=f=0):h===v?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var m=u(s,l,f);s/=m,l/=m,f/=m}var g,y,x=t[o],b=t[o+4],_=t[o+8],w=x*s+b*l+_*f,k=u(x-=s*w,b-=l*w,_-=f*w),T=l*(_/=k)-f*(b/=k),M=f*(x/=k)-s*_,S=s*b-l*x,A=u(T,M,S);if(T/=A,M/=A,S/=A,this.center.jump(e,H,W,G),this.radius.idle(e),this.up.jump(e,s,l,f),this.right.jump(e,x,b,_),2===a){var C=t[1],E=t[5],P=t[9],L=C*x+E*b+P*_,I=C*T+E*M+P*S;g=z<0?-Math.PI/2:Math.PI/2,y=Math.atan2(I,L)}else{var R=t[2],O=t[6],D=t[10],z=R*s+O*l+D*f,F=R*x+O*b+D*_,j=R*T+O*M+D*S;g=Math.asin(c(z)),y=Math.atan2(j,F)}this.angle.jump(e,y,g),this.recalcMatrix(e);var N=t[2],Z=t[6],B=t[10],V=this.computedMatrix;i(V,t);var U=V[15],H=V[12]/U,W=V[13]/U,G=V[14]/U,q=Math.exp(this.computedRadius[0]);this.center.jump(e,H-N*q,W-Z*q,G-B*q)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(e){this.center.idle(e),this.up.idle(e),this.right.idle(e),this.radius.idle(e),this.angle.idle(e)},p.flush=function(e){this.center.flush(e),this.up.flush(e),this.right.flush(e),this.radius.flush(e),this.angle.flush(e)},p.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},p.lookAt=function(e,t,r,n){this.recalcMatrix(e),t=t||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=u(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=t[0]-r[0],f=t[1]-r[1],d=t[2]-r[2],p=u(l,f,d);if(!(p<1e-6)){l/=p,f/=p,d/=p;var h=this.computedRight,v=h[0],m=h[1],g=h[2],y=i*v+a*m+o*g,x=u(v-=y*i,m-=y*a,g-=y*o);if(!(x<.01&&(x=u(v=a*d-o*f,m=o*l-i*d,g=i*f-a*l))<1e-6)){v/=x,m/=x,g/=x,this.up.set(e,i,a,o),this.right.set(e,v,m,g),this.center.set(e,r[0],r[1],r[2]),this.radius.set(e,Math.log(p));var b=a*g-o*m,_=o*v-i*g,w=i*m-a*v,k=u(b,_,w),T=i*l+a*f+o*d,M=v*l+m*f+g*d,S=(b/=k)*l+(_/=k)*f+(w/=k)*d,A=Math.asin(c(T)),C=Math.atan2(S,M),E=this.angle._state,P=E[E.length-1],L=E[E.length-2];P%=2*Math.PI;var I=Math.abs(P+2*Math.PI-C),R=Math.abs(P-C),O=Math.abs(P-2*Math.PI-C);I0?r.pop():new ArrayBuffer(e)}function h(e){return new Uint8Array(p(e),0,e)}function v(e){return new Uint16Array(p(2*e),0,e)}function m(e){return new Uint32Array(p(4*e),0,e)}function g(e){return new Int8Array(p(e),0,e)}function y(e){return new Int16Array(p(2*e),0,e)}function x(e){return new Int32Array(p(4*e),0,e)}function b(e){return new Float32Array(p(4*e),0,e)}function _(e){return new Float64Array(p(8*e),0,e)}function w(e){return o?new Uint8ClampedArray(p(e),0,e):h(e)}function k(e){return s?new BigUint64Array(p(8*e),0,e):null}function T(e){return l?new BigInt64Array(p(8*e),0,e):null}function M(e){return new DataView(p(e),0,e)}function S(e){e=n.nextPow2(e);var t=n.log2(e),r=f[t];return r.length>0?r.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))f[n.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|n.log2(t);c[r].push(e)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(e){d(e.buffer)},t.freeArrayBuffer=d,t.freeBuffer=function(e){f[n.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return p(e);switch(t){case"uint8":return h(e);case"uint16":return v(e);case"uint32":return m(e);case"int8":return g(e);case"int16":return y(e);case"int32":return x(e);case"float":case"float32":return b(e);case"double":case"float64":return _(e);case"uint8_clamped":return w(e);case"bigint64":return T(e);case"biguint64":return k(e);case"buffer":return S(e);case"data":case"dataview":return M(e);default:return null}return null},t.mallocArrayBuffer=p,t.mallocUint8=h,t.mallocUint16=v,t.mallocUint32=m,t.mallocInt8=g,t.mallocInt16=y,t.mallocInt32=x,t.mallocFloat32=t.mallocFloat=b,t.mallocFloat64=t.mallocDouble=_,t.mallocUint8Clamped=w,t.mallocBigUint64=k,t.mallocBigInt64=T,t.mallocDataView=M,t.mallocBuffer=S,t.clearCache=function(){for(var e=0;e<32;++e)u.UINT8[e].length=0,u.UINT16[e].length=0,u.UINT32[e].length=0,u.INT8[e].length=0,u.INT16[e].length=0,u.INT32[e].length=0,u.FLOAT[e].length=0,u.DOUBLE[e].length=0,u.BIGUINT64[e].length=0,u.BIGINT64[e].length=0,u.UINT8C[e].length=0,c[e].length=0,f[e].length=0}},1731:function(e){"use strict";function t(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(e){return e})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",w(function(e,t,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(k=0;k-1?parseInt(e[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),S*=Math.pow(.75,l-s),n=n.replace("?px ",F())),M+=.25*E*(l-s)}if(!0===o.superscripts){var u=e.indexOf(h),f=r.indexOf(h),p=u>-1?parseInt(e[1+u]):0,v=f>-1?parseInt(r[1+f]):0;p!==v&&(n=n.replace(F(),"?px "),S*=Math.pow(.75,v-p),n=n.replace("?px ",F())),M-=.25*E*(v-p)}if(!0===o.bolds){var m=e.indexOf(c)>-1,y=r.indexOf(c)>-1;!m&&y&&(n=x?n.replace("italic ","italic bold "):"bold "+n),m&&!y&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=e.indexOf(d)>-1,b=r.indexOf(d)>-1;!x&&b&&(n="italic "+n),x&&!b&&(n=n.replace("italic ",""))}t.font=n}for(w=0;w",a="",o=i.length,s=a.length,l=t[0]===h||t[0]===g,u=0,c=-s;u>-1&&-1!==(u=r.indexOf(i,u))&&-1!==(c=r.indexOf(a,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var d=n[f].indexOf(t[0]);-1===d?n[f]+=t:l&&(n[f]=n[f].substr(0,d+1)+(1+parseInt(n[f][d+1]))+n[f].substr(d+2))}var p=u+o,v=r.substr(p,c-p).indexOf(i);u=-1!==v?v:c+s}return n}function b(e,t){var r=n(e,128);return t?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function _(e,t,r,n){var i=b(e,n),a=function(e,t,r){for(var n=t.textAlign||"start",i=t.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=e.length,l=0;l=0?r[a]:i}))},has___:{value:x((function(e){var r=y(e);return r?n in r:t.indexOf(e)>=0}))},set___:{value:x((function(e,i){var a,o=y(e);return o?o[n]=i:(a=t.indexOf(e))>=0?r[a]=i:(a=t.length,r[a]=i,t[a]=e),this}))},delete___:{value:x((function(e){var i,a,o=y(e);return o?n in o&&delete o[n]:!((i=t.indexOf(e))<0)&&(a=t.length-1,t[i]=void 0,r[i]=r[a],t[i]=t[a],t.length=a,r.length=a,!0)}))}})};v.prototype=Object.create(Object.prototype,{get:{value:function(e,t){return this.get___(e,t)},writable:!0,configurable:!0},has:{value:function(e){return this.has___(e)},writable:!0,configurable:!0},set:{value:function(e,t){return this.set___(e,t)},writable:!0,configurable:!0},delete:{value:function(e){return this.delete___(e)},writable:!0,configurable:!0}}),"function"===typeof r?function(){function n(){this instanceof v||b();var e,n=new r,i=void 0,a=!1;return e=t?function(e,t){return n.set(e,t),n.has(e)||(i||(i=new v),i.set(e,t)),this}:function(e,t){if(a)try{n.set(e,t)}catch(r){i||(i=new v),i.set___(e,t)}else n.set(e,t);return this},Object.create(v.prototype,{get___:{value:x((function(e,t){return i?n.has(e)?n.get(e):i.get___(e,t):n.get(e,t)}))},has___:{value:x((function(e){return n.has(e)||!!i&&i.has___(e)}))},set___:{value:x(e)},delete___:{value:x((function(e){var t=!!n.delete(e);return i&&i.delete___(e)||t}))},permitHostObjects___:{value:x((function(e){if(e!==m)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&"undefined"!==typeof Proxy&&(Proxy=void 0),n.prototype=v.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!==typeof Proxy&&(Proxy=void 0),e.exports=v)}function m(e){e.permitHostObjects___&&e.permitHostObjects___(m)}function g(e){return!(e.substr(0,8)==l&&"___"===e.substr(e.length-3))}function y(e){if(e!==Object(e))throw new TypeError("Not an object: "+e);var t=e[u];if(t&&t.key===e)return t;if(s(e)){t={key:e};try{return o(e,u,{value:t,writable:!1,enumerable:!1,configurable:!1}),t}catch(r){return}}}function x(e){return e.prototype=null,Object.freeze(e)}function b(){p||"undefined"===typeof console||(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},9222:function(e,t,r){var n=r(7178);e.exports=function(){var e={};return function(t){if(("object"!==typeof t||null===t)&&"function"!==typeof t)throw new Error("Weakmap-shim: Key must be object");var r=t.valueOf(e);return r&&r.identity===e?r:n(t,e)}}},7178:function(e){e.exports=function(e,t){var r={identity:t},n=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function(e){return e!==t?n.apply(this,arguments):r},writable:!0}),r}},4037:function(e,t,r){var n=r(9222);e.exports=function(){var e=n();return{get:function(t,r){var n=e(t);return n.hasOwnProperty("value")?n.value:r},set:function(t,r){return e(t).value=r,this},has:function(t){return"value"in e(t)},delete:function(t){return delete e(t).value}}}},6183:function(e){"use strict";var t=function(){return function(e,t,r,n,i,a){var o=e[0],s=r[0],l=[0],u=s;n|=0;var c=0,f=s;for(c=0;c=0!==p>=0&&i.push(l[0]+.5+.5*(d+p)/(d-p)),n+=f,++l[0]}}};e.exports=function(e){return r={funcName:e.funcName},function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=t[s];return l||(t[s]=l=e([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(t.bind(void 0,r));var r}({funcName:"zeroCrossings"})},9584:function(e,t,r){"use strict";e.exports=function(e,t){var r=[];return t=+t||0,n(e.hi(e.shape[0]-1),r,t),r};var n=r(6183)},6601:function(){}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}return r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},r(7386)}()},e.exports=n()},12856:function(e,t,r){"use strict";function n(e,t){for(var r=0;rp)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,v.prototype),t}function v(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return y(e)}return m(e,t,r)}function m(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!v.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|w(e,t),n=h(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(re(e,Uint8Array)){var t=new Uint8Array(e);return b(t.buffer,t.byteOffset,t.byteLength)}return x(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(e));if(re(e,ArrayBuffer)||e&&re(e.buffer,ArrayBuffer))return b(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(re(e,SharedArrayBuffer)||e&&re(e.buffer,SharedArrayBuffer)))return b(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return v.from(n,t,r);var i=function(e){if(v.isBuffer(e)){var t=0|_(e.length),r=h(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||ne(e.length)?h(0):x(e):"Buffer"===e.type&&Array.isArray(e.data)?x(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return v.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(e))}function g(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function y(e){return g(e),h(e<0?0:0|_(e))}function x(e){for(var t=e.length<0?0:0|_(e.length),r=h(t),n=0;n=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return 0|e}function w(e,t){if(v.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||re(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+u(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ee(e).length;default:if(i)return n?-1:Q(e).length;t=(""+t).toLowerCase(),i=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return R(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return z(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function T(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function M(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),ne(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=v.from(t,n)),v.isBuffer(t))return 0===t.length?-1:S(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):S(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function S(e,t,r,n,i){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,d=0;di&&(n=i):n=i;var a,o=t.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function I(e,t,r){return 0===t&&r===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(t,r))}function R(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,u=void 0,c=void 0,f=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128===(192&(l=e[i+1]))&&(f=(31&a)<<6|63&l)>127&&(o=f);break;case 3:l=e[i+1],u=e[i+2],128===(192&l)&&128===(192&u)&&(f=(15&a)<<12|(63&l)<<6|63&u)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=e[i+1],u=e[i+2],c=e[i+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(f=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?(v.isBuffer(a)||(a=v.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!v.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},v.byteLength=w,v.prototype._isBuffer=!0,v.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},d&&(v.prototype[d]=v.prototype.inspect),v.prototype.compare=function(e,t,r,n,i){if(re(e,Uint8Array)&&(e=v.from(e,e.offset,e.byteLength)),!v.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+u(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(n,i),c=e.slice(t,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return A(this,e,t,r);case"utf8":case"utf-8":return C(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return P(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function D(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function Z(e,t,r,n,i,a){if(!v.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function B(e,t,r,n,i){X(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function V(e,t,r,n,i){X(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function U(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return t=+t,r>>>=0,i||U(e,0,r,4),f.write(e,t,r,n,23,4),r+4}function W(e,t,r,n,i){return t=+t,r>>>=0,i||U(e,0,r,8),f.write(e,t,r,n,52,8),r+8}v.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},v.prototype.readUint8=v.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},v.prototype.readBigUInt64LE=ae((function(e){K(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},v.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},v.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},v.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},v.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},v.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},v.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},v.prototype.readBigInt64LE=ae((function(e){K(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<>>=0,t||N(e,4,this.length),f.read(this,e,!0,23,4)},v.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),f.read(this,e,!1,23,4)},v.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),f.read(this,e,!0,52,8)},v.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),f.read(this,e,!1,52,8)},v.prototype.writeUintLE=v.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||Z(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||Z(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},v.prototype.writeUint8=v.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,1,255,0),this[t]=255&e,t+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},v.prototype.writeBigUInt64LE=ae((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),v.prototype.writeBigUInt64BE=ae((function(e){return V(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),v.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);Z(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},v.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);Z(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},v.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},v.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},v.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},v.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},v.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},v.prototype.writeBigInt64LE=ae((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),v.prototype.writeBigInt64BE=ae((function(e){return V(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),v.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},v.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},v.prototype.writeDoubleLE=function(e,t,r){return W(this,e,t,!0,r)},v.prototype.writeDoubleBE=function(e,t,r){return W(this,e,t,!1,r)},v.prototype.copy=function(e,t,r,n){if(!v.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function X(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(r).concat(s),new G.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,i,a)}function K(e,t){if("number"!==typeof e)throw new G.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw K(e,r),new G.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new G.ERR_BUFFER_OUT_OF_BOUNDS;throw new G.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(u(t))}),TypeError),q("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=Y(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Y(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var J=/[^+/0-9A-Za-z-_]/g;function Q(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function ee(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function te(e,t,r,n){var i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ne(e){return e!==e}var ie=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function ae(e){return"undefined"===typeof BigInt?oe:e}function oe(){throw new Error("BigInt not supported")}},35791:function(e){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});var i=e.ua;if(i||"undefined"===typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"===typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!==typeof i)return!1;var a=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},86781:function(e,t,r){"use strict";r.r(t),r.d(t,{sankeyCenter:function(){return d},sankeyCircular:function(){return P},sankeyJustify:function(){return f},sankeyLeft:function(){return u},sankeyRight:function(){return c}});var n=r(33064),i=r(15140),a=r(45879),o=r(2502),s=r.n(o);function l(e){return e.target.depth}function u(e){return e.depth}function c(e,t){return t-1-e.height}function f(e,t){return e.sourceLinks.length?e.depth:t-1}function d(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?(0,n.VV)(e.sourceLinks,l)-1:0}function p(e){return function(){return e}}var h="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function v(e,t){return g(e.source,t.source)||e.index-t.index}function m(e,t){return g(e.target,t.target)||e.index-t.index}function g(e,t){return e.partOfCycle===t.partOfCycle?e.y0-t.y0:"top"===e.circularLinkType||"bottom"===t.circularLinkType?-1:1}function y(e){return e.value}function x(e){return(e.y0+e.y1)/2}function b(e){return x(e.source)}function _(e){return x(e.target)}function w(e){return e.index}function k(e){return e.nodes}function T(e){return e.links}function M(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function S(e,t){return t(e)}var A=25,C=10,E=.3;function P(){var e,t,r=0,a=0,o=1,l=1,u=24,c=w,d=f,S=k,P=T,I=32,O=2,D=null;function F(){var f={nodes:S.apply(null,arguments),links:P.apply(null,arguments)};!function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=(0,i.UI)(e.nodes,c);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==("undefined"===typeof n?"undefined":h(n))&&(n=e.source=M(t,n)),"object"!==("undefined"===typeof i?"undefined":h(i))&&(i=e.target=M(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(f),function(e,t,r){var n=0;if(null===r){for(var i=[],a=0;a0;--h)m(p*=.99,f),w();function v(i){if(t){var c=1/0;d.forEach((function(e){var r=l*t/(e.length+1);c=r0?t+A+C:t,bottom:r=r>0?r+A+C:r,left:a=a>0?a+A+C:a,right:i=i>0?i+A+C:i}}(s),h=function(e,t){var i=(0,n.Fp)(e.nodes,(function(e){return e.column})),s=o-r,c=l-a,f=s+t.right+t.left,d=c+t.top+t.bottom,p=s/f,h=c/d;return r=r*p+t.left,o=0==t.right?o:o*p,a=a*h+t.top,l*=h,e.nodes.forEach((function(e){e.x0=r+e.column*((o-r-u)/i),e.x1=e.x0+u})),h}(s,p);f*=h,s.links.forEach((function(e){e.width=e.value*f})),d.forEach((function(e){var t=e.length;e.forEach((function(e,r){e.depth==d.length-1&&1==t||0==e.depth&&1==t?(e.y0=l/2-e.value*f,e.y1=e.y0+e.value*f):e.partOfCycle?0==R(e,i)?(e.y0=l/2+r,e.y1=e.y0+e.value*f):"top"==e.circularLinkType?(e.y0=a+r,e.y1=e.y0+e.value*f):(e.y0=l-e.value*f-r,e.y1=e.y0+e.value*f):0==p.top||0==p.bottom?(e.y0=(l-a)/t*r,e.y1=e.y0+e.value*f):(e.y0=(l-a)/2-t/2+r,e.y1=e.y0+e.value*f)}))}))}function m(e,t){var r=d.length;d.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&R(i,t)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=l/2-s/2,i.y1=l/2+s/2;else if(o==r-1&&1==a)s=i.y1-i.y0,i.y0=l/2-s/2,i.y1=l/2+s/2;else{var u=(0,n.J6)(i.sourceLinks,_),c=(0,n.J6)(i.targetLinks,b),f=((u&&c?(u+c)/2:u||c)-x(i))*e;i.y0+=f,i.y1+=f}}))}))}function w(){d.forEach((function(t){var r,n,i,o=a,s=t.length;for(t.sort(g),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+e;if((n=o-e-l)>0)for(o=r.y0-=n,r.y1-=n,i=s-2;i>=0;--i)(n=(r=t[i]).y1+e-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}(f,I,c),j(f);for(var p=0;p<4;p++)Y(f,l,c),X(f,0,c),G(f,a,l,c),Y(f,l,c),X(f,0,c);return function(e,t,r){var i=e.nodes,a=e.links,o=!1,s=!1;if(a.forEach((function(e){"top"==e.circularLinkType?o=!0:"bottom"==e.circularLinkType&&(s=!0)})),0==o||0==s){var l=(0,n.VV)(i,(function(e){return e.y0})),u=(r-t)/((0,n.Fp)(i,(function(e){return e.y1}))-l);i.forEach((function(e){var t=(e.y1-e.y0)*u;e.y0=(e.y0-l)*u,e.y1=e.y0+t})),a.forEach((function(e){e.y0=(e.y0-l)*u,e.y1=(e.y1-l)*u,e.width=e.width*u}))}}(f,a,l),z(f,O,l,c),f}function j(e){e.nodes.forEach((function(e){e.sourceLinks.sort(m),e.targetLinks.sort(v)})),e.nodes.forEach((function(e){var t=e.y0,r=t,n=e.y1,i=n;e.sourceLinks.forEach((function(e){e.circular?(e.y0=n-e.width/2,n-=e.width):(e.y0=t+e.width/2,t+=e.width)})),e.targetLinks.forEach((function(e){e.circular?(e.y1=i-e.width/2,i-=e.width):(e.y1=r+e.width/2,r+=e.width)}))}))}return F.nodeId=function(e){return arguments.length?(c="function"===typeof e?e:p(e),F):c},F.nodeAlign=function(e){return arguments.length?(d="function"===typeof e?e:p(e),F):d},F.nodeWidth=function(e){return arguments.length?(u=+e,F):u},F.nodePadding=function(t){return arguments.length?(e=+t,F):e},F.nodes=function(e){return arguments.length?(S="function"===typeof e?e:p(e),F):S},F.links=function(e){return arguments.length?(P="function"===typeof e?e:p(e),F):P},F.size=function(e){return arguments.length?(r=a=0,o=+e[0],l=+e[1],F):[o-r,l-a]},F.extent=function(e){return arguments.length?(r=+e[0][0],o=+e[1][0],a=+e[0][1],l=+e[1][1],F):[[r,a],[o,l]]},F.iterations=function(e){return arguments.length?(I=+e,F):I},F.circularLinkGap=function(e){return arguments.length?(O=+e,F):O},F.nodePaddingRatio=function(e){return arguments.length?(t=+e,F):t},F.sortNodes=function(e){return arguments.length?(D=e,F):D},F.update=function(e){return L(e,c),j(e),e.links.forEach((function(e){e.circular&&(e.circularLinkType=e.y0+e.y11||i>1)}function D(e,t,r){return e.sort(F),e.forEach((function(n,i){var a,o,s=0;if(J(n,r)&&O(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var u=e[l].circularPathData.verticalBuffer+e[l].width/2+t;s=u>s?u:s}n.circularPathData.verticalBuffer=s+n.width/2}})),e}function z(e,t,r,i){var o=(0,n.VV)(e.links,(function(e){return e.source.y0}));e.links.forEach((function(e){e.circular&&(e.circularPathData={})})),D(e.links.filter((function(e){return"top"==e.circularLinkType})),t,i),D(e.links.filter((function(e){return"bottom"==e.circularLinkType})),t,i),e.links.forEach((function(n){if(n.circular){if(n.circularPathData.arcRadius=n.width+C,n.circularPathData.leftNodeBuffer=5,n.circularPathData.rightNodeBuffer=5,n.circularPathData.sourceWidth=n.source.x1-n.source.x0,n.circularPathData.sourceX=n.source.x0+n.circularPathData.sourceWidth,n.circularPathData.targetX=n.target.x0,n.circularPathData.sourceY=n.y0,n.circularPathData.targetY=n.y1,J(n,i)&&O(n))n.circularPathData.leftSmallArcRadius=C+n.width/2,n.circularPathData.leftLargeArcRadius=C+n.width/2,n.circularPathData.rightSmallArcRadius=C+n.width/2,n.circularPathData.rightLargeArcRadius=C+n.width/2,"bottom"==n.circularLinkType?(n.circularPathData.verticalFullExtent=n.source.y1+A+n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.rightLargeArcRadius):(n.circularPathData.verticalFullExtent=n.source.y0-A-n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.rightLargeArcRadius);else{var s=n.source.column,l=n.circularLinkType,u=e.links.filter((function(e){return e.source.column==s&&e.circularLinkType==l}));"bottom"==n.circularLinkType?u.sort(N):u.sort(j);var c=0;u.forEach((function(e,r){e.circularLinkID==n.circularLinkID&&(n.circularPathData.leftSmallArcRadius=C+n.width/2+c,n.circularPathData.leftLargeArcRadius=C+n.width/2+r*t+c),c+=e.width})),s=n.target.column,u=e.links.filter((function(e){return e.target.column==s&&e.circularLinkType==l})),"bottom"==n.circularLinkType?u.sort(B):u.sort(Z),c=0,u.forEach((function(e,r){e.circularLinkID==n.circularLinkID&&(n.circularPathData.rightSmallArcRadius=C+n.width/2+c,n.circularPathData.rightLargeArcRadius=C+n.width/2+r*t+c),c+=e.width})),"bottom"==n.circularLinkType?(n.circularPathData.verticalFullExtent=Math.max(r,n.source.y1,n.target.y1)+A+n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent-n.circularPathData.rightLargeArcRadius):(n.circularPathData.verticalFullExtent=o-A-n.circularPathData.verticalBuffer,n.circularPathData.verticalLeftInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.leftLargeArcRadius,n.circularPathData.verticalRightInnerExtent=n.circularPathData.verticalFullExtent+n.circularPathData.rightLargeArcRadius)}n.circularPathData.leftInnerExtent=n.circularPathData.sourceX+n.circularPathData.leftNodeBuffer,n.circularPathData.rightInnerExtent=n.circularPathData.targetX-n.circularPathData.rightNodeBuffer,n.circularPathData.leftFullExtent=n.circularPathData.sourceX+n.circularPathData.leftLargeArcRadius+n.circularPathData.leftNodeBuffer,n.circularPathData.rightFullExtent=n.circularPathData.targetX-n.circularPathData.rightLargeArcRadius-n.circularPathData.rightNodeBuffer}if(n.circular)n.path=function(e){return"top"==e.circularLinkType?"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 0 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY-e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 0 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 0 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY-e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 0 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY:"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 1 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY+e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 1 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 1 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY+e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 1 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY}(n);else{var f=(0,a.h5)().source((function(e){return[e.source.x0+(e.source.x1-e.source.x0),e.y0]})).target((function(e){return[e.target.x0,e.y1]}));n.path=f(n)}}))}function F(e,t){return V(e)==V(t)?"bottom"==e.circularLinkType?N(e,t):j(e,t):V(t)-V(e)}function j(e,t){return e.y0-t.y0}function N(e,t){return t.y0-e.y0}function Z(e,t){return e.y1-t.y1}function B(e,t){return t.y1-e.y1}function V(e){return e.target.column-e.source.column}function U(e){return e.target.x0-e.source.x1}function H(e,t){var r=I(e),n=U(t)/Math.tan(r);return"up"==$(e)?e.y1+n:e.y1-n}function W(e,t){var r=I(e),n=U(t)/Math.tan(r);return"up"==$(e)?e.y1-n:e.y1+n}function G(e,t,r,n){e.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)e.nodes.forEach((function(o){if(o.column==a){var u,c=s/(l+1),f=Math.pow(1-c,3),d=3*c*Math.pow(1-c,2),p=3*Math.pow(c,2)*(1-c),h=Math.pow(c,3),v=f*i.y0+d*i.y0+p*i.y1+h*i.y1,m=v-i.width/2,g=v+i.width/2;m>o.y0&&ma.y0&&i.y0a.y0&&i.y1a.y1)&&q(e,u,t,r)}))):(g>o.y0&&go.y1)&&(u=g-o.y0+10,o=q(o,u,t,r),e.nodes.forEach((function(e){S(e,n)!=S(o,n)&&e.column==o.column&&e.y0o.y1&&q(e,u,t,r)})))}}))}}))}function q(e,t,r,n){return e.y0+t>=r&&e.y1+t<=n&&(e.y0=e.y0+t,e.y1=e.y1+t,e.targetLinks.forEach((function(e){e.y1=e.y1+t})),e.sourceLinks.forEach((function(e){e.y0=e.y0+t}))),e}function Y(e,t,r,n){e.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>t&&(i.y=i.y-(i.y+(i.y1-i.y0)-t));var a=e.links.filter((function(e){return S(e.source,r)==S(i,r)})),o=a.length;o>1&&a.sort((function(e,t){if(!e.circular&&!t.circular){if(e.target.column==t.target.column)return e.y1-t.y1;if(!K(e,t))return e.y1-t.y1;if(e.target.column>t.target.column){var r=W(t,e);return e.y1-r}if(t.target.column>e.target.column)return W(e,t)-t.y1}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.target.column===t.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.target.column===t.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:"top"==e.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(e){e.y0=s+e.width/2,s+=e.width})),a.forEach((function(e,t){if("bottom"==e.circularLinkType){for(var r=t+1,n=0;r1&&n.sort((function(e,t){if(!e.circular&&!t.circular){if(e.source.column==t.source.column)return e.y0-t.y0;if(!K(e,t))return e.y0-t.y0;if(t.source.column0?"up":"down"}function J(e,t){return S(e.source,t)==S(e.target,t)}},30838:function(e,t,r){"use strict";r.r(t),r.d(t,{sankey:function(){return w},sankeyCenter:function(){return u},sankeyJustify:function(){return l},sankeyLeft:function(){return o},sankeyLinkHorizontal:function(){return S},sankeyRight:function(){return s}});var n=r(33064),i=r(15140);function a(e){return e.target.depth}function o(e){return e.depth}function s(e,t){return t-1-e.height}function l(e,t){return e.sourceLinks.length?e.depth:t-1}function u(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?(0,n.VV)(e.sourceLinks,a)-1:0}function c(e){return function(){return e}}function f(e,t){return p(e.source,t.source)||e.index-t.index}function d(e,t){return p(e.target,t.target)||e.index-t.index}function p(e,t){return e.y0-t.y0}function h(e){return e.value}function v(e){return(e.y0+e.y1)/2}function m(e){return v(e.source)*e.value}function g(e){return v(e.target)*e.value}function y(e){return e.index}function x(e){return e.nodes}function b(e){return e.links}function _(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function w(){var e=0,t=0,r=1,a=1,o=24,s=8,u=y,w=l,k=x,T=b,M=32,S=2/3;function A(){var l={nodes:k.apply(null,arguments),links:T.apply(null,arguments)};return function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=(0,i.UI)(e.nodes,u);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==typeof n&&(n=e.source=_(t,n)),"object"!==typeof i&&(i=e.target=_(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(l),function(e){e.nodes.forEach((function(e){e.value=Math.max((0,n.Sm)(e.sourceLinks,h),(0,n.Sm)(e.targetLinks,h))}))}(l),function(t){var n,i,a;for(n=t.nodes,i=[],a=0;n.length;++a,n=i,i=[])n.forEach((function(e){e.depth=a,e.sourceLinks.forEach((function(e){i.indexOf(e.target)<0&&i.push(e.target)}))}));for(n=t.nodes,i=[],a=0;n.length;++a,n=i,i=[])n.forEach((function(e){e.height=a,e.targetLinks.forEach((function(e){i.indexOf(e.source)<0&&i.push(e.source)}))}));var s=(r-e-o)/(a-1);t.nodes.forEach((function(t){t.x1=(t.x0=e+Math.max(0,Math.min(a-1,Math.floor(w.call(null,t,a))))*s)+o}))}(l),function(e){var r=(0,i.b1)().key((function(e){return e.x0})).sortKeys(n.j2).entries(e.nodes).map((function(e){return e.values}));u(),d();for(var o=1,l=M;l>0;--l)f(o*=.99),d(),c(o),d();function u(){var i=(0,n.Fp)(r,(function(e){return e.length})),o=S*(a-t)/(i-1);s>o&&(s=o);var l=(0,n.VV)(r,(function(e){return(a-t-(e.length-1)*s)/(0,n.Sm)(e,h)}));r.forEach((function(e){e.forEach((function(e,t){e.y1=(e.y0=t)+e.value*l}))})),e.links.forEach((function(e){e.width=e.value*l}))}function c(e){r.forEach((function(t){t.forEach((function(t){if(t.targetLinks.length){var r=((0,n.Sm)(t.targetLinks,m)/(0,n.Sm)(t.targetLinks,h)-v(t))*e;t.y0+=r,t.y1+=r}}))}))}function f(e){r.slice().reverse().forEach((function(t){t.forEach((function(t){if(t.sourceLinks.length){var r=((0,n.Sm)(t.sourceLinks,g)/(0,n.Sm)(t.sourceLinks,h)-v(t))*e;t.y0+=r,t.y1+=r}}))}))}function d(){r.forEach((function(e){var r,n,i,o=t,l=e.length;for(e.sort(p),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+s;if((n=o-s-a)>0)for(o=r.y0-=n,r.y1-=n,i=l-2;i>=0;--i)(n=(r=e[i]).y1+s-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}(l),C(l),l}function C(e){e.nodes.forEach((function(e){e.sourceLinks.sort(d),e.targetLinks.sort(f)})),e.nodes.forEach((function(e){var t=e.y0,r=t;e.sourceLinks.forEach((function(e){e.y0=t+e.width/2,t+=e.width})),e.targetLinks.forEach((function(e){e.y1=r+e.width/2,r+=e.width}))}))}return A.update=function(e){return C(e),e},A.nodeId=function(e){return arguments.length?(u="function"===typeof e?e:c(e),A):u},A.nodeAlign=function(e){return arguments.length?(w="function"===typeof e?e:c(e),A):w},A.nodeWidth=function(e){return arguments.length?(o=+e,A):o},A.nodePadding=function(e){return arguments.length?(s=+e,A):s},A.nodes=function(e){return arguments.length?(k="function"===typeof e?e:c(e),A):k},A.links=function(e){return arguments.length?(T="function"===typeof e?e:c(e),A):T},A.size=function(n){return arguments.length?(e=t=0,r=+n[0],a=+n[1],A):[r-e,a-t]},A.extent=function(n){return arguments.length?(e=+n[0][0],r=+n[1][0],t=+n[0][1],a=+n[1][1],A):[[e,t],[r,a]]},A.iterations=function(e){return arguments.length?(M=+e,A):M},A}var k=r(45879);function T(e){return[e.source.x1,e.y0]}function M(e){return[e.target.x0,e.y1]}function S(){return(0,k.h5)().source(T).target(M)}},39898:function(e,t,r){var n,i;(function(){var a={version:"3.8.0"},o=[].slice,s=function(e){return o.call(e)},l=self.document;function u(e){return e&&(e.ownerDocument||e.document||e).documentElement}function c(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(l)try{s(l.documentElement.childNodes)[0].nodeType}catch(ga){s=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),l)try{l.createElement("DIV").style.setProperty("opacity",0,"")}catch(ya){var f=this.Element.prototype,d=f.setAttribute,p=f.setAttributeNS,h=this.CSSStyleDeclaration.prototype,v=h.setProperty;f.setAttribute=function(e,t){d.call(this,e,t+"")},f.setAttributeNS=function(e,t,r){p.call(this,e,t,r+"")},h.setProperty=function(e,t,r){v.call(this,e,t+"",r)}}function m(e,t){return et?1:e>=t?0:NaN}function g(e){return null===e?NaN:+e}function y(e){return!isNaN(e)}function x(e){return{left:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}a.ascending=m,a.descending=function(e,t){return te?1:t>=e?0:NaN},a.min=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},a.max=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},a.extent=function(e,t){var r,n,i,a=-1,o=e.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},a.deviation=function(){var e=a.variance.apply(this,arguments);return e?Math.sqrt(e):e};var b=x(m);function _(e){return e.length}a.bisectLeft=b.left,a.bisect=a.bisectRight=b.right,a.bisector=function(e){return x(1===e.length?function(t,r){return m(e(t),r)}:e)},a.shuffle=function(e,t,r){(a=arguments.length)<3&&(r=e.length,a<2&&(t=0));for(var n,i,a=r-t;a;)i=Math.random()*a--|0,n=e[a+t],e[a+t]=e[i+t],e[i+t]=n;return e},a.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},a.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],i=new Array(r<0?0:r);t=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r};var w=Math.abs;function k(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function T(){this._=Object.create(null)}a.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r===1/0)throw new Error("infinite range");var n,i=[],a=function(e){for(var t=1;e*t%1;)t*=10;return t}(w(r)),o=-1;if(e*=a,t*=a,(r*=a)<0)for(;(n=e+r*++o)>t;)i.push(n/a);else for(;(n=e+r*++o)=n.length)return t?t.call(r,a):e?a.sort(e):a;for(var l,u,c,f,d=-1,p=a.length,h=n[s++],v=new T;++d=n.length)return e;var r=[],a=i[t++];return e.forEach((function(e,n){r.push({key:e,values:s(n,t)})})),a?r.sort((function(e,t){return a(e.key,t.key)})):r}return r.map=function(e,t){return o(t,e,0)},r.entries=function(e){return s(o(a.map,e,0),0)},r.key=function(e){return n.push(e),r},r.sortKeys=function(e){return i[n.length-1]=e,r},r.sortValues=function(t){return e=t,r},r.rollup=function(e){return t=e,r},r},a.set=function(e){var t=new O;if(e)for(var r=0,n=e.length;r=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},a.event=null,a.requote=function(e){return e.replace(W,"\\$&")};var W=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,G={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function q(e){return G(e,$),e}var Y=function(e,t){return t.querySelector(e)},X=function(e,t){return t.querySelectorAll(e)},K=function(e,t){var r=e.matches||e[F(e,"matchesSelector")];return K=function(e,t){return r.call(e,t)},K(e,t)};"function"===typeof Sizzle&&(Y=function(e,t){return Sizzle(e,t)[0]||null},X=Sizzle,K=Sizzle.matchesSelector),a.selection=function(){return a.select(l.documentElement)};var $=a.selection.prototype=[];function J(e){return"function"===typeof e?e:function(){return Y(e,this)}}function Q(e){return"function"===typeof e?e:function(){return X(e,this)}}$.select=function(e){var t,r,n,i,a=[];e=J(e);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),te.hasOwnProperty(r)?{space:te[r],local:e}:e}},$.attr=function(e,t){if(arguments.length<2){if("string"===typeof e){var r=this.node();return(e=a.ns.qualify(e)).local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}for(t in e)this.each(re(t,e[t]));return this}return this.each(re(e,t))},$.classed=function(e,t){if(arguments.length<2){if("string"===typeof e){var r=this.node(),n=(e=ae(e)).length,i=-1;if(t=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},$.sort=function(e){e=he.apply(this,arguments);for(var t=-1,r=this.length;++t0&&(e=e.slice(0,i));var l=xe.get(e);function u(){var t=this[n];t&&(this.removeEventListener(e,t,t.$),delete this[n])}return l&&(e=l,o=_e),i?t?function(){var i=o(t,s(arguments));u.call(this),this.addEventListener(e,this[n]=i,i.$=r),i._=t}:u:t?N:function(){var t,r=new RegExp("^__on([^.]+)"+a.requote(e)+"$");for(var n in this)if(t=n.match(r)){var i=this[n];this.removeEventListener(t[1],i,i.$),delete this[n]}}}a.selection.enter=me,a.selection.enter.prototype=ge,ge.append=$.append,ge.empty=$.empty,ge.node=$.node,ge.call=$.call,ge.size=$.size,ge.select=function(e){for(var t,r,n,i,a,o=[],s=-1,l=this.length;++s=t&&(t=i+1);!(o=s[t])&&++t1?Re:e<-1?-Re:Math.asin(e)}function Fe(e){return((e=Math.exp(e))+1/e)/2}var je=Math.SQRT2;a.interpolateZoom=function(e,t){var r,n,i=e[0],a=e[1],o=e[2],s=t[0],l=t[1],u=t[2],c=s-i,f=l-a,d=c*c+f*f;if(d0&&(e=e.transition().duration(v)),e.call(w.event)}function A(){s&&s.domain(o.range().map((function(e){return(e-d.x)/d.k})).map(o.invert)),f&&f.domain(u.range().map((function(e){return(e-d.y)/d.k})).map(u.invert))}function C(e){m++||e({type:"zoomstart"})}function E(e){A(),e({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function P(e){--m||(e({type:"zoomend"}),t=null)}function L(){var e=this,t=_.of(e,arguments),r=0,n=a.select(c(e)).on(y,(function(){r=1,M(a.mouse(e),i),E(t)})).on(x,(function(){n.on(y,null).on(x,null),o(r),P(t)})),i=k(a.mouse(e)),o=Te(e);Ji.call(e),C(t)}function I(){var e,t=this,r=_.of(t,arguments),n={},o=0,s=".zoom-"+a.event.changedTouches[0].identifier,l="touchmove"+s,u="touchend"+s,c=[],f=a.select(t),p=Te(t);function h(){var r=a.touches(t);return e=d.k,r.forEach((function(e){e.identifier in n&&(n[e.identifier]=k(e))})),r}function v(){var e=a.event.target;a.select(e).on(l,m).on(u,y),c.push(e);for(var r=a.event.changedTouches,s=0,f=r.length;s1){g=p[0];var x=p[1],b=g[0]-x[0],_=g[1]-x[1];o=b*b+_*_}}function m(){var s,l,u,c,f=a.touches(t);Ji.call(t);for(var d=0,p=f.length;d360?e-=360:e<0&&(e+=360),e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+t):r+t-r*t),new ot(a(e+120),a(e),a(e-120))}function Ge(e,t,r){return this instanceof Ge?(this.h=+e,this.c=+t,void(this.l=+r)):arguments.length<2?e instanceof Ge?new Ge(e.h,e.c,e.l):rt(e instanceof Xe?e.l:(e=pt((e=a.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ge(e,t,r)}He.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Ue(this.h,this.s,this.l/e)},He.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Ue(this.h,this.s,e*this.l)},He.rgb=function(){return We(this.h,this.s,this.l)},a.hcl=Ge;var qe=Ge.prototype=new Ve;function Ye(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Xe(r,Math.cos(e*=Oe)*t,Math.sin(e)*t)}function Xe(e,t,r){return this instanceof Xe?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof Xe?new Xe(e.l,e.a,e.b):e instanceof Ge?Ye(e.h,e.c,e.l):pt((e=ot(e)).r,e.g,e.b):new Xe(e,t,r)}qe.brighter=function(e){return new Ge(this.h,this.c,Math.min(100,this.l+Ke*(arguments.length?e:1)))},qe.darker=function(e){return new Ge(this.h,this.c,Math.max(0,this.l-Ke*(arguments.length?e:1)))},qe.rgb=function(){return Ye(this.h,this.c,this.l).rgb()},a.lab=Xe;var Ke=18,$e=.95047,Je=1,Qe=1.08883,et=Xe.prototype=new Ve;function tt(e,t,r){var n=(e+16)/116,i=n+t/500,a=n-r/200;return new ot(at(3.2404542*(i=nt(i)*$e)-1.5371385*(n=nt(n)*Je)-.4985314*(a=nt(a)*Qe)),at(-.969266*i+1.8760108*n+.041556*a),at(.0556434*i-.2040259*n+1.0572252*a))}function rt(e,t,r){return e>0?new Ge(Math.atan2(r,t)*De,Math.sqrt(t*t+r*r),e):new Ge(NaN,NaN,e)}function nt(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function it(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function at(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function ot(e,t,r){return this instanceof ot?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof ot?new ot(e.r,e.g,e.b):ft(""+e,ot,We):new ot(e,t,r)}function st(e){return new ot(e>>16,e>>8&255,255&e)}function lt(e){return st(e)+""}et.brighter=function(e){return new Xe(Math.min(100,this.l+Ke*(arguments.length?e:1)),this.a,this.b)},et.darker=function(e){return new Xe(Math.max(0,this.l-Ke*(arguments.length?e:1)),this.a,this.b)},et.rgb=function(){return tt(this.l,this.a,this.b)},a.rgb=ot;var ut=ot.prototype=new Ve;function ct(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function ft(e,t,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(vt(i[0]),vt(i[1]),vt(i[2]))}return(a=mt.get(e))?t(a.r,a.g,a.b):(null==e||"#"!==e.charAt(0)||isNaN(a=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===e.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),t(o,s,l))}function dt(e,t,r){var n,i,a=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=e==o?(t-r)/s+(t0&&l<1?0:n),new Ue(n,i,l)}function pt(e,t,r){var n=it((.4124564*(e=ht(e))+.3575761*(t=ht(t))+.1804375*(r=ht(r)))/$e),i=it((.2126729*e+.7151522*t+.072175*r)/Je);return Xe(116*i-16,500*(n-i),200*(i-it((.0193339*e+.119192*t+.9503041*r)/Qe)))}function ht(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function vt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}ut.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,i=30;return t||r||n?(t&&t=200&&t<300||304===t){try{e=r.call(i,u)}catch(ga){return void o.error.call(i,ga)}o.load.call(i,e)}else o.error.call(i,u)}return self.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(e){var t=a.event;a.event=e;try{o.progress.call(i,u)}finally{a.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",i):t},i.responseType=function(e){return arguments.length?(c=e,i):c},i.response=function(e){return r=e,i},["get","post"].forEach((function(e){i[e]=function(){return i.send.apply(i,[e].concat(s(arguments)))}})),i.send=function(r,n,a){if(2===arguments.length&&"function"===typeof n&&(a=n,n=null),u.open(r,e,!0),null==t||"accept"in l||(l.accept=t+",*/*"),u.setRequestHeader)for(var s in l)u.setRequestHeader(s,l[s]);return null!=t&&u.overrideMimeType&&u.overrideMimeType(t),null!=c&&(u.responseType=c),null!=a&&i.on("error",a).on("load",(function(e){a(null,e)})),o.beforesend.call(i,u),u.send(null==n?null:n),i},i.abort=function(){return u.abort(),i},a.rebind(i,o,"on"),null==n?i:i.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(n))}mt.forEach((function(e,t){mt.set(e,st(t))})),a.functor=gt,a.xhr=yt(D),a.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function i(e,r,n){arguments.length<3&&(n=r,r=null);var i=xt(e,t,null==r?a:o(r),n);return i.row=function(e){return arguments.length?i.response(null==(r=e)?a:o(e)):r},i}function a(e){return i.parse(e.responseText)}function o(e){return function(t){return i.parse(t.responseText,e)}}function s(t){return t.map(l).join(e)}function l(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return i.parse=function(e,t){var r;return i.parseRows(e,(function(e,n){if(r)return r(e,n-1);var i=function(t){for(var r={},n=e.length,i=0;i=l)return o;if(i)return i=!1,a;var t=u;if(34===e.charCodeAt(t)){for(var r=t;r++24?(isFinite(t)&&(clearTimeout(kt),kt=setTimeout(St,t)),wt=0):(wt=1,Tt(St))}function At(){for(var e=Date.now(),t=bt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function Ct(){for(var e,t=bt,r=1/0;t;)t.c?(t.t1&&(t=e[a[o-2]],r=e[a[o-1]],n=e[s],(r[0]-t[0])*(n[1]-t[1])-(r[1]-t[1])*(n[0]-t[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function It(e,t){return e[0]-t[0]||e[1]-t[1]}a.timer=function(){Mt.apply(this,arguments)},a.timer.flush=function(){At(),Ct()},a.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},a.geom={},a.geom.hull=function(e){var t=Et,r=Pt;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,i=gt(t),a=gt(r),o=e.length,s=[],l=[];for(n=0;n=0;--n)p.push(e[s[u[n]][2]]);for(n=+f;nCe)s=s.L;else{if(!((i=a-Kt(s,o))>Ce)){n>-Ce?(t=s.P,r=s):i>-Ce?(t=s,r=s.N):t=r=s;break}if(!s.R){t=s;break}s=s.R}var l=Wt(e);if(Nt.insert(t,l),t||r){if(t===r)return tr(t),r=Wt(t.site),Nt.insert(l,r),l.edge=r.edge=ir(t.site,l.site),er(t),void er(r);if(r){tr(t),tr(r);var u=t.site,c=u.x,f=u.y,d=e.x-c,p=e.y-f,h=r.site,v=h.x-c,m=h.y-f,g=2*(d*m-p*v),y=d*d+p*p,x=v*v+m*m,b={x:(m*y-p*x)/g+c,y:(d*x-v*y)/g+f};or(r.edge,u,h,b),l.edge=ir(u,e,null,b),r.edge=ir(e,h,null,b),er(t),er(r)}else l.edge=ir(t.site,l.site)}}function Xt(e,t){var r=e.site,n=r.x,i=r.y,a=i-t;if(!a)return n;var o=e.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-t;if(!u)return s;var c=s-n,f=1/a-1/u,d=c/u;return f?(-d+Math.sqrt(d*d-2*f*(c*c/(-2*u)-l+u/2+i-a/2)))/f+n:(n+s)/2}function Kt(e,t){var r=e.N;if(r)return Xt(r,t);var n=e.site;return n.y===t?n.x:1/0}function $t(e){this.site=e,this.edges=[]}function Jt(e,t){return t.angle-e.angle}function Qt(){ur(this),this.x=this.y=this.arc=this.site=this.cy=null}function er(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,i=e.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,f=2*(l*(m=a.y-s)-u*c);if(!(f>=-Ee)){var d=l*l+u*u,p=c*c+m*m,h=(m*d-u*p)/f,v=(l*p-c*d)/f,m=v+s,g=Ut.pop()||new Qt;g.arc=e,g.site=i,g.x=h+o,g.y=m+Math.sqrt(h*h+v*v),g.cy=m,e.circle=g;for(var y=null,x=Bt._;x;)if(g.y=s)return;if(d>h){if(a){if(a.y>=u)return}else a={x:m,y:l};r={x:m,y:u}}else{if(a){if(a.y1)if(d>h){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(t/=d,d<0){if(t0){if(t>f)return;t>c&&(c=t)}if(t=i-l,d||!(t<0)){if(t/=d,d<0){if(t>f)return;t>c&&(c=t)}else if(d>0){if(t0)){if(t/=p,p<0){if(t0){if(t>f)return;t>c&&(c=t)}if(t=a-u,p||!(t<0)){if(t/=p,p<0){if(t>f)return;t>c&&(c=t)}else if(p>0){if(t0&&(e.a={x:l+c*d,y:u+c*p}),f<1&&(e.b={x:l+f*d,y:u+f*p}),e}}}}}),l=o.length;l--;)(!rr(t=o[l],e)||!s(t)||w(t.a.x-t.b.x)Ce||w(i-r)>Ce)&&(s.splice(o,0,new sr(ar(a.site,c,w(n-f)Ce?{x:f,y:w(t-f)Ce?{x:w(r-h)Ce?{x:d,y:w(t-d)Ce?{x:w(r-p)=r&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=e[s]})),t}function s(e){return e.map((function(e,t){return{x:Math.round(n(e,t)/Ce)*Ce,y:Math.round(i(e,t)/Ce)*Ce,i:t}}))}return o.links=function(e){return pr(s(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},o.triangles=function(e){var t=[];return pr(s(e)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,u=r.edges.sort(Jt),c=-1,f=u.length,d=u[f-1].edge,p=d.l===l?d.r:d.l;++ca&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:_r(r,n)})),a=Tr.lastIndex;return av&&(v=l.x),l.y>m&&(m=l.y),u.push(l.x),c.push(l.y);else for(f=0;fv&&(v=x),b>m&&(m=b),u.push(x),c.push(b)}var _=v-p,k=m-h;function T(e,t,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var l=e.x,u=e.y;if(null!=l)if(w(l-r)+w(u-n)<.01)M(e,t,r,n,i,a,o,s);else{var c=e.point;e.x=e.y=e.point=null,M(e,c,l,u,i,a,o,s),M(e,t,r,n,i,a,o,s)}else e.x=r,e.y=n,e.point=t}else M(e,t,r,n,i,a,o,s)}function M(e,t,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,f=n>=u,d=f<<1|c;e.leaf=!1,c?i=l:o=l,f?a=u:s=u,T(e=e.nodes[d]||(e.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,i,a,o,s)}_>k?m=h+_:v=p+k;var S={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){T(S,e,+g(e,++f),+y(e,f),p,h,v,m)},visit:function(e){yr(e,S,p,h,v,m)},find:function(e){return function(e,t,r,n,i,a,o){var s,l=1/0;return function e(u,c,f,d,p){if(!(c>a||f>o||d=_)<<1|t>=b,k=w+4;w=0&&!(r=a.interpolators[n](e,t)););return r}function Sr(e,t){var r,n=[],i=[],a=e.length,o=t.length,s=Math.min(e.length,t.length);for(r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Dr(e){return 1-Math.cos(e*Re)}function zr(e){return Math.pow(2,10*(e-1))}function Fr(e){return 1-Math.sqrt(1-e*e)}function jr(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function Nr(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function Zr(e){var t,r,n,i=[e.a,e.b],a=[e.c,e.d],o=Vr(i),s=Br(i,a),l=Vr(((t=a)[0]+=(n=-s)*(r=i)[0],t[1]+=n*r[1],t))||0;i[0]*a[1]=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):"in";return n=Cr.get(n)||Ar,i=Er.get(i)||D,t=i(n.apply(null,o.call(arguments,1))),function(e){return e<=0?0:e>=1?1:t(e)}},a.interpolateHcl=function(e,t){e=a.hcl(e),t=a.hcl(t);var r=e.h,n=e.c,i=e.l,o=t.h-r,s=t.c-n,l=t.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?t.c:n),isNaN(o)?(o=0,r=isNaN(r)?t.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return Ye(r+o*e,n+s*e,i+l*e)+""}},a.interpolateHsl=function(e,t){e=a.hsl(e),t=a.hsl(t);var r=e.h,n=e.s,i=e.l,o=t.h-r,s=t.s-n,l=t.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?t.s:n),isNaN(o)?(o=0,r=isNaN(r)?t.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return We(r+o*e,n+s*e,i+l*e)+""}},a.interpolateLab=function(e,t){e=a.lab(e),t=a.lab(t);var r=e.l,n=e.a,i=e.b,o=t.l-r,s=t.a-n,l=t.b-i;return function(e){return tt(r+o*e,n+s*e,i+l*e)+""}},a.interpolateRound=Nr,a.transform=function(e){var t=l.createElementNS(a.ns.prefix.svg,"g");return(a.transform=function(e){if(null!=e){t.setAttribute("transform",e);var r=t.transform.baseVal.consolidate()}return new Zr(r?r.matrix:Ur)})(e)},Zr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Ur={a:1,b:0,c:0,d:1,e:0,f:0};function Hr(e){return e.length?e.pop()+",":""}function Wr(e,t){var r=[],n=[];return e=a.transform(e),t=a.transform(t),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:_r(e[0],t[0])},{i:i-2,x:_r(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(e.translate,t.translate,r,n),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(Hr(r)+"rotate(",null,")")-2,x:_r(e,t)})):t&&r.push(Hr(r)+"rotate("+t+")")}(e.rotate,t.rotate,r,n),function(e,t,r,n){e!==t?n.push({i:r.push(Hr(r)+"skewX(",null,")")-2,x:_r(e,t)}):t&&r.push(Hr(r)+"skewX("+t+")")}(e.skew,t.skew,r,n),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push(Hr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:_r(e[0],t[0])},{i:i-2,x:_r(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(Hr(r)+"scale("+t+")")}(e.scale,t.scale,r,n),e=t=null,function(e){for(var t,i=-1,a=n.length;++i0?r=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:r=0})):t>0&&(l.start({type:"start",alpha:r=t}),e=Mt(s.tick)),s):r},s.start=function(){var e,t,r,a=g.length,l=y.length,c=u[0],h=u[1];for(e=0;e=0;)r.push(i[n])}function sn(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(a=e.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return sn(i,(function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)})),s}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(on(e,(function(e){e.children&&(e.value=0)})),sn(e,(function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},n},a.layout.partition=function(){var e=a.layout.hierarchy(),t=[1,1];function r(e,t,n,i){var a=e.children;if(e.x=t,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=t);return n}function _n(e){return e.reduce(wn,0)}function wn(e,t){return e+t[1]}function kn(e,t){return Tn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Tn(e,t){for(var r=-1,n=+e[0],i=(e[1]-n)/t,a=[];++r<=t;)a[r]=i*r+n;return a}function Mn(e){return[a.min(e),a.max(e)]}function Sn(e,t){return e.value-t.value}function An(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function Cn(e,t){e._pack_next=t,t._pack_prev=e}function En(e,t){var r=t.x-e.x,n=t.y-e.y,i=e.r+t.r;return.999*i*i>r*r+n*n}function Pn(e){if((t=e.children)&&(l=t.length)){var t,r,n,i,a,o,s,l,u=1/0,c=-1/0,f=1/0,d=-1/0;if(t.forEach(Ln),(r=t[0]).x=-r.r,r.y=0,x(r),l>1&&((n=t[1]).x=n.r,n.y=0,x(n),l>2))for(On(r,n,i=t[2]),x(i),An(r,i),r._pack_prev=i,An(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[a.bisect(d,l,1,h)-1]).y+=v,s.push(i[o]));return u}return i.value=function(e){return arguments.length?(t=e,i):t},i.range=function(e){return arguments.length?(r=gt(e),i):r},i.bins=function(e){return arguments.length?(n="number"===typeof e?function(t){return Tn(t,e)}:gt(e),i):n},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},a.layout.pack=function(){var e,t=a.layout.hierarchy().sort(Sn),r=0,n=[1,1];function i(i,a){var o=t.call(this,i,a),s=o[0],l=n[0],u=n[1],c=null==e?Math.sqrt:"function"===typeof e?e:function(){return e};if(s.x=s.y=0,sn(s,(function(e){e.r=+c(e.value)})),sn(s,Pn),r){var f=r*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;sn(s,(function(e){e.r+=f})),sn(s,Pn),sn(s,(function(e){e.r-=f}))}return Rn(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}return i.size=function(e){return arguments.length?(n=e,i):n},i.radius=function(t){return arguments.length?(e=null==t||"function"===typeof t?t:+t,i):e},i.padding=function(e){return arguments.length?(r=+e,i):r},an(i,t)},a.layout.tree=function(){var e=a.layout.hierarchy().sort(null).value(null),t=Dn,r=[1,1],n=null;function i(i,a){var u=e.call(this,i,a),c=u[0],f=function(e){for(var t,r={A:null,children:[e]},n=[r];null!=(t=n.pop());)for(var i,a=t.children,o=0,s=a.length;op.x&&(p=e),e.depth>h.depth&&(h=e)}));var v=t(d,p)/2-d.x,m=r[0]/(p.x+t(p,d)/2+v),g=r[1]/(h.depth||1);on(c,(function(e){e.x=(e.x+v)*m,e.y=e.depth*g}))}return u}function o(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r.length){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],u=a.m,c=o.m,f=s.m,d=l.m;s=Fn(s),a=zn(a),s&&a;)l=zn(l),(o=Fn(o)).a=e,(i=s.z+f-a.z-u+t(s._,a._))>0&&(jn(Nn(s,e,n),e,i),u+=i,c+=i),f+=s.m,u+=a.m,d+=l.m,c+=o.m;s&&!Fn(o)&&(o.t=s,o.m+=f-c),a&&!zn(l)&&(l.t=a,l.m+=u-d,n=e)}return n}(e,i,e.parent.A||n[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=r[0],e.y=e.depth*r[1]}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(n=null==(r=e)?l:null,i):n?null:r},i.nodeSize=function(e){return arguments.length?(n=null==(r=e)?null:l,i):n?r:null},an(i,e)},a.layout.cluster=function(){var e=a.layout.hierarchy().sort(null).value(null),t=Dn,r=[1,1],n=!1;function i(i,o){var s,l=e.call(this,i,o),u=l[0],c=0;sn(u,(function(e){var r=e.children;r&&r.length?(e.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(r),e.y=function(e){return 1+a.max(e,(function(e){return e.y}))}(r)):(e.x=s?c+=t(e,s):0,e.y=0,s=e)}));var f=Zn(u),d=Bn(u),p=f.x-t(f,d)/2,h=d.x+t(d,f)/2;return sn(u,n?function(e){e.x=(e.x-u.x)*r[0],e.y=(u.y-e.y)*r[1]}:function(e){e.x=(e.x-p)/(h-p)*r[0],e.y=(1-(u.y?e.y/u.y:1))*r[1]}),l}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(n=null==(r=e),i):n?null:r},i.nodeSize=function(e){return arguments.length?(n=null!=(r=e),i):n?r:null},an(i,e)},a.layout.treemap=function(){var e,t=a.layout.hierarchy(),r=Math.round,n=[1,1],i=null,o=Vn,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(e,t){for(var r,n,i=-1,a=e.length;++i0;)s.push(r=u[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,v))<=d?(u.pop(),d=n):(s.area-=s.pop().area,h(s,v,a,!1),v=Math.min(a.dx,a.dy),s.length=s.area=0,d=1/0);s.length&&(h(s,v,a,!0),s.length=s.area=0),t.forEach(f)}}function d(e){var t=e.children;if(t&&t.length){var r,n=o(e),i=t.slice(),a=[];for(c(i,n.dx*n.dy/e.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(h(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);t.forEach(d)}}function p(e,t){for(var r,n=e.area,i=0,a=1/0,o=-1,s=e.length;++oi&&(i=r));return t*=t,(n*=n)?Math.max(t*i*u/n,n/(t*a*u)):1/0}function h(e,t,n,i){var a,o=-1,s=e.length,l=n.x,u=n.y,c=t?r(e.area/t):0;if(t==n.dx){for((i||c>n.dy)&&(c=n.dy);++on.dx)&&(c=n.dx);++o1);return e+t*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=a.random.normal.apply(a,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=a.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,r=0;r2?Kn:Gn,l=n?qr:Gr;return i=o(e,t,l,r),a=o(t,e,l,Mr),s}function s(e){return i(e)}return s.invert=function(e){return a(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},s.range=function(e){return arguments.length?(t=e,o()):t},s.rangeRound=function(e){return s.range(e).interpolate(Nr)},s.clamp=function(e){return arguments.length?(n=e,o()):n},s.interpolate=function(e){return arguments.length?(r=e,o()):r},s.ticks=function(t){return ti(e,t)},s.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},s.nice=function(t){return Qn(e,t),o()},s.copy=function(){return $n(e,t,r,n)},o()}function Jn(e,t){return a.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Qn(e,t){return qn(e,Yn(ei(e,t)[2])),qn(e,Yn(ei(e,t)[2])),e}function ei(e,t){null==t&&(t=10);var r=Hn(e),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),a=t/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function ti(e,t){return a.range.apply(a,ei(e,t))}function ri(e,t,r,n){function i(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function a(e){return r?Math.pow(t,e):-Math.pow(t,-e)}function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(r=t[0]>=0,e.domain((n=t.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(t=+r,e.domain(n.map(i)),o):t},o.nice=function(){var t=qn(n.map(i),r?Math:ni);return e.domain(t),n=t.map(a),o},o.ticks=function(){var e=Hn(n),o=[],s=e[0],l=e[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=t%1?2:t;if(isFinite(c-u)){if(r){for(;u0;d--)o.push(a(u)*d);for(u=0;o[u]l;c--);o=o.slice(u,c)}return o},o.copy=function(){return ri(e.copy(),t,r,n)},Jn(o,e)}a.scale.linear=function(){return $n([0,1],[0,1],Mr,!1)},a.scale.log=function(){return ri(a.scale.linear().domain([0,1]),10,!0,[1,10])};var ni={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function ii(e,t,r){var n=ai(t),i=ai(1/t);function a(t){return e(n(t))}return a.invert=function(t){return i(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain((r=t.map(Number)).map(n)),a):r},a.ticks=function(e){return ti(r,e)},a.tickFormat=function(e,t){return d3_scale_linearTickFormat(r,e,t)},a.nice=function(e){return a.domain(Qn(r,e))},a.exponent=function(o){return arguments.length?(n=ai(t=o),i=ai(1/t),e.domain(r.map(n)),a):t},a.copy=function(){return ii(e.copy(),t,r)},Jn(a,e)}function ai(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function oi(e,t){var r,n,i;function o(i){return n[((r.get(i)||("range"===t.t?r.set(i,e.push(i)):NaN))-1)%n.length]}function s(t,r){return a.range(e.length).map((function(e){return t+r*e}))}return o.domain=function(n){if(!arguments.length)return e;e=[],r=new T;for(var i,a=-1,s=n.length;++a0?r[n-1]:e[0],nf?0:1;if(u=Ie)return l(u,p)+(s?l(s,1-p):"")+"Z";var h,v,m,g,y,x,b,_,w,k,T,M,S=0,A=0,C=[];if((g=(+o.apply(this,arguments)||0)/2)&&(m=n===mi?Math.sqrt(s*s+u*u):+n.apply(this,arguments),p||(A*=-1),u&&(A=ze(m/u*Math.sin(g))),s&&(S=ze(m/s*Math.sin(g)))),u){y=u*Math.cos(c+A),x=u*Math.sin(c+A),b=u*Math.cos(f-A),_=u*Math.sin(f-A);var E=Math.abs(f-c-2*A)<=Pe?0:1;if(A&&wi(y,x,b,_)===p^E){var P=(c+f)/2;y=u*Math.cos(P),x=u*Math.sin(P),b=_=null}}else y=x=0;if(s){w=s*Math.cos(f-S),k=s*Math.sin(f-S),T=s*Math.cos(c+S),M=s*Math.sin(c+S);var L=Math.abs(c-f+2*S)<=Pe?0:1;if(S&&wi(w,k,T,M)===1-p^L){var I=(c+f)/2;w=s*Math.cos(I),k=s*Math.sin(I),T=M=null}}else w=k=0;if(d>Ce&&(h=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){v=s0?0:1}function ki(e,t,r,n,i){var a=e[0]-t[0],o=e[1]-t[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=e[0]+l,f=e[1]+u,d=t[0]+l,p=t[1]+u,h=(c+d)/2,v=(f+p)/2,m=d-c,g=p-f,y=m*m+g*g,x=r-n,b=c*p-d*f,_=(g<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*g-m*_)/y,k=(-b*m-g*_)/y,T=(b*g+m*_)/y,M=(-b*m+g*_)/y,S=w-h,A=k-v,C=T-h,E=M-v;return S*S+A*A>C*C+E*E&&(w=T,k=M),[[w-l,k-u],[w*r/x,k*r/x]]}function Ti(){return!0}function Mi(e){var t=Et,r=Pt,n=Ti,i=Ai,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,f=a.length,d=gt(t),p=gt(r);function h(){l.push("M",i(e(u),o))}for(;++c1&&i.push("H",n[0]),i.join("")},"step-before":Ei,"step-after":Pi,basis:Ri,"basis-open":function(e){if(e.length<4)return Ai(e);for(var t,r=[],n=-1,i=e.length,a=[0],o=[0];++n<3;)t=e[n],a.push(t[0]),o.push(t[1]);for(r.push(Oi(Fi,a)+","+Oi(Fi,o)),--n;++n9&&(i=3*t/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(e))}});function Ai(e){return e.length>1?e.join("L"):e+"Z"}function Ci(e){return e.join("L")+"Z"}function Ei(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t1){s=t[1],a=e[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;uPe)+",1 "+t}function l(e,t,r,n){return"Q 0,0 "+n}return a.radius=function(e){return arguments.length?(r=gt(e),a):r},a.source=function(t){return arguments.length?(e=gt(t),a):e},a.target=function(e){return arguments.length?(t=gt(e),a):t},a.startAngle=function(e){return arguments.length?(n=gt(e),a):n},a.endAngle=function(e){return arguments.length?(i=gt(e),a):i},a},a.svg.diagonal=function(){var e=Vi,t=Ui,r=Wi;function n(n,i){var a=e.call(this,n,i),o=t.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(t){return arguments.length?(e=gt(t),n):e},n.target=function(e){return arguments.length?(t=gt(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},a.svg.diagonal.radial=function(){var e=a.svg.diagonal(),t=Wi,r=e.projection;return e.projection=function(e){return arguments.length?r(function(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Re;return[r*Math.cos(n),r*Math.sin(n)]}}(t=e)):t},e},a.svg.symbol=function(){var e=qi,t=Gi;function r(r,n){return(Xi.get(e.call(this,r,n))||Yi)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=gt(t),r):e},r.size=function(e){return arguments.length?(t=gt(e),r):t},r};var Xi=a.map({circle:Yi,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*$i)),r=t*$i;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Ki),r=t*Ki/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Ki),r=t*Ki/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});a.svg.symbolTypes=Xi.keys();var Ki=Math.sqrt(3),$i=Math.tan(30*Oe);$.transition=function(e){for(var t,r,n=ta||++ia,i=sa(e),a=[],o=ra||{time:Date.now(),ease:Or,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--d].call(e,o);if(a>=1)return f.event&&f.event.end.call(e,e.__data__,t),--c.count?delete c[n]:delete e[r],1}f||(a=i.time,o=Mt((function(e){var t=f.delay;if(o.t=t+a,t<=e)return d(e-t);o.c=d}),0,a),f=c[n]={tween:new T,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++c.count)}na.call=$.call,na.empty=$.empty,na.node=$.node,na.size=$.size,a.transition=function(e,t){return e&&e.transition?ta?e.transition(t):e:a.selection().transition(e)},a.transition.prototype=na,na.select=function(e){var t,r,n,i=this.id,a=this.namespace,o=[];e=J(e);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",o[1]-o[0])}function v(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function m(){var f,m,g=this,y=a.select(a.event.target),x=r.of(g,arguments),b=a.select(g),_=y.datum(),w=!/^(n|s)$/.test(_)&&n,k=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),M=Te(g),S=a.mouse(g),A=a.select(c(g)).on("keydown.brush",(function(){32==a.event.keyCode&&(T||(f=null,S[0]-=o[1],S[1]-=s[1],T=2),V())})).on("keyup.brush",(function(){32==a.event.keyCode&&2==T&&(S[0]+=o[1],S[1]+=s[1],T=0,V())}));if(a.event.changedTouches?A.on("touchmove.brush",P).on("touchend.brush",I):A.on("mousemove.brush",P).on("mouseup.brush",I),b.interrupt().selectAll("*").interrupt(),T)S[0]=o[0]-S[0],S[1]=s[0]-S[1];else if(_){var C=+/w$/.test(_),E=+/^n/.test(_);m=[o[1-C]-S[0],s[1-E]-S[1]],S[0]=o[C],S[1]=s[E]}else a.event.altKey&&(f=S.slice());function P(){var e=a.mouse(g),t=!1;m&&(e[0]+=m[0],e[1]+=m[1]),T||(a.event.altKey?(f||(f=[(o[0]+o[1])/2,(s[0]+s[1])/2]),S[0]=o[+(e[0]>>1;t.dtype||(t.dtype="array"),"string"===typeof t.dtype?h=new(f(t.dtype))(m):t.dtype&&(h=t.dtype,Array.isArray(h)&&(h.length=m));for(var g=0;gr||s>1073741824){for(var d=0;dr+i||S>n+i||A=P)&&o!==s){var l=y[a];void 0===s&&(s=l.length);for(var u=o;u=m&&f<=w&&d>=g&&d<=k&&L.push(c)}var p=x[a],h=p[4*o+0],v=p[4*o+1],b=p[4*o+2],_=p[4*o+3],T=function(e,t){for(var r=null,n=0;null===r;)if(r=e[4*t+n],++n>e.length)return null;return r}(p,o+1),C=.5*i,I=a+1;t(r,n,C,I,h,v||b||_||T),t(r,n+C,C,I,v,b||_||T),t(r+C,n,C,I,b,_||T),t(r+C,n+C,C,I,_,T)}}(0,0,1,0,0,1),L},h;function C(e,t,r){for(var n=1,i=.5,a=.5,o=.5,s=0;s0){t+=Math.abs(o(e[0]));for(var r=1;r2){for(l=0;l=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=f,t.lengthToDegrees=function(e,t){return d(f(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=d,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(f(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=p,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!p(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},60302:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(23132);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,u,c,f,d=0,p=0,h=e.type,v="FeatureCollection"===h,m="Feature"===h,g=v?e.features.length:1,y=0;yu||p>c||h>f)return l=i,u=r,c=p,f=h,void(o=0);var v=n.lineString([l,i],e.properties);if(!1===t(v,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;se[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=f,t.lengthToDegrees=function(e,t){return d(f(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=d,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(f(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=p,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!p(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},27138:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(94228);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,u,c,f,d=0,p=0,h=e.type,v="FeatureCollection"===h,m="Feature"===h,g=v?e.features.length:1,y=0;yu||p>c||h>f)return l=i,u=r,c=p,f=h,void(o=0);var v=n.lineString([l,i],e.properties);if(!1===t(v,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=f,t.lengthToDegrees=function(e,t){return d(f(e,t))},t.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=d,t.degreesToRadians=function(e){return e%360*Math.PI/180},t.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(f(e,t),r)},t.convertArea=function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[r];if(!i)throw new Error("invalid original units");var a=t.areaFactors[n];if(!a)throw new Error("invalid final units");return e/i*a},t.isNumber=p,t.isObject=function(e){return!!e&&e.constructor===Object},t.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!p(e))throw new Error("bbox must only contain numbers")}))},t.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")},t.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},t.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},t.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},t.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},t.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},t.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},t.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},88553:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(64182);function i(e,t,r){if(null!==e)for(var n,a,o,s,l,u,c,f,d=0,p=0,h=e.type,v="FeatureCollection"===h,m="Feature"===h,g=v?e.features.length:1,y=0;yu||p>c||h>f)return l=i,u=r,c=p,f=h,void(o=0);var v=n.lineString([l,i],e.properties);if(!1===t(v,r,a,h,o))return!1;o++,l=i}))&&void 0}}}))}function c(e,t){if(!e)throw new Error("geojson is required");l(e,(function(e,r,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===t(e,r,i,0,0))return!1;break;case"Polygon":for(var s=0;si&&(i=e[o]),e[o]1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;ie.length)&&(r=e.length),e.substring(r-t.length,r)===t}var m="",g="",y="",x="",b={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function w(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function k(e,t,r){var i="",a="",o=0,s="",l=!1,u=w(e),c=u.split("\n"),f=w(t).split("\n"),p=0,h="";if("strictEqual"===r&&"object"===d(e)&&"object"===d(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===f.length&&c[0]!==f[0]){var _=c[0].length+f[0].length;if(_<=10){if(("object"!==d(e)||null===e)&&("object"!==d(t)||null===t)&&(0!==e||0!==t))return"".concat(b[r],"\n\n")+"".concat(c[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&_<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;c[0][p]===f[0][p];)p++;p>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",p),"^"),p=0)}}for(var k=c[c.length-1],T=f[f.length-1];k===T&&(p++<2?s="\n ".concat(k).concat(s):i=k,c.pop(),f.pop(),0!==c.length&&0!==f.length);)k=c[c.length-1],T=f[f.length-1];var M=Math.max(c.length,f.length);if(0===M){var S=u.split("\n");if(S.length>30)for(S[26]="".concat(m,"...").concat(x);S.length>27;)S.pop();return"".concat(b.notIdentical,"\n\n").concat(S.join("\n"),"\n")}p>3&&(s="\n".concat(m,"...").concat(x).concat(s),l=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var A=0,C=b[r]+"\n".concat(g,"+ actual").concat(x," ").concat(y,"- expected").concat(x),E=" ".concat(m,"...").concat(x," Lines skipped");for(p=0;p1&&p>2&&(P>4?(a+="\n".concat(m,"...").concat(x),l=!0):P>3&&(a+="\n ".concat(f[p-2]),A++),a+="\n ".concat(f[p-1]),A++),o=p,i+="\n".concat(y,"-").concat(x," ").concat(f[p]),A++;else if(f.length1&&p>2&&(P>4?(a+="\n".concat(m,"...").concat(x),l=!0):P>3&&(a+="\n ".concat(c[p-2]),A++),a+="\n ".concat(c[p-1]),A++),o=p,a+="\n".concat(g,"+").concat(x," ").concat(c[p]),A++;else{var L=f[p],I=c[p],R=I!==L&&(!v(I,",")||I.slice(0,-1)!==L);R&&v(L,",")&&L.slice(0,-1)===I&&(R=!1,I+=","),R?(P>1&&p>2&&(P>4?(a+="\n".concat(m,"...").concat(x),l=!0):P>3&&(a+="\n ".concat(c[p-2]),A++),a+="\n ".concat(c[p-1]),A++),o=p,a+="\n".concat(g,"+").concat(x," ").concat(I),i+="\n".concat(y,"-").concat(x," ").concat(L),A+=2):(a+=i,i="",1!==P&&0!==p||(a+="\n ".concat(I),A++))}if(A>20&&p30)for(T[26]="".concat(m,"...").concat(x);T.length>27;)T.pop();r=1===T.length?o(this,f(t).call(this,"".concat(v," ").concat(T[0]))):o(this,f(t).call(this,"".concat(v,"\n\n").concat(T.join("\n"),"\n")))}else{var M=w(u),S="",A=b[a];"notDeepEqual"===a||"notEqual"===a?(M="".concat(b[a],"\n\n").concat(M)).length>1024&&(M="".concat(M.slice(0,1021),"...")):(S="".concat(w(c)),M.length>512&&(M="".concat(M.slice(0,509),"...")),S.length>512&&(S="".concat(S.slice(0,509),"...")),"deepEqual"===a||"equal"===a?M="".concat(A,"\n\n").concat(M,"\n\nshould equal\n\n"):S=" ".concat(a," ").concat(S)),r=o(this,f(t).call(this,"".concat(M).concat(S)))}return Error.stackTraceLimit=p,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=u,r.expected=c,r.operator=a,Error.captureStackTrace&&Error.captureStackTrace(s(r),l),r.stack,r.name="AssertionError",o(r)}var r,l,u;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,e),r=t,l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(e,t){return p(this,function(e){for(var t=1;t2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(e,t,i){var a,o,l,u;if(void 0===s&&(s=r(32791)),s("string"===typeof e,"'name' must be a string"),"string"===typeof t&&(o="not ",t.substr(!l||l<0?0:+l,o.length)===o)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))u="The ".concat(e," ").concat(a," ").concat(f(t,"type"));else{var c=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";u='The "'.concat(e,'" ').concat(c," ").concat(a," ").concat(f(t,"type"))}return u+=". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===l&&(l=r(43827));var i=l.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n0,"At least one arg needs to be specified");var i="The ",a=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),a){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,a-1).join(", "),i+=", and ".concat(t[a-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=u},74061:function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(l){i=!0,a=l}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var a=void 0!==/a/g.flags,o=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},s=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:r(64003),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},c=Number.isNaN?Number.isNaN:r(15567);function f(e){return e.call.bind(e)}var d=f(Object.prototype.hasOwnProperty),p=f(Object.prototype.propertyIsEnumerable),h=f(Object.prototype.toString),v=r(43827).types,m=v.isAnyArrayBuffer,g=v.isArrayBufferView,y=v.isDate,x=v.isMap,b=v.isRegExp,_=v.isSet,w=v.isNativeError,k=v.isBoxedPrimitive,T=v.isNumberObject,M=v.isStringObject,S=v.isBooleanObject,A=v.isBigIntObject,C=v.isSymbolObject,E=v.isFloat32Array,P=v.isFloat64Array;function L(e){if(0===e.length||e.length>10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function I(e){return Object.keys(e).filter(L).concat(u(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function R(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i0?o-4:o;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},91358:function(e){"use strict";function t(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}e.exports={ge:function(e,r,n,i,a){return o(e,r,n,i,a,t)},gt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},lt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},le:function(e,t,r,n,a){return o(e,t,r,n,a,i)},eq:function(e,t,r,n,i){return o(e,t,r,n,i,a)}}},13547:function(e,t){"use strict";function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},44781:function(e,t,r){"use strict";var n=r(53435);e.exports=function(e,t){t||(t={});var r,o,s,l,u,c,f,d,p,h,v,m=null==t.cutoff?.25:t.cutoff,g=null==t.radius?8:t.radius,y=t.channel||0;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,o=t.height,l=e,c=t.stride?t.stride:Math.floor(e.length/r/o)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(f=(d=e).getContext("2d"),r=d.width,o=d.height,l=(p=f.getImageData(0,0,r,o)).data,c=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(f=e,r=(d=e.canvas).width,o=d.height,l=(p=f.getImageData(0,0,r,o)).data,c=4):window.ImageData&&e instanceof window.ImageData&&(p=e,r=e.width,o=e.height,l=p.data,c=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(r*o),h=0,v=u.length;h-1?i(r):r}},68222:function(e,t,r){"use strict";var n=r(77575),i=r(68318),a=i("%Function.prototype.apply%"),o=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(o,a),l=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),c=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(d){u=null}e.exports=function(e){var t=s(n,o,arguments);return l&&u&&l(t,"length").configurable&&u(t,"length",{value:1+c(0,e.length-(arguments.length-1))}),t};var f=function(){return s(n,a,arguments)};u?u(e.exports,"apply",{value:f}):e.exports.apply=f},53435:function(e){e.exports=function(e,t,r){return tr?r:e:et?t:e}},6475:function(e,t,r){"use strict";var n=r(53435);function i(e,t){null==t&&(t=!0);var r=e[0],i=e[1],a=e[2],o=e[3];return null==o&&(o=t?1:255),t&&(r*=255,i*=255,a*=255,o*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((a=255&n(a,0,255))<<8)+(o=255&n(o,0,255))}e.exports=i,e.exports.to=i,e.exports.from=function(e,t){var r=(e=+e)>>>24,n=(16711680&e)>>>16,i=(65280&e)>>>8,a=255&e;return!1===t?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},76857:function(e){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},25075:function(e,t,r){"use strict";var n=r(36652),i=r(53435),a=r(90660);e.exports=function(e,t){"float"!==t&&t||(t="array"),"uint"===t&&(t="uint8"),"uint_clamped"===t&&(t="uint8_clamped");var r=new(a(t))(4),o="uint8"!==t&&"uint8_clamped"!==t;return e.length&&"string"!==typeof e||((e=n(e))[0]/=255,e[1]/=255,e[2]/=255),function(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||!!(Array.isArray(e)&&(e[0]>1||0===e[0])&&(e[1]>1||0===e[1])&&(e[2]>1||0===e[2])&&(!e[3]||e[3]>1))}(e)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=null!=e[3]?e[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=null!=e[3]?e[3]:1):(r[0]=i(Math.floor(255*e[0]),0,255),r[1]=i(Math.floor(255*e[1]),0,255),r[2]=i(Math.floor(255*e[2]),0,255),r[3]=null==e[3]?255:i(Math.floor(255*e[3]),0,255)),r)}},90736:function(e,t,r){"use strict";var n=r(76857),i=r(10973),a=r(46775);e.exports=function(e){var t,s,l=[],u=1;if("string"===typeof e)if(n[e])l=n[e].slice(),s="rgb";else if("transparent"===e)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var c=e.slice(1);u=1,(p=c.length)<=4?(l=[parseInt(c[0]+c[0],16),parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16)],4===p&&(u=parseInt(c[3]+c[3],16)/255)):(l=[parseInt(c[0]+c[1],16),parseInt(c[2]+c[3],16),parseInt(c[4]+c[5],16)],8===p&&(u=parseInt(c[6]+c[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var f=t[1],d="rgb"===f;s=c=f.replace(/a$/,"");var p="cmyk"===c?4:"gray"===c?1:3;l=t[2].trim().split(/\s*,\s*/).map((function(e,t){if(/%$/.test(e))return t===p?parseFloat(e)/100:"rgb"===c?255*parseFloat(e)/100:parseFloat(e);if("h"===c[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==o[e])return o[e]}return parseFloat(e)})),f===c&&l.push(1),u=d||void 0===l[p]?1:l[p],l=l.slice(0,p)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(l=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),s=e.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(e))if(i(e)){var h=a(e.r,e.red,e.R,null);null!==h?(s="rgb",l=[h,a(e.g,e.green,e.G),a(e.b,e.blue,e.B)]):(s="hsl",l=[a(e.h,e.hue,e.H),a(e.s,e.saturation,e.S),a(e.l,e.lightness,e.L,e.b,e.brightness)]),u=a(e.a,e.alpha,e.opacity,1),null!=e.opacity&&(u/=100)}else(Array.isArray(e)||r.g.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(e))&&(l=[e[0],e[1],e[2]],s="rgb",u=4===e.length?e[3]:1);else s="rgb",l=[e>>>16,(65280&e)>>>8,255&e];return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}},36652:function(e,t,r){"use strict";var n=r(90736),i=r(80009),a=r(53435);e.exports=function(e){var t,r=n(e);return r.space?((t=Array(3))[0]=a(r.values[0],0,255),t[1]=a(r.values[1],0,255),t[2]=a(r.values[2],0,255),"h"===r.space[0]&&(t=i.rgb(t)),t.push(a(r.alpha,0,1)),t):[]}},80009:function(e,t,r){"use strict";var n=r(6866);e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t,r,n,i,a,o=e[0]/360,s=e[1]/100,l=e[2]/100;if(0===s)return[a=255*l,a,a];t=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[u]=255*a;return i}},n.hsl=function(e){var t,r,n=e[0]/255,i=e[1]/255,a=e[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?t=0:n===s?t=(i-a)/l:i===s?t=2+(a-n)/l:a===s&&(t=4+(n-i)/l),(t=Math.min(60*t,360))<0&&(t+=360),r=(o+s)/2,[t,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},6866:function(e){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},24138:function(e){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},72791:function(e,t,r){"use strict";e.exports={parse:r(41004),stringify:r(53313)}},63625:function(e,t,r){"use strict";var n=r(40402);e.exports={isSize:function(e){return/^[\d\.]/.test(e)||-1!==e.indexOf("/")||-1!==n.indexOf(e)}}},41004:function(e,t,r){"use strict";var n=r(90448),i=r(38732),a=r(41901),o=r(15659),s=r(96209),l=r(83794),u=r(99011),c=r(63625).isSize;e.exports=d;var f=d.cache={};function d(e){if("string"!==typeof e)throw new Error("Font argument must be a string.");if(f[e])return f[e];if(""===e)throw new Error("Cannot parse an empty string.");if(-1!==a.indexOf(e))return f[e]={system:e};for(var t,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},d=u(e,/\s+/);t=d.shift();){if(-1!==i.indexOf(t))return["style","variant","weight","stretch"].forEach((function(e){r[e]=t})),f[e]=r;if(-1===s.indexOf(t))if("normal"!==t&&"small-caps"!==t)if(-1===l.indexOf(t)){if(-1===o.indexOf(t)){if(c(t)){var h=u(t,"/");if(r.size=h[0],null!=h[1]?r.lineHeight=p(h[1]):"/"===d[0]&&(d.shift(),r.lineHeight=p(d.shift())),!d.length)throw new Error("Missing required font-family.");return r.family=u(d.join(" "),/\s*,\s*/).map(n),f[e]=r}throw new Error("Unknown or unsupported font token: "+t)}r.weight=t}else r.stretch=t;else r.variant=t;else r.style=t}throw new Error("Missing required font-size.")}function p(e){var t=parseFloat(e);return t.toString()===e?t:e}},53313:function(e,t,r){"use strict";var n=r(71299),i=r(63625).isSize,a=v(r(38732)),o=v(r(41901)),s=v(r(15659)),l=v(r(96209)),u=v(r(83794)),c={normal:1,"small-caps":1},f={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},d="1rem",p="serif";function h(e,t){if(e&&!t[e]&&!a[e])throw Error("Unknown keyword `"+e+"`");return e}function v(e){for(var t={},r=0;rt?1:e>=t?0:NaN}r.d(t,{j2:function(){return n},Fp:function(){return o},J6:function(){return l},TS:function(){return u},VV:function(){return c},w6:function(){return f},Sm:function(){return d}});var i=function(e){var t;return 1===e.length&&(t=e,e=function(e,r){return n(t(e),r)}),{left:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}(n),a=(i.right,i.left,Array.prototype);function o(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n}function s(e){return null===e?NaN:+e}function l(e,t){var r,n=e.length,i=n,a=-1,o=0;if(null==t)for(;++a=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r}function c(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function f(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),a=new Array(i);++n=n.length)return null!=e&&r.sort(e),null!=t?t(r):r;for(var u,c,f,d=-1,p=r.length,h=n[i++],v=o(),m=s();++dn.length)return e;var a,o=i[r-1];return null!=t&&r>=n.length?a=e.entries():(a=[],e.each((function(e,t){a.push({key:t,values:s(e,r)})}))),null!=o?a.sort((function(e,t){return o(e.key,t.key)})):a}return r={object:function(e){return a(e,0,l,u)},map:function(e){return a(e,0,c,f)},entries:function(e){return s(a(e,0,c,f),0)},key:function(e){return n.push(e),r},sortKeys:function(e){return i[n.length-1]=e,r},sortValues:function(t){return e=t,r},rollup:function(e){return t=e,r}}}function l(){return{}}function u(e,t,r){e[t]=r}function c(){return o()}function f(e,t,r){e.set(t,r)}function d(){}var p=o.prototype;d.prototype=function(e,t){var r=new d;if(e instanceof d)e.each((function(e){r.add(e)}));else if(e){var n=-1,i=e.length;if(null==t)for(;++n=(a=(v+g)/2))?v=a:g=a,(c=r>=(o=(m+y)/2))?m=o:y=o,i=p,!(p=p[f=c<<1|u]))return i[f]=h,e;if(s=+e._x.call(null,p.data),l=+e._y.call(null,p.data),t===s&&r===l)return h.next=p,i?i[f]=h:e._root=h,e;do{i=i?i[f]=new Array(4):e._root=new Array(4),(u=t>=(a=(v+g)/2))?v=a:g=a,(c=r>=(o=(m+y)/2))?m=o:y=o}while((f=c<<1|u)===(d=(l>=o)<<1|s>=a));return i[d]=p,i[f]=h,e}function s(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function l(e){return e[0]}function u(e){return e[1]}function c(e,t,r){var n=new f(null==t?l:t,null==r?u:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function f(e,t,r,n,i,a){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function d(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}r.r(t),r.d(t,{forceCenter:function(){return n},forceCollide:function(){return m},forceLink:function(){return b},forceManyBody:function(){return K},forceRadial:function(){return $},forceSimulation:function(){return X},forceX:function(){return J},forceY:function(){return Q}});var p=c.prototype=f.prototype;function h(e){return e.x+e.vx}function v(e){return e.y+e.vy}function m(e){var t,r,n=1,o=1;function s(){for(var e,i,s,u,f,d,p,m=t.length,g=0;gu+h||if+h||os.index){var v=u-l.x-l.vx,m=f-l.y-l.vy,g=v*v+m*m;ge.r&&(e.r=e[t].r)}function u(){if(t){var n,i,a=t.length;for(r=new Array(a),n=0;nf&&(f=n),id&&(d=i));if(u>f||c>d)return this;for(this.cover(u,c).cover(f,d),r=0;re||e>=i||n>t||t>=a;)switch(s=(tp||(a=u.y0)>h||(o=u.x1)=y)<<1|e>=g)&&(u=v[v.length-1],v[v.length-1]=v[v.length-1-c],v[v.length-1-c]=u)}else{var x=e-+this._x.call(null,m.data),b=t-+this._y.call(null,m.data),_=x*x+b*b;if(_=(s=(h+m)/2))?h=s:m=s,(c=o>=(l=(v+g)/2))?v=l:g=l,t=p,!(p=p[f=c<<1|u]))return this;if(!p.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(r=t,d=f)}for(;p.data!==e;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):t?(i?t[f]=i:delete t[f],(p=t[0]||t[1]||t[2]||t[3])&&p===(t[3]||t[2]||t[1]||t[0])&&!p.length&&(r?r[d]=p:this._root=p),this):(this._root=i,this)},p.removeAll=function(e){for(var t=0,r=e.length;t=0&&(t=e.slice(r+1),e=e.slice(0,r)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!==typeof t)throw new Error("invalid callback: "+t);for(;++o0)for(var r,n,i=new Array(r),a=0;a=0&&t._call.call(null,e),t=t._next;--E}()}finally{E=0,function(){for(var e,t,r=S,n=1/0;r;)r._call?(n>r._time&&(n=r._time),e=r,r=r._next):(t=r._next,r._next=null,r=e?e._next=t:S=t);A=e,H(n)}(),O=0}}function U(){var e=z.now(),t=e-R;t>I&&(D-=t,R=e)}function H(e){E||(P&&(P=clearTimeout(P)),e-O>24?(e<1/0&&(P=setTimeout(V,e-z.now()-D)),L&&(L=clearInterval(L))):(L||(R=z.now(),L=setInterval(U,I)),E=1,F(V)))}function W(e){return e.x}function G(e){return e.y}Z.prototype=B.prototype={constructor:Z,restart:function(e,t,r){if("function"!==typeof e)throw new TypeError("callback is not a function");r=(null==r?j():+r)+(null==t?0:+t),this._next||A===this||(A?A._next=this:S=this,A=this),this._call=e,this._time=r,H()},stop:function(){this._call&&(this._call=null,this._time=1/0,H())}};var q=10,Y=Math.PI*(3-Math.sqrt(5));function X(e){var t,r=1,n=.001,i=1-Math.pow(n,1/300),a=0,o=.6,s=(0,g.UI)(),l=B(c),u=C("tick","end");function c(){f(),u.call("tick",t),r1?(null==r?s.remove(e):s.set(e,p(r)),t):s.get(e)},find:function(t,r,n){var i,a,o,s,l,u=0,c=e.length;for(null==n?n=1/0:n*=n,u=0;u1?(u.on(e,r),t):u.on(e)}}}function K(){var e,t,r,n,o=i(-30),s=1,l=1/0,u=.81;function f(n){var i,a=e.length,o=c(e,W,G).visitAfter(p);for(r=n,i=0;i=l)){(e.data!==t||e.next)&&(0===f&&(h+=(f=a())*f),0===d&&(h+=(d=a())*d),h1?n[0]+n.slice(2):n,+e.slice(r+1)]}r.d(t,{WU:function(){return d},FF:function(){return v}});var i,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(e){if(!(t=a.exec(e)))throw new Error("invalid format: "+e);var t;return new s({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function s(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function l(e,t){var r=n(e,t);if(!r)return e+"";var i=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}o.prototype=s.prototype,s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var u={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return l(100*e,t)},r:l,s:function(e,t){var r=n(e,t);if(!r)return e+"";var a=r[0],o=r[1],s=o-(i=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+n(e,Math.max(0,t+s-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function c(e){return e}var f,d,p=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function v(e){var t,r,a=void 0===e.grouping||void 0===e.thousands?c:(t=p.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var i=e.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(e.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[o=(o+1)%t.length];return a.reverse().join(r)}),s=void 0===e.currency?"":e.currency[0]+"",l=void 0===e.currency?"":e.currency[1]+"",f=void 0===e.decimal?".":e.decimal+"",d=void 0===e.numerals?c:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(p.call(e.numerals,String)),v=void 0===e.percent?"%":e.percent+"",m=void 0===e.minus?"-":e.minus+"",g=void 0===e.nan?"NaN":e.nan+"";function y(e){var t=(e=o(e)).fill,r=e.align,n=e.sign,c=e.symbol,p=e.zero,y=e.width,x=e.comma,b=e.precision,_=e.trim,w=e.type;"n"===w?(x=!0,w="g"):u[w]||(void 0===b&&(b=12),_=!0,w="g"),(p||"0"===t&&"="===r)&&(p=!0,t="0",r="=");var k="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T="$"===c?l:/[%p]/.test(w)?v:"",M=u[w],S=/[defgprs%]/.test(w);function A(e){var o,s,l,u=k,c=T;if("c"===w)c=M(e)+c,e="";else{var v=(e=+e)<0||1/e<0;if(e=isNaN(e)?g:M(Math.abs(e),b),_&&(e=function(e){e:for(var t,r=e.length,n=1,i=-1;n0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),v&&0===+e&&"+"!==n&&(v=!1),u=(v?"("===n?n:m:"-"===n||"("===n?"":n)+u,c=("s"===w?h[8+i/3]:"")+c+(v&&"("===n?")":""),S)for(o=-1,s=e.length;++o(l=e.charCodeAt(o))||l>57){c=(46===l?f+e.slice(o+1):e.slice(o))+c,e=e.slice(0,o);break}}x&&!p&&(e=a(e,1/0));var A=u.length+e.length+c.length,C=A>1)+u+e+c+C.slice(A);break;default:e=C+u+e+c}return d(e)}return b=void 0===b?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),A.toString=function(){return e+""},A}return{format:y,formatPrefix:function(e,t){var r,i=y(((e=o(e)).type="f",e)),a=3*Math.max(-8,Math.min(8,Math.floor((r=t,((r=n(Math.abs(r)))?r[1]:NaN)/3)))),s=Math.pow(10,-a),l=h[8+a/3];return function(e){return i(s*e)+l}}}}f=v({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),d=f.format,f.formatPrefix},65704:function(e,t,r){"use strict";r.r(t),r.d(t,{geoAiry:function(){return D},geoAiryRaw:function(){return O},geoAitoff:function(){return F},geoAitoffRaw:function(){return z},geoArmadillo:function(){return N},geoArmadilloRaw:function(){return j},geoAugust:function(){return B},geoAugustRaw:function(){return Z},geoBaker:function(){return W},geoBakerRaw:function(){return H},geoBerghaus:function(){return Y},geoBerghausRaw:function(){return q},geoBertin1953:function(){return re},geoBertin1953Raw:function(){return te},geoBoggs:function(){return ce},geoBoggsRaw:function(){return ue},geoBonne:function(){return ve},geoBonneRaw:function(){return he},geoBottomley:function(){return ge},geoBottomleyRaw:function(){return me},geoBromley:function(){return xe},geoBromleyRaw:function(){return ye},geoChamberlin:function(){return Ce},geoChamberlinAfrica:function(){return Ae},geoChamberlinRaw:function(){return Me},geoCollignon:function(){return Pe},geoCollignonRaw:function(){return Ee},geoCraig:function(){return Ie},geoCraigRaw:function(){return Le},geoCraster:function(){return De},geoCrasterRaw:function(){return Oe},geoCylindricalEqualArea:function(){return Fe},geoCylindricalEqualAreaRaw:function(){return ze},geoCylindricalStereographic:function(){return Ne},geoCylindricalStereographicRaw:function(){return je},geoEckert1:function(){return Be},geoEckert1Raw:function(){return Ze},geoEckert2:function(){return Ue},geoEckert2Raw:function(){return Ve},geoEckert3:function(){return We},geoEckert3Raw:function(){return He},geoEckert4:function(){return qe},geoEckert4Raw:function(){return Ge},geoEckert5:function(){return Xe},geoEckert5Raw:function(){return Ye},geoEckert6:function(){return $e},geoEckert6Raw:function(){return Ke},geoEisenlohr:function(){return et},geoEisenlohrRaw:function(){return Qe},geoFahey:function(){return nt},geoFaheyRaw:function(){return rt},geoFoucaut:function(){return at},geoFoucautRaw:function(){return it},geoFoucautSinusoidal:function(){return st},geoFoucautSinusoidalRaw:function(){return ot},geoGilbert:function(){return dt},geoGingery:function(){return mt},geoGingeryRaw:function(){return pt},geoGinzburg4:function(){return xt},geoGinzburg4Raw:function(){return yt},geoGinzburg5:function(){return _t},geoGinzburg5Raw:function(){return bt},geoGinzburg6:function(){return kt},geoGinzburg6Raw:function(){return wt},geoGinzburg8:function(){return Mt},geoGinzburg8Raw:function(){return Tt},geoGinzburg9:function(){return At},geoGinzburg9Raw:function(){return St},geoGringorten:function(){return Pt},geoGringortenQuincuncial:function(){return ai},geoGringortenRaw:function(){return Et},geoGuyou:function(){return Ot},geoGuyouRaw:function(){return Rt},geoHammer:function(){return J},geoHammerRaw:function(){return K},geoHammerRetroazimuthal:function(){return jt},geoHammerRetroazimuthalRaw:function(){return zt},geoHealpix:function(){return qt},geoHealpixRaw:function(){return Ut},geoHill:function(){return Xt},geoHillRaw:function(){return Yt},geoHomolosine:function(){return tr},geoHomolosineRaw:function(){return er},geoHufnagel:function(){return nr},geoHufnagelRaw:function(){return rr},geoHyperelliptical:function(){return sr},geoHyperellipticalRaw:function(){return or},geoInterrupt:function(){return cr},geoInterruptedBoggs:function(){return dr},geoInterruptedHomolosine:function(){return hr},geoInterruptedMollweide:function(){return mr},geoInterruptedMollweideHemispheres:function(){return yr},geoInterruptedQuarticAuthalic:function(){return fn},geoInterruptedSinuMollweide:function(){return br},geoInterruptedSinusoidal:function(){return wr},geoKavrayskiy7:function(){return Tr},geoKavrayskiy7Raw:function(){return kr},geoLagrange:function(){return Sr},geoLagrangeRaw:function(){return Mr},geoLarrivee:function(){return Er},geoLarriveeRaw:function(){return Cr},geoLaskowski:function(){return Lr},geoLaskowskiRaw:function(){return Pr},geoLittrow:function(){return Rr},geoLittrowRaw:function(){return Ir},geoLoximuthal:function(){return Dr},geoLoximuthalRaw:function(){return Or},geoMiller:function(){return Fr},geoMillerRaw:function(){return zr},geoModifiedStereographic:function(){return Xr},geoModifiedStereographicAlaska:function(){return Hr},geoModifiedStereographicGs48:function(){return Wr},geoModifiedStereographicGs50:function(){return Gr},geoModifiedStereographicLee:function(){return Yr},geoModifiedStereographicMiller:function(){return qr},geoModifiedStereographicRaw:function(){return jr},geoMollweide:function(){return oe},geoMollweideRaw:function(){return ae},geoMtFlatPolarParabolic:function(){return Qr},geoMtFlatPolarParabolicRaw:function(){return Jr},geoMtFlatPolarQuartic:function(){return tn},geoMtFlatPolarQuarticRaw:function(){return en},geoMtFlatPolarSinusoidal:function(){return nn},geoMtFlatPolarSinusoidalRaw:function(){return rn},geoNaturalEarth:function(){return an.Z},geoNaturalEarth2:function(){return sn},geoNaturalEarth2Raw:function(){return on},geoNaturalEarthRaw:function(){return an.K},geoNellHammer:function(){return un},geoNellHammerRaw:function(){return ln},geoNicolosi:function(){return pn},geoNicolosiRaw:function(){return dn},geoPatterson:function(){return Tn},geoPattersonRaw:function(){return kn},geoPeirceQuincuncial:function(){return oi},geoPierceQuincuncial:function(){return oi},geoPolyconic:function(){return Sn},geoPolyconicRaw:function(){return Mn},geoPolyhedral:function(){return Rn},geoPolyhedralButterfly:function(){return Zn},geoPolyhedralCollignon:function(){return Un},geoPolyhedralWaterman:function(){return Hn},geoProject:function(){return Xn},geoQuantize:function(){return si},geoQuincuncial:function(){return ii},geoRectangularPolyconic:function(){return ui},geoRectangularPolyconicRaw:function(){return li},geoRobinson:function(){return di},geoRobinsonRaw:function(){return fi},geoSatellite:function(){return hi},geoSatelliteRaw:function(){return pi},geoSinuMollweide:function(){return Qt},geoSinuMollweideRaw:function(){return Jt},geoSinusoidal:function(){return pe},geoSinusoidalRaw:function(){return de},geoStitch:function(){return Ri},geoTimes:function(){return Di},geoTimesRaw:function(){return Oi},geoTwoPointAzimuthal:function(){return Ni},geoTwoPointAzimuthalRaw:function(){return Fi},geoTwoPointAzimuthalUsa:function(){return ji},geoTwoPointEquidistant:function(){return Vi},geoTwoPointEquidistantRaw:function(){return Zi},geoTwoPointEquidistantUsa:function(){return Bi},geoVanDerGrinten:function(){return Hi},geoVanDerGrinten2:function(){return Gi},geoVanDerGrinten2Raw:function(){return Wi},geoVanDerGrinten3:function(){return Yi},geoVanDerGrinten3Raw:function(){return qi},geoVanDerGrinten4:function(){return Ki},geoVanDerGrinten4Raw:function(){return Xi},geoVanDerGrintenRaw:function(){return Ui},geoWagner:function(){return Ji},geoWagner4:function(){return na},geoWagner4Raw:function(){return ra},geoWagner6:function(){return aa},geoWagner6Raw:function(){return ia},geoWagner7:function(){return Qi},geoWagnerRaw:function(){return $i},geoWiechel:function(){return sa},geoWiechelRaw:function(){return oa},geoWinkel3:function(){return ua},geoWinkel3Raw:function(){return la}});var n=r(15002),i=Math.abs,a=Math.atan,o=Math.atan2,s=(Math.ceil,Math.cos),l=Math.exp,u=Math.floor,c=Math.log,f=Math.max,d=Math.min,p=Math.pow,h=Math.round,v=Math.sign||function(e){return e>0?1:e<0?-1:0},m=Math.sin,g=Math.tan,y=1e-6,x=1e-12,b=Math.PI,_=b/2,w=b/4,k=Math.SQRT1_2,T=L(2),M=L(b),S=2*b,A=180/b,C=b/180;function E(e){return e>1?_:e<-1?-_:Math.asin(e)}function P(e){return e>1?0:e<-1?b:Math.acos(e)}function L(e){return e>0?Math.sqrt(e):0}function I(e){return(l(e)-l(-e))/2}function R(e){return(l(e)+l(-e))/2}function O(e){var t=g(e/2),r=2*c(s(e/2))/(t*t);function n(e,t){var n=s(e),i=s(t),a=m(t),o=i*n,l=-((1-o?c((1+o)/2)/(1-o):-.5)+r/(1+o));return[l*i*m(e),l*a]}return n.invert=function(t,n){var a,l=L(t*t+n*n),u=-e/2,f=50;if(!l)return[0,0];do{var d=u/2,p=s(d),h=m(d),v=h/p,g=-c(i(p));u-=a=(2/v*g-r*v-l)/(-g/(h*h)+1-r/(2*p*p))*(p<0?.7:1)}while(i(a)>y&&--f>0);var x=m(u);return[o(t*x,l*s(u)),E(n*x/l)]},n}function D(){var e=_,t=(0,n.r)(O),r=t(e);return r.radius=function(r){return arguments.length?t(e=r*C):e*A},r.scale(179.976).clipAngle(147)}function z(e,t){var r=s(t),n=function(e){return e?e/Math.sin(e):1}(P(r*s(e/=2)));return[2*r*m(e)*n,m(t)*n]}function F(){return(0,n.Z)(z).scale(152.63)}function j(e){var t=m(e),r=s(e),n=e>=0?1:-1,a=g(n*e),l=(1+t-r)/2;function u(e,i){var u=s(i),c=s(e/=2);return[(1+u)*m(e),(n*i>-o(c,a)-.001?0:10*-n)+l+m(i)*r-(1+u)*t*c]}return u.invert=function(e,u){var c=0,f=0,d=50;do{var p=s(c),h=m(c),v=s(f),g=m(f),x=1+v,b=x*h-e,_=l+g*r-x*t*p-u,w=x*p/2,k=-h*g,T=t*x*h/2,M=r*v+t*p*g,S=k*T-M*w,A=(_*k-b*M)/S/2,C=(b*T-_*w)/S;i(C)>2&&(C/=2),c-=A,f-=C}while((i(A)>y||i(C)>y)&&--d>0);return n*f>-o(s(c),a)-.001?[2*c,f]:null},u}function N(){var e=20*C,t=e>=0?1:-1,r=g(t*e),i=(0,n.r)(j),a=i(e),l=a.stream;return a.parallel=function(n){return arguments.length?(r=g((t=(e=n*C)>=0?1:-1)*e),i(e)):e*A},a.stream=function(n){var i=a.rotate(),u=l(n),c=(a.rotate([0,0]),l(n)),f=a.precision();return a.rotate(i),u.sphere=function(){c.polygonStart(),c.lineStart();for(var n=-180*t;t*n<180;n+=90*t)c.point(n,90*t);if(e)for(;t*(n-=3*t*f)>=-180;)c.point(n,t*-o(s(n*C/2),r)*A);c.lineEnd(),c.polygonEnd()},u},a.scale(218.695).center([0,28.0974])}function Z(e,t){var r=g(t/2),n=L(1-r*r),i=1+n*s(e/=2),a=m(e)*n/i,o=r/i,l=a*a,u=o*o;return[4/3*a*(3+l-3*u),4/3*o*(3+3*l-u)]}function B(){return(0,n.Z)(Z).scale(66.1603)}z.invert=function(e,t){if(!(e*e+4*t*t>b*b+y)){var r=e,n=t,a=25;do{var o,l=m(r),u=m(r/2),c=s(r/2),f=m(n),d=s(n),p=m(2*n),h=f*f,v=d*d,g=u*u,x=1-v*c*c,_=x?P(d*c)*L(o=1/x):o=0,w=2*_*d*u-e,k=_*f-t,T=o*(v*g+_*d*c*h),M=o*(.5*l*p-2*_*f*u),S=.25*o*(p*u-_*f*v*l),A=o*(h*c+_*g*d),C=M*S-A*T;if(!C)break;var E=(k*M-w*A)/C,I=(w*S-k*T)/C;r-=E,n-=I}while((i(E)>y||i(I)>y)&&--a>0);return[r,n]}},Z.invert=function(e,t){if(t*=3/8,!(e*=3/8)&&i(t)>1)return null;var r=1+e*e+t*t,n=L((r-L(r*r-4*t*t))/2),a=E(n)/3,l=n?function(e){return c(e+L(e*e-1))}(i(t/n))/3:function(e){return c(e+L(e*e+1))}(i(e))/3,u=s(a),f=R(l),d=f*f-u*u;return[2*v(e)*o(I(l)*u,.25-d),2*v(t)*o(f*m(a),.25+d)]};var V=L(8),U=c(1+T);function H(e,t){var r=i(t);return rx&&--u>0);return[e/(s(o)*(V-1/m(o))),v(t)*o]};var G=r(17889);function q(e){var t=2*b/e;function r(e,r){var n=(0,G.N)(e,r);if(i(e)>_){var a=o(n[1],n[0]),l=L(n[0]*n[0]+n[1]*n[1]),u=t*h((a-_)/t)+_,c=o(m(a-=u),2-s(a));a=u+E(b/l*m(c))-c,n[0]=l*s(a),n[1]=l*m(a)}return n}return r.invert=function(e,r){var n=L(e*e+r*r);if(n>_){var i=o(r,e),l=t*h((i-_)/t)+_,u=i>l?-1:1,c=n*s(l-i),f=1/g(u*P((c-b)/L(b*(b-2*c)+n*n)));i=l+2*a((f+u*L(f*f-3))/3),e=n*s(i),r=n*m(i)}return G.N.invert(e,r)},r}function Y(){var e=5,t=(0,n.r)(q),r=t(e),i=r.stream,a=.01,l=-s(a*C),u=m(a*C);return r.lobes=function(r){return arguments.length?t(e=+r):e},r.stream=function(t){var n=r.rotate(),c=i(t),f=(r.rotate([0,0]),i(t));return r.rotate(n),c.sphere=function(){f.polygonStart(),f.lineStart();for(var t=0,r=360/e,n=2*b/e,i=90-180/e,c=_;t0&&i(n)>y);return s<0?NaN:r}function ee(e,t,r){return void 0===t&&(t=40),void 0===r&&(r=x),function(n,a,o,s){var l,u,c;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var f=0;fl)o-=u/=2,s-=c/=2;else{l=v;var m=(o>0?-1:1)*r,g=(s>0?-1:1)*r,y=e(o+m,s),x=e(o,s+g),b=(y[0]-d[0])/m,_=(y[1]-d[1])/m,w=(x[0]-d[0])/g,k=(x[1]-d[1])/g,T=k*b-_*w,M=(i(T)<.5?.5:1)/T;if(o+=u=(h*w-p*k)*M,s+=c=(p*_-h*b)*M,i(u)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return t.invert=ee(t),t}function re(){return(0,n.Z)(te()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ne(e,t){var r,n=e*m(t),a=30;do{t-=r=(t+m(t)-n)/(1+s(t))}while(i(r)>y&&--a>0);return t/2}function ie(e,t,r){function n(n,i){return[e*n*s(i=ne(r,i)),t*m(i)]}return n.invert=function(n,i){return i=E(i/t),[n/(e*s(i)),E((2*i+m(2*i))/r)]},n}$.invert=function(e,t){var r=2*E(t/2);return[e*s(r/2)/s(r),r]};var ae=ie(T/_,T,b);function oe(){return(0,n.Z)(ae).scale(169.529)}var se=2.00276,le=1.11072;function ue(e,t){var r=ne(b,t);return[se*e/(1/s(t)+le/s(r)),(t+T*m(r))/se]}function ce(){return(0,n.Z)(ue).scale(160.857)}function fe(e){var t=0,r=(0,n.r)(e),i=r(t);return i.parallel=function(e){return arguments.length?r(t=e*C):t*A},i}function de(e,t){return[e*s(t),t]}function pe(){return(0,n.Z)(de).scale(152.63)}function he(e){if(!e)return de;var t=1/g(e);function r(r,n){var i=t+e-n,a=i?r*s(n)/i:i;return[i*m(a),t-i*s(a)]}return r.invert=function(r,n){var i=L(r*r+(n=t-n)*n),a=t+e-i;return[i/s(a)*o(r,n),a]},r}function ve(){return fe(he).scale(123.082).center([0,26.1441]).parallel(45)}function me(e){function t(t,r){var n=_-r,i=n?t*e*m(n)/n:n;return[n*m(i)/e,_-n*s(i)]}return t.invert=function(t,r){var n=t*e,i=_-r,a=L(n*n+i*i),s=o(n,i);return[(a?a/m(a):1)*s/e,_-a]},t}function ge(){var e=.5,t=(0,n.r)(me),r=t(e);return r.fraction=function(r){return arguments.length?t(e=+r):e},r.scale(158.837)}ue.invert=function(e,t){var r,n,a=se*t,o=t<0?-w:w,l=25;do{n=a-T*m(o),o-=r=(m(2*o)+2*o-b*m(n))/(2*s(2*o)+2+b*s(n)*T*s(o))}while(i(r)>y&&--l>0);return n=a-T*m(o),[e*(1/s(n)+le/s(o))/se,n]},de.invert=function(e,t){return[e/s(t),t]};var ye=ie(1,4/b,b);function xe(){return(0,n.Z)(ye).scale(152.63)}var be=r(66624),_e=r(49386);function we(e,t,r,n,a,l){var u,c=s(l);if(i(e)>1||i(l)>1)u=P(r*a+t*n*c);else{var f=m(e/2),d=m(l/2);u=2*E(L(f*f+t*n*d*d))}return i(u)>y?[u,o(n*m(l),t*a-r*n*c)]:[0,0]}function ke(e,t,r){return P((e*e+t*t-r*r)/(2*e*t))}function Te(e){return e-2*b*u((e+b)/(2*b))}function Me(e,t,r){for(var n,i=[[e[0],e[1],m(e[1]),s(e[1])],[t[0],t[1],m(t[1]),s(t[1])],[r[0],r[1],m(r[1]),s(r[1])]],a=i[2],o=0;o<3;++o,a=n)n=i[o],a.v=we(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=ke(i[0].v[0],i[2].v[0],i[1].v[0]),u=ke(i[0].v[0],i[1].v[0],i[2].v[0]),c=b-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var f=[i[2].point[0]=i[0].point[0]+i[2].v[0]*s(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(e,t){var r,n=m(t),a=s(t),o=new Array(3);for(r=0;r<3;++r){var l=i[r];if(o[r]=we(t-l[1],l[3],l[2],a,n,e-l[0]),!o[r][0])return l.point;o[r][1]=Te(o[r][1]-l.v[1])}var d=f.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,h=ke(i[r].v[0],o[r][0],o[p][0]);o[r][1]<0&&(h=-h),r?1==r?(h=u-h,d[0]-=o[r][0]*s(h),d[1]-=o[r][0]*m(h)):(h=c-h,d[0]+=o[r][0]*s(h),d[1]+=o[r][0]*m(h)):(d[0]+=o[r][0]*s(h),d[1]-=o[r][0]*m(h))}return d[0]/=3,d[1]/=3,d}}function Se(e){return e[0]*=C,e[1]*=C,e}function Ae(){return Ce([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function Ce(e,t,r){var i=(0,be.Z)({type:"MultiPoint",coordinates:[e,t,r]}),a=[-i[0],-i[1]],o=(0,_e.Z)(a),s=Me(Se(o(e)),Se(o(t)),Se(o(r)));s.invert=ee(s);var l=(0,n.Z)(s).rotate(a),u=l.center;return delete l.rotate,l.center=function(e){return arguments.length?u(o(e)):o.invert(u())},l.clipAngle(90)}function Ee(e,t){var r=L(1-m(t));return[2/M*e*r,M*(1-r)]}function Pe(){return(0,n.Z)(Ee).scale(95.6464).center([0,30])}function Le(e){var t=g(e);function r(e,r){return[e,(e?e/m(e):1)*(m(r)*s(e)-t*s(r))]}return r.invert=t?function(e,r){e&&(r*=m(e)/e);var n=s(e);return[e,2*o(L(n*n+t*t-r*r)-n,t-r)]}:function(e,t){return[e,E(e?t*g(e)/e:t)]},r}function Ie(){return fe(Le).scale(249.828).clipAngle(90)}Ee.invert=function(e,t){var r=(r=t/M-1)*r;return[r>0?e*L(b/r)/2:0,E(1-r)]};var Re=L(3);function Oe(e,t){return[Re*e*(2*s(2*t/3)-1)/M,Re*M*m(t/3)]}function De(){return(0,n.Z)(Oe).scale(156.19)}function ze(e){var t=s(e);function r(e,r){return[e*t,m(r)/t]}return r.invert=function(e,r){return[e/t,E(r*t)]},r}function Fe(){return fe(ze).parallel(38.58).scale(195.044)}function je(e){var t=s(e);function r(e,r){return[e*t,(1+t)*g(r/2)]}return r.invert=function(e,r){return[e/t,2*a(r/(1+t))]},r}function Ne(){return fe(je).scale(124.75)}function Ze(e,t){var r=L(8/(3*b));return[r*e*(1-i(t)/b),r*t]}function Be(){return(0,n.Z)(Ze).scale(165.664)}function Ve(e,t){var r=L(4-3*m(i(t)));return[2/L(6*b)*e*r,v(t)*L(2*b/3)*(2-r)]}function Ue(){return(0,n.Z)(Ve).scale(165.664)}function He(e,t){var r=L(b*(4+b));return[2/r*e*(1+L(1-4*t*t/(b*b))),4/r*t]}function We(){return(0,n.Z)(He).scale(180.739)}function Ge(e,t){var r=(2+_)*m(t);t/=2;for(var n=0,a=1/0;n<10&&i(a)>y;n++){var o=s(t);t-=a=(t+m(t)*(o+2)-r)/(2*o*(1+o))}return[2/L(b*(4+b))*e*(1+s(t)),2*L(b/(4+b))*m(t)]}function qe(){return(0,n.Z)(Ge).scale(180.739)}function Ye(e,t){return[e*(1+s(t))/L(2+b),2*t/L(2+b)]}function Xe(){return(0,n.Z)(Ye).scale(173.044)}function Ke(e,t){for(var r=(1+_)*m(t),n=0,a=1/0;n<10&&i(a)>y;n++)t-=a=(t+m(t)-r)/(1+s(t));return r=L(2+b),[e*(1+s(t))/r,2*t/r]}function $e(){return(0,n.Z)(Ke).scale(173.044)}Oe.invert=function(e,t){var r=3*E(t/(Re*M));return[M*e/(Re*(2*s(2*r/3)-1)),r]},Ze.invert=function(e,t){var r=L(8/(3*b)),n=t/r;return[e/(r*(1-i(n)/b)),n]},Ve.invert=function(e,t){var r=2-i(t)/L(2*b/3);return[e*L(6*b)/(2*r),v(t)*E((4-r*r)/3)]},He.invert=function(e,t){var r=L(b*(4+b))/2;return[e*r/(1+L(1-t*t*(4+b)/(4*b))),t*r/2]},Ge.invert=function(e,t){var r=t*L((4+b)/b)/2,n=E(r),i=s(n);return[e/(2/L(b*(4+b))*(1+i)),E((n+r*(i+2))/(2+_))]},Ye.invert=function(e,t){var r=L(2+b),n=t*r/2;return[r*e/(1+s(n)),n]},Ke.invert=function(e,t){var r=1+_,n=L(r/2);return[2*e*n/(1+s(t*=n)),E((t+m(t))/r)]};var Je=3+2*T;function Qe(e,t){var r=m(e/=2),n=s(e),i=L(s(t)),o=s(t/=2),l=m(t)/(o+T*n*i),u=L(2/(1+l*l)),f=L((T*o+(n+r)*i)/(T*o+(n-r)*i));return[Je*(u*(f-1/f)-2*c(f)),Je*(u*l*(f+1/f)-2*a(l))]}function et(){return(0,n.Z)(Qe).scale(62.5271)}Qe.invert=function(e,t){if(!(r=Z.invert(e/1.2,1.065*t)))return null;var r,n=r[0],o=r[1],l=20;e/=Je,t/=Je;do{var u=n/2,p=o/2,h=m(u),v=s(u),g=m(p),x=s(p),b=s(o),w=L(b),M=g/(x+T*v*w),S=M*M,A=L(2/(1+S)),C=(T*x+(v+h)*w)/(T*x+(v-h)*w),E=L(C),P=E-1/E,I=E+1/E,R=A*P-2*c(E)-e,O=A*M*I-2*a(M)-t,D=g&&k*w*h*S/g,z=(T*v*x+w)/(2*(x+T*v*w)*(x+T*v*w)*w),F=-.5*M*A*A*A,j=F*D,N=F*z,B=(B=2*x+T*w*(v-h))*B*E,V=(T*v*x*w+b)/B,U=-T*h*g/(w*B),H=P*j-2*V/E+A*(V+V/C),W=P*N-2*U/E+A*(U+U/C),G=M*I*j-2*D/(1+S)+A*I*D+A*M*(V-V/C),q=M*I*N-2*z/(1+S)+A*I*z+A*M*(U-U/C),Y=W*G-q*H;if(!Y)break;var X=(O*W-R*q)/Y,K=(R*G-O*H)/Y;n-=X,o=f(-_,d(_,o-K))}while((i(X)>y||i(K)>y)&&--l>0);return i(i(o)-_)n){var d=L(f),p=o(c,u),v=r*h(p/r),g=p-v,x=e*s(g),w=(e*m(g)-g*m(x))/(_-x),k=ht(g,w),T=(b-e)/vt(k,x,b);u=d;var M,S=50;do{u-=M=(e+vt(k,x,u)*T-d)/(k(u)*T)}while(i(M)>y&&--S>0);c=g*m(u),u<_&&(c-=w*(u-_));var A=m(v),C=s(v);l[0]=u*C-c*A,l[1]=u*A+c*C}return l}return a.invert=function(t,a){var l=t*t+a*a;if(l>n){var u=L(l),c=o(a,t),f=r*h(c/r),d=c-f;t=u*s(d),a=u*m(d);for(var p=t-_,v=m(t),g=a/v,y=t<_?1/0:0,w=10;;){var k=e*m(g),T=e*s(g),M=m(T),S=_-T,A=(k-g*M)/S,C=ht(g,A);if(i(y)y||i(p)>y)&&--g>0);return[h,v]},c}var yt=gt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function xt(){return(0,n.Z)(yt).scale(149.995)}var bt=gt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function _t(){return(0,n.Z)(bt).scale(153.93)}var wt=gt(5/6*b,-.62636,-.0344,0,1.3493,-.05524,0,.045);function kt(){return(0,n.Z)(wt).scale(130.945)}function Tt(e,t){var r=e*e,n=t*t;return[e*(1-.162388*n)*(.87-952426e-9*r*r),t*(1+n/12)]}function Mt(){return(0,n.Z)(Tt).scale(131.747)}Tt.invert=function(e,t){var r,n=e,a=t,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-t)/(1+s/4)}while(i(r)>y&&--o>0);o=50,e/=1-.162388*s;do{var l=(l=n*n)*l;n-=r=(n*(.87-952426e-9*l)-e)/(.87-.00476213*l)}while(i(r)>y&&--o>0);return[n,a]};var St=gt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function At(){return(0,n.Z)(St).scale(131.087)}function Ct(e){var t=e(_,0)[0]-e(-_,0)[0];function r(r,n){var i=r>0?-.5:.5,a=e(r+i*b,n);return a[0]-=i*t,a}return e.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=e.invert(r+i*t,n),o=a[0]-i*b;return o<-b?o+=2*b:o>b&&(o-=2*b),a[0]=o,a}),r}function Et(e,t){var r=v(e),n=v(t),a=s(t),l=s(e)*a,u=m(e)*a,c=m(n*t);e=i(o(u,c)),t=E(l),i(e-_)>y&&(e%=_);var f=function(e,t){if(t===_)return[0,0];var r,n,a=m(t),o=a*a,l=o*o,u=1+l,c=1+3*l,f=1-l,d=E(1/L(u)),p=f+o*u*d,h=(1-a)/p,v=L(h),g=h*u,x=L(g),w=v*f;if(0===e)return[0,-(w+o*x)];var k,T=s(t),M=1/T,S=2*a*T,A=(-3*o+d*c)*S,C=(-p*T-(1-a)*A)/(p*p),P=o*u*C+h*c*S,I=-M*S,R=-M*P,O=-2*M*(f*(.5*C/v)-2*o*v*S),D=4*e/b;if(e>.222*b||t.175*b){if(r=(w+o*L(g*(1+l)-w*w))/(1+l),e>b/4)return[r,r];var z=r,F=.5*r;r=.5*(F+z),n=50;do{var j=r*(O+I*L(g-r*r))+R*E(r/x)-D;if(!j)break;j<0?F=r:z=r,r=.5*(F+z)}while(i(z-F)>y&&--n>0)}else{r=y,n=25;do{var N=r*r,Z=L(g-N),B=O+I*Z,V=r*B+R*E(r/x)-D;r-=k=Z?V/(B+(R-I*N)/Z):0}while(i(k)>y&&--n>0)}return[r,-w-o*L(g-r*r)]}(e>b/4?_-e:e,t);return e>b/4&&(c=f[0],f[0]=-f[1],f[1]=-c),f[0]*=r,f[1]*=-n,f}function Pt(){return(0,n.Z)(Ct(Et)).scale(239.75)}function Lt(e,t){var r,n,o,u,c,f;if(t=1-y)return r=(1-t)/4,o=1/(n=R(e)),[(u=((f=l(2*(f=e)))-1)/(f+1))+r*((c=n*I(e))-e)/(n*n),o-r*u*o*(c-e),o+r*u*o*(c+e),2*a(l(e))-_+r*(c-e)/n];var d=[1,0,0,0,0,0,0,0,0],p=[L(t),0,0,0,0,0,0,0,0],h=0;for(n=L(1-t),c=1;i(p[h]/d[h])>y&&h<8;)r=d[h++],p[h]=(r-n)/2,d[h]=(r+n)/2,n=L(r*n),c*=2;o=c*d[h]*e;do{o=(E(u=p[h]*m(n=o)/d[h])+o)/2}while(--h);return[m(o),u=s(o),u/s(o-n),o]}function It(e,t){if(!t)return e;if(1===t)return c(g(e/2+w));for(var r=1,n=L(1-t),o=L(t),s=0;i(o)>y;s++){if(e%b){var l=a(n*g(e)/r);l<0&&(l+=b),e+=l+~~(e/b)*b}else e+=e;o=(r+n)/2,n=L(r*n),o=((r=o)-n)/2}return e/(p(2,s)*r)}function Rt(e,t){var r=(T-1)/(T+1),n=L(1-r*r),u=It(_,n*n),f=c(g(b/4+i(t)/2)),d=l(-1*f)/L(r),p=function(e,t){var r=e*e,n=t+1,i=1-r-t*t;return[.5*((e>=0?_:-_)-o(i,2*e)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(d*s(-1*e),d*m(-1*e)),h=function(e,t,r){var n=i(e),o=I(i(t));if(n){var s=1/m(n),l=1/(g(n)*g(n)),u=-(l+r*(o*o*s*s)-1+r),c=(-u+L(u*u-(r-1)*l*4))/2;return[It(a(1/L(c)),r)*v(e),It(a(L((c/l-1)/r)),1-r)*v(t)]}return[0,It(a(o),1-r)*v(t)]}(p[0],p[1],n*n);return[-h[1],(t>=0?1:-1)*(.5*u-h[0])]}function Ot(){return(0,n.Z)(Ct(Rt)).scale(151.496)}Et.invert=function(e,t){i(e)>1&&(e=2*v(e)-e),i(t)>1&&(t=2*v(t)-t);var r=v(e),n=v(t),a=-r*e,l=-n*t,u=l/a<1,c=function(e,t){for(var r=0,n=1,a=.5,o=50;;){var l=a*a,u=L(a),c=E(1/L(1+l)),f=1-l+a*(1+l)*c,d=(1-u)/f,p=L(d),h=d*(1+l),v=p*(1-l),m=L(h-e*e),g=t+v+a*m;if(i(n-r)0?r=a:n=a,a=.5*(r+n)}if(!o)return null;var y=E(u),_=s(y),w=1/_,k=2*u*_,T=(-f*_-(-3*a+c*(1+3*l))*k*(1-u))/(f*f),M=.5*T/p,S=(1-l)*M-2*a*p*k;return[b/4*(e*(-2*w*S+-w*k*m)+-w*(a*(1+l)*T+d*(1+3*l)*k)*E(e/L(h))),y]}(u?l:a,u?a:l),f=c[0],d=c[1],p=s(d);return u&&(f=-_-f),[r*(o(m(f)*p,-m(d))+b),n*E(s(f)*p)]},Rt.invert=function(e,t){var r=(T-1)/(T+1),n=L(1-r*r),i=function(e,t,r){var n,i,a;return e?(n=Lt(e,r),t?(a=(i=Lt(t,1-r))[1]*i[1]+r*n[0]*n[0]*i[0]*i[0],[[n[0]*i[2]/a,n[1]*n[2]*i[0]*i[1]/a],[n[1]*i[1]/a,-n[0]*n[2]*i[0]*i[2]/a],[n[2]*i[1]*i[2]/a,-r*n[0]*n[1]*i[0]/a]]):[[n[0],0],[n[1],0],[n[2],0]]):[[0,(i=Lt(t,1-r))[0]/i[1]],[1/i[1],0],[i[2]/i[1],0]]}(.5*It(_,n*n)-t,-e,n*n),s=function(e,t){var r=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/r,(e[1]*t[0]-e[0]*t[1])/r]}(i[0],i[1]);return[o(s[1],s[0])/-1,2*a(l(-.5*c(r*s[0]*s[0]+r*s[1]*s[1])))-_]};var Dt=r(7613);function zt(e){var t=m(e),r=s(e),n=Ft(e);function a(e,a){var o=n(e,a);e=o[0],a=o[1];var l=m(a),u=s(a),c=s(e),f=P(t*l+r*u*c),d=m(f),p=i(d)>y?f/d:1;return[p*r*m(e),(i(e)>_?p:-p)*(t*u-r*l*c)]}return n.invert=Ft(-e),a.invert=function(e,r){var i=L(e*e+r*r),a=-m(i),l=s(i),u=i*l,c=-r*a,f=i*t,d=L(u*u+c*c-f*f),p=o(u*f+c*d,c*f-u*d),h=(i>_?-1:1)*o(e*a,i*s(p)*l+r*m(p)*a);return n.invert(h,p)},a}function Ft(e){var t=m(e),r=s(e);return function(e,n){var i=s(n),a=s(e)*i,l=m(e)*i,u=m(n);return[o(l,a*r-u*t),E(u*r+a*t)]}}function jt(){var e=0,t=(0,n.r)(zt),r=t(e),i=r.rotate,a=r.stream,o=(0,Dt.Z)();return r.parallel=function(n){if(!arguments.length)return e*A;var i=r.rotate();return t(e=n*C).rotate(i)},r.rotate=function(t){return arguments.length?(i.call(r,[t[0],t[1]-e*A]),o.center([-t[0],-t[1]]),r):((t=i.call(r))[1]+=e*A,t)},r.stream=function(e){return(e=a(e)).sphere=function(){e.polygonStart();var t,r=o.radius(89.99)().coordinates[0],n=r.length-1,i=-1;for(e.lineStart();++i=0;)e.point((t=r[i])[0],t[1]);e.lineEnd(),e.polygonEnd()},e},r.scale(79.4187).parallel(45).clipAngle(179.999)}var Nt=r(33064),Zt=r(72736),Bt=E(1-1/3)*A,Vt=ze(0);function Ut(e){var t=Bt*C,r=Ee(b,t)[0]-Ee(-b,t)[0],n=Vt(0,t)[1],a=Ee(0,t)[1],o=M-a,s=S/e,l=4/S,c=n+o*o*4/S;function p(p,h){var v,m=i(h);if(m>t){var g=d(e-1,f(0,u((p+b)/s)));(v=Ee(p+=b*(e-1)/e-g*s,m))[0]=v[0]*S/r-S*(e-1)/(2*e)+g*S/e,v[1]=n+4*(v[1]-a)*o/S,h<0&&(v[1]=-v[1])}else v=Vt(p,h);return v[0]*=l,v[1]/=c,v}return p.invert=function(t,p){t/=l;var h=i(p*=c);if(h>n){var v=d(e-1,f(0,u((t+b)/s)));t=(t+b*(e-1)/e-v*s)*r/S;var m=Ee.invert(t,.25*(h-n)*S/o+a);return m[0]-=b*(e-1)/e-v*s,p<0&&(m[1]=-m[1]),m}return Vt.invert(t,p)},p}function Ht(e,t){return[e,1&t?90-y:Bt]}function Wt(e,t){return[e,1&t?-90+y:-Bt]}function Gt(e){return[e[0]*(1-y),e[1]]}function qt(){var e=4,t=(0,n.r)(Ut),r=t(e),i=r.stream;return r.lobes=function(r){return arguments.length?t(e=+r):e},r.stream=function(t){var n=r.rotate(),a=i(t),o=(r.rotate([0,0]),i(t));return r.rotate(n),a.sphere=function(){(0,Zt.Z)(function(e){var t=[].concat((0,Nt.w6)(-180,180+e/2,e).map(Ht),(0,Nt.w6)(180,-180-e/2,-e).map(Wt));return{type:"Polygon",coordinates:[180===e?t.map(Gt):t]}}(180/e),o)},a},r.scale(239.75)}function Yt(e){var t,r=1+e,n=E(m(1/r)),a=2*L(b/(t=b+4*n*r)),l=.5*a*(r+L(e*(2+e))),u=e*e,c=r*r;function f(f,d){var p,h,v=1-m(d);if(v&&v<2){var g,y=_-d,w=25;do{var k=m(y),T=s(y),M=n+o(k,r-T),S=1+c-2*r*T;y-=g=(y-u*n-r*k+S*M-.5*v*t)/(2*r*k*M)}while(i(g)>x&&--w>0);p=a*L(S),h=f*M/b}else p=a*(e+v),h=f*n/b;return[p*m(h),l-p*s(h)]}return f.invert=function(e,i){var s=e*e+(i-=l)*i,f=(1+c-s/(a*a))/(2*r),d=P(f),p=m(d),h=n+o(p,r-f);return[E(e/L(s))*b/h,E(1-2*(d-u*n-r*p+(1+c-2*r*f)*h)/t)]},f}function Xt(){var e=1,t=(0,n.r)(Yt),r=t(e);return r.ratio=function(r){return arguments.length?t(e=+r):e},r.scale(167.774).center([0,18.67])}var Kt=.7109889596207567,$t=.0528035274542;function Jt(e,t){return t>-Kt?((e=ae(e,t))[1]+=$t,e):de(e,t)}function Qt(){return(0,n.Z)(Jt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function er(e,t){return i(t)>Kt?((e=ae(e,t))[1]-=t>0?$t:-$t,e):de(e,t)}function tr(){return(0,n.Z)(er).scale(152.63)}function rr(e,t,r,n){var i=L(4*b/(2*r+(1+e-t/2)*m(2*r)+(e+t)/2*m(4*r)+t/2*m(6*r))),a=L(n*m(r)*L((1+e*s(2*r)+t*s(4*r))/(1+e+t))),o=r*u(1);function l(r){return L(1+e*s(2*r)+t*s(4*r))}function u(n){var i=n*r;return(2*i+(1+e-t/2)*m(2*i)+(e+t)/2*m(4*i)+t/2*m(6*i))/r}function c(e){return l(e)*m(e)}var f=function(e,t){var n=r*Q(u,o*m(t)/r,t/b);isNaN(n)&&(n=r*v(t));var c=i*l(n);return[c*a*e/b*s(n),c/a*m(n)]};return f.invert=function(e,t){var n=Q(c,t*a/i);return[e*b/(s(n)*i*a*l(n)),E(r*u(n/r)/o)]},0===r&&(i=L(n/b),(f=function(e,t){return[e*i,m(t)/i]}).invert=function(e,t){return[e/i,E(t*i)]}),f}function nr(){var e=1,t=0,r=45*C,i=2,a=(0,n.r)(rr),o=a(e,t,r,i);return o.a=function(n){return arguments.length?a(e=+n,t,r,i):e},o.b=function(n){return arguments.length?a(e,t=+n,r,i):t},o.psiMax=function(n){return arguments.length?a(e,t,r=+n*C,i):r*A},o.ratio=function(n){return arguments.length?a(e,t,r,i=+n):i},o.scale(180.739)}function ir(e,t,r,n,i,a,o,s,l,u,c){if(c.nanEncountered)return NaN;var f,d,p,h,v,m,g,y,x,b;if(d=e(t+.25*(f=r-t)),p=e(r-.25*f),isNaN(d))c.nanEncountered=!0;else{if(!isNaN(p))return b=((m=(h=f*(n+4*d+i)/12)+(v=f*(i+4*p+a)/12))-o)/15,u>l?(c.maxDepthCount++,m+b):Math.abs(b)e?r=n:t=n,n=t+r>>1}while(n>t);var i=u[n+1]-u[n];return i&&(i=(e-u[n+1])/i),(n+1+i)/s}var d=2*f(1)/b*o/r,h=function(e,t){var r=f(i(m(t))),a=n(r)*e;return r/=d,[a,t>=0?r:-r]};return h.invert=function(e,t){var r;return i(t*=d)<1&&(r=v(t)*E(a(i(t))*o)),[e/n(i(t)),r]},h}function sr(){var e=0,t=2.5,r=1.183136,i=(0,n.r)(or),a=i(e,t,r);return a.alpha=function(n){return arguments.length?i(e=+n,t,r):e},a.k=function(n){return arguments.length?i(e,t=+n,r):t},a.gamma=function(n){return arguments.length?i(e,t,r=+n):r},a.scale(152.63)}function lr(e,t){return i(e[0]-t[0])a[o][2][0];++o);var l=e(r-a[o][1][0],n);return l[0]+=e(a[o][1][0],i*n>i*a[o][0][1]?a[o][0][1]:n)[0],l}r?o.invert=r(o):e.invert&&(o.invert=function(r,n){for(var i=a[+(n<0)],s=t[+(n<0)],l=0,u=i.length;l=0;--s)r=(t=e[1][s])[0][0],n=t[0][1],i=t[1][1],a=t[2][0],o=t[2][1],l.push(ur([[a-y,o-y],[a-y,i+y],[r+y,i+y],[r+y,n-y]],30));return{type:"Polygon",coordinates:[(0,Nt.TS)(l)]}}(r),t=r.map((function(e){return e.map((function(e){return[[e[0][0]*C,e[0][1]*C],[e[1][0]*C,e[1][1]*C],[e[2][0]*C,e[2][1]*C]]}))})),a=t.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),s):t.map((function(e){return e.map((function(e){return[[e[0][0]*A,e[0][1]*A],[e[1][0]*A,e[1][1]*A],[e[2][0]*A,e[2][1]*A]]}))}))},null!=t&&s.lobes(t),s}Jt.invert=function(e,t){return t>-Kt?ae.invert(e,t-$t):de.invert(e,t)},er.invert=function(e,t){return i(t)>Kt?ae.invert(e,t+(t>0?$t:-$t)):de.invert(e,t)};var fr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function dr(){return cr(ue,fr).scale(160.857)}var pr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function hr(){return cr(er,pr).scale(152.63)}var vr=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function mr(){return cr(ae,vr).scale(169.529)}var gr=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function yr(){return cr(ae,gr).scale(169.529).rotate([20,0])}var xr=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function br(){return cr(Jt,xr,ee).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var _r=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function wr(){return cr(de,_r).scale(152.63).rotate([-20,0])}function kr(e,t){return[3/S*e*L(b*b/3-t*t),t]}function Tr(){return(0,n.Z)(kr).scale(158.837)}function Mr(e){function t(t,r){if(i(i(r)-_)2)return null;var a=(t/=2)*t,s=(r/=2)*r,l=2*r/(1+a+s);return l=p((1+l)/(1-l),1/e),[o(2*t,1-a-s)/e,E((l-1)/(l+1))]},t}function Sr(){var e=.5,t=(0,n.r)(Mr),r=t(e);return r.spacing=function(r){return arguments.length?t(e=+r):e},r.scale(124.75)}kr.invert=function(e,t){return[S/3*e/L(b*b/3-t*t),t]};var Ar=b/T;function Cr(e,t){return[e*(1+L(s(t)))/2,t/(s(t/2)*s(e/6))]}function Er(){return(0,n.Z)(Cr).scale(97.2672)}function Pr(e,t){var r=e*e,n=t*t;return[e*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),t*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function Lr(){return(0,n.Z)(Pr).scale(139.98)}function Ir(e,t){return[m(e)/s(t),g(t)*s(e)]}function Rr(){return(0,n.Z)(Ir).scale(144.049).clipAngle(89.999)}function Or(e){var t=s(e),r=g(w+e/2);function n(n,a){var o=a-e,s=i(o)=0;)d=(f=e[c])[0]+l*(i=d)-u*p,p=f[1]+l*p+u*i;return[d=l*(i=d)-u*p,p=l*p+u*i]}return r.invert=function(r,n){var l=20,u=r,c=n;do{for(var f,d=t,p=e[d],h=p[0],v=p[1],g=0,x=0;--d>=0;)g=h+u*(f=g)-c*x,x=v+u*x+c*f,h=(p=e[d])[0]+u*(f=h)-c*v,v=p[1]+u*v+c*f;var b,_,w=(g=h+u*(f=g)-c*x)*g+(x=v+u*x+c*f)*x;u-=b=((h=u*(f=h)-c*v-r)*g+(v=u*v+c*f-n)*x)/w,c-=_=(v*g-h*x)/w}while(i(b)+i(_)>y*y&&--l>0);if(l){var k=L(u*u+c*c),T=2*a(.5*k),M=m(T);return[o(u*M,k*s(T)),k?E(c*M/k):0]}},r}Cr.invert=function(e,t){var r=i(e),n=i(t),a=y,o=_;ny||i(x)>y)&&--a>0);return a&&[r,n]},Ir.invert=function(e,t){var r=e*e,n=t*t+1,i=r+n,a=e?k*L((i-L(i*i-4*r))/r):1/L(n);return[E(e*a),v(t)*P(a)]},zr.invert=function(e,t){return[e,2.5*a(l(.8*t))-.625*b]};var Nr=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Zr=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Br=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Vr=[[.9245,0],[0,0],[.01943,0]],Ur=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Hr(){return Xr(Nr,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Wr(){return Xr(Zr,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Gr(){return Xr(Br,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function qr(){return Xr(Vr,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Yr(){return Xr(Ur,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Xr(e,t){var r=(0,n.Z)(jr(e)).rotate(t).clipAngle(90),i=(0,_e.Z)(t),a=r.center;return delete r.rotate,r.center=function(e){return arguments.length?a(i(e)):i.invert(a())},r}var Kr=L(6),$r=L(7);function Jr(e,t){var r=E(7*m(t)/(3*Kr));return[Kr*e*(2*s(2*r/3)-1)/$r,9*m(r/3)/$r]}function Qr(){return(0,n.Z)(Jr).scale(164.859)}function en(e,t){for(var r,n=(1+k)*m(t),a=t,o=0;o<25&&(a-=r=(m(a/2)+m(a)-n)/(.5*s(a/2)+s(a)),!(i(r)x&&--l>0);return[e/(.84719-.13063*(n=s*s)+(o=n*(a=n*n))*o*(.05494*n-.04515-.02326*a+.00331*o)),s]},ln.invert=function(e,t){for(var r=t/2,n=0,a=1/0;n<10&&i(a)>y;++n){var o=s(t/2);t-=a=(t-g(t/2)-r)/(1-.5/(o*o))}return[2*e/(1+s(t)),t]};var cn=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function fn(){return cr(K(1/0),cn).rotate([20,0]).scale(152.63)}function dn(e,t){var r=m(t),n=s(t),a=v(e);if(0===e||i(t)===_)return[0,t];if(0===t)return[e,0];if(i(e)===_)return[e*n,_*r];var o=b/(2*e)-2*e/b,l=2*t/b,u=(1-l*l)/(r-l),c=o*o,f=u*u,d=1+c/f,p=1+f/c,h=(o*r/u-o/2)/d,g=(f*r/c+u/2)/p,y=g*g-(f*r*r/c+u*r-1)/p;return[_*(h+L(h*h+n*n/d)*a),_*(g+L(y<0?0:y)*v(-t*o)*a)]}function pn(){return(0,n.Z)(dn).scale(127.267)}dn.invert=function(e,t){var r=(e/=_)*e,n=r+(t/=_)*t,i=b*b;return[e?(n-1+L((1-n)*(1-n)+4*r))/(2*e)*_:0,Q((function(e){return n*(b*m(e)-2*e)*b+4*e*e*(t-m(e))+2*b*e-i*t}),0)]};var hn=1.0148,vn=.23185,mn=-.14499,gn=.02406,yn=hn,xn=5*vn,bn=7*mn,_n=9*gn,wn=1.790857183;function kn(e,t){var r=t*t;return[e,t*(hn+r*r*(vn+r*(mn+gn*r)))]}function Tn(){return(0,n.Z)(kn).scale(139.319)}function Mn(e,t){if(i(t)wn?t=wn:t<-1.790857183&&(t=-1.790857183);var r,n=t;do{var a=n*n;n-=r=(n*(hn+a*a*(vn+a*(mn+gn*a)))-t)/(yn+a*a*(xn+a*(bn+_n*a)))}while(i(r)>y);return[e,n]},Mn.invert=function(e,t){if(i(t)y&&--o>0);return l=g(a),[(i(t)=0;)if(n=t[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(t.face,r.face),i=En(n.map(r.project),n.map(t.project));t.transform=r.transform?Pn(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;o0?[-t[0],0]:[180-t[0],180])};var t=Nn.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,r){var n=t[e];n&&(n.children||(n.children=[])).push(t[r])})),Rn(t[0],(function(e,r){return t[e<-b/2?r<0?6:4:e<0?r<0?2:0:en^p>n&&r<(d-u)*(n-c)/(p-c)+u&&(i=!i)}return i}(e[0],r))return e.push(t),!0}))||e.push([t])})),ei=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}};function ii(e){var t=e(_,0)[0]-e(-_,0)[0];function r(r,n){var a=i(r)<_,o=e(a?r:r>0?r-b:r+b,n),s=(o[0]-o[1])*k,l=(o[0]+o[1])*k;if(a)return[s,l];var u=t*k,c=s>0^l>0?-1:1;return[c*s-v(l)*u,c*l-v(s)*u]}return e.invert&&(r.invert=function(r,n){var a=(r+n)*k,o=(n-r)*k,s=i(a)<.5*t&&i(o)<.5*t;if(!s){var l=t*k,u=a>0^o>0?-1:1,c=-u*r+(o>0?1:-1)*l,f=-u*n+(a>0?1:-1)*l;a=(-c-f)*k,o=(c-f)*k}var d=e.invert(a,o);return s||(d[0]+=a>0?b:-b),d}),(0,n.Z)(r).rotate([-90,-90,45]).clipAngle(179.999)}function ai(){return ii(Et).scale(176.423)}function oi(){return ii(Rt).scale(111.48)}function si(e,t){if(!(0<=(t=+t)&&t<=20))throw new Error("invalid digits");function r(e){var r=e.length,n=2,i=new Array(r);for(i[0]=+e[0].toFixed(t),i[1]=+e[1].toFixed(t);n2||a[0]!=t[0]||a[1]!=t[1])&&(n.push(a),t=a)}return 1===n.length&&e.length>1&&n.push(r(e[e.length-1])),n}function a(e){return e.map(i)}function o(e){if(null==e)return e;var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(o)};break;case"Point":t={type:"Point",coordinates:r(e.coordinates)};break;case"MultiPoint":t={type:e.type,coordinates:n(e.coordinates)};break;case"LineString":t={type:e.type,coordinates:i(e.coordinates)};break;case"MultiLineString":case"Polygon":t={type:e.type,coordinates:a(e.coordinates)};break;case"MultiPolygon":t={type:"MultiPolygon",coordinates:e.coordinates.map(a)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function s(e){var t={type:"Feature",properties:e.properties,geometry:o(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),t}if(null!=e)switch(e.type){case"Feature":return s(e);case"FeatureCollection":var l={type:"FeatureCollection",features:e.features.map(s)};return null!=e.bbox&&(l.bbox=e.bbox),l;default:return o(e)}return e}function li(e){var t=m(e);function r(r,n){var i=t?g(r*t/2)/t:r/2;if(!n)return[2*i,-e];var o=2*a(i*m(n)),l=1/g(n);return[m(o)*l,n+(1-s(o))*l-e]}return r.invert=function(r,n){if(i(n+=e)y&&--c>0);var h=r*(f=g(u)),v=g(i(n)0?_:-_)*(f+o*(h-l)/2+o*o*(h-2*f+l)/2)]}function di(){return(0,n.Z)(fi).scale(152.63)}function pi(e,t){var r=function(e){function t(t,r){var n=s(r),i=(e-1)/(e-n*s(t));return[i*n*m(t),i*m(r)]}return t.invert=function(t,r){var n=t*t+r*r,i=L(n),a=(e-L(1-n*(e+1)/(e-1)))/((e-1)/i+i/(e-1));return[o(t*a,i*L(1-a*a)),i?E(r*a/i):0]},t}(e);if(!t)return r;var n=s(t),i=m(t);function a(t,a){var o=r(t,a),s=o[1],l=s*i/(e-1)+n;return[o[0]*n/l,s/l]}return a.invert=function(t,a){var o=(e-1)/(e-1-a*i);return r.invert(o*t,o*a*n)},a}function hi(){var e=2,t=0,r=(0,n.r)(pi),i=r(e,t);return i.distance=function(n){return arguments.length?r(e=+n,t):e},i.tilt=function(n){return arguments.length?r(e,t=n*C):t*A},i.scale(432.147).clipAngle(P(1/e)*A-1e-6)}ci.forEach((function(e){e[1]*=1.0144})),fi.invert=function(e,t){var r=t/_,n=90*r,a=d(18,i(n/5)),o=f(0,u(a));do{var s=ci[o][1],l=ci[o+1][1],c=ci[d(19,o+2)][1],p=c-s,h=c-2*l+s,v=2*(i(r)-l)/p,m=h/p,g=v*(1-m*v*(1-2*m*v));if(g>=0||1===o){n=(t>=0?5:-5)*(g+a);var y,b=50;do{g=(a=d(18,i(n)/5))-(o=u(a)),s=ci[o][1],l=ci[o+1][1],c=ci[d(19,o+2)][1],n-=(y=(t>=0?_:-_)*(l+g*(c-s)/2+g*g*(c-2*l+s)/2)-t)*A}while(i(y)>x&&--b>0);break}}while(--o>=0);var w=ci[o][0],k=ci[o+1][0],T=ci[d(19,o+2)][0];return[e/(k+g*(T-w)/2+g*g*(T-2*k+w)/2),n*C]};var vi=1e-4,mi=1e4,gi=-180,yi=gi+vi,xi=180,bi=xi-vi,_i=-90,wi=_i+vi,ki=90,Ti=ki-vi;function Mi(e){return e.length>0}function Si(e){return e===_i||e===ki?[0,e]:[gi,(t=e,Math.floor(t*mi)/mi)];var t}function Ai(e){var t=e[0],r=e[1],n=!1;return t<=yi?(t=gi,n=!0):t>=bi&&(t=xi,n=!0),r<=wi?(r=_i,n=!0):r>=Ti&&(r=ki,n=!0),n?[t,r]:e}function Ci(e){return e.map(Ai)}function Ei(e,t,r){for(var n=0,i=e.length;n=bi||c<=wi||c>=Ti){a[o]=Ai(l);for(var f=o+1;fyi&&pwi&&h=s)break;r.push({index:-1,polygon:t,ring:a=a.slice(f-1)}),a[0]=Si(a[0][1]),o=-1,s=a.length}}}}function Pi(e){var t,r,n,i,a,o,s=e.length,l={},u={};for(t=0;t0?b-l:l)*A],c=(0,n.Z)(e(s)).rotate(u),f=(0,_e.Z)(u),d=c.center;return delete c.rotate,c.center=function(e){return arguments.length?d(f(e)):f.invert(d())},c.clipAngle(90)}function Fi(e){var t=s(e);function r(e,r){var n=(0,Fn.M)(e,r);return n[0]*=t,n}return r.invert=function(e,r){return Fn.M.invert(e/t,r)},r}function ji(){return Ni([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Ni(e,t){return zi(Fi,e,t)}function Zi(e){if(!(e*=2))return G.N;var t=-e/2,r=-t,n=e*e,i=g(r),a=.5/m(r);function l(i,a){var o=P(s(a)*s(i-t)),l=P(s(a)*s(i-r));return[((o*=o)-(l*=l))/(2*e),(a<0?-1:1)*L(4*n*l-(n-o+l)*(n-o+l))/(2*e)]}return l.invert=function(e,n){var l,u,c=n*n,f=s(L(c+(l=e+t)*l)),d=s(L(c+(l=e+r)*l));return[o(u=f-d,l=(f+d)*i),(n<0?-1:1)*P(L(l*l+u*u)*a)]},l}function Bi(){return Vi([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function Vi(e,t){return zi(Zi,e,t)}function Ui(e,t){if(i(t)y&&--l>0);return[v(e)*(L(a*a+4)+a)*b/4,_*s]};var ea=4*b+3*L(3),ta=2*L(2*b*L(3)/ea),ra=ie(ta*L(3)/b,ta,ea/6);function na(){return(0,n.Z)(ra).scale(176.84)}function ia(e,t){return[e*L(1-3*t*t/(b*b)),t]}function aa(){return(0,n.Z)(ia).scale(152.63)}function oa(e,t){var r=s(t),n=s(e)*r,i=1-n,a=s(e=o(m(e)*r,-m(t))),l=m(e);return[l*(r=L(1-n*n))-a*i,-a*r-l*i]}function sa(){return(0,n.Z)(oa).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)}function la(e,t){var r=z(e,t);return[(r[0]+e/_)/2,(r[1]+t)/2]}function ua(){return(0,n.Z)(la).scale(158.837)}ia.invert=function(e,t){return[e/L(1-3*t*t/(b*b)),t]},oa.invert=function(e,t){var r=(e*e+t*t)/-2,n=L(-r*(2+r)),i=t*r+e*n,a=e*r-t*n,s=L(a*a+i*i);return[o(n*i,s*(1+r)),s?-E(n*a/s):0]},la.invert=function(e,t){var r=e,n=t,a=25;do{var o,l=s(n),u=m(n),c=m(2*n),f=u*u,d=l*l,p=m(r),h=s(r/2),v=m(r/2),g=v*v,x=1-d*h*h,b=x?P(l*h)*L(o=1/x):o=0,w=.5*(2*b*l*v+r/_)-e,k=.5*(b*u+n)-t,T=.5*o*(d*g+b*l*h*f)+.5/_,M=o*(p*c/4-b*u*v),S=.125*o*(c*v-b*u*d*p),A=.5*o*(f*h+b*g*l)+.5,C=M*S-A*T,E=(k*M-w*A)/C,I=(w*S-k*T)/C;r-=E,n-=I}while((i(E)>y||i(I)>y)&&--a>0);return[r,n]}},33940:function(e,t,r){"use strict";function n(){return new i}function i(){this.reset()}r.d(t,{Z:function(){return n}}),i.prototype={constructor:i,reset:function(){this.s=this.t=0},add:function(e){o(a,e,this.t),o(this,a.s,this.s),this.s?this.t+=a.t:this.s=a.t},valueOf:function(){return this.s}};var a=new i;function o(e,t,r){var n=e.s=t+r,i=n-t,a=n-i;e.t=t-a+(r-i)}},97860:function(e,t,r){"use strict";r.d(t,{L9:function(){return d},ZP:function(){return x},gL:function(){return h}});var n,i,a,o,s,l=r(33940),u=r(39695),c=r(73182),f=r(72736),d=(0,l.Z)(),p=(0,l.Z)(),h={point:c.Z,lineStart:c.Z,lineEnd:c.Z,polygonStart:function(){d.reset(),h.lineStart=v,h.lineEnd=m},polygonEnd:function(){var e=+d;p.add(e<0?u.BZ+e:e),this.lineStart=this.lineEnd=this.point=c.Z},sphere:function(){p.add(u.BZ)}};function v(){h.point=g}function m(){y(n,i)}function g(e,t){h.point=y,n=e,i=t,e*=u.uR,t*=u.uR,a=e,o=(0,u.mC)(t=t/2+u.pu),s=(0,u.O$)(t)}function y(e,t){e*=u.uR,t=(t*=u.uR)/2+u.pu;var r=e-a,n=r>=0?1:-1,i=n*r,l=(0,u.mC)(t),c=(0,u.O$)(t),f=s*c,p=o*l+f*(0,u.mC)(i),h=f*n*(0,u.O$)(i);d.add((0,u.fv)(h,p)),a=e,o=l,s=c}function x(e){return p.reset(),(0,f.Z)(e,h),2*p}},77338:function(e,t,r){"use strict";r.d(t,{Z:function(){return P}});var n,i,a,o,s,l,u,c,f,d,p=r(33940),h=r(97860),v=r(7620),m=r(39695),g=r(72736),y=(0,p.Z)(),x={point:b,lineStart:w,lineEnd:k,polygonStart:function(){x.point=T,x.lineStart=M,x.lineEnd=S,y.reset(),h.gL.polygonStart()},polygonEnd:function(){h.gL.polygonEnd(),x.point=b,x.lineStart=w,x.lineEnd=k,h.L9<0?(n=-(a=180),i=-(o=90)):y>m.Ho?o=90:y<-m.Ho&&(i=-90),d[0]=n,d[1]=a},sphere:function(){n=-(a=180),i=-(o=90)}};function b(e,t){f.push(d=[n=e,a=e]),to&&(o=t)}function _(e,t){var r=(0,v.Og)([e*m.uR,t*m.uR]);if(c){var l=(0,v.T5)(c,r),u=[l[1],-l[0],0],p=(0,v.T5)(u,l);(0,v.iJ)(p),p=(0,v.Y1)(p);var h,g=e-s,y=g>0?1:-1,x=p[0]*m.RW*y,b=(0,m.Wn)(g)>180;b^(y*so&&(o=h):b^(y*s<(x=(x+360)%360-180)&&xo&&(o=t)),b?eA(n,a)&&(a=e):A(e,a)>A(n,a)&&(n=e):a>=n?(ea&&(a=e)):e>s?A(n,e)>A(n,a)&&(a=e):A(e,a)>A(n,a)&&(n=e)}else f.push(d=[n=e,a=e]);to&&(o=t),c=r,s=e}function w(){x.point=_}function k(){d[0]=n,d[1]=a,x.point=b,c=null}function T(e,t){if(c){var r=e-s;y.add((0,m.Wn)(r)>180?r+(r>0?360:-360):r)}else l=e,u=t;h.gL.point(e,t),_(e,t)}function M(){h.gL.lineStart()}function S(){T(l,u),h.gL.lineEnd(),(0,m.Wn)(y)>m.Ho&&(n=-(a=180)),d[0]=n,d[1]=a,c=null}function A(e,t){return(t-=e)<0?t+360:t}function C(e,t){return e[0]-t[0]}function E(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tA(s[0],s[1])&&(s[1]=l[1]),A(l[0],s[1])>A(s[0],s[1])&&(s[0]=l[0])):u.push(s=l);for(c=-1/0,t=0,s=u[r=u.length-1];t<=r;s=l,++t)l=u[t],(p=A(s[1],l[0]))>c&&(c=p,n=l[0],a=s[1])}return f=d=null,n===1/0||i===1/0?[[NaN,NaN],[NaN,NaN]]:[[n,i],[a,o]]}},7620:function(e,t,r){"use strict";r.d(t,{Og:function(){return a},T:function(){return u},T5:function(){return s},Y1:function(){return i},iJ:function(){return c},j9:function(){return o},s0:function(){return l}});var n=r(39695);function i(e){return[(0,n.fv)(e[1],e[0]),(0,n.ZR)(e[2])]}function a(e){var t=e[0],r=e[1],i=(0,n.mC)(r);return[i*(0,n.mC)(t),i*(0,n.O$)(t),(0,n.O$)(r)]}function o(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function s(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function l(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function u(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function c(e){var t=(0,n._b)(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}},66624:function(e,t,r){"use strict";r.d(t,{Z:function(){return R}});var n,i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x=r(39695),b=r(73182),_=r(72736),w={sphere:b.Z,point:k,lineStart:M,lineEnd:C,polygonStart:function(){w.lineStart=E,w.lineEnd=P},polygonEnd:function(){w.lineStart=M,w.lineEnd=C}};function k(e,t){e*=x.uR,t*=x.uR;var r=(0,x.mC)(t);T(r*(0,x.mC)(e),r*(0,x.O$)(e),(0,x.O$)(t))}function T(e,t,r){++n,a+=(e-a)/n,o+=(t-o)/n,s+=(r-s)/n}function M(){w.point=S}function S(e,t){e*=x.uR,t*=x.uR;var r=(0,x.mC)(t);m=r*(0,x.mC)(e),g=r*(0,x.O$)(e),y=(0,x.O$)(t),w.point=A,T(m,g,y)}function A(e,t){e*=x.uR,t*=x.uR;var r=(0,x.mC)(t),n=r*(0,x.mC)(e),a=r*(0,x.O$)(e),o=(0,x.O$)(t),s=(0,x.fv)((0,x._b)((s=g*o-y*a)*s+(s=y*n-m*o)*s+(s=m*a-g*n)*s),m*n+g*a+y*o);i+=s,l+=s*(m+(m=n)),u+=s*(g+(g=a)),c+=s*(y+(y=o)),T(m,g,y)}function C(){w.point=k}function E(){w.point=L}function P(){I(h,v),w.point=k}function L(e,t){h=e,v=t,e*=x.uR,t*=x.uR,w.point=I;var r=(0,x.mC)(t);m=r*(0,x.mC)(e),g=r*(0,x.O$)(e),y=(0,x.O$)(t),T(m,g,y)}function I(e,t){e*=x.uR,t*=x.uR;var r=(0,x.mC)(t),n=r*(0,x.mC)(e),a=r*(0,x.O$)(e),o=(0,x.O$)(t),s=g*o-y*a,h=y*n-m*o,v=m*a-g*n,b=(0,x._b)(s*s+h*h+v*v),_=(0,x.ZR)(b),w=b&&-_/b;f+=w*s,d+=w*h,p+=w*v,i+=_,l+=_*(m+(m=n)),u+=_*(g+(g=a)),c+=_*(y+(y=o)),T(m,g,y)}function R(e){n=i=a=o=s=l=u=c=f=d=p=0,(0,_.Z)(e,w);var t=f,r=d,h=p,v=t*t+r*r+h*h;return v0?os)&&(o+=i*a.BZ));for(var d,p=o;i>0?p>s:p0?i.pi:-i.pi,u=(0,i.Wn)(o-r);(0,i.Wn)(u-i.pi)0?i.ou:-i.ou),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),e.point(o,n),t=0):a!==l&&u>=i.pi&&((0,i.Wn)(r-a)i.Ho?(0,i.z4)(((0,i.O$)(t)*(o=(0,i.mC)(n))*(0,i.O$)(r)-(0,i.O$)(n)*(a=(0,i.mC)(t))*(0,i.O$)(e))/(a*o*s)):(t+n)/2}(r,n,o,s),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),t=0),e.point(r=o,n=s),a=l},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}}),(function(e,t,r,n){var a;if(null==e)a=r*i.ou,n.point(-i.pi,a),n.point(0,a),n.point(i.pi,a),n.point(i.pi,0),n.point(i.pi,-a),n.point(0,-a),n.point(-i.pi,-a),n.point(-i.pi,0),n.point(-i.pi,a);else if((0,i.Wn)(e[0]-t[0])>i.Ho){var o=e[0]1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}},1457:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(7620),i=r(7613),a=r(39695),o=r(67108),s=r(97023);function l(e){var t=(0,a.mC)(e),r=6*a.uR,l=t>0,u=(0,a.Wn)(t)>a.Ho;function c(e,r){return(0,a.mC)(e)*(0,a.mC)(r)>t}function f(e,r,i){var o=(0,n.Og)(e),s=(0,n.Og)(r),l=[1,0,0],u=(0,n.T5)(o,s),c=(0,n.j9)(u,u),f=u[0],d=c-f*f;if(!d)return!i&&e;var p=t*c/d,h=-t*f/d,v=(0,n.T5)(l,u),m=(0,n.T)(l,p),g=(0,n.T)(u,h);(0,n.s0)(m,g);var y=v,x=(0,n.j9)(m,y),b=(0,n.j9)(y,y),_=x*x-b*((0,n.j9)(m,m)-1);if(!(_<0)){var w=(0,a._b)(_),k=(0,n.T)(y,(-x-w)/b);if((0,n.s0)(k,m),k=(0,n.Y1)(k),!i)return k;var T,M=e[0],S=r[0],A=e[1],C=r[1];S0^k[1]<((0,a.Wn)(k[0]-M)a.pi^(M<=k[0]&&k[0]<=S)){var L=(0,n.T)(y,(-x+w)/b);return(0,n.s0)(L,m),[k,(0,n.Y1)(L)]}}}function d(t,r){var n=l?e:a.pi-e,i=0;return t<-n?i|=1:t>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}return(0,s.Z)(c,(function(e){var t,r,n,i,s;return{lineStart:function(){i=n=!1,s=1},point:function(p,h){var v,m=[p,h],g=c(p,h),y=l?g?0:d(p,h):g?d(p+(p<0?a.pi:-a.pi),h):0;if(!t&&(i=n=g)&&e.lineStart(),g!==n&&(!(v=f(t,m))||(0,o.Z)(t,v)||(0,o.Z)(m,v))&&(m[2]=1),g!==n)s=0,g?(e.lineStart(),v=f(m,t),e.point(v[0],v[1])):(v=f(t,m),e.point(v[0],v[1],2),e.lineEnd()),t=v;else if(u&&t&&l^g){var x;y&r||!(x=f(m,t,!0))||(s=0,l?(e.lineStart(),e.point(x[0][0],x[0][1]),e.point(x[1][0],x[1][1]),e.lineEnd()):(e.point(x[1][0],x[1][1]),e.lineEnd(),e.lineStart(),e.point(x[0][0],x[0][1],3)))}!g||t&&(0,o.Z)(t,m)||e.point(m[0],m[1]),t=m,n=g,r=y},lineEnd:function(){n&&e.lineEnd(),t=null},clean:function(){return s|(i&&n)<<1}}}),(function(t,n,a,o){(0,i.m)(o,e,r,a,t,n)}),l?[0,-e]:[-a.pi,e-a.pi])}},97023:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(85272),i=r(46225),a=r(39695),o=r(23071),s=r(33064);function l(e,t,r,a){return function(l){var f,d,p,h=t(l),v=(0,n.Z)(),m=t(v),g=!1,y={point:x,lineStart:_,lineEnd:w,polygonStart:function(){y.point=k,y.lineStart=T,y.lineEnd=M,d=[],f=[]},polygonEnd:function(){y.point=x,y.lineStart=_,y.lineEnd=w,d=(0,s.TS)(d);var e=(0,o.Z)(f,a);d.length?(g||(l.polygonStart(),g=!0),(0,i.Z)(d,c,e,r,l)):e&&(g||(l.polygonStart(),g=!0),l.lineStart(),r(null,null,1,l),l.lineEnd()),g&&(l.polygonEnd(),g=!1),d=f=null},sphere:function(){l.polygonStart(),l.lineStart(),r(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function x(t,r){e(t,r)&&l.point(t,r)}function b(e,t){h.point(e,t)}function _(){y.point=b,h.lineStart()}function w(){y.point=x,h.lineEnd()}function k(e,t){p.push([e,t]),m.point(e,t)}function T(){m.lineStart(),p=[]}function M(){k(p[0][0],p[0][1]),m.lineEnd();var e,t,r,n,i=m.clean(),a=v.result(),o=a.length;if(p.pop(),f.push(p),p=null,o)if(1&i){if((t=(r=a[0]).length-1)>0){for(g||(l.polygonStart(),g=!0),l.lineStart(),e=0;e1&&2&i&&a.push(a.pop().concat(a.shift())),d.push(a.filter(u))}return y}}function u(e){return e.length>1}function c(e,t){return((e=e.x)[0]<0?e[1]-a.ou-a.Ho:a.ou-e[1])-((t=t.x)[0]<0?t[1]-a.ou-a.Ho:a.ou-t[1])}},87605:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(39695),i=r(85272),a=r(46225),o=r(33064),s=1e9,l=-s;function u(e,t,r,u){function c(n,i){return e<=n&&n<=r&&t<=i&&i<=u}function f(n,i,a,o){var s=0,l=0;if(null==n||(s=d(n,a))!==(l=d(i,a))||h(n,i)<0^a>0)do{o.point(0===s||3===s?e:r,s>1?u:t)}while((s=(s+a+4)%4)!==l);else o.point(i[0],i[1])}function d(i,a){return(0,n.Wn)(i[0]-e)0?0:3:(0,n.Wn)(i[0]-r)0?2:1:(0,n.Wn)(i[1]-t)0?1:0:a>0?3:2}function p(e,t){return h(e.x,t.x)}function h(e,t){var r=d(e,1),n=d(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(n){var d,h,v,m,g,y,x,b,_,w,k,T=n,M=(0,i.Z)(),S={point:A,lineStart:function(){S.point=C,h&&h.push(v=[]),w=!0,_=!1,x=b=NaN},lineEnd:function(){d&&(C(m,g),y&&_&&M.rejoin(),d.push(M.result())),S.point=A,_&&T.lineEnd()},polygonStart:function(){T=M,d=[],h=[],k=!0},polygonEnd:function(){var t=function(){for(var t=0,r=0,n=h.length;ru&&(f-i)*(u-a)>(d-a)*(e-i)&&++t:d<=u&&(f-i)*(u-a)<(d-a)*(e-i)&&--t;return t}(),r=k&&t,i=(d=(0,o.TS)(d)).length;(r||i)&&(n.polygonStart(),r&&(n.lineStart(),f(null,null,1,n),n.lineEnd()),i&&(0,a.Z)(d,p,t,f,n),n.polygonEnd()),T=n,d=h=v=null}};function A(e,t){c(e,t)&&T.point(e,t)}function C(n,i){var a=c(n,i);if(h&&v.push([n,i]),w)m=n,g=i,y=a,w=!1,a&&(T.lineStart(),T.point(n,i));else if(a&&_)T.point(n,i);else{var o=[x=Math.max(l,Math.min(s,x)),b=Math.max(l,Math.min(s,b))],f=[n=Math.max(l,Math.min(s,n)),i=Math.max(l,Math.min(s,i))];!function(e,t,r,n,i,a){var o,s=e[0],l=e[1],u=0,c=1,f=t[0]-s,d=t[1]-l;if(o=r-s,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>c)return;o>u&&(u=o)}if(o=i-s,f||!(o<0)){if(o/=f,f<0){if(o>c)return;o>u&&(u=o)}else if(f>0){if(o0)){if(o/=d,d<0){if(o0){if(o>c)return;o>u&&(u=o)}if(o=a-l,d||!(o<0)){if(o/=d,d<0){if(o>c)return;o>u&&(u=o)}else if(d>0){if(o0&&(e[0]=s+u*f,e[1]=l+u*d),c<1&&(t[0]=s+c*f,t[1]=l+c*d),!0}}}}}(o,f,e,t,r,u)?a&&(T.lineStart(),T.point(n,i),k=!1):(_||(T.lineStart(),T.point(o[0],o[1])),T.point(f[0],f[1]),a||T.lineEnd(),k=!1)}x=n,b=i,_=a}return S}}},46225:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(67108),i=r(39695);function a(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function o(e,t,r,o,l){var u,c,f=[],d=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,r,o=e[0],s=e[t];if((0,n.Z)(o,s)){if(!o[2]&&!s[2]){for(l.lineStart(),u=0;u=0;--u)l.point((h=p[u])[0],h[1]);else o(m.x,m.p.x,-1,l);m=m.p}p=(m=m.o).z,g=!g}while(!m.v);l.lineEnd()}}}function s(e){if(t=e.length){for(var t,r,n=0,i=e[0];++n0&&(i=A(e[a],e[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))m.Ho})).map(l)).concat((0,F.w6)((0,m.mD)(a/p)*p,i,p).filter((function(e){return(0,m.Wn)(e%v)>m.Ho})).map(u))}return y.lines=function(){return x().map((function(e){return{type:"LineString",coordinates:e}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(n).concat(f(o).slice(1),c(r).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.extentMajor(e).extentMinor(e):y.extentMinor()},y.extentMajor=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),y.precision(g)):[[n,s],[r,o]]},y.extentMinor=function(r){return arguments.length?(t=+r[0][0],e=+r[1][0],a=+r[0][1],i=+r[1][1],t>e&&(r=t,t=e,e=r),a>i&&(r=a,a=i,i=r),y.precision(g)):[[t,a],[e,i]]},y.step=function(e){return arguments.length?y.stepMajor(e).stepMinor(e):y.stepMinor()},y.stepMajor=function(e){return arguments.length?(h=+e[0],v=+e[1],y):[h,v]},y.stepMinor=function(e){return arguments.length?(d=+e[0],p=+e[1],y):[d,p]},y.precision=function(d){return arguments.length?(g=+d,l=j(a,i,90),u=N(t,e,g),c=j(s,o,90),f=N(n,r,g),y):g},y.extentMajor([[-180,-90+m.Ho],[180,90-m.Ho]]).extentMinor([[-180,-80-m.Ho],[180,80+m.Ho]])}function B(){return Z()()}var V,U,H,W,G=r(83074),q=r(8593),Y=(0,v.Z)(),X=(0,v.Z)(),K={point:g.Z,lineStart:g.Z,lineEnd:g.Z,polygonStart:function(){K.lineStart=$,K.lineEnd=ee},polygonEnd:function(){K.lineStart=K.lineEnd=K.point=g.Z,Y.add((0,m.Wn)(X)),X.reset()},result:function(){var e=Y/2;return Y.reset(),e}};function $(){K.point=J}function J(e,t){K.point=Q,V=H=e,U=W=t}function Q(e,t){X.add(W*e-H*t),H=e,W=t}function ee(){Q(V,U)}var te,re,ne,ie,ae=K,oe=r(3559),se=0,le=0,ue=0,ce=0,fe=0,de=0,pe=0,he=0,ve=0,me={point:ge,lineStart:ye,lineEnd:_e,polygonStart:function(){me.lineStart=we,me.lineEnd=ke},polygonEnd:function(){me.point=ge,me.lineStart=ye,me.lineEnd=_e},result:function(){var e=ve?[pe/ve,he/ve]:de?[ce/de,fe/de]:ue?[se/ue,le/ue]:[NaN,NaN];return se=le=ue=ce=fe=de=pe=he=ve=0,e}};function ge(e,t){se+=e,le+=t,++ue}function ye(){me.point=xe}function xe(e,t){me.point=be,ge(ne=e,ie=t)}function be(e,t){var r=e-ne,n=t-ie,i=(0,m._b)(r*r+n*n);ce+=i*(ne+e)/2,fe+=i*(ie+t)/2,de+=i,ge(ne=e,ie=t)}function _e(){me.point=ge}function we(){me.point=Te}function ke(){Me(te,re)}function Te(e,t){me.point=Me,ge(te=ne=e,re=ie=t)}function Me(e,t){var r=e-ne,n=t-ie,i=(0,m._b)(r*r+n*n);ce+=i*(ne+e)/2,fe+=i*(ie+t)/2,de+=i,pe+=(i=ie*e-ne*t)*(ne+e),he+=i*(ie+t),ve+=3*i,ge(ne=e,ie=t)}var Se=me;function Ae(e){this._context=e}Ae.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,m.BZ)}},result:g.Z};var Ce,Ee,Pe,Le,Ie,Re=(0,v.Z)(),Oe={point:g.Z,lineStart:function(){Oe.point=De},lineEnd:function(){Ce&&ze(Ee,Pe),Oe.point=g.Z},polygonStart:function(){Ce=!0},polygonEnd:function(){Ce=null},result:function(){var e=+Re;return Re.reset(),e}};function De(e,t){Oe.point=ze,Ee=Le=e,Pe=Ie=t}function ze(e,t){Le-=e,Ie-=t,Re.add((0,m._b)(Le*Le+Ie*Ie)),Le=e,Ie=t}var Fe=Oe;function je(){this._string=[]}function Ne(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Ze(e,t){var r,n,i=4.5;function a(e){return e&&("function"===typeof i&&n.pointRadius(+i.apply(this,arguments)),(0,y.Z)(e,r(n))),n.result()}return a.area=function(e){return(0,y.Z)(e,r(ae)),ae.result()},a.measure=function(e){return(0,y.Z)(e,r(Fe)),Fe.result()},a.bounds=function(e){return(0,y.Z)(e,r(oe.Z)),oe.Z.result()},a.centroid=function(e){return(0,y.Z)(e,r(Se)),Se.result()},a.projection=function(t){return arguments.length?(r=null==t?(e=null,q.Z):(e=t).stream,a):e},a.context=function(e){return arguments.length?(n=null==e?(t=null,new je):new Ae(t=e),"function"!==typeof i&&n.pointRadius(i),a):t},a.pointRadius=function(e){return arguments.length?(i="function"===typeof e?e:(n.pointRadius(+e),+e),a):i},a.projection(e).context(t)}je.prototype={_radius:4.5,_circle:Ne(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=Ne(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}};var Be=r(15002);function Ve(e){var t=0,r=m.pi/3,n=(0,Be.r)(e),i=n(t,r);return i.parallels=function(e){return arguments.length?n(t=e[0]*m.uR,r=e[1]*m.uR):[t*m.RW,r*m.RW]},i}function Ue(e,t){var r=(0,m.O$)(e),n=(r+(0,m.O$)(t))/2;if((0,m.Wn)(n)=.12&&i<.234&&n>=-.425&&n<-.214?s:i>=.166&&i<.234&&n>=-.214&&n<-.115?l:o).invert(e)},c.stream=function(r){return e&&t===r?e:e=function(e){var t=e.length;return{point:function(r,n){for(var i=-1;++i0?t<-m.ou+m.Ho&&(t=-m.ou+m.Ho):t>m.ou-m.Ho&&(t=m.ou-m.Ho);var r=i/(0,m.sQ)(et(t),n);return[r*(0,m.O$)(n*e),i-r*(0,m.mC)(n*e)]}return a.invert=function(e,t){var r=i-t,a=(0,m.Xx)(n)*(0,m._b)(e*e+r*r),o=(0,m.fv)(e,(0,m.Wn)(r))*(0,m.Xx)(r);return r*n<0&&(o-=m.pi*(0,m.Xx)(e)*(0,m.Xx)(r)),[o/n,2*(0,m.z4)((0,m.sQ)(i/a,1/n))-m.ou]},a}function rt(){return Ve(tt).scale(109.5).parallels([30,30])}$e.invert=function(e,t){return[e,2*(0,m.z4)((0,m.Qq)(t))-m.ou]};var nt=r(97492);function it(e,t){var r=(0,m.mC)(e),n=e===t?(0,m.O$)(e):(r-(0,m.mC)(t))/(t-e),i=r/n+e;if((0,m.Wn)(n)2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90]).scale(159.155)}xt.invert=(0,yt.O)((function(e){return 2*(0,m.z4)(e)})),_t.invert=function(e,t){return[-t,2*(0,m.z4)((0,m.Qq)(e))-m.ou]}},83074:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(39695);function i(e,t){var r=e[0]*n.uR,i=e[1]*n.uR,a=t[0]*n.uR,o=t[1]*n.uR,s=(0,n.mC)(i),l=(0,n.O$)(i),u=(0,n.mC)(o),c=(0,n.O$)(o),f=s*(0,n.mC)(r),d=s*(0,n.O$)(r),p=u*(0,n.mC)(a),h=u*(0,n.O$)(a),v=2*(0,n.ZR)((0,n._b)((0,n.Jy)(o-i)+s*u*(0,n.Jy)(a-r))),m=(0,n.O$)(v),g=v?function(e){var t=(0,n.O$)(e*=v)/m,r=(0,n.O$)(v-e)/m,i=r*f+t*p,a=r*d+t*h,o=r*l+t*c;return[(0,n.fv)(a,i)*n.RW,(0,n.fv)(o,(0,n._b)(i*i+a*a))*n.RW]}:function(){return[r*n.RW,i*n.RW]};return g.distance=v,g}},39695:function(e,t,r){"use strict";r.d(t,{BZ:function(){return l},Ho:function(){return n},Jy:function(){return M},Kh:function(){return k},O$:function(){return x},OR:function(){return w},Qq:function(){return m},RW:function(){return u},Wn:function(){return f},Xx:function(){return b},ZR:function(){return T},_b:function(){return _},aW:function(){return i},cM:function(){return g},fv:function(){return p},mC:function(){return h},mD:function(){return v},ou:function(){return o},pi:function(){return a},pu:function(){return s},sQ:function(){return y},uR:function(){return c},z4:function(){return d}});var n=1e-6,i=1e-12,a=Math.PI,o=a/2,s=a/4,l=2*a,u=180/a,c=a/180,f=Math.abs,d=Math.atan,p=Math.atan2,h=Math.cos,v=Math.ceil,m=Math.exp,g=(Math.floor,Math.log),y=Math.pow,x=Math.sin,b=Math.sign||function(e){return e>0?1:e<0?-1:0},_=Math.sqrt,w=Math.tan;function k(e){return e>1?0:e<-1?a:Math.acos(e)}function T(e){return e>1?o:e<-1?-o:Math.asin(e)}function M(e){return(e=x(e/2))*e}},73182:function(e,t,r){"use strict";function n(){}r.d(t,{Z:function(){return n}})},3559:function(e,t,r){"use strict";var n=r(73182),i=1/0,a=i,o=-i,s=o,l={point:function(e,t){eo&&(o=e),ts&&(s=t)},lineStart:n.Z,lineEnd:n.Z,polygonStart:n.Z,polygonEnd:n.Z,result:function(){var e=[[i,a],[o,s]];return o=s=-(a=i=1/0),e}};t.Z=l},67108:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(39695);function i(e,t){return(0,n.Wn)(e[0]-t[0])=0?1:-1,E=C*A,P=E>a.pi,L=x*M;if(o.add((0,a.fv)(L*C*(0,a.O$)(E),b*S+L*(0,a.mC)(E))),c+=P?A+C*a.BZ:A,P^g>=r^k>=r){var I=(0,i.T5)((0,i.Og)(m),(0,i.Og)(w));(0,i.iJ)(I);var R=(0,i.T5)(u,I);(0,i.iJ)(R);var O=(P^A>=0?-1:1)*(0,a.ZR)(R[2]);(n>O||n===O&&(I[0]||I[1]))&&(f+=P^A>=0?1:-1)}}return(c<-a.Ho||c4*t&&g--){var w=o+p,k=s+v,T=u+m,M=(0,l._b)(w*w+k*k+T*T),S=(0,l.ZR)(T/=M),A=(0,l.Wn)((0,l.Wn)(T)-1)t||(0,l.Wn)((x*L+b*I)/_-.5)>.3||o*p+s*v+u*m2?e[2]%360*l.uR:0,V()):[E*l.RW,P*l.RW,L*l.RW]},Z.angle=function(e){return arguments.length?(I=e%360*l.uR,V()):I*l.RW},Z.reflectX=function(e){return arguments.length?(R=e?-1:1,V()):R<0},Z.reflectY=function(e){return arguments.length?(O=e?-1:1,V()):O<0},Z.precision=function(e){return arguments.length?(x=v(b,N=e*e),U()):(0,l._b)(N)},Z.fitExtent=function(e,t){return(0,f.qg)(Z,e,t)},Z.fitSize=function(e,t){return(0,f.mF)(Z,e,t)},Z.fitWidth=function(e,t){return(0,f.V6)(Z,e,t)},Z.fitHeight=function(e,t){return(0,f.rf)(Z,e,t)},function(){return t=e.apply(this,arguments),Z.invert=t.invert&&B,V()}}},26867:function(e,t,r){"use strict";r.d(t,{K:function(){return a},Z:function(){return o}});var n=r(15002),i=r(39695);function a(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function o(){return(0,n.Z)(a).scale(175.295)}a.invert=function(e,t){var r,n=t,a=25;do{var o=n*n,s=o*o;n-=r=(n*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-t)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while((0,i.Wn)(r)>i.Ho&&--a>0);return[e/(.8707+(o=n*n)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),n]}},57962:function(e,t,r){"use strict";r.d(t,{I:function(){return o},Z:function(){return s}});var n=r(39695),i=r(25382),a=r(15002);function o(e,t){return[(0,n.mC)(t)*(0,n.O$)(e),(0,n.O$)(t)]}function s(){return(0,a.Z)(o).scale(249.5).clipAngle(90+n.Ho)}o.invert=(0,i.O)(n.ZR)},49386:function(e,t,r){"use strict";r.d(t,{I:function(){return o},Z:function(){return c}});var n=r(96059),i=r(39695);function a(e,t){return[(0,i.Wn)(e)>i.pi?e+Math.round(-e/i.BZ)*i.BZ:e,t]}function o(e,t,r){return(e%=i.BZ)?t||r?(0,n.Z)(l(e),u(t,r)):l(e):t||r?u(t,r):a}function s(e){return function(t,r){return[(t+=e)>i.pi?t-i.BZ:t<-i.pi?t+i.BZ:t,r]}}function l(e){var t=s(e);return t.invert=s(-e),t}function u(e,t){var r=(0,i.mC)(e),n=(0,i.O$)(e),a=(0,i.mC)(t),o=(0,i.O$)(t);function s(e,t){var s=(0,i.mC)(t),l=(0,i.mC)(e)*s,u=(0,i.O$)(e)*s,c=(0,i.O$)(t),f=c*r+l*n;return[(0,i.fv)(u*a-f*o,l*r-c*n),(0,i.ZR)(f*a+u*o)]}return s.invert=function(e,t){var s=(0,i.mC)(t),l=(0,i.mC)(e)*s,u=(0,i.O$)(e)*s,c=(0,i.O$)(t),f=c*a-u*o;return[(0,i.fv)(u*a+c*o,l*r+f*n),(0,i.ZR)(f*r-l*n)]},s}function c(e){function t(t){return(t=e(t[0]*i.uR,t[1]*i.uR))[0]*=i.RW,t[1]*=i.RW,t}return e=o(e[0]*i.uR,e[1]*i.uR,e.length>2?e[2]*i.uR:0),t.invert=function(t){return(t=e.invert(t[0]*i.uR,t[1]*i.uR))[0]*=i.RW,t[1]*=i.RW,t},t}a.invert=a},72736:function(e,t,r){"use strict";function n(e,t){e&&a.hasOwnProperty(e.type)&&a[e.type](e,t)}r.d(t,{Z:function(){return l}});var i={Feature:function(e,t){n(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,i=-1,a=r.length;++i=0;)t+=r[n].value;else t=1;e.value=t}function l(e,t){var r,n,i,a,o,s=new d(e),l=+e.value&&(s.value=e.value),c=[s];for(null==t&&(t=u);r=c.pop();)if(l&&(r.value=+r.data.value),(i=t(r.data))&&(o=i.length))for(r.children=new Array(o),a=o-1;a>=0;--a)c.push(n=r.children[a]=new d(i[a])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(f)}function u(e){return e.children}function c(e){e.data=e.data.data}function f(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function d(e){this.data=e,this.depth=this.height=0,this.parent=null}r.r(t),r.d(t,{cluster:function(){return o},hierarchy:function(){return l},pack:function(){return I},packEnclose:function(){return h},packSiblings:function(){return A},partition:function(){return j},stratify:function(){return H},tree:function(){return $},treemap:function(){return re},treemapBinary:function(){return ne},treemapDice:function(){return F},treemapResquarify:function(){return ae},treemapSlice:function(){return J},treemapSliceDice:function(){return ie},treemapSquarify:function(){return te}}),d.prototype=l.prototype={constructor:d,count:function(){return this.eachAfter(s)},each:function(e){var t,r,n,i,a=this,o=[a];do{for(t=o.reverse(),o=[];a=t.pop();)if(e(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(r){r!==e&&t.push({source:r.parent,target:r})})),t},copy:function(){return l(this).eachBefore(c)}};var p=Array.prototype.slice;function h(e){for(var t,r,n=0,i=(e=function(e){for(var t,r,n=e.length;n;)r=Math.random()*n--|0,t=e[n],e[n]=e[r],e[r]=t;return e}(p.call(e))).length,a=[];n0&&r*r>n*n+i*i}function y(e,t){for(var r=0;r(o*=o)?(n=(u+o-i)/(2*u),a=Math.sqrt(Math.max(0,o/u-n*n)),r.x=e.x-n*s-a*l,r.y=e.y-n*l+a*s):(n=(u+i-o)/(2*u),a=Math.sqrt(Math.max(0,i/u-n*n)),r.x=t.x+n*s-a*l,r.y=t.y+n*l+a*s)):(r.x=t.x+r.r,r.y=t.y)}function k(e,t){var r=e.r+t.r-1e-6,n=t.x-e.x,i=t.y-e.y;return r>0&&r*r>n*n+i*i}function T(e){var t=e._,r=e.next._,n=t.r+r.r,i=(t.x*r.r+r.x*t.r)/n,a=(t.y*r.r+r.y*t.r)/n;return i*i+a*a}function M(e){this._=e,this.next=null,this.previous=null}function S(e){if(!(i=e.length))return 0;var t,r,n,i,a,o,s,l,u,c,f;if((t=e[0]).x=0,t.y=0,!(i>1))return t.r;if(r=e[1],t.x=-r.r,r.x=t.r,r.y=0,!(i>2))return t.r+r.r;w(r,t,n=e[2]),t=new M(t),r=new M(r),n=new M(n),t.next=n.previous=r,r.next=t.previous=n,n.next=r.previous=t;e:for(s=3;s0)throw new Error("cycle");return a}return r.id=function(t){return arguments.length?(e=C(t),r):e},r.parentId=function(e){return arguments.length?(t=C(e),r):t},r}function W(e,t){return e.parent===t.parent?1:2}function G(e){var t=e.children;return t?t[0]:e.t}function q(e){var t=e.children;return t?t[t.length-1]:e.t}function Y(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function X(e,t,r){return e.a.parent===t.parent?e.a:r}function K(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function $(){var e=W,t=1,r=1,n=null;function i(i){var l=function(e){for(var t,r,n,i,a,o=new K(e,0),s=[o];t=s.pop();)if(n=t._.children)for(t.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=t.children[i]=new K(n[i],i)),r.parent=t;return(o.parent=new K(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var u=i,c=i,f=i;i.eachBefore((function(e){e.xc.x&&(c=e),e.depth>f.depth&&(f=e)}));var d=u===c?1:e(u,c)/2,p=d-u.x,h=t/(c.x+d+p),v=r/(f.depth||1);i.eachBefore((function(e){e.x=(e.x+p)*h,e.y=e.depth*v}))}return i}function a(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var a=(r[0].z+r[r.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,r,n){if(r){for(var i,a=t,o=t,s=r,l=a.parent.children[0],u=a.m,c=o.m,f=s.m,d=l.m;s=q(s),a=G(a),s&&a;)l=G(l),(o=q(o)).a=t,(i=s.z+f-a.z-u+e(s._,a._))>0&&(Y(X(s,t,n),t,i),u+=i,c+=i),f+=s.m,u+=a.m,d+=l.m,c+=o.m;s&&!q(o)&&(o.t=s,o.m+=f-c),a&&!G(l)&&(l.t=a,l.m+=u-d,n=t)}return n}(t,i,t.parent.A||n[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],i):n?null:[t,r]},i.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],i):n?[t,r]:null},i}function J(e,t,r,n,i){for(var a,o=e.children,s=-1,l=o.length,u=e.value&&(i-r)/e.value;++sd&&(d=s),m=c*c*v,(p=Math.max(d/m,m/f))>h){c-=s;break}h=p}g.push(o={value:c,dice:l1?t:1)},r}(Q);function re(){var e=te,t=!1,r=1,n=1,i=[0],a=E,o=E,s=E,l=E,u=E;function c(e){return e.x0=e.y0=0,e.x1=r,e.y1=n,e.eachBefore(f),i=[0],t&&e.eachBefore(z),e}function f(t){var r=i[t.depth],n=t.x0+r,c=t.y0+r,f=t.x1-r,d=t.y1-r;f=r-1){var c=s[t];return c.x0=i,c.y0=a,c.x1=o,void(c.y1=l)}for(var f=u[t],d=n/2+f,p=t+1,h=r-1;p>>1;u[v]l-a){var y=(i*g+o*m)/n;e(t,p,m,i,a,y,l),e(p,r,g,y,a,o,l)}else{var x=(a*g+l*m)/n;e(t,p,m,i,a,o,x),e(p,r,g,i,x,o,l)}}(0,l,e.value,t,r,n,i)}function ie(e,t,r,n,i){(1&e.depth?J:F)(e,t,r,n,i)}var ae=function e(t){function r(e,r,n,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,l,u,c,f=-1,d=o.length,p=e.value;++f1?t:1)},r}(Q)},45879:function(e,t,r){"use strict";r.d(t,{h5:function(){return y}});var n=Math.PI,i=2*n,a=1e-6,o=i-a;function s(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function l(){return new s}s.prototype=l.prototype={constructor:s,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,i,a){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,r,i,o){e=+e,t=+t,r=+r,i=+i,o=+o;var s=this._x1,l=this._y1,u=r-e,c=i-t,f=s-e,d=l-t,p=f*f+d*d;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(p>a)if(Math.abs(d*u-c*f)>a&&o){var h=r-s,v=i-l,m=u*u+c*c,g=h*h+v*v,y=Math.sqrt(m),x=Math.sqrt(p),b=o*Math.tan((n-Math.acos((m+p-g)/(2*y*x)))/2),_=b/x,w=b/y;Math.abs(_-1)>a&&(this._+="L"+(e+_*f)+","+(t+_*d)),this._+="A"+o+","+o+",0,0,"+ +(d*h>f*v)+","+(this._x1=e+w*u)+","+(this._y1=t+w*c)}else this._+="L"+(this._x1=e)+","+(this._y1=t)},arc:function(e,t,r,s,l,u){e=+e,t=+t,u=!!u;var c=(r=+r)*Math.cos(s),f=r*Math.sin(s),d=e+c,p=t+f,h=1^u,v=u?s-l:l-s;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+d+","+p:(Math.abs(this._x1-d)>a||Math.abs(this._y1-p)>a)&&(this._+="L"+d+","+p),r&&(v<0&&(v=v%i+i),v>o?this._+="A"+r+","+r+",0,1,"+h+","+(e-c)+","+(t-f)+"A"+r+","+r+",0,1,"+h+","+(this._x1=d)+","+(this._y1=p):v>a&&(this._+="A"+r+","+r+",0,"+ +(v>=n)+","+h+","+(this._x1=e+r*Math.cos(l))+","+(this._y1=t+r*Math.sin(l))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};var u=l,c=Array.prototype.slice;function f(e){return function(){return e}}function d(e){return e[0]}function p(e){return e[1]}function h(e){return e.source}function v(e){return e.target}function m(e){var t=h,r=v,n=d,i=p,a=null;function o(){var o,s=c.call(arguments),l=t.apply(this,s),f=r.apply(this,s);if(a||(a=o=u()),e(a,+n.apply(this,(s[0]=l,s)),+i.apply(this,s),+n.apply(this,(s[0]=f,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(r=e,o):r},o.x=function(e){return arguments.length?(n="function"===typeof e?e:f(+e),o):n},o.y=function(e){return arguments.length?(i="function"===typeof e?e:f(+e),o):i},o.context=function(e){return arguments.length?(a=null==e?null:e,o):a},o}function g(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,i,n,i)}function y(){return m(g)}},84096:function(e,t,r){"use strict";r.d(t,{i$:function(){return h},Dq:function(){return d},g0:function(){return v}});var n=r(58176),i=r(48480),a=r(59879),o=r(82301),s=r(34823),l=r(79791);function u(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function c(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function f(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function d(e){var t=e.dateTime,r=e.date,s=e.time,l=e.periods,d=e.days,p=e.shortDays,h=e.months,v=e.shortMonths,g=w(l),y=k(l),x=w(d),b=k(d),_=w(p),Ae=k(p),Ce=w(h),Ee=k(h),Pe=w(v),Le=k(v),Ie={a:function(e){return p[e.getDay()]},A:function(e){return d[e.getDay()]},b:function(e){return v[e.getMonth()]},B:function(e){return h[e.getMonth()]},c:null,d:H,e:H,f:X,H:W,I:G,j:q,L:Y,m:K,M:$,p:function(e){return l[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Me,s:Se,S:J,u:Q,U:ee,V:te,w:re,W:ne,x:null,X:null,y:ie,Y:ae,Z:oe,"%":Te},Re={a:function(e){return p[e.getUTCDay()]},A:function(e){return d[e.getUTCDay()]},b:function(e){return v[e.getUTCMonth()]},B:function(e){return h[e.getUTCMonth()]},c:null,d:se,e:se,f:de,H:le,I:ue,j:ce,L:fe,m:pe,M:he,p:function(e){return l[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Me,s:Se,S:ve,u:me,U:ge,V:ye,w:xe,W:be,x:null,X:null,y:_e,Y:we,Z:ke,"%":Te},Oe={a:function(e,t,r){var n=_.exec(t.slice(r));return n?(e.w=Ae[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=x.exec(t.slice(r));return n?(e.w=b[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.m=Le[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=Ce.exec(t.slice(r));return n?(e.m=Ee[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,r,n){return Fe(e,t,r,n)},d:O,e:O,f:Z,H:z,I:z,j:D,L:N,m:R,M:F,p:function(e,t,r){var n=g.exec(t.slice(r));return n?(e.p=y[n[0].toLowerCase()],r+n[0].length):-1},q:I,Q:V,s:U,S:j,u:M,U:S,V:A,w:T,W:C,x:function(e,t,n){return Fe(e,r,t,n)},X:function(e,t,r){return Fe(e,s,t,r)},y:P,Y:E,Z:L,"%":B};function De(e,t){return function(r){var n,i,a,o=[],s=-1,l=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++s53)return null;"w"in d||(d.w=1),"Z"in d?(l=(s=c(f(d.y,0,1))).getUTCDay(),s=l>4||0===l?n.l6.ceil(s):(0,n.l6)(s),s=i.Z.offset(s,7*(d.V-1)),d.y=s.getUTCFullYear(),d.m=s.getUTCMonth(),d.d=s.getUTCDate()+(d.w+6)%7):(l=(s=u(f(d.y,0,1))).getDay(),s=l>4||0===l?a.wA.ceil(s):(0,a.wA)(s),s=o.Z.offset(s,7*(d.V-1)),d.y=s.getFullYear(),d.m=s.getMonth(),d.d=s.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),l="Z"in d?c(f(d.y,0,1)).getUTCDay():u(f(d.y,0,1)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+7*d.W-(l+5)%7:d.w+7*d.U-(l+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,c(d)):u(d)}}function Fe(e,t,r,n){for(var i,a,o=0,s=t.length,l=r.length;o=l)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=Oe[i in m?t.charAt(o++):i])||(n=a(e,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Ie.x=De(r,Ie),Ie.X=De(s,Ie),Ie.c=De(t,Ie),Re.x=De(r,Re),Re.X=De(s,Re),Re.c=De(t,Re),{format:function(e){var t=De(e+="",Ie);return t.toString=function(){return e},t},parse:function(e){var t=ze(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=De(e+="",Re);return t.toString=function(){return e},t},utcParse:function(e){var t=ze(e+="",!0);return t.toString=function(){return e},t}}}var p,h,v,m={"-":"",_:" ",0:"0"},g=/^\s*\d+/,y=/^%/,x=/[\\^$*+?|[\]().{}]/g;function b(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function L(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function I(e,t,r){var n=g.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function R(e,t,r){var n=g.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function O(e,t,r){var n=g.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function D(e,t,r){var n=g.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function z(e,t,r){var n=g.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function F(e,t,r){var n=g.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function j(e,t,r){var n=g.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function N(e,t,r){var n=g.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Z(e,t,r){var n=g.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function B(e,t,r){var n=y.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function V(e,t,r){var n=g.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function U(e,t,r){var n=g.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function H(e,t){return b(e.getDate(),t,2)}function W(e,t){return b(e.getHours(),t,2)}function G(e,t){return b(e.getHours()%12||12,t,2)}function q(e,t){return b(1+o.Z.count((0,s.Z)(e),e),t,3)}function Y(e,t){return b(e.getMilliseconds(),t,3)}function X(e,t){return Y(e,t)+"000"}function K(e,t){return b(e.getMonth()+1,t,2)}function $(e,t){return b(e.getMinutes(),t,2)}function J(e,t){return b(e.getSeconds(),t,2)}function Q(e){var t=e.getDay();return 0===t?7:t}function ee(e,t){return b(a.OM.count((0,s.Z)(e)-1,e),t,2)}function te(e,t){var r=e.getDay();return e=r>=4||0===r?(0,a.bL)(e):a.bL.ceil(e),b(a.bL.count((0,s.Z)(e),e)+(4===(0,s.Z)(e).getDay()),t,2)}function re(e){return e.getDay()}function ne(e,t){return b(a.wA.count((0,s.Z)(e)-1,e),t,2)}function ie(e,t){return b(e.getFullYear()%100,t,2)}function ae(e,t){return b(e.getFullYear()%1e4,t,4)}function oe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+b(t/60|0,"0",2)+b(t%60,"0",2)}function se(e,t){return b(e.getUTCDate(),t,2)}function le(e,t){return b(e.getUTCHours(),t,2)}function ue(e,t){return b(e.getUTCHours()%12||12,t,2)}function ce(e,t){return b(1+i.Z.count((0,l.Z)(e),e),t,3)}function fe(e,t){return b(e.getUTCMilliseconds(),t,3)}function de(e,t){return fe(e,t)+"000"}function pe(e,t){return b(e.getUTCMonth()+1,t,2)}function he(e,t){return b(e.getUTCMinutes(),t,2)}function ve(e,t){return b(e.getUTCSeconds(),t,2)}function me(e){var t=e.getUTCDay();return 0===t?7:t}function ge(e,t){return b(n.Ox.count((0,l.Z)(e)-1,e),t,2)}function ye(e,t){var r=e.getUTCDay();return e=r>=4||0===r?(0,n.hB)(e):n.hB.ceil(e),b(n.hB.count((0,l.Z)(e),e)+(4===(0,l.Z)(e).getUTCDay()),t,2)}function xe(e){return e.getUTCDay()}function be(e,t){return b(n.l6.count((0,l.Z)(e)-1,e),t,2)}function _e(e,t){return b(e.getUTCFullYear()%100,t,2)}function we(e,t){return b(e.getUTCFullYear()%1e4,t,4)}function ke(){return"+0000"}function Te(){return"%"}function Me(e){return+e}function Se(e){return Math.floor(+e/1e3)}p=d({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),h=p.format,p.parse,v=p.utcFormat,p.utcParse},82301:function(e,t,r){"use strict";r.d(t,{a:function(){return o}});var n=r(30052),i=r(54263),a=(0,n.Z)((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.yB)/i.UD}),(function(e){return e.getDate()-1}));t.Z=a;var o=a.range},54263:function(e,t,r){"use strict";r.d(t,{UD:function(){return o},Y2:function(){return a},Ym:function(){return n},iM:function(){return s},yB:function(){return i}});var n=1e3,i=6e4,a=36e5,o=864e5,s=6048e5},81041:function(e,t,r){"use strict";r.r(t),r.d(t,{timeDay:function(){return g.Z},timeDays:function(){return g.a},timeFriday:function(){return y.mC},timeFridays:function(){return y.b$},timeHour:function(){return v},timeHours:function(){return m},timeInterval:function(){return n.Z},timeMillisecond:function(){return a},timeMilliseconds:function(){return o},timeMinute:function(){return d},timeMinutes:function(){return p},timeMonday:function(){return y.wA},timeMondays:function(){return y.bJ},timeMonth:function(){return b},timeMonths:function(){return _},timeSaturday:function(){return y.EY},timeSaturdays:function(){return y.Ff},timeSecond:function(){return u},timeSeconds:function(){return c},timeSunday:function(){return y.OM},timeSundays:function(){return y.vm},timeThursday:function(){return y.bL},timeThursdays:function(){return y.$t},timeTuesday:function(){return y.sy},timeTuesdays:function(){return y.aU},timeWednesday:function(){return y.zg},timeWednesdays:function(){return y.Ld},timeWeek:function(){return y.OM},timeWeeks:function(){return y.vm},timeYear:function(){return w.Z},timeYears:function(){return w.g},utcDay:function(){return E.Z},utcDays:function(){return E.y},utcFriday:function(){return P.QQ},utcFridays:function(){return P.fz},utcHour:function(){return A},utcHours:function(){return C},utcMillisecond:function(){return a},utcMilliseconds:function(){return o},utcMinute:function(){return T},utcMinutes:function(){return M},utcMonday:function(){return P.l6},utcMondays:function(){return P.$3},utcMonth:function(){return I},utcMonths:function(){return R},utcSaturday:function(){return P.g4},utcSaturdays:function(){return P.Q_},utcSecond:function(){return u},utcSeconds:function(){return c},utcSunday:function(){return P.Ox},utcSundays:function(){return P.SU},utcThursday:function(){return P.hB},utcThursdays:function(){return P.xj},utcTuesday:function(){return P.J1},utcTuesdays:function(){return P.DK},utcWednesday:function(){return P.b3},utcWednesdays:function(){return P.uy},utcWeek:function(){return P.Ox},utcWeeks:function(){return P.SU},utcYear:function(){return O.Z},utcYears:function(){return O.D}});var n=r(30052),i=(0,n.Z)((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?(0,n.Z)((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):i:null};var a=i,o=i.range,s=r(54263),l=(0,n.Z)((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+t*s.Ym)}),(function(e,t){return(t-e)/s.Ym}),(function(e){return e.getUTCSeconds()})),u=l,c=l.range,f=(0,n.Z)((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*s.Ym)}),(function(e,t){e.setTime(+e+t*s.yB)}),(function(e,t){return(t-e)/s.yB}),(function(e){return e.getMinutes()})),d=f,p=f.range,h=(0,n.Z)((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*s.Ym-e.getMinutes()*s.yB)}),(function(e,t){e.setTime(+e+t*s.Y2)}),(function(e,t){return(t-e)/s.Y2}),(function(e){return e.getHours()})),v=h,m=h.range,g=r(82301),y=r(59879),x=(0,n.Z)((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),b=x,_=x.range,w=r(34823),k=(0,n.Z)((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*s.yB)}),(function(e,t){return(t-e)/s.yB}),(function(e){return e.getUTCMinutes()})),T=k,M=k.range,S=(0,n.Z)((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*s.Y2)}),(function(e,t){return(t-e)/s.Y2}),(function(e){return e.getUTCHours()})),A=S,C=S.range,E=r(48480),P=r(58176),L=(0,n.Z)((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),I=L,R=L.range,O=r(79791)},30052:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=new Date,i=new Date;function a(e,t,r,o){function s(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return s.floor=function(t){return e(t=new Date(+t)),t},s.ceil=function(r){return e(r=new Date(r-1)),t(r,1),e(r),r},s.round=function(e){var t=s(e),r=s.ceil(e);return e-t0))return o;do{o.push(a=new Date(+r)),t(r,i),e(r)}while(a=t)for(;e(t),!r(t);)t.setTime(t-1)}),(function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););}))},r&&(s.count=function(t,a){return n.setTime(+t),i.setTime(+a),e(n),e(i),Math.floor(r(n,i))},s.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?s.filter(o?function(t){return o(t)%e===0}:function(t){return s.count(0,t)%e===0}):s:null}),s}},48480:function(e,t,r){"use strict";r.d(t,{y:function(){return o}});var n=r(30052),i=r(54263),a=(0,n.Z)((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/i.UD}),(function(e){return e.getUTCDate()-1}));t.Z=a;var o=a.range},58176:function(e,t,r){"use strict";r.d(t,{$3:function(){return h},DK:function(){return v},J1:function(){return l},Ox:function(){return o},QQ:function(){return f},Q_:function(){return x},SU:function(){return p},b3:function(){return u},fz:function(){return y},g4:function(){return d},hB:function(){return c},l6:function(){return s},uy:function(){return m},xj:function(){return g}});var n=r(30052),i=r(54263);function a(e){return(0,n.Z)((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/i.iM}))}var o=a(0),s=a(1),l=a(2),u=a(3),c=a(4),f=a(5),d=a(6),p=o.range,h=s.range,v=l.range,m=u.range,g=c.range,y=f.range,x=d.range},79791:function(e,t,r){"use strict";r.d(t,{D:function(){return a}});var n=r(30052),i=(0,n.Z)((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));i.every=function(e){return isFinite(e=Math.floor(e))&&e>0?(0,n.Z)((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null},t.Z=i;var a=i.range},59879:function(e,t,r){"use strict";r.d(t,{$t:function(){return g},EY:function(){return d},Ff:function(){return x},Ld:function(){return m},OM:function(){return o},aU:function(){return v},b$:function(){return y},bJ:function(){return h},bL:function(){return c},mC:function(){return f},sy:function(){return l},vm:function(){return p},wA:function(){return s},zg:function(){return u}});var n=r(30052),i=r(54263);function a(e){return(0,n.Z)((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.yB)/i.iM}))}var o=a(0),s=a(1),l=a(2),u=a(3),c=a(4),f=a(5),d=a(6),p=o.range,h=s.range,v=l.range,m=u.range,g=c.range,y=f.range,x=d.range},34823:function(e,t,r){"use strict";r.d(t,{g:function(){return a}});var n=r(30052),i=(0,n.Z)((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));i.every=function(e){return isFinite(e=Math.floor(e))&&e>0?(0,n.Z)((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null},t.Z=i;var a=i.range},17045:function(e,t,r){"use strict";var n=r(8709),i="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),a=Object.prototype.toString,o=Array.prototype.concat,s=Object.defineProperty,l=r(55622)(),u=s&&l,c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!==typeof(i=n)||"[object Function]"!==a.call(i)||!n())return;var i;u?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r},f=function(e,t){var r=arguments.length>2?arguments[2]:{},a=n(t);i&&(a=o.call(a,Object.getOwnPropertySymbols(t)));for(var s=0;ss*l){var p=(d-f)/s;o[c]=1e3*p}}return o}function i(e){for(var t=[],r=e[0];r<=e[1];r++)for(var n=String.fromCharCode(r),i=e[0];i0)return function(e,t){var r,n;for(r=new Array(e),n=0;n80*a){o=l=e[0],s=f=e[1];for(var b=a;bl&&(l=d),h>f&&(f=h);v=0!==(v=Math.max(l-o,f-s))?1/v:0}return i(y,x,a,o,s,v),x}function r(e,t,r,n,i){var a,o;if(i===S(e,t,r,n)>0)for(a=t;a=t;a-=n)o=k(a,e[a],e[a+1],o);return o&&g(o,o.next)&&(T(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!g(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(T(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function i(e,t,r,u,c,f,p){if(e){!p&&f&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=d(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,l,u=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1)}(i)}(e,u,c,f);for(var h,v,m=e;e.prev!==e.next;)if(h=e.prev,v=e.next,f?o(e,u,c,f):a(e))t.push(h.i/r),t.push(e.i/r),t.push(v.i/r),T(e),e=v.next,m=v.next;else if((e=v)===m){p?1===p?i(e=s(n(e),t,r),t,r,u,c,f,2):2===p&&l(e,t,r,u,c,f):i(n(e),t,r,u,c,f,1);break}}}function a(e){var t=e.prev,r=e,n=e.next;if(m(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(h(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&m(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function o(e,t,r,n){var i=e.prev,a=e,o=e.next;if(m(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=d(s,l,t,r,n),p=d(u,c,t,r,n),v=e.prevZ,g=e.nextZ;v&&v.z>=f&&g&&g.z<=p;){if(v!==e.prev&&v!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,g!==e.prev&&g!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;g&&g.z<=p;){if(g!==e.prev&&g!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function s(e,t,r){var i=e;do{var a=i.prev,o=i.next.next;!g(a,o)&&y(a,i,i.next,o)&&_(a,o)&&_(o,a)&&(t.push(a.i/r),t.push(i.i/r),t.push(o.i/r),T(i),T(i.next),i=e=o),i=i.next}while(i!==e);return n(i)}function l(e,t,r,a,o,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&v(l,u)){var c=w(l,u);return l=n(l,l.next),c=n(c,c.next),i(l,t,r,a,o,s),void i(c,t,r,a,o,s)}u=u.next}l=l.next}while(l!==e)}function u(e,t){return e.x-t.x}function c(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&h(ar.x||n.x===r.x&&f(r,n)))&&(r=n,p=l)),n=n.next}while(n!==u);return r}(e,t),t){var r=w(t,e);n(t,t.next),n(r,r.next)}}function f(e,t){return m(e.prev,e,t.prev)<0&&m(t.next,e,e.next)<0}function d(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,r=e;do{(t.x=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function v(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&y(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(_(e,t)&&_(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(m(e.prev,e,t.prev)||m(e,t.prev,t))||g(e,t)&&m(e.prev,e,e.next)>0&&m(t.prev,t,t.next)>0)}function m(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function g(e,t){return e.x===t.x&&e.y===t.y}function y(e,t,r,n){var i=b(m(e,t,r)),a=b(m(e,t,n)),o=b(m(r,n,e)),s=b(m(r,n,t));return i!==a&&o!==s||!(0!==i||!x(e,r,t))||!(0!==a||!x(e,n,t))||!(0!==o||!x(r,e,n))||!(0!==s||!x(r,t,n))}function x(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function b(e){return e>0?1:e<0?-1:0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function w(e,t){var r=new M(e.i,e.x,e.y),n=new M(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function k(e,t,r,n){var i=new M(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function T(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,r,n){for(var i=0,a=t,o=r-n;a0&&(n+=e[i-1].length,r.holes.push(n))}return r}},2502:function(e,t,r){var n=r(68664);e.exports=function(e,t){var r,i=[],a=[],o=[],s={},l=[];function u(e){o[e]=!1,s.hasOwnProperty(e)&&Object.keys(s[e]).forEach((function(t){delete s[e][t],o[t]&&u(t)}))}function c(e){var t,n,i=!1;for(a.push(e),o[e]=!0,t=0;t=t}))}(t);for(var r,i=n(e).components.filter((function(e){return e.length>1})),a=1/0,o=0;o=55296&&y<=56319&&(w+=e[++r]),w=k?d.call(k,T,w,v):w,t?(p.value=w,h(m,v,p)):m[v]=w,++v;g=v}if(void 0===g)for(g=o(e.length),t&&(m=new t(g)),r=0;r0?1:-1}},56247:function(e,t,r){"use strict";var n=r(9953),i=Math.abs,a=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?n(e)*a(i(e)):e}},35976:function(e,t,r){"use strict";var n=r(56247),i=Math.max;e.exports=function(e){return i(0,n(e))}},67260:function(e,t,r){"use strict";var n=r(78513),i=r(36672),a=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(r,u){var c,f=arguments[2],d=arguments[3];return r=Object(i(r)),n(u),c=s(r),d&&c.sort("function"===typeof d?a.call(d,r):void 0),"function"!==typeof e&&(e=c[e]),o.call(e,c,(function(e,n){return l.call(r,e)?o.call(u,f,r[e],e,r,n):t}))}}},95879:function(e,t,r){"use strict";e.exports=r(73583)()?Object.assign:r(34205)},73583:function(e){"use strict";e.exports=function(){var e,t=Object.assign;return"function"===typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},34205:function(e,t,r){"use strict";var n=r(68700),i=r(36672),a=Math.max;e.exports=function(e,t){var r,o,s,l=a(arguments.length,2);for(e=Object(i(e)),s=function(n){try{e[n]=t[n]}catch(i){r||(r=i)}},o=1;o-1}},87963:function(e){"use strict";var t=Object.prototype.toString,r=t.call("");e.exports=function(e){return"string"===typeof e||e&&"object"===typeof e&&(e instanceof String||t.call(e)===r)||!1}},43043:function(e){"use strict";var t=Object.create(null),r=Math.random;e.exports=function(){var e;do{e=r().toString(36).slice(2)}while(t[e]);return e}},32411:function(e,t,r){"use strict";var n,i=r(1496),a=r(66741),o=r(62072),s=r(8260),l=r(95426),u=Object.defineProperty;n=e.exports=function(e,t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,e),t=t?a.call(t,"key+value")?"key+value":a.call(t,"key")?"key":"value":"value",u(this,"__kind__",o("",t))},i&&i(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),u(n.prototype,s.toStringTag,o("c","Array Iterator"))},27515:function(e,t,r){"use strict";var n=r(73051),i=r(78513),a=r(87963),o=r(66661),s=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(e,t){var r,c,f,d,p,h,v,m,g=arguments[2];if(s(e)||n(e)?r="array":a(e)?r="string":e=o(e),i(t),f=function(){d=!0},"array"!==r)if("string"!==r)for(c=e.next();!c.done;){if(l.call(t,g,c.value,f),d)return;c=e.next()}else for(h=e.length,p=0;p=55296&&m<=56319&&(v+=e[++p]),l.call(t,g,v,f),!d);++p);else u.call(e,(function(e){return l.call(t,g,e,f),d}))}},66661:function(e,t,r){"use strict";var n=r(73051),i=r(87963),a=r(32411),o=r(259),s=r(58095),l=r(8260).iterator;e.exports=function(e){return"function"===typeof s(e)[l]?e[l]():n(e)?new a(e):i(e)?new o(e):new a(e)}},95426:function(e,t,r){"use strict";var n,i=r(16134),a=r(95879),o=r(78513),s=r(36672),l=r(62072),u=r(55174),c=r(8260),f=Object.defineProperty,d=Object.defineProperties;e.exports=n=function(e,t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");d(this,{__list__:l("w",s(e)),__context__:l("w",t),__nextIndex__:l("w",0)}),t&&(o(t.on),t.on("_add",this._onAdd),t.on("_delete",this._onDelete),t.on("_clear",this._onClear))},delete n.prototype.constructor,d(n.prototype,a({_next:l((function(){var e;if(this.__list__)return this.__redo__&&void 0!==(e=this.__redo__.shift())?e:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(t,r){t>=e&&(this.__redo__[r]=++t)}),this),this.__redo__.push(e)):f(this,"__redo__",l("c",[e])))})),_onDelete:l((function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach((function(t,r){t>e&&(this.__redo__[r]=--t)}),this)))})),_onClear:l((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),f(n.prototype,c.iterator,l((function(){return this})))},35940:function(e,t,r){"use strict";var n=r(73051),i=r(95296),a=r(87963),o=r(8260).iterator,s=Array.isArray;e.exports=function(e){return!!i(e)&&(!!s(e)||!!a(e)||!!n(e)||"function"===typeof e[o])}},259:function(e,t,r){"use strict";var n,i=r(1496),a=r(62072),o=r(8260),s=r(95426),l=Object.defineProperty;n=e.exports=function(e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");e=String(e),s.call(this,e),l(this,"__length__",a("",e.length))},i&&i(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:a((function(){if(this.__list__)return this.__nextIndex__=55296&&t<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,a("c","String Iterator"))},58095:function(e,t,r){"use strict";var n=r(35940);e.exports=function(e){if(!n(e))throw new TypeError(e+" is not iterable");return e}},73523:function(e){"use strict";function t(e,t){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,u=c,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"===typeof l)n(l,this,t);else{var u=l.length,c=h(l,u);for(r=0;r=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},60774:function(e){var t=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}}()},94908:function(e,t,r){"use strict";e.exports=r(51152)()?globalThis:r(60774)},51152:function(e){"use strict";e.exports=function(){return"object"===typeof globalThis&&!!globalThis&&globalThis.Array===Array}},92770:function(e,t,r){"use strict";var n=r(18546);e.exports=function(e){var t=typeof e;if("string"===t){var r=e;if(0===(e=+e)&&n(r))return!1}else if("number"!==t)return!1;return e-e<1}},30120:function(e,t,r){var n=r(90660);e.exports=function(e,t,r){if(!e)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(e)&&e[0]&&"number"===typeof e[0][0]){var i,a,o,s,l=e[0].length,u=e.length*l;t&&"string"!==typeof t||(t=new(n(t||"float32"))(u+r));var c=t.length-r;if(u!==c)throw new Error("source length "+u+" ("+l+"x"+e.length+") does not match destination length "+c);for(i=0,o=r;it[0]-o[0]/2&&(d=o[0]/2,p+=o[1]);return r}},32879:function(e){"use strict";function t(e,a){a||(a={}),("string"===typeof e||Array.isArray(e))&&(a.family=e);var o=Array.isArray(a.family)?a.family.join(", "):a.family;if(!o)throw Error("`family` must be defined");var s=a.size||a.fontSize||a.em||48,l=a.weight||a.fontWeight||"",u=(e=[a.style||a.fontStyle||"",l,s].join(" ")+"px "+o,a.origin||"top");if(t.cache[o]&&s<=t.cache[o].em)return r(t.cache[o],u);var c=a.canvas||t.canvas,f=c.getContext("2d"),d={upper:void 0!==a.upper?a.upper:"H",lower:void 0!==a.lower?a.lower:"x",descent:void 0!==a.descent?a.descent:"p",ascent:void 0!==a.ascent?a.ascent:"h",tittle:void 0!==a.tittle?a.tittle:"i",overshoot:void 0!==a.overshoot?a.overshoot:"O"},p=Math.ceil(1.5*s);c.height=p,c.width=.5*p,f.font=e;var h="H",v={top:0};f.clearRect(0,0,p,p),f.textBaseline="top",f.fillStyle="black",f.fillText(h,0,0);var m=n(f.getImageData(0,0,p,p));f.clearRect(0,0,p,p),f.textBaseline="bottom",f.fillText(h,0,p);var g=n(f.getImageData(0,0,p,p));v.lineHeight=v.bottom=p-g+m,f.clearRect(0,0,p,p),f.textBaseline="alphabetic",f.fillText(h,0,p);var y=p-n(f.getImageData(0,0,p,p))-1+m;v.baseline=v.alphabetic=y,f.clearRect(0,0,p,p),f.textBaseline="middle",f.fillText(h,0,.5*p);var x=n(f.getImageData(0,0,p,p));v.median=v.middle=p-x-1+m-.5*p,f.clearRect(0,0,p,p),f.textBaseline="hanging",f.fillText(h,0,.5*p);var b=n(f.getImageData(0,0,p,p));v.hanging=p-b-1+m-.5*p,f.clearRect(0,0,p,p),f.textBaseline="ideographic",f.fillText(h,0,p);var _=n(f.getImageData(0,0,p,p));if(v.ideographic=p-_-1+m,d.upper&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.upper,0,0),v.upper=n(f.getImageData(0,0,p,p)),v.capHeight=v.baseline-v.upper),d.lower&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.lower,0,0),v.lower=n(f.getImageData(0,0,p,p)),v.xHeight=v.baseline-v.lower),d.tittle&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.tittle,0,0),v.tittle=n(f.getImageData(0,0,p,p))),d.ascent&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.ascent,0,0),v.ascent=n(f.getImageData(0,0,p,p))),d.descent&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.descent,0,0),v.descent=i(f.getImageData(0,0,p,p))),d.overshoot){f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(d.overshoot,0,0);var w=i(f.getImageData(0,0,p,p));v.overshoot=w-y}for(var k in v)v[k]/=s;return v.em=s,t.cache[o]=v,r(v,u)}function r(e,t){var r={};for(var n in"string"===typeof t&&(t=e[t]),e)"em"!==n&&(r[n]=e[n]-t);return r}function n(e){for(var t=e.height,r=e.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/t)}e.exports=t,t.canvas=document.createElement("canvas"),t.cache={}},31353:function(e,t,r){"use strict";var n=r(85395),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;n1&&"boolean"!==typeof t)throw new o('"allowMissing" argument must be a boolean');if(null===M(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=T(e,0,1),r=T(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return k(e,S,(function(e,t,r,i){n[n.length]=r?k(i,A,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",a=C("%"+n+"%",t),s=a.name,u=a.value,c=!1,f=a.alias;f&&(n=f[0],w(r,_([0,1],f)));for(var d=1,p=!0;d=r.length){var y=l(u,h);u=(p=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:u[h]}else p=b(u,h),u=u[h];p&&!c&&(v[s]=u)}}return u}},85400:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],f=t[9],d=t[10],p=t[11],h=t[12],v=t[13],m=t[14],g=t[15];return e[0]=s*(d*g-p*m)-f*(l*g-u*m)+v*(l*p-u*d),e[1]=-(n*(d*g-p*m)-f*(i*g-a*m)+v*(i*p-a*d)),e[2]=n*(l*g-u*m)-s*(i*g-a*m)+v*(i*u-a*l),e[3]=-(n*(l*p-u*d)-s*(i*p-a*d)+f*(i*u-a*l)),e[4]=-(o*(d*g-p*m)-c*(l*g-u*m)+h*(l*p-u*d)),e[5]=r*(d*g-p*m)-c*(i*g-a*m)+h*(i*p-a*d),e[6]=-(r*(l*g-u*m)-o*(i*g-a*m)+h*(i*u-a*l)),e[7]=r*(l*p-u*d)-o*(i*p-a*d)+c*(i*u-a*l),e[8]=o*(f*g-p*v)-c*(s*g-u*v)+h*(s*p-u*f),e[9]=-(r*(f*g-p*v)-c*(n*g-a*v)+h*(n*p-a*f)),e[10]=r*(s*g-u*v)-o*(n*g-a*v)+h*(n*u-a*s),e[11]=-(r*(s*p-u*f)-o*(n*p-a*f)+c*(n*u-a*s)),e[12]=-(o*(f*m-d*v)-c*(s*m-l*v)+h*(s*d-l*f)),e[13]=r*(f*m-d*v)-c*(n*m-i*v)+h*(n*d-i*f),e[14]=-(r*(s*m-l*v)-o*(n*m-i*v)+h*(n*l-i*s)),e[15]=r*(s*d-l*f)-o*(n*d-i*f)+c*(n*l-i*s),e}},42331:function(e){e.exports=function(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},31042:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},11902:function(e){e.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},89887:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],f=e[10],d=e[11],p=e[12],h=e[13],v=e[14],m=e[15];return(t*o-r*a)*(f*m-d*v)-(t*s-n*a)*(c*m-d*h)+(t*l-i*a)*(c*v-f*h)+(r*s-n*o)*(u*m-d*p)-(r*l-i*o)*(u*v-f*p)+(n*l-i*s)*(u*h-c*p)}},27812:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,f=n*s,d=i*o,p=i*s,h=i*l,v=a*o,m=a*s,g=a*l;return e[0]=1-f-h,e[1]=c+g,e[2]=d-m,e[3]=0,e[4]=c-g,e[5]=1-u-h,e[6]=p+v,e[7]=0,e[8]=d+m,e[9]=p-v,e[10]=1-u-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},34045:function(e){e.exports=function(e,t,r){var n,i,a,o=r[0],s=r[1],l=r[2],u=Math.sqrt(o*o+s*s+l*l);return Math.abs(u)<1e-6?null:(o*=u=1/u,s*=u,l*=u,n=Math.sin(t),i=Math.cos(t),a=1-i,e[0]=o*o*a+i,e[1]=s*o*a+l*n,e[2]=l*o*a-s*n,e[3]=0,e[4]=o*s*a-l*n,e[5]=s*s*a+i,e[6]=l*s*a+o*n,e[7]=0,e[8]=o*l*a+s*n,e[9]=s*l*a-o*n,e[10]=l*l*a+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}},45973:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,l=i+i,u=a+a,c=n*s,f=n*l,d=n*u,p=i*l,h=i*u,v=a*u,m=o*s,g=o*l,y=o*u;return e[0]=1-(p+v),e[1]=f+y,e[2]=d-g,e[3]=0,e[4]=f-y,e[5]=1-(c+v),e[6]=h+m,e[7]=0,e[8]=d+g,e[9]=h-m,e[10]=1-(c+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}},81472:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},14669:function(e){e.exports=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}},75262:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},331:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},11049:function(e){e.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},75195:function(e){e.exports=function(e,t,r,n,i,a,o){var s=1/(r-t),l=1/(i-n),u=1/(a-o);return e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*l,e[10]=(o+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*u,e[15]=0,e}},71551:function(e){e.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},79576:function(e,t,r){e.exports={create:r(11902),clone:r(42331),copy:r(31042),identity:r(71551),transpose:r(88654),invert:r(95874),adjoint:r(85400),determinant:r(89887),multiply:r(91362),translate:r(31283),scale:r(10789),rotate:r(65074),rotateX:r(35545),rotateY:r(94918),rotateZ:r(15692),fromRotation:r(34045),fromRotationTranslation:r(45973),fromScaling:r(81472),fromTranslation:r(14669),fromXRotation:r(75262),fromYRotation:r(331),fromZRotation:r(11049),fromQuat:r(27812),frustum:r(75195),perspective:r(7864),perspectiveFromFieldOfView:r(35279),ortho:r(60378),lookAt:r(65551),str:r(6726)}},95874:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],f=t[9],d=t[10],p=t[11],h=t[12],v=t[13],m=t[14],g=t[15],y=r*s-n*o,x=r*l-i*o,b=r*u-a*o,_=n*l-i*s,w=n*u-a*s,k=i*u-a*l,T=c*v-f*h,M=c*m-d*h,S=c*g-p*h,A=f*m-d*v,C=f*g-p*v,E=d*g-p*m,P=y*E-x*C+b*A+_*S-w*M+k*T;return P?(P=1/P,e[0]=(s*E-l*C+u*A)*P,e[1]=(i*C-n*E-a*A)*P,e[2]=(v*k-m*w+g*_)*P,e[3]=(d*w-f*k-p*_)*P,e[4]=(l*S-o*E-u*M)*P,e[5]=(r*E-i*S+a*M)*P,e[6]=(m*b-h*k-g*x)*P,e[7]=(c*k-d*b+p*x)*P,e[8]=(o*C-s*S+u*T)*P,e[9]=(n*S-r*C-a*T)*P,e[10]=(h*w-v*b+g*y)*P,e[11]=(f*b-c*w-p*y)*P,e[12]=(s*M-o*A-l*T)*P,e[13]=(r*A-n*M+i*T)*P,e[14]=(v*x-h*_-m*y)*P,e[15]=(c*_-f*x+d*y)*P,e):null}},65551:function(e,t,r){var n=r(71551);e.exports=function(e,t,r,i){var a,o,s,l,u,c,f,d,p,h,v=t[0],m=t[1],g=t[2],y=i[0],x=i[1],b=i[2],_=r[0],w=r[1],k=r[2];return Math.abs(v-_)<1e-6&&Math.abs(m-w)<1e-6&&Math.abs(g-k)<1e-6?n(e):(f=v-_,d=m-w,p=g-k,h=1/Math.sqrt(f*f+d*d+p*p),a=x*(p*=h)-b*(d*=h),o=b*(f*=h)-y*p,s=y*d-x*f,(h=Math.sqrt(a*a+o*o+s*s))?(a*=h=1/h,o*=h,s*=h):(a=0,o=0,s=0),l=d*s-p*o,u=p*a-f*s,c=f*o-d*a,(h=Math.sqrt(l*l+u*u+c*c))?(l*=h=1/h,u*=h,c*=h):(l=0,u=0,c=0),e[0]=a,e[1]=l,e[2]=f,e[3]=0,e[4]=o,e[5]=u,e[6]=d,e[7]=0,e[8]=s,e[9]=c,e[10]=p,e[11]=0,e[12]=-(a*v+o*m+s*g),e[13]=-(l*v+u*m+c*g),e[14]=-(f*v+d*m+p*g),e[15]=1,e)}},91362:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],f=t[8],d=t[9],p=t[10],h=t[11],v=t[12],m=t[13],g=t[14],y=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*n+b*s+_*f+w*v,e[1]=x*i+b*l+_*d+w*m,e[2]=x*a+b*u+_*p+w*g,e[3]=x*o+b*c+_*h+w*y,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*n+b*s+_*f+w*v,e[5]=x*i+b*l+_*d+w*m,e[6]=x*a+b*u+_*p+w*g,e[7]=x*o+b*c+_*h+w*y,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*n+b*s+_*f+w*v,e[9]=x*i+b*l+_*d+w*m,e[10]=x*a+b*u+_*p+w*g,e[11]=x*o+b*c+_*h+w*y,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*n+b*s+_*f+w*v,e[13]=x*i+b*l+_*d+w*m,e[14]=x*a+b*u+_*p+w*g,e[15]=x*o+b*c+_*h+w*y,e}},60378:function(e){e.exports=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*u,e[15]=1,e}},7864:function(e){e.exports=function(e,t,r,n,i){var a=1/Math.tan(t/2),o=1/(n-i);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*n*o,e[15]=0,e}},35279:function(e){e.exports=function(e,t,r,n){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(o-s)*l*.5,e[9]=(i-a)*u*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}},65074:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x,b,_,w,k,T,M,S,A,C=n[0],E=n[1],P=n[2],L=Math.sqrt(C*C+E*E+P*P);return Math.abs(L)<1e-6?null:(C*=L=1/L,E*=L,P*=L,i=Math.sin(r),a=Math.cos(r),o=1-a,s=t[0],l=t[1],u=t[2],c=t[3],f=t[4],d=t[5],p=t[6],h=t[7],v=t[8],m=t[9],g=t[10],y=t[11],x=C*C*o+a,b=E*C*o+P*i,_=P*C*o-E*i,w=C*E*o-P*i,k=E*E*o+a,T=P*E*o+C*i,M=C*P*o+E*i,S=E*P*o-C*i,A=P*P*o+a,e[0]=s*x+f*b+v*_,e[1]=l*x+d*b+m*_,e[2]=u*x+p*b+g*_,e[3]=c*x+h*b+y*_,e[4]=s*w+f*k+v*T,e[5]=l*w+d*k+m*T,e[6]=u*w+p*k+g*T,e[7]=c*w+h*k+y*T,e[8]=s*M+f*S+v*A,e[9]=l*M+d*S+m*A,e[10]=u*M+p*S+g*A,e[11]=c*M+h*S+y*A,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}},35545:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],f=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+u*n,e[5]=o*i+c*n,e[6]=s*i+f*n,e[7]=l*i+d*n,e[8]=u*i-a*n,e[9]=c*i-o*n,e[10]=f*i-s*n,e[11]=d*i-l*n,e}},94918:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[8],c=t[9],f=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-u*n,e[1]=o*i-c*n,e[2]=s*i-f*n,e[3]=l*i-d*n,e[8]=a*n+u*i,e[9]=o*n+c*i,e[10]=s*n+f*i,e[11]=l*n+d*i,e}},15692:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],c=t[5],f=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+u*n,e[1]=o*i+c*n,e[2]=s*i+f*n,e[3]=l*i+d*n,e[4]=u*i-a*n,e[5]=c*i-o*n,e[6]=f*i-s*n,e[7]=d*i-l*n,e}},10789:function(e){e.exports=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},6726:function(e){e.exports=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}},31283:function(e){e.exports=function(e,t,r){var n,i,a,o,s,l,u,c,f,d,p,h,v=r[0],m=r[1],g=r[2];return t===e?(e[12]=t[0]*v+t[4]*m+t[8]*g+t[12],e[13]=t[1]*v+t[5]*m+t[9]*g+t[13],e[14]=t[2]*v+t[6]*m+t[10]*g+t[14],e[15]=t[3]*v+t[7]*m+t[11]*g+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],f=t[8],d=t[9],p=t[10],h=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=f,e[9]=d,e[10]=p,e[11]=h,e[12]=n*v+s*m+f*g+t[12],e[13]=i*v+l*m+d*g+t[13],e[14]=a*v+u*m+p*g+t[14],e[15]=o*v+c*m+h*g+t[15]),e}},88654:function(e){e.exports=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},42505:function(e,t,r){"use strict";var n=r(72791),i=r(71299),a=r(98580),o=r(12018),s=r(83522),l=r(25075),u=r(68016),c=r(58404),f=r(18863),d=r(10973),p=r(25677),h=r(75686),v=r(53545),m=r(56131),g=r(32879),y=r(30120),x=r(13547).nextPow2,b=new s,_=!1;if(document.body){var w=document.body.appendChild(document.createElement("div"));w.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(w).fontStretch&&(_=!0),document.body.removeChild(w)}var k=function(e){!function(e){return"function"===typeof e&&e._gl&&e.prop&&e.texture&&e.buffer}(e)?this.gl=o(e):(e={regl:e},this.gl=e.regl._gl),this.shader=b.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=e.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),b.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(d(e)?e:{})};k.prototype.createShader=function(){var e=this.regl,t=e({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:e.prop("count"),offset:e.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:e.this("sizeBuffer")},width:{offset:0,stride:8,buffer:e.this("sizeBuffer")},char:e.this("charBuffer"),position:e.this("position")},uniforms:{atlasSize:function(e,t){return[t.atlas.width,t.atlas.height]},atlasDim:function(e,t){return[t.atlas.cols,t.atlas.rows]},atlas:function(e,t){return t.atlas.texture},charStep:function(e,t){return t.atlas.step},em:function(e,t){return t.atlas.em},color:e.prop("color"),opacity:e.prop("opacity"),viewport:e.this("viewportArray"),scale:e.this("scale"),align:e.prop("align"),baseline:e.prop("baseline"),translate:e.this("translate"),positionOffset:e.prop("positionOffset")},primitive:"points",viewport:e.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:e,draw:t,atlas:{}}},k.prototype.update=function(e){var t=this;if("string"===typeof e)e={text:e};else if(!e)return;null!=(e=i(e,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(e.opacity)?this.opacity=e.opacity.map((function(e){return parseFloat(e)})):this.opacity=parseFloat(e.opacity)),null!=e.viewport&&(this.viewport=f(e.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=e.kerning&&(this.kerning=e.kerning),null!=e.offset&&("number"===typeof e.offset&&(e.offset=[e.offset,0]),this.positionOffset=y(e.offset)),e.direction&&(this.direction=e.direction),e.range&&(this.range=e.range,this.scale=[1/(e.range[2]-e.range[0]),1/(e.range[3]-e.range[1])],this.translate=[-e.range[0],-e.range[1]]),e.scale&&(this.scale=e.scale),e.translate&&(this.translate=e.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||e.font||(e.font=k.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(e.font&&(Array.isArray(e.font)?e.font:[e.font]).forEach((function(e,r){if("string"===typeof e)try{e=n.parse(e)}catch(f){e=n.parse(k.baseFontSize+"px "+e)}else e=n.parse(n.stringify(e));var i=n.stringify({size:k.baseFontSize,family:e.family,stretch:_?e.stretch:void 0,variant:e.variant,weight:e.weight,style:e.style}),s=p(e.size),l=Math.round(s[0]*h(s[1]));if(l!==t.fontSize[r]&&(o=!0,t.fontSize[r]=l),(!t.font[r]||i!=t.font[r].baseString)&&(a=!0,t.font[r]=k.fonts[i],!t.font[r])){var u=e.family.join(", "),c=[e.style];e.style!=e.variant&&c.push(e.variant),e.variant!=e.weight&&c.push(e.weight),_&&e.weight!=e.stretch&&c.push(e.stretch),t.font[r]={baseString:i,family:u,weight:e.weight,stretch:e.stretch,style:e.style,variant:e.variant,width:{},kerning:{},metrics:g(u,{origin:"top",fontSize:k.baseFontSize,fontStyle:c.join(" ")})},k.fonts[i]=t.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:t.fontSize[i],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(t.fontAtlas[i]=t.shader.atlas[a],!t.fontAtlas[i]){var o=r.metrics;t.shader.atlas[a]=t.fontAtlas[i]={fontString:a,step:2*Math.ceil(t.fontSize[i]*o.bottom*.5),em:t.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:t.regl.texture()}}null==e.text&&(e.text=t.text)})),"string"===typeof e.text&&e.position&&e.position.length>2){for(var s=Array(.5*e.position.length),d=0;d2){for(var w=!e.position[0].length,T=c.mallocFloat(2*this.count),M=0,S=0;M1?t.align[r]:t.align[0]:t.align;if("number"===typeof n)return n;switch(n){case"right":case"end":return-e;case"center":case"centre":case"middle":return.5*-e}return 0}))),null==this.baseline&&null==e.baseline&&(e.baseline=0),null!=e.baseline&&(this.baseline=e.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(e,r){var n=(t.font[r]||t.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"===typeof e?e-n.baseline:-n[e],i*=-1}))),null!=e.color)if(e.color||(e.color="transparent"),"string"!==typeof e.color&&isNaN(e.color)){var H;if("number"===typeof e.color[0]&&e.color.length>this.counts.length){var W=e.color.length;H=c.mallocUint8(W);for(var G=(e.color.subarray||e.color.slice).bind(e.color),q=0;q4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var K=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(K);for(var $=0;$1?this.counts[$]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[$]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*$,4*$+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[$]:this.opacity,baseline:null!=this.baselineOffset[$]?this.baselineOffset[$]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[$]?this.alignOffset[$]:this.alignOffset[0]:0,atlas:this.fontAtlas[$]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*$,2*$+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},k.prototype.destroy=function(){},k.prototype.kerning=!0,k.prototype.position={constant:new Float32Array(2)},k.prototype.translate=null,k.prototype.scale=null,k.prototype.font=null,k.prototype.text="",k.prototype.positionOffset=[0,0],k.prototype.opacity=1,k.prototype.color=new Uint8Array([0,0,0,255]),k.prototype.alignOffset=[0,0],k.maxAtlasSize=1024,k.atlasCanvas=document.createElement("canvas"),k.atlasContext=k.atlasCanvas.getContext("2d",{alpha:!1}),k.baseFontSize=64,k.fonts={},e.exports=k},12018:function(e,t,r){"use strict";var n=r(71299);function i(e){if(e.container)if(e.container==document.body)document.body.style.width||(e.canvas.width=e.width||e.pixelRatio*r.g.innerWidth),document.body.style.height||(e.canvas.height=e.height||e.pixelRatio*r.g.innerHeight);else{var t=e.container.getBoundingClientRect();e.canvas.width=e.width||t.right-t.left,e.canvas.height=e.height||t.bottom-t.top}}function a(e){return"function"===typeof e.getContext&&"width"in e&&"height"in e}function o(){var e=document.createElement("canvas");return e.style.position="absolute",e.style.top=0,e.style.left=0,e}e.exports=function(e){var t;if(e?"string"===typeof e&&(e={container:e}):e={},(e=a(e)||"string"===typeof(t=e).nodeName&&"function"===typeof t.appendChild&&"function"===typeof t.getBoundingClientRect?{container:e}:function(e){return"function"===typeof e.drawArrays||"function"===typeof e.drawElements}(e)?{gl:e}:n(e,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(e.pixelRatio=r.g.pixelRatio||1),e.gl)return e.gl;if(e.canvas&&(e.container=e.canvas.parentNode),e.container){if("string"===typeof e.container){var s=document.querySelector(e.container);if(!s)throw Error("Element "+e.container+" is not found");e.container=s}a(e.container)?(e.canvas=e.container,e.container=e.canvas.parentNode):e.canvas||(e.canvas=o(),e.container.appendChild(e.canvas),i(e))}else if(!e.canvas){if("undefined"===typeof document)throw Error("Not DOM environment. Use headless-gl.");e.container=document.body||document.documentElement,e.canvas=o(),e.container.appendChild(e.canvas),i(e)}return e.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(r){try{e.gl=e.canvas.getContext(r,e.attrs)}catch(t){}return e.gl})),e.gl}},56068:function(e){e.exports=function(e){"string"===typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n>1,c=-7,f=r?i-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=h,s/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=h,o/=256,u-=8);e[r+p-h]|=128*v}},42018:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},47216:function(e,t,r){"use strict";var n=r(84543)(),i=r(6614)("Object.prototype.toString"),a=function(e){return!(n&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!a(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,e.exports=s?a:o},54404:function(e){e.exports=!0},85395:function e(t){"use strict";var r,n,i=Function.prototype.toString,a="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof a&&"function"===typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},a((function(){throw 42}),null,r)}catch(e){e!==n&&(a=null)}else a=null;var o=/^\s*class\b/,s=function(e){try{var t=i.call(e);return o.test(t)}catch(r){return!1}},l=function(e){try{return!s(e)&&(i.call(e),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"===typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),d=function(){return!1};if("object"===typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(d=function(e){if((f||!e)&&("undefined"===typeof e||"object"===typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(r){}return!1})}t.exports=a?function(e){if(d(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;try{a(e,null,r)}catch(t){if(t!==n)return!1}return!s(e)&&l(e)}:function(e){if(d(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;if(c)return l(e);if(s(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&l(e)}},65481:function(e,t,r){"use strict";var n,i=Object.prototype.toString,a=Function.prototype.toString,o=/^\s*(?:function)?\*/,s=r(84543)(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!==typeof e)return!1;if(o.test(a.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!l)return!1;if("undefined"===typeof n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}},62683:function(e){"use strict";e.exports="undefined"!==typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},64274:function(e){"use strict";e.exports=function(e){return e!==e}},15567:function(e,t,r){"use strict";var n=r(68222),i=r(17045),a=r(64274),o=r(14922),s=r(22442),l=n(o(),Number);i(l,{getPolyfill:o,implementation:a,shim:s}),e.exports=l},14922:function(e,t,r){"use strict";var n=r(64274);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},22442:function(e,t,r){"use strict";var n=r(17045),i=r(14922);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},64941:function(e){"use strict";e.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},10973:function(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var r;return"[object Object]"===t.call(e)&&(null===(r=Object.getPrototypeOf(e))||r===Object.getPrototypeOf({}))}},18546:function(e){"use strict";e.exports=function(e){for(var t,r=e.length,n=0;n13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},89546:function(e){"use strict";e.exports=function(e){return"string"===typeof e&&(e=e.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(e)&&/[\dz]$/i.test(e)&&e.length>4))}},9187:function(e,t,r){"use strict";var n=r(31353),i=r(72077),a=r(6614),o=a("Object.prototype.toString"),s=r(84543)(),l=r(40383),u="undefined"===typeof globalThis?r.g:globalThis,c=i(),f=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1}return!!l&&function(e){var t=!1;return n(p,(function(r,n){if(!t)try{t=r.call(e)===n}catch(i){}})),t}(e)}},44517:function(e){e.exports=function(){"use strict";var e,t,r;function n(n,i){if(e)if(t){var a="var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk);",o={};e(o),(r=i(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else t=i;else e=i}return n(["exports"],(function(e){function t(e,t){return e(t={exports:{}},t.exports),t.exports}var r="1.10.1",n=i;function i(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=n,this.p2x=r,this.p2y=n}i.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},i.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},i.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},i.prototype.solveCurveX=function(e,t){var r,n,i,a,o;for("undefined"===typeof t&&(t=1e-6),i=e,o=0;o<8;o++){if(a=this.sampleCurveX(i)-e,Math.abs(a)(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var a=o;function o(e,t){this.x=e,this.y=t}function s(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function u(e,t,r,i){var a=new n(e,t,r,i);return function(e){return a.solve(e)}}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),a=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(e){return e instanceof o?e:Array.isArray(e)?new o(e[0],e[1]):e};var c=u(.25,.1,.25,1);function f(e,t,r){return Math.min(r,Math.max(t,e))}function d(e,t,r){var n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function p(e,t,r){if(!e.length)return r(null,[]);var n=e.length,i=new Array(e.length),a=null;e.forEach((function(e,o){t(e,(function(e,t){e&&(a=e),i[o]=t,0===--n&&r(a,i)}))}))}function h(e){var t=[];for(var r in e)t.push(e[r]);return t}function v(e,t){var r=[];for(var n in e)n in t||r.push(n);return r}function m(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}return e()}function _(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function w(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function k(e,t){return-1!==e.indexOf(t,e.length-t.length)}function T(e,t,r){var n={};for(var i in e)n[i]=t.call(r||this,e[i],i,e);return n}function M(e,t,r){var n={};for(var i in e)t.call(r||this,e[i],i,e)&&(n[i]=e[i]);return n}function S(e){return Array.isArray(e)?e.map(S):"object"===typeof e&&e?T(e,S):e}function A(e,t){for(var r=0;r=0)return!0;return!1}var C={};function E(e){C[e]||("undefined"!==typeof console&&console.warn(e),C[e]=!0)}function P(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function L(e){for(var t=0,r=0,n=e.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(e.replace(t,(function(e,t,n,i){var a=n||i;return r[t]=!a||a.toLowerCase(),""})),r["max-age"]){var n=parseInt(r["max-age"],10);isNaN(n)?delete r["max-age"]:r["max-age"]=n}return r}var D=null;function z(e){if(null==D){var t=e.navigator?e.navigator.userAgent:null;D=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return D}function F(e){try{var t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(r){return!1}}function j(e){return self.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(Number("0x"+t))})))}function N(e){return decodeURIComponent(self.atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}var Z,B,V,U,H=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),W=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,G=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,q={now:H,frame:function(e){var t=W(e);return{cancel:function(){return G(t)}}},getImageData:function(e,t){void 0===t&&(t=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return Z||(Z=self.document.createElement("a")),Z.href=e,Z.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==B&&(B=self.matchMedia("(prefers-reduced-motion: reduce)")),B.matches)}},Y={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},X={supported:!1,testSupport:J},K=!1,$=!1;function J(e){!K&&U&&($?Q(e):V=e)}function Q(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,U),e.isContextLost())return;X.supported=!0}catch(r){}e.deleteTexture(t),K=!0}self.document&&((U=self.document.createElement("img")).onload=function(){V&&Q(V),V=null,$=!0},U.onerror=function(){K=!0,V=null},U.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var ee="01";function te(){for(var e="1",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",n=0;n<10;n++)r+=t[Math.floor(62*Math.random())];var i=432e5;return{token:[e,ee,r].join(""),tokenExpiresAt:Date.now()+i}}var re=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function ne(e){return 0===e.indexOf("mapbox:")}re.prototype._createSkuToken=function(){var e=te();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},re.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},re.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},re.prototype.normalizeStyleURL=function(e,t){if(!ne(e))return e;var r=ue(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},re.prototype.normalizeGlyphsURL=function(e,t){if(!ne(e))return e;var r=ue(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},re.prototype.normalizeSourceURL=function(e,t){if(!ne(e))return e;var r=ue(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},re.prototype.normalizeSpriteURL=function(e,t,r,n){var i=ue(e);return ne(e)?(i.path="/styles/v1"+i.path+"/sprite"+t+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+t+r,ce(i))},re.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!ne(e))return e;var r=ue(e),n=/(\.(png|jpg)\d*)(?=$)/,i=/^.+\/v4\//,a=q.devicePixelRatio>=2||512===t?"@2x":"",o=X.supported?".webp":"$1";r.path=r.path.replace(n,""+a+o),r.path=r.path.replace(i,"/"),r.path="/v4"+r.path;var s=this._customAccessToken||se(r.params)||Y.ACCESS_TOKEN;return Y.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,s)},re.prototype.canonicalizeTileURL=function(e,t){var r="/v4/",n=/\.[\w]+$/,i=ue(e);if(!i.path.match(/(^\/v4\/)/)||!i.path.match(n))return e;var a="mapbox://tiles/";a+=i.path.replace(r,"");var o=i.params;return t&&(o=o.filter((function(e){return!e.match(/^access_token=/)}))),o.length&&(a+="?"+o.join("&")),a},re.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&ne(t),n=[],i=0,a=e.tiles||[];i=1&&self.localStorage.setItem(t,JSON.stringify(this.eventData))}catch(n){E("Unable to write to LocalStorage")}},pe.prototype.processRequests=function(e){},pe.prototype.postEvent=function(e,t,n,i){var a=this;if(Y.EVENTS_URL){var o=ue(Y.EVENTS_URL);o.params.push("access_token="+(i||Y.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:ee,userId:this.anonId},l=t?m(s,t):s,u={url:ce(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=Ye(u,(function(e){a.pendingRequest=null,n(e),a.saveEventData(),a.processRequests(i)}))}},pe.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var he,ve,me=function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postMapLoadEvent=function(e,t,r,n){this.skuToken=r,(Y.EVENTS_URL&&n||Y.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return ne(e)||ae(e)})))&&this.queueRequest({id:t,timestamp:Date.now()},n)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),_(this.anonId)||(this.anonId=b()),this.postEvent(i,{skuToken:this.skuToken},(function(e){e||n&&(t.success[n]=!0)}),e))}},t}(pe),ge=function(e){function t(t){e.call(this,"appUserTurnstile"),this._customAccessToken=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postTurnstileEvent=function(e,t){Y.EVENTS_URL&&Y.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return ne(e)||ae(e)}))&&this.queueRequest(Date.now(),t)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=de(Y.ACCESS_TOKEN),n=r?r.u:Y.ACCESS_TOKEN,i=n!==this.eventData.tokenU;_(this.anonId)||(this.anonId=b(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(e){e||(t.eventData.lastSuccess=a,t.eventData.tokenU=n)}),e)}},t}(pe),ye=new ge,xe=ye.postTurnstileEvent.bind(ye),be=new me,_e=be.postMapLoadEvent.bind(be),we="mapbox-tiles",ke=500,Te=50,Me=42e4;function Se(){self.caches&&!he&&(he=self.caches.open(we))}function Ae(e,t){if(void 0===ve)try{new Response(new ReadableStream),ve=!0}catch(r){ve=!1}ve?t(e.body):e.blob().then(t)}function Ce(e,t,r){if(Se(),he){var n={status:t.status,statusText:t.statusText,headers:new self.Headers};t.headers.forEach((function(e,t){return n.headers.set(t,e)}));var i=O(t.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-rDate.now()&&!r["no-cache"]}var Ie,Re=1/0;function Oe(e){++Re>Te&&(e.getActor().send("enforceCacheSizeLimit",ke),Re=0)}function De(e){Se(),he&&he.then((function(t){t.keys().then((function(r){for(var n=0;n=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(i){return t(i)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new Ze(r.statusText,r.status,e.url))},r.send(e.body),{cancel:function(){return r.abort()}}}var We=function(e,t){if(!Ve(e.url)){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return Ue(e,t);if(R()&&self.worker&&self.worker.actor){var r=!0;return self.worker.actor.send("getResource",e,t,void 0,r)}}return He(e,t)},Ge=function(e,t){return We(m(e,{type:"json"}),t)},qe=function(e,t){return We(m(e,{type:"arrayBuffer"}),t)},Ye=function(e,t){return We(m(e,{method:"POST"}),t)};function Xe(e){var t=self.document.createElement("a");return t.href=e,t.protocol===self.document.location.protocol&&t.host===self.document.location.host}var Ke,$e,Je="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Qe(e,t,r,n){var i=new self.Image,a=self.URL;i.onload=function(){t(null,i),a.revokeObjectURL(i.src)},i.onerror=function(){return t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new self.Blob([new Uint8Array(e)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=e.byteLength?a.createObjectURL(o):Je}function et(e,t){var r=new self.Blob([new Uint8Array(e)],{type:"image/png"});self.createImageBitmap(r).then((function(e){t(null,e)})).catch((function(e){t(new Error("Could not load image because of "+e.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}Ke=[],$e=0;var tt=function e(t,r){if(X.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),$e>=Y.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:t,callback:r,cancelled:!1,cancel:function(){this.cancelled=!0}};return Ke.push(n),n}$e++;var i=!1,a=function(){if(!i)for(i=!0,$e--;Ke.length&&$e0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},st.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var lt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},ut=function(e,t,r,n){this.message=(e?e+": ":"")+r,n&&(this.identifier=n),null!==t&&void 0!==t&&t.__line__&&(this.line=t.__line__)};function ct(e){var t=e.key,r=e.value;return r?[new ut(t,r,"constants have been deprecated as of v8")]:[]}function ft(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var Et=[mt,gt,yt,xt,bt,Mt,_t,At(wt),St];function Pt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Pt(e.itemType,t.itemType))&&("number"!==typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var r=0,n=Et;r255?255:e}function i(e){return e<0?0:e>1?1:e}function a(e){return"%"===e[e.length-1]?n(parseFloat(e)/100*255):n(parseInt(e))}function o(e){return"%"===e[e.length-1]?i(parseFloat(e)/100):i(parseFloat(e))}function s(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function l(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=i.indexOf("("),u=i.indexOf(")");if(-1!==l&&u+1===i.length){var c=i.substr(0,l),f=i.substr(l+1,u-(l+1)).split(","),d=1;switch(c){case"rgba":if(4!==f.length)return null;d=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),d];case"hsla":if(4!==f.length)return null;d=o(f.pop());case"hsl":if(3!==f.length)return null;var p=(parseFloat(f[0])%360+360)%360/360,h=o(f[1]),v=o(f[2]),m=v<=.5?v*(h+1):v+h-v*h,g=2*v-m;return[n(255*s(g,m,p+1/3)),n(255*s(g,m,p)),n(255*s(g,m,p-1/3)),d];default:return null}}return null}try{t.parseCSSColor=l}catch(u){}})),Ot=Rt.parseCSSColor,Dt=function(e,t,r,n){void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n};Dt.parse=function(e){if(e){if(e instanceof Dt)return e;if("string"===typeof e){var t=Ot(e);if(t)return new Dt(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Dt.prototype.toString=function(){var e=this.toArray(),t=e[0],r=e[1],n=e[2],i=e[3];return"rgba("+Math.round(t)+","+Math.round(r)+","+Math.round(n)+","+i+")"},Dt.prototype.toArray=function(){var e=this,t=e.r,r=e.g,n=e.b,i=e.a;return 0===i?[0,0,0,0]:[255*t/i,255*r/i,255*n/i,i]},Dt.black=new Dt(0,0,0,1),Dt.white=new Dt(1,1,1,1),Dt.transparent=new Dt(0,0,0,0),Dt.red=new Dt(1,0,0,1);var zt=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};zt.prototype.compare=function(e,t){return this.collator.compare(e,t)},zt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Ft=function(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i},jt=function(e){this.sections=e};jt.fromString=function(e){return new jt([new Ft(e,null,null,null,null)])},jt.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))},jt.factory=function(e){return e instanceof jt?e:jt.fromString(e)},jt.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")},jt.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t=0&&e<=255&&"number"===typeof t&&t>=0&&t<=255&&"number"===typeof r&&r>=0&&r<=255?"undefined"===typeof n||"number"===typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[e,t,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"===typeof n?[e,t,r,n]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Bt(e){if(null===e)return!0;if("string"===typeof e)return!0;if("boolean"===typeof e)return!0;if("number"===typeof e)return!0;if(e instanceof Dt)return!0;if(e instanceof zt)return!0;if(e instanceof jt)return!0;if(e instanceof Nt)return!0;if(Array.isArray(e)){for(var t=0,r=e;t2){var s=e[1];if("string"!==typeof s||!(s in Gt)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=Gt[s],n++}else a=wt;if(e.length>3){if(null!==e[2]&&("number"!==typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=At(a,o)}else r=Gt[i];for(var l=[];n1)&&t.push(n)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var Yt=function(e){this.type=Mt,this.sections=e};Yt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&"object"===typeof r)return t.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=e.length-1;++a){var o=e[a];if(i&&"object"===typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=t.parse(o["font-scale"],1,gt)))return null;var l=null;if(o["text-font"]&&!(l=t.parse(o["text-font"],1,At(yt))))return null;var u=null;if(o["text-color"]&&!(u=t.parse(o["text-color"],1,bt)))return null;var c=n[n.length-1];c.scale=s,c.font=l,c.textColor=u}else{var f=t.parse(e[a],1,wt);if(!f)return null;var d=f.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:f,scale:null,font:null,textColor:null})}}return new Yt(n)},Yt.prototype.evaluate=function(e){var t=function(t){var r=t.content.evaluate(e);return Vt(r)===St?new Ft("",r,null,null,null):new Ft(Ut(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)};return new jt(this.sections.map(t))},Yt.prototype.eachChild=function(e){for(var t=0,r=this.sections;t-1),r},Xt.prototype.eachChild=function(e){e(this.input)},Xt.prototype.outputDefined=function(){return!1},Xt.prototype.serialize=function(){return["image",this.input.serialize()]};var Kt={"to-boolean":xt,"to-color":bt,"to-number":gt,"to-string":yt},$t=function(e,t){this.type=e,this.args=t};$t.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");for(var n=Kt[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":Zt(t[0],t[1],t[2],t[3])))return new Dt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Wt(r||"Could not parse color from value '"+("string"===typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=t[2])&&!(e[1]<=t[1])&&!(e[3]>=t[3])}function lr(e,t){var r=ar(e[0]),n=or(e[1]),i=Math.pow(2,t.z);return[Math.round(r*i*nr),Math.round(n*i*nr)]}function ur(e,t,r){var n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return n*o-a*i===0&&n*a<=0&&i*o<=0}function cr(e,t,r){return t[1]>e[1]!==r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function fr(e,t){for(var r=!1,n=0,i=t.length;n0&&f<0||c<0&&f>0}function vr(e,t,r,n){var i=[t[0]-e[0],t[1]-e[1]];return 0!==pr([n[0]-r[0],n[1]-r[1]],i)&&!(!hr(e,t,r,n)||!hr(r,n,e,t))}function mr(e,t,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=e[0]-r[0]>i?-n:r[0]-e[0]>i?n:0;0===a&&(a=e[0]-r[2]>i?-n:r[2]-e[0]>i?n:0),e[0]+=a}ir(t,e)}function wr(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function kr(e,t,r,n){for(var i=Math.pow(2,n.z)*nr,a=[n.x*nr,n.y*nr],o=[],s=0,l=e;s=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Pr(e,t)&&(r=!1)})),r}Ar.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(Bt(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var n=0;nt))throw new Wt("Input is not a number.");o=s-1}return 0}Ir.prototype.parse=function(e,t,r,n,i){return void 0===i&&(i={}),t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)},Ir.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new qt(t,[e]):"coerce"===r?new $t(t,[e]):e}if(null!==e&&"string"!==typeof e&&"boolean"!==typeof e&&"number"!==typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=e[0];if("string"!==typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,t.typeAnnotation||"coerce");else a=r(a,o,t.typeAnnotation||"assert")}if(!(a instanceof Ht)&&"resolvedImage"!==a.type.kind&&Rr(a)){var l=new Qt;try{a=new Ht(a.type,a.evaluate(l))}catch(u){return this.error(u.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return"undefined"===typeof e?this.error("'undefined' value invalid. Use null instead."):"object"===typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},Ir.prototype.concat=function(e,t,r){var n="number"===typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new Ir(this.registry,n,t||null,i,this.errors)},Ir.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var n=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new ht(n,e))},Ir.prototype.checkSubtype=function(e,t){var r=Pt(e,t);return r&&this.error(r),r};var Dr=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=t.parse(s,u,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new Dr(i,r,n)},Dr.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Or(t,n)].evaluate(e)},Dr.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Nr=Object.freeze({__proto__:null,number:zr,color:Fr,array:jr}),Zr=.95047,Br=1,Vr=1.08883,Ur=4/29,Hr=6/29,Wr=3*Hr*Hr,Gr=Hr*Hr*Hr,qr=Math.PI/180,Yr=180/Math.PI;function Xr(e){return e>Gr?Math.pow(e,1/3):e/Wr+Ur}function Kr(e){return e>Hr?e*e*e:Wr*(e-Ur)}function $r(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Jr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Qr(e){var t=Jr(e.r),r=Jr(e.g),n=Jr(e.b),i=Xr((.4124564*t+.3575761*r+.1804375*n)/Zr),a=Xr((.2126729*t+.7151522*r+.072175*n)/Br);return{l:116*a-16,a:500*(i-a),b:200*(a-Xr((.0193339*t+.119192*r+.9503041*n)/Vr)),alpha:e.a}}function en(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=Br*Kr(t),r=Zr*Kr(r),n=Vr*Kr(n),new Dt($r(3.2404542*r-1.5371385*t-.4985314*n),$r(-.969266*r+1.8760108*t+.041556*n),$r(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function tn(e,t,r){return{l:zr(e.l,t.l,r),a:zr(e.a,t.a,r),b:zr(e.b,t.b,r),alpha:zr(e.alpha,t.alpha,r)}}function rn(e){var t=Qr(e),r=t.l,n=t.a,i=t.b,a=Math.atan2(i,n)*Yr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:e.a}}function nn(e){var t=e.h*qr,r=e.c;return en({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})}function an(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}function on(e,t,r){return{h:an(e.h,t.h,r),c:zr(e.c,t.c,r),l:zr(e.l,t.l,r),alpha:zr(e.alpha,t.alpha,r)}}var sn={forward:Qr,reverse:en,interpolate:tn},ln={forward:rn,reverse:nn,interpolate:on},un=Object.freeze({__proto__:null,lab:sn,hcl:ln}),cn=function(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(!(i=t.parse(i,2,gt)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=bt:t.expectedType&&"value"!==t.expectedType.kind&&(u=t.expectedType);for(var c=0;c=f)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var v=t.parse(d,h,u);if(!v)return null;u=u||v.type,l.push([f,v])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"===typeof u.N?new cn(u,r,n,i,l):t.error("Type "+Ct(u)+" is not interpolatable.")},cn.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);var a=Or(t,n),o=t[a],s=t[a+1],l=cn.interpolationFactor(this.interpolation,n,o,s),u=r[a].evaluate(e),c=r[a+1].evaluate(e);return"interpolate"===this.operator?Nr[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?ln.reverse(ln.interpolate(ln.forward(u),ln.forward(c),l)):sn.reverse(sn.interpolate(sn.forward(u),sn.forward(c),l))},cn.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t=r.length)throw new Wt("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new Wt("Array index must be an integer, but found "+t+" instead.");return r[t]},hn.prototype.eachChild=function(e){e(this.index),e(this.input)},hn.prototype.outputDefined=function(){return!1},hn.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var vn=function(e,t){this.type=xt,this.needle=e,this.haystack=t};vn.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,wt),n=t.parse(e[2],2,wt);return r&&n?Lt(r.type,[xt,yt,gt,mt,wt])?new vn(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+Ct(r.type)+" instead"):null},vn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!It(t,["boolean","string","number","null"]))throw new Wt("Expected first argument to be of type boolean, string, number or null, but found "+Ct(Vt(t))+" instead.");if(!It(r,["string","array"]))throw new Wt("Expected second argument to be of type array or string, but found "+Ct(Vt(r))+" instead.");return r.indexOf(t)>=0},vn.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},vn.prototype.outputDefined=function(){return!0},vn.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var mn=function(e,t,r){this.type=gt,this.needle=e,this.haystack=t,this.fromIndex=r};mn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,wt),n=t.parse(e[2],2,wt);if(!r||!n)return null;if(!Lt(r.type,[xt,yt,gt,mt,wt]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+Ct(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,gt);return i?new mn(r,n,i):null}return new mn(r,n)},mn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!It(t,["boolean","string","number","null"]))throw new Wt("Expected first argument to be of type boolean, string, number or null, but found "+Ct(Vt(t))+" instead.");if(!It(r,["string","array"]))throw new Wt("Expected second argument to be of type array or string, but found "+Ct(Vt(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},mn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},mn.prototype.outputDefined=function(){return!1},mn.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var gn=function(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};gn.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!==1)return t.error("Expected an even number of arguments.");var r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"===typeof d&&Math.floor(d)!==d)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,Vt(d)))return null}else r=Vt(d);if("undefined"!==typeof i[String(d)])return u.error("Branch labels must be unique.");i[String(d)]=a.length}var p=t.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var h=t.parse(e[1],1,wt);if(!h)return null;var v=t.parse(e[e.length-1],e.length-1,n);return v?"value"!==h.type.kind&&t.concat(1).checkSubtype(r,h.type)?null:new gn(r,n,h,i,a,v):null},gn.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(Vt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},gn.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},gn.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},gn.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();ir}function Mn(e,t,r){return t<=r}function Sn(e,t,r){return t>=r}function An(e,t,r,n){return 0===n.compare(t,r)}function Cn(e,t,r,n){return!An(e,t,r,n)}function En(e,t,r,n){return n.compare(t,r)<0}function Pn(e,t,r,n){return n.compare(t,r)>0}function Ln(e,t,r,n){return n.compare(t,r)<=0}function In(e,t,r,n){return n.compare(t,r)>=0}function Rn(e,t,r){var n="=="!==e&&"!="!==e;return function(){function i(e,t,r){this.type=xt,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return i.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],a=t.parse(e[1],1,wt);if(!a)return null;if(!bn(r,a.type))return t.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Ct(a.type)+"'.");var o=t.parse(e[2],2,wt);if(!o)return null;if(!bn(r,o.type))return t.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Ct(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '"+Ct(a.type)+"' and '"+Ct(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new qt(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new qt(a.type,[o])));var s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,Tt)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=Vt(a),l=Vt(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new Wt('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var u=Vt(a),c=Vt(o);if("string"!==u.kind||"string"!==c.kind)return t(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):t(i,a,o)},i.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var t=[e];return this.eachChild((function(e){t.push(e.serialize())})),t},i}()}xn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,wt),n=t.parse(e[2],2,gt);if(!r||!n)return null;if(!Lt(r.type,[At(wt),yt,wt]))return t.error("Expected first argument to be of type array or string, but found "+Ct(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,gt);return i?new xn(r.type,r,n,i):null}return new xn(r.type,r,n)},xn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!It(t,["string","array"]))throw new Wt("Expected first argument to be of type array or string, but found "+Ct(Vt(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},xn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},xn.prototype.outputDefined=function(){return!1},xn.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var On=Rn("==",_n,An),Dn=Rn("!=",wn,Cn),zn=Rn("<",kn,En),Fn=Rn(">",Tn,Pn),jn=Rn("<=",Mn,Ln),Nn=Rn(">=",Sn,In),Zn=function(e,t,r,n,i){this.type=yt,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Zn.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,gt);if(!r)return null;var n=e[2];if("object"!==typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=t.parse(n.locale,1,yt)))return null;var a=null;if(n.currency&&!(a=t.parse(n.currency,1,yt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=t.parse(n["min-fraction-digits"],1,gt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=t.parse(n["max-fraction-digits"],1,gt))?null:new Zn(r,i,a,o,s)},Zn.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},Zn.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},Zn.prototype.outputDefined=function(){return!1},Zn.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Bn=function(e){this.type=gt,this.input=e};Bn.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+Ct(r.type)+" instead."):new Bn(r):null},Bn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"===typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Wt("Expected value to be of type string or array, but found "+Ct(Vt(t))+" instead.")},Bn.prototype.eachChild=function(e){e(this.input)},Bn.prototype.outputDefined=function(){return!1},Bn.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Vn={"==":On,"!=":Dn,">":Fn,"<":zn,">=":Nn,"<=":jn,array:qt,at:hn,boolean:qt,case:yn,coalesce:dn,collator:rr,format:Yt,image:Xt,in:vn,"index-of":mn,interpolate:cn,"interpolate-hcl":cn,"interpolate-lab":cn,length:Bn,let:pn,literal:Ht,match:gn,number:qt,"number-format":Zn,object:qt,slice:xn,step:Dr,string:qt,"to-boolean":$t,"to-color":$t,"to-number":$t,"to-string":$t,var:Lr,within:Ar};function Un(e,t){var r=t[0],n=t[1],i=t[2],a=t[3];r=r.evaluate(e),n=n.evaluate(e),i=i.evaluate(e);var o=a?a.evaluate(e):1,s=Zt(r,n,i,o);if(s)throw new Wt(s);return new Dt(r/255*o,n/255*o,i/255*o,o)}function Hn(e,t){return e in t}function Wn(e,t){var r=t[e];return"undefined"===typeof r?null:r}function Gn(e,t,r,n){for(;r<=n;){var i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}function qn(e){return{type:e}}function Yn(e){return{result:"success",value:e}}function Xn(e){return{result:"error",value:e}}function Kn(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function $n(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Jn(e){return!!e.expression&&e.expression.interpolated}function Qn(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function ei(e){return"object"===typeof e&&null!==e&&!Array.isArray(e)}function ti(e){return e}function ri(e,t){var r,n,i,a="color"===t.type,o=e.stops&&"object"===typeof e.stops[0][0],s=o||void 0!==e.property,l=o||!s,u=e.type||(Jn(t)?"exponential":"interval");if(a&&((e=ft({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],Dt.parse(e[1])]}))),e.default?e.default=Dt.parse(e.default):e.default=Dt.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!un[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)r=oi;else if("interval"===u)r=ai;else if("categorical"===u){r=ii,n=Object.create(null);for(var c=0,f=e.stops;c=e.stops[n-1][0])return e.stops[n-1][1];var i=Or(e.stops.map((function(e){return e[0]})),r);return e.stops[i][1]}function oi(e,t,r){var n=void 0!==e.base?e.base:1;if("number"!==Qn(r))return ni(e.default,t.default);var i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];var a=Or(e.stops.map((function(e){return e[0]})),r),o=li(r,n,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],u=Nr[t.type]||ti;if(e.colorSpace&&"rgb"!==e.colorSpace){var c=un[e.colorSpace];u=function(e,t){return c.reverse(c.interpolate(c.forward(e),c.forward(t),o))}}return"function"===typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return u(r,n,o)}}:u(s,l,o)}function si(e,t,r){return"color"===t.type?r=Dt.parse(r):"formatted"===t.type?r=jt.fromString(r.toString()):"resolvedImage"===t.type?r=Nt.fromString(r.toString()):Qn(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),ni(r,e.default,t.default)}function li(e,t,r,n){var i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}er.register(Vn,{error:[kt,[yt],function(e,t){var r=t[0];throw new Wt(r.evaluate(e))}],typeof:[yt,[wt],function(e,t){return Ct(Vt(t[0].evaluate(e)))}],"to-rgba":[At(gt,4),[bt],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[bt,[gt,gt,gt],Un],rgba:[bt,[gt,gt,gt,gt],Un],has:{type:xt,overloads:[[[yt],function(e,t){return Hn(t[0].evaluate(e),e.properties())}],[[yt,_t],function(e,t){var r=t[0],n=t[1];return Hn(r.evaluate(e),n.evaluate(e))}]]},get:{type:wt,overloads:[[[yt],function(e,t){return Wn(t[0].evaluate(e),e.properties())}],[[yt,_t],function(e,t){var r=t[0],n=t[1];return Wn(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[wt,[yt],function(e,t){return Wn(t[0].evaluate(e),e.featureState||{})}],properties:[_t,[],function(e){return e.properties()}],"geometry-type":[yt,[],function(e){return e.geometryType()}],id:[wt,[],function(e){return e.id()}],zoom:[gt,[],function(e){return e.globals.zoom}],"heatmap-density":[gt,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[gt,[],function(e){return e.globals.lineProgress||0}],accumulated:[wt,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[gt,qn(gt),function(e,t){for(var r=0,n=0,i=t;n":[xt,[yt,wt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>a}],"filter-id->":[xt,[wt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>i}],"filter-<=":[xt,[yt,wt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i<=a}],"filter-id-<=":[xt,[wt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n<=i}],"filter->=":[xt,[yt,wt],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>=a}],"filter-id->=":[xt,[wt],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>=i}],"filter-has":[xt,[wt],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[xt,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[xt,[At(yt)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[xt,[At(wt)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[xt,[yt,At(wt)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[xt,[yt,At(wt)],function(e,t){var r=t[0],n=t[1];return Gn(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:xt,overloads:[[[xt,xt],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[qn(xt),function(e,t){for(var r=0,n=t;r0&&"string"===typeof e[0]&&e[0]in Vn}function fi(e,t){var r=new Ir(Vn,[],t?yi(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Yn(new ui(n,t)):Xn(r.errors)}ui.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},ui.prototype.evaluate=function(e,t,r,n,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null===o||void 0===o||"number"===typeof o&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new Wt("Expected value to be one of "+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!==typeof console&&console.warn(s.message)),this._defaultValue}};var di=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Er(t.expression)};di.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},di.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)};var pi=function(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Er(t.expression),this.interpolationType=n};function hi(e,t){if("error"===(e=fi(e,t)).result)return e;var r=e.value.expression,n=Cr(r);if(!n&&!Kn(t))return Xn([new ht("","data expressions not supported")]);var i=Pr(r,["zoom"]);if(!i&&!$n(t))return Xn([new ht("","zoom expressions not supported")]);var a=gi(r);if(!a&&!i)return Xn([new ht("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof ht)return Xn([a]);if(a instanceof cn&&!Jn(t))return Xn([new ht("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Yn(new di(n?"constant":"source",e.value));var o=a instanceof cn?a.interpolation:void 0;return Yn(new pi(n?"camera":"composite",e.value,a.labels,o))}pi.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},pi.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)},pi.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?cn.interpolationFactor(this.interpolationType,e,t,r):0};var vi=function(e,t){this._parameters=e,this._specification=t,ft(this,ri(this._parameters,this._specification))};function mi(e,t){if(ei(e))return new vi(e,t);if(ci(e)){var r=hi(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}var n=e;return"string"===typeof e&&"color"===t.type&&(n=Dt.parse(e)),{kind:"constant",evaluate:function(){return n}}}function gi(e){var t=null;if(e instanceof pn)t=gi(e.result);else if(e instanceof dn)for(var r=0,n=e.args;rn.maximum?[new ut(t,r,r+" is greater than the maximum value "+n.maximum)]:[]}function ki(e){var t,r,n,i=e.valueSpec,a=dt(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,u="array"===Qn(e.value.stops)&&"array"===Qn(e.value.stops[0])&&"object"===Qn(e.value.stops[0][0]),c=bi({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:f,default:h}});return"identity"===a&&s&&c.push(new ut(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||c.push(new ut(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!Jn(e.valueSpec)&&c.push(new ut(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Kn(e.valueSpec)?c.push(new ut(e.key,e.value,"property functions not supported")):s&&!$n(e.valueSpec)&&c.push(new ut(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!u||void 0!==e.value.property||c.push(new ut(e.key,e.value,'"property" property is required')),c;function f(e){if("identity"===a)return[new ut(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;return t=t.concat(_i({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:d})),"array"===Qn(r)&&0===r.length&&t.push(new ut(e.key,r,"array must have at least one stop")),t}function d(e){var t=[],a=e.value,s=e.key;if("array"!==Qn(a))return[new ut(s,a,"array expected, "+Qn(a)+" found")];if(2!==a.length)return[new ut(s,a,"array length 2 expected, length "+a.length+" found")];if(u){if("object"!==Qn(a[0]))return[new ut(s,a,"object expected, "+Qn(a[0])+" found")];if(void 0===a[0].zoom)return[new ut(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new ut(s,a,"object stop key must have value")];if(n&&n>dt(a[0].zoom))return[new ut(s,a[0].zoom,"stop zoom values must appear in ascending order")];dt(a[0].zoom)!==n&&(n=dt(a[0].zoom),r=void 0,o={}),t=t.concat(bi({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:wi,value:p}}))}else t=t.concat(p({key:s+"[0]",value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return ci(pt(a[1]))?t.concat([new ut(s+"[1]",a[1],"expressions are not allowed in function stops.")]):t.concat(Qi({key:s+"[1]",value:a[1],valueSpec:i,style:e.style,styleSpec:e.styleSpec}))}function p(e,n){var s=Qn(e.value),l=dt(e.value),u=null!==e.value?e.value:n;if(t){if(s!==t)return[new ut(e.key,u,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ut(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return Kn(i)&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ut(e.key,u,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!==typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);tt?1:0}function Ii(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t"===t||"<="===t||">="===t?Oi(e[1],e[2],t):"any"===t?Di(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(Ri)):"none"===t?["all"].concat(e.slice(1).map(Ri).map(ji)):"in"===t?zi(e[1],e.slice(2)):"!in"===t?ji(zi(e[1],e.slice(2))):"has"===t?Fi(e[1]):"!has"===t?ji(Fi(e[1])):"within"!==t||e}function Oi(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Di(e){return["any"].concat(e.map(Ri))}function zi(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return typeof e!==typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Li)]]:["filter-in-small",e,["literal",t]]}}function Fi(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function ji(e){return["!",e]}function Ni(e){return Ci(pt(e.value))?Ti(ft({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Zi(e)}function Zi(e){var t=e.value,r=e.key;if("array"!==Qn(t))return[new ut(r,t,"array expected, "+Qn(t)+" found")];var n,i=e.styleSpec,a=[];if(t.length<1)return[new ut(r,t,"filter array must have at least 1 element")];switch(a=a.concat(Ai({key:r+"[0]",value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),dt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===dt(t[1])&&a.push(new ut(r,t,'"$type" cannot be use with operator "'+t[0]+'"'));case"==":case"!=":3!==t.length&&a.push(new ut(r,t,'filter array for operator "'+t[0]+'" must have 3 elements'));case"in":case"!in":t.length>=2&&"string"!==(n=Qn(t[1]))&&a.push(new ut(r+"[1]",t[1],"string expected, "+n+" found"));for(var o=2;o=c[p+0]&&n>=c[p+1])?(o[d]=!0,a.push(u[d])):o[d]=!1}}},fa.prototype._forEachCell=function(e,t,r,n,i,a,o,s){for(var l=this._convertToCellCoord(e),u=this._convertToCellCoord(t),c=this._convertToCellCoord(r),f=this._convertToCellCoord(n),d=l;d<=c;d++)for(var p=u;p<=f;p++){var h=this.d*p+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&i.call(this,e,t,r,n,h,a,o,s))return}},fa.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},fa.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},fa.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=ca+this.cells.length+1+1,r=0,n=0;n=0)){var f=e[c];u[c]=ha[l].shallow.indexOf(c)>=0?f:xa(f,t)}e instanceof Error&&(u.message=e.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}throw new Error("can't serialize object of type "+typeof e)}function ba(e){if(null===e||void 0===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||ga(e)||ya(e)||ArrayBuffer.isView(e)||e instanceof da)return e;if(Array.isArray(e))return e.map(ba);if("object"===typeof e){var t=e.$name||"Object",r=ha[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var n=Object.create(r.prototype),i=0,a=Object.keys(e);i=0?s:ba(s)}}return n}throw new Error("can't deserialize object of type "+typeof e)}var _a=function(){this.first=!0};_a.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function ka(e){for(var t=0,r=e;t=65097&&e<=65103)||!!wa["CJK Compatibility Ideographs"](e)||!!wa["CJK Compatibility"](e)||!!wa["CJK Radicals Supplement"](e)||!!wa["CJK Strokes"](e)||!(!wa["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||!!wa["CJK Unified Ideographs Extension A"](e)||!!wa["CJK Unified Ideographs"](e)||!!wa["Enclosed CJK Letters and Months"](e)||!!wa["Hangul Compatibility Jamo"](e)||!!wa["Hangul Jamo Extended-A"](e)||!!wa["Hangul Jamo Extended-B"](e)||!!wa["Hangul Jamo"](e)||!!wa["Hangul Syllables"](e)||!!wa.Hiragana(e)||!!wa["Ideographic Description Characters"](e)||!!wa.Kanbun(e)||!!wa["Kangxi Radicals"](e)||!!wa["Katakana Phonetic Extensions"](e)||!(!wa.Katakana(e)||12540===e)||!(!wa["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!wa["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||!!wa["Unified Canadian Aboriginal Syllabics"](e)||!!wa["Unified Canadian Aboriginal Syllabics Extended"](e)||!!wa["Vertical Forms"](e)||!!wa["Yijing Hexagram Symbols"](e)||!!wa["Yi Syllables"](e)||!!wa["Yi Radicals"](e))}function Ca(e){return!(!wa["Latin-1 Supplement"](e)||167!==e&&169!==e&&174!==e&&177!==e&&188!==e&&189!==e&&190!==e&&215!==e&&247!==e)||!(!wa["General Punctuation"](e)||8214!==e&&8224!==e&&8225!==e&&8240!==e&&8241!==e&&8251!==e&&8252!==e&&8258!==e&&8263!==e&&8264!==e&&8265!==e&&8273!==e)||!!wa["Letterlike Symbols"](e)||!!wa["Number Forms"](e)||!(!wa["Miscellaneous Technical"](e)||!(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215))||!(!wa["Control Pictures"](e)||9251===e)||!!wa["Optical Character Recognition"](e)||!!wa["Enclosed Alphanumerics"](e)||!!wa["Geometric Shapes"](e)||!(!wa["Miscellaneous Symbols"](e)||e>=9754&&e<=9759)||!(!wa["Miscellaneous Symbols and Arrows"](e)||!(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243))||!!wa["CJK Symbols and Punctuation"](e)||!!wa.Katakana(e)||!!wa["Private Use Area"](e)||!!wa["CJK Compatibility Forms"](e)||!!wa["Small Form Variants"](e)||!!wa["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e}function Ea(e){return!(Aa(e)||Ca(e))}function Pa(e){return wa.Arabic(e)||wa["Arabic Supplement"](e)||wa["Arabic Extended-A"](e)||wa["Arabic Presentation Forms-A"](e)||wa["Arabic Presentation Forms-B"](e)}function La(e){return e>=1424&&e<=2303||wa["Arabic Presentation Forms-A"](e)||wa["Arabic Presentation Forms-B"](e)}function Ia(e,t){return!(!t&&La(e))&&!(e>=2304&&e<=3583||e>=3840&&e<=4255||wa.Khmer(e))}function Ra(e){for(var t=0,r=e;t-1&&(Fa=Da.error),za&&za(e)};function Za(){Ba.fire(new at("pluginStateChange",{pluginStatus:Fa,pluginURL:ja}))}var Ba=new st,Va=function(){return Fa},Ua=function(e){return e({pluginStatus:Fa,pluginURL:ja}),Ba.on("pluginStateChange",e),e},Ha=function(e,t,r){if(void 0===r&&(r=!1),Fa===Da.deferred||Fa===Da.loading||Fa===Da.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");ja=q.resolveURL(e),Fa=Da.deferred,za=t,Za(),r||Wa()},Wa=function(){if(Fa!==Da.deferred||!ja)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Fa=Da.loading,Za(),ja&&qe({url:ja},(function(e){e?Na(e):(Fa=Da.loaded,Za())}))},Ga={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Fa===Da.loaded||null!=Ga.applyArabicShaping},isLoading:function(){return Fa===Da.loading},setState:function(e){Fa=e.pluginStatus,ja=e.pluginURL},isParsed:function(){return null!=Ga.applyArabicShaping&&null!=Ga.processBidirectionalText&&null!=Ga.processStyledBidirectionalText},getPluginURL:function(){return ja}},qa=function(){Ga.isLoading()||Ga.isLoaded()||"deferred"!==Va()||Wa()},Ya=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new _a,this.transition={})};Ya.prototype.isSupportedScript=function(e){return Oa(e,Ga.isLoaded())},Ya.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Ya.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Xa=function(e,t){this.property=e,this.value=t,this.expression=mi(void 0===t?e.specification.default:t,e.specification)};Xa.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Xa.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var Ka=function(e){this.property=e,this.value=new Xa(e,void 0)};Ka.prototype.transitioned=function(e,t){return new Ja(this.property,this.value,t,m({},e.transition,this.transition),e.now)},Ka.prototype.untransitioned=function(){return new Ja(this.property,this.value,null,{},0)};var $a=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};$a.prototype.getValue=function(e){return S(this._values[e].value.value)},$a.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ka(this._values[e].property)),this._values[e].value=new Xa(this._values[e].property,null===t?void 0:S(t))},$a.prototype.getTransition=function(e){return S(this._values[e].transition)},$a.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ka(this._values[e].property)),this._values[e].transition=S(t)||void 0},$a.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);tthis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(nn.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},t.prototype.interpolate=function(e){return e},t}(io),oo=function(e){this.specification=e};oo.prototype.possiblyEvaluate=function(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){var i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new Ya(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Ya(Math.floor(t.zoom),t)),e.expression.evaluate(new Ya(Math.floor(t.zoom+1),t)),t)}},oo.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},oo.prototype.interpolate=function(e){return e};var so=function(e){this.specification=e};so.prototype.possiblyEvaluate=function(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)},so.prototype.interpolate=function(){return!1};var lo=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var n=this.defaultPropertyValues[t]=new Xa(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new Ka(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}};va("DataDrivenProperty",io),va("DataConstantProperty",no),va("CrossFadedDataDrivenProperty",ao),va("CrossFadedProperty",oo),va("ColorRampProperty",so);var uo="-transition",co=function(e){function t(t,r){if(e.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new eo(r.layout)),r.paint)){for(var n in this._transitionablePaint=new $a(r.paint),t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ro(r.paint)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".layout."+e;if(this._validate(sa,n,e,t,r))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t},t.prototype.getPaintProperty=function(e){return k(e,uo)?this._transitionablePaint.getTransition(e.slice(0,-uo.length)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".paint."+e;if(this._validate(oa,n,e,t,r))return!1}if(k(e,uo))return this._transitionablePaint.setTransition(e.slice(0,-uo.length),t||void 0),!1;var i=this._transitionablePaint._values[e],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var l=this._transitionablePaint._values[e].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(e,s,l)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype._handleOverridablePaintPropertyUpdate=function(e,t,r){return!1},t.prototype.isHidden=function(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility},t.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)},t.prototype.serialize=function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),M(e,(function(e,t){return void 0!==e&&!("layout"===t&&!Object.keys(e).length)&&!("paint"===t&&!Object.keys(e).length)}))},t.prototype._validate=function(e,t,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&la(this,e.call(ia,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:lt,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof to&&Kn(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1},t}(st),fo={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},po=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},ho=128,vo=5,mo=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function go(e,t){void 0===t&&(t=1);var r=0,n=0;return{members:e.map((function(e){var i=yo(e.type),a=r=xo(r,Math.max(t,i)),o=e.components||1;return n=Math.max(n,i),r+=i*o,{name:e.name,type:e.type,components:o,offset:a}})),size:xo(r,Math.max(n,t)),alignment:t}}function yo(e){return fo[e].BYTES_PER_ELEMENT}function xo(e,t){return Math.ceil(e/t)*t}mo.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},mo.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},mo.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},mo.prototype.clear=function(){this.length=0},mo.prototype.resize=function(e){this.reserve(e),this.length=e},mo.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*vo),ho),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},mo.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var bo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e},t}(mo);bo.prototype.bytesPerElement=4,va("StructArrayLayout2i4",bo);var _o=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e},t}(mo);_o.prototype.bytesPerElement=8,va("StructArrayLayout4i8",_o);var wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(mo);wo.prototype.bytesPerElement=12,va("StructArrayLayout2i4i12",wo);var ko=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,e},t}(mo);ko.prototype.bytesPerElement=8,va("StructArrayLayout2i4ub8",ko);var To=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,u){var c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,a,o,s,l,u)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,u,c){var f=9*e,d=18*e;return this.uint16[f+0]=t,this.uint16[f+1]=r,this.uint16[f+2]=n,this.uint16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.uint8[d+16]=u,this.uint8[d+17]=c,e},t}(mo);To.prototype.bytesPerElement=18,va("StructArrayLayout8ui2ub18",To);var Mo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,u,c,f){var d=this.length;return this.resize(d+1),this.emplace(d,e,t,r,n,i,a,o,s,l,u,c,f)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,u,c,f,d){var p=12*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=u,this.int16[p+9]=c,this.int16[p+10]=f,this.int16[p+11]=d,e},t}(mo);Mo.prototype.bytesPerElement=24,va("StructArrayLayout4i4ui4i24",Mo);var So=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e},t}(mo);So.prototype.bytesPerElement=12,va("StructArrayLayout3f12",So);var Ao=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint32[r+0]=t,e},t}(mo);Ao.prototype.bytesPerElement=4,va("StructArrayLayout1ul4",Ao);var Co=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l){var u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,i,a,o,s,l)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,u){var c=10*e,f=5*e;return this.int16[c+0]=t,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=a,this.int16[c+5]=o,this.uint32[f+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,e},t}(mo);Co.prototype.bytesPerElement=20,va("StructArrayLayout6i1ul2ui20",Co);var Eo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(mo);Eo.prototype.bytesPerElement=12,va("StructArrayLayout2i2i2i12",Eo);var Po=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)},t.prototype.emplace=function(e,t,r,n,i,a){var o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,e},t}(mo);Po.prototype.bytesPerElement=16,va("StructArrayLayout2f1f2i16",Po);var Lo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=12*e,o=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,e},t}(mo);Lo.prototype.bytesPerElement=12,va("StructArrayLayout2ub2f12",Lo);var Io=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e},t}(mo);Io.prototype.bytesPerElement=6,va("StructArrayLayout3ui6",Io);var Ro=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m){var g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m,g){var y=24*e,x=12*e,b=48*e;return this.int16[y+0]=t,this.int16[y+1]=r,this.uint16[y+2]=n,this.uint16[y+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[y+10]=l,this.uint16[y+11]=u,this.uint16[y+12]=c,this.float32[x+7]=f,this.float32[x+8]=d,this.uint8[b+36]=p,this.uint8[b+37]=h,this.uint8[b+38]=v,this.uint32[x+10]=m,this.int16[y+22]=g,e},t}(mo);Ro.prototype.bytesPerElement=48,va("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ro);var Oo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x,b,_,w,k,T,M,S,A){var C=this.length;return this.resize(C+1),this.emplace(C,e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x,b,_,w,k,T,M,S,A)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v,m,g,y,x,b,_,w,k,T,M,S,A,C){var E=34*e,P=17*e;return this.int16[E+0]=t,this.int16[E+1]=r,this.int16[E+2]=n,this.int16[E+3]=i,this.int16[E+4]=a,this.int16[E+5]=o,this.int16[E+6]=s,this.int16[E+7]=l,this.uint16[E+8]=u,this.uint16[E+9]=c,this.uint16[E+10]=f,this.uint16[E+11]=d,this.uint16[E+12]=p,this.uint16[E+13]=h,this.uint16[E+14]=v,this.uint16[E+15]=m,this.uint16[E+16]=g,this.uint16[E+17]=y,this.uint16[E+18]=x,this.uint16[E+19]=b,this.uint16[E+20]=_,this.uint16[E+21]=w,this.uint16[E+22]=k,this.uint32[P+12]=T,this.float32[P+13]=M,this.float32[P+14]=S,this.float32[P+15]=A,this.float32[P+16]=C,e},t}(mo);Oo.prototype.bytesPerElement=68,va("StructArrayLayout8i15ui1ul4f68",Oo);var Do=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.float32[r+0]=t,e},t}(mo);Do.prototype.bytesPerElement=4,va("StructArrayLayout1f4",Do);var zo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e},t}(mo);zo.prototype.bytesPerElement=6,va("StructArrayLayout3i6",zo);var Fo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=2*e,a=4*e;return this.uint32[i+0]=t,this.uint16[a+2]=r,this.uint16[a+3]=n,e},t}(mo);Fo.prototype.bytesPerElement=8,va("StructArrayLayout1ul2ui8",Fo);var jo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e},t}(mo);jo.prototype.bytesPerElement=4,va("StructArrayLayout2ui4",jo);var No=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint16[r+0]=t,e},t}(mo);No.prototype.bytesPerElement=2,va("StructArrayLayout1ui2",No);var Zo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e},t}(mo);Zo.prototype.bytesPerElement=8,va("StructArrayLayout2f8",Zo);var Bo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e},t}(mo);Bo.prototype.bytesPerElement=16,va("StructArrayLayout4f16",Bo);var Vo=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(po);Vo.prototype.size=20;var Uo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Vo(this,e)},t}(Co);va("CollisionBoxArray",Uo);var Ho=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(po);Ho.prototype.size=48;var Wo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Ho(this,e)},t}(Ro);va("PlacedSymbolArray",Wo);var Go=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+12]=e},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(po);Go.prototype.size=68;var qo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Go(this,e)},t}(Oo);va("SymbolInstanceArray",qo);var Yo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t}(Do);va("GlyphOffsetArray",Yo);var Xo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t}(zo);va("SymbolLineVertexArray",Xo);var Ko=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(po);Ko.prototype.size=8;var $o=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Ko(this,e)},t}(Fo);va("FeatureIndexArray",$o);var Jo=go([{name:"a_pos",components:2,type:"Int16"}],4).members,Qo=function(e){void 0===e&&(e=[]),this.segments=e};function es(e,t){return 256*(e=f(Math.floor(e),0,255))+(t=f(Math.floor(t),0,255))}Qo.prototype.prepareSegment=function(e,t,r,n){var i=this.segments[this.segments.length-1];return e>Qo.MAX_VERTEX_ARRAY_LENGTH&&E("Max vertices per segment is "+Qo.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!i||i.vertexLength+e>Qo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Qo.prototype.get=function(){return this.segments},Qo.prototype.destroy=function(){for(var e=0,t=this.segments;e>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}e.exports=t})),ns=t((function(e){function t(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}e.exports=t})),is=rs,as=rs,os=ns;is.murmur3=as,is.murmur2=os;var ss=function(){this.ids=[],this.positions=[],this.indexed=!1};ss.prototype.add=function(e,t,r,n){this.ids.push(us(e)),this.positions.push(t,r,n)},ss.prototype.getPositions=function(e){for(var t=us(e),r=0,n=this.ids.length-1;r>1;this.ids[i]>=t?n=i:r=i+1}for(var a=[];this.ids[r]===t;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},ss.serialize=function(e,t){var r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return cs(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}},ss.deserialize=function(e){var t=new ss;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ls=Math.pow(2,53)-1;function us(e){var t=+e;return!isNaN(t)&&t<=ls?t:is(String(e))}function cs(e,t,r,n){for(;r>1],a=r-1,o=n+1;;){do{a++}while(e[a]i);if(a>=o)break;fs(e,a,o),fs(t,3*a,3*o),fs(t,3*a+1,3*o+1),fs(t,3*a+2,3*o+2)}o-rOs.max||o.yOs.max)&&(E("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=f(o.x,Os.min,Os.max),o.y=f(o.y,Os.min,Os.max))}return r}function zs(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}var Fs=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new bo,this.indexArray=new Io,this.segments=new Qo,this.programConfigurations=new Cs(Jo,e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function js(e,t){for(var r=0;r=3)for(var a=0;a1){if(Us(e,t))return!0;for(var n=0;n1?e.distSqr(r):e.distSqr(r.sub(t)._mult(i)._add(t))}function qs(e,t){for(var r,n,i,a=!1,o=0;ot.y!==i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Ys(e,t){for(var r=!1,n=0,i=e.length-1;nt.y!==o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Xs(e,t,r,n,i){for(var o=0,s=e;o=l.x&&i>=l.y)return!0}var u=[new a(t,r),new a(t,i),new a(n,i),new a(n,r)];if(e.length>2)for(var c=0,f=u;ci.x&&t.x>i.x||e.yi.y&&t.y>i.y)return!1;var a=P(e,t,r[0]);return a!==P(e,t,r[1])||a!==P(e,t,r[2])||a!==P(e,t,r[3])}function $s(e,t,r){var n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Js(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Qs(e,t,r,n,i){if(!t[0]&&!t[1])return e;var o=a.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=Is||c<0||c>=Is)){var f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),d=f.vertexLength;zs(this.layoutVertexArray,u,c,-1,-1),zs(this.layoutVertexArray,u,c,1,-1),zs(this.layoutVertexArray,u,c,1,1),zs(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(d,d+1,d+2),this.indexArray.emplaceBack(d,d+3,d+2),f.vertexLength+=4,f.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)},va("CircleBucket",Fs,{omit:["layers"]});var el=new lo({"circle-sort-key":new io(lt.layout_circle["circle-sort-key"])}),tl={paint:new lo({"circle-radius":new io(lt.paint_circle["circle-radius"]),"circle-color":new io(lt.paint_circle["circle-color"]),"circle-blur":new io(lt.paint_circle["circle-blur"]),"circle-opacity":new io(lt.paint_circle["circle-opacity"]),"circle-translate":new no(lt.paint_circle["circle-translate"]),"circle-translate-anchor":new no(lt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new no(lt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new no(lt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new io(lt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new io(lt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new io(lt.paint_circle["circle-stroke-opacity"])}),layout:el},rl="undefined"!==typeof Float32Array?Float32Array:Array;function nl(){var e=new rl(4);return rl!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function il(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+a*s,e[1]=i*l+o*s,e[2]=n*-s+a*l,e[3]=i*-s+o*l,e}function al(){var e=new rl(9);return rl!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ol(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function sl(){var e=new rl(16);return rl!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function ll(e){var t=new rl(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ul(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function cl(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],f=t[9],d=t[10],p=t[11],h=t[12],v=t[13],m=t[14],g=t[15],y=r*s-n*o,x=r*l-i*o,b=r*u-a*o,_=n*l-i*s,w=n*u-a*s,k=i*u-a*l,T=c*v-f*h,M=c*m-d*h,S=c*g-p*h,A=f*m-d*v,C=f*g-p*v,E=d*g-p*m,P=y*E-x*C+b*A+_*S-w*M+k*T;return P?(P=1/P,e[0]=(s*E-l*C+u*A)*P,e[1]=(i*C-n*E-a*A)*P,e[2]=(v*k-m*w+g*_)*P,e[3]=(d*w-f*k-p*_)*P,e[4]=(l*S-o*E-u*M)*P,e[5]=(r*E-i*S+a*M)*P,e[6]=(m*b-h*k-g*x)*P,e[7]=(c*k-d*b+p*x)*P,e[8]=(o*C-s*S+u*T)*P,e[9]=(n*S-r*C-a*T)*P,e[10]=(h*w-v*b+g*y)*P,e[11]=(f*b-c*w-p*y)*P,e[12]=(s*M-o*A-l*T)*P,e[13]=(r*A-n*M+i*T)*P,e[14]=(v*x-h*_-m*y)*P,e[15]=(c*_-f*x+d*y)*P,e):null}function fl(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],f=t[8],d=t[9],p=t[10],h=t[11],v=t[12],m=t[13],g=t[14],y=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*n+b*s+_*f+w*v,e[1]=x*i+b*l+_*d+w*m,e[2]=x*a+b*u+_*p+w*g,e[3]=x*o+b*c+_*h+w*y,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*n+b*s+_*f+w*v,e[5]=x*i+b*l+_*d+w*m,e[6]=x*a+b*u+_*p+w*g,e[7]=x*o+b*c+_*h+w*y,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*n+b*s+_*f+w*v,e[9]=x*i+b*l+_*d+w*m,e[10]=x*a+b*u+_*p+w*g,e[11]=x*o+b*c+_*h+w*y,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*n+b*s+_*f+w*v,e[13]=x*i+b*l+_*d+w*m,e[14]=x*a+b*u+_*p+w*g,e[15]=x*o+b*c+_*h+w*y,e}function dl(e,t,r){var n,i,a,o,s,l,u,c,f,d,p,h,v=r[0],m=r[1],g=r[2];return t===e?(e[12]=t[0]*v+t[4]*m+t[8]*g+t[12],e[13]=t[1]*v+t[5]*m+t[9]*g+t[13],e[14]=t[2]*v+t[6]*m+t[10]*g+t[14],e[15]=t[3]*v+t[7]*m+t[11]*g+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],f=t[8],d=t[9],p=t[10],h=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=f,e[9]=d,e[10]=p,e[11]=h,e[12]=n*v+s*m+f*g+t[12],e[13]=i*v+l*m+d*g+t[13],e[14]=a*v+u*m+p*g+t[14],e[15]=o*v+c*m+h*g+t[15]),e}function pl(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function hl(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],f=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+u*n,e[5]=o*i+c*n,e[6]=s*i+f*n,e[7]=l*i+d*n,e[8]=u*i-a*n,e[9]=c*i-o*n,e[10]=f*i-s*n,e[11]=d*i-l*n,e}function vl(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],c=t[5],f=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+u*n,e[1]=o*i+c*n,e[2]=s*i+f*n,e[3]=l*i+d*n,e[4]=u*i-a*n,e[5]=c*i-o*n,e[6]=f*i-s*n,e[7]=d*i-l*n,e}function ml(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e}function gl(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*u,e[15]=1,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var yl=fl;function xl(){var e=new rl(3);return rl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function bl(e){var t=new rl(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function _l(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function wl(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function kl(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function Tl(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function Ml(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Sl(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}function Al(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}var Cl=wl;function El(){var e=new rl(4);return rl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Pl(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Ll(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Il(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function Rl(){var e=new rl(2);return rl!=Float32Array&&(e[0]=0,e[1]=0),e}function Ol(e){var t=e[0],r=e[1];return t*t+r*r}xl(),El();var Dl=Ol,zl=(Rl(),function(e){function t(t){e.call(this,t,tl)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new Fs(e)},t.prototype.queryRadius=function(e){var t=e;return $s("circle-radius",this,t)+$s("circle-stroke-width",this,t)+Js(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o,s){for(var l=Qs(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),u=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),c="map"===this.paint.get("circle-pitch-alignment"),f=c?l:jl(l,s),d=c?u*o:u,p=0,h=n;pe.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=e.data,s=t.data,l=0;l80*r){n=a=e[0],i=o=e[1];for(var h=r;ha&&(a=s),l>o&&(o=l);u=0!==(u=Math.max(a-n,o-i))?1/u:0}return ru(d,p,r,n,i,u),p}function eu(e,t,r,n,i){var a,o;if(i===Pu(e,t,r,n)>0)for(a=t;a=t;a-=n)o=Au(a,e[a],e[a+1],o);return o&&xu(o,o.next)&&(Cu(o),o=o.next),o}function tu(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!xu(n,n.next)&&0!==yu(n.prev,n,n.next))n=n.next;else{if(Cu(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function ru(e,t,r,n,i,a,o){if(e){!o&&a&&du(e,n,i,a);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?iu(e,n,i,a):nu(e))t.push(s.i/r),t.push(e.i/r),t.push(l.i/r),Cu(e),e=l.next,u=l.next;else if((e=l)===u){o?1===o?ru(e=au(tu(e),t,r),t,r,n,i,a,2):2===o&&ou(e,t,r,n,i,a):ru(tu(e),t,r,n,i,a,1);break}}}function nu(e){var t=e.prev,r=e,n=e.next;if(yu(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(mu(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&yu(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function iu(e,t,r,n){var i=e.prev,a=e,o=e.next;if(yu(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=hu(s,l,t,r,n),d=hu(u,c,t,r,n),p=e.prevZ,h=e.nextZ;p&&p.z>=f&&h&&h.z<=d;){if(p!==e.prev&&p!==e.next&&mu(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&yu(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,h!==e.prev&&h!==e.next&&mu(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&yu(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;p&&p.z>=f;){if(p!==e.prev&&p!==e.next&&mu(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&yu(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;h&&h.z<=d;){if(h!==e.prev&&h!==e.next&&mu(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&yu(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function au(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!xu(i,a)&&bu(i,n,n.next,a)&&Tu(i,a)&&Tu(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),Cu(n),Cu(n.next),n=e=a),n=n.next}while(n!==e);return tu(n)}function ou(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&gu(o,s)){var l=Su(o,s);return o=tu(o,o.next),l=tu(l,l.next),ru(o,t,r,n,i,a),void ru(l,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function su(e,t,r,n){var i,a,o,s=[];for(i=0,a=t.length;i=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&mu(ar.x||n.x===r.x&&fu(r,n)))&&(r=n,d=l)),n=n.next}while(n!==u);return r}function fu(e,t){return yu(e.prev,e,t.prev)<0&&yu(t.next,e,e.next)<0}function du(e,t,r,n){var i=e;do{null===i.z&&(i.z=hu(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,pu(i)}function pu(e){var t,r,n,i,a,o,s,l,u=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1);return e}function hu(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function vu(e){var t=e,r=e;do{(t.x=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function gu(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!ku(e,t)&&(Tu(e,t)&&Tu(t,e)&&Mu(e,t)&&(yu(e.prev,e,t.prev)||yu(e,t.prev,t))||xu(e,t)&&yu(e.prev,e,e.next)>0&&yu(t.prev,t,t.next)>0)}function yu(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function xu(e,t){return e.x===t.x&&e.y===t.y}function bu(e,t,r,n){var i=wu(yu(e,t,r)),a=wu(yu(e,t,n)),o=wu(yu(r,n,e)),s=wu(yu(r,n,t));return i!==a&&o!==s||!(0!==i||!_u(e,r,t))||!(0!==a||!_u(e,n,t))||!(0!==o||!_u(r,e,n))||!(0!==s||!_u(r,t,n))}function _u(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function wu(e){return e>0?1:e<0?-1:0}function ku(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&bu(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function Tu(e,t){return yu(e.prev,e,e.next)<0?yu(e,t,e.next)>=0&&yu(e,e.prev,t)>=0:yu(e,t,e.prev)<0||yu(e,e.next,t)<0}function Mu(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}function Su(e,t){var r=new Eu(e.i,e.x,e.y),n=new Eu(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Au(e,t,r,n){var i=new Eu(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Cu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Eu(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Pu(e,t,r,n){for(var i=0,a=t,o=r-n;ar;){if(n-r>600){var a=n-r+1,o=t-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Iu(e,t,Math.max(r,Math.floor(t-o*l/a+u)),Math.min(n,Math.floor(t+(a-o)*l/a+u)),i)}var c=e[t],f=r,d=n;for(Ru(e,r,t),i(e[n],c)>0&&Ru(e,r,n);f0;)d--}0===i(e[r],c)?Ru(e,r,d):Ru(e,++d,n),d<=t&&(r=d+1),t<=d&&(n=d-1)}}function Ru(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function Ou(e,t){return et?1:0}function Du(e,t){var r=e.length;if(r<=1)return[e];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=e[i-1].length,r.holes.push(n))}return r},$l.default=Jl;var Nu=500,Zu=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new bo,this.indexArray=new Io,this.indexArray2=new jo,this.programConfigurations=new Cs(Kl,e.layers,e.zoom),this.segments=new Qo,this.segments2=new Qo,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};Zu.prototype.populate=function(e,t,r){this.hasPattern=Fu("fill",this.layers,t);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=e;a>3}if(i--,1===n||2===n)o+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&l.push(t),t=[]),t.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&l.push(t),l},Gu.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;e.pos>3}if(n--,1===r||2===r)(i+=e.readSVarint())s&&(s=i),(a+=e.readSVarint())u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},Gu.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),u=Gu.types[this.type];function c(e){for(var t=0;t>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}function tc(e,t){this.layers=e.readFields(rc,{},t)}function rc(e,t,r){if(3===e){var n=new $u(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}Ju.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Wu(this._pbf,t,this.extent,this._keys,this._values)};var nc={VectorTile:tc,VectorTileFeature:Wu,VectorTileLayer:$u},ic=nc.VectorTileFeature.types,ac=500,oc=Math.pow(2,13);function sc(e,t,r,n,i,a,o,s){e.emplaceBack(t,r,2*Math.floor(n*oc)+o,i*oc*2,a*oc*2,Math.round(s))}var lc=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new wo,this.indexArray=new Io,this.programConfigurations=new Cs(Hu,e.layers,e.zoom),this.segments=new Qo,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function uc(e,t){return e.x===t.x&&(e.x<0||e.x>Is)||e.y===t.y&&(e.y<0||e.y>Is)}function cc(e){return e.every((function(e){return e.x<0}))||e.every((function(e){return e.x>Is}))||e.every((function(e){return e.y<0}))||e.every((function(e){return e.y>Is}))}lc.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=Fu("fill-extrusion",this.layers,t);for(var n=0,i=e;n=1){var y=h[m-1];if(!uc(g,y)){f.vertexLength+4>Qo.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=g.sub(y)._perp()._unit(),b=y.dist(g);v+b>32768&&(v=0),sc(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,v),sc(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,v),v+=b,sc(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,v),sc(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,v);var _=f.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),f.vertexLength+=4,f.primitiveLength+=2}}}}if(f.vertexLength+l>Qo.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===ic[e.type]){for(var w=[],k=[],T=f.vertexLength,M=0,S=s;M=2&&e[l-1].equals(e[l-2]);)l--;for(var u=0;u0;if(k&&g>u){var M=c.dist(p);if(M>2*f){var S=c.sub(c.sub(p)._mult(f/M)._round());this.updateDistance(p,S),this.addCurrentVertex(S,v,0,0,d),p=S}}var A=p&&h,C=A?r:s?"butt":n;if(A&&"round"===C&&(_i&&(C="bevel"),"bevel"===C&&(_>2&&(C="flipbevel"),_100)y=m.mult(-1);else{var E=_*v.add(m).mag()/v.sub(m).mag();y._perp()._mult(E*(T?-1:1))}this.addCurrentVertex(c,y,0,0,d),this.addCurrentVertex(c,y.mult(-1),0,0,d)}else if("bevel"===C||"fakeround"===C){var P=-Math.sqrt(_*_-1),L=T?P:0,I=T?0:P;if(p&&this.addCurrentVertex(c,v,L,I,d),"fakeround"===C)for(var R=Math.round(180*w/Math.PI/kc),O=1;O2*f){var Z=c.add(h.sub(c)._mult(f/N)._round());this.updateDistance(c,Z),this.addCurrentVertex(Z,m,0,0,d),c=Z}}}}},Ac.prototype.addCurrentVertex=function(e,t,r,n,i,a){void 0===a&&(a=!1);var o=t.x+t.y*r,s=t.y-t.x*r,l=-t.x+t.y*n,u=-t.y-t.x*n;this.addHalfVertex(e,o,s,a,!1,r,i),this.addHalfVertex(e,l,u,a,!0,-n,i),this.distance>Sc/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,r,n,i,a))},Ac.prototype.addHalfVertex=function(e,t,r,n,i,a,o){var s=e.x,l=e.y,u=this.scaledDistance*Mc;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(bc*t)+128,Math.round(bc*r)+128,1+(0===a?0:a<0?-1:1)|(63&u)<<2,u>>6);var c=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),o.primitiveLength++),i?this.e2=c:this.e1=c},Ac.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Sc-1):this.distance},Ac.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},va("LineBucket",Ac,{omit:["layers","patternFeatures"]});var Cc=new lo({"line-cap":new no(lt.layout_line["line-cap"]),"line-join":new io(lt.layout_line["line-join"]),"line-miter-limit":new no(lt.layout_line["line-miter-limit"]),"line-round-limit":new no(lt.layout_line["line-round-limit"]),"line-sort-key":new io(lt.layout_line["line-sort-key"])}),Ec={paint:new lo({"line-opacity":new io(lt.paint_line["line-opacity"]),"line-color":new io(lt.paint_line["line-color"]),"line-translate":new no(lt.paint_line["line-translate"]),"line-translate-anchor":new no(lt.paint_line["line-translate-anchor"]),"line-width":new io(lt.paint_line["line-width"]),"line-gap-width":new io(lt.paint_line["line-gap-width"]),"line-offset":new io(lt.paint_line["line-offset"]),"line-blur":new io(lt.paint_line["line-blur"]),"line-dasharray":new oo(lt.paint_line["line-dasharray"]),"line-pattern":new ao(lt.paint_line["line-pattern"]),"line-gradient":new so(lt.paint_line["line-gradient"])}),layout:Cc},Pc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(t,r){return r=new Ya(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),e.prototype.possiblyEvaluate.call(this,t,r)},t.prototype.evaluate=function(t,r,n,i){return r=m({},r,{zoom:Math.floor(r.zoom)}),e.prototype.evaluate.call(this,t,r,n,i)},t}(io),Lc=new Pc(Ec.paint.properties["line-width"].specification);Lc.useIntegerZoom=!0;var Ic=function(e){function t(t){e.call(this,t,Ec)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){"line-gradient"===e&&this._updateGradient()},t.prototype._updateGradient=function(){var e=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Gl(e,"lineProgress"),this.gradientTexture=null},t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r),this.paint._values["line-floorwidth"]=Lc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new Ac(e)},t.prototype.queryRadius=function(e){var t=e,r=Rc($s("line-width",this,t),$s("line-gap-width",this,t)),n=$s("line-offset",this,t);return r/2+Math.abs(n)+Js(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o){var s=Qs(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*Rc(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),u=this.paint.get("line-offset").evaluate(t,r);return u&&(n=Oc(n,u*o)),Bs(s,n,l)},t.prototype.isTileClipped=function(){return!0},t}(co);function Rc(e,t){return t>0?t+2*e:e}function Oc(e,t){for(var r=[],n=new a(0,0),i=0;i":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};function Hc(e){for(var t="",r=0;r>1,c=-7,f=r?i-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},write:function(e,t,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=h,s/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=h,o/=256,u-=8);e[r+p-h]|=128*v}},qc=Yc;function Yc(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Yc.Varint=0,Yc.Fixed64=1,Yc.Bytes=2,Yc.Fixed32=5;var Xc=4294967296,Kc=1/Xc,$c=12,Jc="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function Qc(e,t,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return tf(e,n,t);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return tf(e,n,t);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return tf(e,n,t);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return tf(e,n,t);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return tf(e,n,t);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return tf(e,n,t);throw new Error("Expected varint not more than 10 bytes")}function ef(e){return e.type===Yc.Bytes?e.readVarint()+e.pos:e.pos+1}function tf(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function rf(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),nf(r,n,t),af(n,t)}function nf(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}function af(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}function of(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function sf(e,t){for(var r=0;r>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function yf(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function xf(e,t,r){for(var n="",i=t;i239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128===(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(a=e[i+1],o=e[i+2],128===(192&a)&&128===(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=e[i+1],o=e[i+2],s=e[i+3],128===(192&a)&&128===(192&o)&&128===(192&s)&&((u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c}return n}function bf(e,t,r){return Jc.decode(e.subarray(t,r))}function _f(e,t,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}Yc.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=mf(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=yf(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=mf(this.buf,this.pos)+mf(this.buf,this.pos+4)*Xc;return this.pos+=8,e},readSFixed64:function(){var e=mf(this.buf,this.pos)+yf(this.buf,this.pos+4)*Xc;return this.pos+=8,e},readFloat:function(){var e=Gc.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Gc.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:Qc(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=$c&&Jc?bf(this.buf,t,e):xf(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Yc.Bytes)return e.push(this.readVarint(t));var r=ef(this);for(e=e||[];this.pos127;);else if(t===Yc.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Yc.Fixed32)this.pos+=4;else{if(t!==Yc.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?rf(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=_f(this.buf,e,this.pos);var r=this.pos-t;r>=128&&of(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Gc.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Gc.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&of(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,Yc.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,sf,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,lf,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,ff,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,uf,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,cf,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,df,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,pf,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,hf,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,vf,t)},writeBytesField:function(e,t){this.writeTag(e,Yc.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Yc.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Yc.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Yc.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Yc.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Yc.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Yc.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Yc.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Yc.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Yc.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var wf=3;function kf(e,t,r){1===e&&r.readMessage(Tf,t)}function Tf(e,t,r){if(3===e){var n=r.readMessage(Mf,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,u=n.top,c=n.advance;t.push({id:i,bitmap:new Ul({width:o+2*wf,height:s+2*wf},a),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function Mf(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function Sf(e){return new qc(e).readFields(kf,[])}var Af=wf;function Cf(e){for(var t=0,r=0,n=0,i=e;n=0;d--){var p=o[d];if(!(f.w>p.w||f.h>p.h)){if(f.x=p.x,f.y=p.y,l=Math.max(l,f.y+f.h),s=Math.max(s,f.x+f.w),f.w===p.w&&f.h===p.h){var h=o.pop();d=0&&n>=e&&Vf[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Nf.prototype.substring=function(e,t){var r=new Nf;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Nf.prototype.toString=function(){return this.text},Nf.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},Nf.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(jf.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,n=0;n=Ff?null:++this.imageSectionID:(this.imageSectionID=zf,this.imageSectionID)};var Vf={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Uf={};function Hf(e,t,r,n,i,a){if(t.imageName){var o=n[t.imageName];return o?o.displaySize[0]*t.scale*Wc/a+i:0}var s=r[t.fontStack],l=s&&s[e];return l?l.metrics.advance*t.scale+i:0}function Wf(e,t,r,n,i,a){for(var o=0,s=0;s=0,c=0,f=0;f0&&j>M&&(M=j)}else{var N=r[A.fontStack],Z=N&&N[E];if(Z&&Z.rect)I=Z.rect,L=Z.metrics;else{var B=t[A.fontStack],V=B&&B[E];if(!V)continue;L=V.metrics}P=(_-A.scale)*Wc}D?(e.verticalizable=!0,T.push({glyph:E,imageName:R,x:d,y:p+P,vertical:D,scale:A.scale,fontStack:A.fontStack,sectionIndex:C,metrics:L,rect:I}),d+=O*A.scale+u):(T.push({glyph:E,imageName:R,x:d,y:p+P,vertical:D,scale:A.scale,fontStack:A.fontStack,sectionIndex:C,metrics:L,rect:I}),d+=L.advance*A.scale+u)}if(0!==T.length){var U=d-u;h=Math.max(U,h),Qf(T,0,T.length-1,m,M)}d=0;var H=a*_+M;k.lineOffset=Math.max(M,w),p+=H,v=Math.max(H,v),++g}else p+=a,++g}var W=p-Of,G=$f(o),q=G.horizontalAlign,Y=G.verticalAlign;ed(e.positionedLines,m,q,Y,h,v,a,W,i.length),e.top+=-Y*W,e.bottom=e.top+W,e.left+=-q*h,e.right=e.left+h}function Qf(e,t,r,n,i){if(n||i)for(var a=e[r],o=a.metrics.advance*a.scale,s=(e[r].x+o)*n,l=t;l<=r;l++)e[l].x-=s,e[l].y+=i}function ed(e,t,r,n,i,a,o,s,l){var u=(t-r)*i,c=0;c=a!==o?-s*n-Of:(-n*l+.5)*o;for(var f=0,d=e;f-r/2;){if(--o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;for(var l=[],u=0;sn;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=f.dist(d)}return!0}function cd(e){for(var t=0,r=0;ru){var h=(u-l)/p,v=zr(f.x,d.x,h),m=zr(f.y,d.y,h),g=new nd(v,m,d.angleTo(f),c);return g._round(),!o||ud(e,g,s,o,t)?g:void 0}l+=p}}function hd(e,t,r,n,i,a,o,s,l){var u=fd(n,a,o),c=dd(n,i),f=c*o,d=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-f=0&&b=0&&_=0&&d+u<=c){var w=new nd(b,_,y,h);w._round(),n&&!ud(e,w,a,n,i)||p.push(w)}}f+=g}return s||p.length||o||(p=vd(e,f/2,r,n,i,a,o,!0,l)),p}function md(e,t,r,n,i){for(var o=[],s=0;s=n&&d.x>=n||(f.x>=n?f=new a(n,f.y+(d.y-f.y)*((n-f.x)/(d.x-f.x)))._round():d.x>=n&&(d=new a(n,f.y+(d.y-f.y)*((n-f.x)/(d.x-f.x)))._round()),f.y>=i&&d.y>=i||(f.y>=i?f=new a(f.x+(d.x-f.x)*((i-f.y)/(d.y-f.y)),i)._round():d.y>=i&&(d=new a(f.x+(d.x-f.x)*((i-f.y)/(d.y-f.y)),i)._round()),u&&f.equals(u[u.length-1])||(u=[f],o.push(u)),u.push(d)))))}return o}var gd=Ef;function yd(e,t,r,n){var i=[],o=e.image,s=o.pixelRatio,l=o.paddedRect.w-2*gd,u=o.paddedRect.h-2*gd,c=e.right-e.left,f=e.bottom-e.top,d=o.stretchX||[[0,l]],p=o.stretchY||[[0,u]],h=function(e,t){return e+t[1]-t[0]},v=d.reduce(h,0),m=p.reduce(h,0),g=l-v,y=u-m,x=0,b=v,_=0,w=m,k=0,T=g,M=0,S=y;if(o.content&&n){var A=o.content;x=xd(d,0,A[0]),_=xd(p,0,A[1]),b=xd(d,A[0],A[2]),w=xd(p,A[1],A[3]),k=A[0]-x,M=A[1]-_,T=A[2]-A[0]-b,S=A[3]-A[1]-w}var C=function(n,i,l,u){var d=_d(n.stretch-x,b,c,e.left),p=wd(n.fixed-k,T,n.stretch,v),h=_d(i.stretch-_,w,f,e.top),g=wd(i.fixed-M,S,i.stretch,m),y=_d(l.stretch-x,b,c,e.left),A=wd(l.fixed-k,T,l.stretch,v),C=_d(u.stretch-_,w,f,e.top),E=wd(u.fixed-M,S,u.stretch,m),P=new a(d,h),L=new a(y,h),I=new a(y,C),R=new a(d,C),O=new a(p/s,g/s),D=new a(A/s,E/s),z=t*Math.PI/180;if(z){var F=Math.sin(z),j=Math.cos(z),N=[j,-F,F,j];P._matMult(N),L._matMult(N),R._matMult(N),I._matMult(N)}var Z=n.stretch+n.fixed,B=l.stretch+l.fixed,V=i.stretch+i.fixed,U=u.stretch+u.fixed;return{tl:P,tr:L,bl:R,br:I,tex:{x:o.paddedRect.x+gd+Z,y:o.paddedRect.y+gd+V,w:B-Z,h:U-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:D,minFontScaleX:T/s/c,minFontScaleY:S/s/f,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var E=bd(d,g,v),P=bd(p,y,m),L=0;L0&&(h=Math.max(10,h),this.circleDiameter=h)}else{var v=o.top*s-l,m=o.bottom*s+l,g=o.left*s-l,y=o.right*s+l,x=o.collisionPadding;if(x&&(g-=x[0]*s,v-=x[1]*s,y+=x[2]*s,m+=x[3]*s),c){var b=new a(g,v),_=new a(y,v),w=new a(g,m),k=new a(y,m),T=c*Math.PI/180;b._rotate(T),_._rotate(T),w._rotate(T),k._rotate(T),g=Math.min(b.x,_.x,w.x,k.x),y=Math.max(b.x,_.x,w.x,k.x),v=Math.min(b.y,_.y,w.y,k.y),m=Math.max(b.y,_.y,w.y,k.y)}e.emplaceBack(t.x,t.y,g,v,y,m,r,n,i)}this.boxEndIndex=e.length},Md=function(e,t){if(void 0===e&&(e=[]),void 0===t&&(t=Sd),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Sd(e,t){return et?1:0}function Ad(e,t,r){void 0===t&&(t=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=e[0],u=0;uo)&&(o=c.x),(!u||c.y>s)&&(s=c.y)}var f=o-n,d=s-i,p=Math.min(f,d),h=p/2,v=new Md([],Cd);if(0===p)return new a(n,i);for(var m=n;my.d||!y.d)&&(y=b,r&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-y.d<=t||(h=b.h/2,v.push(new Ed(b.p.x-h,b.p.y-h,h,e)),v.push(new Ed(b.p.x+h,b.p.y-h,h,e)),v.push(new Ed(b.p.x-h,b.p.y+h,h,e)),v.push(new Ed(b.p.x+h,b.p.y+h,h,e)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+y.d)),y.p}function Cd(e,t){return t.max-e.max}function Ed(e,t,r,n){this.p=new a(e,t),this.h=r,this.d=Pd(this.p,n),this.max=this.d+this.h*Math.SQRT2}function Pd(e,t){for(var r=!1,n=1/0,i=0;ie.y!==c.y>e.y&&e.x<(c.x-u.x)*(e.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,Gs(e,u,c))}return(r?1:-1)*Math.sqrt(n)}function Ld(e){for(var t=0,r=0,n=0,i=e[0],a=0,o=i.length,s=o-1;a0&&(this.data[0]=t,this._down(0)),e}},Md.prototype.peek=function(){return this.data[0]},Md.prototype._up=function(e){for(var t=this,r=t.data,n=t.compare,i=r[e];e>0;){var a=e-1>>1,o=r[a];if(n(i,o)>=0)break;r[e]=o,e=a}r[e]=i},Md.prototype._down=function(e){for(var t=this,r=t.data,n=t.compare,i=this.length>>1,a=r[e];e=0)break;r[e]=s,e=o}r[e]=a};var Id=7,Rd=Number.POSITIVE_INFINITY;function Od(e,t){function r(e,t){var r=0,n=0;t<0&&(t=0);var i=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":n=i-Id;break;case"bottom-right":case"bottom-left":n=-i+Id;break;case"bottom":n=-t+Id;break;case"top":n=t-Id}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}function n(e,t,r){var n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-Id;break;case"bottom-right":case"bottom-left":case"bottom":i=-r+Id}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}return t[1]!==Rd?n(e,t[0],t[1]):r(e,t[0])}function Dd(e,t,r,n,i,a,o){e.createArrays();var s=512*e.overscaling;e.tilePixelRatio=Is/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,u=e.layers[0]._unevaluatedLayout._values,c={};if("composite"===e.textSizeData.kind){var f=e.textSizeData,d=f.minZoom,p=f.maxZoom;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new Ya(d),o),u["text-size"].possiblyEvaluate(new Ya(p),o)]}if("composite"===e.iconSizeData.kind){var h=e.iconSizeData,v=h.minZoom,m=h.maxZoom;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new Ya(v),o),u["icon-size"].possiblyEvaluate(new Ya(m),o)]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new Ya(e.zoom+1),o),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new Ya(e.zoom+1),o),c.textMaxSize=u["text-size"].possiblyEvaluate(new Ya(18));for(var g=l.get("text-line-height")*Wc,y="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),b=l.get("text-size"),_=function(){var a=k[w],s=l.get("text-font").evaluate(a,{},o).join(","),u=b.evaluate(a,{},o),f=c.layoutTextSize.evaluate(a,{},o),d=c.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},h=a.text,v=[0,0];if(h){var m=h.toString(),_=l.get("text-letter-spacing").evaluate(a,{},o)*Wc,T=Ta(m)?_:0,M=l.get("text-anchor").evaluate(a,{},o),S=l.get("text-variable-anchor");if(!S){var A=l.get("text-radial-offset").evaluate(a,{},o);v=A?Od(M,[A*Wc,Rd]):l.get("text-offset").evaluate(a,{},o).map((function(e){return e*Wc}))}var C=y?"center":l.get("text-justify").evaluate(a,{},o),P=l.get("symbol-placement"),L="point"===P?l.get("text-max-width").evaluate(a,{},o)*Wc:0,I=function(){e.allowVerticalPlacement&&ka(m)&&(p.vertical=Bf(h,t,r,i,s,L,g,M,"left",T,v,Rf.vertical,!0,P,f,u))};if(!y&&S){for(var R="auto"===C?S.map((function(e){return zd(e)})):[C],O=!1,D=0;D=Is||f.y<0||f.y>=Is||Vd(e,f,s,r,n,i,d,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,y,w,M,l,b,k,S,h,t,a,u,c,o)};if("line"===A)for(var L=0,I=md(t.geometry,0,0,Is,Is);L1){var Z=pd(N,T,r.vertical||v,n,m,x);Z&&P(N,Z)}}else if("Polygon"===t.type)for(var B=0,V=Du(t.geometry,0);BNd&&E(e.layerIds[0]+': Value for "text-size" is >= '+jd+'. Reduce your "text-size".'):"composite"===m.kind&&((g=[id*p.compositeTextSizes[0].evaluate(o,{},h),id*p.compositeTextSizes[1].evaluate(o,{},h)])[0]>Nd||g[1]>Nd)&&E(e.layerIds[0]+': Value for "text-size" is >= '+jd+'. Reduce your "text-size".'),e.addSymbols(e.text,v,g,s,a,o,u,t,l.lineStartIndex,l.lineLength,d,h);for(var y=0,x=c;yNd&&E(e.layerIds[0]+': Value for "icon-size" is >= '+jd+'. Reduce your "icon-size".'):"composite"===Y.kind&&((X=[id*_.compositeIconSizes[0].evaluate(b,{},k),id*_.compositeIconSizes[1].evaluate(b,{},k)])[0]>Nd||X[1]>Nd)&&E(e.layerIds[0]+': Value for "icon-size" is >= '+jd+'. Reduce your "icon-size".'),e.addSymbols(e.icon,G,X,x,y,b,!1,t,L.lineStartIndex,L.lineLength,-1,k),z=e.icon.placedSymbolArray.length-1,q&&(R=4*q.length,e.addSymbols(e.icon,q,X,x,y,b,Rf.vertical,t,L.lineStartIndex,L.lineLength,-1,k),F=e.icon.placedSymbolArray.length-1)}for(var K in n.horizontal){var $=n.horizontal[K];if(!S){N=is($.text);var J=s.layout.get("text-rotate").evaluate(b,{},k);S=new Td(l,t,u,c,f,$,d,p,h,J)}var Q=1===$.positionedLines.length;if(O+=Zd(e,t,$,a,s,h,b,v,L,n.vertical?Rf.horizontal:Rf.horizontalOnly,Q?Object.keys(n.horizontal):[K],j,z,_,k),Q)break}n.vertical&&(D+=Zd(e,t,n.vertical,a,s,h,b,v,L,Rf.vertical,["vertical"],j,F,_,k));var ee=S?S.boxStartIndex:e.collisionBoxArray.length,te=S?S.boxEndIndex:e.collisionBoxArray.length,re=C?C.boxStartIndex:e.collisionBoxArray.length,ne=C?C.boxEndIndex:e.collisionBoxArray.length,ie=A?A.boxStartIndex:e.collisionBoxArray.length,ae=A?A.boxEndIndex:e.collisionBoxArray.length,oe=P?P.boxStartIndex:e.collisionBoxArray.length,se=P?P.boxEndIndex:e.collisionBoxArray.length,le=-1,ue=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};le=ue(S,le),le=ue(C,le),le=ue(A,le);var ce=(le=ue(P,le))>-1?1:0;ce&&(le*=T/Wc),e.glyphOffsetArray.length>=$d.MAX_GLYPHS&&E("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,j.right>=0?j.right:-1,j.center>=0?j.center:-1,j.left>=0?j.left:-1,j.vertical||-1,z,F,N,ee,te,re,ne,ie,ae,oe,se,u,O,D,I,R,ce,0,d,Z,B,le)}function Ud(e,t,r,n){var i=e.compareText;if(t in i){for(var a=i[t],o=a.length-1;o>=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],l||u){for(var f=t.iconDependencies,d=t.glyphDependencies,p=t.availableImages,h=new Ya(this.zoom),v=0,m=e;v=0;for(var R=0,O=T.sections;R=0;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=t[s-1].dist(t[s]));for(var l=0;l0},$d.prototype.hasIconData=function(){return this.icon.segments.get().length>0},$d.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},$d.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},$d.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},$d.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(e)===r&&t.addIndicesForPlacedSymbol(t.text,e)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},va("SymbolBucket",$d,{omit:["layers","collisionBoxArray","features","compareText"]}),$d.MAX_GLYPHS=65535,$d.addDynamicAttributes=qd;var Qd=new lo({"symbol-placement":new no(lt.layout_symbol["symbol-placement"]),"symbol-spacing":new no(lt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new no(lt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new io(lt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new no(lt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new no(lt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new no(lt.layout_symbol["icon-ignore-placement"]),"icon-optional":new no(lt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new no(lt.layout_symbol["icon-rotation-alignment"]),"icon-size":new io(lt.layout_symbol["icon-size"]),"icon-text-fit":new no(lt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new no(lt.layout_symbol["icon-text-fit-padding"]),"icon-image":new io(lt.layout_symbol["icon-image"]),"icon-rotate":new io(lt.layout_symbol["icon-rotate"]),"icon-padding":new no(lt.layout_symbol["icon-padding"]),"icon-keep-upright":new no(lt.layout_symbol["icon-keep-upright"]),"icon-offset":new io(lt.layout_symbol["icon-offset"]),"icon-anchor":new io(lt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new no(lt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new no(lt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new no(lt.layout_symbol["text-rotation-alignment"]),"text-field":new io(lt.layout_symbol["text-field"]),"text-font":new io(lt.layout_symbol["text-font"]),"text-size":new io(lt.layout_symbol["text-size"]),"text-max-width":new io(lt.layout_symbol["text-max-width"]),"text-line-height":new no(lt.layout_symbol["text-line-height"]),"text-letter-spacing":new io(lt.layout_symbol["text-letter-spacing"]),"text-justify":new io(lt.layout_symbol["text-justify"]),"text-radial-offset":new io(lt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new no(lt.layout_symbol["text-variable-anchor"]),"text-anchor":new io(lt.layout_symbol["text-anchor"]),"text-max-angle":new no(lt.layout_symbol["text-max-angle"]),"text-writing-mode":new no(lt.layout_symbol["text-writing-mode"]),"text-rotate":new io(lt.layout_symbol["text-rotate"]),"text-padding":new no(lt.layout_symbol["text-padding"]),"text-keep-upright":new no(lt.layout_symbol["text-keep-upright"]),"text-transform":new io(lt.layout_symbol["text-transform"]),"text-offset":new io(lt.layout_symbol["text-offset"]),"text-allow-overlap":new no(lt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new no(lt.layout_symbol["text-ignore-placement"]),"text-optional":new no(lt.layout_symbol["text-optional"])}),ep={paint:new lo({"icon-opacity":new io(lt.paint_symbol["icon-opacity"]),"icon-color":new io(lt.paint_symbol["icon-color"]),"icon-halo-color":new io(lt.paint_symbol["icon-halo-color"]),"icon-halo-width":new io(lt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new io(lt.paint_symbol["icon-halo-blur"]),"icon-translate":new no(lt.paint_symbol["icon-translate"]),"icon-translate-anchor":new no(lt.paint_symbol["icon-translate-anchor"]),"text-opacity":new io(lt.paint_symbol["text-opacity"]),"text-color":new io(lt.paint_symbol["text-color"],{runtimeType:bt,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new io(lt.paint_symbol["text-halo-color"]),"text-halo-width":new io(lt.paint_symbol["text-halo-width"]),"text-halo-blur":new io(lt.paint_symbol["text-halo-blur"]),"text-translate":new no(lt.paint_symbol["text-translate"]),"text-translate-anchor":new no(lt.paint_symbol["text-translate-anchor"])}),layout:Qd},tp=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:mt,this.defaultValue=e};tp.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},tp.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},tp.prototype.outputDefined=function(){return!1},tp.prototype.serialize=function(){return null},va("FormatSectionOverride",tp,{omit:["defaultValue"]});var rp=function(e){function t(t){e.call(this,t,ep)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){if(e.prototype.recalculate.call(this,t,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},yp.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(""===t.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else R()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},yp.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},yp.prototype.processTask=function(e,t){var r=this;if(""===t.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n(ba(t.error)):n(null,ba(t.data)))}else{var i=!1,a=z(this.globalScope)?void 0:[],o=t.hasCallback?function(t,n){i=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"",sourceMapId:r.mapId,error:t?xa(t):null,data:xa(n,a)},a)}:function(e){i=!0},s=null,l=ba(t.data);if(this.parent[t.type])s=this.parent[t.type](t.sourceMapId,l,o);else if(this.parent.getWorkerSource){var u=t.type.split(".");s=this.parent.getWorkerSource(t.sourceMapId,u[0],l.source)[u[1]](l,o)}else o(new Error("Could not find function "+t.type));!i&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}},yp.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var _p=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};_p.prototype.setNorthEast=function(e){return this._ne=e instanceof kp?new kp(e.lng,e.lat):kp.convert(e),this},_p.prototype.setSouthWest=function(e){return this._sw=e instanceof kp?new kp(e.lng,e.lat):kp.convert(e),this},_p.prototype.extend=function(e){var t,r,n=this._sw,i=this._ne;if(e instanceof kp)t=e,r=e;else{if(!(e instanceof _p)){if(Array.isArray(e)){if(4===e.length||e.every(Array.isArray)){var a=e;return this.extend(_p.convert(a))}var o=e;return this.extend(kp.convert(o))}return this}if(t=e._sw,r=e._ne,!t||!r)return this}return n||i?(n.lng=Math.min(t.lng,n.lng),n.lat=Math.min(t.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new kp(t.lng,t.lat),this._ne=new kp(r.lng,r.lat)),this},_p.prototype.getCenter=function(){return new kp((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},_p.prototype.getSouthWest=function(){return this._sw},_p.prototype.getNorthEast=function(){return this._ne},_p.prototype.getNorthWest=function(){return new kp(this.getWest(),this.getNorth())},_p.prototype.getSouthEast=function(){return new kp(this.getEast(),this.getSouth())},_p.prototype.getWest=function(){return this._sw.lng},_p.prototype.getSouth=function(){return this._sw.lat},_p.prototype.getEast=function(){return this._ne.lng},_p.prototype.getNorth=function(){return this._ne.lat},_p.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},_p.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},_p.prototype.isEmpty=function(){return!(this._sw&&this._ne)},_p.prototype.contains=function(e){var t=kp.convert(e),r=t.lng,n=t.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},_p.convert=function(e){return!e||e instanceof _p?e:new _p(e)};var wp=6371008.8,kp=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};kp.prototype.wrap=function(){return new kp(d(this.lng,-180,180),this.lat)},kp.prototype.toArray=function(){return[this.lng,this.lat]},kp.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},kp.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return wp*Math.acos(Math.min(i,1))},kp.prototype.toBounds=function(e){void 0===e&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new _p(new kp(this.lng-r,this.lat-t),new kp(this.lng+r,this.lat+t))},kp.convert=function(e){if(e instanceof kp)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new kp(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"===typeof e&&null!==e)return new kp(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Tp=2*Math.PI*wp;function Mp(e){return Tp*Math.cos(e*Math.PI/180)}function Sp(e){return(180+e)/360}function Ap(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Cp(e,t){return e/Mp(t)}function Ep(e){return 360*e-180}function Pp(e){var t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function Lp(e,t){return e*Mp(Pp(t))}function Ip(e){return 1/Math.cos(e*Math.PI/180)}var Rp=function(e,t,r){void 0===r&&(r=0),this.x=+e,this.y=+t,this.z=+r};Rp.fromLngLat=function(e,t){void 0===t&&(t=0);var r=kp.convert(e);return new Rp(Sp(r.lng),Ap(r.lat),Cp(t,r.lat))},Rp.prototype.toLngLat=function(){return new kp(Ep(this.x),Pp(this.y))},Rp.prototype.toAltitude=function(){return Lp(this.z,this.y)},Rp.prototype.meterInMercatorCoordinateUnits=function(){return 1/Tp*Ip(Pp(this.y))};var Op=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Fp(0,e,e,t,r)};Op.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Op.prototype.url=function(e,t){var r=xp(this.x,this.y,this.z),n=jp(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)},Op.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new a((e.x*t-this.x)*Is,(e.y*t-this.y)*Is)},Op.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Dp=function(e,t){this.wrap=e,this.canonical=t,this.key=Fp(e,t.z,t.z,t.x,t.y)},zp=function(e,t,r,n,i){this.overscaledZ=e,this.wrap=t,this.canonical=new Op(r,+n,+i),this.key=Fp(t,e,r,n,i)};function Fp(e,t,r,n,i){(e*=2)<0&&(e=-1*e-1);var a=1<0;a--)i+=(t&(n=1<this.canonical.z?new zp(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new zp(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},zp.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Fp(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Fp(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},zp.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t},zp.prototype.children=function(e){if(this.overscaledZ>=e)return[new zp(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new zp(t,this.wrap,t,r,n),new zp(t,this.wrap,t,r+1,n),new zp(t,this.wrap,t,r,n+1),new zp(t,this.wrap,t,r+1,n+1)]},zp.prototype.isLessThan=function(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Np.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Np.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Np.prototype.getPixels=function(){return new Hl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Np.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var n=t*this.dim,i=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-t*this.dim,l=-r*this.dim,u=a;u=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}},Wp.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new nc.VectorTile(new qc(this.rawTileData)).layers,this.sourceLayerCoder=new Bp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Wp.prototype.query=function(e,t,r,n){var i=this;this.loadVTLayers();for(var a=e.params||{},o=Is/e.tileSize/e.scale,s=Pi(a.filter),l=e.queryGeometry,u=e.queryPadding*o,c=qp(l),f=this.grid.query(c.minX-u,c.minY-u,c.maxX+u,c.maxY+u),d=qp(e.cameraQueryGeometry),p=0,h=this.grid3D.query(d.minX-u,d.minY-u,d.maxX+u,d.maxY+u,(function(t,r,n,i){return Xs(e.cameraQueryGeometry,t-u,r-u,n+u,i+u)}));pn)i=!1;else if(t)if(this.expirationTime=C.maxzoom||"none"!==C.visibility&&(l(A,this.zoom,n),(v[C.id]=C.createBucket({index:c.bucketLayerIDs.length,layers:A,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(_,m,this.tileID.canonical),c.bucketLayerIDs.push(A.map((function(e){return e.id}))))}}}var E=e.mapObject(m.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(E).length?i.send("getGlyphs",{uid:this.uid,stacks:E},(function(e,t){f||(f=e,d=t,I.call(s))})):d={};var P=Object.keys(m.iconDependencies);P.length?i.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){f||(f=e,p=t,I.call(s))})):p={};var L=Object.keys(m.patternDependencies);function I(){if(f)return a(f);if(d&&p&&h){var t=new o(d),r=new e.ImageAtlas(p,h);for(var i in v){var s=v[i];s instanceof e.SymbolBucket?(l(s.layers,this.zoom,n),e.performSymbolLayout(s,d,t.positions,p,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):s.hasPattern&&(s instanceof e.LineBucket||s instanceof e.FillBucket||s instanceof e.FillExtrusionBucket)&&(l(s.layers,this.zoom,n),s.addFeatures(m,this.tileID.canonical,r.patternPositions))}this.status="done",a(null,{buckets:e.values(v).filter((function(e){return!e.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?t.positions:null})}}L.length?i.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){f||(f=e,h=t,I.call(s))})):h={},I.call(this)};var c=function(e,t,r,n){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=n||u,this.loading={},this.loaded={}};c.prototype.loadTile=function(t,r){var n=this,i=t.uid;this.loading||(this.loading={});var a=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),o=this.loading[i]=new s(t);o.abort=this.loadVectorData(t,(function(t,s){if(delete n.loading[i],t||!s)return o.status="done",n.loaded[i]=o,r(t);var l=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl);var c={};if(a){var f=a.finish();f&&(c.resourceTiming=JSON.parse(JSON.stringify(f)))}o.vectorTile=s.vectorTile,o.parse(s.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(t,n){if(t||!n)return r(t);r(null,e.extend({rawTileData:l.slice(0)},n,u,c))})),n.loaded=n.loaded||{},n.loaded[i]=o}))},c.prototype.reloadTile=function(e,t){var r=this,n=this.loaded,i=e.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),t(e,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},c.prototype.abortTile=function(e,t){var r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),t()},c.prototype.removeTile=function(e,t){var r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t()};var f=e.window.ImageBitmap,d=function(){this.loaded={}};d.prototype.loadTile=function(t,r){var n=t.uid,i=t.encoding,a=t.rawImageData,o=f&&a instanceof f?this.getImageData(a):a,s=new e.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},d.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)},d.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]};var p=h;function h(e,t){var r,n=e&&e.type;if("FeatureCollection"===n)for(r=0;r=0!==!!t&&e.reverse()}var g=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,y=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};y.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,n=this._feature.geometry;r>31}function z(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,a=0,o=r.length,s=0;s>1;N(e,t,o,n,i,a%2),j(e,t,r,n,o-1,a+1),j(e,t,r,o+1,i,a+1)}}function N(e,t,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);N(e,t,r,Math.max(n,Math.floor(r-s*u/o+c)),Math.min(i,Math.floor(r+(o-s)*u/o+c)),a)}var f=t[2*r+a],d=n,p=i;for(Z(e,t,n,r),t[2*i+a]>f&&Z(e,t,n,i);df;)p--}t[2*n+a]===f?Z(e,t,n,p):Z(e,t,++p,i),p<=r&&(n=p+1),r<=p&&(i=p-1)}}function Z(e,t,r,n){B(e,r,n),B(t,2*r,2*n),B(t,2*r+1,2*n+1)}function B(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function V(e,t,r,n,i,a,o){for(var s,l,u=[0,e.length-1,0],c=[];u.length;){var f=u.pop(),d=u.pop(),p=u.pop();if(d-p<=o)for(var h=p;h<=d;h++)s=t[2*h],l=t[2*h+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(e[h]);else{var v=Math.floor((p+d)/2);s=t[2*v],l=t[2*v+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(e[v]);var m=(f+1)%2;(0===f?r<=s:n<=l)&&(u.push(p),u.push(v-1),u.push(m)),(0===f?i>=s:a>=l)&&(u.push(v+1),u.push(d),u.push(m))}}return c}function U(e,t,r,n,i,a){for(var o=[0,e.length-1,0],s=[],l=i*i;o.length;){var u=o.pop(),c=o.pop(),f=o.pop();if(c-f<=a)for(var d=f;d<=c;d++)H(t[2*d],t[2*d+1],r,n)<=l&&s.push(e[d]);else{var p=Math.floor((f+c)/2),h=t[2*p],v=t[2*p+1];H(h,v,r,n)<=l&&s.push(e[p]);var m=(u+1)%2;(0===u?r-i<=h:n-i<=v)&&(o.push(f),o.push(p-1),o.push(m)),(0===u?r+i>=h:n+i>=v)&&(o.push(p+1),o.push(c),o.push(m))}}return s}function H(e,t,r,n){var i=e-r,a=t-n;return i*i+a*a}T.fromVectorTileJs=M,T.fromGeojsonVt=S,T.GeoJSONWrapper=A;var W=function(e){return e[0]},G=function(e){return e[1]},q=function(e,t,r,n,i){void 0===t&&(t=W),void 0===r&&(r=G),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=e;for(var a=e.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(e.length),s=this.coords=new i(2*e.length),l=0;l=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return ie(ie({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function ee(e){return e/360+.5}function te(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function re(e){return 360*(e-.5)}function ne(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function ie(e,t){for(var r in t)e[r]=t[r];return e}function ae(e){return e.x}function oe(e){return e.y}function se(e,t,r,n){for(var i,a=n,o=r-t>>1,s=r-t,l=e[t],u=e[t+1],c=e[r],f=e[r+1],d=t+3;da)i=d,a=p;else if(p===a){var h=Math.abs(d-o);hn&&(i-t>3&&se(e,t,i,n),e[i+2]=a,r-i>3&&se(e,i,r,n))}function le(e,t,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((e-r)*o+(t-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=e-r)*o+(s=t-n)*s}function ue(e,t,r,n){var i={id:"undefined"===typeof e?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return ce(i),i}function ce(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)fe(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*u-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(u-a,2))),i=l,a=u}var c=t.length-3;t[2]=1,se(t,0,c,r),t[c+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function me(e,t,r,n){for(var i=0;i1?1:r}function xe(e,t,r,n,i,a,o,s){if(n/=t,a>=(r/=t)&&o=n)return null;for(var l=[],u=0;u=r&&h=n)){var v=[];if("Point"===d||"MultiPoint"===d)be(f,v,r,n,i);else if("LineString"===d)_e(f,v,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===d)ke(f,v,r,n,i,!1);else if("Polygon"===d)ke(f,v,r,n,i,!0);else if("MultiPolygon"===d)for(var m=0;m=r&&o<=n&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function _e(e,t,r,n,i,a,o){for(var s,l,u=we(e),c=0===i?Me:Se,f=e.start,d=0;dr&&(l=c(u,p,h,m,g,r),o&&(u.start=f+s*l)):y>n?x=r&&(l=c(u,p,h,m,g,r),b=!0),x>n&&y<=n&&(l=c(u,p,h,m,g,n),b=!0),!a&&b&&(o&&(u.end=f+s*l),t.push(u),u=we(e)),o&&(f+=s)}var _=e.length-3;p=e[_],h=e[_+1],v=e[_+2],(y=0===i?p:h)>=r&&y<=n&&Te(u,p,h,v),_=u.length-3,a&&_>=3&&(u[_]!==u[0]||u[_+1]!==u[1])&&Te(u,u[0],u[1],u[2]),u.length&&t.push(u)}function we(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ke(e,t,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=c),f>o.maxY&&(o.maxY=f)}return o}function Re(e,t,r,n){var i=t.geometry,a=t.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&t.size<(i?o:n))r.numPoints+=t.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;i&&De(s,a),e.push(s)}}function De(e,t){for(var r=0,n=0,i=e.length,a=i-2;n0===t)for(n=0,i=e.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=de(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=Ae(n,t)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function je(e,t,r){return 32*((1<=n;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new q(s,ae,oe,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},X.prototype.getClusters=function(e,t){var r=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],t),s=this.getClusters([-180,n,i,a],t);return o.concat(s)}for(var l=this.trees[this._limitZoom(t)],u=[],c=0,f=l.range(ee(r),te(a),ee(i),te(n));c1?this._map(u,!0):null,m=(l<<5)+(t+1)+this.points.length,g=0,y=f;g>5},X.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},X.prototype._map=function(e,t){if(e.numPoints)return t?ie({},e.properties):e.properties;var r=this.points[e.index].properties,n=this.options.map(r);return t&&n===r?ie({},n):n},Fe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Fe.prototype.splitTile=function(e,t,r,n,i,a,o){for(var s=[e,t,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var c=1<1&&console.time("creation"),d=this.tiles[f]=Ie(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var p="z"+t;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(d.source=e,i){if(t===l.maxZoom||t===i)continue;var h=1<1&&console.time("clipping");var v,m,g,y,x,b,_=.5*l.buffer/l.extent,w=.5-_,k=.5+_,T=1+_;v=m=g=y=null,x=xe(e,c,r-_,r+k,0,d.minX,d.maxX,l),b=xe(e,c,r+w,r+T,0,d.minX,d.maxX,l),e=null,x&&(v=xe(x,c,n-_,n+k,1,d.minY,d.maxY,l),m=xe(x,c,n+w,n+T,1,d.minY,d.maxY,l),x=null),b&&(g=xe(b,c,n-_,n+k,1,d.minY,d.maxY,l),y=xe(b,c,n+w,n+T,1,d.minY,d.maxY,l),b=null),u>1&&console.timeEnd("clipping"),s.push(v||[],t+1,2*r,2*n),s.push(m||[],t+1,2*r,2*n+1),s.push(g||[],t+1,2*r+1,2*n),s.push(y||[],t+1,2*r+1,2*n+1)}}},Fe.prototype.getTile=function(e,t,r){var n=this.options,i=n.extent,a=n.debug;if(e<0||e>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,u=e,c=t,f=r;!l&&u>0;)u--,c=Math.floor(c/2),f=Math.floor(f/2),l=this.tiles[je(u,c,f)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",u,c,f),a>1&&console.time("drilling down"),this.splitTile(l.source,u,c,f,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?Pe(this.tiles[s],i):null):null};var Be=function(t){function r(e,r,n,i){t.call(this,e,r,n,Ze),i&&(this.loadGeoJSON=i)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new e.RequestPerformance(n.request);this.loadGeoJSON(n,(function(e,a){if(e||!a)return r(e);if("object"!==typeof a)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));p(a,!0);try{t._geoJSONIndex=n.cluster?new X(Ve(n)).load(a.features):ze(a,n.geojsonVtOptions)}catch(e){return r(e)}t.loaded={};var o={};if(i){var s=i.finish();s&&(o.resourceTiming={},o.resourceTiming[n.source]=JSON.parse(JSON.stringify(s)))}r(null,o)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(e,r){var n=this.loaded,i=e.uid;return n&&n[i]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},r.prototype.loadGeoJSON=function(t,r){if(t.request)e.getJSON(t.request,r);else{if("string"!==typeof t.data)return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(t.data))}catch(n){return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()},r.prototype.getClusterExpansionZoom=function(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(r){t(r)}},r.prototype.getClusterChildren=function(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(r){t(r)}},r.prototype.getClusterLeaves=function(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(r){t(r)}},r}(c);function Ve(t){var r=t.superclusterOptions,n=t.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),u=0,c=l;u1?"@2x":"",l=e.getJSON(r.transformRequest(r.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),(function(e,t){l=null,o||(o=e,i=t,c())})),u=e.getImage(r.transformRequest(r.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),(function(e,t){u=null,o||(o=e,a=t,c())}));function c(){if(o)n(o);else if(i&&a){var t=e.browser.getImageData(a),r={};for(var s in i){var l=i[s],u=l.width,c=l.height,f=l.x,d=l.y,p=l.sdf,h=l.pixelRatio,v=l.stretchX,m=l.stretchY,g=l.content,y=new e.RGBAImage({width:u,height:c});e.RGBAImage.copy(t,y,{x:f,y:d},{x:0,y:0},{width:u,height:c}),r[s]={data:y,pixelRatio:h,sdf:p,stretchX:v,stretchY:m,content:g}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}function d(e){var t=e.userImage;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}r.suppressClick=function(){e.window.addEventListener("click",c,!0),e.window.setTimeout((function(){e.window.removeEventListener("click",c,!0)}),0)},r.mousePos=function(t,r){var n=t.getBoundingClientRect();return new e.Point(r.clientX-n.left-t.clientLeft,r.clientY-n.top-t.clientTop)},r.touchPos=function(t,r){for(var n=t.getBoundingClientRect(),i=[],a=0;a=0?0:t.button},r.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var p=1,h=function(t){function r(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,r=this.requestors;t=0?1.2:1))}function b(e,t,r,n,i,a,o){for(var s=0;s65535)t(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])t(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],w.loadGlyphRange(r,s,n.url,n.requestManager,(function(e,t){if(t){for(var r in t)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=t[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=e[++s]);var c=Math.abs(u-l.left),f=Math.abs(u-l.right),d=Math.min(c,f),p=void 0,h=i/r*(n+1);if(l.isDash){var v=n-Math.abs(h);p=Math.sqrt(d*d+v*v)}else p=n-Math.sqrt(d*d+h*h);this.data[o+u]=Math.max(0,Math.min(255,p+128))}},A.prototype.addRegularDash=function(e){for(var t=e.length-1;t>=0;--t){var r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}var i=e[0],a=e[e.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=e[s],u=0;u1&&(l=e[++s]);var c=Math.abs(u-l.left),f=Math.abs(u-l.right),d=Math.min(c,f),p=l.isDash?d:-d;this.data[o+u]=Math.max(0,Math.min(255,p+128))}},A.prototype.addDash=function(t,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n.minX&&t.x=n.minY&&t.y0&&(l[new e.OverscaledTileID(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new e.Event("data",n))}}))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setData=function(t){var r=this;return this._data=t,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)r.fire(new e.ErrorEvent(t));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new e.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this},r.prototype.getClusterChildren=function(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this},r.prototype.getClusterLeaves=function(e,t,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:r},n),this},r.prototype._updateWorkerData=function(t){var r=this;this._loaded=!1;var n=e.extend({},this.workerOptions),i=this._data;"string"===typeof i?(n.request=this.map._requestManager.transformRequest(e.browser.resolveURL(i),e.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(e,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),t(e))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(t,r){var n=this,i=t.actor?"reloadTile":"loadTile";t.actor=this.actor;var a={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(i,a,(function(e,a){return delete t.request,t.unloadVectorData(),t.aborted?r(null):e?r(e):(t.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0},r.prototype.unloadTile=function(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(e.Evented),D=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),z=function(t){function r(e,r,n,i){t.call(this),this.id=e,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(t,r){var n=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new e.ErrorEvent(i)):a&&(n.image=a,t&&(n.coordinates=t),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(e){var t=this;return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,(function(){t.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setCoordinates=function(t){var r=this;this.coordinates=t;var n=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=F(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map((function(e){return r.tileID.getTilePoint(e)._round()}));return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,D.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.loadTile=function(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(e.Evented);function F(t){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=t;or.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=t}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,D.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(z),N=function(t){function r(r,n,i,a){t.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(e){return!Array.isArray(e)||2!==e.length||e.some((function(e){return"number"!==typeof e}))}))||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!==typeof n.animate&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"===typeof n.canvas||n.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,D.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var e=0,t=[this.canvas.width,this.canvas.height];ethis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},$.prototype.has=function(e){return e.wrapped().key in this.data},$.prototype.getAndRemove=function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null},$.prototype._getAndRemoveByKey=function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value},$.prototype.getByKey=function(e){var t=this.data[e];return t?t[0].value:null},$.prototype.get=function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null},$.prototype.remove=function(e,t){if(!this.has(e))return this;var r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},$.prototype.setMaxSize=function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this},$.prototype.filter=function(e){var t=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(e){return this.getTileByID(e.key)},r.prototype.getTileByID=function(e){return this._tiles[e]},r.prototype._retainLoadedChildren=function(e,t,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>t+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>t;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(e,t){if(e.key in this._loadedParentTiles){var r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(var n=e.overscaledZ-1;n>=t;n--){var i=e.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)},r.prototype.updateCacheSize=function(e){var t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),r=5,n=Math.floor(t*r),i="number"===typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(e){var t=(e-(void 0===this._prevLng?e:this._prevLng))/360,r=Math.round(t);if(this._prevLng=e,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(t){var n=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(e){return n._source.hasTile(e)})))):i=[];var a=t.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Je(this._source.type)){for(var u={},c={},f=0,d=Object.keys(l);fthis._source.maxzoom){var m=h.children(this._source.maxzoom)[0],g=this.getTile(m);if(g&&g.hasData()){n[m.key]=m;continue}}else{var y=h.children(this._source.maxzoom);if(n[y[0].key]&&n[y[1].key]&&n[y[2].key]&&n[y[3].key])continue}for(var x=v.wasRequested(),b=h.overscaledZ-1;b>=a;--b){var _=h.scaledTo(b);if(i[_.key])break;if(i[_.key]=!0,!(v=this.getTile(_))&&x&&(v=this._addTile(_)),v&&(n[_.key]=_,x=v.wasRequested(),v.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],r=void 0,n=this._tiles[e].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=t;a0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))},r.prototype.clearTiles=function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()},r.prototype.tilesIn=function(t,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(t):t,l=t.map((function(e){return o.pointCoordinate(e)})),u=s.map((function(e){return o.pointCoordinate(e)})),c=this.getIds(),f=1/0,d=1/0,p=-1/0,h=-1/0,v=0,m=u;v=0&&g[1].y+m>=0){var y=l.map((function(e){return s.getTilePoint(e)})),x=u.map((function(e){return s.getTilePoint(e)}));a.push({tile:n,tileID:s,queryGeometry:y,cameraQueryGeometry:x,scale:v})}}},x=0;x=e.browser.now())return!0}return!1},r.prototype.setFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.updateState(e,t,r)},r.prototype.removeFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.removeFeatureState(e,t,r)},r.prototype.getFeatureState=function(e,t){return e=e||"_geojsonTileLayer",this._state.getState(e,t)},r.prototype.setDependencies=function(e,t,r){var n=this._tiles[e];n&&n.setDependencies(t,r)},r.prototype.reloadTilesForDependencies=function(e,t){for(var r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(e,t)}))},r}(e.Evented);function $e(e,t){var r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Je(e){return"raster"===e||"image"===e||"video"===e}function Qe(){return new e.window.Worker(cs.workerUrl)}Ke.maxOverzooming=10,Ke.maxUnderzooming=3;var et="mapboxgl_preloaded_worker_pool",tt=function(){this.active={}};tt.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var wt=function(e,t,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(var a=0;a=-t[0]&&r<=t[0]&&n>=-t[1]&&n<=t[1]}function Ct(t,r,n,i,a,o,s,l){var u=i?t.textSizeData:t.iconSizeData,c=e.evaluateSizeForZoom(u,n.transform.zoom),f=[256/n.width*2+1,256/n.height*2+1],d=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;d.clear();for(var p=t.lineVertexArray,h=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,v=n.transform.width/n.transform.height,m=!1,g=0;gMath.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function Lt(t,r,n,i,a,o,s,l,u,c,f,d,p,h){var v,m=r/24,g=t.lineOffsetX*m,y=t.lineOffsetY*m;if(t.numGlyphs>1){var x=t.glyphStartIndex+t.numGlyphs,b=t.lineStartIndex,_=t.lineStartIndex+t.lineLength,w=Et(m,l,g,y,n,f,d,t,u,o,p);if(!w)return{notEnoughRoom:!0};var k=Mt(w.first.point,s).point,T=Mt(w.last.point,s).point;if(i&&!n){var M=Pt(t.writingMode,k,T,h);if(M)return M}v=[w.first];for(var S=t.glyphStartIndex+1;S0?P.point:It(d,E,A,1,a),I=Pt(t.writingMode,A,L,h);if(I)return I}var R=Rt(m*l.getoffsetX(t.glyphStartIndex),g,y,n,f,d,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,u,o,p);if(!R)return{notEnoughRoom:!0};v=[R]}for(var O=0,D=v;O0?1:-1,v=0;i&&(h*=-1,v=Math.PI),h<0&&(v+=Math.PI);for(var m=h>0?l+s:l+s+1,g=a,y=a,x=0,b=0,_=Math.abs(p),w=[];x+b<=_;){if((m+=h)=u)return null;if(y=g,w.push(g),void 0===(g=d[m])){var k=new e.Point(c.getx(m),c.gety(m)),T=Mt(k,f);if(T.signedDistanceFromCamera>0)g=d[m]=T.point;else{var M=m-h;g=It(0===x?o:new e.Point(c.getx(M),c.gety(M)),k,y,_-x+1,f)}}x+=b,b=y.dist(g)}var S=(_-x)/b,A=g.sub(y),C=A.mult(S)._add(y);C._add(A._unit()._perp()._mult(n*h));var E=v+Math.atan2(g.y-y.y,g.x-y.x);return w.push(C),{point:C,angle:E,path:w}}wt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},wt.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},wt.prototype.insertCircle=function(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)},wt.prototype._insertBoxCell=function(e,t,r,n,i,a){this.boxCells[i].push(a)},wt.prototype._insertCircleCell=function(e,t,r,n,i,a){this.circleCells[i].push(a)},wt.prototype._query=function(e,t,r,n,i,a){if(r<0||e>this.width||n<0||t>this.height)return!i&&[];var o=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},wt.prototype._queryCircle=function(e,t,r,n,i){var a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var u=[],c={hitTest:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,u,c,i),n?u.length>0:u},wt.prototype.query=function(e,t,r,n,i){return this._query(e,t,r,n,!1,i)},wt.prototype.hitTest=function(e,t,r,n,i){return this._query(e,t,r,n,!0,i)},wt.prototype.hitTestCircle=function(e,t,r,n){return this._queryCircle(e,t,r,!0,n)},wt.prototype._queryCell=function(e,t,r,n,i,a,o,s){var l=o.seenUids,u=this.boxCells[i];if(null!==u)for(var c=this.bboxes,f=0,d=u;f=c[h+0]&&n>=c[h+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:c[h],y1:c[h+1],x2:c[h+2],y2:c[h+3]})}}}var v=this.circleCells[i];if(null!==v)for(var m=this.circles,g=0,y=v;go*o+s*s},wt.prototype._circleAndRectCollide=function(e,t,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;var u=(o-i)/2,c=Math.abs(t-(i+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var f=l-s,d=c-u;return f*f+d*d<=r*r};var Ot=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Dt(e,t){for(var r=0;r=1;I--)L.push(E.path[I]);for(var R=1;R0){for(var F=L[0].clone(),j=L[0].clone(),N=1;N=S.x&&j.x<=A.x&&F.y>=S.y&&j.y<=A.y?[L]:j.xA.x||j.yA.y?[]:e.clipLine([L],S.x,S.y,A.x,A.y)}for(var Z=0,B=z;Z=this.screenRightBoundary||nthis.screenBottomBoundary},jt.prototype.isInsideGrid=function(e,t,r,n){return r>=0&&e=0&&t0?(this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(v=this.prevPlacement.variableOffsets[f.crossTileID].anchor),this.variableOffsets[f.crossTileID]={textOffset:m,width:r,height:n,anchor:e,textBoxScale:i,prevAnchor:v},this.markUsedJustification(d,e,f,p),d.allowVerticalPlacement&&(this.markUsedOrientation(d,p,f),this.placedOrientations[f.crossTileID]=p),{shift:g,placedGlyphBoxes:y}):void 0},Yt.prototype.placeLayerBucketPart=function(t,r,n){var i=this,a=t.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,u=a.textLabelPlaneMatrix,c=a.labelToScreenMatrix,f=a.textPixelRatio,d=a.holdingForFade,p=a.collisionBoxArray,h=a.partiallyEvaluatedTextSize,v=a.collisionGroup,m=s.get("text-optional"),g=s.get("icon-optional"),y=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),_="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),k="viewport-y"===s.get("symbol-z-order"),T=y&&(x||!o.hasIconData()||g),M=x&&(y||!o.hasTextData()||m);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var S=function(t,a){if(!r[t.crossTileID])if(d)i.placements[t.crossTileID]=new Vt(!1,!1,!1);else{var p=!1,k=!1,S=!0,A=null,C={box:null,offscreen:null},E={box:null,offscreen:null},P=null,L=null,I=null,R=0,O=0,D=0;a.textFeatureIndex?R=a.textFeatureIndex:t.useRuntimeCollisionCircles&&(R=t.featureIndex),a.verticalTextFeatureIndex&&(O=a.verticalTextFeatureIndex);var z=a.textBox;if(z){var F=function(r){var n=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[t.crossTileID];a&&(i.placedOrientations[t.crossTileID]=a,n=a,i.markUsedOrientation(o,n,t))}return n},j=function(r,n){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(N=N.filter((function(e){return e!==Z.anchor}))).unshift(Z.anchor)}var B=function(e,r,n){for(var a=e.x2-e.x1,s=e.y2-e.y1,u=t.textBoxScale,c=w&&!x?r:null,d={box:[],offscreen:!1},h=y?2*N.length:N.length,m=0;m=N.length,T=i.attemptAnchorPlacement(g,e,a,s,u,b,_,f,l,v,k,t,o,n,c);if(T&&(d=T.placedGlyphBoxes)&&d.box&&d.box.length){p=!0,A=T.shift;break}}return d};j((function(){return B(z,a.iconBox,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=C&&C.box&&C.box.length;return o.allowVerticalPlacement&&!n&&t.numVerticalGlyphVertices>0&&r?B(r,a.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}})),C&&(p=C.box,S=C.offscreen);var V=F(C&&C.box);if(!p&&i.prevPlacement){var U=i.prevPlacement.variableOffsets[t.crossTileID];U&&(i.variableOffsets[t.crossTileID]=U,i.markUsedJustification(o,U.anchor,t,V))}}else{var H=function(e,r){var n=i.collisionIndex.placeCollisionBox(e,y,f,l,v.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,t),i.placedOrientations[t.crossTileID]=r),n};j((function(){return H(z,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?H(r,e.WritingMode.vertical):{box:null,offscreen:null}})),F(C&&C.box&&C.box.length)}}if(p=(P=C)&&P.box&&P.box.length>0,S=P&&P.offscreen,t.useRuntimeCollisionCircles){var W=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),G=e.evaluateSizeForFeature(o.textSizeData,h,W),q=s.get("text-padding"),Y=t.collisionCircleDiameter;L=i.collisionIndex.placeCollisionCircles(y,W,o.lineVertexArray,o.glyphOffsetArray,G,l,u,c,n,_,v.predicate,Y,q),p=y||L.circles.length>0&&!L.collisionDetected,S=S&&L.offscreen}if(a.iconFeatureIndex&&(D=a.iconFeatureIndex),a.iconBox){var X=function(e){var t=w&&A?qt(e,A.x,A.y,b,_,i.transform.angle):e;return i.collisionIndex.placeCollisionBox(t,x,f,l,v.predicate)};k=E&&E.box&&E.box.length&&a.verticalIconBox?(I=X(a.verticalIconBox)).box.length>0:(I=X(a.iconBox)).box.length>0,S=S&&I.offscreen}var K=m||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,$=g||0===t.numIconVertices;if(K||$?$?K||(k=k&&p):p=k&&p:k=p=k&&p,p&&P&&P.box&&(E&&E.box&&O?i.collisionIndex.insertCollisionBox(P.box,s.get("text-ignore-placement"),o.bucketInstanceId,O,v.ID):i.collisionIndex.insertCollisionBox(P.box,s.get("text-ignore-placement"),o.bucketInstanceId,R,v.ID)),k&&I&&i.collisionIndex.insertCollisionBox(I.box,s.get("icon-ignore-placement"),o.bucketInstanceId,D,v.ID),L&&(p&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),o.bucketInstanceId,R,v.ID),n)){var J=o.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new Ut);for(var ee=0;ee=0;--C){var E=A[C];S(o.symbolInstances.get(E),o.collisionArrays[E])}else for(var P=t.symbolInstanceStart;P=0&&(t.text.placedSymbolArray.get(u).crossTileID=a>=0&&u!==a?0:n.crossTileID)}},Yt.prototype.markUsedOrientation=function(t,r,n){for(var i=r===e.WritingMode.horizontal||r===e.WritingMode.horizontalOnly?r:0,a=r===e.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,x=a.numIconVertices>0,b=i.placedOrientations[a.crossTileID],_=b===e.WritingMode.vertical,w=b===e.WritingMode.horizontal||b===e.WritingMode.horizontalOnly;if(y){var k=nr(g.text),T=_?ir:k;h(t.text,s,T);var M=w?ir:k;h(t.text,l,M);var S=g.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=S||_?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=S||w?1:0);var A=i.variableOffsets[a.crossTileID];A&&i.markUsedJustification(t,A.anchor,a,b);var C=i.placedOrientations[a.crossTileID];C&&(i.markUsedJustification(t,"left",a,C),i.markUsedOrientation(t,C,a))}if(x){var E=nr(g.icon),P=!(d&&a.verticalPlacedIconSymbolIndex&&_);if(a.placedIconSymbolIndex>=0){var L=P?E:ir;h(t.icon,a.numIconVertices,L),t.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=g.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var I=P?ir:E;h(t.icon,a.numVerticalIconVertices,I),t.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden()}}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var R=t.collisionArrays[n];if(R){var O=new e.Point(0,0);if(R.textBox||R.verticalTextBox){var D=!0;if(u){var z=i.variableOffsets[v];z?(O=Gt(z.anchor,z.width,z.height,z.textOffset,z.textBoxScale),c&&O._rotate(f?i.transform.angle:-i.transform.angle)):D=!1}R.textBox&&Xt(t.textCollisionBox.collisionVertexArray,g.text.placed,!D||_,O.x,O.y),R.verticalTextBox&&Xt(t.textCollisionBox.collisionVertexArray,g.text.placed,!D||w,O.x,O.y)}var F=Boolean(!w&&R.verticalIconBox);R.iconBox&&Xt(t.iconCollisionBox.collisionVertexArray,g.icon.placed,F,d?O.x:0,d?O.y:0),R.verticalIconBox&&Xt(t.iconCollisionBox.collisionVertexArray,g.icon.placed,!F,d?O.x:0,d?O.y:0)}}},m=0;me},Yt.prototype.setStale=function(){this.stale=!0};var Kt=Math.pow(2,25),$t=Math.pow(2,24),Jt=Math.pow(2,17),Qt=Math.pow(2,16),er=Math.pow(2,9),tr=Math.pow(2,8),rr=Math.pow(2,1);function nr(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*Kt+t*$t+r*Jt+t*Qt+r*er+t*tr+r*rr+t}var ir=0,ar=function(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ar.prototype.continuePlacement=function(e,t,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new ar(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},or.prototype.commit=function(e){return this.placement.commit(e),this.placement};var sr=512/e.EXTENT/2,lr=function(e,t,r){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;ne.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,i)}else{var u=o[e.scaledTo(Number(a)).key];u&&u.findMatches(t.symbolInstances,e,i)}}for(var c=0;c0)throw new Error("Unimplemented: "+i.map((function(e){return e.command})).join(", ")+".");return n.forEach((function(e){"setTransition"!==e.command&&r[e.command].apply(r,e.args)})),this.stylesheet=t,!0},r.prototype.addImage=function(t,r){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(t,r),this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.fire(new e.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(e,t){this.imageManager.updateImage(e,t)},r.prototype.getImage=function(e){return this.imageManager.getImage(e)},r.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.fire(new e.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(t,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(e.validateStyle.source,"sources."+t,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[t]=new Ke(t,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:t}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'+t+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},r.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},r.prototype.addLayer=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new e.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===t.type){if(dr(this,e.validateCustomStyleLayer(t)))return;a=e.createStyleLayer(t)}else{if("object"===typeof t.source&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateStyle.layer,"layers."+i,t,{arrayIndex:-1},n))return;a=e.createStyleLayer(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(t,r){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==r){var n=this._order.indexOf(t);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(t){this._checkLoaded();var r=this._layers[t];if(r){r.setEventedParent(null);var n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(e){return this._layers[e]},r.prototype.hasLayer=function(e){return e in this._layers},r.prototype.setLayerZoomRange=function(t,r,n){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(t);if(i){if(!e.deepEqual(i.filter,r))return null===r||void 0===r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=e.clone$1(r),this._updateLayer(i)))}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(t){return e.clone$1(this.getLayer(t).filter)},r.prototype.setLayoutProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(t,r){var n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},r.prototype.setFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!==typeof t.id&&"number"!==typeof t.id?this.fire(new e.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(t){this._checkLoaded();var r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,(function(e){return e.serialize()})),layers:this._serializeLayers(this._order)},(function(e){return void 0!==e}))},r.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(e){for(var t=this,r=function(e){return"fill-extrusion"===t._layers[e].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=e;s=0;h--){var v=this._order[h];if(r(v))for(var m=i.length-1;m>=0;m--){var g=i[m].feature;if(n[g.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}",Lr="attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}",Ir="varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}",Rr="attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}",Or="uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}",Dr="attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}",zr="#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Fr="attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}",jr="varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Nr="attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}",Zr="uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Br="uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}",Vr="uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Ur="uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}",Hr="varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Wr="uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}",Gr="uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",qr="uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}",Yr="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Xr="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",Kr="uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",$r="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",Jr="uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Qr="\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}",en="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",tn="\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}",rn="uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",nn="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}",an="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",on="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}",sn="uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",ln="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",un="uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",cn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}",fn="#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",dn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}",pn="#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",hn="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}",vn=Bn("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),mn=Bn(yr,xr),gn=Bn(br,_r),yn=Bn(wr,kr),xn=Bn(Tr,Mr),bn=Bn(Sr,Ar),_n=Bn(Cr,Er),wn=Bn(Pr,Lr),kn=Bn(Ir,Rr),Tn=Bn(Or,Dr),Mn=Bn(zr,Fr),Sn=Bn(jr,Nr),An=Bn(Zr,Br),Cn=Bn(Vr,Ur),En=Bn(Hr,Wr),Pn=Bn(Gr,qr),Ln=Bn(Yr,Xr),In=Bn(Kr,$r),Rn=Bn(Jr,Qr),On=Bn(en,tn),Dn=Bn(rn,nn),zn=Bn(an,on),Fn=Bn(sn,ln),jn=Bn(un,cn),Nn=Bn(fn,dn),Zn=Bn(pn,hn);function Bn(e,t){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:e=e.replace(r,(function(e,t,r,i,a){return n[a]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"})),vertexSource:t=t.replace(r,(function(e,t,r,i,a){var o="float"===i?"vec2":"vec4",s=a.match(/color/)?"color":o;return n[a]?"define"===t?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"define"===t?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"}))}}var Vn=Object.freeze({__proto__:null,prelude:vn,background:mn,backgroundPattern:gn,circle:yn,clippingMask:xn,heatmap:bn,heatmapTexture:_n,collisionBox:wn,collisionCircle:kn,debug:Tn,fill:Mn,fillOutline:Sn,fillOutlinePattern:An,fillPattern:Cn,fillExtrusion:En,fillExtrusionPattern:Pn,hillshadePrepare:Ln,hillshade:In,line:Rn,lineGradient:On,linePattern:Dn,lineSDF:zn,raster:Fn,symbolIcon:jn,symbolSDF:Nn,symbolTextAndIcon:Zn}),Un=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Un.prototype.bind=function(e,t,r,n,i,a,o,s){this.context=e;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}function Gn(e,t,r,n){var i=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,u=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/u,f=c*(n.tileID.canonical.x+n.tileID.wrap*u),d=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/Nt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[f>>16,d>>16],u_pixel_coord_lower:[65535&f,65535&d]}}Hn.prototype.draw=function(e,t,r,n,i,a,o,s,l,u,c,f,d,p,h,v){var m,g=e.gl;if(!this.failedToCreate){for(var y in e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),e.setColorMode(i),e.setCullFace(a),this.fixedUniforms)this.fixedUniforms[y].set(o[y]);p&&p.setUniforms(e,this.binderUniforms,f,{zoom:d});for(var x=(m={},m[g.LINES]=2,m[g.TRIANGLES]=3,m[g.LINE_STRIP]=1,m)[t],b=0,_=c.get();b<_.length;b+=1){var w=_[b],k=w.vaos||(w.vaos={});(k[s]||(k[s]=new Un)).bind(e,this,l,p?p.getPaintVertexBuffers():[],u,w.vertexOffset,h,v),g.drawElements(t,w.primitiveLength*x,g.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var qn=function(t,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=e.create$1();"viewport"===a.properties.get("anchor")&&e.fromRotation(l,-r.transform.angle),e.transformMat3(s,s,l);var u=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:i}},Yn=function(t,r,n,i,a,o,s){return e.extend(qn(t,r,n,i),Wn(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Xn=function(e){return{u_matrix:e}},Kn=function(t,r,n,i){return e.extend(Xn(t),Wn(n,r,i))},$n=function(e,t){return{u_matrix:e,u_world:t}},Jn=function(t,r,n,i,a){return e.extend(Kn(t,r,n,i),{u_world:a})},Qn=function(t,r,n,i){var a,o,s=t.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=Nt(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:o}},ei=function(e,t,r){var n=Nt(r,1,t.zoom),i=Math.pow(2,t.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[t.pixelsToGLUnits[0]/(n*i),t.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},ti=function(e,t,r){return{u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},ri=function(e,t,r){return void 0===r&&(r=1),{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:r}},ni=function(e){return{u_matrix:e}},ii=function(e,t,r,n){return{u_matrix:e,u_extrude_scale:Nt(t,1,r),u_intensity:n}},ai=function(t,r,n,i){var a=e.create();e.ortho(a,0,t.width,t.height,0,0,1);var o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}},oi=function(e,t,r){var n=r.paint.get("hillshade-shadow-color"),i=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),o=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(o-=e.transform.angle);var s=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),s),u_image:0,u_latrange:li(e,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:i,u_accent:a}},si=function(t,r,n){var i=r.stride,a=e.create();return e.ortho(a,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(a,a,[0,-e.EXTENT,0]),{u_matrix:a,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_maxzoom:n,u_unpack:r.getUnpackVector()}};function li(t,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.MercatorCoordinate(0,i/n).toLngLat().lat,new e.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var ui=function(t,r,n){var i=t.transform;return{u_matrix:hi(t,r,n),u_ratio:1/Nt(r,1,i.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},ci=function(t,r,n){return e.extend(ui(t,r,n),{u_image:0})},fi=function(t,r,n,i){var a=t.transform,o=pi(r,a);return{u_matrix:hi(t,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/Nt(r,1,a.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},di=function(t,r,n,i,a){var o=t.transform,s=t.lineAtlas,l=pi(r,o),u="round"===n.layout.get("line-cap"),c=s.getDash(i.from,u),f=s.getDash(i.to,u),d=c.width*a.fromScale,p=f.width*a.toScale;return e.extend(ui(t,r,n),{u_patternscale_a:[l/d,-c.height/2],u_patternscale_b:[l/p,-f.height/2],u_sdfgamma:s.width/(256*Math.min(d,p)*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:f.y,u_mix:a.t})};function pi(e,t){return 1/Nt(e,1,t.tileZoom)}function hi(e,t,r){return e.translatePosMatrix(t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var vi=function(e,t,r,n,i){return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:yi(i.paint.get("raster-saturation")),u_contrast_factor:gi(i.paint.get("raster-contrast")),u_spin_weights:mi(i.paint.get("raster-hue-rotate"))}};function mi(e){e*=Math.PI/180;var t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}function gi(e){return e>0?1/(1-e):1+e}function yi(e){return e>0?1-1/(1.001-e):-e}var xi,bi=function(e,t,r,n,i,a,o,s,l,u){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:u,u_texture:0}},_i=function(t,r,n,i,a,o,s,l,u,c,f){var d=a.transform;return e.extend(bi(t,r,n,i,a,o,s,l,u,c),{u_gamma_scale:i?Math.cos(d._pitch)*d.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+f})},wi=function(t,r,n,i,a,o,s,l,u,c){return e.extend(_i(t,r,n,i,a,o,s,l,!0,u,!0),{u_texsize_icon:c,u_texture_icon:1})},ki=function(e,t,r){return{u_matrix:e,u_opacity:t,u_color:r}},Ti=function(t,r,n,i,a,o){return e.extend(Gn(i,o,n,a),{u_matrix:t,u_opacity:r})},Mi={fillExtrusion:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fillExtrusionPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,r.u_height_factor),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fill:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},fillPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},fillOutline:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world)}},fillOutlinePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},circle:function(t,r){return{u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,r.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},collisionBox:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,r.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,r.u_overscale_factor)}},collisionCircle:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,r.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,r.u_viewport_size)}},debug:function(t,r){return{u_color:new e.UniformColor(t,r.u_color),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_overlay:new e.Uniform1i(t,r.u_overlay),u_overlay_scale:new e.Uniform1f(t,r.u_overlay_scale)}},clippingMask:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmap:function(t,r){return{u_extrude_scale:new e.Uniform1f(t,r.u_extrude_scale),u_intensity:new e.Uniform1f(t,r.u_intensity),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmapTexture:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_color_ramp:new e.Uniform1i(t,r.u_color_ramp),u_opacity:new e.Uniform1f(t,r.u_opacity)}},hillshade:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_latrange:new e.Uniform2f(t,r.u_latrange),u_light:new e.Uniform2f(t,r.u_light),u_shadow:new e.UniformColor(t,r.u_shadow),u_highlight:new e.UniformColor(t,r.u_highlight),u_accent:new e.UniformColor(t,r.u_accent)}},hillshadePrepare:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_dimension:new e.Uniform2f(t,r.u_dimension),u_zoom:new e.Uniform1f(t,r.u_zoom),u_maxzoom:new e.Uniform1f(t,r.u_maxzoom),u_unpack:new e.Uniform4f(t,r.u_unpack)}},line:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels)}},lineGradient:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_image:new e.Uniform1i(t,r.u_image)}},linePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texsize:new e.Uniform2f(t,r.u_texsize),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_image:new e.Uniform1i(t,r.u_image),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},lineSDF:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,r.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,r.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,r.u_sdfgamma),u_image:new e.Uniform1i(t,r.u_image),u_tex_y_a:new e.Uniform1f(t,r.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,r.u_tex_y_b),u_mix:new e.Uniform1f(t,r.u_mix)}},raster:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_tl_parent:new e.Uniform2f(t,r.u_tl_parent),u_scale_parent:new e.Uniform1f(t,r.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,r.u_buffer_scale),u_fade_t:new e.Uniform1f(t,r.u_fade_t),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image0:new e.Uniform1i(t,r.u_image0),u_image1:new e.Uniform1i(t,r.u_image1),u_brightness_low:new e.Uniform1f(t,r.u_brightness_low),u_brightness_high:new e.Uniform1f(t,r.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,r.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,r.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,r.u_spin_weights)}},symbolIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture)}},symbolSDF:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},symbolTextAndIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texsize_icon:new e.Uniform2f(t,r.u_texsize_icon),u_texture:new e.Uniform1i(t,r.u_texture),u_texture_icon:new e.Uniform1i(t,r.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},background:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_color:new e.UniformColor(t,r.u_color)}},backgroundPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image:new e.Uniform1i(t,r.u_image),u_pattern_tl_a:new e.Uniform2f(t,r.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,r.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,r.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,r.u_pattern_br_b),u_texsize:new e.Uniform2f(t,r.u_texsize),u_mix:new e.Uniform1f(t,r.u_mix),u_pattern_size_a:new e.Uniform2f(t,r.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,r.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,r.u_scale_a),u_scale_b:new e.Uniform1f(t,r.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,r.u_tile_units_to_pixels)}}};function Si(t,r,n,i,a,o,s){for(var l=t.context,u=l.gl,c=t.useProgram("collisionBox"),f=[],d=0,p=0,h=0;h0){var _=e.create(),w=y;e.mul(_,g.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(_,_,g.placementViewportMatrix),f.push({circleArray:b,circleOffset:p,transform:w,invTransform:_}),p=d+=b.length/4}x&&c.draw(l,u.LINES,je.disabled,Be.disabled,t.colorModeForRenderPass(),Ye.disabled,ei(y,t.transform,m),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,t.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&f.length){var k=t.useProgram("collisionCircle"),T=new e.StructArrayLayout2f1f2i16;T.resize(4*d),T._trim();for(var M=0,S=0,A=f;S=0&&(v[g.associatedIconIndex]={shiftedAnchor:A,angle:C})}else Dt(g.numGlyphs,p)}if(f){h.clear();for(var P=t.icon.placedSymbolArray,L=0;L0){var s=e.browser.now(),l=(s-t.timeAdded)/o,u=r?(s-r.timeAdded)/o:-1,c=n.getSource(),f=a.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),d=!r||Math.abs(r.tileID.overscaledZ-f)>Math.abs(t.tileID.overscaledZ-f),p=d&&t.refreshedUponExpiration?1:e.clamp(d?l:1-u,0,1);return t.refreshedUponExpiration&&l>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}function $i(e,t,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var a=e.context,o=a.gl,s=e.transform,l=s.tileSize,u=r.paint.get("background-pattern");if(!e.isPatternMissing(u)){var c=!u&&1===n.a&&1===i&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass===c){var f=Be.disabled,d=e.depthModeForSublayer(0,"opaque"===c?je.ReadWrite:je.ReadOnly),p=e.colorModeForRenderPass(),h=e.useProgram(u?"backgroundPattern":"background"),v=s.coveringTiles({tileSize:l});u&&(a.activeTexture.set(o.TEXTURE0),e.imageManager.bind(e.context));for(var m=r.getCrossfadeParameters(),g=0,y=v;g "+n.overscaledZ),ca(t,g+" "+h+"kb"),s.draw(i,a.TRIANGLES,l,u,We.alphaBlended,Ye.disabled,ri(o,e.Color.transparent,m),f,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}function ca(e,t){e.initDebugOverlayCanvas();var r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}function fa(e,t,r){var n=e.context,i=r.implementation;if("offscreen"===e.renderPass){var a=i.prerender;a&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),a.call(i,n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Be.disabled);var o="3d"===i.renderingMode?new je(e.context.gl.LEQUAL,je.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,je.ReadOnly);n.setDepthMode(o),i.render(n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}}var da={symbol:Ei,circle:zi,heatmap:Fi,line:Bi,fill:Vi,"fill-extrusion":Hi,hillshade:Gi,raster:Xi,background:$i,debug:la,custom:fa},pa=function(e,t){this.context=new Xe(e),this.transform=t,this._tileTextures={},this.setup(),this.numSublayers=Ke.maxUnderzooming+Ke.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new fr,this.gpuTimers={}};pa.prototype.resize=function(t,r){if(this.width=t*e.browser.devicePixelRatio,this.height=r*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n256&&this.clearStencil(),r.setColorMode(We.disabled),r.setDepthMode(je.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=t;a256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new Be({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)},pa.prototype.stencilModeForClipping=function(e){var t=this.context.gl;return new Be({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)},pa.prototype.stencilConfigForOverlap=function(e){var t,r=this.context.gl,n=e.sort((function(e,t){return t.overscaledZ-e.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],k=a[w.source],T=c[w.source];this._renderTileClippingMasks(w,T),this.renderLayer(this,k,w,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?t.pop():null},pa.prototype.isPatternMissing=function(e){if(!e)return!1;if(!e.from||!e.to)return!0;var t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r},pa.prototype.useProgram=function(e,t){this.cache=this.cache||{};var r=""+e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Hn(this.context,Vn[e],t,Mi[e],this._showOverdrawInspector)),this.cache[r]},pa.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},pa.prototype.setBaseState=function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)},pa.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var t=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,t.RGBA)}},pa.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var ha=function(e,t){this.points=e,this.planes=t};ha.fromInvProjectionMatrix=function(t,r,n){var i=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],a=Math.pow(2,n),o=i.map((function(r){return e.transformMat4([],r,t)})).map((function(t){return e.scale$1([],t,1/t[3]/r*a)})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var r=e.sub([],o[t[0]],o[t[1]]),n=e.sub([],o[t[2]],o[t[1]]),i=e.normalize([],e.cross([],r,n)),a=-e.dot(i,o[t[1]]);return i.concat(a)}));return new ha(o,s)};var va=function(t,r){this.min=t,this.max=r,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};va.prototype.quadrant=function(t){for(var r=[t%2===0,t<2],n=e.clone$2(this.min),i=e.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,c=-Number.MAX_VALUE,f=0;fthis.max[l]-this.min[l])return 0}return 1};var ma=function(e,t,r,n){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n};ma.prototype.interpolate=function(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.number(t.right,r.right,n)),this},ma.prototype.getCenter=function(t,r){var n=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+r-this.bottom)/2,0,r);return new e.Point(n,i)},ma.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right},ma.prototype.clone=function(){return new ma(this.top,this.bottom,this.left,this.right)},ma.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var ga=function(t,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=void 0===n||null===n?0:n,this._maxPitch=void 0===i||null===i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ma,this._posMatrixCache={},this._alignedPosMatrixCache={}},ya={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};function xa(e,t){var r=!1,n=null,i=function i(){n=null,r&&(e(),n=setTimeout(i,t),r=!1)};return function(){return r=!0,n||i(),n}}ga.prototype.clone=function(){var e=new ga(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._calcMatrices(),e},ya.minZoom.get=function(){return this._minZoom},ya.minZoom.set=function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))},ya.maxZoom.get=function(){return this._maxZoom},ya.maxZoom.set=function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))},ya.minPitch.get=function(){return this._minPitch},ya.minPitch.set=function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))},ya.maxPitch.get=function(){return this._maxPitch},ya.maxPitch.set=function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))},ya.renderWorldCopies.get=function(){return this._renderWorldCopies},ya.renderWorldCopies.set=function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e},ya.worldSize.get=function(){return this.tileSize*this.scale},ya.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},ya.size.get=function(){return new e.Point(this.width,this.height)},ya.bearing.get=function(){return-this.angle/Math.PI*180},ya.bearing.set=function(t){var r=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},ya.pitch.get=function(){return this._pitch/Math.PI*180},ya.pitch.set=function(t){var r=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},ya.fov.get=function(){return this._fov/Math.PI*180},ya.fov.set=function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())},ya.zoom.get=function(){return this._zoom},ya.zoom.set=function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},ya.center.get=function(){return this._center},ya.center.set=function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())},ya.padding.get=function(){return this._edgeInsets.toJSON()},ya.padding.set=function(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())},ya.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},ga.prototype.isPaddingEqual=function(e){return this._edgeInsets.equals(e)},ga.prototype.interpolatePadding=function(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()},ga.prototype.coveringZoomLevel=function(e){var t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)},ga.prototype.getVisibleUnwrappedCoordinates=function(t){var r=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),a=this.pointCoordinate(new e.Point(this.width,this.height)),o=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),u=1,c=s-u;c<=l+u;c++)0!==c&&r.push(new e.UnwrappedTileID(c,t));return r},ga.prototype.coveringTiles=function(t){var r=this.coveringZoomLevel(t),n=r;if(void 0!==t.minzoom&&rt.maxzoom&&(r=t.maxzoom);var i=e.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=ha.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var u=3,c=function(e){return{aabb:new va([e*a,0,0],[(e+1)*a,a,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}},f=[],d=[],p=r,h=t.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var v=1;v<=3;v++)f.push(c(-v)),f.push(c(v));for(f.push(c(0));f.length>0;){var m=f.pop(),g=m.x,y=m.y,x=m.fullyVisible;if(!x){var b=m.aabb.intersects(s);if(0===b)continue;x=2===b}var _=m.aabb.distanceX(o),w=m.aabb.distanceY(o),k=Math.max(Math.abs(_),Math.abs(w)),T=u+(1<T&&m.zoom>=l)d.push({tileID:new e.OverscaledTileID(m.zoom===p?h:m.zoom,m.wrap,m.zoom,g,y),distanceSq:e.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var M=0;M<4;M++){var S=(g<<1)+M%2,A=(y<<1)+(M>>1);f.push({aabb:m.aabb.quadrant(M),zoom:m.zoom+1,x:S,y:A,wrap:m.wrap,fullyVisible:x})}}return d.sort((function(e,t){return e.distanceSq-t.distanceSq})).map((function(e){return e.tileID}))},ga.prototype.resize=function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()},ya.unmodified.get=function(){return this._unmodified},ga.prototype.zoomScale=function(e){return Math.pow(2,e)},ga.prototype.scaleZoom=function(e){return Math.log(e)/Math.LN2},ga.prototype.project=function(t){var r=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(r)*this.worldSize)},ga.prototype.unproject=function(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},ya.point.get=function(){return this.project(this.center)},ga.prototype.setLocationAtPoint=function(t,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},ga.prototype.locationPoint=function(e){return this.coordinatePoint(this.locationCoordinate(e))},ga.prototype.pointLocation=function(e){return this.coordinateLocation(this.pointCoordinate(e))},ga.prototype.locationCoordinate=function(t){return e.MercatorCoordinate.fromLngLat(t)},ga.prototype.coordinateLocation=function(e){return e.toLngLat()},ga.prototype.pointCoordinate=function(t){var r=0,n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];e.transformMat4(n,n,this.pixelMatrixInverse),e.transformMat4(i,i,this.pixelMatrixInverse);var a=n[3],o=i[3],s=n[0]/a,l=i[0]/o,u=n[1]/a,c=i[1]/o,f=n[2]/a,d=i[2]/o,p=f===d?0:(r-f)/(d-f);return new e.MercatorCoordinate(e.number(s,l,p)/this.worldSize,e.number(u,c,p)/this.worldSize)},ga.prototype.coordinatePoint=function(t){var r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix),new e.Point(r[0]/r[3],r[1]/r[3])},ga.prototype.getBounds=function(){return(new e.LngLatBounds).extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},ga.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},ga.prototype.setMaxBounds=function(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},ga.prototype.calculatePosMatrix=function(t,r){void 0===r&&(r=!1);var n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*t.wrap,l=e.identity(new Float64Array(16));return e.translate(l,l,[s*o,a.y*o,0]),e.scale(l,l,[o/e.EXTENT,o/e.EXTENT,1]),e.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},ga.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},ga.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,r,n,i,a=-90,o=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var f=this.latRange;a=e.mercatorYfromLat(f[1])*this.worldSize,t=(o=e.mercatorYfromLat(f[0])*this.worldSize)-ao&&(i=o-m)}if(this.lngRange){var g=p.x,y=u.x/2;g-yl&&(n=l-y)}void 0===n&&void 0===i||(this.center=this.unproject(new e.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=c,this._constraining=!1}},ga.prototype._calcMatrices=function(){if(this.height){var t=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(t)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),c=this.height/50,f=new Float64Array(16);e.perspective(f,this._fov,this.width/this.height,c,u),f[8]=2*-r.x/this.width,f[9]=2*r.y/this.height,e.scale(f,f,[1,-1,1]),e.translate(f,f,[0,0,-this.cameraToCenterDistance]),e.rotateX(f,f,this._pitch),e.rotateZ(f,f,this.angle),e.translate(f,f,[-s,-l,0]),this.mercatorMatrix=e.scale([],f,[this.worldSize,this.worldSize,this.worldSize]),e.scale(f,f,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=f,this.invProjMatrix=e.invert([],this.projMatrix);var d=this.width%2/2,p=this.height%2/2,h=Math.cos(this.angle),v=Math.sin(this.angle),m=s-Math.round(s)+h*d+v*p,g=l-Math.round(l)+h*p+v*d,y=new Float64Array(f);if(e.translate(y,y,[m>.5?m-1:m,g>.5?g-1:g,0]),this.alignedProjMatrix=y,f=e.create(),e.scale(f,f,[this.width/2,-this.height/2,1]),e.translate(f,f,[1,-1,0]),this.labelPlaneMatrix=f,f=e.create(),e.scale(f,f,[1,-1,1]),e.translate(f,f,[-1,-1,0]),e.scale(f,f,[2/this.width,2/this.height,1]),this.glCoordMatrix=f,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(f=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=f,this._posMatrixCache={},this._alignedPosMatrixCache={}}},ga.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.Point(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},ga.prototype.getCameraPoint=function(){var t=this._pitch,r=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,r))},ga.prototype.getCameraQueryGeometry=function(t){var r=this.getCameraPoint();if(1===t.length)return[t[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=t;s=3&&!e.some((function(e){return isNaN(e)}))){var t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},ba.prototype._updateHashUnthrottled=function(){var t=this.getHashString();try{e.window.history.replaceState(e.window.history.state,"",t)}catch(r){}};var _a={linearity:.3,easing:e.bezier(0,0,.3,1)},wa=e.extend({deceleration:2500,maxSpeed:1400},_a),ka=e.extend({deceleration:20,maxSpeed:1400},_a),Ta=e.extend({deceleration:1e3,maxSpeed:360},_a),Ma=e.extend({deceleration:1e3,maxSpeed:90},_a),Sa=function(e){this._map=e,this.clear()};function Aa(e,t){(!e.duration||e.duration0&&r-t[0].time>n;)t.shift()},Sa.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Ea(e.type,this._map,e))},Ia.prototype.dblclick=function(e){return this._firePreventable(new Ea(e.type,this._map,e))},Ia.prototype.mouseover=function(e){this._map.fire(new Ea(e.type,this._map,e))},Ia.prototype.mouseout=function(e){this._map.fire(new Ea(e.type,this._map,e))},Ia.prototype.touchstart=function(e){return this._firePreventable(new Pa(e.type,this._map,e))},Ia.prototype.touchmove=function(e){this._map.fire(new Pa(e.type,this._map,e))},Ia.prototype.touchend=function(e){this._map.fire(new Pa(e.type,this._map,e))},Ia.prototype.touchcancel=function(e){this._map.fire(new Pa(e.type,this._map,e))},Ia.prototype._firePreventable=function(e){if(this._map.fire(e),e.defaultPrevented)return{}},Ia.prototype.isEnabled=function(){return!0},Ia.prototype.isActive=function(){return!1},Ia.prototype.enable=function(){},Ia.prototype.disable=function(){};var Ra=function(e){this._map=e};Ra.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Ra.prototype.mousemove=function(e){this._map.fire(new Ea(e.type,this._map,e))},Ra.prototype.mousedown=function(){this._delayContextMenu=!0},Ra.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ea("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Ra.prototype.contextmenu=function(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new Ea(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()},Ra.prototype.isEnabled=function(){return!0},Ra.prototype.isActive=function(){return!1},Ra.prototype.enable=function(){},Ra.prototype.disable=function(){};var Oa=function(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1};function Da(e,t){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=za(t),this.touches=Da(r,t)))},Za.prototype.touchmove=function(e,t,r){if(!this.aborted&&this.centroid){var n=Da(r,t);for(var i in this.touches){var a=this.touches[i],o=n[i];(!o||o.dist(a)>Na)&&(this.aborted=!0)}}},Za.prototype.touchend=function(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>ja)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Ba=function(e){this.singleTap=new Za(e),this.numTaps=e.numTaps,this.reset()};Ba.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ba.prototype.touchstart=function(e,t,r){this.singleTap.touchstart(e,t,r)},Ba.prototype.touchmove=function(e,t,r){this.singleTap.touchmove(e,t,r)},Ba.prototype.touchend=function(e,t,r){var n=this.singleTap.touchend(e,t,r);if(n){var i=e.timeStamp-this.lastTime0&&(this._active=!0);var i=Da(n,r),a=new e.Point(0,0),o=new e.Point(0,0),s=0;for(var l in i){var u=i[l],c=this._touches[l];c&&(a._add(u),o._add(u.sub(c)),s++,i[l]=u)}if(this._touches=i,!(sMath.abs(e.x)}var ao=100,oo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},t.prototype._start=function(e){this._lastPoints=e,io(e[0].sub(e[1]))&&(this._valid=!1)},t.prototype._move=function(e,t,r){var n=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},t.prototype.gestureBeginsVertically=function(e,t,r){if(void 0!==this._valid)return this._valid;var n=2,i=e.mag()>=n,a=t.mag()>=n;if(i||a){if(!i||!a)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove0===t.y>0;return io(e)&&io(t)&&o}},t}(Ka),so={panStep:100,bearingStep:15,pitchStep:10},lo=function(){var e=so;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep};function uo(e){return e*(2-e)}lo.prototype.reset=function(){this._active=!1},lo.prototype.keydown=function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:uo,zoom:r?Math.round(l)+r*(e.shiftKey?2:1):l,bearing:s.getBearing()+n*t._bearingStep,pitch:s.getPitch()+i*t._pitchStep,offset:[-a*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}},lo.prototype.enable=function(){this._enabled=!0},lo.prototype.disable=function(){this._enabled=!1,this.reset()},lo.prototype.isEnabled=function(){return this._enabled},lo.prototype.isActive=function(){return this._active};var co=4.000244140625,fo=.01,po=1/450,ho=2,vo=function(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=fo,this._wheelZoomRate=po,e.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};vo.prototype.setZoomRate=function(e){this._defaultZoomRate=e},vo.prototype.setWheelZoomRate=function(e){this._wheelZoomRate=e},vo.prototype.isEnabled=function(){return!!this._enabled},vo.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},vo.prototype.isZooming=function(){return!!this._zooming},vo.prototype.enable=function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&"center"===e.around)},vo.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},vo.prototype.wheel=function(t){if(this.isEnabled()){var r=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,n=e.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%co===0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}},vo.prototype._onTimeout=function(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},vo.prototype._start=function(t){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},vo.prototype.renderFrame=function(){return this._onScrollFrame()},vo.prototype._onScrollFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>co?this._wheelZoomRate:this._defaultZoomRate,i=ho/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"===typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"===typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&l&&u){var f=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),d=u(f);o=e.number(l,s,d),f<1?this._frameId||(this._frameId=!0):c=!0}else o=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},vo.prototype._smoothOutEasing=function(t){var r=e.ease;if(this._prevEase){var n=this._prevEase,i=(e.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.bezier(o,s,.25,1)}return this._prevEase={start:e.browser.now(),duration:t,easing:r},r},vo.prototype.reset=function(){this._active=!1};var mo=function(e,t){this._clickZoom=e,this._tapZoom=t};mo.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},mo.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},mo.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},mo.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var go=function(){this.reset()};go.prototype.reset=function(){this._active=!1},go.prototype.dblclick=function(e,t){return e.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}},go.prototype.enable=function(){this._enabled=!0},go.prototype.disable=function(){this._enabled=!1,this.reset()},go.prototype.isEnabled=function(){return this._enabled},go.prototype.isActive=function(){return this._active};var yo=function(){this._tap=new Ba({numTouches:1,numTaps:1}),this.reset()};yo.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},yo.prototype.touchstart=function(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>Fa&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))},yo.prototype.touchmove=function(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)},yo.prototype.touchend=function(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)},yo.prototype.touchcancel=function(){this.reset()},yo.prototype.enable=function(){this._enabled=!0},yo.prototype.disable=function(){this._enabled=!1,this.reset()},yo.prototype.isEnabled=function(){return this._enabled},yo.prototype.isActive=function(){return this._active};var xo=function(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r};xo.prototype.enable=function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},xo.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},xo.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},xo.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var bo=function(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r};bo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},bo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},bo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},bo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var _o=function(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};_o.prototype.enable=function(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},_o.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},_o.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},_o.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},_o.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},_o.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var wo=function(e){return e.zoom||e.drag||e.pitch||e.rotate},ko=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(e.Event);function To(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var Mo=function(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Sa(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),e.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!1}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[e.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,_):Math.max(.5,_),w=Math.pow(m,1-t),k=i.unproject(x.add(b.mult(t*w)).mult(v));i.setLocationAtPoint(i.renderWorldCopies?k.wrap():k,h)}n._fireMoveEvents(r)}),(function(e){n._afterEase(r,e)}),t),this},r.prototype._prepareEase=function(t,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.Event("pitchstart",t))},r.prototype._fireMoveEvents=function(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))},r.prototype._afterEase=function(t,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.Event("zoomend",t)),i&&this.fire(new e.Event("rotateend",t)),a&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}},r.prototype.flyTo=function(t,r){var n=this;if(!t.essential&&e.browser.prefersReducedMotion){var i=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),c="zoom"in t?e.clamp(+t.zoom,a.minZoom,a.maxZoom):o,f="bearing"in t?this._normalizeBearing(t.bearing,s):s,d="pitch"in t?+t.pitch:l,p="padding"in t?t.padding:a.padding,h=a.zoomScale(c-o),v=e.Point.convert(t.offset),m=a.centerPoint.add(v),g=a.pointLocation(m),y=e.LngLat.convert(t.center||g);this._normalizeCenter(y);var x=a.project(g),b=a.project(y).sub(x),_=t.curve,w=Math.max(a.width,a.height),k=w/h,T=b.mag();if("minZoom"in t){var M=e.clamp(Math.min(t.minZoom,o,c),a.minZoom,a.maxZoom),S=w/a.zoomScale(M-o);_=Math.sqrt(S/T*2)}var A=_*_;function C(e){var t=(k*k-w*w+(e?-1:1)*A*A*T*T)/(2*(e?k:w)*A*T);return Math.log(Math.sqrt(t*t+1)-t)}function E(e){return(Math.exp(e)-Math.exp(-e))/2}function P(e){return(Math.exp(e)+Math.exp(-e))/2}function L(e){return E(e)/P(e)}var I=C(0),R=function(e){return P(I)/P(I+_*e)},O=function(e){return w*((P(I)*L(I+_*e)-E(I))/A)/T},D=(C(1)-I)/_;if(Math.abs(T)<1e-6||!isFinite(D)){if(Math.abs(w-k)<1e-6)return this.easeTo(t,r);var z=kt.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==f,this._pitching=d!==l,this._padding=!a.isPaddingEqual(p),this._prepareEase(r,!1),this._ease((function(t){var i=t*D,h=1/R(i);a.zoom=1===t?c:o+a.scaleZoom(h),n._rotating&&(a.bearing=e.number(s,f,t)),n._pitching&&(a.pitch=e.number(l,d,t)),n._padding&&(a.interpolatePadding(u,p,t),m=a.centerPoint.add(v));var g=1===t?y:a.unproject(x.add(b.mult(O(i))).mult(h));a.setLocationAtPoint(a.renderWorldCopies?g.wrap():g,m),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),t),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}if(!e){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(t,r,n){!1===n.animate||0===n.duration?(t(1),r()):(this._easeStart=e.browser.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var t=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(t,r){t=e.wrap(t,-180,180);var n=Math.abs(t-r);return Math.abs(t-360-r)180?-360:r<-180?360:0}},r}(e.Evented),Ao=function(t){void 0===t&&(t={}),this.options=t,e.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};Ao.prototype.getDefaultPosition=function(){return"bottom-right"},Ao.prototype.onAdd=function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Ao.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Ao.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){var n=r.reduce((function(e,t,n){return t.value&&(e+=t.key+"="+t.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,e.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Ao.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var Co=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Co.prototype.onAdd=function(e){this._map=e,this._container=r.create("div","mapboxgl-ctrl");var t=r.create("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Co.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Co.prototype.getDefaultPosition=function(){return"bottom-left"},Co.prototype._updateLogo=function(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Co.prototype._logoRequired=function(){if(this._map.style){var e=this._map.style.sourceCaches;for(var t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},Co.prototype._updateCompact=function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}};var Eo=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Eo.prototype.add=function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t},Eo.prototype.remove=function(e){for(var t=this._currentlyRunning,r=0,n=t?this._queue.concat(t):this._queue;rt.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitchFo)throw new Error("maxPitch must be less than or equal to "+Fo);var i=new ga(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies);if(n.call(this,i,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new Eo,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Po,t.locale),this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken),"string"===typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error("Container '"+t.container+"' not found.")}else{if(!(t.container instanceof Io))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),"undefined"!==typeof e.window&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new Mo(this,t);var a="string"===typeof t.hash&&t.hash||void 0;this._hash=t.hash&&new ba(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new Ao({customAttribution:t.customAttribution})),this.addControl(new Co,t.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(t){r._update("style"===t.dataType),r.fire(new e.Event(t.dataType+"data",t))})),this.on("dataloading",(function(t){r.fire(new e.Event(t.dataType+"dataloading",t))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(t,r){if(void 0===r&&t.getDefaultPosition&&(r=t.getDefaultPosition()),void 0===r&&(r="top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this},i.prototype.resize=function(t){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t))),this.fire(new e.Event("resize",t)),a&&this.fire(new e.Event("moveend",t)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()},i.prototype.setMinZoom=function(e){if((e=null===e||void 0===e?Oo:e)>=Oo&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(e){if((e=null===e||void 0===e?zo:e)=zo&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()Fo)throw new Error("maxPitch must be less than or equal to "+Fo);if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(e){return this.transform.renderWorldCopies=e,this._update()},i.prototype.project=function(t){return this.transform.locationPoint(e.LngLat.convert(t))},i.prototype.unproject=function(t){return this.transform.pointLocation(e.Point.convert(t))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(e,t,r){var n,i=this;if("mouseenter"===e||"mouseover"===e){var a=!1,o=function(n){var o=i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[];o.length?a||(a=!0,r.call(i,new Ea(e,i,n.originalEvent,{features:o}))):a=!1};return{layer:t,listener:r,delegates:{mousemove:o,mouseout:function(){a=!1}}}}if("mouseleave"===e||"mouseout"===e){var s=!1,l=function(n){(i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[]).length?s=!0:s&&(s=!1,r.call(i,new Ea(e,i,n.originalEvent)))},u=function(t){s&&(s=!1,r.call(i,new Ea(e,i,t.originalEvent)))};return{layer:t,listener:r,delegates:{mousemove:l,mouseout:u}}}var c=function(e){var n=i.getLayer(t)?i.queryRenderedFeatures(e.point,{layers:[t]}):[];n.length&&(e.features=n,r.call(i,e),delete e.features)};return{layer:t,listener:r,delegates:(n={},n[e]=c,n)}},i.prototype.on=function(e,t,r){if(void 0===r)return n.prototype.on.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(e,t,r){if(void 0===r)return n.prototype.once.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(e,t,r){var i=this;if(void 0===r)return n.prototype.off.call(this,e,t);var a=function(n){for(var a=n[e],o=0;o180;){var s=n.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}Uo.prototype.down=function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),r.disableDrag()},Uo.prototype.move=function(e,t){var r=this.map,n=this.mouseRotate.mousemoveWindow(e,t);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(e,t);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Uo.prototype.off=function(){var e=this.element;r.removeEventListener(e,"mousedown",this.mousedown),r.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(e,"touchmove",this.touchmove),r.removeEventListener(e,"touchend",this.touchend),r.removeEventListener(e,"touchcancel",this.reset),this.offTemp()},Uo.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(e.window,"mousemove",this.mousemove),r.removeEventListener(e.window,"mouseup",this.mouseup)},Uo.prototype.mousedown=function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),r.mousePos(this.element,t)),r.addEventListener(e.window,"mousemove",this.mousemove),r.addEventListener(e.window,"mouseup",this.mouseup)},Uo.prototype.mousemove=function(e){this.move(e,r.mousePos(this.element,e))},Uo.prototype.mouseup=function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()},Uo.prototype.touchstart=function(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos))},Uo.prototype.touchmove=function(e){1!==e.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos))},Uo.prototype.touchend=function(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)t.getEast()||r.latitudet.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}},n.prototype._updateCamera=function(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(t){if(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),r=this._map.unproject([1,e]),n=t.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Jo)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(t){var n=this;if(this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Yo(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Yo({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(t){var r=t.originalEvent&&"resize"===t.originalEvent.type;t.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new e.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":$o--,Jo=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++$o>1?(t={maximumAge:6e5,timeout:0},Jo=!0):(t=this.options.positionOptions,Jo=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(e.Evented),es={maxWidth:100,unit:"metric"},ts=function(t){this.options=e.extend({},es,t),e.bindAll(["_onMove","setUnit"],this)};function rs(e,t,r){var n=r&&r.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?ns(t,n,l/5280,e._getUIString("ScaleControl.Miles")):ns(t,n,l,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?ns(t,n,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?ns(t,n,s/1e3,e._getUIString("ScaleControl.Kilometers")):ns(t,n,s,e._getUIString("ScaleControl.Meters"))}function ns(e,t,r,n){var i=as(r),a=i/r;e.style.width=t*a+"px",e.innerHTML=i+" "+n}function is(e){var t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}function as(e){var t=Math.pow(10,(""+Math.floor(e)).length-1),r=e/t;return t*(r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:is(r))}ts.prototype.getDefaultPosition=function(){return"bottom-left"},ts.prototype._onMove=function(){rs(this._map,this._container,this.options)},ts.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},ts.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},ts.prototype.setUnit=function(e){this.options.unit=e,rs(this._map,this._container,this.options)};var os=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};os.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},os.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},os.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},os.prototype._setupUI=function(){var t=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden",!0),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},os.prototype._updateTitle=function(){var e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e},os.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},os.prototype._isFullscreen=function(){return this._fullscreen},os.prototype._changeIcon=function(){(e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},os.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var ss={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},ls=function(t){function n(r){t.call(this),this.options=e.extend(Object.create(ss),r),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(t){return this.setDOMContent(e.window.document.createTextNode(t))},n.prototype.setHTML=function(t){var r,n=e.window.document.createDocumentFragment(),i=e.window.document.createElement("body");for(i.innerHTML=t;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(e){return this.options.maxWidth=e,this._update(),this},n.prototype.setDOMContent=function(e){return this._createContent(),this._content.appendChild(e),this._update(),this},n.prototype.addClassName=function(e){this._container&&this._container.classList.add(e)},n.prototype.removeClassName=function(e){this._container&&this._container.classList.remove(e)},n.prototype.toggleClassName=function(e){if(this._container)return this._container.classList.toggle(e)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(e){this._update(e.point)},n.prototype._onMouseMove=function(e){this._update(e.point)},n.prototype._onDrag=function(e){this._update(e.point)},n.prototype._update=function(e){var t=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(e){return t._container.classList.add(e)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ho(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,o=us(this.options.offset);if(!a){var s,l=this._container.offsetWidth,u=this._container.offsetHeight;s=i.y+o.bottom.ythis._map.transform.height-u?["bottom"]:[],i.xthis._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var c=i.add(o[a]).round();r.setTransform(this._container,Wo[a]+" translate("+c.x+"px,"+c.y+"px)"),Go(this._container,a,"popup")}},n.prototype._onClose=function(){this.remove()},n}(e.Evented);function us(t){if(t){if("number"===typeof t){var r=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{center:new e.Point(0,0),top:new e.Point(0,t),"top-left":new e.Point(r,r),"top-right":new e.Point(-r,r),bottom:new e.Point(0,-t),"bottom-left":new e.Point(r,-r),"bottom-right":new e.Point(-r,-r),left:new e.Point(t,0),right:new e.Point(-t,0)}}if(t instanceof e.Point||Array.isArray(t)){var n=e.Point.convert(t);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:e.Point.convert(t.center||[0,0]),top:e.Point.convert(t.top||[0,0]),"top-left":e.Point.convert(t["top-left"]||[0,0]),"top-right":e.Point.convert(t["top-right"]||[0,0]),bottom:e.Point.convert(t.bottom||[0,0]),"bottom-left":e.Point.convert(t["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(t["bottom-right"]||[0,0]),left:e.Point.convert(t.left||[0,0]),right:e.Point.convert(t.right||[0,0])}}return us(new e.Point(0,0))}var cs={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:No,NavigationControl:Vo,GeolocateControl:Qo,AttributionControl:Ao,ScaleControl:ts,FullscreenControl:os,Popup:ls,Marker:Yo,Style:mr,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:at,clearPrewarmedResources:ot,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return tt.workerCount},set workerCount(e){tt.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){e.clearTileCache(t)},workerUrl:""};return cs})),r}()},27084:function(e){"use strict";e.exports=Math.log2||function(e){return Math.log(e)*Math.LOG2E}},16825:function(e,t,r){"use strict";e.exports=function(e,t){t||(t=e,e=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function u(e,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||u!==i||c!==a||l(s))&&(r=0|e,i=u||0,a=c||0,t&&t(r,i,a,o))}function c(e){u(0,e)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function d(e){l(e)&&t&&t(r,i,a,o)}function p(e){0===n.buttons(e)?u(0,e):u(r,e)}function h(e){u(r|n.buttons(e),e)}function v(e){u(r&~n.buttons(e),e)}function m(){s||(s=!0,e.addEventListener("mousemove",p),e.addEventListener("mousedown",h),e.addEventListener("mouseup",v),e.addEventListener("mouseleave",c),e.addEventListener("mouseenter",c),e.addEventListener("mouseout",c),e.addEventListener("mouseover",c),e.addEventListener("blur",f),e.addEventListener("keyup",d),e.addEventListener("keydown",d),e.addEventListener("keypress",d),e!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",d),window.addEventListener("keydown",d),window.addEventListener("keypress",d)))}m();var g={element:e};return Object.defineProperties(g,{enabled:{get:function(){return s},set:function(t){t?m():s&&(s=!1,e.removeEventListener("mousemove",p),e.removeEventListener("mousedown",h),e.removeEventListener("mouseup",v),e.removeEventListener("mouseleave",c),e.removeEventListener("mouseenter",c),e.removeEventListener("mouseout",c),e.removeEventListener("mouseover",c),e.removeEventListener("blur",f),e.removeEventListener("keyup",d),e.removeEventListener("keydown",d),e.removeEventListener("keypress",d),e!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",d),window.removeEventListener("keydown",d),window.removeEventListener("keypress",d)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),g};var n=r(74311)},48956:function(e){var t={left:0,top:0};e.exports=function(e,r,n){r=r||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=e.clientX||0,o=e.clientY||0,s=(i=r)===window||i===document||i===document.body?t:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},74311:function(e,t){"use strict";function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"===typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<=0)return 1<0&&a(s,r))}catch(m){c.call(new d(r),m)}}}function c(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function f(e,t,r,n){for(var i=0;i1&&(i*=g=Math.sqrt(g),s*=g);var y=i*i,x=s*s,b=(u==c?-1:1)*Math.sqrt(Math.abs((y*x-y*m*m-x*v*v)/(y*m*m+x*v*v)));b==1/0&&(b=1);var _=b*i*m/s+(e+f)/2,w=b*-s*v/i+(n+d)/2,k=Math.asin(((n-w)/s).toFixed(9)),T=Math.asin(((d-w)/s).toFixed(9));(k=e<_?t-k:k)<0&&(k=2*t+k),(T=f<_?t-T:T)<0&&(T=2*t+T),c&&k>T&&(k-=2*t),!c&&T>k&&(T-=2*t)}if(Math.abs(T-k)>r){var M=T,S=f,A=d;T=k+r*(c&&T>k?1:-1);var C=a(f=_+i*Math.cos(T),d=w+s*Math.sin(T),i,s,l,0,c,S,A,[T,M,_,w])}var E=Math.tan((T-k)/4),P=4/3*i*E,L=4/3*s*E,I=[2*e-(e+P*Math.sin(k)),2*n-(n-L*Math.cos(k)),f+P*Math.sin(T),d-L*Math.cos(T),f,d];if(p)return I;C&&(I=I.concat(C));for(var R=0;R7&&(r.push(g.splice(0,7)),g.unshift("C"));break;case"S":var x=p,b=h;"C"!=t&&"S"!=t||(x+=x-o,b+=b-l),g=["C",x,b,g[1],g[2],g[3],g[4]];break;case"T":"Q"==t||"T"==t?(f=2*p-f,d=2*h-d):(f=p,d=h),g=i(p,h,f,d,g[1],g[2]);break;case"Q":f=g[1],d=g[2],g=i(p,h,g[1],g[2],g[3],g[4]);break;case"L":g=n(p,h,g[1],g[2]);break;case"H":g=n(p,h,g[1],h);break;case"V":g=n(p,h,p,g[1]);break;case"Z":g=n(p,h,u,c)}t=y,p=g[g.length-2],h=g[g.length-1],g.length>4?(o=g[g.length-4],l=g[g.length-3]):(o=p,l=h),r.push(g)}return r}},56131:function(e){"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(e,i){for(var a,o,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l0&&!i.call(e,0))for(var v=0;v0)for(var m=0;m=0&&"[object Function]"===t.call(e.callee)),n}},88641:function(e){"use strict";function t(e,t){if("string"!==typeof e)return[e];var r=[e];"string"===typeof t||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],i=t.escape||"___",a=!!t.flat;n.forEach((function(e){var t=new RegExp(["\\",e[0],"[^\\",e[0],"\\",e[1],"]*\\",e[1]].join("")),n=[];function a(t,a,o){var s=r.push(t.slice(e[0].length,-e[1].length))-1;return n.push(s),i+s+i}r.forEach((function(e,n){for(var i,o=0;e!=i;)if(i=e,e=e.replace(t,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=e})),n=n.reverse(),r=r.map((function(t){return n.forEach((function(r){t=t.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),e[0]+"$1"+e[1])})),t}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function e(t,r,n){for(var i,a=[],s=0;i=o.exec(t);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(t.slice(0,i.index)),a.push(e(r[i[1]],r)),t=t.slice(i.index+i[0].length)}return a.push(t),a}(r[0],r)}function r(e,t){if(t&&t.flat){var r,n=t&&t.escape||"___",i=e[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+e);r=i,i=i.replace(a,s)}return i}return e.reduce((function e(t,r){return Array.isArray(r)&&(r=r.reduce(e,"")),t+r}),"");function s(t,r){if(null==e[r])throw Error("Reference "+r+"is undefined");return e[r]}}function n(e,n){return Array.isArray(e)?r(e,n):t(e,n)}n.parse=t,n.stringify=r,e.exports=n},18863:function(e,t,r){"use strict";var n=r(71299);e.exports=function(e){var t;return arguments.length>1&&(e=arguments),"string"===typeof e?e=e.split(/\s/).map(parseFloat):"number"===typeof e&&(e=[e]),e.length&&"number"===typeof e[0]?t=1===e.length?{width:e[0],height:e[0],x:0,y:0}:2===e.length?{width:e[0],height:e[1],x:0,y:0}:{x:e[0],y:e[1],width:e[2]-e[0]||0,height:e[3]-e[1]||0}:e&&(t={x:(e=n(e,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:e.top||0},null==e.width?e.right?t.width=e.right-t.x:t.width=0:t.width=e.width,null==e.height?e.bottom?t.height=e.bottom-t.y:t.height=0:t.height=e.height),t}},95616:function(e){e.exports=function(e){var i=[];return e.replace(r,(function(e,r,a){var o=r.toLowerCase();for(a=function(e){var t=e.match(n);return t?t.map(Number):[]}(a),"m"==o&&a.length>2&&(i.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==t[o])return a.unshift(r),i.push(a);if(a.lengtha!==p>a&&i<(d-c)*(a-f)/(p-f)+c&&(o=!o)}return o}},52142:function(e,t,r){var n,i=r(69444),a=r(29023),o=r(87263),s=r(11328),l=r(55968),u=r(10670),c=!1,f=a();function d(e,t,r){var i=n.segments(e),a=n.segments(t),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(e){return!0===e?c=i():!1===e&&(c=!1),!1!==c&&c.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,c);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,c).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:l.union(e.combined,c),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:l.intersect(e.combined,c),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:l.difference(e.combined,c),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:l.differenceRev(e.combined,c),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:l.xor(e.combined,c),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:s(e.segments,f,c),inverted:e.inverted}},polygonFromGeoJSON:function(e){return u.toPolygon(n,e)},polygonToGeoJSON:function(e){return u.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"===typeof window&&(window.PolyBool=n),e.exports=n},69444:function(e){e.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!==typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},29023:function(e){e.exports=function(e){"number"!==typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"===typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=t[0];return(o-i)*(t[1]-a)-(s-a)*(l-i)>=-e},pointBetween:function(t,r,n){var i=t[1]-r[1],a=n[0]-r[0],o=t[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-i>e&&(a-u)*(i-c)/(o-c)+u-n>e&&(s=!s),a=u,o=c}return s}};return t}},10670:function(e){var t={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),i=1;i0}))}function c(e,n){var i=e.seg,a=n.seg,o=i.start,s=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);var f=t.linesIntersect(o,s,u,c);if(!1===f){if(!t.pointsCollinear(o,s,u))return!1;if(t.pointsSame(o,c)||t.pointsSame(s,u))return!1;var d=t.pointsSame(o,u),p=t.pointsSame(s,c);if(d&&p)return n;var h=!d&&t.pointBetween(o,u,c),v=!p&&t.pointBetween(s,u,c);if(d)return v?l(n,s):l(e,c),n;h&&(p||(v?l(n,s):l(e,c)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(e,u):0===f.alongB?l(e,f.pt):1===f.alongB&&l(e,c)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[],d=function(){if(p=a.getHead(),r&&r.vert(p.pt[0]),p.isStart){if(r&&r.segmentNew(p.seg,p.primary),h=u(p),v=h.before?h.before.ev:null,m=h.after?h.after.ev:null,r&&r.tempStatus(p.seg,!!v&&v.seg,!!m&&m.seg),(g=function(){if(v){var e=c(p,v);if(e)return e}return!!m&&c(p,m)}())&&(e?(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above):g.seg.otherFill=p.seg.myFill,r&&r.segmentUpdate(g.seg),p.other.remove(),p.remove()),a.getHead()!==p)return r&&r.rewind(p.seg),"continue";e?(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=m?m.seg.myFill.above:i,p.seg.myFill.above=y?!p.seg.myFill.below:p.seg.myFill.below):null===p.seg.otherFill&&(x=m?p.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:p.primary?o:i,p.seg.otherFill={above:x,below:x}),r&&r.status(p.seg,!!v&&v.seg,!!m&&m.seg),p.other.status=h.insert(n.node({ev:p}))}else{if(null===(b=p.status))throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");s.exists(b.prev)&&s.exists(b.next)&&c(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),p.primary||(_=p.seg.myFill,p.seg.myFill=p.seg.otherFill,p.seg.otherFill=_),f.push(p.seg)}a.getHead().remove()};!a.isEmpty();){var p,h,v,m,g,y,x,b,_;d()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,i,a,o=e[e.length-1],l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},n.prototype.read_uint16=function(e){var r=this.input;if(e+2>r.length)throw t("unexpected EOF","EBADDATA");return this.big_endian?256*r[e]+r[e+1]:r[e]+256*r[e+1]},n.prototype.read_uint32=function(e){var r=this.input;if(e+4>r.length)throw t("unexpected EOF","EBADDATA");return this.big_endian?16777216*r[e]+65536*r[e+1]+256*r[e+2]+r[e+3]:r[e]+256*r[e+1]+65536*r[e+2]+16777216*r[e+3]},n.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},n.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},n.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return r=this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return r=this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return r=this.read_uint32(t);case 9:return 0|(r=this.read_uint32(t));default:return null}},n.prototype.scan_ifd=function(e,n,i){var a=this.read_uint16(n);n+=2;for(var o=0;othis.input.length)throw t("unexpected EOF","EBADDATA");for(var h=[],v=d,m=0;m0&&(this.ifds_to_read.push({id:s,offset:h[0]}),p=!0),!1===i({is_big_endian:this.big_endian,ifd:e,tag:s,format:l,count:u,entry_offset:n+this.start,data_length:f,data_offset:d+this.start,value:h,is_subifd_link:p}))return void(this.aborted=!0);n+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(n)})},e.exports.ExifParser=n,e.exports.get_orientation=function(e){var t=0;try{return new n(e,0,e.length).each((function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch(r){return-1}}},76767:function(e,t,r){"use strict";var n=r(14847).n8,i=r(14847).Ag;function a(e,t){if(e.length<4+t)return null;var r=i(e,t);return e.length>4&15,i=15&e[4],a=e[5]>>4&15,o=n(e,6),l=8,u=0;ut.width||e.width===t.width&&e.height>t.height?e:t})),r=e.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t}));return t.width>r.height||t.width===r.height&&t.height>r.width?t:r}(t.sizes),n=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(n=0===e.value?r[n]:t[n=t[n=r[n]]]),"irot"===e.type)for(var i=0;i1&&(d.variants=f.variants),f.orientation&&(d.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=e.length){var p=a(e,f.exif_location.offset),h=e.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),v=s.get_orientation(h);v>0&&(d.orientation=v)}return d}}}}}}},2504:function(e,t,r){"use strict";var n=r(14847).eG,i=r(14847).OF,a=r(14847).mP,o=n("BM");e.exports=function(e){if(!(e.length<26)&&i(e,0,o))return{width:a(e,18),height:a(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},47342:function(e,t,r){"use strict";var n=r(14847).eG,i=r(14847).OF,a=r(14847).mP,o=n("GIF87a"),s=n("GIF89a");e.exports=function(e){if(!(e.length<10)&&(i(e,0,o)||i(e,0,s)))return{width:a(e,6),height:a(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},31355:function(e,t,r){"use strict";var n=r(14847).mP;e.exports=function(e){var t=n(e,0),r=n(e,2),i=n(e,4);if(0===t&&1===r&&i){for(var a=[],o={width:0,height:0},s=0;so.width||u>o.height)&&(o=c)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},54261:function(e,t,r){"use strict";var n=r(14847).n8,i=r(14847).eG,a=r(14847).OF,o=r(71371),s=i("Exif\0\0");e.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1]&&255===e[2])for(var t=2;;){for(;;){if(e.length-t<2)return;if(255===e[t++])break}for(var r,i,l=e[t++];255===l;)l=e[t++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(e.length-t<2)return;r=n(e,t)-2,t+=2}if(217===l||218===l)return;if(225===l&&r>=10&&a(e,t,s)&&(i=o.get_orientation(e.slice(t+6,t+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(e.length-t0&&(u.orientation=i),u}t+=r}}},6303:function(e,t,r){"use strict";var n=r(14847).eG,i=r(14847).OF,a=r(14847).Ag,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(e){if(!(e.length<24)&&i(e,0,o)&&i(e,12,s))return{width:a(e,16),height:a(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},38689:function(e,t,r){"use strict";var n=r(14847).eG,i=r(14847).OF,a=r(14847).Ag,o=n("8BPS\0\x01");e.exports=function(e){if(!(e.length<22)&&i(e,0,o))return{width:a(e,18),height:a(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},6881:function(e){"use strict";function t(e){return"number"===typeof e&&isFinite(e)&&e>0}var r=/<[-_.:a-zA-Z0-9][^>]*>/,n=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,i=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,a=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,s=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function l(e){return s.test(e)?e.match(s)[0]:"px"}e.exports=function(e){if(function(e){var t,r=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function d(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<e.length)){for(;t+8=10?r=r||c(e,t+8):"VP8L"===p&&h>=9?r=r||f(e,t+8):"VP8X"===p&&h>=10?r=r||d(e,t+8):"EXIF"===p&&(n=s.get_orientation(e.slice(t+8,t+8+h)),t=1/0),t+=8+h}else t++;if(r)return n>0&&(r.orientation=n),r}}}},91497:function(e,t,r){"use strict";e.exports={avif:r(24461),bmp:r(2504),gif:r(47342),ico:r(31355),jpeg:r(54261),png:r(6303),psd:r(38689),svg:r(6881),tiff:r(66278),webp:r(90784)}},33575:function(e,t,r){"use strict";var n=r(91497);e.exports=function(e){return function(e){for(var t=Object.keys(n),r=0;r1)for(var r=1;r1&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],r(e),e.after&&e.after(e))}function k(e){if(e){null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var t=0,r=0;if(b.groups=x=e.map((function(e,u){var c=x[u];return e?("function"===typeof e?e={after:e}:"number"===typeof e[0]&&(e={positions:e}),e=o(e,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),c||(x[u]=c={id:u,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},e=s({},y,e)),a(c,e,[{lineWidth:function(e){return.5*+e},capSize:function(e){return.5*+e},opacity:parseFloat,errors:function(e){return e=l(e),r+=e.length,e},positions:function(e,r){return e=l(e,"float64"),r.count=Math.floor(e.length/2),r.bounds=n(e,2),r.offset=t,t+=r.count,e}},{color:function(e,t){var r=t.count;if(e||(e="transparent"),!Array.isArray(e)||"number"===typeof e[0]){var n=e;e=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:e.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(s){t=i}return{fill:e({primitive:"triangle",elements:function(e,t){return t.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:e.prop("scale"),color:e.prop("fill"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),viewport:function(e,t){return[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]}},attributes:{position:{buffer:e.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:t}},g.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},g.prototype.render=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];t.length&&(e=this).update.apply(e,t),this.draw()},g.prototype.draw=function(){for(var e=this,t=[],r=arguments.length;r--;)t[r]=arguments[r];return(t.length?t:this.passes).forEach((function(t,r){var n;if(t&&Array.isArray(t))return(n=e).draw.apply(n,t);"number"===typeof t&&(t=e.passes[t]),t&&t.count>1&&t.opacity&&(e.regl._refresh(),t.fill&&t.triangles&&t.triangles.length>2&&e.shaders.fill(t),t.thickness&&(t.scale[0]*t.viewport.width>g.precisionThreshold||t.scale[1]*t.viewport.height>g.precisionThreshold||"rect"===t.join||!t.join&&(t.thickness<=2||t.count>=g.maxPoints)?e.shaders.rect(t):e.shaders.miter(t)))})),this},g.prototype.update=function(e){var t=this;if(e){null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var r=this.regl,o=this.gl;if(e.forEach((function(e,f){var h=t.passes[f];if(void 0!==e)if(null!==e){if("number"===typeof e[0]&&(e={positions:e}),e=s(e,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),h||(t.passes[f]=h={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},e=a({},g.defaults,e)),null!=e.thickness&&(h.thickness=parseFloat(e.thickness)),null!=e.opacity&&(h.opacity=parseFloat(e.opacity)),null!=e.miterLimit&&(h.miterLimit=parseFloat(e.miterLimit)),null!=e.overlay&&(h.overlay=!!e.overlay,f=D}));(I=I.slice(0,z)).push(D)}for(var F=function(e){var t=T.slice(2*O,2*I[e]).concat(D?T.slice(2*D):[]),r=(h.hole||[]).map((function(t){return t-D+(I[e]-O)})),n=u(t,r);n=n.map((function(t){return t+O+(t+Oe.length)&&(t=e.length);for(var r=0,n=new Array(t);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),u.vert=d(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(u.frag=u.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=e(u)}b.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},b.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},b.prototype.draw=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;nn)?t.tree=c(e,{bounds:f}):n&&n.length&&(t.tree=n),t.tree){var d={primitive:"points",usage:"static",data:t.tree,type:"uint32"};t.elements?t.elements(d):t.elements=o.elements(d)}var p=g.float32(e);return i({data:p,usage:"dynamic"}),a({data:g.fract32(e,p),usage:"dynamic"}),s({data:new Uint8Array(u),type:"uint8",usage:"stream"}),e}},{marker:function(t,r,n){var i=r.activation;if(i.forEach((function(e){return e&&e.destroy&&e.destroy()})),i.length=0,t&&"number"!==typeof t[0]){for(var a=[],s=0,l=Math.min(t.length,r.count);s=0)return a;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)t=e;else{t=new Uint8Array(e.length);for(var o=0,s=e.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},b.prototype.updatePalette=function(e){if(!this.tooManyColors){var t=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*e.length/t);if(n>1)for(var i=.25*(e=e.slice()).length%t;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x,s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y,l.height),[a,n,o,i]}function p(e){if("number"===typeof e)return[e,e,e,e];if(2===e.length)return[e[0],e[1],e[0],e[1]];var t=l(e);return[t.x,t.y,t.x+t.width,t.y+t.height]}e.exports=c,c.prototype.render=function(){for(var e,t=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(e=this).update.apply(e,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){t.draw(),t.dirty=!0,t.planned=null}))):(this.draw(),this.dirty=!0,o((function(){t.dirty=!1}))),this)},c.prototype.update=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t.length){for(var n=0;nT))&&(s.lower||!(k>>=t))<<3,(t|=r=(15<(e>>>=r))<<2)|(r=(3<(e>>>=r))<<1)|e>>>r>>1}function p(){function e(e){e:{for(var t=16;268435456>=t;t*=16)if(e<=t){e=t;break e}e=0}return 0<(t=r[d(e)>>2]).length?t.pop():new ArrayBuffer(e)}function t(e){r[d(e.byteLength)>>2].push(e)}var r=f(8,(function(){return[]}));return{alloc:e,free:t,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(e){t(e.buffer)}}}function h(e){return!!e&&"object"===typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"===typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||oe(e.data))}function v(e,t,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===c?i>>=1:5125===c&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(e){n.elementsCount--,delete s[e.id],e.buffer.destroy(),e.buffer=null}var s={},l=0,u={uint8:5121,uint16:5123};t.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var c=[];return{create:function(e,t){function s(e){if(e)if("number"===typeof e)l(e),c.primType=4,c.vertCount=0|e,c.type=5121;else{var t=null,r=35044,n=-1,i=-1,o=0,f=0;Array.isArray(e)||oe(e)||h(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(r=fe[e.usage]),"primitive"in e&&(n=ve[e.primitive]),"count"in e&&(i=0|e.count),"type"in e&&(f=u[e.type]),"length"in e?o=0|e.length:(o=i,5123===f||5122===f?o*=2:5125!==f&&5124!==f||(o*=4))),a(c,t,r,n,i,o,f)}else l(),c.primType=4,c.vertCount=0,c.type=5121;return s}var l=r.create(null,34963,!0),c=new i(l._buffer);return n.elementsCount++,s(e),s._reglType="elements",s._elements=c,s.subdata=function(e,t){return l.subdata(e,t),s},s.destroy=function(){o(c)},s},createStream:function(e){var t=c.pop();return t||(t=new i(r.create(null,34963,!0,!1)._buffer)),a(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){c.push(e)},getElements:function(e){return"function"===typeof e&&e._elements instanceof i?e._elements:null},clear:function(){se(s).forEach(o)}}}function w(e){for(var t=ie.allocType(5123,e.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;t[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,d(r,n[i]),e.mipmask|=1<t;++t)e.images[t]=null;return e}function T(e){for(var t=e.images,r=0;rt){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var e=0;return Object.keys(ae).forEach((function(t){e+=ae[t].stats.size})),e}),{create2D:function(t,r){function n(e,t){var r=i.texInfo;L.call(r);var a=_();return"number"===typeof e?y(a,0|e,"number"===typeof t?0|t:0|e):e?(I(r,e),x(a,e)):y(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,l(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,D(i),b(a,3553),R(r,3553),z(),T(a),o.profile&&(i.stats.size=P(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=Y[i.internalformat],n.type=X[i.type],n.mag=K[r.magFilter],n.min=$[r.minFilter],n.wrapS=J[r.wrapS],n.wrapT=J[r.wrapT],n}var i=new O(3553);return ae[i.id]=i,a.textureCount++,n(t,r),n.subimage=function(e,t,r,a){t|=0,r|=0,a|=0;var o=v();return l(o,i),o.width=0,o.height=0,d(o,e),o.width=o.width||(i.width>>a)-t,o.height=o.height||(i.height>>a)-r,D(i),p(o,3553,t,r,a),z(),m(o),n},n.resize=function(t,r){var a=0|t,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,D(i);for(var l=0;i.mipmask>>l;++l){var u=a>>l,c=s>>l;if(!u||!c)break;e.texImage2D(3553,l,i.format,u,c,0,i.format,i.type,null)}return z(),o.profile&&(i.stats.size=P(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(t,r,n,i,s,c){function f(e,t,r,n,i,a){var s,c=h.texInfo;for(L.call(c),s=0;6>s;++s)g[s]=_();if("number"!==typeof e&&e){if("object"===typeof e)if(t)x(g[0],e),x(g[1],t),x(g[2],r),x(g[3],n),x(g[4],i),x(g[5],a);else if(I(c,e),u(h,e),"faces"in e)for(e=e.faces,s=0;6>s;++s)l(g[s],h),x(g[s],e[s]);else for(s=0;6>s;++s)x(g[s],e)}else for(e=0|e||1,s=0;6>s;++s)y(g[s],e,e);for(l(h,g[0]),h.mipmask=c.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,D(h),s=0;6>s;++s)b(g[s],34069+s);for(R(c,34067),z(),o.profile&&(h.stats.size=P(h.internalformat,h.type,f.width,f.height,c.genMipmaps,!0)),f.format=Y[h.internalformat],f.type=X[h.type],f.mag=K[c.magFilter],f.min=$[c.minFilter],f.wrapS=J[c.wrapS],f.wrapT=J[c.wrapT],s=0;6>s;++s)T(g[s]);return f}var h=new O(34067);ae[h.id]=h,a.cubeCount++;var g=Array(6);return f(t,r,n,i,s,c),f.subimage=function(e,t,r,n,i){r|=0,n|=0,i|=0;var a=v();return l(a,h),a.width=0,a.height=0,d(a,t),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,D(h),p(a,34069+e,r,n,i),z(),m(a),f},f.resize=function(t){if((t|=0)!==h.width){f.width=h.width=t,f.height=h.height=t,D(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)e.texImage2D(34069+r,n,h.format,t>>n,t>>n,0,h.format,h.type,null);return z(),o.profile&&(h.stats.size=P(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var t=0;tr;++r)if(0!==(t.mipmask&1<>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;6>n;++n)e.texImage2D(34069+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);R(t.texInfo,t.target)}))},refresh:function(){for(var t=0;ti;++i){for(u=0;ue;++e)r[e].resize(n);return t.width=t.height=n,t},_reglType:"framebufferCube",destroy:function(){r.forEach((function(e){e.destroy()}))}})},clear:function(){se(T).forEach(m)},restore:function(){x.cur=null,x.next=null,x.dirty=!0,se(T).forEach((function(t){t.framebuffer=e.createFramebuffer(),g(t)}))}})}function R(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function O(e,t,r,n,i,a,o){function s(e){if(e!==g.currentVAO){var r=t.oes_vertex_array_object;e?r.bindVertexArrayOES(e.vao):r.bindVertexArrayOES(null),g.currentVAO=e}}function l(r){if(r!==g.currentVAO){if(r)r.bindAttrs();else{for(var n=t.angle_instanced_arrays,i=0;i=f.byteLength?l.subdata(f):(l.destroy(),r.buffers[s]=null)),r.buffers[s]||(l=r.buffers[s]=i.create(u,34962,!1,!0)),c.buffer=i.getBuffer(l),c.size=0|c.buffer.dimension,c.normalized=!1,c.type=c.buffer.dtype,c.offset=0,c.stride=0,c.divisor=0,c.state=1,e[s]=1):i.getBuffer(u)?(c.buffer=i.getBuffer(u),c.size=0|c.buffer.dimension,c.normalized=!1,c.type=c.buffer.dtype,c.offset=0,c.stride=0,c.divisor=0,c.state=1):i.getBuffer(u.buffer)?(c.buffer=i.getBuffer(u.buffer),c.size=0|(+u.size||c.buffer.dimension),c.normalized=!!u.normalized||!1,c.type="type"in u?ce[u.type]:c.buffer.dtype,c.offset=0|(u.offset||0),c.stride=0|(u.stride||0),c.divisor=0|(u.divisor||0),c.state=1):"x"in u&&(c.x=+u.x||0,c.y=+u.y||0,c.z=+u.z||0,c.w=+u.w||0,c.state=2)}for(l=0;le&&(e=t.stats.uniformsCount)})),e},r.getMaxAttributesCount=function(){var e=0;return d.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var t=e.deleteShader.bind(e);se(u).forEach(t),u={},se(c).forEach(t),c={},d.forEach((function(t){e.deleteProgram(t.program)})),d.length=0,f={},r.shaderCount=0},program:function(t,n,i,a){var o=f[n];o||(o=f[n]={});var p=o[t];if(p&&(p.refCount++,!a))return p;var h=new s(n,t);return r.shaderCount++,l(h,i,a),p||(o[t]=h),d.push(h),Q(h,{destroy:function(){if(h.refCount--,0>=h.refCount){e.deleteProgram(h.program);var t=d.indexOf(h);d.splice(t,1),r.shaderCount--}0>=o[h.vertId].refCount&&(e.deleteShader(c[h.vertId]),delete c[h.vertId],delete f[h.fragId][h.vertId]),Object.keys(f[h.fragId]).length||(e.deleteShader(u[h.fragId]),delete u[h.fragId],delete f[h.fragId])}})},restore:function(){u={},c={};for(var e=0;e>2),r=0;r>5]|=(255&e.charCodeAt(r/8))<<24-r%32;var n,i,a,o,s,l,u,c,f,d,p,h=8*e.length;for(e=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),t[h>>5]|=128<<24-h%32,t[15+(h+64>>9<<4)]=h,c=0;cf;f++){var v;16>f?r[f]=t[f+c]:(d=f,p=B(p=Z(p=r[f-2],17)^Z(p,19)^p>>>10,r[f-7]),v=Z(v=r[f-15],7)^Z(v,18)^v>>>3,r[d]=B(B(p,v),r[f-16])),d=B(B(B(B(u,d=Z(d=o,6)^Z(d,11)^Z(d,25)),o&s^~o&l),Oe[f]),r[f]),p=B(u=Z(u=h,2)^Z(u,13)^Z(u,22),h&n^h&i^n&i),u=l,l=s,s=o,o=B(a,d),a=i,i=n,n=h,h=B(d,p)}e[0]=B(h,e[0]),e[1]=B(n,e[1]),e[2]=B(i,e[2]),e[3]=B(a,e[3]),e[4]=B(o,e[4]),e[5]=B(s,e[5]),e[6]=B(l,e[6]),e[7]=B(u,e[7])}for(t="",r=0;r<32*e.length;r+=8)t+=String.fromCharCode(e[r>>5]>>>24-r%32&255);return t}function j(e){for(var t,r="",n=0;n>>4&15)+"0123456789abcdef".charAt(15&t);return r}function N(e){for(var t,r,n="",i=-1;++i=t&&56320<=r&&57343>=r&&(t=65536+((1023&t)<<10)+(1023&r),i++),127>=t?n+=String.fromCharCode(t):2047>=t?n+=String.fromCharCode(192|t>>>6&31,128|63&t):65535>=t?n+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):2097151>=t&&(n+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return n}function Z(e,t){return e>>>t|e<<32-t}function B(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function V(e){return Array.prototype.slice.call(e)}function U(e){return V(e).join("")}function H(e){function t(){var e=[],t=[];return Q((function(){e.push.apply(e,V(arguments))}),{def:function(){var r="v"+i++;return t.push(r),0"+t+"?"+i+".constant["+t+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",c,"=",a,".createStream(",34962,",",i,".buffer);","}else{",c,"=",a,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",c,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",c,");","}"),l}))})),o}function L(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r=t[e];n[e]=X((function(e,t){return"number"===typeof r||"boolean"===typeof r?""+r:e.link(r)}))})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=K(t,(function(e,r){return e.invoke(r,t)}))})),n}function I(e,t,n,i,a){function o(e){var t=l[e];t&&(f[e]=t)}var s=M(e,t),l=T(e,p=w(e,a),a),c=A(e,a),f=C(e,a),d=S(e,a,s);o("viewport"),o(g("scissor.box"));var p,h=0>1)",s],");")}function t(){r(l,".drawArraysInstancedANGLE(",[h,v,m,s],");")}p&&"null"!==p?y?e():(r("if(",p,"){"),e(),r("}else{"),t(),r("}")):t()}function o(){function e(){r(c+".drawElements("+[h,m,g,v+"<<(("+g+"-5121)>>1)"]+");")}function t(){r(c+".drawArrays("+[h,v,m]+");")}p&&"null"!==p?y?e():(r("if(",p,"){"),e(),r("}else{"),t(),r("}")):t()}var s,l,u=e.shared,c=u.gl,f=u.draw,d=n.draw,p=function(){var i=d.elements,a=t;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(e,a),d.elementsActive&&a("if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",f,".","elements",";","if(",i,"){",c,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",u.vao,".currentVAO){",i,"=",e.shared.elements+".getElements("+u.vao,".currentVAO.elements);",fe?"":"if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),h=i("primitive"),v=i("offset"),m=function(){var i=d.count,a=t;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(e,a)):i=a.def(f,".","count"),i}();if("number"===typeof m){if(0===m)return}else r("if(",m,"){"),r.exit("}");le&&(s=i("instances"),l=e.instancing);var g=p+".type",y=d.elements&&Y(d.elements)&&!d.vaoActive;le&&("number"!==typeof s||0<=s)?"string"===typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function V(e,t,r,n,i){return i=(t=b()).proc("body",i),le&&(t.instancing=i.def(t.shared.extensions,".angle_instanced_arrays")),e(t,i,r,n),t.compile().body}function U(e,t,r,n){F(e,t),r.useVAO?r.drawVAO?t(e.shared.vao,".setVAO(",r.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),N(e,t,r,n.attributes,(function(){return!0}))),Z(e,t,r,n.uniforms,(function(){return!0}),!1),B(e,t,t,r)}function $(e,t){var r=e.proc("draw",1);F(e,r),R(e,r,t.context),O(e,r,t.framebuffer),D(e,r,t),z(e,r,t.state),j(e,r,t,!1,!0);var n=t.shader.progVar.append(e,r);if(r(e.shared.gl,".useProgram(",n,".program);"),t.shader.program)U(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var i=e.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(e.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",e.link((function(r){return V(U,e,t,r,1)})),"(",n,");",o,".call(this,a0);"))}0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var e=0;return Object.keys(c).forEach((function(t){e+=c[t].stats.size})),e}),{create:function(t,r){function o(t,r){var n=0,a=0,c=32854;if("object"===typeof t&&t?("shape"in t?(n=0|(a=t.shape)[0],a=0|a[1]):("radius"in t&&(n=a=0|t.radius),"width"in t&&(n=0|t.width),"height"in t&&(a=0|t.height)),"format"in t&&(c=s[t.format])):"number"===typeof t?(n=0|t,a="number"===typeof r?0|r:n):t||(n=a=1),n!==u.width||a!==u.height||c!==u.format)return o.width=u.width=n,o.height=u.height=a,u.format=c,e.bindRenderbuffer(36161,u.renderbuffer),e.renderbufferStorage(36161,c,n,a),i.profile&&(u.stats.size=Pe[u.format]*u.width*u.height),o.format=l[u.format],o}var u=new a(e.createRenderbuffer());return c[u.id]=u,n.renderbufferCount++,o(t,r),o.resize=function(t,r){var n=0|t,a=0|r||n;return n===u.width&&a===u.height||(o.width=u.width=n,o.height=u.height=a,e.bindRenderbuffer(36161,u.renderbuffer),e.renderbufferStorage(36161,u.format,n,a),i.profile&&(u.stats.size=Pe[u.format]*u.width*u.height)),o},o._reglType="renderbuffer",o._renderbuffer=u,i.profile&&(o.stats=u.stats),o.destroy=function(){u.decRef()},o},clear:function(){se(c).forEach(o)},restore:function(){se(c).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)})),e.bindRenderbuffer(36161,null)}}},Ie=[];Ie[6408]=4,Ie[6407]=3;var Re=[];Re[5121]=1,Re[5126]=4,Re[36193]=2;var Oe=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],De=["x","y","z","w"],ze="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Fe={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},je={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ne={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ze={cw:2304,ccw:2305},Be=new q(!1,!1,!1,(function(){})),Ve=function(e,t){function r(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null}function n(e,t,n){var i=o.pop()||new r;i.startQueryIndex=e,i.endQueryIndex=t,i.sum=0,i.stats=n,s.push(i)}if(!t.ext_disjoint_timer_query)return null;var i=[],a=[],o=[],s=[],l=[],u=[];return{beginQuery:function(e){var r=i.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,r),a.push(r),n(a.length-1,a.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:n,update:function(){var e,r;if(0!==(e=a.length)){u.length=Math.max(u.length,e+1),l.length=Math.max(l.length,e+1),l[0]=0;var n=u[0]=0;for(r=e=0;r=G.length&&n()}var r=J(G,e);G[r]=t}}}function d(){var e=H.viewport,t=H.scissor_box;e[0]=e[1]=t[0]=t[1]=0,E.viewportWidth=E.framebufferWidth=E.drawingBufferWidth=e[2]=t[2]=m.drawingBufferWidth,E.viewportHeight=E.framebufferHeight=E.drawingBufferHeight=e[3]=t[3]=m.drawingBufferHeight}function p(){E.tick+=1,E.time=v(),d(),U.procs.poll()}function h(){Z.refresh(),d(),U.procs.refresh(),M&&M.update()}function v(){return(ne()-S)/1e3}if(!(e=u(e)))return null;var m=e.gl,g=m.getContextAttributes();m.isContextLost();var y=c(m,e);if(!y)return null;var x=i(),w={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},k=e.cachedCode||{},T=y.extensions,M=Ve(m,T),S=ne(),A=m.drawingBufferWidth,C=m.drawingBufferHeight,E={tick:0,time:0,viewportWidth:A,viewportHeight:C,framebufferWidth:A,framebufferHeight:C,drawingBufferWidth:A,drawingBufferHeight:C,pixelRatio:e.pixelRatio},P=(A={elements:null,primitive:4,count:-1,offset:0,instances:-1},ae(m,T)),R=b(m,w,e,(function(e){return j.destroyBuffer(e)})),F=_(m,T,R,w),j=O(m,T,P,w,R,F,A),N=D(m,x,w,e),Z=L(m,T,P,(function(){U.procs.poll()}),E,w,e),B=Le(m,T,P,w,e),V=I(m,T,P,Z,B,w),U=$(m,x,T,P,R,F,Z,V,{},j,N,A,E,M,k,e),H=(x=z(m,V,U.procs.poll,E,g,T,P),U.next),W=m.canvas,G=[],q=[],Y=[],X=[e.onDestroy],K=null;W&&(W.addEventListener("webglcontextlost",a,!1),W.addEventListener("webglcontextrestored",o,!1));var ee=V.setFBO=s({framebuffer:te.define.call(null,1,"framebuffer")});return h(),g=Q(s,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var t=0;6>t;++t)ee(Q({framebuffer:e.framebuffer.faces[t]},e),l);else ee(e,l);else l(null,e)},prop:te.define.bind(null,1),context:te.define.bind(null,2),this:te.define.bind(null,3),draw:s({}),buffer:function(e){return R.create(e,34962,!1,!1)},elements:function(e){return F.create(e,!1)},texture:Z.create2D,cube:Z.createCube,renderbuffer:B.create,framebuffer:V.create,framebufferCube:V.createCube,vao:j.createVAO,attributes:g,frame:f,on:function(e,t){var r;switch(e){case"frame":return f(t);case"lost":r=q;break;case"restore":r=Y;break;case"destroy":r=X}return r.push(t),{cancel:function(){for(var e=0;e2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,a,o,s;if("string"===typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var l=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(n(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},37865:function(e,t,r){"use strict";var n=r(90386),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var a=r(40410),o=r(37493);r(42018)(c,a);for(var s=i(o.prototype),l=0;l0)if("string"===typeof t||s.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)s.endEmitted?w(e,new _):A(e,s,t,!0);else if(s.ended)w(e,new x);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?A(e,s,t,!1):I(e,s)):A(e,s,t,!1)}else n||(s.reading=!1,I(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function P(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(L,e))}function L(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,F(e)}function I(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){a("readable nexttick read 0"),e.read(0)}function z(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),F(e),t.flowing&&!t.reading&&e.read(0)}function F(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function j(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function N(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(Z,t,e))}function Z(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function B(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return a("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):P(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&N(this),null;var n,i=t.needReadable;return a("need readable",i),(0===t.length||t.length-e0?j(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&N(this)),null!==n&&this.emit("data",n),n},M.prototype._read=function(e){w(this,new b("_read()"))},M.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===i.stdout||e===i.stderr?m:u;function l(t,i){a("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,a("cleanup"),e.removeListener("close",h),e.removeListener("finish",v),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",l),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",d),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function u(){a("onend"),e.end()}n.endEmitted?i.nextTick(s):r.once("end",s),e.on("unpipe",l);var c=function(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,F(e))}}(r);e.on("drain",c);var f=!1;function d(t){a("ondata");var i=e.write(t);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==B(n.pipes,e))&&!f&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(t){a("onerror",t),m(),e.removeListener("error",p),0===o(e,"error")&&w(e,t)}function h(){e.removeListener("finish",v),m()}function v(){a("onfinish"),e.removeListener("close",h),m()}function m(){a("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",h),e.once("finish",v),e.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),e},M.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?P(this):n.reading||i.nextTick(D,this))),r},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(O,this),r},M.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(O,this),t},M.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(z,e,t))}(this,e)),e.paused=!1,this},M.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!==i&&void 0!==i)&&(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(e,t,r){r(new v("_write()"))},M.prototype._writev=null,M.prototype.end=function(e,t,r){var n=this._writableState;return"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,L(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),M.prototype.destroy=f.destroy,M.prototype._undestroy=f.undestroy,M.prototype._destroy=function(e,t){t(e)}},68221:function(e,t,r){"use strict";var n,i=r(90386);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(12726),s=Symbol("lastResolve"),l=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),p=Symbol("stream");function h(e,t){return{value:e,done:t}}function v(e){var t=e[s];if(null!==t){var r=e[p].read();null!==r&&(e[f]=null,e[s]=null,e[l]=null,t(h(r,!1)))}}function m(e){i.nextTick(v,e)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((a(n={get stream(){return this[p]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[p].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[u]?r(e[u]):t(h(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(h(void 0,!0)):t[d](r,n)}),n)}}(n,this));else{var a=this[p].read();if(null!==a)return Promise.resolve(h(a,!1));r=new Promise(this[d])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),g);e.exports=function(e){var t,r=Object.create(y,(a(t={},p,{value:e,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,l,{value:null,writable:!0}),a(t,u,{value:null,writable:!0}),a(t,c,{value:e._readableState.endEmitted,writable:!0}),a(t,d,{value:function(e,t){var n=r[p].read();n?(r[f]=null,r[s]=null,r[l]=null,e(h(n,!1))):(r[s]=e,r[l]=t)},writable:!0}),t));return r[f]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[f]=null,r[s]=null,r[l]=null,t(e)),void(r[u]=e)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[l]=null,n(h(void 0,!0))),r[c]=!0})),e.on("readable",m.bind(null,r)),r}},31125:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,i=o.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=i,n=s,o.prototype.copy.call(t,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0===(e-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&d.forEach(l),a||(d.forEach(l),f(c))}))}));return t.reduce(u)}},56306:function(e,t,r){"use strict";var n=r(74322).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},71405:function(e,t,r){e.exports=r(15398).EventEmitter},68019:function(e,t,r){"use strict";var n=r(71665).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!==typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.s=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},90715:function(e,t,r){var n=r(32791),i=r(41633)("stream-parser");e.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),e._bytes=c,e._skipBytes=f,t&&(e._passthrough=d),t?e._transform=h:e._write=p};var a=-1,o=0,s=1,l=2;function u(e){i("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=a,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function c(e,t){n(!this._parserCallback,'there is already a "callback" set!'),n(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||u(this),i("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=o}function f(e,t){n(!this._parserCallback,'there is already a "callback" set!'),n(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||u(this),i("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=s}function d(e,t){n(!this._parserCallback,'There is already a "callback" set!'),n(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||u(this),i("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=l}function p(e,t,r){this._parserInit||u(this),i("write(%o bytes)",e.length),"function"==typeof t&&(r=t),m(this,e,null,r)}function h(e,t,r){this._parserInit||u(this),i("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),m(this,e,t,r)}function v(e,t,r,n){if(e._parserBytesLeft-=t.length,i("%o bytes left for stream piece",e._parserBytesLeft),e._parserState===o?(e._parserBuffers.push(t),e._parserBuffered+=t.length):e._parserState===l&&r(t),0!==e._parserBytesLeft)return n;var s=e._parserCallback;if(s&&e._parserState===o&&e._parserBuffers.length>1&&(t=Buffer.concat(e._parserBuffers,e._parserBuffered)),e._parserState!==o&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=a,e._parserBuffers.splice(0),s){var u=[];t&&u.push(t),r&&u.push(r);var c=s.length>u.length;c&&u.push(g(n));var f=s.apply(e,u);if(!c||n===f)return n}}var m=g((function e(t,r,n,i){return t._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return v(t,r,n,i)}:function(){var a=r.slice(0,t._parserBytesLeft);return v(t,a,n,(function(o){return o?i(o):r.length>a.length?function(){return e(t,r.slice(a.length),n,i)}:void 0}))}}));function g(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}},41633:function(e,t,r){var n=r(90386);function i(){var e;try{e=t.storage.debug}catch(r){}return!e&&"undefined"!==typeof n&&"env"in n&&(e=n.env.DEBUG),e}(t=e.exports=r(74469)).log=function(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,a=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))})),e.splice(a,0,n)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(r){}},t.load=i,t.useColors=function(){return!("undefined"===typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(i())},74469:function(e,t,r){var n;function i(e){function r(){if(r.enabled){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s0)return function(e){if(!((e=String(e)).length>100)){var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*a;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===u&&!1===isNaN(e))return s.long?o(l=e,i,"day")||o(l,n,"hour")||o(l,r,"minute")||o(l,t,"second")||l+" ms":function(e){return e>=i?Math.round(e/i)+"d":e>=n?Math.round(e/n)+"h":e>=r?Math.round(e/r)+"m":e>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},99011:function(e,t,r){"use strict";var n=r(88641);e.exports=function(e,t,r){if(null==e)throw Error("First argument should be a string");if(null==t)throw Error("Separator should be a string or a RegExp");r?("string"===typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"===typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(e){return 1===e.length&&(e+=e),e})));var i=n.parse(e,{flat:!0,brackets:r.ignore}),a=i[0].split(t);if(r.escape){for(var o=[],s=0;s0;){t=u[u.length-1];var p=e[t];if(a[t]=0&&s[t].push(o[v])}a[t]=h}else{if(n[t]===r[t]){var m=[],g=[],y=0;for(h=l.length-1;h>=0;--h){var x=l[h];if(i[x]=!1,m.push(x),g.push(s[x]),y+=s[x].length,o[x]=f.length,x===t){l.length=h;break}}f.push(m);var b=new Array(y);for(h=0;h1&&(i=1),i<-1&&(i=-1),(e*n-t*r<0?-1:1)*Math.acos(i)};t.default=function(e){var t=e.px,r=e.py,l=e.cx,u=e.cy,c=e.rx,f=e.ry,d=e.xAxisRotation,p=void 0===d?0:d,h=e.largeArcFlag,v=void 0===h?0:h,m=e.sweepFlag,g=void 0===m?0:m,y=[];if(0===c||0===f)return[];var x=Math.sin(p*i/360),b=Math.cos(p*i/360),_=b*(t-l)/2+x*(r-u)/2,w=-x*(t-l)/2+b*(r-u)/2;if(0===_&&0===w)return[];c=Math.abs(c),f=Math.abs(f);var k=Math.pow(_,2)/Math.pow(c,2)+Math.pow(w,2)/Math.pow(f,2);k>1&&(c*=Math.sqrt(k),f*=Math.sqrt(k));var T=function(e,t,r,n,a,o,l,u,c,f,d,p){var h=Math.pow(a,2),v=Math.pow(o,2),m=Math.pow(d,2),g=Math.pow(p,2),y=h*v-h*g-v*m;y<0&&(y=0),y/=h*g+v*m;var x=(y=Math.sqrt(y)*(l===u?-1:1))*a/o*p,b=y*-o/a*d,_=f*x-c*b+(e+r)/2,w=c*x+f*b+(t+n)/2,k=(d-x)/a,T=(p-b)/o,M=(-d-x)/a,S=(-p-b)/o,A=s(1,0,k,T),C=s(k,T,M,S);return 0===u&&C>0&&(C-=i),1===u&&C<0&&(C+=i),[_,w,A,C]}(t,r,l,u,c,f,v,g,x,b,_,w),M=n(T,4),S=M[0],A=M[1],C=M[2],E=M[3],P=Math.abs(E)/(i/4);Math.abs(1-P)<1e-7&&(P=1);var L=Math.max(Math.ceil(P),1);E/=L;for(var I=0;It[2]&&(t[2]=u[c+0]),u[c+1]>t[3]&&(t[3]=u[c+1]);return t}},29988:function(e,t,r){"use strict";e.exports=function(e){for(var t,r=[],o=0,s=0,l=0,u=0,c=null,f=null,d=0,p=0,h=0,v=e.length;h4?(o=m[m.length-4],s=m[m.length-3]):(o=d,s=p),r.push(m)}return r};var n=r(7095);function i(e,t,r,n){return["C",e,t,r,n,r,n]}function a(e,t,r,n,i,a){return["C",e/3+2/3*r,t/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},82019:function(e,t,r){"use strict";var n,i=r(1750),a=r(95616),o=r(31457),s=r(89546),l=r(44781),u=document.createElement("canvas"),c=u.getContext("2d");e.exports=function(e,t){if(!s(e))throw Error("Argument should be valid svg path string");var r,f;t||(t={}),t.shape?(r=t.shape[0],f=t.shape[1]):(r=u.width=t.w||t.width||200,f=u.height=t.h||t.height||200);var d=Math.min(r,f),p=t.stroke||0,h=t.viewbox||t.viewBox||i(e),v=[r/(h[2]-h[0]),f/(h[3]-h[1])],m=Math.min(v[0]||0,v[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,r,f),c.fillStyle="white",p&&("number"!=typeof p&&(p=1),c.strokeStyle=p>0?"white":"black",c.lineWidth=Math.abs(p)),c.translate(.5*r,.5*f),c.scale(m,m),function(){if(null!=n)return n;var e=document.createElement("canvas").getContext("2d");if(e.canvas.width=e.canvas.height=1,!window.Path2D)return n=!1;var t=new Path2D("M0,0h1v1h-1v-1Z");e.fillStyle="black",e.fill(t);var r=e.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var g=new Path2D(e);c.fill(g),p&&c.stroke(g)}else{var y=a(e);o(c,y),c.fill(),p&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=t.cutoff?t.cutoff:.5,radius:null!=t.radius?t.radius:.5*d})}},84267:function(e,t,r){var n;!function(i){var a=/^\s+/,o=/\s+$/,s=0,l=i.round,u=i.min,c=i.max,f=i.random;function d(e,t){if(t=t||{},(e=e||"")instanceof d)return e;if(!(this instanceof d))return new d(e,t);var r=function(e){var t,r,n,s={r:0,g:0,b:0},l=1,f=null,d=null,p=null,h=!1,v=!1;return"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(o,"").toLowerCase();var t,r=!1;if(P[e])e=P[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=Z.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=Z.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Z.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Z.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Z.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Z.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Z.hex8.exec(e))?{r:D(t[1]),g:D(t[2]),b:D(t[3]),a:N(t[4]),format:r?"name":"hex8"}:(t=Z.hex6.exec(e))?{r:D(t[1]),g:D(t[2]),b:D(t[3]),format:r?"name":"hex"}:(t=Z.hex4.exec(e))?{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),a:N(t[4]+""+t[4]),format:r?"name":"hex8"}:!!(t=Z.hex3.exec(e))&&{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),format:r?"name":"hex"}}(e)),"object"==typeof e&&(B(e.r)&&B(e.g)&&B(e.b)?(t=e.r,r=e.g,n=e.b,s={r:255*R(t,255),g:255*R(r,255),b:255*R(n,255)},h=!0,v="%"===String(e.r).substr(-1)?"prgb":"rgb"):B(e.h)&&B(e.s)&&B(e.v)?(f=F(e.s),d=F(e.v),s=function(e,t,r){e=6*R(e,360),t=R(t,100),r=R(r,100);var n=i.floor(e),a=e-n,o=r*(1-t),s=r*(1-a*t),l=r*(1-(1-a)*t),u=n%6,c=[r,s,o,o,l,r][u],f=[l,r,r,s,o,o][u],d=[o,o,l,r,r,s][u];return{r:255*c,g:255*f,b:255*d}}(e.h,f,d),h=!0,v="hsv"):B(e.h)&&B(e.s)&&B(e.l)&&(f=F(e.s),p=F(e.l),s=function(e,t,r){var n,i,a;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=R(e,360),t=R(t,100),r=R(r,100),0===t)n=i=a=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),i=o(l,s,e),a=o(l,s,e-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,f,p),h=!0,v="hsl"),e.hasOwnProperty("a")&&(l=e.a)),l=I(l),{ok:h,format:e.format||v,r:u(255,c(s.r,0)),g:u(255,c(s.g,0)),b:u(255,c(s.b,0)),a:l}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=l(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=r.ok,this._tc_id=s++}function p(e,t,r){e=R(e,255),t=R(t,255),r=R(r,255);var n,i,a=c(e,t,r),o=u(e,t,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case e:n=(t-r)/l+(t>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(d(n));return a}function E(e,t){t=t||6;for(var r=d(e).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/t;t--;)o.push(d({h:n,s:i,v:a})),a=(a+s)%1;return o}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:i.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=I(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=p(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return v(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,i){var a=[z(l(e).toString(16)),z(l(t).toString(16)),z(l(r).toString(16)),z(j(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*R(this._r,255))+"%",g:l(100*R(this._g,255))+"%",b:l(100*R(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*R(this._r,255))+"%, "+l(100*R(this._g,255))+"%, "+l(100*R(this._b,255))+"%)":"rgba("+l(100*R(this._r,255))+"%, "+l(100*R(this._g,255))+"%, "+l(100*R(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[v(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+m(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=d(e);r="#"+m(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(k,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(C,arguments)},complement:function(){return this._applyCombination(T,arguments)},monochromatic:function(){return this._applyCombination(E,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(M,arguments)},tetrad:function(){return this._applyCombination(S,arguments)}},d.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:F(e[n]));e=r}return d(e,t)},d.equals=function(e,t){return!(!e||!t)&&d(e).toRgbString()==d(t).toRgbString()},d.random=function(){return d.fromRatio({r:f(),g:f(),b:f()})},d.mix=function(e,t,r){r=0===r?0:r||50;var n=d(e).toRgb(),i=d(t).toRgb(),a=r/100;return d({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},d.readability=function(e,t){var r=d(e),n=d(t);return(i.max(r.getLuminance(),n.getLuminance())+.05)/(i.min(r.getLuminance(),n.getLuminance())+.05)},d.isReadable=function(e,t,r){var n,i,a=d.readability(e,t);switch(i=!1,(n=function(e){var t,r;return t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},d.mostReadable=function(e,t,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=d(t[u]));return d.isReadable(e,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,d.mostReadable(e,["#fff","#000"],r))};var P=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},L=d.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(P);function I(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function R(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"===typeof e&&-1!=e.indexOf("%")}(e);return e=u(t,c(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),i.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function O(e){return u(1,c(0,e))}function D(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function F(e){return e<=1&&(e=100*e+"%"),e}function j(e){return i.round(255*parseFloat(e)).toString(16)}function N(e){return D(e)/255}var Z=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",r="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function B(e){return!!Z.CSS_UNIT.exec(e)}e.exports?e.exports=d:void 0===(n=function(){return d}.call(t,r,t,e))||(e.exports=n)}(Math)},57060:function(e){"use strict";e.exports=r,e.exports.float32=e.exports.float=r,e.exports.fract32=e.exports.fract=function(e,t){if(e.length){if(e instanceof Float32Array)return new Float32Array(e.length);t instanceof Float32Array||(t=r(e));for(var n=0,i=t.length;n":(t.length>100&&(t=t.slice(0,99)+"\u2026"),t=t.replace(i,(function(e){switch(e){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},47403:function(e,t,r){"use strict";var n=r(24582),i={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!n(e)&&hasOwnProperty.call(i,typeof e)}},82527:function(e,t,r){"use strict";var n=r(69190),i=r(84985);e.exports=function(e){return i(e)?e:n(e,"%v is not a plain function",arguments[1])}},84985:function(e,t,r){"use strict";var n=r(73116),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(e){return!!n(e)&&!i.test(a.call(e))}},24511:function(e,t,r){"use strict";var n=r(47403);e.exports=function(e){if(!n(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(t){return!1}}},9234:function(e,t,r){"use strict";var n=r(24582),i=r(47403),a=Object.prototype.toString;e.exports=function(e){if(!n(e))return null;if(i(e)){var t=e.toString;if("function"!==typeof t)return null;if(t===a)return null}try{return""+e}catch(r){return null}}},10424:function(e,t,r){"use strict";var n=r(69190),i=r(24582);e.exports=function(e){return i(e)?e:n(e,"Cannot use %v",arguments[1])}},24582:function(e){"use strict";e.exports=function(e){return void 0!==e&&null!==e}},58404:function(e,t,r){"use strict";var n=r(13547),i=r(12129),a=r(12856).Buffer;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!==typeof Uint8ClampedArray,s="undefined"!==typeof BigUint64Array,l="undefined"!==typeof BigInt64Array,u=r.g.__TYPEDARRAY_POOL;u.UINT8C||(u.UINT8C=i([32,0])),u.BIGUINT64||(u.BIGUINT64=i([32,0])),u.BIGINT64||(u.BIGINT64=i([32,0])),u.BUFFER||(u.BUFFER=i([32,0]));var c=u.DATA,f=u.BUFFER;function d(e){if(e){var t=e.length||e.byteLength,r=n.log2(t);c[r].push(e)}}function p(e){e=n.nextPow2(e);var t=n.log2(e),r=c[t];return r.length>0?r.pop():new ArrayBuffer(e)}function h(e){return new Uint8Array(p(e),0,e)}function v(e){return new Uint16Array(p(2*e),0,e)}function m(e){return new Uint32Array(p(4*e),0,e)}function g(e){return new Int8Array(p(e),0,e)}function y(e){return new Int16Array(p(2*e),0,e)}function x(e){return new Int32Array(p(4*e),0,e)}function b(e){return new Float32Array(p(4*e),0,e)}function _(e){return new Float64Array(p(8*e),0,e)}function w(e){return o?new Uint8ClampedArray(p(e),0,e):h(e)}function k(e){return s?new BigUint64Array(p(8*e),0,e):null}function T(e){return l?new BigInt64Array(p(8*e),0,e):null}function M(e){return new DataView(p(e),0,e)}function S(e){e=n.nextPow2(e);var t=n.log2(e),r=f[t];return r.length>0?r.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))f[n.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|n.log2(t);c[r].push(e)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(e){d(e.buffer)},t.freeArrayBuffer=d,t.freeBuffer=function(e){f[n.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return p(e);switch(t){case"uint8":return h(e);case"uint16":return v(e);case"uint32":return m(e);case"int8":return g(e);case"int16":return y(e);case"int32":return x(e);case"float":case"float32":return b(e);case"double":case"float64":return _(e);case"uint8_clamped":return w(e);case"bigint64":return T(e);case"biguint64":return k(e);case"buffer":return S(e);case"data":case"dataview":return M(e);default:return null}return null},t.mallocArrayBuffer=p,t.mallocUint8=h,t.mallocUint16=v,t.mallocUint32=m,t.mallocInt8=g,t.mallocInt16=y,t.mallocInt32=x,t.mallocFloat32=t.mallocFloat=b,t.mallocFloat64=t.mallocDouble=_,t.mallocUint8Clamped=w,t.mallocBigUint64=k,t.mallocBigInt64=T,t.mallocDataView=M,t.mallocBuffer=S,t.clearCache=function(){for(var e=0;e<32;++e)u.UINT8[e].length=0,u.UINT16[e].length=0,u.UINT32[e].length=0,u.INT8[e].length=0,u.INT16[e].length=0,u.INT32[e].length=0,u.FLOAT[e].length=0,u.DOUBLE[e].length=0,u.BIGUINT64[e].length=0,u.BIGINT64[e].length=0,u.UINT8C[e].length=0,c[e].length=0,f[e].length=0}},90448:function(e){var t=/[\'\"]/;e.exports=function(e){return e?(t.test(e.charAt(0))&&(e=e.substr(1)),t.test(e.charAt(e.length-1))&&(e=e.substr(0,e.length-1)),e):""}},93447:function(e){"use strict";e.exports=function(e,t,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),d(n,e,n.depth)}function c(e,t){var r=u.styles[t];return r?"\x1b["+u.colors[r][0]+"m"+e+"\x1b["+u.colors[r][1]+"m":e}function f(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&M(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return x(i)||(i=d(e,i,n)),i}var a=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(x(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return y(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),T(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return p(r);if(0===o.length){if(M(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return e.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var u,c="",f=!1,w=["{","}"];return v(r)&&(f=!0,w=["[","]"]),M(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(c=" "+RegExp.prototype.toString.call(r)),k(r)&&(c=" "+Date.prototype.toUTCString.call(r)),T(r)&&(c=" "+p(r)),0!==o.length||f&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=f?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(u,c,w)):w[0]+c+w[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),E(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=g(r)?d(e,l.value,null):d(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),b(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function v(e){return Array.isArray(e)}function m(e){return"boolean"===typeof e}function g(e){return null===e}function y(e){return"number"===typeof e}function x(e){return"string"===typeof e}function b(e){return void 0===e}function _(e){return w(e)&&"[object RegExp]"===S(e)}function w(e){return"object"===typeof e&&null!==e}function k(e){return w(e)&&"[object Date]"===S(e)}function T(e){return w(e)&&("[object Error]"===S(e)||e instanceof Error)}function M(e){return"function"===typeof e}function S(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!o[e])if(s.test(e)){var r=n.pid;o[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else o[e]=function(){};return o[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(4936),t.isArray=v,t.isBoolean=m,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=x,t.isSymbol=function(e){return"symbol"===typeof e},t.isUndefined=b,t.isRegExp=_,t.types.isRegExp=_,t.isObject=w,t.isDate=k,t.types.isDate=k,t.isError=T,t.types.isNativeError=T,t.isFunction=M,t.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=r(45920);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",function(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),C[e.getMonth()],t].join(" ")}(),t.format.apply(t,arguments))},t.inherits=r(42018),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function L(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!==typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],a=0;a2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var i=this.intercalaryMonth(e);if(r&&t!==i||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&t<=i?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13;return t},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var i,o=this._validateYear(e,n.local.invalidyear),s=d[o-d[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(i=a.newDate(l,u,c)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);var i=r&1<<12-t?30:29;return i},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,s,r,n.local.invalidDate);e=this._validateYear(i.year()),t=i.month(),r=i.day();var o=this.isIntercalaryMonth(e,t),s=this.toChineseMonth(e,t),l=function(e,t,r,n,i){var a,o,s;if("object"===typeof e)o=e,a=t||{};else{var l;if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"===typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:e,month:t,day:r,isIntercalary:l}}s=o.day-1;var u,c=f[o.year-f[0]],p=c>>13;u=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(v>>5&15)-1,(31&v)+s);return a.year=m.getFullYear(),a.month=1+m.getMonth(),a.day=m.getDate(),a}(e,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(e){var t=a.fromJD(e),r=function(e,t,r,n){var i,a;if("object"===typeof e)i=e,a=t||{};else{if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:e,month:t,day:r},a=n||{}}var o=d[i.year-d[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=d[a.year-d[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(i.year,i.month-1,i.day);l=Math.round((c-u)/864e5);var p,h=f[a.year-f[0]];for(p=0;p<13;p++){var v=h&1<<12-p?30:29;if(l>13;return!m||p=2&&n<=6},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year()+(i.year()<0?1:0),t=i.month(),(r=i.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},37715:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4===3||e%4===-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return(e=i.year())<0&&e++,i.day()+30*(i.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,i=t-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},99384:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=e<=0?e+1:e,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(t<7){for(var s=7;s<=this.monthsInYear(e);s++)o+=this.daysInMonth(e,s);for(s=1;s=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=a},43805:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year(),t=i.month(),e=e<=0?e+1:e,(r=i.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=a},88874:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4===0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=i.year(),t=i.month(),r=i.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((t-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=t-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},83290:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function s(e,t){return o(e-1,t)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o(8+(e-=this.jdEpoch)+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[s(20+(e-=this.jdEpoch),20),s(e+4,13)]},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=a},29108:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidMonth);(e=i.year())<0&&e++;for(var a=i.day(),s=1;s=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=a},55422:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),"undefined"===typeof this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),"undefined"===typeof this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=n.instance(),o=0,s=t,l=e;this._createMissingCalendarData(e);var u=e-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==t&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),i=t.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var u=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,u)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);e=i.year(),t=i.month(),r=i.day();var a=e-(e>=0?474:473),s=474+o(a,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var u=e-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),f=e-this.toJD(l,c,1)+1;return this.newDate(l,c,f)}}),n.calendars.persian=a,n.calendars.jalali=a},31320:function(e,t,r){var n=r(63489),i=r(56131),a=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(t.year()),a.leapYear(e)},weekOfYear:function(e,t,r){var i=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(i.year()),a.weekOfYear(e,i.month(),i.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=this._t2gYear(i.year()),a.toJD(e,i.month(),i.day())},fromJD:function(e){var t=a.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},51367:function(e,t,r){var n=r(63489),i=r(56131),a=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(t.year()),a.leapYear(e)},weekOfYear:function(e,t,r){var i=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return e=this._t2gYear(i.year()),a.weekOfYear(e,i.month(),i.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate);return e=this._t2gYear(i.year()),a.toJD(e,i.month(),i.day())},fromJD:function(e){var t=a.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},21457:function(e,t,r){var n=r(63489),i=r(56131);function a(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var i=this._validate(e,t,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,u=t-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(e,t,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(e=null!=e.year?e.year:e)>=1276&&e<=1500),i},_validate:function(e,t,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},63489:function(e,t,r){var n=r(56131);function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function s(){this.shortYearCutoff="+10"}function l(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(i.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,i){return(n=(null!=e&&e.year?e.calendar():"string"===typeof n?this.instance(n,i):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":e[a]+t[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(a.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new a(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),i=e.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);i=e.day(),"y"===r?(e.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(e){for(;ot-1+e.minMonth;)a++,o-=t,t=e.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(l){throw this._validateLevel--,l}},_correctAdd:function(e,t,r,n){if(!this.hasYearZero&&("y"===n||"m"===n)&&(0===t[0]||e.year()>0!==t[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;t=this._add(e,r*i[0]+a*i[1],i[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),i="m"===r?t:e.month(),a="d"===r?t:e.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),e.date(n,i,a)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var i=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var u=e.exports=new i;u.cdate=a,u.baseCalendar=s,u.calendars.gregorian=l},94338:function(e,t,r){var n=r(56131),i=r(63489);n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(e,t){return"string"!==typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!==typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n=(r=r||{}).dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,u=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;x+n1}),c=function(e,t,r,n){var i=""+t;if(u(e,n))for(;i.length1},x=function(e,r){var n=y(e,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=t.substring(M).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"===typeof l){y("m");var e=l.call(b,t.substring(M));return M+=e.length,e}return x("m")},w=function(e,r,n,a){for(var o=y(e,a)?n:r,s=0;s-1){p=1,h=v;for(var C=this.daysInMonth(d,p);h>C;C=this.daysInMonth(d,p))p++,h-=C}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,i){r&&"object"!==typeof r&&(i=n,n=r,r=null),"string"!==typeof n&&(i=n,n="");var a=this;return t=t?t.newDate():null,e=null==e?t:"string"===typeof e?function(e){try{return a.parseDate(n,e,i)}catch(l){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(e);s;)t.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(e);return t}(e):"number"===typeof e?isNaN(e)||e===1/0||e===-1/0?t:a.today().add(e,"d"):a.newDate(e)}})},69862:function(){},40964:function(){},72077:function(e,t,r){"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"===typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?k(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?k(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=d.exec(e))?new M(t[1],t[2],t[3],1):(t=p.exec(e))?new M(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=h.exec(e))?k(t[1],t[2],t[3],t[4]):(t=v.exec(e))?k(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=m.exec(e))?L(t[1],t[2]/100,t[3]/100,1):(t=g.exec(e))?L(t[1],t[2]/100,t[3]/100,t[4]):y.hasOwnProperty(e)?w(y[e]):"transparent"===e?new M(NaN,NaN,NaN,0):null}function w(e){return new M(e>>16&255,e>>8&255,255&e,1)}function k(e,t,r,n){return n<=0&&(e=t=r=NaN),new M(e,t,r,n)}function T(e,t,r,n){return 1===arguments.length?((i=e)instanceof a||(i=_(i)),i?new M((i=i.rgb()).r,i.g,i.b,i.opacity):new M):new M(e,t,r,null==n?1:n);var i}function M(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function S(){return"#".concat(P(this.r)).concat(P(this.g)).concat(P(this.b))}function A(){var e=C(this.opacity);return"".concat(1===e?"rgb(":"rgba(").concat(E(this.r),", ").concat(E(this.g),", ").concat(E(this.b)).concat(1===e?")":", ".concat(e,")"))}function C(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function E(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function P(e){return((e=E(e))<16?"0":"")+e.toString(16)}function L(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new R(e,t,r,n)}function I(e){if(e instanceof R)return new R(e.h,e.s,e.l,e.opacity);if(e instanceof a||(e=_(e)),!e)return new R;if(e instanceof R)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=NaN,l=o-i,u=(o+i)/2;return l?(s=t===o?(r-n)/l+6*(r0&&u<1?0:s,new R(s,l,u,e.opacity)}function R(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function O(e){return(e=(e||0)%360)<0?e+360:e}function D(e){return Math.max(0,Math.min(1,e||0))}function z(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function F(e,t,r,n,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*r+(1+3*e+3*a-3*o)*n+o*i)/6}n(a,_,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:x,formatHex:x,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return I(this).formatHsl()},formatRgb:b,toString:b}),n(M,T,i(a,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new M(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?o:Math.pow(o,e),new M(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},clamp:function(){return new M(E(this.r),E(this.g),E(this.b),C(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:S,formatHex:S,formatHex8:function(){return"#".concat(P(this.r)).concat(P(this.g)).concat(P(this.b)).concat(P(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:A,toString:A})),n(R,(function(e,t,r,n){return 1===arguments.length?I(e):new R(e,t,r,null==n?1:n)}),i(a,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new R(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?o:Math.pow(o,e),new R(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new M(z(e>=240?e-240:e+120,i,n),z(e,i,n),z(e<120?e+240:e-120,i,n),this.opacity)},clamp:function(){return new R(O(this.h),D(this.s),D(this.l),C(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=C(this.opacity);return"".concat(1===e?"hsl(":"hsla(").concat(O(this.h),", ").concat(100*D(this.s),"%, ").concat(100*D(this.l),"%").concat(1===e?")":", ".concat(e,")"))}}));var j=function(e){return function(){return e}};function N(e,t){return function(r){return e+r*t}}function Z(e){return 1===(e=+e)?B:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):j(isNaN(t)?r:t)}}function B(e,t){var r=t-e;return r?N(e,r):j(isNaN(e)?t:e)}var V=function e(t){var r=Z(t);function n(e,t){var n=r((e=T(e)).r,(t=T(t)).r),i=r(e.g,t.g),a=r(e.b,t.b),o=B(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return n.gamma=e,n}(1);function U(e){return function(t){var r,n,i=t.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;r=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=na&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:G(r,n)})),a=K.lastIndex;return a
\n * @param idOverride\n * @returns {string}\n */\nexport default function useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride);\n}","'use client';\n\n// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nlet hadKeyboardEvent = true;\nlet hadFocusVisibleRecently = false;\nlet hadFocusVisibleRecentlyTimeout;\nconst inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @returns {boolean}\n */\nfunction focusTriggersKeyboardModality(node) {\n const {\n type,\n tagName\n } = node;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n if (node.isContentEditable) {\n return true;\n }\n return false;\n}\n\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n hadKeyboardEvent = true;\n}\n\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\nfunction isFocusVisible(event) {\n const {\n target\n } = event;\n try {\n return target.matches(':focus-visible');\n } catch (error) {\n // Browsers not implementing :focus-visible will throw a SyntaxError.\n // We use our own heuristic for those browsers.\n // Rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n }\n\n // No need for validFocusTarget check. The user does that by attaching it to\n // focusable events only.\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\nexport default function useIsFocusVisible() {\n const ref = React.useCallback(node => {\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n const isFocusVisibleRef = React.useRef(false);\n\n /**\n * Should be called if a blur event is fired\n */\n function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {\n hadFocusVisibleRecently = false;\n }, 100);\n isFocusVisibleRef.current = false;\n return true;\n }\n return false;\n }\n\n /**\n * Should be called if a blur event is fired\n */\n function handleFocusVisible(event) {\n if (isFocusVisible(event)) {\n isFocusVisibleRef.current = true;\n return true;\n }\n return false;\n }\n return {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref\n };\n}","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)68?1900:2e3)};var a=function(e){return function(t){this[e]=+t}},f=[/[+-]\\d\\d:?(\\d\\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if(\"Z\"===e)return 0;var t=e.match(/([+-]|\\d\\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:\"+\"===t[0]?-n:n}(e)}],h=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?\"pm\":\"PM\");return n},d={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\\d{3}/,function(e){this.milliseconds=+e}],s:[r,a(\"seconds\")],ss:[r,a(\"seconds\")],m:[r,a(\"minutes\")],mm:[r,a(\"minutes\")],H:[r,a(\"hours\")],h:[r,a(\"hours\")],HH:[r,a(\"hours\")],hh:[r,a(\"hours\")],D:[r,a(\"day\")],DD:[n,a(\"day\")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\\[|\\]/g,\"\")===e&&(this.day=r)}],M:[r,a(\"month\")],MM:[n,a(\"month\")],MMM:[i,function(e){var t=h(\"months\"),n=(h(\"monthsShort\")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=h(\"months\").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\\d+/,a(\"year\")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\\d{4}/,a(\"year\")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\\[[^\\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\\[[^\\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,f=0;f-1)return new Date((\"X\"===t?1e3:1)*e);var r=c(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,h=r.seconds,u=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=h||0,g=u||0;return d?new Date(Date.UTC(M,Y,m,p,v,D,g+60*d.offset*1e3)):n?new Date(Date.UTC(M,Y,m,p,v,D,g)):new Date(M,Y,m,p,v,D,g)}catch(e){return new Date(\"\")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date(\"\")),o={}}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(\"\"))}else i.call(this,e)}}}));","!function(e,i){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=i():\"function\"==typeof define&&define.amd?define(i):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isBetween=i()}(this,(function(){\"use strict\";return function(e,i,t){i.prototype.isBetween=function(e,i,s,f){var n=t(e),o=t(i),r=\"(\"===(f=f||\"()\")[0],u=\")\"===f[1];return(r?this.isAfter(n,s):!this.isBefore(n,s))&&(u?this.isBefore(o,s):!this.isAfter(o,s))||(r?this.isBefore(n,s):!this.isAfter(n,s))&&(u?this.isAfter(o,s):!this.isBefore(o,s))}}}));","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_localizedFormat=t()}(this,(function(){\"use strict\";var e={LTS:\"h:mm:ss A\",LT:\"h:mm A\",L:\"MM/DD/YYYY\",LL:\"MMMM D, YYYY\",LLL:\"MMMM D, YYYY h:mm A\",LLLL:\"dddd, MMMM D, YYYY h:mm A\"};return function(t,o,n){var r=o.prototype,i=r.format;n.en.formats=e,r.format=function(t){void 0===t&&(t=\"YYYY-MM-DDTHH:mm:ssZ\");var o=this.$locale().formats,n=function(t,o){return t.replace(/(\\[[^\\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var i=r&&r.toUpperCase();return n||o[r]||e[r]||o[i].replace(/(\\[[^\\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,o){return t||o.slice(1)}))}))}(t,void 0===o?{}:o);return i.call(this,n)}}}));","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_weekOfYear=t()}(this,(function(){\"use strict\";var e=\"week\",t=\"year\";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),\"day\");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,\"millisecond\"),o=this.diff(a,e,!0);return o<0?r(this).startOf(\"week\").week():Math.ceil(o)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}}));","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict'\n\n\nconst createScatter = require('regl-scatter2d')\nconst pick = require('pick-by-alias')\nconst getBounds = require('array-bounds')\nconst raf = require('raf')\nconst arrRange = require('array-range')\nconst rect = require('parse-rect')\nconst flatten = require('flatten-vertex-data')\n\n\nmodule.exports = SPLOM\n\n\n// @constructor\nfunction SPLOM (regl, options) {\n\tif (!(this instanceof SPLOM)) return new SPLOM(regl, options)\n\n\t// render passes\n\tthis.traces = []\n\n\t// passes for scatter, combined across traces\n\tthis.passes = {}\n\n\tthis.regl = regl\n\n\t// main scatter drawing instance\n\tthis.scatter = createScatter(regl)\n\n\tthis.canvas = this.scatter.canvas\n}\n\n\n// update & draw passes once per frame\nSPLOM.prototype.render = function (...args) {\n\tif (args.length) {\n\t\tthis.update(...args)\n\t}\n\n\tif (this.regl.attributes.preserveDrawingBuffer) return this.draw()\n\n\t// make sure draw is not called more often than once a frame\n\tif (this.dirty) {\n\t\tif (this.planned == null) {\n\t\t\tthis.planned = raf(() => {\n\t\t\t\tthis.draw()\n\t\t\t\tthis.dirty = true\n\t\t\t\tthis.planned = null\n\t\t\t})\n\t\t}\n\t}\n\telse {\n\t\tthis.draw()\n\t\tthis.dirty = true\n\t\traf(() => {\n\t\t\tthis.dirty = false\n\t\t})\n\t}\n\n\treturn this\n}\n\n\n// update passes\nSPLOM.prototype.update = function (...args) {\n\tif (!args.length) return\n\n\tfor (let i = 0; i < args.length; i++) {\n\t\tthis.updateItem(i, args[i])\n\t}\n\n\t// remove nulled passes\n\tthis.traces = this.traces.filter(Boolean)\n\n\t// FIXME: update passes independently\n\tlet passes = []\n\tlet offset = 0\n\tfor (let i = 0; i < this.traces.length; i++) {\n\t\tlet trace = this.traces[i]\n\t\tlet tracePasses = this.traces[i].passes\n\t\tfor (let j = 0; j < tracePasses.length; j++) {\n\t\t\tpasses.push(this.passes[tracePasses[j]])\n\t\t}\n\t\t// save offset of passes\n\t\ttrace.passOffset = offset\n\t\toffset += trace.passes.length\n\t}\n\n\tthis.scatter.update(...passes)\n\n\treturn this\n}\n\n\n// update trace by index, not supposed to be called directly\nSPLOM.prototype.updateItem = function (i, options) {\n\tlet { regl } = this\n\n\t// remove pass if null\n\tif (options === null) {\n\t\tthis.traces[i] = null\n\t\treturn this\n\t}\n\n\tif (!options) return this\n\n\tlet o = pick(options, {\n\t\tdata: 'data items columns rows values dimensions samples x',\n\t\tsnap: 'snap cluster',\n\t\tsize: 'sizes size radius',\n\t\tcolor: 'colors color fill fill-color fillColor',\n\t\topacity: 'opacity alpha transparency opaque',\n\t\tborderSize: 'borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline',\n\t\tborderColor: 'borderColors borderColor bordercolor stroke stroke-color strokeColor',\n\t\tmarker: 'markers marker shape',\n\t\trange: 'range ranges databox dataBox',\n\t\tviewport: 'viewport viewBox viewbox',\n\t\tdomain: 'domain domains area areas',\n\t\tpadding: 'pad padding paddings pads margin margins',\n\t\ttranspose: 'transpose transposed',\n\t\tdiagonal: 'diagonal diag showDiagonal',\n\t\tupper: 'upper up top upperhalf upperHalf showupperhalf showUpper showUpperHalf',\n\t\tlower: 'lower low bottom lowerhalf lowerHalf showlowerhalf showLowerHalf showLower'\n\t})\n\n\t// we provide regl buffer per-trace, since trace data can be changed\n\tlet trace = (this.traces[i] || (this.traces[i] = {\n\t\tid: i,\n\t\tbuffer: regl.buffer({\n\t\t\tusage: 'dynamic',\n\t\t\ttype: 'float',\n\t\t\tdata: new Uint8Array()\n\t\t}),\n\t\tcolor: 'black',\n\t\tmarker: null,\n\t\tsize: 12,\n\t\tborderColor: 'transparent',\n\t\tborderSize: 1,\n\t\tviewport: rect([regl._gl.drawingBufferWidth, regl._gl.drawingBufferHeight]),\n\t\tpadding: [0, 0, 0, 0],\n\t\topacity: 1,\n\t\tdiagonal: true,\n\t\tupper: true,\n\t\tlower: true\n\t}))\n\n\n\t// save styles\n\tif (o.color != null) {\n\t\ttrace.color = o.color\n\t}\n\tif (o.size != null) {\n\t\ttrace.size = o.size\n\t}\n\tif (o.marker != null) {\n\t\ttrace.marker = o.marker\n\t}\n\tif (o.borderColor != null) {\n\t\ttrace.borderColor = o.borderColor\n\t}\n\tif (o.borderSize != null) {\n\t\ttrace.borderSize = o.borderSize\n\t}\n\tif (o.opacity != null) {\n\t\ttrace.opacity = o.opacity\n\t}\n\tif (o.viewport) {\n\t\ttrace.viewport = rect(o.viewport)\n\t}\n\tif (o.diagonal != null) trace.diagonal = o.diagonal\n\tif (o.upper != null) trace.upper = o.upper\n\tif (o.lower != null) trace.lower = o.lower\n\n\t// put flattened data into buffer\n\tif (o.data) {\n\t\ttrace.buffer(flatten(o.data))\n\t\ttrace.columns = o.data.length\n\t\ttrace.count = o.data[0].length\n\n\t\t// detect bounds per-column\n\t\ttrace.bounds = []\n\n\t\tfor (let i = 0; i < trace.columns; i++) {\n\t\t\ttrace.bounds[i] = getBounds(o.data[i], 1)\n\t\t}\n\t}\n\n\t// add proper range updating markers\n\tlet multirange\n\tif (o.range) {\n\t\ttrace.range = o.range\n\t\tmultirange = trace.range && typeof trace.range[0] !== 'number'\n\t}\n\n\tif (o.domain) {\n\t\ttrace.domain = o.domain\n\t}\n\tlet multipadding = false\n\tif (o.padding != null) {\n\t\t// multiple paddings\n\t\tif (Array.isArray(o.padding) && o.padding.length === trace.columns && typeof o.padding[o.padding.length - 1] === 'number') {\n\t\t\ttrace.padding = o.padding.map(getPad)\n\t\t\tmultipadding = true\n\t\t}\n\t\t// single padding\n\t\telse {\n\t\t\ttrace.padding = getPad(o.padding)\n\t\t}\n\t}\n\n\t// create passes\n\tlet m = trace.columns\n\tlet n = trace.count\n\n\tlet w = trace.viewport.width\n\tlet h = trace.viewport.height\n\tlet left = trace.viewport.x\n\tlet top = trace.viewport.y\n\tlet iw = w / m\n\tlet ih = h / m\n\n\ttrace.passes = []\n\n\tfor (let i = 0; i < m; i++) {\n\t\tfor (let j = 0; j < m; j++) {\n\t\t\tif (!trace.diagonal && j === i) continue\n\t\t\tif (!trace.upper && i > j) continue\n\t\t\tif (!trace.lower && i < j) continue\n\n\t\t\tlet key = passId(trace.id, i, j)\n\n\t\t\tlet pass = this.passes[key] || (this.passes[key] = {})\n\n\t\t\tif (o.data) {\n\t\t\t\tif (o.transpose) {\n\t\t\t\t\tpass.positions = {\n\t\t\t\t\t\tx: {buffer: trace.buffer, offset: j, count: n, stride: m},\n\t\t\t\t\t\ty: {buffer: trace.buffer, offset: i, count: n, stride: m}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpass.positions = {\n\t\t\t\t\t\tx: {buffer: trace.buffer, offset: j * n, count: n},\n\t\t\t\t\t\ty: {buffer: trace.buffer, offset: i * n, count: n}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpass.bounds = getBox(trace.bounds, i, j)\n\t\t\t}\n\n\t\t\tif (o.domain || o.viewport || o.data) {\n\t\t\t\tlet pad = multipadding ? getBox(trace.padding, i, j) : trace.padding\n\t\t\t\tif (trace.domain) {\n\t\t\t\t\tlet [lox, loy, hix, hiy] = getBox(trace.domain, i, j)\n\n\t\t\t\t\tpass.viewport = [\n\t\t\t\t\t\tleft + lox * w + pad[0],\n\t\t\t\t\t\ttop + loy * h + pad[1],\n\t\t\t\t\t\tleft + hix * w - pad[2],\n\t\t\t\t\t\ttop + hiy * h - pad[3]\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t\t// consider auto-domain equipartial\n\t\t\t\telse {\n\t\t\t\t\tpass.viewport = [\n\t\t\t\t\t\tleft + j * iw + iw * pad[0],\n\t\t\t\t\t\ttop + i * ih + ih * pad[1],\n\t\t\t\t\t\tleft + (j + 1) * iw - iw * pad[2],\n\t\t\t\t\t\ttop + (i + 1) * ih - ih * pad[3]\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (o.color) pass.color = trace.color\n\t\t\tif (o.size) pass.size = trace.size\n\t\t\tif (o.marker) pass.marker = trace.marker\n\t\t\tif (o.borderSize) pass.borderSize = trace.borderSize\n\t\t\tif (o.borderColor) pass.borderColor = trace.borderColor\n\t\t\tif (o.opacity) pass.opacity = trace.opacity\n\n\t\t\tif (o.range) {\n\t\t\t\tpass.range = multirange ? getBox(trace.range, i, j) : trace.range || pass.bounds\n\t\t\t}\n\n\t\t\ttrace.passes.push(key)\n\t\t}\n\t}\n\n\treturn this\n}\n\n\n// draw all or passed passes\nSPLOM.prototype.draw = function (...args) {\n\tif (!args.length) {\n\t\tthis.scatter.draw()\n\t}\n\telse {\n\t\tlet idx = []\n\t\tfor (let i = 0; i < args.length; i++) {\n\t\t\t// draw(0, 2, 5) - draw traces\n\t\t\tif (typeof args[i] === 'number' ) {\n\t\t\t\tlet { passes, passOffset } = this.traces[args[i]]\n\t\t\t\tidx.push(...arrRange(passOffset, passOffset + passes.length))\n\t\t\t}\n\t\t\t// draw([0, 1, 2 ...], [3, 4, 5]) - draw points\n\t\t\telse if (args[i].length) {\n\t\t\t\tlet els = args[i]\n\t\t\t\tlet { passes, passOffset } = this.traces[i]\n\t\t\t\tpasses = passes.map((passId, i) => {\n\t\t\t\t\tidx[passOffset + i] = els\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tthis.scatter.draw(...idx)\n\t}\n\n\treturn this\n}\n\n\n// dispose resources\nSPLOM.prototype.destroy = function () {\n\tthis.traces.forEach(trace => {\n\t\tif (trace.buffer && trace.buffer.destroy) trace.buffer.destroy()\n\t})\n\tthis.traces = null\n\tthis.passes = null\n\n\tthis.scatter.destroy()\n\n\treturn this\n}\n\n\n// return pass corresponding to trace i- j- square\nfunction passId (trace, i, j) {\n\tlet id = (trace.id != null ? trace.id : trace)\n\tlet n = i\n\tlet m = j\n\tlet key = id << 16 | (n & 0xff) << 8 | m & 0xff\n\n\treturn key\n}\n\n\n// return bounding box corresponding to a pass\nfunction getBox (items, i, j) {\n\tlet ilox, iloy, ihix, ihiy, jlox, jloy, jhix, jhiy\n\tlet iitem = items[i], jitem = items[j]\n\n\tif (iitem.length > 2) {\n\t\tilox = iitem[0]\n\t\tihix = iitem[2]\n\t\tiloy = iitem[1]\n\t\tihiy = iitem[3]\n\t}\n\telse if (iitem.length) {\n\t\tilox = iloy = iitem[0]\n\t\tihix = ihiy = iitem[1]\n\t}\n\telse {\n\t\tilox = iitem.x\n\t\tiloy = iitem.y\n\t\tihix = iitem.x + iitem.width\n\t\tihiy = iitem.y + iitem.height\n\t}\n\n\tif (jitem.length > 2) {\n\t\tjlox = jitem[0]\n\t\tjhix = jitem[2]\n\t\tjloy = jitem[1]\n\t\tjhiy = jitem[3]\n\t}\n\telse if (jitem.length) {\n\t\tjlox = jloy = jitem[0]\n\t\tjhix = jhiy = jitem[1]\n\t}\n\telse {\n\t\tjlox = jitem.x\n\t\tjloy = jitem.y\n\t\tjhix = jitem.x + jitem.width\n\t\tjhiy = jitem.y + jitem.height\n\t}\n\n\treturn [ jlox, iloy, jhix, ihiy ]\n}\n\n\nfunction getPad (arg) {\n\tif (typeof arg === 'number') return [arg, arg, arg, arg]\n\telse if (arg.length === 2) return [arg[0], arg[1], arg[0], arg[1]]\n\telse {\n\t\tlet box = rect(arg)\n\t\treturn [box.x, box.y, box.x + box.width, box.y + box.height]\n\t}\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ca=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)}\nfunction Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0);\nfunction Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[];\nfunction Oh(){for(var a=0;ac?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState}\nfunction Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}}\nfunction ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}}\nfunction Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308,\n4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=\nci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d,\nf,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Uh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eHj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(),\nnull;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1;\nfunction Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n}\nfunction Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}\nfunction Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling}\nfunction ak(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0;\nZj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)}\nfunction ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk;\nWk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\nhj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)}\nfunction al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction $k(a){if(\"function\"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction yh(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)bj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3 {\n if (this.unmounting) {\n return;\n }\n if (!this.el) {\n throw new Error('Missing element reference');\n }\n // eslint-disable-next-line consistent-return\n return Plotly.react(this.el, {\n data: this.props.data,\n layout: this.props.layout,\n config: this.props.config,\n frames: this.props.frames,\n });\n })\n .then(() => {\n if (this.unmounting) {\n return;\n }\n this.syncWindowResize(shouldInvokeResizeHandler);\n this.syncEventHandlers();\n this.figureCallback(figureCallbackFunction);\n if (shouldAttachUpdateEvents) {\n this.attachUpdateEvents();\n }\n })\n .catch((err) => {\n if (this.props.onError) {\n this.props.onError(err);\n }\n });\n }\n\n componentDidMount() {\n this.unmounting = false;\n\n this.updatePlotly(true, this.props.onInitialized, true);\n }\n\n componentDidUpdate(prevProps) {\n this.unmounting = false;\n\n // frames *always* changes identity so fall back to check length only :(\n const numPrevFrames =\n prevProps.frames && prevProps.frames.length ? prevProps.frames.length : 0;\n const numNextFrames =\n this.props.frames && this.props.frames.length ? this.props.frames.length : 0;\n\n const figureChanged = !(\n prevProps.layout === this.props.layout &&\n prevProps.data === this.props.data &&\n prevProps.config === this.props.config &&\n numNextFrames === numPrevFrames\n );\n const revisionDefined = prevProps.revision !== void 0;\n const revisionChanged = prevProps.revision !== this.props.revision;\n\n if (!figureChanged && (!revisionDefined || (revisionDefined && !revisionChanged))) {\n return;\n }\n\n this.updatePlotly(false, this.props.onUpdate, false);\n }\n\n componentWillUnmount() {\n this.unmounting = true;\n\n this.figureCallback(this.props.onPurge);\n\n if (this.resizeHandler && isBrowser) {\n window.removeEventListener('resize', this.resizeHandler);\n this.resizeHandler = null;\n }\n\n this.removeUpdateEvents();\n\n Plotly.purge(this.el);\n }\n\n attachUpdateEvents() {\n if (!this.el || !this.el.removeListener) {\n return;\n }\n\n updateEvents.forEach((updateEvent) => {\n this.el.on(updateEvent, this.handleUpdate);\n });\n }\n\n removeUpdateEvents() {\n if (!this.el || !this.el.removeListener) {\n return;\n }\n\n updateEvents.forEach((updateEvent) => {\n this.el.removeListener(updateEvent, this.handleUpdate);\n });\n }\n\n handleUpdate() {\n this.figureCallback(this.props.onUpdate);\n }\n\n figureCallback(callback) {\n if (typeof callback === 'function') {\n const {data, layout} = this.el;\n const frames = this.el._transitionData ? this.el._transitionData._frames : null;\n const figure = {data, layout, frames};\n callback(figure, this.el);\n }\n }\n\n syncWindowResize(invoke) {\n if (!isBrowser) {\n return;\n }\n\n if (this.props.useResizeHandler && !this.resizeHandler) {\n this.resizeHandler = () => Plotly.Plots.resize(this.el);\n window.addEventListener('resize', this.resizeHandler);\n if (invoke) {\n this.resizeHandler();\n }\n } else if (!this.props.useResizeHandler && this.resizeHandler) {\n window.removeEventListener('resize', this.resizeHandler);\n this.resizeHandler = null;\n }\n }\n\n getRef(el) {\n this.el = el;\n\n if (this.props.debug && isBrowser) {\n window.gd = this.el;\n }\n }\n\n // Attach and remove event handlers as they're added or removed from props:\n syncEventHandlers() {\n eventNames.forEach((eventName) => {\n const prop = this.props['on' + eventName];\n const handler = this.handlers[eventName];\n const hasHandler = Boolean(handler);\n\n if (prop && !hasHandler) {\n this.addEventHandler(eventName, prop);\n } else if (!prop && hasHandler) {\n // Needs to be removed:\n this.removeEventHandler(eventName);\n } else if (prop && hasHandler && prop !== handler) {\n // replace the handler\n this.removeEventHandler(eventName);\n this.addEventHandler(eventName, prop);\n }\n });\n }\n\n addEventHandler(eventName, prop) {\n this.handlers[eventName] = prop;\n this.el.on(this.getPlotlyEventName(eventName), this.handlers[eventName]);\n }\n\n removeEventHandler(eventName) {\n this.el.removeListener(this.getPlotlyEventName(eventName), this.handlers[eventName]);\n delete this.handlers[eventName];\n }\n\n getPlotlyEventName(eventName) {\n return 'plotly_' + eventName.toLowerCase();\n }\n\n render() {\n return (\n \n );\n }\n }\n\n PlotlyComponent.propTypes = {\n data: PropTypes.arrayOf(PropTypes.object),\n config: PropTypes.object,\n layout: PropTypes.object,\n frames: PropTypes.arrayOf(PropTypes.object),\n revision: PropTypes.number,\n onInitialized: PropTypes.func,\n onPurge: PropTypes.func,\n onError: PropTypes.func,\n onUpdate: PropTypes.func,\n debug: PropTypes.bool,\n style: PropTypes.object,\n className: PropTypes.string,\n useResizeHandler: PropTypes.bool,\n divId: PropTypes.string,\n };\n\n eventNames.forEach((eventName) => {\n PlotlyComponent.propTypes['on' + eventName] = PropTypes.func;\n });\n\n PlotlyComponent.defaultProps = {\n debug: false,\n useResizeHandler: false,\n data: [],\n style: {position: 'relative', display: 'inline-block'},\n };\n\n return PlotlyComponent;\n}\n","import plotComponentFactory from './factory';\nimport Plotly from 'plotly.js/dist/plotly';\n\nconst PlotComponent = plotComponentFactory(Plotly);\n\nexport default PlotComponent;\n","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; };\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; });\n\t}\n\tdef['default'] = function() { return value; };\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"static/js/\" + chunkId + \".\" + \"666d7345\" + \".chunk.js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"strudel-kit:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/strudel-kit/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkstrudel_kit\"] = self[\"webpackChunkstrudel_kit\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","import _typeof from \"./typeof.js\";\nexport default function _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n };\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw new Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nexport default function _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","import { DataFilter, AnalyticsState } from './AnalyticsProvider';\n\nexport enum AnalyticsActionType {\n SET_DATA = 'SET_DATA',\n SET_SEARCH = 'SET_SEARCH',\n SET_FILTERED_DATA = 'SET_FILTERED_DATA',\n SET_FILTER = 'SET_FILTER',\n SET_PREVIEW_ITEM = 'SET_PREVIEW_ITEM'\n}\n\nexport interface AnalyticsAction {\n type: AnalyticsActionType;\n payload?: any;\n}\n\nexport const setData = (data: AnalyticsState['data']): AnalyticsAction => ({\n type: AnalyticsActionType.SET_DATA,\n payload: data,\n});\n\nexport const setSearch = (searchTerm: AnalyticsState['searchTerm']): AnalyticsAction => ({\n type: AnalyticsActionType.SET_SEARCH,\n payload: searchTerm,\n});\n\nexport const setFilteredData = (data: AnalyticsState['filteredData']): AnalyticsAction => ({\n type: AnalyticsActionType.SET_FILTERED_DATA,\n payload: data,\n});\n\nexport const setFilter = (filter: DataFilter): AnalyticsAction => ({\n type: AnalyticsActionType.SET_FILTER,\n payload: filter,\n});\n\nexport const setPreviewItem = (rowItem: AnalyticsState['previewItem']): AnalyticsAction => ({\n type: AnalyticsActionType.SET_PREVIEW_ITEM,\n payload: rowItem,\n});","import dayjs from \"dayjs\";\nimport { DataFilter } from \"./AnalyticsProvider\";\n\nexport const filterBySearchText = (allData: any[], searchText?: string) => {\n let filteredData = allData;\n if (searchText) {\n filteredData = allData.filter((d) => {\n const rowString = JSON.stringify(d).toLowerCase();\n return rowString.indexOf(searchText.toLowerCase()) > -1;\n });\n }\n return filteredData;\n};\n\nexport const filterByDataFilters = (allData: any[], filters: DataFilter[]) => {\n let filteredData = allData;\n if (filters.length > 0) {\n filteredData = allData.filter((d) => {\n let include = true;\n /**\n * All filters have to be matched for a row to be included in the filtered data\n */\n filters.forEach((f) => {\n let match = false;\n if (include === true) {\n switch (f.operator) {\n case 'contains': {\n if (d[f.field].indexOf(f.value) > -1) {\n match = true;\n }\n break;\n }\n case 'contains one of': {\n if (Array.isArray(f.value)) {\n f.value.forEach((v) => {\n if (!match) {\n if (d[f.field].indexOf(v) > -1) {\n match = true;\n }\n }\n });\n }\n break;\n }\n case 'equals one of': {\n if (Array.isArray(f.value)) {\n f.value.forEach((v) => {\n if (!match) {\n if (d[f.field] === v) {\n match = true;\n }\n }\n });\n }\n break;\n }\n case 'range': {\n if (Array.isArray(f.value)) {\n const min = f.value[0];\n const max = f.value[1];\n if (d[f.field] >= min && d[f.field] <= max) {\n match = true;\n }\n }\n break;\n }\n case 'date range': {\n if (\n typeof d[f.field] === 'string' \n && Array.isArray(f.value)\n && f.value[0]\n && f.value[1]\n ) {\n console.log(d[f.field]);\n console.log(f.value);\n console.log(dayjs(d[f.field]));\n const dateValue = dayjs(d[f.field]);\n if (dateValue.isAfter(f.value[0]) && dateValue.isBefore(f.value[1])) {\n console.log('match');\n match = true;\n }\n } else {\n match = true;\n }\n break;\n }\n default:\n break;\n }\n }\n if (!match) include = false;\n });\n return include;\n });\n }\n return filteredData;\n};\n\nexport const filterData = (allData: any[], filters: DataFilter[], searchText?: string) => {\n const filteredByText = filterBySearchText(allData, searchText);\n const filteredByTextAndDataFilters = filterByDataFilters(filteredByText, filters);\n return filteredByTextAndDataFilters;\n}\n\nexport const initSliderTicks = (ticks: number | null, domain: number[], scale?: any) => {\n if (ticks === 2) {\n return domain;\n } else if (ticks !== null) {\n return scale.ticks(ticks);\n } else {\n return;\n }\n};","import React, { useEffect, useReducer, useContext } from 'react';\nimport { AnalyticsAction, AnalyticsActionType, setData, setFilteredData } from './actions';\nimport { filterData } from './utils';\n\nexport enum FilterOperator {\n CONTAINS = 'CONTAINS',\n EQUALS = 'EQUALS',\n EQUALS_ONE_OF = 'EQUALS_ONE_OF',\n BETWEEN = 'BETWEEN'\n}\n\nexport interface DataFilter {\n field: string;\n value: string | number | any[] | null;\n operator: string;\n}\n\nexport interface AnalyticsState {\n columns: any[];\n count?: number;\n data?: any[];\n dataIdField: string;\n filteredData?: any[];\n activeFilters: DataFilter[];\n filterValues?: any;\n previewItem?: any;\n searchTerm?: string;\n showFiltersPanel?: boolean;\n tablePage: number,\n tablePageSize: number\n}\n\n/**\n * AnalyticsProvider props are the same as the State except\n * some of the required props in the State are optional props.\n * These props have default values set in the initialState object.\n */\n// interface AnalyticsProviderProps extends Omit {\ninterface AnalyticsProviderProps extends Partial {\n activeFilters?: DataFilter[];\n columns?: any[];\n tablePage?: number;\n tablePageSize?: number;\n children: React.ReactNode; \n}\n\nconst AnalyticsContext = React.createContext<{state: AnalyticsState; dispatch: React.Dispatch} | undefined>(undefined);\n\nconst initialState: AnalyticsState = {\n data: [],\n columns: [],\n filterValues: {},\n activeFilters: [],\n dataIdField: 'id',\n tablePage: 0,\n tablePageSize: 25\n}\n\nconst initState = (initialState: AnalyticsState, props: AnalyticsProviderProps) => {\n const {children, ...rest} = props;\n return {\n ...initialState,\n ...rest\n }\n};\n\nfunction analyticsReducer(state: AnalyticsState, action: AnalyticsAction): AnalyticsState {\n switch (action.type) {\n case AnalyticsActionType.SET_DATA: {\n return {\n ...state,\n data: action.payload\n }\n }\n case AnalyticsActionType.SET_SEARCH: {\n return {\n ...state,\n searchTerm: action.payload\n }\n }\n case AnalyticsActionType.SET_FILTERED_DATA: {\n return {\n ...state,\n filteredData: action.payload\n }\n }\n case AnalyticsActionType.SET_FILTER: {\n console.log(action);\n const filter = action.payload;\n const existingIndex = state.activeFilters.findIndex((f) => f.field === filter.field);\n const activeFilters = [...state.activeFilters];\n if (existingIndex > -1) {\n if (filter.value) {\n activeFilters[existingIndex] = filter;\n } else {\n activeFilters.splice(existingIndex, 1);\n }\n } else if (filter.value) {\n activeFilters.push(filter);\n }\n return {\n ...state,\n activeFilters\n }\n }\n case AnalyticsActionType.SET_PREVIEW_ITEM: {\n return {\n ...state,\n previewItem: action.payload\n }\n }\n default: {\n throw new Error(`Unhandled action type: ${action.type}`)\n }\n }\n}\n\nexport const AnalyticsProvider: React.FC = (props) => {\n const [state, dispatch] = React.useReducer(analyticsReducer, initState(initialState, props));\n const value = { state, dispatch };\n\n useEffect(() => {\n console.log(props.data);\n dispatch(setData(props.data));\n }, [props.data]);\n\n useEffect(() => {\n if (state.data) {\n const filteredData = filterData(state.data, state.activeFilters, state.searchTerm);\n dispatch(setFilteredData(filteredData));\n }\n }, [state.data, state.searchTerm, JSON.stringify(state.activeFilters)]);\n\n return (\n \n {props.children}\n \n )\n}\n\nexport const useAnalytics = () => {\n const context = useContext(AnalyticsContext)\n if (context === undefined) {\n throw new Error('useAnalytics must be used within an AnalyticsProvider')\n }\n return context\n}","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t {\n var _props$theme$unstable, _props$theme;\n const result = {\n systemProps: {},\n otherProps: {}\n };\n const config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig;\n Object.keys(props).forEach(prop => {\n if (config[prop]) {\n result.systemProps[prop] = props[prop];\n } else {\n result.otherProps[prop] = props[prop];\n }\n });\n return result;\n};\nexport default function extendSxProp(props) {\n const {\n sx: inSx\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n systemProps,\n otherProps\n } = splitProps(other);\n let finalSx;\n if (Array.isArray(inSx)) {\n finalSx = [systemProps, ...inSx];\n } else if (typeof inSx === 'function') {\n finalSx = (...args) => {\n const result = inSx(...args);\n if (!isPlainObject(result)) {\n return systemProps;\n }\n return _extends({}, systemProps, result);\n };\n } else {\n finalSx = _extends({}, systemProps, inSx);\n }\n return _extends({}, otherProps, {\n sx: finalSx\n });\n}","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"component\"];\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport styled from '@mui/styled-engine';\nimport styleFunctionSx, { extendSxProp } from './styleFunctionSx';\nimport useTheme from './useTheme';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function createBox(options = {}) {\n const {\n themeId,\n defaultTheme,\n defaultClassName = 'MuiBox-root',\n generateClassName\n } = options;\n const BoxRoot = styled('div', {\n shouldForwardProp: prop => prop !== 'theme' && prop !== 'sx' && prop !== 'as'\n })(styleFunctionSx);\n const Box = /*#__PURE__*/React.forwardRef(function Box(inProps, ref) {\n const theme = useTheme(defaultTheme);\n const _extendSxProp = extendSxProp(inProps),\n {\n className,\n component = 'div'\n } = _extendSxProp,\n other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded);\n return /*#__PURE__*/_jsx(BoxRoot, _extends({\n as: component,\n ref: ref,\n className: clsx(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),\n theme: themeId ? theme[themeId] || theme : theme\n }, other));\n });\n return Box;\n}","'use client';\n\nimport { createBox } from '@mui/system';\nimport PropTypes from 'prop-types';\nimport { unstable_ClassNameGenerator as ClassNameGenerator } from '../className';\nimport { createTheme } from '../styles';\nimport THEME_ID from '../styles/identifier';\nconst defaultTheme = createTheme();\nconst Box = createBox({\n themeId: THEME_ID,\n defaultTheme,\n defaultClassName: 'MuiBox-root',\n generateClassName: ClassNameGenerator.generate\n});\nprocess.env.NODE_ENV !== \"production\" ? Box.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * @ignore\n */\n children: PropTypes.node,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default Box;","// Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61\nconst getOverlayAlpha = elevation => {\n let alphaValue;\n if (elevation < 1) {\n alphaValue = 5.11916 * elevation ** 2;\n } else {\n alphaValue = 4.5 * Math.log(elevation + 1) + 2;\n }\n return (alphaValue / 100).toFixed(2);\n};\nexport default getOverlayAlpha;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getPaperUtilityClass(slot) {\n return generateUtilityClass('MuiPaper', slot);\n}\nconst paperClasses = generateUtilityClasses('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']);\nexport default paperClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"component\", \"elevation\", \"square\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { chainPropTypes, integerPropType } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport { alpha } from '@mui/system';\nimport styled from '../styles/styled';\nimport getOverlayAlpha from '../styles/getOverlayAlpha';\nimport useThemeProps from '../styles/useThemeProps';\nimport useTheme from '../styles/useTheme';\nimport { getPaperUtilityClass } from './paperClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n square,\n elevation,\n variant,\n classes\n } = ownerState;\n const slots = {\n root: ['root', variant, !square && 'rounded', variant === 'elevation' && `elevation${elevation}`]\n };\n return composeClasses(slots, getPaperUtilityClass, classes);\n};\nconst PaperRoot = styled('div', {\n name: 'MuiPaper',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === 'elevation' && styles[`elevation${ownerState.elevation}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$vars$overlays;\n return _extends({\n backgroundColor: (theme.vars || theme).palette.background.paper,\n color: (theme.vars || theme).palette.text.primary,\n transition: theme.transitions.create('box-shadow')\n }, !ownerState.square && {\n borderRadius: theme.shape.borderRadius\n }, ownerState.variant === 'outlined' && {\n border: `1px solid ${(theme.vars || theme).palette.divider}`\n }, ownerState.variant === 'elevation' && _extends({\n boxShadow: (theme.vars || theme).shadows[ownerState.elevation]\n }, !theme.vars && theme.palette.mode === 'dark' && {\n backgroundImage: `linear-gradient(${alpha('#fff', getOverlayAlpha(ownerState.elevation))}, ${alpha('#fff', getOverlayAlpha(ownerState.elevation))})`\n }, theme.vars && {\n backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation]\n }));\n});\nconst Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPaper'\n });\n const {\n className,\n component = 'div',\n elevation = 1,\n square = false,\n variant = 'elevation'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n component,\n elevation,\n square,\n variant\n });\n const classes = useUtilityClasses(ownerState);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const theme = useTheme();\n if (theme.shadows[elevation] === undefined) {\n console.error([`MUI: The elevation provided is not available in the theme.`, `Please make sure that \\`theme.shadows[${elevation}]\\` is defined.`].join('\\n'));\n }\n }\n return /*#__PURE__*/_jsx(PaperRoot, _extends({\n as: component,\n ownerState: ownerState,\n className: clsx(classes.root, className),\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Paper.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * Shadow depth, corresponds to `dp` in the spec.\n * It accepts values between 0 and 24 inclusive.\n * @default 1\n */\n elevation: chainPropTypes(integerPropType, props => {\n const {\n elevation,\n variant\n } = props;\n if (elevation > 0 && variant === 'outlined') {\n return new Error(`MUI: Combining \\`elevation={${elevation}}\\` with \\`variant=\"${variant}\"\\` has no effect. Either use \\`elevation={0}\\` or use a different \\`variant\\`.`);\n }\n return null;\n }),\n /**\n * If `true`, rounded corners are disabled.\n * @default false\n */\n square: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The variant to use.\n * @default 'elevation'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['elevation', 'outlined']), PropTypes.string])\n} : void 0;\nexport default Paper;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getAppBarUtilityClass(slot) {\n return generateUtilityClass('MuiAppBar', slot);\n}\nconst appBarClasses = generateUtilityClasses('MuiAppBar', ['root', 'positionFixed', 'positionAbsolute', 'positionSticky', 'positionStatic', 'positionRelative', 'colorDefault', 'colorPrimary', 'colorSecondary', 'colorInherit', 'colorTransparent']);\nexport default appBarClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"color\", \"enableColorOnDark\", \"position\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport capitalize from '../utils/capitalize';\nimport Paper from '../Paper';\nimport { getAppBarUtilityClass } from './appBarClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n color,\n position,\n classes\n } = ownerState;\n const slots = {\n root: ['root', `color${capitalize(color)}`, `position${capitalize(position)}`]\n };\n return composeClasses(slots, getAppBarUtilityClass, classes);\n};\n\n// var2 is the fallback.\n// Ex. var1: 'var(--a)', var2: 'var(--b)'; return: 'var(--a, var(--b))'\nconst joinVars = (var1, var2) => var1 ? `${var1 == null ? void 0 : var1.replace(')', '')}, ${var2})` : var2;\nconst AppBarRoot = styled(Paper, {\n name: 'MuiAppBar',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[`position${capitalize(ownerState.position)}`], styles[`color${capitalize(ownerState.color)}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n const backgroundColorDefault = theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[900];\n return _extends({\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n boxSizing: 'border-box',\n // Prevent padding issue with the Modal and fixed positioned AppBar.\n flexShrink: 0\n }, ownerState.position === 'fixed' && {\n position: 'fixed',\n zIndex: (theme.vars || theme).zIndex.appBar,\n top: 0,\n left: 'auto',\n right: 0,\n '@media print': {\n // Prevent the app bar to be visible on each printed page.\n position: 'absolute'\n }\n }, ownerState.position === 'absolute' && {\n position: 'absolute',\n zIndex: (theme.vars || theme).zIndex.appBar,\n top: 0,\n left: 'auto',\n right: 0\n }, ownerState.position === 'sticky' && {\n // ⚠️ sticky is not supported by IE11.\n position: 'sticky',\n zIndex: (theme.vars || theme).zIndex.appBar,\n top: 0,\n left: 'auto',\n right: 0\n }, ownerState.position === 'static' && {\n position: 'static'\n }, ownerState.position === 'relative' && {\n position: 'relative'\n }, !theme.vars && _extends({}, ownerState.color === 'default' && {\n backgroundColor: backgroundColorDefault,\n color: theme.palette.getContrastText(backgroundColorDefault)\n }, ownerState.color && ownerState.color !== 'default' && ownerState.color !== 'inherit' && ownerState.color !== 'transparent' && {\n backgroundColor: theme.palette[ownerState.color].main,\n color: theme.palette[ownerState.color].contrastText\n }, ownerState.color === 'inherit' && {\n color: 'inherit'\n }, theme.palette.mode === 'dark' && !ownerState.enableColorOnDark && {\n backgroundColor: null,\n color: null\n }, ownerState.color === 'transparent' && _extends({\n backgroundColor: 'transparent',\n color: 'inherit'\n }, theme.palette.mode === 'dark' && {\n backgroundImage: 'none'\n })), theme.vars && _extends({}, ownerState.color === 'default' && {\n '--AppBar-background': ownerState.enableColorOnDark ? theme.vars.palette.AppBar.defaultBg : joinVars(theme.vars.palette.AppBar.darkBg, theme.vars.palette.AppBar.defaultBg),\n '--AppBar-color': ownerState.enableColorOnDark ? theme.vars.palette.text.primary : joinVars(theme.vars.palette.AppBar.darkColor, theme.vars.palette.text.primary)\n }, ownerState.color && !ownerState.color.match(/^(default|inherit|transparent)$/) && {\n '--AppBar-background': ownerState.enableColorOnDark ? theme.vars.palette[ownerState.color].main : joinVars(theme.vars.palette.AppBar.darkBg, theme.vars.palette[ownerState.color].main),\n '--AppBar-color': ownerState.enableColorOnDark ? theme.vars.palette[ownerState.color].contrastText : joinVars(theme.vars.palette.AppBar.darkColor, theme.vars.palette[ownerState.color].contrastText)\n }, {\n backgroundColor: 'var(--AppBar-background)',\n color: ownerState.color === 'inherit' ? 'inherit' : 'var(--AppBar-color)'\n }, ownerState.color === 'transparent' && {\n backgroundImage: 'none',\n backgroundColor: 'transparent',\n color: 'inherit'\n }));\n});\nconst AppBar = /*#__PURE__*/React.forwardRef(function AppBar(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiAppBar'\n });\n const {\n className,\n color = 'primary',\n enableColorOnDark = false,\n position = 'fixed'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n color,\n position,\n enableColorOnDark\n });\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(AppBarRoot, _extends({\n square: true,\n component: \"header\",\n ownerState: ownerState,\n elevation: 4,\n className: clsx(classes.root, className, position === 'fixed' && 'mui-fixed'),\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? AppBar.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).\n * @default 'primary'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary', 'transparent']), PropTypes.string]),\n /**\n * If true, the `color` prop is applied in dark mode.\n * @default false\n */\n enableColorOnDark: PropTypes.bool,\n /**\n * The positioning type. The behavior of the different options is described\n * [in the MDN web docs](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning).\n * Note: `sticky` is not universally supported and will fall back to `static` when unavailable.\n * @default 'fixed'\n */\n position: PropTypes.oneOf(['absolute', 'fixed', 'relative', 'static', 'sticky']),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default AppBar;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getToolbarUtilityClass(slot) {\n return generateUtilityClass('MuiToolbar', slot);\n}\nconst toolbarClasses = generateUtilityClasses('MuiToolbar', ['root', 'gutters', 'regular', 'dense']);\nexport default toolbarClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"component\", \"disableGutters\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport useThemeProps from '../styles/useThemeProps';\nimport styled from '../styles/styled';\nimport { getToolbarUtilityClass } from './toolbarClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n disableGutters,\n variant\n } = ownerState;\n const slots = {\n root: ['root', !disableGutters && 'gutters', variant]\n };\n return composeClasses(slots, getToolbarUtilityClass, classes);\n};\nconst ToolbarRoot = styled('div', {\n name: 'MuiToolbar',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, !ownerState.disableGutters && styles.gutters, styles[ownerState.variant]];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n position: 'relative',\n display: 'flex',\n alignItems: 'center'\n}, !ownerState.disableGutters && {\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3)\n }\n}, ownerState.variant === 'dense' && {\n minHeight: 48\n}), ({\n theme,\n ownerState\n}) => ownerState.variant === 'regular' && theme.mixins.toolbar);\nconst Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiToolbar'\n });\n const {\n className,\n component = 'div',\n disableGutters = false,\n variant = 'regular'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n component,\n disableGutters,\n variant\n });\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(ToolbarRoot, _extends({\n as: component,\n className: clsx(classes.root, className),\n ref: ref,\n ownerState: ownerState\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Toolbar.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The Toolbar children, usually a mixture of `IconButton`, `Button` and `Typography`.\n * The Toolbar is a flex container, allowing flex item properties to be used to lay out the children.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * If `true`, disables gutter padding.\n * @default false\n */\n disableGutters: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The variant to use.\n * @default 'regular'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['dense', 'regular']), PropTypes.string])\n} : void 0;\nexport default Toolbar;","export default function _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","import React from 'react';\nexport default React.createContext(null);","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `
` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","import { h as hasOwnProperty, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, i as isBrowser$1 } from './emotion-element-c39617d8.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-c39617d8.browser.esm.js';\nimport * as React from 'react';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { serializeStyles } from '@emotion/serialize';\nimport '@emotion/cache';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport 'hoist-non-react-statics';\n\nvar pkg = {\n\tname: \"@emotion/react\",\n\tversion: \"11.11.1\",\n\tmain: \"dist/emotion-react.cjs.js\",\n\tmodule: \"dist/emotion-react.esm.js\",\n\tbrowser: {\n\t\t\"./dist/emotion-react.esm.js\": \"./dist/emotion-react.browser.esm.js\"\n\t},\n\texports: {\n\t\t\".\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./dist/emotion-react.worker.esm.js\",\n\t\t\t\tbrowser: \"./dist/emotion-react.browser.esm.js\",\n\t\t\t\t\"default\": \"./dist/emotion-react.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/emotion-react.cjs.mjs\",\n\t\t\t\"default\": \"./dist/emotion-react.cjs.js\"\n\t\t},\n\t\t\"./jsx-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs\",\n\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js\"\n\t\t},\n\t\t\"./_isolated-hnrs\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js\",\n\t\t\t\tbrowser: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js\",\n\t\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs\",\n\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js\"\n\t\t},\n\t\t\"./jsx-dev-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs\",\n\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\",\n\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\"./macro\": {\n\t\t\ttypes: {\n\t\t\t\t\"import\": \"./macro.d.mts\",\n\t\t\t\t\"default\": \"./macro.d.ts\"\n\t\t\t},\n\t\t\t\"default\": \"./macro.js\"\n\t\t}\n\t},\n\ttypes: \"types/index.d.ts\",\n\tfiles: [\n\t\t\"src\",\n\t\t\"dist\",\n\t\t\"jsx-runtime\",\n\t\t\"jsx-dev-runtime\",\n\t\t\"_isolated-hnrs\",\n\t\t\"types/*.d.ts\",\n\t\t\"macro.*\"\n\t],\n\tsideEffects: false,\n\tauthor: \"Emotion Contributors\",\n\tlicense: \"MIT\",\n\tscripts: {\n\t\t\"test:typescript\": \"dtslint types\"\n\t},\n\tdependencies: {\n\t\t\"@babel/runtime\": \"^7.18.3\",\n\t\t\"@emotion/babel-plugin\": \"^11.11.0\",\n\t\t\"@emotion/cache\": \"^11.11.0\",\n\t\t\"@emotion/serialize\": \"^1.1.2\",\n\t\t\"@emotion/use-insertion-effect-with-fallbacks\": \"^1.0.1\",\n\t\t\"@emotion/utils\": \"^1.2.1\",\n\t\t\"@emotion/weak-memoize\": \"^0.3.1\",\n\t\t\"hoist-non-react-statics\": \"^3.3.1\"\n\t},\n\tpeerDependencies: {\n\t\treact: \">=16.8.0\"\n\t},\n\tpeerDependenciesMeta: {\n\t\t\"@types/react\": {\n\t\t\toptional: true\n\t\t}\n\t},\n\tdevDependencies: {\n\t\t\"@definitelytyped/dtslint\": \"0.0.112\",\n\t\t\"@emotion/css\": \"11.11.0\",\n\t\t\"@emotion/css-prettifier\": \"1.1.3\",\n\t\t\"@emotion/server\": \"11.11.0\",\n\t\t\"@emotion/styled\": \"11.11.0\",\n\t\t\"html-tag-names\": \"^1.1.2\",\n\t\treact: \"16.14.0\",\n\t\t\"svg-tag-names\": \"^1.1.1\",\n\t\ttypescript: \"^4.5.5\"\n\t},\n\trepository: \"https://github.com/emotion-js/emotion/tree/main/packages/react\",\n\tpublishConfig: {\n\t\taccess: \"public\"\n\t},\n\t\"umd:main\": \"dist/emotion-react.umd.min.js\",\n\tpreconstruct: {\n\t\tentrypoints: [\n\t\t\t\"./index.js\",\n\t\t\t\"./jsx-runtime.js\",\n\t\t\t\"./jsx-dev-runtime.js\",\n\t\t\t\"./_isolated-hnrs.js\"\n\t\t],\n\t\tumdName: \"emotionReact\",\n\t\texports: {\n\t\t\tenvConditions: [\n\t\t\t\t\"browser\",\n\t\t\t\t\"worker\"\n\t\t\t],\n\t\t\textra: {\n\t\t\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\t\t\"./macro\": {\n\t\t\t\t\ttypes: {\n\t\t\t\t\t\t\"import\": \"./macro.d.mts\",\n\t\t\t\t\t\t\"default\": \"./macro.d.ts\"\n\t\t\t\t\t},\n\t\t\t\t\t\"default\": \"./macro.js\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar jsx = function jsx(type, props) {\n var args = arguments;\n\n if (props == null || !hasOwnProperty.call(props, 'css')) {\n // $FlowFixMe\n return React.createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n } // $FlowFixMe\n\n\n return React.createElement.apply(null, createElementArgArray);\n};\n\nvar warnedAboutCssPropForGlobal = false; // maintain place over rerenders.\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is\n // probably using the custom createElement which\n // means it will be turned into a className prop\n // $FlowFixMe I don't really want to add it to the type since it shouldn't be used\n props.className || props.css)) {\n console.error(\"It looks like you're using the css prop on Global, did you mean to use the styles prop instead?\");\n warnedAboutCssPropForGlobal = true;\n }\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));\n\n if (!isBrowser$1) {\n var _ref;\n\n var serializedNames = serialized.name;\n var serializedStyles = serialized.styles;\n var next = serialized.next;\n\n while (next !== undefined) {\n serializedNames += ' ' + next.name;\n serializedStyles += next.styles;\n next = next.next;\n }\n\n var shouldCache = cache.compat === true;\n var rules = cache.insert(\"\", {\n name: serializedNames,\n styles: serializedStyles\n }, cache.sheet, shouldCache);\n\n if (shouldCache) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"style\", (_ref = {}, _ref[\"data-emotion\"] = cache.key + \"-global \" + serializedNames, _ref.dangerouslySetInnerHTML = {\n __html: rules\n }, _ref.nonce = cache.sheet.nonce, _ref));\n } // yes, i know these hooks are used conditionally\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = React.useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false; // $FlowFixMe\n\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Global.displayName = 'EmotionGlobal';\n}\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nvar keyframes = function keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name; // $FlowFixMe\n\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n};\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {\n console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.');\n }\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: React.useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nif (process.env.NODE_ENV !== 'production') {\n ClassNames.displayName = 'EmotionClassNames';\n}\n\nif (process.env.NODE_ENV !== 'production') {\n var isBrowser = \"object\" !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked\n\n var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';\n\n if (isBrowser && !isTestEnv) {\n // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later\n var globalContext = // $FlowIgnore\n typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef\n : isBrowser ? window : global;\n var globalKey = \"__EMOTION_REACT_\" + pkg.version.split('.')[0] + \"__\";\n\n if (globalContext[globalKey]) {\n console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');\n }\n\n globalContext[globalKey] = true;\n }\n}\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction Ripple(props) {\n const {\n className,\n classes,\n pulsate = false,\n rippleX,\n rippleY,\n rippleSize,\n in: inProp,\n onExited,\n timeout\n } = props;\n const [leaving, setLeaving] = React.useState(false);\n const rippleClassName = clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);\n const rippleStyles = {\n width: rippleSize,\n height: rippleSize,\n top: -(rippleSize / 2) + rippleY,\n left: -(rippleSize / 2) + rippleX\n };\n const childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);\n if (!inProp && !leaving) {\n setLeaving(true);\n }\n React.useEffect(() => {\n if (!inProp && onExited != null) {\n // react-transition-group#onExited\n const timeoutId = setTimeout(onExited, timeout);\n return () => {\n clearTimeout(timeoutId);\n };\n }\n return undefined;\n }, [onExited, inProp, timeout]);\n return /*#__PURE__*/_jsx(\"span\", {\n className: rippleClassName,\n style: rippleStyles,\n children: /*#__PURE__*/_jsx(\"span\", {\n className: childClassName\n })\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? Ripple.propTypes = {\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n /**\n * @ignore - injected from TransitionGroup\n */\n in: PropTypes.bool,\n /**\n * @ignore - injected from TransitionGroup\n */\n onExited: PropTypes.func,\n /**\n * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.\n */\n pulsate: PropTypes.bool,\n /**\n * Diameter of the ripple.\n */\n rippleSize: PropTypes.number,\n /**\n * Horizontal position of the ripple center.\n */\n rippleX: PropTypes.number,\n /**\n * Vertical position of the ripple center.\n */\n rippleY: PropTypes.number,\n /**\n * exit delay\n */\n timeout: PropTypes.number.isRequired\n} : void 0;\nexport default Ripple;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getTouchRippleUtilityClass(slot) {\n return generateUtilityClass('MuiTouchRipple', slot);\n}\nconst touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);\nexport default touchRippleClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"center\", \"classes\", \"className\"];\nlet _ = t => t,\n _t,\n _t2,\n _t3,\n _t4;\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { TransitionGroup } from 'react-transition-group';\nimport clsx from 'clsx';\nimport { keyframes } from '@mui/system';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport Ripple from './Ripple';\nimport touchRippleClasses from './touchRippleClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst DURATION = 550;\nexport const DELAY_RIPPLE = 80;\nconst enterKeyframe = keyframes(_t || (_t = _`\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n`));\nconst exitKeyframe = keyframes(_t2 || (_t2 = _`\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n`));\nconst pulsateKeyframe = keyframes(_t3 || (_t3 = _`\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n`));\nexport const TouchRippleRoot = styled('span', {\n name: 'MuiTouchRipple',\n slot: 'Root'\n})({\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 0,\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: 'inherit'\n});\n\n// This `styled()` function invokes keyframes. `styled-components` only supports keyframes\n// in string templates. Do not convert these styles in JS object as it will break.\nexport const TouchRippleRipple = styled(Ripple, {\n name: 'MuiTouchRipple',\n slot: 'Ripple'\n})(_t4 || (_t4 = _`\n opacity: 0;\n position: absolute;\n\n &.${0} {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ${0};\n animation-duration: ${0}ms;\n animation-timing-function: ${0};\n }\n\n &.${0} {\n animation-duration: ${0}ms;\n }\n\n & .${0} {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & .${0} {\n opacity: 0;\n animation-name: ${0};\n animation-duration: ${0}ms;\n animation-timing-function: ${0};\n }\n\n & .${0} {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ${0};\n animation-duration: 2500ms;\n animation-timing-function: ${0};\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n`), touchRippleClasses.rippleVisible, enterKeyframe, DURATION, ({\n theme\n}) => theme.transitions.easing.easeInOut, touchRippleClasses.ripplePulsate, ({\n theme\n}) => theme.transitions.duration.shorter, touchRippleClasses.child, touchRippleClasses.childLeaving, exitKeyframe, DURATION, ({\n theme\n}) => theme.transitions.easing.easeInOut, touchRippleClasses.childPulsate, pulsateKeyframe, ({\n theme\n}) => theme.transitions.easing.easeInOut);\n\n/**\n * @ignore - internal component.\n *\n * TODO v5: Make private\n */\nconst TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiTouchRipple'\n });\n const {\n center: centerProp = false,\n classes = {},\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [ripples, setRipples] = React.useState([]);\n const nextKey = React.useRef(0);\n const rippleCallback = React.useRef(null);\n React.useEffect(() => {\n if (rippleCallback.current) {\n rippleCallback.current();\n rippleCallback.current = null;\n }\n }, [ripples]);\n\n // Used to filter out mouse emulated events on mobile.\n const ignoringMouseDown = React.useRef(false);\n // We use a timer in order to only show the ripples for touch \"click\" like events.\n // We don't want to display the ripple for touch scroll events.\n const startTimer = React.useRef(0);\n\n // This is the hook called once the previous timeout is ready.\n const startTimerCommit = React.useRef(null);\n const container = React.useRef(null);\n React.useEffect(() => {\n return () => {\n if (startTimer.current) {\n clearTimeout(startTimer.current);\n }\n };\n }, []);\n const startCommit = React.useCallback(params => {\n const {\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n } = params;\n setRipples(oldRipples => [...oldRipples, /*#__PURE__*/_jsx(TouchRippleRipple, {\n classes: {\n ripple: clsx(classes.ripple, touchRippleClasses.ripple),\n rippleVisible: clsx(classes.rippleVisible, touchRippleClasses.rippleVisible),\n ripplePulsate: clsx(classes.ripplePulsate, touchRippleClasses.ripplePulsate),\n child: clsx(classes.child, touchRippleClasses.child),\n childLeaving: clsx(classes.childLeaving, touchRippleClasses.childLeaving),\n childPulsate: clsx(classes.childPulsate, touchRippleClasses.childPulsate)\n },\n timeout: DURATION,\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize\n }, nextKey.current)]);\n nextKey.current += 1;\n rippleCallback.current = cb;\n }, [classes]);\n const start = React.useCallback((event = {}, options = {}, cb = () => {}) => {\n const {\n pulsate = false,\n center = centerProp || options.pulsate,\n fakeElement = false // For test purposes\n } = options;\n if ((event == null ? void 0 : event.type) === 'mousedown' && ignoringMouseDown.current) {\n ignoringMouseDown.current = false;\n return;\n }\n if ((event == null ? void 0 : event.type) === 'touchstart') {\n ignoringMouseDown.current = true;\n }\n const element = fakeElement ? null : container.current;\n const rect = element ? element.getBoundingClientRect() : {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n };\n\n // Get the size of the ripple\n let rippleX;\n let rippleY;\n let rippleSize;\n if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {\n rippleX = Math.round(rect.width / 2);\n rippleY = Math.round(rect.height / 2);\n } else {\n const {\n clientX,\n clientY\n } = event.touches && event.touches.length > 0 ? event.touches[0] : event;\n rippleX = Math.round(clientX - rect.left);\n rippleY = Math.round(clientY - rect.top);\n }\n if (center) {\n rippleSize = Math.sqrt((2 * rect.width ** 2 + rect.height ** 2) / 3);\n\n // For some reason the animation is broken on Mobile Chrome if the size is even.\n if (rippleSize % 2 === 0) {\n rippleSize += 1;\n }\n } else {\n const sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;\n const sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;\n rippleSize = Math.sqrt(sizeX ** 2 + sizeY ** 2);\n }\n\n // Touche devices\n if (event != null && event.touches) {\n // check that this isn't another touchstart due to multitouch\n // otherwise we will only clear a single timer when unmounting while two\n // are running\n if (startTimerCommit.current === null) {\n // Prepare the ripple effect.\n startTimerCommit.current = () => {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n };\n // Delay the execution of the ripple effect.\n startTimer.current = setTimeout(() => {\n if (startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n }\n }, DELAY_RIPPLE); // We have to make a tradeoff with this value.\n }\n } else {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n }\n }, [centerProp, startCommit]);\n const pulsate = React.useCallback(() => {\n start({}, {\n pulsate: true\n });\n }, [start]);\n const stop = React.useCallback((event, cb) => {\n clearTimeout(startTimer.current);\n\n // The touch interaction occurs too quickly.\n // We still want to show ripple effect.\n if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n startTimer.current = setTimeout(() => {\n stop(event, cb);\n });\n return;\n }\n startTimerCommit.current = null;\n setRipples(oldRipples => {\n if (oldRipples.length > 0) {\n return oldRipples.slice(1);\n }\n return oldRipples;\n });\n rippleCallback.current = cb;\n }, []);\n React.useImperativeHandle(ref, () => ({\n pulsate,\n start,\n stop\n }), [pulsate, start, stop]);\n return /*#__PURE__*/_jsx(TouchRippleRoot, _extends({\n className: clsx(touchRippleClasses.root, classes.root, className),\n ref: container\n }, other, {\n children: /*#__PURE__*/_jsx(TransitionGroup, {\n component: null,\n exit: true,\n children: ripples\n })\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? TouchRipple.propTypes = {\n /**\n * If `true`, the ripple starts at the center of the component\n * rather than at the point of interaction.\n */\n center: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string\n} : void 0;\nexport default TouchRipple;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getButtonBaseUtilityClass(slot) {\n return generateUtilityClass('MuiButtonBase', slot);\n}\nconst buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);\nexport default buttonBaseClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"action\", \"centerRipple\", \"children\", \"className\", \"component\", \"disabled\", \"disableRipple\", \"disableTouchRipple\", \"focusRipple\", \"focusVisibleClassName\", \"LinkComponent\", \"onBlur\", \"onClick\", \"onContextMenu\", \"onDragLeave\", \"onFocus\", \"onFocusVisible\", \"onKeyDown\", \"onKeyUp\", \"onMouseDown\", \"onMouseLeave\", \"onMouseUp\", \"onTouchEnd\", \"onTouchMove\", \"onTouchStart\", \"tabIndex\", \"TouchRippleProps\", \"touchRippleRef\", \"type\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { elementTypeAcceptingRef, refType } from '@mui/utils';\nimport composeClasses from '@mui/base/composeClasses';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport useForkRef from '../utils/useForkRef';\nimport useEventCallback from '../utils/useEventCallback';\nimport useIsFocusVisible from '../utils/useIsFocusVisible';\nimport TouchRipple from './TouchRipple';\nimport buttonBaseClasses, { getButtonBaseUtilityClass } from './buttonBaseClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n disabled,\n focusVisible,\n focusVisibleClassName,\n classes\n } = ownerState;\n const slots = {\n root: ['root', disabled && 'disabled', focusVisible && 'focusVisible']\n };\n const composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);\n if (focusVisible && focusVisibleClassName) {\n composedClasses.root += ` ${focusVisibleClassName}`;\n }\n return composedClasses;\n};\nexport const ButtonBaseRoot = styled('button', {\n name: 'MuiButtonBase',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n boxSizing: 'border-box',\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n MozAppearance: 'none',\n // Reset\n WebkitAppearance: 'none',\n // Reset\n textDecoration: 'none',\n // So we take precedent over the style of a native element.\n color: 'inherit',\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n },\n\n [`&.${buttonBaseClasses.disabled}`]: {\n pointerEvents: 'none',\n // Disable link interactions\n cursor: 'default'\n },\n '@media print': {\n colorAdjust: 'exact'\n }\n});\n\n/**\n * `ButtonBase` contains as few styles as possible.\n * It aims to be a simple building block for creating a button.\n * It contains a load of style reset and some focus/ripple logic.\n */\nconst ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiButtonBase'\n });\n const {\n action,\n centerRipple = false,\n children,\n className,\n component = 'button',\n disabled = false,\n disableRipple = false,\n disableTouchRipple = false,\n focusRipple = false,\n LinkComponent = 'a',\n onBlur,\n onClick,\n onContextMenu,\n onDragLeave,\n onFocus,\n onFocusVisible,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n tabIndex = 0,\n TouchRippleProps,\n touchRippleRef,\n type\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const buttonRef = React.useRef(null);\n const rippleRef = React.useRef(null);\n const handleRippleRef = useForkRef(rippleRef, touchRippleRef);\n const {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref: focusVisibleRef\n } = useIsFocusVisible();\n const [focusVisible, setFocusVisible] = React.useState(false);\n if (disabled && focusVisible) {\n setFocusVisible(false);\n }\n React.useImperativeHandle(action, () => ({\n focusVisible: () => {\n setFocusVisible(true);\n buttonRef.current.focus();\n }\n }), []);\n const [mountedState, setMountedState] = React.useState(false);\n React.useEffect(() => {\n setMountedState(true);\n }, []);\n const enableTouchRipple = mountedState && !disableRipple && !disabled;\n React.useEffect(() => {\n if (focusVisible && focusRipple && !disableRipple && mountedState) {\n rippleRef.current.pulsate();\n }\n }, [disableRipple, focusRipple, focusVisible, mountedState]);\n function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {\n return useEventCallback(event => {\n if (eventCallback) {\n eventCallback(event);\n }\n const ignore = skipRippleAction;\n if (!ignore && rippleRef.current) {\n rippleRef.current[rippleAction](event);\n }\n return true;\n });\n }\n const handleMouseDown = useRippleHandler('start', onMouseDown);\n const handleContextMenu = useRippleHandler('stop', onContextMenu);\n const handleDragLeave = useRippleHandler('stop', onDragLeave);\n const handleMouseUp = useRippleHandler('stop', onMouseUp);\n const handleMouseLeave = useRippleHandler('stop', event => {\n if (focusVisible) {\n event.preventDefault();\n }\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n });\n const handleTouchStart = useRippleHandler('start', onTouchStart);\n const handleTouchEnd = useRippleHandler('stop', onTouchEnd);\n const handleTouchMove = useRippleHandler('stop', onTouchMove);\n const handleBlur = useRippleHandler('stop', event => {\n handleBlurVisible(event);\n if (isFocusVisibleRef.current === false) {\n setFocusVisible(false);\n }\n if (onBlur) {\n onBlur(event);\n }\n }, false);\n const handleFocus = useEventCallback(event => {\n // Fix for https://github.com/facebook/react/issues/7769\n if (!buttonRef.current) {\n buttonRef.current = event.currentTarget;\n }\n handleFocusVisible(event);\n if (isFocusVisibleRef.current === true) {\n setFocusVisible(true);\n if (onFocusVisible) {\n onFocusVisible(event);\n }\n }\n if (onFocus) {\n onFocus(event);\n }\n });\n const isNonNativeButton = () => {\n const button = buttonRef.current;\n return component && component !== 'button' && !(button.tagName === 'A' && button.href);\n };\n\n /**\n * IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat\n */\n const keydownRef = React.useRef(false);\n const handleKeyDown = useEventCallback(event => {\n // Check if key is already down to avoid repeats being counted as multiple activations\n if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {\n keydownRef.current = true;\n rippleRef.current.stop(event, () => {\n rippleRef.current.start(event);\n });\n }\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {\n event.preventDefault();\n }\n if (onKeyDown) {\n onKeyDown(event);\n }\n\n // Keyboard accessibility for non interactive elements\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {\n event.preventDefault();\n if (onClick) {\n onClick(event);\n }\n }\n });\n const handleKeyUp = useEventCallback(event => {\n // calling preventDefault in keyUp on a