diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..c2658d7d1b31848c3b71960543cb0368e56cd4c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/README.md b/README.md index 94b4b0b42f4edf2914eebd8eba328adb08253e43..23d9f4eea0217e80fa79fea1401f3bbf60130a97 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,7 @@ title: Cnn Visualizer emoji: 🌍 colorFrom: indigo colorTo: red -sdk: gradio -sdk_version: 5.46.0 -app_file: app.py +sdk: static +app_file: dist/index.html pinned: false ---- - -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +--- \ No newline at end of file diff --git a/dist/assets/index-BoCAEVud.css b/dist/assets/index-BoCAEVud.css new file mode 100644 index 0000000000000000000000000000000000000000..769390b18b4dc070ca31f94abd259ef6b5a26e4a --- /dev/null +++ b/dist/assets/index-BoCAEVud.css @@ -0,0 +1 @@ +:root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:orange}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}h1{font-size:40px;font-weight:700;text-align:left}.main-container{flex:1;display:grid;grid-template-columns:2fr 1fr;gap:2rem}.convolution-viewer{display:flex;flex-direction:row;justify-content:center;gap:2rem;padding:2rem}.convolution-viewer-item{display:flex;flex-direction:column;align-items:center;width:300px;height:340px;border-radius:10px;background:#fafafa;padding:1rem;box-shadow:0 2px 6px #0000000d;transition:transform .2s ease,box-shadow .2s ease;border:1px solid black}.convolution-viewer-item h3{margin:.5rem 0 1rem;font-size:1.1rem;font-weight:600;color:#333;text-align:center;border-bottom:2px solid orange;padding-bottom:.3rem}.convolution-viewer-item img{flex-grow:1;width:100%;height:100%;max-height:none;object-fit:contain}` .app-button{padding:8px 16px;background-color:#f0f0f0;border:none;border-radius:8px;cursor:pointer;font-size:1rem}.app-button:focus{outline:none}.app-button:hover{outline:1px solid orange}.app-button.selected{background-color:orange;color:#fff}.preset-selector{display:flex;align-items:center;gap:12px;background:#f7f7f7;padding:12px 16px;border-radius:8px;border:1px solid #ddd;margin-bottom:12px;width:fit-content}.preset-label{font-weight:600;font-size:14px}.preset-dropdown{padding:6px 10px;font-size:14px;border-radius:6px;border:1px solid #ccc;background:#fff}.preset-dropdown:focus{outline:none}.preset-dropdown:focus-visible{outline:2px solid #4e9fff}.preset-apply{padding:6px 14px;font-size:14px;background:#4e9fff;color:#fff;border:none;border-radius:6px;cursor:pointer;transition:background .2s}.preset-apply:hover{background:#1e7be6}.kernel-editor{display:flex;flex-direction:column;gap:30px;padding:12px;max-width:fit-content;align-items:center}.kernel-matrix{display:flex;flex-direction:column;gap:8px}.kernel-row{display:flex;gap:8px}.kernel-size-options{border:1px solid #d0d0d0;border-radius:6px;padding:8px 12px;background:#f9f9f9;box-shadow:0 1px 2px #0000000a}.kernel-size-options form{display:flex;justify-content:space-between;align-items:center}.kernel-size-options input[type=number]{width:auto;max-width:4ch;margin:0 8px}.kernel-cell{width:4.5em;height:2.4em;text-align:center;font-size:15px;border:1px solid #d0d0d0;border-radius:6px;background:#fff;transition:border-color .2s,box-shadow .2s,transform .1s;box-shadow:0 1px 2px #0000000a}.kernel-cell:hover{border-color:#888}.kernel-cell:focus{outline:none;border-color:orange;box-shadow:0 0 0 3px #0078ff33;transform:scale(1.02)}.channel-buttons{display:flex;gap:12px}.channel-buttons .selected{background-color:orange;color:#fff}.channel-buttons button:focus{outline:none}.channel-buttons button:focus-visible{outline:2px solid orange}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.tabs{display:flex;flex-direction:column;height:100%}.tab-buttons{display:flex;border-bottom:1px solid #ccc;margin-bottom:20px}.tab-buttons button{padding:10px 20px;border:none;background:none;cursor:pointer;border-radius:0;will-change:border-bottom}.tab-buttons button.active{border-bottom:3px solid orange}.tab-content{flex:1;padding:20px;border:none}.tab-buttons button:focus{outline:none}.tab-buttons button:focus-visible{outline:2px solid orange}.switch-container{display:flex;align-items:center;justify-content:center;gap:12px;font-size:16px;-webkit-user-select:none;user-select:none}.switch{position:relative;width:70px;height:36px}.slider{position:absolute;cursor:pointer;inset:0;background:#777;border-radius:36px;transition:background .25s}.slider:before{position:absolute;content:"";height:28px;width:28px;left:4px;top:4px;background:#fff;border-radius:50%;transition:transform .25s}.switch input:checked+.slider{background:orange}.input-selector{display:flex;flex-direction:column;gap:30px}.switch{position:relative;display:inline-block;width:50px;height:24px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#ccc;transition:.4s;border-radius:24px}.slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;transition:.4s;border-radius:50%}input:checked+.slider{background-color:#4caf50}input:checked+.slider:before{transform:translate(26px)}.layer-viewer{padding:12px;border:1px solid #ccc;margin-bottom:20px;border-radius:6px;background:#fafafa}.layer-title{margin:0 0 6px;font-size:20px;font-weight:600}.layer-details{display:flex;justify-content:space-evenly;margin-bottom:12px;color:#444;font-size:14px}.layer-grid{display:flex;flex-wrap:wrap;gap:6px}.layer-grid img{width:100px;height:100px;image-rendering:pixelated}.card{background-color:#fff;border:1px solid #dcdfe6;border-radius:12px;padding:18px;display:flex;flex-direction:column;gap:24px;width:300px}.field{display:flex;flex-direction:column;gap:6px}.field label,.field legend{font-weight:600;color:#2c2f37;align-self:flex-start}.field input[type=text],.field input[type=number],.field textarea{border:1px solid #ccd0dd;border-radius:6px;padding:8px 10px;font-size:.95rem;font-family:inherit;background-color:#fafafe}.field textarea{resize:vertical}.field input[readonly],.field textarea[readonly]{background-color:#f4f6fc;color:#4a4f5c}.double-field{display:flex;gap:6px;width:100%;justify-content:space-between}.double-field .field{width:140px}.input-button{display:grid;grid-template-columns:1fr 1fr;gap:8px}.fieldset{border:1px solid #ccd0dd;border-radius:6px;padding:10px 12px 12px;display:flex;flex-direction:column;gap:6px}.fieldset label{font-weight:500;color:#343844}.slider-field{gap:10px}.slider-control{display:flex;align-items:center;gap:12px}.slider-control input[type=range]{width:80px;-webkit-appearance:none;background-color:#d3d3d3;border-radius:6px;accent-color:var(--accent-color);flex:1}.slider-control input[type=range]::-webkit-slider-runnable-track{height:6px;background:#d3d3d3;border-radius:6px}.slider-control input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;background:var(--accent-color);cursor:pointer;margin-top:-4px}.slider-control span{min-width:28px;text-align:right;font-weight:600}.network-visualizer{display:grid;grid-template-columns:2fr 1fr;gap:20px} diff --git a/dist/assets/index-CARha6nB.js b/dist/assets/index-CARha6nB.js new file mode 100644 index 0000000000000000000000000000000000000000..62fb44921969d49852aa7b75c00602098a18f988 --- /dev/null +++ b/dist/assets/index-CARha6nB.js @@ -0,0 +1,8782 @@ +function kee(u,e){for(var n=0;nb[R]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const R of document.querySelectorAll('link[rel="modulepreload"]'))b(R);new MutationObserver(R=>{for(const q of R)if(q.type==="childList")for(const re of q.addedNodes)re.tagName==="LINK"&&re.rel==="modulepreload"&&b(re)}).observe(document,{childList:!0,subtree:!0});function n(R){const q={};return R.integrity&&(q.integrity=R.integrity),R.referrerPolicy&&(q.referrerPolicy=R.referrerPolicy),R.crossOrigin==="use-credentials"?q.credentials="include":R.crossOrigin==="anonymous"?q.credentials="omit":q.credentials="same-origin",q}function b(R){if(R.ep)return;R.ep=!0;const q=n(R);fetch(R.href,q)}})();function yU(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function Mee(u){if(Object.prototype.hasOwnProperty.call(u,"__esModule"))return u;var e=u.default;if(typeof e=="function"){var n=function b(){var R=!1;try{R=this instanceof b}catch{}return R?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(u).forEach(function(b){var R=Object.getOwnPropertyDescriptor(u,b);Object.defineProperty(n,b,R.get?R:{enumerable:!0,get:function(){return u[b]}})}),n}var j4={exports:{}},BE={};var d9;function Iee(){if(d9)return BE;d9=1;var u=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(b,R,q){var re=null;if(q!==void 0&&(re=""+q),R.key!==void 0&&(re=""+R.key),"key"in R){q={};for(var fe in R)fe!=="key"&&(q[fe]=R[fe])}else q=R;return R=q.ref,{$$typeof:u,type:b,key:re,ref:R!==void 0?R:null,props:q}}return BE.Fragment=e,BE.jsx=n,BE.jsxs=n,BE}var p9;function Lee(){return p9||(p9=1,j4.exports=Iee()),j4.exports}var Ei=Lee(),G4={exports:{}},Xu={};var v9;function Ree(){if(v9)return Xu;v9=1;var u=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),re=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),be=Symbol.for("react.memo"),Pe=Symbol.for("react.lazy"),je=Symbol.for("react.activity"),We=Symbol.iterator;function ft(Hn){return Hn===null||typeof Hn!="object"?null:(Hn=We&&Hn[We]||Hn["@@iterator"],typeof Hn=="function"?Hn:null)}var xt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zt=Object.assign,Ft={};function jt(Hn,qa,ki){this.props=Hn,this.context=qa,this.refs=Ft,this.updater=ki||xt}jt.prototype.isReactComponent={},jt.prototype.setState=function(Hn,qa){if(typeof Hn!="object"&&typeof Hn!="function"&&Hn!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Hn,qa,"setState")},jt.prototype.forceUpdate=function(Hn){this.updater.enqueueForceUpdate(this,Hn,"forceUpdate")};function Re(){}Re.prototype=jt.prototype;function Lr(Hn,qa,ki){this.props=Hn,this.context=qa,this.refs=Ft,this.updater=ki||xt}var Cr=Lr.prototype=new Re;Cr.constructor=Lr,zt(Cr,jt.prototype),Cr.isPureReactComponent=!0;var Gr=Array.isArray;function yn(){}var Pn={H:null,A:null,T:null,S:null},Vn=Object.prototype.hasOwnProperty;function un(Hn,qa,ki){var no=ki.ref;return{$$typeof:u,type:Hn,key:qa,ref:no!==void 0?no:null,props:ki}}function Nn(Hn,qa){return un(Hn.type,qa,Hn.props)}function Kr(Hn){return typeof Hn=="object"&&Hn!==null&&Hn.$$typeof===u}function Ma(Hn){var qa={"=":"=0",":":"=2"};return"$"+Hn.replace(/[=:]/g,function(ki){return qa[ki]})}var ui=/\/+/g;function da(Hn,qa){return typeof Hn=="object"&&Hn!==null&&Hn.key!=null?Ma(""+Hn.key):qa.toString(36)}function Ia(Hn){switch(Hn.status){case"fulfilled":return Hn.value;case"rejected":throw Hn.reason;default:switch(typeof Hn.status=="string"?Hn.then(yn,yn):(Hn.status="pending",Hn.then(function(qa){Hn.status==="pending"&&(Hn.status="fulfilled",Hn.value=qa)},function(qa){Hn.status==="pending"&&(Hn.status="rejected",Hn.reason=qa)})),Hn.status){case"fulfilled":return Hn.value;case"rejected":throw Hn.reason}}throw Hn}function aa(Hn,qa,ki,no,oo){var Li=typeof Hn;(Li==="undefined"||Li==="boolean")&&(Hn=null);var Do=!1;if(Hn===null)Do=!0;else switch(Li){case"bigint":case"string":case"number":Do=!0;break;case"object":switch(Hn.$$typeof){case u:case e:Do=!0;break;case Pe:return Do=Hn._init,aa(Do(Hn._payload),qa,ki,no,oo)}}if(Do)return oo=oo(Hn),Do=no===""?"."+da(Hn,0):no,Gr(oo)?(ki="",Do!=null&&(ki=Do.replace(ui,"$&/")+"/"),aa(oo,qa,ki,"",function(ou){return ou})):oo!=null&&(Kr(oo)&&(oo=Nn(oo,ki+(oo.key==null||Hn&&Hn.key===oo.key?"":(""+oo.key).replace(ui,"$&/")+"/")+Do)),qa.push(oo)),1;Do=0;var el=no===""?".":no+":";if(Gr(Hn))for(var Ps=0;Ps>>1,$i=aa[Ui];if(0>>1;UiR(ki,ai))no<$i&&0>R(oo,ki)?(aa[Ui]=oo,aa[no]=ai,Ui=no):(aa[Ui]=ki,aa[qa]=ai,Ui=qa);else if(no<$i&&0>R(oo,ai))aa[Ui]=oo,aa[no]=ai,Ui=no;else break e}}return Ka}function R(aa,Ka){var ai=aa.sortIndex-Ka.sortIndex;return ai!==0?ai:aa.id-Ka.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var q=performance;u.unstable_now=function(){return q.now()}}else{var re=Date,fe=re.now();u.unstable_now=function(){return re.now()-fe}}var he=[],be=[],Pe=1,je=null,We=3,ft=!1,xt=!1,zt=!1,Ft=!1,jt=typeof setTimeout=="function"?setTimeout:null,Re=typeof clearTimeout=="function"?clearTimeout:null,Lr=typeof setImmediate<"u"?setImmediate:null;function Cr(aa){for(var Ka=n(be);Ka!==null;){if(Ka.callback===null)b(be);else if(Ka.startTime<=aa)b(be),Ka.sortIndex=Ka.expirationTime,e(he,Ka);else break;Ka=n(be)}}function Gr(aa){if(zt=!1,Cr(aa),!xt)if(n(he)!==null)xt=!0,yn||(yn=!0,Ma());else{var Ka=n(be);Ka!==null&&Ia(Gr,Ka.startTime-aa)}}var yn=!1,Pn=-1,Vn=5,un=-1;function Nn(){return Ft?!0:!(u.unstable_now()-unaa&&Nn());){var Ui=je.callback;if(typeof Ui=="function"){je.callback=null,We=je.priorityLevel;var $i=Ui(je.expirationTime<=aa);if(aa=u.unstable_now(),typeof $i=="function"){je.callback=$i,Cr(aa),Ka=!0;break t}je===n(he)&&b(he),Cr(aa)}else b(he);je=n(he)}if(je!==null)Ka=!0;else{var Hn=n(be);Hn!==null&&Ia(Gr,Hn.startTime-aa),Ka=!1}}break e}finally{je=null,We=ai,ft=!1}Ka=void 0}}finally{Ka?Ma():yn=!1}}}var Ma;if(typeof Lr=="function")Ma=function(){Lr(Kr)};else if(typeof MessageChannel<"u"){var ui=new MessageChannel,da=ui.port2;ui.port1.onmessage=Kr,Ma=function(){da.postMessage(null)}}else Ma=function(){jt(Kr,0)};function Ia(aa,Ka){Pn=jt(function(){aa(u.unstable_now())},Ka)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(aa){aa.callback=null},u.unstable_forceFrameRate=function(aa){0>aa||125Ui?(aa.sortIndex=ai,e(be,aa),n(he)===null&&aa===n(be)&&(zt?(Re(Pn),Pn=-1):zt=!0,Ia(Gr,ai-Ui))):(aa.sortIndex=$i,e(he,aa),xt||ft||(xt=!0,yn||(yn=!0,Ma()))),aa},u.unstable_shouldYield=Nn,u.unstable_wrapCallback=function(aa){var Ka=We;return function(){var ai=We;We=Ka;try{return aa.apply(this,arguments)}finally{We=ai}}}})(W4)),W4}var y9;function Pee(){return y9||(y9=1,H4.exports=Dee()),H4.exports}var X4={exports:{}},hm={};var _9;function zee(){if(_9)return hm;_9=1;var u=qL();function e(he){var be="https://react.dev/errors/"+he;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(e){console.error(e)}}return u(),X4.exports=zee(),X4.exports}var b9;function Oee(){if(b9)return UE;b9=1;var u=Pee(),e=qL(),n=Nee();function b($){var te="https://react.dev/errors/"+$;if(1$i||($.current=Ui[$i],Ui[$i]=null,$i--)}function ki($,te){$i++,Ui[$i]=$.current,$.current=te}var no=Hn(null),oo=Hn(null),Li=Hn(null),Do=Hn(null);function el($,te){switch(ki(Li,te),ki(oo,$),ki(no,null),te.nodeType){case 9:case 11:$=($=te.documentElement)&&($=$.namespaceURI)?z5($):0;break;default:if($=te.tagName,te=te.namespaceURI)te=z5(te),$=N5(te,$);else switch($){case"svg":$=1;break;case"math":$=2;break;default:$=0}}qa(no),ki(no,$)}function Ps(){qa(no),qa(oo),qa(Li)}function ou($){$.memoizedState!==null&&ki(Do,$);var te=no.current,Ae=N5(te,$.type);te!==Ae&&(ki(oo,$),ki(no,Ae))}function As($){oo.current===$&&(qa(no),qa(oo)),Do.current===$&&(qa(Do),Tx._currentValue=ai)}var nc,du;function ko($){if(nc===void 0)try{throw Error()}catch(Ae){var te=Ae.stack.trim().match(/\n( *(at )?)/);nc=te&&te[1]||"",du=-1)":-1Tt||ja[qe]!==Ji[Tt]){var Io=` +`+ja[qe].replace(" at new "," at ");return $.displayName&&Io.includes("")&&(Io=Io.replace("",$.displayName)),Io}while(1<=qe&&0<=Tt);break}}}finally{Ec=!1,Error.prepareStackTrace=Ae}return(Ae=$?$.displayName||$.name:"")?ko(Ae):""}function Ah($,te){switch($.tag){case 26:case 27:case 5:return ko($.type);case 16:return ko("Lazy");case 13:return $.child!==te&&te!==null?ko("Suspense Fallback"):ko("Suspense");case 19:return ko("SuspenseList");case 0:case 15:return Cc($.type,!1);case 11:return Cc($.type.render,!1);case 1:return Cc($.type,!0);case 31:return ko("Activity");default:return""}}function Hc($){try{var te="",Ae=null;do te+=Ah($,Ae),Ae=$,$=$.return;while($);return te}catch(qe){return` +Error generating stack: `+qe.message+` +`+qe.stack}}var $v=Object.prototype.hasOwnProperty,eh=u.unstable_scheduleCallback,Vv=u.unstable_cancelCallback,uv=u.unstable_shouldYield,S0=u.unstable_requestPaint,Rh=u.unstable_now,cg=u.unstable_getCurrentPriorityLevel,Vm=u.unstable_ImmediatePriority,fg=u.unstable_UserBlockingPriority,_m=u.unstable_NormalPriority,_1=u.unstable_LowPriority,L_=u.unstable_IdlePriority,Sb=u.log,tS=u.unstable_setDisableYieldValue,Gg=null,Mv=null;function qg($){if(typeof Sb=="function"&&tS($),Mv&&typeof Mv.setStrictMode=="function")try{Mv.setStrictMode(Gg,$)}catch{}}var xm=Math.clz32?Math.clz32:AD,wD=Math.log,TD=Math.LN2;function AD($){return $>>>=0,$===0?32:31-(wD($)/TD|0)|0}var V2=256,j2=262144,G2=4194304;function x1($){var te=$&42;if(te!==0)return te;switch($&-$){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return $&261888;case 262144:case 524288:case 1048576:case 2097152:return $&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return $&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return $}}function q2($,te,Ae){var qe=$.pendingLanes;if(qe===0)return 0;var Tt=0,qt=$.suspendedLanes,Hr=$.pingedLanes;$=$.warmLanes;var On=qe&134217727;return On!==0?(qe=On&~qt,qe!==0?Tt=x1(qe):(Hr&=On,Hr!==0?Tt=x1(Hr):Ae||(Ae=On&~$,Ae!==0&&(Tt=x1(Ae))))):(On=qe&~qt,On!==0?Tt=x1(On):Hr!==0?Tt=x1(Hr):Ae||(Ae=qe&~$,Ae!==0&&(Tt=x1(Ae)))),Tt===0?0:te!==0&&te!==Tt&&(te&qt)===0&&(qt=Tt&-Tt,Ae=te&-te,qt>=Ae||qt===32&&(Ae&4194048)!==0)?te:Tt}function Eb($,te){return($.pendingLanes&~($.suspendedLanes&~$.pingedLanes)&te)===0}function SD($,te){switch($){case 1:case 2:case 4:case 8:case 64:return te+250;case 16:case 32: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 te+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Mk(){var $=G2;return G2<<=1,(G2&62914560)===0&&(G2=4194304),$}function rS($){for(var te=[],Ae=0;31>Ae;Ae++)te.push($);return te}function Cb($,te){$.pendingLanes|=te,te!==268435456&&($.suspendedLanes=0,$.pingedLanes=0,$.warmLanes=0)}function ED($,te,Ae,qe,Tt,qt){var Hr=$.pendingLanes;$.pendingLanes=Ae,$.suspendedLanes=0,$.pingedLanes=0,$.warmLanes=0,$.expiredLanes&=Ae,$.entangledLanes&=Ae,$.errorRecoveryDisabledLanes&=Ae,$.shellSuspendCounter=0;var On=$.entanglements,ja=$.expirationTimes,Ji=$.hiddenUpdates;for(Ae=Hr&~Ae;0"u")return null;try{return $.activeElement||$.body}catch{return $.body}}var Ib=/[\n"\\]/g;function Gm($){return $.replace(Ib,function(te){return"\\"+te.charCodeAt(0).toString(16)+" "})}function Y2($,te,Ae,qe,Tt,qt,Hr,On){$.name="",Hr!=null&&typeof Hr!="function"&&typeof Hr!="symbol"&&typeof Hr!="boolean"?$.type=Hr:$.removeAttribute("type"),te!=null?Hr==="number"?(te===0&&$.value===""||$.value!=te)&&($.value=""+jm(te)):$.value!==""+jm(te)&&($.value=""+jm(te)):Hr!=="submit"&&Hr!=="reset"||$.removeAttribute("value"),te!=null?Bu($,Hr,jm(te)):Ae!=null?Bu($,Hr,jm(Ae)):qe!=null&&$.removeAttribute("value"),Tt==null&&qt!=null&&($.defaultChecked=!!qt),Tt!=null&&($.checked=Tt&&typeof Tt!="function"&&typeof Tt!="symbol"),On!=null&&typeof On!="function"&&typeof On!="symbol"&&typeof On!="boolean"?$.name=""+jm(On):$.removeAttribute("name")}function O_($,te,Ae,qe,Tt,qt,Hr,On){if(qt!=null&&typeof qt!="function"&&typeof qt!="symbol"&&typeof qt!="boolean"&&($.type=qt),te!=null||Ae!=null){if(!(qt!=="submit"&&qt!=="reset"||te!=null)){X2($);return}Ae=Ae!=null?""+jm(Ae):"",te=te!=null?""+jm(te):Ae,On||te===$.value||($.value=te),$.defaultValue=te}qe=qe??Tt,qe=typeof qe!="function"&&typeof qe!="symbol"&&!!qe,$.checked=On?$.checked:!!qe,$.defaultChecked=!!qe,Hr!=null&&typeof Hr!="function"&&typeof Hr!="symbol"&&typeof Hr!="boolean"&&($.name=Hr),X2($)}function Bu($,te,Ae){te==="number"&&I0($.ownerDocument)===$||$.defaultValue===""+Ae||($.defaultValue=""+Ae)}function qh($,te,Ae,qe){if($=$.options,te){te={};for(var Tt=0;Tt"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fp=!1;if(Hg)try{var dg={};Object.defineProperty(dg,"passive",{get:function(){fp=!0}}),window.addEventListener("test",dg,dg),window.removeEventListener("test",dg,dg)}catch{fp=!1}var Gv=null,K2=null,ed=null;function Ok(){if(ed)return ed;var $,te=K2,Ae=te.length,qe,Tt="value"in Gv?Gv.value:Gv.textContent,qt=Tt.length;for($=0;$=Db),Pb=" ",e3=!1;function t3($,te){switch($){case"keyup":return FD.indexOf(te.keyCode)!==-1;case"keydown":return te.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r3($){return $=$.detail,typeof $=="object"&&"data"in $?$.data:null}var qm=!1;function pS($,te){switch($){case"compositionend":return r3(te);case"keypress":return te.which!==32?null:(e3=!0,Pb);case"textInput":return $=te.data,$===Pb&&e3?null:$;default:return null}}function Xk($,te){if(qm)return $==="compositionend"||!dS&&t3($,te)?($=Ok(),ed=K2=Gv=null,qm=!1,$):null;switch($){case"paste":return null;case"keypress":if(!(te.ctrlKey||te.altKey||te.metaKey)||te.ctrlKey&&te.altKey){if(te.char&&1=te)return{node:Ae,offset:te-$};$=qe}e:{for(;Ae;){if(Ae.nextSibling){Ae=Ae.nextSibling;break e}Ae=Ae.parentNode}Ae=void 0}Ae=Jk(Ae)}}function eM($,te){return $&&te?$===te?!0:$&&$.nodeType===3?!1:te&&te.nodeType===3?eM($,te.parentNode):"contains"in $?$.contains(te):$.compareDocumentPosition?!!($.compareDocumentPosition(te)&16):!1:!1}function tM($){$=$!=null&&$.ownerDocument!=null&&$.ownerDocument.defaultView!=null?$.ownerDocument.defaultView:window;for(var te=I0($.document);te instanceof $.HTMLIFrameElement;){try{var Ae=typeof te.contentWindow.location.href=="string"}catch{Ae=!1}if(Ae)$=te.contentWindow;else break;te=I0($.document)}return te}function F_($){var te=$&&$.nodeName&&$.nodeName.toLowerCase();return te&&(te==="input"&&($.type==="text"||$.type==="search"||$.type==="tel"||$.type==="url"||$.type==="password")||te==="textarea"||$.contentEditable==="true")}var VD=Hg&&"documentMode"in document&&11>=document.documentMode,B_=null,i3=null,yy=null,_y=!1;function Wg($,te,Ae){var qe=Ae.window===Ae?Ae.document:Ae.nodeType===9?Ae:Ae.ownerDocument;_y||B_==null||B_!==I0(qe)||(qe=B_,"selectionStart"in qe&&F_(qe)?qe={start:qe.selectionStart,end:qe.selectionEnd}:(qe=(qe.ownerDocument&&qe.ownerDocument.defaultView||window).getSelection(),qe={anchorNode:qe.anchorNode,anchorOffset:qe.anchorOffset,focusNode:qe.focusNode,focusOffset:qe.focusOffset}),yy&&Nb(yy,qe)||(yy=qe,qe=ww(i3,"onSelect"),0>=Hr,Tt-=Hr,Eh=1<<32-xm(te)+Tt|Ae<Uu?(pc=ol,ol=null):pc=ol.sibling;var uf=ao(zi,ol,Xi[Uu],Lo);if(uf===null){ol===null&&(ol=pc);break}$&&ol&&uf.alternate===null&&te(zi,ol),pi=qt(uf,pi,Uu),Wc===null?jl=uf:Wc.sibling=uf,Wc=uf,ol=pc}if(Uu===Xi.length)return Ae(zi,ol),fc&&md(zi,Uu),jl;if(ol===null){for(;UuUu?(pc=ol,ol=null):pc=ol.sibling;var qy=ao(zi,ol,uf.value,Lo);if(qy===null){ol===null&&(ol=pc);break}$&&ol&&qy.alternate===null&&te(zi,ol),pi=qt(qy,pi,Uu),Wc===null?jl=qy:Wc.sibling=qy,Wc=qy,ol=pc}if(uf.done)return Ae(zi,ol),fc&&md(zi,Uu),jl;if(ol===null){for(;!uf.done;Uu++,uf=Xi.next())uf=No(zi,uf.value,Lo),uf!==null&&(pi=qt(uf,pi,Uu),Wc===null?jl=uf:Wc.sibling=uf,Wc=uf);return fc&&md(zi,Uu),jl}for(ol=qe(ol);!uf.done;Uu++,uf=Xi.next())uf=po(ol,zi,Uu,uf.value,Lo),uf!==null&&($&&uf.alternate!==null&&ol.delete(uf.key===null?Uu:uf.key),pi=qt(uf,pi,Uu),Wc===null?jl=uf:Wc.sibling=uf,Wc=uf);return $&&ol.forEach(function(yP){return te(zi,yP)}),fc&&md(zi,Uu),jl}function th(zi,pi,Xi,Lo){if(typeof Xi=="object"&&Xi!==null&&Xi.type===zt&&Xi.key===null&&(Xi=Xi.props.children),typeof Xi=="object"&&Xi!==null){switch(Xi.$$typeof){case ft:e:{for(var jl=Xi.key;pi!==null;){if(pi.key===jl){if(jl=Xi.type,jl===zt){if(pi.tag===7){Ae(zi,pi.sibling),Lo=Tt(pi,Xi.props.children),Lo.return=zi,zi=Lo;break e}}else if(pi.elementType===jl||typeof jl=="object"&&jl!==null&&jl.$$typeof===Vn&&P1(jl)===pi.type){Ae(zi,pi.sibling),Lo=Tt(pi,Xi.props),qb(Lo,Xi),Lo.return=zi,zi=Lo;break e}Ae(zi,pi);break}else te(zi,pi);pi=pi.sibling}Xi.type===zt?(Lo=xy(Xi.props.children,zi.mode,Lo,Xi.key),Lo.return=zi,zi=Lo):(Lo=R0(Xi.type,Xi.key,Xi.props,null,zi.mode,Lo),qb(Lo,Xi),Lo.return=zi,zi=Lo)}return Hr(zi);case xt:e:{for(jl=Xi.key;pi!==null;){if(pi.key===jl)if(pi.tag===4&&pi.stateNode.containerInfo===Xi.containerInfo&&pi.stateNode.implementation===Xi.implementation){Ae(zi,pi.sibling),Lo=Tt(pi,Xi.children||[]),Lo.return=zi,zi=Lo;break e}else{Ae(zi,pi);break}else te(zi,pi);pi=pi.sibling}Lo=Em(Xi,zi.mode,Lo),Lo.return=zi,zi=Lo}return Hr(zi);case Vn:return Xi=P1(Xi),th(zi,pi,Xi,Lo)}if(Ia(Xi))return vl(zi,pi,Xi,Lo);if(Ma(Xi)){if(jl=Ma(Xi),typeof jl!="function")throw Error(b(150));return Xi=jl.call(Xi),uu(zi,pi,Xi,Lo)}if(typeof Xi.then=="function")return th(zi,pi,m3(Xi),Lo);if(Xi.$$typeof===Lr)return th(zi,pi,f3(zi,Xi),Lo);af(zi,Xi)}return typeof Xi=="string"&&Xi!==""||typeof Xi=="number"||typeof Xi=="bigint"?(Xi=""+Xi,pi!==null&&pi.tag===6?(Ae(zi,pi.sibling),Lo=Tt(pi,Xi),Lo.return=zi,zi=Lo):(Ae(zi,pi),Lo=AS(Xi,zi.mode,Lo),Lo.return=zi,zi=Lo),Hr(zi)):Ae(zi,pi)}return function(zi,pi,Xi,Lo){try{Gb=0;var jl=th(zi,pi,Xi,Lo);return X_=null,jl}catch(ol){if(ol===Ay||ol===W_)throw ol;var Wc=Zp(29,ol,null,zi.mode);return Wc.lanes=Lo,Wc.return=zi,Wc}}}var Sy=DS(!0),pM=DS(!1),N0=!1;function PS($){$.updateQueue={baseState:$.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zS($,te){$=$.updateQueue,te.updateQueue===$&&(te.updateQueue={baseState:$.baseState,firstBaseUpdate:$.firstBaseUpdate,lastBaseUpdate:$.lastBaseUpdate,shared:$.shared,callbacks:null})}function Ey($){return{lane:$,tag:0,payload:null,callback:null,next:null}}function Cy($,te,Ae){var qe=$.updateQueue;if(qe===null)return null;if(qe=qe.shared,(sf&2)!==0){var Tt=qe.pending;return Tt===null?te.next=te:(te.next=Tt.next,Tt.next=te),qe.pending=te,te=u3($),_g($,null,Ae),te}return l3($,qe,te,Ae),u3($)}function Hb($,te,Ae){if(te=te.updateQueue,te!==null&&(te=te.shared,(Ae&4194048)!==0)){var qe=te.lanes;qe&=$.pendingLanes,Ae|=qe,te.lanes=Ae,nS($,Ae)}}function NS($,te){var Ae=$.updateQueue,qe=$.alternate;if(qe!==null&&(qe=qe.updateQueue,Ae===qe)){var Tt=null,qt=null;if(Ae=Ae.firstBaseUpdate,Ae!==null){do{var Hr={lane:Ae.lane,tag:Ae.tag,payload:Ae.payload,callback:null,next:null};qt===null?Tt=qt=Hr:qt=qt.next=Hr,Ae=Ae.next}while(Ae!==null);qt===null?Tt=qt=te:qt=qt.next=te}else Tt=qt=te;Ae={baseState:qe.baseState,firstBaseUpdate:Tt,lastBaseUpdate:qt,shared:qe.shared,callbacks:qe.callbacks},$.updateQueue=Ae;return}$=Ae.lastBaseUpdate,$===null?Ae.firstBaseUpdate=te:$.next=te,Ae.lastBaseUpdate=te}var OS=!1;function Wb(){if(OS){var $=H_;if($!==null)throw $}}function Xb($,te,Ae,qe){OS=!1;var Tt=$.updateQueue;N0=!1;var qt=Tt.firstBaseUpdate,Hr=Tt.lastBaseUpdate,On=Tt.shared.pending;if(On!==null){Tt.shared.pending=null;var ja=On,Ji=ja.next;ja.next=null,Hr===null?qt=Ji:Hr.next=Ji,Hr=ja;var Io=$.alternate;Io!==null&&(Io=Io.updateQueue,On=Io.lastBaseUpdate,On!==Hr&&(On===null?Io.firstBaseUpdate=Ji:On.next=Ji,Io.lastBaseUpdate=ja))}if(qt!==null){var No=Tt.baseState;Hr=0,Io=Ji=ja=null,On=qt;do{var ao=On.lane&-536870913,po=ao!==On.lane;if(po?(Ic&ao)===ao:(qe&ao)===ao){ao!==0&&ao===D1&&(OS=!0),Io!==null&&(Io=Io.next={lane:0,tag:On.tag,payload:On.payload,callback:null,next:null});e:{var vl=$,uu=On;ao=te;var th=Ae;switch(uu.tag){case 1:if(vl=uu.payload,typeof vl=="function"){No=vl.call(th,No,ao);break e}No=vl;break e;case 3:vl.flags=vl.flags&-65537|128;case 0:if(vl=uu.payload,ao=typeof vl=="function"?vl.call(th,No,ao):vl,ao==null)break e;No=je({},No,ao);break e;case 2:N0=!0}}ao=On.callback,ao!==null&&($.flags|=64,po&&($.flags|=8192),po=Tt.callbacks,po===null?Tt.callbacks=[ao]:po.push(ao))}else po={lane:ao,tag:On.tag,payload:On.payload,callback:On.callback,next:null},Io===null?(Ji=Io=po,ja=No):Io=Io.next=po,Hr|=ao;if(On=On.next,On===null){if(On=Tt.shared.pending,On===null)break;po=On,On=po.next,po.next=null,Tt.lastBaseUpdate=po,Tt.shared.pending=null}}while(!0);Io===null&&(ja=No),Tt.baseState=ja,Tt.firstBaseUpdate=Ji,Tt.lastBaseUpdate=Io,qt===null&&(Tt.shared.lanes=0),G0|=Hr,$.lanes=Hr,$.memoizedState=No}}function vM($,te){if(typeof $!="function")throw Error(b(191,$));$.call(te)}function FS($,te){var Ae=$.callbacks;if(Ae!==null)for($.callbacks=null,$=0;$qt?qt:8;var Hr=aa.T,On={};aa.T=On,nw($,!1,te,Ae);try{var ja=Tt(),Ji=aa.S;if(Ji!==null&&Ji(On,ja),ja!==null&&typeof ja=="object"&&typeof ja.then=="function"){var Io=XD(ja,qe);ex($,te,Io,pv($))}else ex($,te,qe,pv($))}catch(No){ex($,te,{then:function(){},status:"rejected",reason:No},pv())}finally{Ka.p=qt,Hr!==null&&On.types!==null&&(Hr.types=On.types),aa.T=Hr}}function U3(){}function $3($,te,Ae,qe){if($.tag!==5)throw Error(b(476));var Tt=rw($).queue;YS($,Tt,te,ai,Ae===null?U3:function(){return ZS($),Ae(qe)})}function rw($){var te=$.memoizedState;if(te!==null)return te;te={memoizedState:ai,baseState:ai,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kg,lastRenderedState:ai},next:null};var Ae={};return te.next={memoizedState:Ae,baseState:Ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kg,lastRenderedState:Ae},next:null},$.memoizedState=te,$=$.alternate,$!==null&&($.memoizedState=te),te}function ZS($){var te=rw($);te.next===null&&(te=$.alternate.memoizedState),ex($,te.next.queue,{},pv())}function V3(){return Pp(Tx)}function EM(){return nd().memoizedState}function KS(){return nd().memoizedState}function CM($){for(var te=$.return;te!==null;){switch(te.tag){case 24:case 3:var Ae=pv();$=Ey(Ae);var qe=Cy(te,$,Ae);qe!==null&&(Jv(qe,te,Ae),Hb(qe,te,Ae)),te={cache:IS()},$.payload=te;return}te=te.return}}function kM($,te,Ae){var qe=pv();Ae={lane:qe,revertLane:0,gesture:null,action:Ae,hasEagerState:!1,eagerState:null,next:null},tx($)?JS(te,Ae):(Ae=TS($,te,Ae,qe),Ae!==null&&(Jv(Ae,$,qe),MM(Ae,te,qe)))}function j3($,te,Ae){var qe=pv();ex($,te,Ae,qe)}function ex($,te,Ae,qe){var Tt={lane:qe,revertLane:0,gesture:null,action:Ae,hasEagerState:!1,eagerState:null,next:null};if(tx($))JS(te,Tt);else{var qt=$.alternate;if($.lanes===0&&(qt===null||qt.lanes===0)&&(qt=te.lastRenderedReducer,qt!==null))try{var Hr=te.lastRenderedState,On=qt(Hr,Ae);if(Tt.hasEagerState=!0,Tt.eagerState=On,wm(On,Hr))return l3($,te,Tt,0),dh===null&&Fb(),!1}catch{}if(Ae=TS($,te,Tt,qe),Ae!==null)return Jv(Ae,$,qe),MM(Ae,te,qe),!0}return!1}function nw($,te,Ae,qe){if(qe={lane:2,revertLane:px(),gesture:null,action:qe,hasEagerState:!1,eagerState:null,next:null},tx($)){if(te)throw Error(b(479))}else te=TS($,Ae,qe,2),te!==null&&Jv(te,$,2)}function tx($){var te=$.alternate;return $===Cu||te!==null&&te===Cu}function JS($,te){K_=My=!0;var Ae=$.pending;Ae===null?te.next=te:(te.next=Ae.next,Ae.next=te),$.pending=te}function MM($,te,Ae){if((Ae&4194048)!==0){var qe=te.lanes;qe&=$.pendingLanes,Ae|=qe,te.lanes=Ae,nS($,Ae)}}var aw={readContext:Pp,use:x3,useCallback:rd,useContext:rd,useEffect:rd,useImperativeHandle:rd,useLayoutEffect:rd,useInsertionEffect:rd,useMemo:rd,useReducer:rd,useRef:rd,useState:rd,useDebugValue:rd,useDeferredValue:rd,useTransition:rd,useSyncExternalStore:rd,useId:rd,useHostTransitionStatus:rd,useFormState:rd,useActionState:rd,useOptimistic:rd,useMemoCache:rd,useCacheRefresh:rd};aw.useEffectEvent=rd;var QS={readContext:Pp,use:x3,useCallback:function($,te){return pp().memoizedState=[$,te===void 0?null:te],$},useContext:Pp,useEffect:z3,useImperativeHandle:function($,te,Ae){Ae=Ae!=null?Ae.concat([$]):null,D3(4194308,4,O3.bind(null,te,$),Ae)},useLayoutEffect:function($,te){return D3(4194308,4,$,te)},useInsertionEffect:function($,te){D3(4,2,$,te)},useMemo:function($,te){var Ae=pp();te=te===void 0?null:te;var qe=$();if(N1){qg(!0);try{$()}finally{qg(!1)}}return Ae.memoizedState=[qe,te],qe},useReducer:function($,te,Ae){var qe=pp();if(Ae!==void 0){var Tt=Ae(te);if(N1){qg(!0);try{Ae(te)}finally{qg(!1)}}}else Tt=te;return qe.memoizedState=qe.baseState=Tt,$={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$,lastRenderedState:Tt},qe.queue=$,$=$.dispatch=kM.bind(null,Cu,$),[qe.memoizedState,$]},useRef:function($){var te=pp();return $={current:$},te.memoizedState=$},useState:function($){$=Jb($);var te=$.queue,Ae=j3.bind(null,Cu,te);return te.dispatch=Ae,[$.memoizedState,Ae]},useDebugValue:F3,useDeferredValue:function($,te){var Ae=pp();return tw(Ae,$,te)},useTransition:function(){var $=Jb(!1);return $=YS.bind(null,Cu,$.queue,!0,!1),pp().memoizedState=$,[!1,$]},useSyncExternalStore:function($,te,Ae){var qe=Cu,Tt=pp();if(fc){if(Ae===void 0)throw Error(b(407));Ae=Ae()}else{if(Ae=te(),dh===null)throw Error(b(349));(Ic&127)!==0||A3(qe,te,Ae)}Tt.memoizedState=Ae;var qt={value:Ae,getSnapshot:te};return Tt.queue=qt,z3(E3.bind(null,qe,qt,$),[$]),qe.flags|=2048,Q_(9,{destroy:void 0},S3.bind(null,qe,qt,Ae,te),null),Ae},useId:function(){var $=pp(),te=dh.identifierPrefix;if(fc){var Ae=Wm,qe=Eh;Ae=(qe&~(1<<32-xm(qe)-1)).toString(32)+Ae,te="_"+te+"R_"+Ae,Ae=O1++,0<\/script>",qt=qt.removeChild(qt.firstChild);break;case"select":qt=typeof qe.is=="string"?Hr.createElement("select",{is:qe.is}):Hr.createElement("select"),qe.multiple?qt.multiple=!0:qe.size&&(qt.size=qe.size);break;default:qt=typeof qe.is=="string"?Hr.createElement(Tt,{is:qe.is}):Hr.createElement(Tt)}}qt[Wl]=te,qt[cv]=qe;e:for(Hr=te.child;Hr!==null;){if(Hr.tag===5||Hr.tag===6)qt.appendChild(Hr.stateNode);else if(Hr.tag!==4&&Hr.tag!==27&&Hr.child!==null){Hr.child.return=Hr,Hr=Hr.child;continue}if(Hr===te)break e;for(;Hr.sibling===null;){if(Hr.return===null||Hr.return===te)break e;Hr=Hr.return}Hr.sibling.return=Hr.return,Hr=Hr.sibling}te.stateNode=qt;e:switch(Kd(qt,Tt,qe),Tt){case"button":case"input":case"select":case"textarea":qe=!!qe.autoFocus;break e;case"img":qe=!0;break e;default:qe=!1}qe&&Jg(te)}}return Ph(te),p5(te,te.type,$===null?null:$.memoizedProps,te.pendingProps,Ae),null;case 6:if($&&te.stateNode!=null)$.memoizedProps!==qe&&Jg(te);else{if(typeof qe!="string"&&te.stateNode===null)throw Error(b(166));if($=Li.current,G_(te)){if($=te.stateNode,Ae=te.memoizedProps,qe=null,Tt=Dp,Tt!==null)switch(Tt.tag){case 27:case 5:qe=Tt.memoizedProps}$[Wl]=te,$=!!($.nodeValue===Ae||qe!==null&&qe.suppressHydrationWarning===!0||cT($.nodeValue,Ae)),$||by(te,!0)}else $=Qv($).createTextNode(qe),$[Wl]=te,te.stateNode=$}return Ph(te),null;case 31:if(Ae=te.memoizedState,$===null||$.memoizedState!==null){if(qe=G_(te),Ae!==null){if($===null){if(!qe)throw Error(b(318));if($=te.memoizedState,$=$!==null?$.dehydrated:null,!$)throw Error(b(557));$[Wl]=te}else P0(),(te.flags&128)===0&&(te.memoizedState=null),te.flags|=4;Ph(te),$=!1}else Ae=ES(),$!==null&&$.memoizedState!==null&&($.memoizedState.hydrationErrors=Ae),$=!0;if(!$)return te.flags&256?(Mm(te),te):(Mm(te),null);if((te.flags&128)!==0)throw Error(b(558))}return Ph(te),null;case 13:if(qe=te.memoizedState,$===null||$.memoizedState!==null&&$.memoizedState.dehydrated!==null){if(Tt=G_(te),qe!==null&&qe.dehydrated!==null){if($===null){if(!Tt)throw Error(b(318));if(Tt=te.memoizedState,Tt=Tt!==null?Tt.dehydrated:null,!Tt)throw Error(b(317));Tt[Wl]=te}else P0(),(te.flags&128)===0&&(te.memoizedState=null),te.flags|=4;Ph(te),Tt=!1}else Tt=ES(),$!==null&&$.memoizedState!==null&&($.memoizedState.hydrationErrors=Tt),Tt=!0;if(!Tt)return te.flags&256?(Mm(te),te):(Mm(te),null)}return Mm(te),(te.flags&128)!==0?(te.lanes=Ae,te):(Ae=qe!==null,$=$!==null&&$.memoizedState!==null,Ae&&(qe=te.child,Tt=null,qe.alternate!==null&&qe.alternate.memoizedState!==null&&qe.alternate.memoizedState.cachePool!==null&&(Tt=qe.alternate.memoizedState.cachePool.pool),qt=null,qe.memoizedState!==null&&qe.memoizedState.cachePool!==null&&(qt=qe.memoizedState.cachePool.pool),qt!==Tt&&(qe.flags|=2048)),Ae!==$&&Ae&&(te.child.flags|=8192),K3(te,te.updateQueue),Ph(te),null);case 4:return Ps(),$===null&&yx(te.stateNode.containerInfo),Ph(te),null;case 10:return Tg(te.type),Ph(te),null;case 19:if(qa(Nc),qe=te.memoizedState,qe===null)return Ph(te),null;if(Tt=(te.flags&128)!==0,qt=qe.rendering,qt===null)if(Tt)ow(qe,!1);else{if(yd!==0||$!==null&&($.flags&128)!==0)for($=te.child;$!==null;){if(qt=Z_($),qt!==null){for(te.flags|=128,ow(qe,!1),$=qt.updateQueue,te.updateQueue=$,K3(te,$),te.subtreeFlags=0,$=Ae,Ae=te.child;Ae!==null;)iM(Ae,$),Ae=Ae.sibling;return ki(Nc,Nc.current&1|2),fc&&md(te,qe.treeForkCount),te.child}$=$.sibling}qe.tail!==null&&Rh()>eT&&(te.flags|=128,Tt=!0,ow(qe,!1),te.lanes=4194304)}else{if(!Tt)if($=Z_(qt),$!==null){if(te.flags|=128,Tt=!0,$=$.updateQueue,te.updateQueue=$,K3(te,$),ow(qe,!0),qe.tail===null&&qe.tailMode==="hidden"&&!qt.alternate&&!fc)return Ph(te),null}else 2*Rh()-qe.renderingStartTime>eT&&Ae!==536870912&&(te.flags|=128,Tt=!0,ow(qe,!1),te.lanes=4194304);qe.isBackwards?(qt.sibling=te.child,te.child=qt):($=qe.last,$!==null?$.sibling=qt:te.child=qt,qe.last=qt)}return qe.tail!==null?($=qe.tail,qe.rendering=$,qe.tail=$.sibling,qe.renderingStartTime=Rh(),$.sibling=null,Ae=Nc.current,ki(Nc,Tt?Ae&1|2:Ae&1),fc&&md(te,qe.treeForkCount),$):(Ph(te),null);case 22:case 23:return Mm(te),ky(),qe=te.memoizedState!==null,$!==null?$.memoizedState!==null!==qe&&(te.flags|=8192):qe&&(te.flags|=8192),qe?(Ae&536870912)!==0&&(te.flags&128)===0&&(Ph(te),te.subtreeFlags&6&&(te.flags|=8192)):Ph(te),Ae=te.updateQueue,Ae!==null&&K3(te,Ae.retryQueue),Ae=null,$!==null&&$.memoizedState!==null&&$.memoizedState.cachePool!==null&&(Ae=$.memoizedState.cachePool.pool),qe=null,te.memoizedState!==null&&te.memoizedState.cachePool!==null&&(qe=te.memoizedState.cachePool.pool),qe!==Ae&&(te.flags|=2048),$!==null&&qa(Ty),null;case 24:return Ae=null,$!==null&&(Ae=$.memoizedState.cache),te.memoizedState.cache!==Ae&&(te.flags|=2048),Tg(Wd),Ph(te),null;case 25:return null;case 30:return null}throw Error(b(156,te.tag))}function tP($,te){switch(M1(te),te.tag){case 1:return $=te.flags,$&65536?(te.flags=$&-65537|128,te):null;case 3:return Tg(Wd),Ps(),$=te.flags,($&65536)!==0&&($&128)===0?(te.flags=$&-65537|128,te):null;case 26:case 27:case 5:return As(te),null;case 31:if(te.memoizedState!==null){if(Mm(te),te.alternate===null)throw Error(b(340));P0()}return $=te.flags,$&65536?(te.flags=$&-65537|128,te):null;case 13:if(Mm(te),$=te.memoizedState,$!==null&&$.dehydrated!==null){if(te.alternate===null)throw Error(b(340));P0()}return $=te.flags,$&65536?(te.flags=$&-65537|128,te):null;case 19:return qa(Nc),null;case 4:return Ps(),null;case 10:return Tg(te.type),null;case 22:case 23:return Mm(te),ky(),$!==null&&qa(Ty),$=te.flags,$&65536?(te.flags=$&-65537|128,te):null;case 24:return Tg(Wd),null;case 25:return null;default:return null}}function XM($,te){switch(M1(te),te.tag){case 3:Tg(Wd),Ps();break;case 26:case 27:case 5:As(te);break;case 4:Ps();break;case 31:te.memoizedState!==null&&Mm(te);break;case 13:Mm(te);break;case 19:qa(Nc);break;case 10:Tg(te.type);break;case 22:case 23:Mm(te),ky(),$!==null&&qa(Ty);break;case 24:Tg(Wd)}}function sw($,te){try{var Ae=te.updateQueue,qe=Ae!==null?Ae.lastEffect:null;if(qe!==null){var Tt=qe.next;Ae=Tt;do{if((Ae.tag&$)===$){qe=void 0;var qt=Ae.create,Hr=Ae.inst;qe=qt(),Hr.destroy=qe}Ae=Ae.next}while(Ae!==Tt)}}catch(On){Vf(te,te.return,On)}}function Xm($,te,Ae){try{var qe=te.updateQueue,Tt=qe!==null?qe.lastEffect:null;if(Tt!==null){var qt=Tt.next;qe=qt;do{if((qe.tag&$)===$){var Hr=qe.inst,On=Hr.destroy;if(On!==void 0){Hr.destroy=void 0,Tt=te;var ja=Ae,Ji=On;try{Ji()}catch(Io){Vf(Tt,ja,Io)}}}qe=qe.next}while(qe!==qt)}}catch(Io){Vf(te,te.return,Io)}}function v5($){var te=$.updateQueue;if(te!==null){var Ae=$.stateNode;try{FS(te,Ae)}catch(qe){Vf($,$.return,qe)}}}function YM($,te,Ae){Ae.props=B1($.type,$.memoizedProps),Ae.state=$.memoizedState;try{Ae.componentWillUnmount()}catch(qe){Vf($,te,qe)}}function Ym($,te){try{var Ae=$.ref;if(Ae!==null){switch($.tag){case 26:case 27:case 5:var qe=$.stateNode;break;case 30:qe=$.stateNode;break;default:qe=$.stateNode}typeof Ae=="function"?$.refCleanup=Ae(qe):Ae.current=qe}}catch(Tt){Vf($,te,Tt)}}function Sg($,te){var Ae=$.ref,qe=$.refCleanup;if(Ae!==null)if(typeof qe=="function")try{qe()}catch(Tt){Vf($,te,Tt)}finally{$.refCleanup=null,$=$.alternate,$!=null&&($.refCleanup=null)}else if(typeof Ae=="function")try{Ae(null)}catch(Tt){Vf($,te,Tt)}else Ae.current=null}function ZM($){var te=$.type,Ae=$.memoizedProps,qe=$.stateNode;try{e:switch(te){case"button":case"input":case"select":case"textarea":Ae.autoFocus&&qe.focus();break e;case"img":Ae.src?qe.src=Ae.src:Ae.srcSet&&(qe.srcset=Ae.srcSet)}}catch(Tt){Vf($,$.return,Tt)}}function m5($,te,Ae){try{var qe=$.stateNode;P5(qe,$.type,Ae,te),qe[cv]=te}catch(Tt){Vf($,$.return,Tt)}}function U1($){return $.tag===5||$.tag===3||$.tag===26||$.tag===27&&a0($.type)||$.tag===4}function lw($){e:for(;;){for(;$.sibling===null;){if($.return===null||U1($.return))return null;$=$.return}for($.sibling.return=$.return,$=$.sibling;$.tag!==5&&$.tag!==6&&$.tag!==18;){if($.tag===27&&a0($.type)||$.flags&2||$.child===null||$.tag===4)continue e;$.child.return=$,$=$.child}if(!($.flags&2))return $.stateNode}}function nx($,te,Ae){var qe=$.tag;if(qe===5||qe===6)$=$.stateNode,te?(Ae.nodeType===9?Ae.body:Ae.nodeName==="HTML"?Ae.ownerDocument.body:Ae).insertBefore($,te):(te=Ae.nodeType===9?Ae.body:Ae.nodeName==="HTML"?Ae.ownerDocument.body:Ae,te.appendChild($),Ae=Ae._reactRootContainer,Ae!=null||te.onclick!==null||(te.onclick=$c));else if(qe!==4&&(qe===27&&a0($.type)&&(Ae=$.stateNode,te=null),$=$.child,$!==null))for(nx($,te,Ae),$=$.sibling;$!==null;)nx($,te,Ae),$=$.sibling}function uw($,te,Ae){var qe=$.tag;if(qe===5||qe===6)$=$.stateNode,te?Ae.insertBefore($,te):Ae.appendChild($);else if(qe!==4&&(qe===27&&a0($.type)&&(Ae=$.stateNode),$=$.child,$!==null))for(uw($,te,Ae),$=$.sibling;$!==null;)uw($,te,Ae),$=$.sibling}function KM($){var te=$.stateNode,Ae=$.memoizedProps;try{for(var qe=$.type,Tt=te.attributes;Tt.length;)te.removeAttributeNode(Tt[0]);Kd(te,qe,Ae),te[Wl]=$,te[cv]=Ae}catch(qt){Vf($,$.return,qt)}}var U0=!1,Yd=!1,g5=!1,y5=typeof WeakSet=="function"?WeakSet:Set,gd=null;function rP($,te){if($=$.containerInfo,W0=zw,$=tM($),F_($)){if("selectionStart"in $)var Ae={start:$.selectionStart,end:$.selectionEnd};else e:{Ae=(Ae=$.ownerDocument)&&Ae.defaultView||window;var qe=Ae.getSelection&&Ae.getSelection();if(qe&&qe.rangeCount!==0){Ae=qe.anchorNode;var Tt=qe.anchorOffset,qt=qe.focusNode;qe=qe.focusOffset;try{Ae.nodeType,qt.nodeType}catch{Ae=null;break e}var Hr=0,On=-1,ja=-1,Ji=0,Io=0,No=$,ao=null;t:for(;;){for(var po;No!==Ae||Tt!==0&&No.nodeType!==3||(On=Hr+Tt),No!==qt||qe!==0&&No.nodeType!==3||(ja=Hr+qe),No.nodeType===3&&(Hr+=No.nodeValue.length),(po=No.firstChild)!==null;)ao=No,No=po;for(;;){if(No===$)break t;if(ao===Ae&&++Ji===Tt&&(On=Hr),ao===qt&&++Io===qe&&(ja=Hr),(po=No.nextSibling)!==null)break;No=ao,ao=No.parentNode}No=po}Ae=On===-1||ja===-1?null:{start:On,end:ja}}else Ae=null}Ae=Ae||{start:0,end:0}}else Ae=null;for(Uy={focusedElem:$,selectionRange:Ae},zw=!1,gd=te;gd!==null;)if(te=gd,$=te.child,(te.subtreeFlags&1028)!==0&&$!==null)$.return=te,gd=$;else for(;gd!==null;){switch(te=gd,qt=te.alternate,$=te.flags,te.tag){case 0:if(($&4)!==0&&($=te.updateQueue,$=$!==null?$.events:null,$!==null))for(Ae=0;Ae<$.length;Ae++)Tt=$[Ae],Tt.ref.impl=Tt.nextImpl;break;case 11:case 15:break;case 1:if(($&1024)!==0&&qt!==null){$=void 0,Ae=te,Tt=qt.memoizedProps,qt=qt.memoizedState,qe=Ae.stateNode;try{var vl=B1(Ae.type,Tt);$=qe.getSnapshotBeforeUpdate(vl,qt),qe.__reactInternalSnapshotBeforeUpdate=$}catch(uu){Vf(Ae,Ae.return,uu)}}break;case 3:if(($&1024)!==0){if($=te.stateNode.containerInfo,Ae=$.nodeType,Ae===9)Tw($);else if(Ae===1)switch($.nodeName){case"HEAD":case"HTML":case"BODY":Tw($);break;default:$.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(($&1024)!==0)throw Error(b(163))}if($=te.sibling,$!==null){$.return=te.return,gd=$;break}gd=te.return}}function JM($,te,Ae){var qe=Ae.flags;switch(Ae.tag){case 0:case 11:case 15:Im($,Ae),qe&4&&sw(5,Ae);break;case 1:if(Im($,Ae),qe&4)if($=Ae.stateNode,te===null)try{$.componentDidMount()}catch(Hr){Vf(Ae,Ae.return,Hr)}else{var Tt=B1(Ae.type,te.memoizedProps);te=te.memoizedState;try{$.componentDidUpdate(Tt,te,$.__reactInternalSnapshotBeforeUpdate)}catch(Hr){Vf(Ae,Ae.return,Hr)}}qe&64&&v5(Ae),qe&512&&Ym(Ae,Ae.return);break;case 3:if(Im($,Ae),qe&64&&($=Ae.updateQueue,$!==null)){if(te=null,Ae.child!==null)switch(Ae.child.tag){case 27:case 5:te=Ae.child.stateNode;break;case 1:te=Ae.child.stateNode}try{FS($,te)}catch(Hr){Vf(Ae,Ae.return,Hr)}}break;case 27:te===null&&qe&4&&KM(Ae);case 26:case 5:Im($,Ae),te===null&&qe&4&&ZM(Ae),qe&512&&Ym(Ae,Ae.return);break;case 12:Im($,Ae);break;case 31:Im($,Ae),qe&4&&tI($,Ae);break;case 13:Im($,Ae),qe&4&&rI($,Ae),qe&64&&($=Ae.memoizedState,$!==null&&($=$.dehydrated,$!==null&&(Ae=fx.bind(null,Ae),dP($,Ae))));break;case 22:if(qe=Ae.memoizedState!==null||U0,!qe){te=te!==null&&te.memoizedState!==null||Yd,Tt=U0;var qt=Yd;U0=qe,(Yd=te)&&!qt?Qg($,Ae,(Ae.subtreeFlags&8772)!==0):Im($,Ae),U0=Tt,Yd=qt}break;case 30:break;default:Im($,Ae)}}function QM($){var te=$.alternate;te!==null&&($.alternate=null,QM(te)),$.child=null,$.deletions=null,$.sibling=null,$.tag===5&&(te=$.stateNode,te!==null&&oS(te)),$.stateNode=null,$.return=null,$.dependencies=null,$.memoizedProps=null,$.memoizedState=null,$.pendingProps=null,$.stateNode=null,$.updateQueue=null}var Hh=null,Xv=!1;function $0($,te,Ae){for(Ae=Ae.child;Ae!==null;)eI($,te,Ae),Ae=Ae.sibling}function eI($,te,Ae){if(Mv&&typeof Mv.onCommitFiberUnmount=="function")try{Mv.onCommitFiberUnmount(Gg,Ae)}catch{}switch(Ae.tag){case 26:Yd||Sg(Ae,te),$0($,te,Ae),Ae.memoizedState?Ae.memoizedState.count--:Ae.stateNode&&(Ae=Ae.stateNode,Ae.parentNode.removeChild(Ae));break;case 27:Yd||Sg(Ae,te);var qe=Hh,Tt=Xv;a0(Ae.type)&&(Hh=Ae.stateNode,Xv=!1),$0($,te,Ae),W1(Ae.stateNode),Hh=qe,Xv=Tt;break;case 5:Yd||Sg(Ae,te);case 6:if(qe=Hh,Tt=Xv,Hh=null,$0($,te,Ae),Hh=qe,Xv=Tt,Hh!==null)if(Xv)try{(Hh.nodeType===9?Hh.body:Hh.nodeName==="HTML"?Hh.ownerDocument.body:Hh).removeChild(Ae.stateNode)}catch(qt){Vf(Ae,te,qt)}else try{Hh.removeChild(Ae.stateNode)}catch(qt){Vf(Ae,te,qt)}break;case 18:Hh!==null&&(Xv?($=Hh,U5($.nodeType===9?$.body:$.nodeName==="HTML"?$.ownerDocument.body:$,Ae.stateNode),t_($)):U5(Hh,Ae.stateNode));break;case 4:qe=Hh,Tt=Xv,Hh=Ae.stateNode.containerInfo,Xv=!0,$0($,te,Ae),Hh=qe,Xv=Tt;break;case 0:case 11:case 14:case 15:Xm(2,Ae,te),Yd||Xm(4,Ae,te),$0($,te,Ae);break;case 1:Yd||(Sg(Ae,te),qe=Ae.stateNode,typeof qe.componentWillUnmount=="function"&&YM(Ae,te,qe)),$0($,te,Ae);break;case 21:$0($,te,Ae);break;case 22:Yd=(qe=Yd)||Ae.memoizedState!==null,$0($,te,Ae),Yd=qe;break;default:$0($,te,Ae)}}function tI($,te){if(te.memoizedState===null&&($=te.alternate,$!==null&&($=$.memoizedState,$!==null))){$=$.dehydrated;try{t_($)}catch(Ae){Vf(te,te.return,Ae)}}}function rI($,te){if(te.memoizedState===null&&($=te.alternate,$!==null&&($=$.memoizedState,$!==null&&($=$.dehydrated,$!==null))))try{t_($)}catch(Ae){Vf(te,te.return,Ae)}}function nP($){switch($.tag){case 31:case 13:case 19:var te=$.stateNode;return te===null&&(te=$.stateNode=new y5),te;case 22:return $=$.stateNode,te=$._retryCache,te===null&&(te=$._retryCache=new y5),te;default:throw Error(b(435,$.tag))}}function V0($,te){var Ae=nP($);te.forEach(function(qe){if(!Ae.has(qe)){Ae.add(qe);var Tt=hx.bind(null,$,qe);qe.then(Tt,Tt)}})}function Kp($,te){var Ae=te.deletions;if(Ae!==null)for(var qe=0;qe title"))),Kd(qt,qe,Ae),qt[Wl]=$,Ip(qt),qe=qt;break e;case"link":var Hr=DI("link","href",Tt).get(qe+(Ae.href||""));if(Hr){for(var On=0;Onth&&(Hr=th,th=uu,uu=Hr);var zi=Qk(On,uu),pi=Qk(On,th);if(zi&&pi&&(po.rangeCount!==1||po.anchorNode!==zi.node||po.anchorOffset!==zi.offset||po.focusNode!==pi.node||po.focusOffset!==pi.offset)){var Xi=No.createRange();Xi.setStart(zi.node,zi.offset),po.removeAllRanges(),uu>th?(po.addRange(Xi),po.extend(pi.node,pi.offset)):(Xi.setEnd(pi.node,pi.offset),po.addRange(Xi))}}}}for(No=[],po=On;po=po.parentNode;)po.nodeType===1&&No.push({element:po,left:po.scrollLeft,top:po.scrollTop});for(typeof On.focus=="function"&&On.focus(),On=0;OnAe?32:Ae,aa.T=null,Ae=A5,A5=null;var qt=Ny,Hr=q0;if(Zd=0,j1=Ny=null,q0=0,(sf&6)!==0)throw Error(b(331));var On=sf;if(sf|=4,ox(qt.current),aI(qt,qt.current,Hr,Ae),sf=On,vw(0,!1),Mv&&typeof Mv.onPostCommitFiberRoot=="function")try{Mv.onPostCommitFiberRoot(Gg,qt)}catch{}return!0}finally{Ka.p=Tt,aa.T=qe,bI($,te)}}function TI($,te,Ae){te=vd(Ae,te),te=F0($.stateNode,te,2),$=Cy($,te,2),$!==null&&(Cb($,2),r0($))}function Vf($,te,Ae){if($.tag===3)TI($,$,Ae);else for(;te!==null;){if(te.tag===3){TI(te,$,Ae);break}else if(te.tag===1){var qe=te.stateNode;if(typeof te.type.getDerivedStateFromError=="function"||typeof qe.componentDidCatch=="function"&&(Km===null||!Km.has(qe))){$=vd(Ae,$),Ae=NM(2),qe=Cy(te,Ae,2),qe!==null&&(OM(Ae,qe,te,$),Cb(qe,2),r0(qe));break}}te=te.return}}function C5($,te,Ae){var qe=$.pingCache;if(qe===null){qe=$.pingCache=new sI;var Tt=new Set;qe.set(te,Tt)}else Tt=qe.get(te),Tt===void 0&&(Tt=new Set,qe.set(te,Tt));Tt.has(Ae)||(Py=!0,Tt.add(Ae),$=uP.bind(null,$,te,Ae),te.then($,$))}function uP($,te,Ae){var qe=$.pingCache;qe!==null&&qe.delete(te),$.pingedLanes|=$.suspendedLanes&Ae,$.warmLanes&=~Ae,dh===$&&(Ic&Ae)===Ae&&(yd===4||yd===3&&(Ic&62914560)===Ic&&300>Rh()-hw?(sf&2)===0&&ux($,0):T5|=Ae,zy===Ic&&(zy=0)),r0($)}function AI($,te){te===0&&(te=Mk()),$=yg($,te),$!==null&&(Cb($,te),r0($))}function fx($){var te=$.memoizedState,Ae=0;te!==null&&(Ae=te.retryLane),AI($,Ae)}function hx($,te){var Ae=0;switch($.tag){case 31:case 13:var qe=$.stateNode,Tt=$.memoizedState;Tt!==null&&(Ae=Tt.retryLane);break;case 19:qe=$.stateNode;break;case 22:qe=$.stateNode._retryCache;break;default:throw Error(b(314))}qe!==null&&qe.delete(te),AI($,Ae)}function k5($,te){return eh($,te)}var sT=null,t0=null,M5=!1,dx=!1,I5=!1,Fy=0;function r0($){$!==t0&&$.next===null&&(t0===null?sT=t0=$:t0=t0.next=$),dx=!0,M5||(M5=!0,fP())}function vw($,te){if(!I5&&dx){I5=!0;do for(var Ae=!1,qe=sT;qe!==null;){if($!==0){var Tt=qe.pendingLanes;if(Tt===0)var qt=0;else{var Hr=qe.suspendedLanes,On=qe.pingedLanes;qt=(1<<31-xm(42|$)+1)-1,qt&=Tt&~(Hr&~On),qt=qt&201326741?qt&201326741|1:qt?qt|2:0}qt!==0&&(Ae=!0,SI(qe,qt))}else qt=Ic,qt=q2(qe,qe===dh?qt:0,qe.cancelPendingCommit!==null||qe.timeoutHandle!==-1),(qt&3)===0||Eb(qe,qt)||(Ae=!0,SI(qe,qt));qe=qe.next}while(Ae);I5=!1}}function cP(){L5()}function L5(){dx=M5=!1;var $=0;Fy!==0&&MI()&&($=Fy);for(var te=Rh(),Ae=null,qe=sT;qe!==null;){var Tt=qe.next,qt=mw(qe,te);qt===0?(qe.next=null,Ae===null?sT=Tt:Ae.next=Tt,Tt===null&&(t0=Ae)):(Ae=qe,($!==0||(qt&3)!==0)&&(dx=!0)),qe=Tt}Zd!==0&&Zd!==5||vw($),Fy!==0&&(Fy=0)}function mw($,te){for(var Ae=$.suspendedLanes,qe=$.pingedLanes,Tt=$.expirationTimes,qt=$.pendingLanes&-62914561;0On)break;var Io=ja.transferSize,No=ja.initiatorType;Io&&H0(No)&&(ja=ja.responseEnd,Hr+=Io*(ja"u"?null:document;function yT($,te,Ae){var qe=xx;if(qe&&typeof te=="string"&&te){var Tt=Gm(te);Tt='link[rel="'+$+'"][href="'+Tt+'"]',typeof Ae=="string"&&(Tt+='[crossorigin="'+Ae+'"]'),gT.has(Tt)||(gT.add(Tt),$={rel:$,crossOrigin:Ae,href:te},qe.querySelector(Tt)===null&&(te=qe.createElement("link"),Kd(te,"link",$),Ip(te),qe.head.appendChild(te)))}}function X1($){Mg.D($),yT("dns-prefetch",$,null)}function G5($,te){Mg.C($,te),yT("preconnect",$,te)}function _T($,te,Ae){Mg.L($,te,Ae);var qe=xx;if(qe&&$&&te){var Tt='link[rel="preload"][as="'+Gm(te)+'"]';te==="image"&&Ae&&Ae.imageSrcSet?(Tt+='[imagesrcset="'+Gm(Ae.imageSrcSet)+'"]',typeof Ae.imageSizes=="string"&&(Tt+='[imagesizes="'+Gm(Ae.imageSizes)+'"]')):Tt+='[href="'+Gm($)+'"]';var qt=Tt;switch(te){case"style":qt=$y($);break;case"script":qt=Z1($)}tm.has(qt)||($=je({rel:"preload",href:te==="image"&&Ae&&Ae.imageSrcSet?void 0:$,as:te},Ae),tm.set(qt,$),qe.querySelector(Tt)!==null||te==="style"&&qe.querySelector(Cw(qt))||te==="script"&&qe.querySelector(K1(qt))||(te=qe.createElement("link"),Kd(te,"link",$),Ip(te),qe.head.appendChild(te)))}}function xT($,te){Mg.m($,te);var Ae=xx;if(Ae&&$){var qe=te&&typeof te.as=="string"?te.as:"script",Tt='link[rel="modulepreload"][as="'+Gm(qe)+'"][href="'+Gm($)+'"]',qt=Tt;switch(qe){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":qt=Z1($)}if(!tm.has(qt)&&($=je({rel:"modulepreload",href:$},te),tm.set(qt,$),Ae.querySelector(Tt)===null)){switch(qe){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(Ae.querySelector(K1(qt)))return}qe=Ae.createElement("link"),Kd(qe,"link",$),Ip(qe),Ae.head.appendChild(qe)}}}function Ew($,te,Ae){Mg.S($,te,Ae);var qe=xx;if(qe&&$){var Tt=z_(qe).hoistableStyles,qt=$y($);te=te||"default";var Hr=Tt.get(qt);if(!Hr){var On={loading:0,preload:null};if(Hr=qe.querySelector(Cw(qt)))On.loading=5;else{$=je({rel:"stylesheet",href:$,"data-precedence":te},Ae),(Ae=tm.get(qt))&&J1($,Ae);var ja=Hr=qe.createElement("link");Ip(ja),Kd(ja,"link",$),ja._p=new Promise(function(Ji,Io){ja.onload=Ji,ja.onerror=Io}),ja.addEventListener("load",function(){On.loading|=1}),ja.addEventListener("error",function(){On.loading|=2}),On.loading|=4,kw(Hr,te,qe)}Hr={type:"stylesheet",instance:Hr,count:1,state:On},Tt.set(qt,Hr)}}}function bx($,te){Mg.X($,te);var Ae=xx;if(Ae&&$){var qe=z_(Ae).hoistableScripts,Tt=Z1($),qt=qe.get(Tt);qt||(qt=Ae.querySelector(K1(Tt)),qt||($=je({src:$,async:!0},te),(te=tm.get(Tt))&&wT($,te),qt=Ae.createElement("script"),Ip(qt),Kd(qt,"link",$),Ae.head.appendChild(qt)),qt={type:"script",instance:qt,count:1,state:null},qe.set(Tt,qt))}}function q5($,te){Mg.M($,te);var Ae=xx;if(Ae&&$){var qe=z_(Ae).hoistableScripts,Tt=Z1($),qt=qe.get(Tt);qt||(qt=Ae.querySelector(K1(Tt)),qt||($=je({src:$,async:!0,type:"module"},te),(te=tm.get(Tt))&&wT($,te),qt=Ae.createElement("script"),Ip(qt),Kd(qt,"link",$),Ae.head.appendChild(qt)),qt={type:"script",instance:qt,count:1,state:null},qe.set(Tt,qt))}}function bT($,te,Ae,qe){var Tt=(Tt=Li.current)?o0(Tt):null;if(!Tt)throw Error(b(446));switch($){case"meta":case"title":return null;case"style":return typeof Ae.precedence=="string"&&typeof Ae.href=="string"?(te=$y(Ae.href),Ae=z_(Tt).hoistableStyles,qe=Ae.get(te),qe||(qe={type:"style",instance:null,count:0,state:null},Ae.set(te,qe)),qe):{type:"void",instance:null,count:0,state:null};case"link":if(Ae.rel==="stylesheet"&&typeof Ae.href=="string"&&typeof Ae.precedence=="string"){$=$y(Ae.href);var qt=z_(Tt).hoistableStyles,Hr=qt.get($);if(Hr||(Tt=Tt.ownerDocument||Tt,Hr={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},qt.set($,Hr),(qt=Tt.querySelector(Cw($)))&&!qt._p&&(Hr.instance=qt,Hr.state.loading=5),tm.has($)||(Ae={rel:"preload",as:"style",href:Ae.href,crossOrigin:Ae.crossOrigin,integrity:Ae.integrity,media:Ae.media,hrefLang:Ae.hrefLang,referrerPolicy:Ae.referrerPolicy},tm.set($,Ae),qt||RI(Tt,$,Ae,Hr.state))),te&&qe===null)throw Error(b(528,""));return Hr}if(te&&qe!==null)throw Error(b(529,""));return null;case"script":return te=Ae.async,Ae=Ae.src,typeof Ae=="string"&&te&&typeof te!="function"&&typeof te!="symbol"?(te=Z1(Ae),Ae=z_(Tt).hoistableScripts,qe=Ae.get(te),qe||(qe={type:"script",instance:null,count:0,state:null},Ae.set(te,qe)),qe):{type:"void",instance:null,count:0,state:null};default:throw Error(b(444,$))}}function $y($){return'href="'+Gm($)+'"'}function Cw($){return'link[rel="stylesheet"]['+$+"]"}function Y1($){return je({},$,{"data-precedence":$.precedence,precedence:null})}function RI($,te,Ae,qe){$.querySelector('link[rel="preload"][as="style"]['+te+"]")?qe.loading=1:(te=$.createElement("link"),qe.preload=te,te.addEventListener("load",function(){return qe.loading|=1}),te.addEventListener("error",function(){return qe.loading|=2}),Kd(te,"link",Ae),Ip(te),$.head.appendChild(te))}function Z1($){return'[src="'+Gm($)+'"]'}function K1($){return"script[async]"+$}function H5($,te,Ae){if(te.count++,te.instance===null)switch(te.type){case"style":var qe=$.querySelector('style[data-href~="'+Gm(Ae.href)+'"]');if(qe)return te.instance=qe,Ip(qe),qe;var Tt=je({},Ae,{"data-href":Ae.href,"data-precedence":Ae.precedence,href:null,precedence:null});return qe=($.ownerDocument||$).createElement("style"),Ip(qe),Kd(qe,"style",Tt),kw(qe,Ae.precedence,$),te.instance=qe;case"stylesheet":Tt=$y(Ae.href);var qt=$.querySelector(Cw(Tt));if(qt)return te.state.loading|=4,te.instance=qt,Ip(qt),qt;qe=Y1(Ae),(Tt=tm.get(Tt))&&J1(qe,Tt),qt=($.ownerDocument||$).createElement("link"),Ip(qt);var Hr=qt;return Hr._p=new Promise(function(On,ja){Hr.onload=On,Hr.onerror=ja}),Kd(qt,"link",qe),te.state.loading|=4,kw(qt,Ae.precedence,$),te.instance=qt;case"script":return qt=Z1(Ae.src),(Tt=$.querySelector(K1(qt)))?(te.instance=Tt,Ip(Tt),Tt):(qe=Ae,(Tt=tm.get(qt))&&(qe=je({},Ae),wT(qe,Tt)),$=$.ownerDocument||$,Tt=$.createElement("script"),Ip(Tt),Kd(Tt,"link",qe),$.head.appendChild(Tt),te.instance=Tt);case"void":return null;default:throw Error(b(443,te.type))}else te.type==="stylesheet"&&(te.state.loading&4)===0&&(qe=te.instance,te.state.loading|=4,kw(qe,Ae.precedence,$));return te.instance}function kw($,te,Ae){for(var qe=Ae.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),Tt=qe.length?qe[qe.length-1]:null,qt=Tt,Hr=0;Hr title"):null)}function vP($,te,Ae){if(Ae===1||te.itemProp!=null)return!1;switch($){case"meta":case"title":return!0;case"style":if(typeof te.precedence!="string"||typeof te.href!="string"||te.href==="")break;return!0;case"link":if(typeof te.rel!="string"||typeof te.href!="string"||te.href===""||te.onLoad||te.onError)break;return te.rel==="stylesheet"?($=te.disabled,typeof te.precedence=="string"&&$==null):!0;case"script":if(te.async&&typeof te.async!="function"&&typeof te.async!="symbol"&&!te.onLoad&&!te.onError&&te.src&&typeof te.src=="string")return!0}return!1}function mp($){return!($.type==="stylesheet"&&($.state.loading&3)===0)}function wx($,te,Ae,qe){if(Ae.type==="stylesheet"&&(typeof qe.media!="string"||matchMedia(qe.media).matches!==!1)&&(Ae.state.loading&4)===0){if(Ae.instance===null){var Tt=$y(qe.href),qt=te.querySelector(Cw(Tt));if(qt){te=qt._p,te!==null&&typeof te=="object"&&typeof te.then=="function"&&($.count++,$=Lw.bind($),te.then($,$)),Ae.state.loading|=4,Ae.instance=qt,Ip(qt);return}qt=te.ownerDocument||te,qe=Y1(qe),(Tt=tm.get(Tt))&&J1(qe,Tt),qt=qt.createElement("link"),Ip(qt);var Hr=qt;Hr._p=new Promise(function(On,ja){Hr.onload=On,Hr.onerror=ja}),Kd(qt,"link",qe),Ae.instance=qt}$.stylesheets===null&&($.stylesheets=new Map),$.stylesheets.set(Ae,te),(te=Ae.state.preload)&&(Ae.state.loading&3)===0&&($.count++,Ae=Lw.bind($),te.addEventListener("load",Ae),te.addEventListener("error",Ae))}}var TT=0;function AT($,te){return $.stylesheets&&$.count===0&&Dw($,$.stylesheets),0<$.count||0<$.imgCount?function(Ae){var qe=setTimeout(function(){if($.stylesheets&&Dw($,$.stylesheets),$.unsuspend){var qt=$.unsuspend;$.unsuspend=null,qt()}},6e4+te);0<$.imgBytes&&TT===0&&(TT=62500*H1());var Tt=setTimeout(function(){if($.waitingForImages=!1,$.count===0&&($.stylesheets&&Dw($,$.stylesheets),$.unsuspend)){var qt=$.unsuspend;$.unsuspend=null,qt()}},($.imgBytes>TT?50:800)+te);return $.unsuspend=Ae,function(){$.unsuspend=null,clearTimeout(qe),clearTimeout(Tt)}}:null}function Lw(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dw(this,this.stylesheets);else if(this.unsuspend){var $=this.unsuspend;this.unsuspend=null,$()}}}var Rw=null;function Dw($,te){$.stylesheets=null,$.unsuspend!==null&&($.count++,Rw=new Map,te.forEach(W5,$),Rw=null,Lw.call($))}function W5($,te){if(!(te.state.loading&4)){var Ae=Rw.get($);if(Ae)var qe=Ae.get(null);else{Ae=new Map,Rw.set($,Ae);for(var Tt=$.querySelectorAll("link[data-precedence],style[data-precedence]"),qt=0;qt"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(e){console.error(e)}}return u(),q4.exports=Oee(),q4.exports}var Bee=Fee();function Uee(u){return new Promise(e=>{const n=new Image;n.src=u,n.onload=()=>e(n)})}async function $ee(u,e,n){const b=await Uee(u);return e.width=b.width,e.height=b.height,n.drawImage(b,0,0),n.getImageData(0,0,b.width,b.height)}function Vee(u){const{width:e,height:n}=u,b=new ImageData(e,n),R=u.data,q=b.data;for(let re=0;re{async function re(){const fe=e.current,he=fe.getContext("2d",{willReadFrequently:!0}),be=await $ee(u.inputImageUrl,fe,he),Pe=Vee(be);u.setColorImage(be),u.setGrayImage(Pe)}re()},[u.inputImageUrl]),$u.useEffect(()=>{if(!u.useColor&&!u.grayImage||u.useColor&&!u.colorImage)return;const re=e.current,fe=re.getContext("2d",{willReadFrequently:!0});u.useColor?(fe.putImageData(u.colorImage,0,0),b(re.toDataURL())):(fe.putImageData(u.grayImage,0,0),b(re.toDataURL()))},[u.useColor,u.colorImage,u.grayImage]),$u.useEffect(()=>{if(!u.kernel||u.kernel.flat().flat().some(je=>je===""||je===null||je===void 0||!Number.isFinite(je))||u.useColor&&!u.colorImage||!u.useColor&&!u.grayImage)return;const fe=u.useColor?Gee(u.colorImage,u.kernel):jee(u.grayImage,u.kernel[0]),he=e.current,be=he.getContext("2d",{willReadFrequently:!0});he.width=fe.width,he.height=fe.height,be.putImageData(fe,0,0);const Pe=he.toDataURL();q(Pe)},[u.useColor,u.grayImage,u.colorImage,u.kernel]),Ei.jsxs("div",{className:"convolution-viewer",children:[Ei.jsxs("div",{className:"convolution-viewer-item",children:[Ei.jsx("h3",{children:"Input"}),n?Ei.jsx("img",{src:n,alt:"Input"}):Ei.jsx("p",{children:"Loading..."})]}),Ei.jsxs("div",{className:"convolution-viewer-item",children:[Ei.jsx("h3",{children:"Output"}),R?Ei.jsx("img",{src:R,alt:"Output"}):Ei.jsx("p",{children:"Processing..."})]}),Ei.jsx("canvas",{ref:e,style:{display:"none"}})]})}function tb(u){const{selected:e=!1,children:n,className:b="",...R}=u,q=["app-button",e?"selected":"",b].join(" ");return Ei.jsx("button",{className:q,...R,children:n})}const Y4={Laplacian:[[[-1,-1,-1],[-1,8,-1],[-1,-1,-1]],[[-1,-1,-1],[-1,8,-1],[-1,-1,-1]],[[-1,-1,-1],[-1,8,-1],[-1,-1,-1]]],Red:[[[0,0,0],[0,1,0],[0,0,0]],[[0,0,0],[0,0,0],[0,0,0]],[[0,0,0],[0,0,0],[0,0,0]]],Green:[[[0,0,0],[0,0,0],[0,0,0]],[[0,0,0],[0,1,0],[0,0,0]],[[0,0,0],[0,0,0],[0,0,0]]],Blue:[[[0,0,0],[0,0,0],[0,0,0]],[[0,0,0],[0,0,0],[0,0,0]],[[0,0,0],[0,1,0],[0,0,0]]]},Z4={Laplacian:[[[-1,-1,-1],[-1,8,-1],[-1,-1,-1]],[[-1,-1,-1],[-1,8,-1],[-1,-1,-1]],[[-1,-1,-1],[-1,8,-1],[-1,-1,-1]]],"Sobel X":[[[-1,0,1],[-2,0,2],[-1,0,1]],[[-1,0,1],[-2,0,2],[-1,0,1]],[[-1,0,1],[-2,0,2],[-1,0,1]]],"Sobel Y":[[[-1,-2,-1],[0,0,0],[1,2,1]],[[-1,-2,-1],[0,0,0],[1,2,1]],[[-1,-2,-1],[0,0,0],[1,2,1]]],Sharpen:[[[0,-1,0],[-1,5,-1],[0,-1,0]],[[0,-1,0],[-1,5,-1],[0,-1,0]],[[0,-1,0],[-1,5,-1],[0,-1,0]]],"Box Blur":[[[.11,.11,.11],[.11,.11,.11],[.11,.11,.11]],[[.11,.11,.11],[.11,.11,.11],[.11,.11,.11]],[[.11,.11,.11],[.11,.11,.11],[.11,.11,.11]]]};function Hee(u){const[e,n]=$u.useState(u.useColor?Object.keys(Y4):Object.keys(Z4)),[b,R]=$u.useState(e[0]);function q(){u.useColor?u.onKernelChange(Y4[b]):u.onKernelChange(Z4[b])}return $u.useEffect(()=>{console.log("PresetSelector: useEffect triggered"),console.log("useColor:",u.useColor);const re=u.useColor?Object.keys(Y4):Object.keys(Z4);n(re),R(re[0])},[u.useColor]),Ei.jsxs("div",{className:"preset-selector",children:[Ei.jsx("label",{className:"preset-label",children:"Preset:"}),Ei.jsx("select",{className:"preset-dropdown",value:b,onChange:re=>R(re.target.value),children:e.map(re=>Ei.jsx("option",{value:re,children:re},re))}),Ei.jsx(tb,{onClick:q,children:"Apply"})]})}function Wee(u){const[e,n]=$u.useState(u.kernel[0].length),[b,R]=$u.useState(u.kernel.length),[q,re]=$u.useState(0);function fe(Pe,je,We,ft){const xt=u.kernel.map(zt=>[...zt]);xt[Pe][je][We]=ft===""?"":parseFloat(ft),u.onKernelChange?.(xt)}function he(Pe){Pe.preventDefault(),be(e,b)}function be(Pe,je){const We=u.kernel[0][0].length,ft=u.kernel[0].length,xt=[];for(let zt=0;zt<3;++zt){const Ft=[];for(let jt=0;jt{u.useColor||re(0)},[u.useColor]),Ei.jsxs("div",{className:"kernel-editor",children:[Ei.jsx("div",{className:"kernel-size-options",children:Ei.jsxs("form",{onSubmit:he,children:["Width: "," ",Ei.jsx("input",{type:"number",value:e,min:1,onChange:Pe=>n(parseInt(Pe.target.value))}),"Height: "," ",Ei.jsx("input",{type:"number",value:b,min:1,onChange:Pe=>R(parseInt(Pe.target.value))}),Ei.jsx(tb,{type:"submit",children:"Resize"})]})}),u.useColor&&Ei.jsx("div",{className:"channel-selector",children:Ei.jsxs("div",{className:"channel-buttons",children:[Ei.jsx(tb,{selected:q===0,onClick:()=>re(0),children:"R"}),Ei.jsx(tb,{selected:q===1,onClick:()=>re(1),children:"G"}),Ei.jsx(tb,{selected:q===2,onClick:()=>re(2),children:"B"})]})}),Ei.jsx("div",{className:"kernel-matrix",children:u.kernel[q].map((Pe,je)=>Ei.jsx("div",{className:"kernel-row",children:Pe.map((We,ft)=>Ei.jsx("input",{type:"number",value:We,onChange:xt=>fe(q,je,ft,xt.target.value),className:"kernel-cell"},ft))},je))}),Ei.jsx(Hee,{onKernelChange:u.onKernelChange,useColor:u.useColor})]})}function i8(u){const[e,n]=$u.useState(u.defaultTab);return Ei.jsxs("div",{className:"tabs",children:[Ei.jsx("div",{className:"tab-buttons",children:u.tabs.map(b=>Ei.jsx("button",{className:e===b.label?"active":"",onClick:()=>n(b.label),children:b.label},b.label))}),Ei.jsx("div",{className:"tab-content",children:u.tabs.find(b=>b.label===e)?.content})]})}function Xee(u){return Ei.jsxs("div",{className:"switch-container",children:[Ei.jsx("span",{className:"switch-label",children:u.leftLabel}),Ei.jsxs("label",{className:"switch",children:[Ei.jsx("input",{type:"checkbox",checked:u.checked,onChange:e=>u.onChange(e.target.checked)}),Ei.jsx("span",{className:"slider"})]}),Ei.jsx("span",{className:"switch-label",children:u.rightLabel})]})}function Yee(u){const e=$u.useRef(null);return Ei.jsxs("div",{className:"input-selector",children:[Ei.jsx("input",{ref:e,type:"file",accept:"image/*",onChange:u.handleFileChange,style:{display:"none"}}),Ei.jsx(tb,{onClick:()=>e.current.click(),children:"Upload Image"}),Ei.jsx(Xee,{checked:u.useColor,onChange:n=>u.onUseColor(n),leftLabel:"Grayscale",rightLabel:"Color"})]})}const Zee="Input";function Kee(u){const e=[{label:"Input",content:Ei.jsx(Yee,{handleFileChange:n,useColor:u.useColor,onUseColor:u.onUseColor})},{label:"Kernel",content:Ei.jsx(Wee,{kernel:u.kernel,onKernelChange:u.onKernelChange,onBoundingBoxButton:u.onBoundingBoxButton,useColor:u.useColor})}];function n(b){const R=b.target.files[0];R&&u.onUpload(R)}return Ei.jsx("div",{className:"sidebar",children:Ei.jsx(i8,{tabs:e,defaultTab:Zee})})}const Jee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADgCAIAAABjIy8HAAANRklEQVR42u2drXYbOxeG1a6BAQHnEgwCAgoCDAwKCgIMAg4ICAgoCDDwBQQEnAswMAgoCDAIOCDAoCCgIMAg4ICAAF/CBwIMDT4gR5YlzVi250/S86ysrvF41z+a/Wr/jGb85Wq8FACp8pUhAAQAgAAAEAAAAgBAAAAIACBusrJe6OFGCCGu74seOvcotj5l7Ff2SVEwzs7x2TrOxjCWOMiex1Huz/tetnG5hz4r/fDYH1r/MtLAeTDUU/owFSjKeKnEKR6fXcdNHYJDBtl5HAv25/lPpZPd14qOhPPA5E0AUMr8WjqNHK+a3y5L5FhG6f27jlu446x/8nKjQckCkPErLwsq+GIkM/U4UMvHOc9/QkqBnJ/1+n7151/4wh7jvNV4p3F2pumt+l4xpEBK7qre0g+SOgaqhm5qpFro/fpMuXV87HEuyC4qjRjO47tT8lbip/rCcmhImawiced1l23tbj1FsLWfXeKM9ZD1hBDZzcxzXtjp/Ead6b7/m9af5+RN55772xsBjBxG/wJ5rV87/hafEHF+84LX38P7VxODhwac79tI3rz3RFB/cex5fAtO0pX7Ub9WIWvdFfL2530fvVa2pS/TXD3ZLXj96nLWre9rf852VpD1C7X4+NYfqRorgou/j+1e9mRQ25lgvTfneQ61kc/pmXK0oX/gPL4FRbw+77Q0Auw9EPac2sJWj6f3w37eLzbbfXZEzdvfIgE4P3TxfuPkgGFpnDfISyfyXr/0Y2acncl73/rTHs+swx7wxqsUn09S9XiW3AbdowskCpc0FiT3pXeBJoNsed+VFfCsfzQ+/7DDbl4TPa+yr7++9H/rRlKjPY5vpePJeQBTA0II3fshbhAABDY9Scry24xhhVC8f7lcO32WZaVoAAFAGBO/7v3yYSka4JpgCGDiN7w/Ly8iAkBCyCBwYCggAkB4fP+z1oD8d+84gAAgjML3+5+13//5vt6mCIYkvP/P941njYcIAOLxez298XR3vRKYDHYoCRAAtHTWP+QV/MtiBACReL9qClEEQ5AcOPfbr+DTGmItELQl7z9cABu5jd8pAlIgCD7vPySekAJB0iAAaJir8TLLKslEfHpBrU6Bqlj/Da3VgExa7HNeNj42np3Qr232/qXGgYv+IJQ4oC9zcK538PF+4b1AqI1doLyeQFnXQED7C2Ld9ZW7O3cWSyK8LtDWnsBOJ7ohUHSnN+KADBF5YrADSzxFsAxqpEPRJ0IS5dzKv9W27vEFc79PbR2GJ6kYp9Z/kw5FrAHlwSoXUF6udtp+r56Sfh/kWiBjBaz6njLqlbUCFsIqi5VLyFnP2Kl7/E6u3zoB1LP+G4KLBiqTkQ+NnbrH75EUNN8Fcq7/9tLuXuu/AVoUAepf/w3QFgE0sv4bQKfJNmgj678Bmq8BGlz/DdBwCtTs+m+AtqRAACkKoNn13wDNRwBdAz63+PKxwfshpBSoqfXfADoNnwmuf/03wIbDtORz1Lb+G6AVKZCeCNW5/hugRSmQMx0y3Dqvwb/f+m+ANqZAoq713wAtjQB6KLATem6RAqkIACCVIhgAAQAgAAAEAIAAABAAAAIAqBoWz5TJ4Pexp+X4/IPhQgCxef9Z/9TTeHLDsm1SoChnlJvZgQZABAiY5X1XbrxO3/T9KjgoAyACRIv0/u50If9sPQACSCUgqCmf5AcBACCABDjrn8rMh+SHIjjpalgVAwwIAkAPQAqUcC4ECCA5Xqdvs/4R0z8CSDvRpAGKANL0dTsFQgwUwWkVu8Ye0iEEECfd6UJMmd0Dg/sCATUAAAIAQAAACAAAAQAgAAAEAIAAABAAAAIAQADgz0PWe8h6jAMCSNT7jQ1AAMl5PxpAAAnz82U+Ypk0Akhz+v/5In71OsOu1ABBAAEAIAAABACAAAAQAEBDcFF8hahG0Pw06wy7Qojr5QvDQgRIjF896f2AANLCmO+Z/hFAuhrA+9sJd4arOw4AEQAAAQAgAAAEAIAAABAAAAIAQAAACAAAAQAgAAAEAIAAABAAAAIAQAAAB8EFMWUyGfiOJ/ciQAARev+sf+Rp3B1kaIAUKEK608WBBoAAAmZrEPCPEoAAABAAAEWwk8HvY0/L8flHgkeX8Sng4WQatgAGv4/P+qeexpOb5LoujE8xr6OrGFKg7GZ2oEHkIZ7xiTgFEkIs71f3nX2dvun71eSnDNKE8clD9qMjOREmj65qsc/6R6/TN/8EIP5wz/hYyH50bF2g5X1XTWmJB3fGxwfaoIAAwuesf6riu5HsNpJZHmIQ9/i0qgboThfxLIaTkd1IdpvKLA8xiHt82lYDRLsatP7mxtV42Q1nOXTizTFFbAI46582WNu1/1xSs+ODACrndfo26x/RAGV8PKu1OLtATHKMj08NMOsfxbYUQm93cLAZn/hTILuYM/awFILxiVMA3elCTAnljM9BNcAXLs2GlGEpBKTdD2AIquPhx7/6w+vnvxkTBJCi6wshxJ+REAiAFChd7wciQLJ8HwohHsS/5EIIIH7mF5dyozPsCiHmo5ncEEJcL18YH1KgmLkdZ51hV3n8ShKjVT/+Ies9ZD1GCQGkEQpGMxkHDD2gAVKgaKf/AjEYMij4v/8MODtJBAgcNfHPRzMZCuTGfDSzKwHp/eq/FAhpKw8327cBAVSCnLlVxq+Xwsq/O8OuMwVamf18OUQDhsdf36/26NvQWAokD3zcnRCpgdtRpqZ/Qwb2CEhfXxUMoid+vnREz1CRJ3g5EaAVlUDn6VF8H+pOrLad+v9nsFzn/b8okWMUgIr7cfdAVt6vnQ3YmKFzvF8lPKpawDWJAAFje/8/g2Ve7nc7zuT0r5cQNIKiEoAx66fWCO88PRYUtauyYZypXGhv71clr7MmhlqL4GIv15+NuyyWGZFn9VwisiC+vje3oZkUSOW1cSe40o+V0+vef0h339/p5Z96qD8FtQrAc16PdfrvPD3q3u8ZByCqCLDVuZNYHfl5MQAaaCF1XBSfVwxE6f2Oq2H0r8yVAMnWAAAtpPKyrKAX9JD1uECkBiaf96yW0X6yeQvrxO+LU3kKVNwMjUYAeofHmevPLy7l/pqzIOXuy+en1Zz348KwSVkDtS6Gk+6e2lkweVa42QpYeb/ctjVABKh2+rdn+oKnYooAauJvsAiWP4numPx+XJAC1VEEO108hez/+vnvNi/puRovuTFmVr/rR68BY5rfWBhXox4Gv4/lxutvcTacGM++jq4Gn9vj8w8EACXQnvleeb9y92JjWwMT6/fOogwXCKBW71dLPuv8YGr6lzIwHub6vVW0Ty6z+JSAAGKb+/PqXb0RZDzccP2CZtXjhhLikAEC2AE9K/A5/NJ+sqN9KbPs+PzDyILWrc/phW08GWTCs097uVLC5DKLQAMIYAfvv/tv7VJ337Yc/qrtd0X/gW7jZ8I8vX82ORJCiL4QE9G9WojHGDTAL8T4Tvy6d3766Idz9Kq236kUlr5u/zy92t+dLnbwfv0VrhYyIATtQiyG85r4be/M65ZUbb9rIiR/DNQZEA7x/vXOx4M+IQIImLv/jqX7enpA1fZ5Gsh76hDvj0YDCGAv13//UD6qPLVBex37wsvx+cfxfLG393enC6NmUK/QnS5C1wAC8C18794/1n55cqy267T3Qd1l6HacqQ2jS7vT3D/rHy2fnwwNdKeL5fOTTK6C1gBdIG/vP9lI042HNdjvFAFUHLA1sEPH01U3FxFgX4gI4PB7+bfRlNzmjkYhW4W9ml/zJlrl9PI+pOpe0+q2pLfjzN/77dRfTvkyIOQahxYHEIC751PQlmnDJ3Q6mX6Lxc7b0ti4HWcn70Lse1WC4fS2BjbiQDgaIAVy5yTtbDrdfdv+Cde3of75ou+cj2Z7e7+xaqh4aV1YuRAnwjTX6f0VykeV58gmgw0n20iBNO8Xv9Y3Wz+52+Fd9CzIuaB6XR5cucqDEM6REQHWWXWbp/+8aFD6iomNqvfTrZd/ORKes+Ek+99F6HGAGmD7udjWasCuAcTmL3EYedFO078Xl0JcbsuF2l0PIIDYWN969VdP/dbGQfdjvXTcSCL7cbHeGbIGEIC4Gi/vvgV5TaCxWk5v9s9PM2Pj5E68HxABdA3sfFOJFmvgi7Oflf24mPWP9LrHuJgI+9bazwdu7+yMnw55/VUx8PxkC8B2oYDG84tzqaA80b1R5lt7sG+t/fF8cfIu3k+EEOKjc3Q8X3x0jhgfpz0pUGwod++Mn+SG1AAjQw2QBMZkX7ATtghg++In7LEP3D63NpcJk/o/zlIBe+xDt88VwNlwshxu1NH6Q+yxj8M+2yoaf7DHPjh7imCgCAZIlcxZLDvPKcjzf847zGCPfaD2Wd6Nk2z00+DYYx+Jvb26o+CU8uvoCnvsY7LP5HMFv6DmLKWxxz4O+8yno2SfQsMe+5js1zhveiE+byWJPfaR2Wd597dwrp8uuBkG9tiHaJ/lBYuz4cR/vTX22Adqz4kwSBoEAAhgj2IZe+yjsOd6AOyTtud6AOyTtud6AOyTtv8/IQo5nrxfUrIAAAAASUVORK5CYII=",Qee=Jee,ete=[[[-1,-1,-1],[-1,8,-1],[-1,-1,-1]],[[-1,-1,-1],[-1,8,-1],[-1,-1,-1]],[[-1,-1,-1],[-1,8,-1],[-1,-1,-1]]];function tte(){const u=$u.useRef(null),[e,n]=$u.useState(ete),[b,R]=$u.useState(Qee),[q,re]=$u.useState(null),[fe,he]=$u.useState(null),[be,Pe]=$u.useState(!0);function je(We){const ft=URL.createObjectURL(We);R(ft)}return Ei.jsxs(Ei.Fragment,{children:[Ei.jsxs("div",{className:"main-container",children:[Ei.jsx(qee,{inputImageUrl:b,kernel:e,grayImage:q,setGrayImage:re,colorImage:fe,setColorImage:he,useColor:be}),Ei.jsx(Kee,{kernel:e,onKernelChange:n,onUpload:je,useColor:be,onUseColor:Pe})]}),Ei.jsx("canvas",{ref:u,style:{display:"none"}})]})}const rte=1e-7,nte=1e-4;class _U{constructor(e,n){this.backend=e,this.dataMover=n,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,n){this.dataIdsCount++,this.data.set(e,n)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}}class o8{refCount(e){return ng("refCount")}incRef(e){return ng("incRef")}timerAvailable(){return!0}time(e){return ng("time")}read(e){return ng("read")}readSync(e){return ng("readSync")}readToGPU(e,n){return ng("readToGPU")}numDataIds(){return ng("numDataIds")}disposeData(e,n){return ng("disposeData")}write(e,n,b){return ng("write")}move(e,n,b,R,q){return ng("move")}createTensorFromGPUData(e,n,b){return ng("createTensorFromGPUData")}memory(){return ng("memory")}floatPrecision(){return ng("floatPrecision")}epsilon(){return this.floatPrecision()===32?rte:nte}dispose(){return ng("dispose")}}function ng(u){throw new Error(`'${u}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function xU(u){let e=u.length,n=0;for(;e>0;)n=Math.random()*e|0,e--,yA(u,e,n)}function s8(u,e,n){return Math.max(u,Math.min(e,n))}function l8(u){return u%2===0?u:u+1}function yA(u,e,n){const b=u[e];u[e]=u[n],u[n]=b}function ate(u){let e=0;for(let n=0;nn+` Shapes ${u} and ${e} must match`)}function bU(u){Jn(u!=null,()=>"The input to the tensor constructor must be a non-null value.")}function xo(u){if(u.length===0)return 1;let e=u[0];for(let n=1;n0,n,b){return new Promise((R,q)=>{let re=0;const fe=()=>{if(u()){R();return}re++;const he=e(re);if(n!=null&&re>=n){q();return}b!=null?b(fe,he):setTimeout(fe,he)};fe()})}function wU(u,e){let n=1,b=-1;for(let q=0;q=0)n*=u[q];else if(u[q]===-1){if(b!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${b} and dim ${q}`);b=q}else if(u[q]<0)throw Error(`Shapes can not be < 0. Found ${u[q]} at dim ${q}`);if(b===-1){if(e>0&&e!==n)throw Error(`Size(${e}) must match the product of shape ${u}`);return u}if(n===0)throw Error(`Cannot infer the missing size in [${u}] when there are 0 elements`);if(e%n!==0)throw Error(`The implicit shape can't be a fractional number. Got ${e} / ${n}`);const R=u.slice();return R[b]=e/n,R}function Ac(u,e){const n=e.length;return u=u==null?e.map((b,R)=>R):[].concat(u),Jn(u.every(b=>b>=-n&&b`All values in axis param must be in range [-${n}, ${n}) but got axis ${u}`),Jn(u.every(b=>CA(b)),()=>`All values in axis param must be integers but got axis ${u}`),u.map(b=>b<0?n+b:b)}function mb(u,e){const n=[],b=[],R=e!=null&&Array.isArray(e)&&e.length===0,q=e==null||R?null:Ac(e,u).sort();let re=0;for(let fe=0;fefe)&&u[fe]===1&&(n.push(u[fe]),b.push(fe)),q[re]<=fe&&re++}u[fe]!==1&&(n.push(u[fe]),b.push(fe))}return{newShape:n,keptDims:b}}function zv(u,e){return np(u,e)}function np(u,e){let n=null;if(u==null||u==="float32")n=new Float32Array(e);else if(u==="int32")n=new Int32Array(e);else if(u==="bool")n=new Uint8Array(e);else if(u==="string")n=new Array(e);else throw new Error(`Unknown data type ${u}`);return n}function ite(u,e){for(let n=0;ne+=n.length),e}function hC(u){return typeof u=="string"||u instanceof String}function lte(u){return typeof u=="boolean"}function Tz(u){return typeof u=="number"}function FA(u){return Array.isArray(u)?FA(u[0]):u instanceof Float32Array?"float32":u instanceof Int32Array||u instanceof Uint8Array||u instanceof Uint8ClampedArray?"int32":Tz(u)?"float32":hC(u)?"string":lte(u)?"bool":"float32"}function Az(u){return!!(u&&u.constructor&&u.call&&u.apply)}function Sz(u,e){for(let n=e;n=0;--b)n[b]=n[b+1]*u[b+1];return n}function AU(u,e,n,b=!1){const R=new Array;if(e.length===1){const q=e[0]*(b?2:1);for(let re=0;rehe*be)*(b?2:1);for(let he=0;heR*q)*(n?2:1);if(b===0)return[];if(b!==e.length)throw new Error(`[${u}] does not match the input size ${e.length}${n?" for a complex tensor":""}.`);return AU(0,u,e,n)}function ute(u,e){if(Array.isArray(u))return u;if(e==="float32")return u instanceof Float32Array?u:new Float32Array(u);if(e==="int32")return u instanceof Int32Array?u:new Int32Array(u);if(e==="bool"||e==="string")return Uint8Array.from(new Int32Array(u));throw new Error(`Unknown dtype ${e}`)}function u8(u,e){const n=Nv(u,e);for(let b=0;bb*R,1);if(e==null||e==="float32")return ay(u,new Float32Array(n));if(e==="int32")return ay(u,new Int32Array(n));if(e==="bool")return ay(u,new Uint8Array(n));throw new Error(`Unknown data type ${e}`)}function A_(u){u.forEach(e=>{Jn(Number.isInteger(e)&&e>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${u}].`)})}function c1(u,e,n){if(e===0)return 0;if(e===1)return u[0];let b=u[u.length-1];for(let R=0;R"u"||typeof this.global.location>"u"||typeof this.global.location.search>"u")return;const e=this.getQueryParams(this.global.location.search);S9 in e&&e[S9].split(",").forEach(b=>{const[R,q]=b.split(":");this.urlFlags[R]=dte(R,q)})}}function fte(u){const e={};return u.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(n,...b)=>(hte(e,b[0],b[1]),b.join("="))),e}function hte(u,e,n){u[decodeURIComponent(e)]=decodeURIComponent(n||"")}function dte(u,e){const n=e.toLowerCase();return n==="true"||n==="false"?n==="true":`${+n}`===n?+n:e}function co(){return EU}let EU=null;function pte(u){EU=u}let K4;function CU(){if(K4==null){let u;if(typeof window<"u")u=window;else if(typeof global<"u")u=global;else if(typeof process<"u")u=process;else if(typeof self<"u")u=self;else throw new Error("Could not find a global object");K4=u}return K4}function vte(){const u=CU();return u._tfGlobals==null&&(u._tfGlobals=new Map),u._tfGlobals}function f8(u,e){const n=vte();if(n.has(u))return n.get(u);{const b=e();return n.set(u,b),n.get(u)}}const HL="Abs",dC="Acos",pC="Acosh",UA="Add",h8="AddN",d8="All",p8="Any",WL="ArgMax",XL="ArgMin",vC="Asin",mC="Asinh",gC="Atan",yC="Atanh",_C="Atan2",YL="AvgPool",v8="AvgPoolGrad",ZL="AvgPool3D",m8="AvgPool3DGrad",KL="BatchMatMul",JL="BatchToSpaceND",g8="Bincount",y8="BitwiseAnd",mte="BroadcastTo",kU="BroadcastArgs",xC="Cast",bC="Ceil",wC="ClipByValue",_8="Complex",QL="ComplexAbs",eR="Concat",tR="Conv2D",x8="Conv2DBackpropFilter",rR="Conv2DBackpropInput",nR="Conv3D",b8="Conv3DBackpropFilterV2",w8="Conv3DBackpropInputV2",TC="Cos",AC="Cosh",T8="Cumprod",aR="Cumsum",A8="CropAndResize",S8="DenseBincount",E8="DepthToSpace",iR="DepthwiseConv2dNative",C8="DepthwiseConv2dNativeBackpropFilter",k8="DepthwiseConv2dNativeBackpropInput",MU="Diag",oR="Dilation2D",Ez="Dilation2DBackpropInput",Cz="Dilation2DBackpropFilter",gte="Draw",SC="RealDiv",M8="Einsum",EC="Elu",I8="EluGrad",CC="Erf",sR="Equal",kC="Exp",lR="ExpandDims",MC="Expm1",L8="FFT",R8="Fill",D8="FlipLeftRight",IC="Floor",LC="FloorDiv",uR="FusedBatchNorm",cR="GatherV2",IU="GatherNd",fR="Greater",RC="GreaterEqual",DC="Identity",P8="IFFT",z8="Imag",PC="IsFinite",zC="IsInf",NC="IsNan",hR="LeakyRelu",dR="Less",pR="LessEqual",LU="LinSpace",OC="Log",FC="Log1p",vR="LogicalAnd",mR="LogicalNot",gR="LogicalOr",yte="LogSoftmax",yR="LRN",N8="LRNGrad",_R="Max",BC="Maximum",xR="MaxPool",O8="MaxPoolGrad",bR="MaxPool3D",F8="MaxPool3DGrad",RU="MaxPoolWithArgmax",wR="Mean",TR="Min",UC="Minimum",AR="MirrorPad",$C="Mod",DU="Multinomial",VC="Multiply",SR="Neg",ER="NotEqual",B8="NonMaxSuppressionV3",U8="NonMaxSuppressionV4",$8="NonMaxSuppressionV5",CR="OnesLike",kR="OneHot",MR="Pack",IR="PadV2",jC="Pow",LR="Prelu",RR="Prod",PU="RaggedGather",zU="RaggedRange",NU="RaggedTensorToTensor",V8="Range",j8="Real",GC="Reciprocal",qC="Relu",DR="Reshape",PR="ResizeNearestNeighbor",G8="ResizeNearestNeighborGrad",zR="ResizeBilinear",q8="ResizeBilinearGrad",HC="Relu6",NR="Reverse",WC="Round",XC="Rsqrt",OU="ScatterNd",FU="TensorScatterUpdate",BU="SearchSorted",OR="Select",YC="Selu",FR="Slice",ZC="Sin",KC="Sinh",JC="Sign",QC="Sigmoid",ek="Softplus",tk="Sqrt",BR="Sum",UR="SpaceToBatchND",$R="SplitV",VR="Softmax",UU="SparseFillEmptyRows",$U="SparseReshape",VU="SparseSegmentMean",jU="SparseSegmentSum",GU="SparseToDense",rk="SquaredDifference",H8="Square",W8="StaticRegexReplace",X8="StridedSlice",qU="StringNGrams",HU="StringSplit",WU="StringToHashBucketFast",nk="Sub",ak="Tan",ik="Tanh",ok="Tile",Y8="TopK",Z8="Transform",TA="Transpose",K8="Unique",jR="Unpack",GR="UnsortedSegmentSum",qR="ZerosLike",sk="Step",_te="FromPixels",J8="RotateWithOffset",gL="_FusedMatMul",yL="FusedConv2D",XU="FusedDepthwiseConv2D";function Og(...u){co().getBool("IS_TEST")||co().getBool("PROD")||console.warn(...u)}const _L=f8("kernelRegistry",()=>new Map),kz=f8("gradRegistry",()=>new Map);function E9(u,e){const n=ZU(u,e);return _L.get(n)}function C9(u){return kz.get(u)}function k9(u){const e=_L.entries(),n=[];for(;;){const{done:b,value:R}=e.next();if(b)break;const[q,re]=R,[fe]=q.split("_");fe===u&&n.push(re)}return n}function YU(u){const{kernelName:e,backendName:n}=u,b=ZU(e,n);_L.has(b)&&Og(`The kernel '${e}' for backend '${n}' is already registered`),_L.set(b,u)}function xte(u){const{kernelName:e}=u;kz.has(e)&&co().getBool("DEBUG")&&Og(`Overriding the gradient for '${e}'`),kz.set(e,u)}function ZU(u,e){return`${e}_${u}`}function KU(u){return u instanceof Float32Array||u instanceof Int32Array||u instanceof Uint8Array||u instanceof Uint8ClampedArray}var J4,M9;function bte(){if(M9)return J4;M9=1,J4=e;var u=null;try{u=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function e(Nn,Kr,Ma){this.low=Nn|0,this.high=Kr|0,this.unsigned=!!Ma}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0});function n(Nn){return(Nn&&Nn.__isLong__)===!0}e.isLong=n;var b={},R={};function q(Nn,Kr){var Ma,ui,da;return Kr?(Nn>>>=0,(da=0<=Nn&&Nn<256)&&(ui=R[Nn],ui)?ui:(Ma=fe(Nn,(Nn|0)<0?-1:0,!0),da&&(R[Nn]=Ma),Ma)):(Nn|=0,(da=-128<=Nn&&Nn<128)&&(ui=b[Nn],ui)?ui:(Ma=fe(Nn,Nn<0?-1:0,!1),da&&(b[Nn]=Ma),Ma))}e.fromInt=q;function re(Nn,Kr){if(isNaN(Nn))return Kr?Re:jt;if(Kr){if(Nn<0)return Re;if(Nn>=xt)return Pn}else{if(Nn<=-zt)return Vn;if(Nn+1>=zt)return yn}return Nn<0?re(-Nn,Kr).neg():fe(Nn%ft|0,Nn/ft|0,Kr)}e.fromNumber=re;function fe(Nn,Kr,Ma){return new e(Nn,Kr,Ma)}e.fromBits=fe;var he=Math.pow;function be(Nn,Kr,Ma){if(Nn.length===0)throw Error("empty string");if(Nn==="NaN"||Nn==="Infinity"||Nn==="+Infinity"||Nn==="-Infinity")return jt;if(typeof Kr=="number"?(Ma=Kr,Kr=!1):Kr=!!Kr,Ma=Ma||10,Ma<2||360)throw Error("interior hyphen");if(ui===0)return be(Nn.substring(1),Kr,Ma).neg();for(var da=re(he(Ma,8)),Ia=jt,aa=0;aa>>0:this.low},un.toNumber=function(){return this.unsigned?(this.high>>>0)*ft+(this.low>>>0):this.high*ft+(this.low>>>0)},un.toString=function(Kr){if(Kr=Kr||10,Kr<2||36>>0,$i=Ui.toString(Kr);if(aa=ai,aa.isZero())return $i+Ka;for(;$i.length<6;)$i="0"+$i;Ka=""+$i+Ka}},un.getHighBits=function(){return this.high},un.getHighBitsUnsigned=function(){return this.high>>>0},un.getLowBits=function(){return this.low},un.getLowBitsUnsigned=function(){return this.low>>>0},un.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Vn)?64:this.neg().getNumBitsAbs();for(var Kr=this.high!=0?this.high:this.low,Ma=31;Ma>0&&(Kr&1<=0},un.isOdd=function(){return(this.low&1)===1},un.isEven=function(){return(this.low&1)===0},un.equals=function(Kr){return n(Kr)||(Kr=Pe(Kr)),this.unsigned!==Kr.unsigned&&this.high>>>31===1&&Kr.high>>>31===1?!1:this.high===Kr.high&&this.low===Kr.low},un.eq=un.equals,un.notEquals=function(Kr){return!this.eq(Kr)},un.neq=un.notEquals,un.ne=un.notEquals,un.lessThan=function(Kr){return this.comp(Kr)<0},un.lt=un.lessThan,un.lessThanOrEqual=function(Kr){return this.comp(Kr)<=0},un.lte=un.lessThanOrEqual,un.le=un.lessThanOrEqual,un.greaterThan=function(Kr){return this.comp(Kr)>0},un.gt=un.greaterThan,un.greaterThanOrEqual=function(Kr){return this.comp(Kr)>=0},un.gte=un.greaterThanOrEqual,un.ge=un.greaterThanOrEqual,un.compare=function(Kr){if(n(Kr)||(Kr=Pe(Kr)),this.eq(Kr))return 0;var Ma=this.isNegative(),ui=Kr.isNegative();return Ma&&!ui?-1:!Ma&&ui?1:this.unsigned?Kr.high>>>0>this.high>>>0||Kr.high===this.high&&Kr.low>>>0>this.low>>>0?-1:1:this.sub(Kr).isNegative()?-1:1},un.comp=un.compare,un.negate=function(){return!this.unsigned&&this.eq(Vn)?Vn:this.not().add(Lr)},un.neg=un.negate,un.add=function(Kr){n(Kr)||(Kr=Pe(Kr));var Ma=this.high>>>16,ui=this.high&65535,da=this.low>>>16,Ia=this.low&65535,aa=Kr.high>>>16,Ka=Kr.high&65535,ai=Kr.low>>>16,Ui=Kr.low&65535,$i=0,Hn=0,qa=0,ki=0;return ki+=Ia+Ui,qa+=ki>>>16,ki&=65535,qa+=da+ai,Hn+=qa>>>16,qa&=65535,Hn+=ui+Ka,$i+=Hn>>>16,Hn&=65535,$i+=Ma+aa,$i&=65535,fe(qa<<16|ki,$i<<16|Hn,this.unsigned)},un.subtract=function(Kr){return n(Kr)||(Kr=Pe(Kr)),this.add(Kr.neg())},un.sub=un.subtract,un.multiply=function(Kr){if(this.isZero())return jt;if(n(Kr)||(Kr=Pe(Kr)),u){var Ma=u.mul(this.low,this.high,Kr.low,Kr.high);return fe(Ma,u.get_high(),this.unsigned)}if(Kr.isZero())return jt;if(this.eq(Vn))return Kr.isOdd()?Vn:jt;if(Kr.eq(Vn))return this.isOdd()?Vn:jt;if(this.isNegative())return Kr.isNegative()?this.neg().mul(Kr.neg()):this.neg().mul(Kr).neg();if(Kr.isNegative())return this.mul(Kr.neg()).neg();if(this.lt(Ft)&&Kr.lt(Ft))return re(this.toNumber()*Kr.toNumber(),this.unsigned);var ui=this.high>>>16,da=this.high&65535,Ia=this.low>>>16,aa=this.low&65535,Ka=Kr.high>>>16,ai=Kr.high&65535,Ui=Kr.low>>>16,$i=Kr.low&65535,Hn=0,qa=0,ki=0,no=0;return no+=aa*$i,ki+=no>>>16,no&=65535,ki+=Ia*$i,qa+=ki>>>16,ki&=65535,ki+=aa*Ui,qa+=ki>>>16,ki&=65535,qa+=da*$i,Hn+=qa>>>16,qa&=65535,qa+=Ia*Ui,Hn+=qa>>>16,qa&=65535,qa+=aa*ai,Hn+=qa>>>16,qa&=65535,Hn+=ui*$i+da*Ui+Ia*ai+aa*Ka,Hn&=65535,fe(ki<<16|no,Hn<<16|qa,this.unsigned)},un.mul=un.multiply,un.divide=function(Kr){if(n(Kr)||(Kr=Pe(Kr)),Kr.isZero())throw Error("division by zero");if(u){if(!this.unsigned&&this.high===-2147483648&&Kr.low===-1&&Kr.high===-1)return this;var Ma=(this.unsigned?u.div_u:u.div_s)(this.low,this.high,Kr.low,Kr.high);return fe(Ma,u.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Re:jt;var ui,da,Ia;if(this.unsigned){if(Kr.unsigned||(Kr=Kr.toUnsigned()),Kr.gt(this))return Re;if(Kr.gt(this.shru(1)))return Cr;Ia=Re}else{if(this.eq(Vn)){if(Kr.eq(Lr)||Kr.eq(Gr))return Vn;if(Kr.eq(Vn))return Lr;var aa=this.shr(1);return ui=aa.div(Kr).shl(1),ui.eq(jt)?Kr.isNegative()?Lr:Gr:(da=this.sub(Kr.mul(ui)),Ia=ui.add(da.div(Kr)),Ia)}else if(Kr.eq(Vn))return this.unsigned?Re:jt;if(this.isNegative())return Kr.isNegative()?this.neg().div(Kr.neg()):this.neg().div(Kr).neg();if(Kr.isNegative())return this.div(Kr.neg()).neg();Ia=jt}for(da=this;da.gte(Kr);){ui=Math.max(1,Math.floor(da.toNumber()/Kr.toNumber()));for(var Ka=Math.ceil(Math.log(ui)/Math.LN2),ai=Ka<=48?1:he(2,Ka-48),Ui=re(ui),$i=Ui.mul(Kr);$i.isNegative()||$i.gt(da);)ui-=ai,Ui=re(ui,this.unsigned),$i=Ui.mul(Kr);Ui.isZero()&&(Ui=Lr),Ia=Ia.add(Ui),da=da.sub($i)}return Ia},un.div=un.divide,un.modulo=function(Kr){if(n(Kr)||(Kr=Pe(Kr)),u){var Ma=(this.unsigned?u.rem_u:u.rem_s)(this.low,this.high,Kr.low,Kr.high);return fe(Ma,u.get_high(),this.unsigned)}return this.sub(this.div(Kr).mul(Kr))},un.mod=un.modulo,un.rem=un.modulo,un.not=function(){return fe(~this.low,~this.high,this.unsigned)},un.and=function(Kr){return n(Kr)||(Kr=Pe(Kr)),fe(this.low&Kr.low,this.high&Kr.high,this.unsigned)},un.or=function(Kr){return n(Kr)||(Kr=Pe(Kr)),fe(this.low|Kr.low,this.high|Kr.high,this.unsigned)},un.xor=function(Kr){return n(Kr)||(Kr=Pe(Kr)),fe(this.low^Kr.low,this.high^Kr.high,this.unsigned)},un.shiftLeft=function(Kr){return n(Kr)&&(Kr=Kr.toInt()),(Kr&=63)===0?this:Kr<32?fe(this.low<>>32-Kr,this.unsigned):fe(0,this.low<>>Kr|this.high<<32-Kr,this.high>>Kr,this.unsigned):fe(this.high>>Kr-32,this.high>=0?0:-1,this.unsigned)},un.shr=un.shiftRight,un.shiftRightUnsigned=function(Kr){if(n(Kr)&&(Kr=Kr.toInt()),Kr&=63,Kr===0)return this;var Ma=this.high;if(Kr<32){var ui=this.low;return fe(ui>>>Kr|Ma<<32-Kr,Ma>>>Kr,this.unsigned)}else return Kr===32?fe(Ma,0,this.unsigned):fe(Ma>>>Kr-32,0,this.unsigned)},un.shru=un.shiftRightUnsigned,un.shr_u=un.shiftRightUnsigned,un.toSigned=function(){return this.unsigned?fe(this.low,this.high,!1):this},un.toUnsigned=function(){return this.unsigned?this:fe(this.low,this.high,!0)},un.toBytes=function(Kr){return Kr?this.toBytesLE():this.toBytesBE()},un.toBytesLE=function(){var Kr=this.high,Ma=this.low;return[Ma&255,Ma>>>8&255,Ma>>>16&255,Ma>>>24,Kr&255,Kr>>>8&255,Kr>>>16&255,Kr>>>24]},un.toBytesBE=function(){var Kr=this.high,Ma=this.low;return[Kr>>>24,Kr>>>16&255,Kr>>>8&255,Kr&255,Ma>>>24,Ma>>>16&255,Ma>>>8&255,Ma&255]},e.fromBytes=function(Kr,Ma,ui){return ui?e.fromBytesLE(Kr,Ma):e.fromBytesBE(Kr,Ma)},e.fromBytesLE=function(Kr,Ma){return new e(Kr[0]|Kr[1]<<8|Kr[2]<<16|Kr[3]<<24,Kr[4]|Kr[5]<<8|Kr[6]<<16|Kr[7]<<24,Ma)},e.fromBytesBE=function(Kr,Ma){return new e(Kr[4]<<24|Kr[5]<<16|Kr[6]<<8|Kr[7],Kr[0]<<24|Kr[1]<<16|Kr[2]<<8|Kr[3],Ma)},J4}var JU=bte();const QU=yU(JU),wte=kee({__proto__:null,default:QU},[JU]);const c2=QU||wte;function HR(u){return c2.fromString(u,!0,16)}const e$=HR("c3a5c85c97cb3127"),l2=HR("b492b66fbe98f273"),pm=HR("9ae16a3b2f90404f");function Mz(u){return u.xor(u.shru(47))}function t$(u,e,n){const b=u.slice(e,e+n);return c2.fromBytes(Array.from(b),!0,!0)}function $h(u,e){return t$(u,e,8)}function I9(u,e){return t$(u,e,4)}function ov(u,e){return e===0?u:u.shru(e).or(u.shl(64-e))}function ib(u,e,n=HR("9ddfea08eb382d69")){let b=u.xor(e).mul(n);b=b.xor(b.shru(47));let R=e.xor(b).mul(n);return R=R.xor(R.shru(47)),R=R.mul(n),R}function Tte(u,e,n,b,R,q){R=R.add(u),q=ov(q.add(R).add(b),21);const re=R;return R=R.add(e),R=R.add(n),q=q.add(ov(R,44)),[R.add(b),q.add(re)]}function W6(u,e,n,b){return Tte($h(u,e),$h(u,e+8),$h(u,e+16),$h(u,e+24),n,b)}function Ate(u,e=u.length){if(e>=8){const n=pm.add(e*2),b=$h(u,0).add(pm),R=$h(u,e-8),q=ov(R,37).mul(n).add(b),re=ov(b,25).add(R).mul(n);return ib(q,re,n)}if(e>=4){const n=pm.add(e*2),b=I9(u,0);return ib(b.shl(3).add(e),I9(u,e-4),n)}if(e>0){const n=u[0],b=u[e>>1],R=u[e-1],q=n+(b<<8),re=e+(R<<2);return Mz(pm.mul(q).xor(e$.mul(re))).mul(pm)}return pm}function Ste(u,e=u.length){const n=pm.add(e*2),b=$h(u,0).mul(l2),R=$h(u,8),q=$h(u,e-8).mul(n),re=$h(u,e-16).mul(pm);return ib(ov(b.add(R),43).add(ov(q,30)).add(re),b.add(ov(R.add(pm),18)).add(q),n)}function Ete(u,e=u.length){const n=pm.add(e*2),b=$h(u,0).mul(pm),R=$h(u,8),q=$h(u,e-8).mul(n),re=$h(u,e-16).mul(pm),fe=ov(b.add(R),43).add(ov(q,30)).add(re),he=ib(fe,b.add(ov(R.add(pm),18)).add(q),n),be=$h(u,16).mul(n),Pe=$h(u,24),je=fe.add($h(u,e-32)).mul(n),We=he.add($h(u,e-24)).mul(n);return ib(ov(be.add(Pe),43).add(ov(je,30)).add(We),be.add(ov(Pe.add(b),18)).add(je),n)}function Cte(u,e=u.length){const n=c2.fromNumber(81,!0);if(e<=32)return e<=16?Ate(u,e):Ste(u,e);if(e<=64)return Ete(u,e);let b=n,R=n.mul(l2).add(113),q=Mz(R.mul(pm).add(113)).mul(pm),re=[c2.UZERO,c2.UZERO],fe=[c2.UZERO,c2.UZERO];b=b.mul(pm).add($h(u,0));let he=0;const be=(e-1>>6)*64,Pe=be+(e-1&63)-63;do b=ov(b.add(R).add(re[0]).add($h(u,he+8)),37).mul(l2),R=ov(R.add(re[1]).add($h(u,he+48)),42).mul(l2),b=b.xor(fe[1]),R=R.add(re[0]).add($h(u,he+40)),q=ov(q.add(fe[0]),33).mul(l2),re=W6(u,he,re[1].mul(l2),b.add(fe[0])),fe=W6(u,he+32,q.add(fe[1]),R.add($h(u,he+16))),[q,b]=[b,q],he+=64;while(he!==be);const je=l2.add(q.and(255).shl(1));return he=Pe,fe[0]=fe[0].add(e-1&63),re[0]=re[0].add(fe[0]),fe[0]=fe[0].add(re[0]),b=ov(b.add(R).add(re[0]).add($h(u,he+8)),37).mul(je),R=ov(R.add(re[1]).add($h(u,he+48)),42).mul(je),b=b.xor(fe[1].mul(9)),R=R.add(re[0].mul(9).add($h(u,he+40))),q=ov(q.add(fe[0]),33).mul(je),re=W6(u,he,re[1].mul(je),b.add(fe[0])),fe=W6(u,he+32,q.add(fe[1]),R.add($h(u,he+16))),[q,b]=[b,q],ib(ib(re[0],fe[0],je).add(Mz(R).mul(e$)).add(q),ib(re[1],fe[1],je).add(b),je)}function gb(u,e){return e==="string"?ob(u):D2([u],e)}function kte(u,e){return u instanceof Float32Array&&e==="float32"||u instanceof Int32Array&&e==="int32"||u instanceof Uint8Array&&e==="bool"}function D2(u,e){if(e==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(u)&&(u=_2(u)),co().getBool("DEBUG")&&ite(u,e),kte(u,e))return u;if(e==null||e==="float32"||e==="complex64")return new Float32Array(u);if(e==="int32")return new Int32Array(u);if(e==="bool"){const n=new Uint8Array(u.length);for(let b=0;b{R=b()};let re;const fe=Pm();if(this.backendTimer.timerAvailable())re=this.backendTimer.time(q);else{q();for(const be of R)be.dataSync();re=Promise.resolve({kernelMs:Pm()-fe})}if(co().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let be=0;be{Ite(je,Pe.dtype,e)})}return{kernelName:e,outputs:R,inputs:n,timeMs:re.then(be=>be.kernelMs),extraInfo:re.then(be=>be.getExtraProfileInfo!=null?be.getExtraProfileInfo():"")}}logKernelProfile(e){const{kernelName:n,outputs:b,timeMs:R,inputs:q,extraInfo:re}=e;b.forEach(fe=>{Promise.all([fe.data(),R,re]).then(he=>{this.logger.logKernelProfile(n,fe,he[0],he[1],q,he[2])})})}}function Ite(u,e,n){if(e!=="float32")return!1;for(let b=0;b0?zt:""} `}}console.log(`%c${he} %c${fe} %c${be}D ${je} %c${Pe} %c${We} %c${re}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}function Rte(u,e,n){const b={},R={};for(let he=0;heb[zt.id]=!0),ft=!0,R[be.id]=!0;break}if(ft)break}}const q={};q[n.id]=!0;const re={};for(let he=u.length-1;he>=0;he--){const be=u[he],Pe=be.inputs;for(let je=0;je=0;R--){const q=e[R],re=[];if(q.outputs.forEach(he=>{const be=u[he.id];be!=null?re.push(be):re.push(null)}),q.gradient==null)throw new Error(`Cannot compute gradient: gradient function not found for ${q.kernelName}.`);const fe=q.gradient(re);for(const he in q.inputs){if(!(he in fe))throw new Error(`Cannot backprop through input ${he}. Available gradients found: ${Object.keys(fe)}.`);const be=n(()=>fe[he]());if(be.dtype!=="float32")throw new Error(`Error in gradient for op ${q.kernelName}. The gradient of input ${he} must have 'float32' dtype, but has '${be.dtype}'`);const Pe=q.inputs[he];if(!$f(be.shape,Pe.shape))throw new Error(`Error in gradient for op ${q.kernelName}. The gradient of input '${he}' has shape '${be.shape}', which does not match the shape of the input '${Pe.shape}'`);if(u[Pe.id]==null)u[Pe.id]=be;else{const je=u[Pe.id];u[Pe.id]=b(je,be),je.dispose()}}}}const L9=20,$E=3,Q4=7;function Pte(u,e,n,b){const R=Zl(e),q=zte(u,e,n,R),re=e.length,fe=oL(u,e,n,R,q),he=["Tensor"];return b&&(he.push(` dtype: ${n}`),he.push(` rank: ${re}`),he.push(` shape: [${e}]`),he.push(" values:")),he.push(fe.map(be=>" "+be).join(` +`)),he.join(` +`)}function zte(u,e,n,b){const R=xo(e),q=b[b.length-1],re=new Array(q).fill(0),fe=e.length,he=n==="complex64"?HE(u):u;if(fe>1)for(let be=0;beL9){const Ft=$E*re;let jt=Array.from(u.slice(0,Ft)),Re=Array.from(u.slice((fe-$E)*re,fe*re));return n==="complex64"&&(jt=HE(jt),Re=HE(Re)),["["+jt.map((Lr,Cr)=>qE(Lr,R[Cr],n)).join(", ")+", ..., "+Re.map((Lr,Cr)=>qE(Lr,R[fe-$E+Cr],n)).join(", ")+"]"]}return["["+(n==="complex64"?HE(u):Array.from(u)).map((Ft,jt)=>qE(Ft,R[jt],n)).join(", ")+"]"]}const be=e.slice(1),Pe=b.slice(1),je=b[0]*re,We=[];if(fe>L9){for(let zt=0;zt<$E;zt++){const Ft=zt*je,jt=Ft+je;We.push(...oL(u.slice(Ft,jt),be,n,Pe,R,!1))}We.push("...");for(let zt=fe-$E;zt0?We[0]+ft:"");for(let zt=1;zt`Length of values '${R}' does not match the size inferred by the shape '${this.size}'.`)}if(n==="complex64")throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=b||np(n,this.size),this.strides=Zl(e)}set(e,...n){n.length===0&&(n=[0]),Jn(n.length===this.rank,()=>`The number of provided coordinates (${n.length}) must match the rank (${this.rank})`);const b=this.locToIndex(n);this.values[b]=e}get(...e){e.length===0&&(e=[0]);let n=0;for(const R of e){if(R<0||R>=this.shape[n]){const q=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(q)}n++}let b=e[e.length-1];for(let R=0;Rcb(b))}catch{throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),ty().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=ty().readSync(this.dataId);if(this.dtype==="string")try{return e.map(n=>cb(n))}catch{throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await ty().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),ty().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return _A.print(this,e)}clone(){return this.throwIfDisposed(),_A.clone(this)}toString(e=!1){const n=this.dataSync();return Pte(n,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),_A.cast(this,e)}variable(e=!0,n,b){return this.throwIfDisposed(),ty().makeVariable(this,e,n,b)}}Object.defineProperty($p,Symbol.hasInstance,{value:u=>!!u&&u.data!=null&&u.dataSync!=null&&u.throwIfDisposed!=null});function go(){return f8("Tensor",()=>$p)}go();class xL extends $p{constructor(e,n,b,R){super(e.shape,e.dtype,e.dataId,R),this.trainable=n,this.name=b}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!$f(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);ty().disposeTensor(this),this.dataId=e.dataId,ty().incRef(this,null)}dispose(){ty().disposeVariable(this),this.isDisposedInternal=!0}}Object.defineProperty(xL,Symbol.hasInstance,{value:u=>u instanceof $p&&u.assign!=null&&u.assign instanceof Function});var R9;(function(u){u.R0="R0",u.R1="R1",u.R2="R2",u.R3="R3",u.R4="R4",u.R5="R5",u.R6="R6"})(R9||(R9={}));var Iz;(function(u){u.float32="float32",u.int32="int32",u.bool="int32",u.complex64="complex64"})(Iz||(Iz={}));var Lz;(function(u){u.float32="float32",u.int32="int32",u.bool="bool",u.complex64="complex64"})(Lz||(Lz={}));var Rz;(function(u){u.float32="float32",u.int32="float32",u.bool="float32",u.complex64="complex64"})(Rz||(Rz={}));var Dz;(function(u){u.float32="complex64",u.int32="complex64",u.bool="complex64",u.complex64="complex64"})(Dz||(Dz={}));const Fte={float32:Rz,int32:Iz,bool:Lz,complex64:Dz};function sg(u,e){if(u==="string"||e==="string"){if(u==="string"&&e==="string")return"string";throw new Error(`Can not upcast ${u} with ${e}`)}return Fte[u][e]}function Q8(u){return sg(u,"int32")}function n$(u){return u!=null&&typeof u=="object"&&"texture"in u&&u.texture instanceof WebGLTexture}function a$(u){return typeof GPUBuffer<"u"&&u!=null&&typeof u=="object"&&"buffer"in u&&u.buffer instanceof GPUBuffer}function ap(u,e){if(u.dtype===e.dtype)return[u,e];const n=sg(u.dtype,e.dtype);return[u.cast(n),e.cast(n)]}function i$(u){const e=[];return o$(u,e,new Set),e}function o$(u,e,n){if(u==null)return;if(u instanceof $p){e.push(u);return}if(!Bte(u))return;const b=u;for(const R in b){const q=b[R];n.has(q)||(n.add(q),o$(q,e,n))}}function Bte(u){return Array.isArray(u)||typeof u=="object"}function ez(u){return u.kernelName!=null}class D9{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(e=>e.name)))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class kA{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new D9}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;const e=this.getSortedBackends();for(let n=0;n{n.setupFunc!=null&&n.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){k9(e).forEach(b=>{b.disposeFunc!=null&&b.disposeFunc(this.registry[e])})}initializeBackend(e){const n=this.registryFactory[e];if(n==null)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const b=n.factory();if(b&&!(b instanceof o8)&&typeof b.then=="function"){const R=++this.pendingBackendInitId,q=b.then(re=>R(Rthis.registryFactory[n].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let n=0;nthis.startScope(b),()=>this.endScope(R),()=>(R=n(),R instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),R))}scopedRun(e,n,b){e();try{const R=b();return n(),R}catch(R){throw n(),R}}nextTensorId(){return kA.nextTensorId++}nextVariableId(){return kA.nextVariableId++}clone(e){const n=wi.runKernel(DC,{x:e}),b={x:e},R=re=>({x:()=>{const fe="float32",he={x:re},be={dtype:fe};return wi.runKernel(xC,he,be)}}),q=[];return this.addTapeNode(this.state.activeScope.name,b,[n],R,q,{}),n}runKernel(e,n,b){if(this.backendName==null&&this.backend,!(E9(e,this.backendName)!=null))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:n,attrs:b})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,n,b){const R=this.backend.numDataIds();let q=0;b.forEach(he=>{q+=he.dtype==="complex64"?3:1});const re=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],fe=R-n-q-re;if(fe>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${fe} data ids) after running '${e}'`)}runKernelFunc(e){let n,b=[];const R=this.isTapeOn(),q=this.state.numBytes,re=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let fe;this.backendName==null&&this.backend;let he;const be=ez(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(ez(e)){const{kernelName:xt,inputs:zt,attrs:Ft}=e;this.backendName==null&&this.backend;const jt=E9(xt,this.backendName);Jn(jt!=null,()=>`Cannot find registered kernel '${xt}' for backend '${this.backendName}'`),fe=()=>{const Re=this.backend.numDataIds();he=jt.kernelFunc({inputs:zt,attrs:Ft,backend:this.backend});const Lr=Array.isArray(he)?he:[he];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(xt,Re,Lr);const Cr=Lr.map(Gr=>Gr.rank!=null?Gr:this.makeTensorFromTensorInfo(Gr));if(R){const Gr=this.getTensorsForGradient(xt,zt,Cr);b=this.saveTensorsForBackwardMode(Gr)}return Cr}}else{const{forwardFunc:xt}=e,zt=Ft=>{R&&(b=Ft.map(jt=>this.keep(this.clone(jt))))};fe=()=>{const Ft=this.backend.numDataIds();he=this.tidy(()=>xt(this.backend,zt));const jt=Array.isArray(he)?he:[he];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(be,Ft,jt),jt}}const{inputs:Pe,attrs:je}=e,We=ez(e)?null:e.backwardsFunc;let ft;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?n=fe():(ft=this.profiler.profileKernel(be,Pe,()=>fe()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(ft),n=ft.outputs)}),R&&this.addTapeNode(be,Pe,n,We,b,je),this.state.profiling&&this.state.activeProfile.kernels.push({name:be,bytesAdded:this.state.numBytes-q,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-re,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(Pe).map(xt=>Pe[xt]!=null?Pe[xt].shape:null),outputShapes:n.map(xt=>xt.shape),kernelTimeMs:ft.timeMs,extraInfo:ft.extraInfo}),Array.isArray(he)?n:n[0]}saveTensorsForBackwardMode(e){return e.map(b=>this.keep(this.clone(b)))}getTensorsForGradient(e,n,b){const R=C9(e);if(R!=null){const q=R.inputsToSave||[],re=R.outputsToSave||[];let fe;R.saveAllInputs?(Jn(Array.isArray(n),()=>"saveAllInputs is true, expected inputs to be an array."),fe=Object.keys(n).map(be=>n[be])):fe=q.map(be=>n[be]);const he=b.filter((be,Pe)=>re[Pe]);return fe.concat(he)}return[]}makeTensor(e,n,b,R){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");b=b||"float32",R=R||this.backend;let q=e;b==="string"&&hC(e[0])&&(q=e.map(he=>ob(he)));const re=R.write(q,n,b),fe=new $p(n,b,re,this.nextTensorId());if(this.trackTensor(fe,R),b==="string"){const he=this.state.tensorInfo.get(re),be=ste(q);this.state.numBytes+=be-he.bytes,he.bytes=be}return fe}makeTensorFromDataId(e,n,b,R){b=b||"float32";const q={dataId:e,shape:n,dtype:b};return this.makeTensorFromTensorInfo(q,R)}makeTensorFromTensorInfo(e,n){const{dataId:b,shape:R,dtype:q}=e,re=new $p(R,q,b,this.nextTensorId());return this.trackTensor(re,n),re}makeVariable(e,n=!0,b,R){b=b||this.nextVariableId().toString(),R!=null&&R!==e.dtype&&(e=e.cast(R));const q=new xL(e,n,b,this.nextTensorId());if(this.state.registeredVariables[q.name]!=null)throw new Error(`Variable with name ${q.name} was already registered`);return this.state.registeredVariables[q.name]=q,this.incRef(q,this.backend),q}trackTensor(e,n){this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++;let b=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(b=e.size*mL(e.dtype)),this.state.numBytes+=b,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:n||this.backend,dtype:e.dtype,shape:e.shape,bytes:b})),e instanceof xL||this.track(e)}incRef(e,n){this.trackTensor(e,n),this.backend.incRef(e.dataId)}removeDataId(e,n){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===n&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const n=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,e.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=n.bytes),e.dtype!=="complex64"&&e.dtype!=="string"){const b=e.size*mL(e.dtype);this.state.numBytes-=b}n.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,n.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const n=this.state.registeredVariables[e];this.disposeVariable(n)}}disposeVariable(e){this.disposeTensor(e),this.state.registeredVariables[e.name]!=null&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,e.reasons==null&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const n=this.state.numBytes,b=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(R=>R.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-n,this.state.activeProfile.newTensors=this.state.numTensors-b;for(const R of this.state.activeProfile.kernels)R.kernelTimeMs=await R.kernelTimeMs,R.extraInfo=await R.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,n,b,R,q,re){const fe={id:this.state.nextTapeNodeId++,kernelName:e,inputs:n,outputs:b,saved:q},he=C9(e);he!=null&&(R=he.gradFunc),R!=null&&(fe.gradient=be=>(be=be.map((Pe,je)=>{if(Pe==null){const We=b[je],ft=Nv(We.size,We.dtype);return this.makeTensor(ft,We.shape,We.dtype)}return Pe}),R(be.length>1?be:be[0],q,re))),this.state.activeTape.push(fe)}keep(e){return e.kept=!0,e}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const n={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(n.name=e),this.state.scopeStack.push(n),this.state.activeScope=n}endScope(e){const n=i$(e),b=new Set(n.map(q=>q.id));for(let q=0;q{!q.kept&&q.scopeId===R.id&&this.track(q)})}gradients(e,n,b,R=!1){if(Jn(n.length>0,()=>"gradients() received an empty list of xs."),b!=null&&b.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${b.dtype}'`);const q=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));Jn(q instanceof $p,()=>"The result y returned by f() must be a tensor.");const re=Rte(this.state.activeTape,n,q);if(!R&&re.length===0&&n.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{const fe={};fe[q.id]=b??Ute(q.shape),Dte(fe,re,be=>this.tidy(be),$te);const he=n.map(be=>fe[be.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(be=>{for(const Pe of be.saved)Pe.dispose()}),this.state.activeTape=null),{value:q,grads:he}})}customGrad(e){return Jn(Az(e),()=>"The f passed in customGrad(f) must be a function."),(...n)=>{Jn(n.every(fe=>fe instanceof $p),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let b;const R={};n.forEach((fe,he)=>{R[he]=fe});const q=(fe,he)=>(b=e(...n,he),Jn(b.value instanceof $p,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),Jn(Az(b.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),b.value),re=(fe,he)=>{const be=b.gradFunc(fe,he),Pe=Array.isArray(be)?be:[be];Jn(Pe.length===n.length,()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."),Jn(Pe.every(We=>We instanceof $p),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");const je={};return Pe.forEach((We,ft)=>{je[ft]=()=>We}),je};return this.runKernelFunc({forwardFunc:q,backwardsFunc:re,inputs:R})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,n){return this.state.tensorInfo.get(e).backend.readToGPU(e,n)}async time(e){const n=Pm(),b=await this.backend.time(e);return b.wallMs=Pm()-n,b}track(e){return this.state.activeScope!=null&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new D9;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}kA.nextTensorId=0;kA.nextVariableId=0;function Ute(u){const e=u8(xo(u),"float32");return wi.makeTensor(e,u,"float32")}function s$(){const u=CU();if(u._tfengine==null){const e=new cte(u);u._tfengine=new kA(e)}return pte(u._tfengine.ENV),Nte(()=>u._tfengine),u._tfengine}const wi=s$();function $te(u,e){const n={a:u,b:e};return wi.runKernel(UA,n)}function Vte(){return typeof navigator<"u"&&navigator!=null}function l$(u){if(u||Vte()){if(u||(u=navigator),u.product==="ReactNative")return!0;const e=u.userAgent||u.vendor||(typeof window<"u"?window.opera:"");if(!e){const n=u;return n.userAgentData&&n.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|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(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))}return!1}function u$(){return typeof window<"u"&&window.document!=null||typeof WorkerGlobalScope<"u"}const Bm=co();Bm.registerFlag("DEBUG",()=>!1,u=>{u&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")});Bm.registerFlag("IS_BROWSER",()=>u$());Bm.registerFlag("IS_NODE",()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u");Bm.registerFlag("IS_CHROME",()=>typeof navigator<"u"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));Bm.registerFlag("IS_SAFARI",()=>typeof navigator<"u"&&navigator!=null&&navigator.userAgent!=null&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor));Bm.registerFlag("PROD",()=>!1);Bm.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>Bm.getBool("DEBUG"));Bm.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);Bm.registerFlag("IS_TEST",()=>!1);Bm.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>Bm.getBool("DEBUG"));Bm.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);Bm.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",()=>!1);Bm.registerFlag("USE_SETTIMEOUTCUSTOM",()=>!1);function WR(u,e){let n=u;if(y0(u))return e==="string"?[]:[u.length];if(n$(u)){const R=u.channels||"RGBA";return[u.height,u.width*R.length]}else if(a$(u))return[u.buffer.size/(e==null?4:mL(e))];if(!Array.isArray(u))return[];const b=[];for(;Array.isArray(n)||y0(n)&&e!=="string";)b.push(n.length),n=n[0];return Array.isArray(u)&&co().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&c$(u,b,[]),b}function c$(u,e,n){if(n=n||[],!Array.isArray(u)&&!y0(u)){Jn(e.length===0,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`);return}Jn(e.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${u.length} elements`),Jn(u.length===e[0],()=>`Element arr[${n.join("][")}] should have ${e[0]} elements, but has ${u.length} elements`);const b=e.slice(1);for(let R=0;R=0&&(R=b),P9(b,R,e,n),u==null||!y0(u)&&!Array.isArray(u)&&typeof u!="number"&&typeof u!="boolean"&&typeof u!="string"){const he=u==null?"null":u.constructor.name;throw new Error(`Argument '${e}' passed to '${n}' must be a Tensor or TensorLike, but got '${he}'`)}const q=WR(u,R);!y0(u)&&!Array.isArray(u)&&(u=[u]);const fe=R!=="string"?D2(u,R):_2(u,[],!0);return wi.makeTensor(fe,q,R)}function f$(u,e,n,b="numeric"){if(!Array.isArray(u))throw new Error(`Argument ${e} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return u.map((q,re)=>ya(q,`${e}[${re}]`,n,b))}const jte="__op";function Ci(u){const e=Object.keys(u);if(e.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${e.length} keys.`);let n=e[0];const b=u[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n=n+jte;const R=(...q)=>{wi.startScope(n);try{const re=b(...q);return c8(re)&&console.error("Cannot return a Promise inside of tidy."),wi.endScope(re),re}catch(re){throw wi.endScope(null),re}};return Object.defineProperty(R,"name",{value:n,configurable:!0}),R}function Gte(u,e){const n=ya(u,"real","complex"),b=ya(e,"imag","complex");b0(n.shape,b.shape,`real and imag shapes, ${n.shape} and ${b.shape}, must match in call to tf.complex().`);const R={real:n,imag:b};return wi.runKernel(_8,R)}const MA=Ci({complex_:Gte});function XR(u,e,n,b){if(b==null)b=FA(u);else if(b==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(a$(u)||n$(u)){if(b!=="float32"&&b!=="int32")throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${b}.`);return wi.backend.createTensorFromGPUData(u,e||n,b)}if(!y0(u)&&!Array.isArray(u)&&typeof u!="number"&&typeof u!="boolean"&&typeof u!="string")throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(e!=null){A_(e);const R=xo(e),q=xo(n);Jn(R===q,()=>`Based on the provided shape, [${e}], the tensor should have ${R} values but has ${q}`);for(let re=0;re`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${e}). `)}}return!y0(u)&&!Array.isArray(u)&&(u=[u]),e=e||n,u=b!=="string"?D2(u,b):_2(u,[],!0),wi.makeTensor(u,e,b)}function h$(u,e,n){const b=WR(u,n);return XR(u,e,b,n)}class $A{static join(e){return new $A(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,e==null||(e instanceof Array||(e=[e]),e=e.map(b=>y0(b)?b.buffer:b),e.length===0))return;this.bufferUniformSize=e[0].byteLength;let n=0;for(let b=0;b=this.byteLength)return-1;if(this.bufferUniformSize!=null)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function n(R){return e=R.end?1:0}if(n(this.shards[this.previousShardIndex])===0)return this.previousShardIndex;const b=qte(this.shards,n);return b===-1?-1:(this.previousShardIndex=b,this.previousShardIndex)}}function qte(u,e){let n=0,b=u.length;for(;n<=b;){const R=Math.floor((b-n)/2)+n,q=e(u[R]);if(q===0)return R;q<0?b=R:n=R+1}return-1}function a1(){return wi}function z9(){return wi.memory()}function Zi(u,e){return wi.tidy(u,e)}function zc(u){i$(u).forEach(n=>n.dispose())}function f1(u){return wi.keep(u)}function d$(u,e,n=1){return wi.registerBackend(u,e,n)}function Hte(){return wi.backend}const N9=4;async function O9(u,e){const n=[],b=[],R=Array.isArray(u)?u.map(re=>re.name):Object.keys(u);for(let re=0;re{const We=await he.bytes(),ft=We.reduce((Ft,jt)=>Ft+jt.length,0)+N9*We.length,xt=new Uint8Array(ft);let zt=0;for(let Ft=0;Ft{if(e+=q.byteLength,n.push(q.byteLength===q.buffer.byteLength?q:new q.constructor(q)),!(q instanceof Float32Array||q instanceof Int32Array||q instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${q.constructor.name}`)});const b=new Uint8Array(e);let R=0;return n.forEach(q=>{b.set(new Uint8Array(q.buffer),R),R+=q.byteLength}),b.buffer}const eN=typeof Buffer<"u"&&(typeof Blob>"u"||typeof atob>"u"||typeof btoa>"u");function F9(u){return eN?Buffer.byteLength(u,"utf8"):new Blob([u]).size}function Xte(u){if(eN)return Buffer.from(u).toString("base64");const e=new Uint8Array(u);let n="";for(let b=0,R=e.length;b{const fe=re(e,b);fe!==null&&R.push(fe)}),R}}const Kte=u=>dm.getSaveHandlers(u);const Pz="tensorflowjs",zz=1,d2="models_store",rb="model_info_store";function v$(){if(!co().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const u=typeof window>"u"?self:window,e=u.indexedDB||u.mozIndexedDB||u.webkitIndexedDB||u.msIndexedDB||u.shimIndexedDB;if(e==null)throw new Error("The current browser does not appear to support IndexedDB.");return e}function Nz(u){const e=u.result;e.createObjectStore(d2,{keyPath:"modelPath"}),e.createObjectStore(rb,{keyPath:"modelPath"})}class x2{constructor(e){if(this.indexedDB=v$(),e==null||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,n){return new Promise((b,R)=>{const q=this.indexedDB.open(Pz,zz);q.onupgradeneeded=()=>Nz(q),q.onsuccess=()=>{const re=q.result;if(n==null){const fe=re.transaction(d2,"readonly"),be=fe.objectStore(d2).get(this.modelPath);be.onsuccess=()=>{if(be.result==null)return re.close(),R(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));b(be.result.modelArtifacts)},be.onerror=Pe=>(re.close(),R(be.error)),fe.oncomplete=()=>re.close()}else{n.weightData=$A.join(n.weightData);const fe=p$(n),he=re.transaction(rb,"readwrite");let be=he.objectStore(rb),Pe;try{Pe=be.put({modelPath:this.modelPath,modelArtifactsInfo:fe})}catch(We){return R(We)}let je;Pe.onsuccess=()=>{je=re.transaction(d2,"readwrite");const We=je.objectStore(d2);let ft;try{ft=We.put({modelPath:this.modelPath,modelArtifacts:n,modelArtifactsInfo:fe})}catch(xt){return R(xt)}ft.onsuccess=()=>b({modelArtifactsInfo:fe}),ft.onerror=xt=>{be=he.objectStore(rb);const zt=be.delete(this.modelPath);zt.onsuccess=()=>(re.close(),R(ft.error)),zt.onerror=Ft=>(re.close(),R(ft.error))}},Pe.onerror=We=>(re.close(),R(Pe.error)),he.oncomplete=()=>{je==null?re.close():je.oncomplete=()=>re.close()}}},q.onerror=re=>R(q.error)})}}x2.URL_SCHEME="indexeddb://";const m$=u=>co().getBool("IS_BROWSER")&&!Array.isArray(u)&&u.startsWith(x2.URL_SCHEME)?Jte(u.slice(x2.URL_SCHEME.length)):null;dm.registerSaveRouter(m$);dm.registerLoadRouter(m$);function Jte(u){return new x2(u)}function Qte(u){return u.startsWith(x2.URL_SCHEME)?u.slice(x2.URL_SCHEME.length):u}class ere{constructor(){this.indexedDB=v$()}async listModels(){return new Promise((e,n)=>{const b=this.indexedDB.open(Pz,zz);b.onupgradeneeded=()=>Nz(b),b.onsuccess=()=>{const R=b.result,q=R.transaction(rb,"readonly"),fe=q.objectStore(rb).getAll();fe.onsuccess=()=>{const he={};for(const be of fe.result)he[be.modelPath]=be.modelArtifactsInfo;e(he)},fe.onerror=he=>(R.close(),n(fe.error)),q.oncomplete=()=>R.close()},b.onerror=R=>n(b.error)})}async removeModel(e){return e=Qte(e),new Promise((n,b)=>{const R=this.indexedDB.open(Pz,zz);R.onupgradeneeded=()=>Nz(R),R.onsuccess=()=>{const q=R.result,re=q.transaction(rb,"readwrite"),fe=re.objectStore(rb),he=fe.get(e);let be;he.onsuccess=()=>{if(he.result==null)return q.close(),b(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const Pe=fe.delete(e),je=()=>{be=q.transaction(d2,"readwrite");const ft=be.objectStore(d2).delete(e);ft.onsuccess=()=>n(he.result.modelArtifactsInfo),ft.onerror=xt=>b(he.error)};Pe.onsuccess=je,Pe.onerror=We=>(je(),q.close(),b(he.error))}},he.onerror=Pe=>(q.close(),b(he.error)),re.oncomplete=()=>{be==null?q.close():be.oncomplete=()=>q.close()}},R.onerror=q=>b(R.error)})}}const g_="/",xA="tensorflowjs_models",g$="info",tre="model_topology",rre="weight_specs",nre="weight_data",are="model_metadata";function y$(u){return{info:[xA,u,g$].join(g_),topology:[xA,u,tre].join(g_),weightSpecs:[xA,u,rre].join(g_),weightData:[xA,u,nre].join(g_),modelMetadata:[xA,u,are].join(g_)}}function _$(u){for(const e of Object.values(u))window.localStorage.removeItem(e)}function ire(u){const e=u.split(g_);if(e.length<3)throw new Error(`Invalid key format: ${u}`);return e.slice(1,e.length-1).join(g_)}function ore(u){return u.startsWith(b2.URL_SCHEME)?u.slice(b2.URL_SCHEME.length):u}class b2{constructor(e){if(!co().getBool("IS_BROWSER")||typeof window>"u"||typeof window.localStorage>"u")throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,e==null||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=y$(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const n=JSON.stringify(e.modelTopology),b=JSON.stringify(e.weightSpecs),R=p$(e),q=$A.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(R)),this.LS.setItem(this.keys.topology,n),this.LS.setItem(this.keys.weightSpecs,b),this.LS.setItem(this.keys.weightData,Xte(q));const re={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:e.signature!=null?e.signature:void 0,userDefinedMetadata:e.userDefinedMetadata!=null?e.userDefinedMetadata:void 0,modelInitializer:e.modelInitializer!=null?e.modelInitializer:void 0,initializerSignature:e.initializerSignature!=null?e.initializerSignature:void 0,trainingConfig:e.trainingConfig!=null?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(re)),{modelArtifactsInfo:R}}catch{throw _$(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${R.modelTopologyBytes}, weightSpecsBytes=${R.weightSpecsBytes}, weightDataBytes=${R.weightDataBytes}.`)}}}async load(){const e=JSON.parse(this.LS.getItem(this.keys.info));if(e==null)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if(e.modelTopologyType!=="JSON")throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");const n={},b=JSON.parse(this.LS.getItem(this.keys.topology));if(b==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);n.modelTopology=b;const R=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(R==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);n.weightSpecs=R;const q=this.LS.getItem(this.keys.modelMetadata);if(q!=null){const fe=JSON.parse(q);n.format=fe.format,n.generatedBy=fe.generatedBy,n.convertedBy=fe.convertedBy,fe.signature!=null&&(n.signature=fe.signature),fe.userDefinedMetadata!=null&&(n.userDefinedMetadata=fe.userDefinedMetadata),fe.modelInitializer!=null&&(n.modelInitializer=fe.modelInitializer),fe.initializerSignature!=null&&(n.initializerSignature=fe.initializerSignature),fe.trainingConfig!=null&&(n.trainingConfig=fe.trainingConfig)}const re=this.LS.getItem(this.keys.weightData);if(re==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return n.weightData=Yte(re),n}}b2.URL_SCHEME="localstorage://";const x$=u=>co().getBool("IS_BROWSER")&&!Array.isArray(u)&&u.startsWith(b2.URL_SCHEME)?sre(u.slice(b2.URL_SCHEME.length)):null;dm.registerSaveRouter(x$);dm.registerLoadRouter(x$);function sre(u){return new b2(u)}class lre{constructor(){Jn(co().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),Jn(typeof window>"u"||typeof window.localStorage<"u",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){const e={},n=xA+g_,b=g_+g$;for(let R=0;R"scheme must not be undefined or null."),e.endsWith(B9)&&(e=e.slice(0,e.indexOf(B9))),Jn(e.length>0,()=>"scheme must not be an empty string.");const b=i1.getInstance();Jn(b.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),b.managers[e]=n}static getManager(e){const n=i1.getInstance().managers[e];if(n==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return n}static getSchemes(){return Object.keys(i1.getInstance().managers)}}class ure{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(e,n){return fetch(e,n)}now(){return performance.now()}encode(e,n){if(n!=="utf-8"&&n!=="utf8")throw new Error(`Browser's encoder only supports utf-8, but got ${n}`);return this.textEncoder==null&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,n){return new TextDecoder(n).decode(e)}setTimeoutCustom(e,n){if(typeof window>"u"||!co().getBool("USE_SETTIMEOUTCUSTOM")){setTimeout(e,n);return}this.functionRefs.push(e),setTimeout(()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")},n),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",b=>{if(b.source===window&&b.data.name===this.messageName){b.stopPropagation();const R=this.functionRefs[b.data.index];R(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}},!0))}isTypedArray(e){return KU(e)}}if(co().get("IS_BROWSER")){co().setPlatform("browser",new ure);try{i1.registerManager(b2.URL_SCHEME,new lre)}catch{}try{i1.registerManager(x2.URL_SCHEME,new ere)}catch{}}const cre={importFetch:()=>require("node-fetch")};let tz;class fre{constructor(){this.util=require("util"),this.textEncoder=new this.util.TextEncoder}fetch(e,n){return co().global.fetch!=null?co().global.fetch(e,n):(tz==null&&(tz=cre.importFetch()),tz(e,n))}now(){const e=process.hrtime();return e[0]*1e3+e[1]/1e6}encode(e,n){if(n!=="utf-8"&&n!=="utf8")throw new Error(`Node built-in encoder only supports utf-8, but got ${n}`);return this.textEncoder.encode(e)}decode(e,n){return e.length===0?"":new this.util.TextDecoder(n).decode(e)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}}co().get("IS_NODE")&&!co().get("IS_BROWSER")&&co().setPlatform("node",new fre);function Tc(u,e="float32",n){return e=e||"float32",A_(u),new Sv(u,e,n)}function hre(u,e){const n=ya(u,"x","cast");if(!ote(e))throw new Error(`Failed to cast to unknown dtype ${e}`);if(e==="string"&&n.dtype!=="string"||e!=="string"&&n.dtype==="string")throw new Error("Only strings can be casted to strings");const b={x:n},R={dtype:e};return wi.runKernel(xC,b,R)}const Gs=Ci({cast_:hre});function dre(u){const n={x:ya(u,"x","clone","string_or_numeric")};return wi.runKernel(DC,n)}const m2=Ci({clone_:dre});function pre(u,e=!1){console.log(u.toString(e))}s$();const vre={buffer:Tc,cast:Gs,clone:m2,print:pre};Ote(vre);function mre(u,e){let n=ya(u,"a","add"),b=ya(e,"b","add");[n,b]=ap(n,b);const R={a:n,b};return wi.runKernel(UA,R)}const Ko=Ci({add_:mre});function gre(u,e){let n=ya(u,"a","floorDiv"),b=ya(e,"b","floorDiv");[n,b]=ap(n,b);const R={a:n,b};return wi.runKernel(LC,R)}const b$=Ci({floorDiv_:gre});function yre(u,e){let n=ya(u,"a","div"),b=ya(e,"b","div");if([n,b]=ap(n,b),n.dtype==="int32"&&b.dtype==="int32")return b$(n,b);const R={a:n,b},q={};return wi.runKernel(SC,R,q)}const Vl=Ci({div_:yre});function _re(u,e){let n=ya(u,"a","mul"),b=ya(e,"b","mul");[n,b]=ap(n,b);const R={a:n,b};return wi.runKernel(VC,R)}const si=Ci({mul_:_re});function xre(u){const e=ya(u,"x","abs");if(e.dtype==="complex64"){const n={x:e};return wi.runKernel(QL,n)}else{const n={x:e};return wi.runKernel(HL,n)}}const iv=Ci({abs_:xre});function bre(u){const n={x:ya(u,"x","acos")};return wi.runKernel(dC,n)}const wre=Ci({acos_:bre});function Tre(u){const n={x:ya(u,"x","acosh")};return wi.runKernel(pC,n)}const Are=Ci({acosh_:Tre});function Sre(u,e=null,n=!1){const R={x:ya(u,"x","all","bool")},q={axis:e,keepDims:n};return wi.runKernel(d8,R,q)}const w$=Ci({all_:Sre});function Ere(u,e=null,n=!1){const R={x:ya(u,"x","any","bool")},q={axis:e,keepDims:n};return wi.runKernel(p8,R,q)}const Oz=Ci({any_:Ere});function Cre(u,e=0){const b={x:ya(u,"x","argMax")},R={axis:e};return wi.runKernel(WL,b,R)}const QE=Ci({argMax_:Cre});function kre(u,e=0){const b={x:ya(u,"x","argMin")},R={axis:e};return wi.runKernel(XL,b,R)}const Mre=Ci({argMin_:kre});function Ire(u){const n={x:ya(u,"x","asin")};return wi.runKernel(vC,n)}const Lre=Ci({asin_:Ire});function Rre(u){const n={x:ya(u,"x","asinh")};return wi.runKernel(mC,n)}const Dre=Ci({asinh_:Rre});function Pre(u){const n={x:ya(u,"x","atan")};return wi.runKernel(gC,n)}const zre=Ci({atan_:Pre});function Nre(u,e){let n=ya(u,"a","atan2"),b=ya(e,"b","atan2");[n,b]=ap(n,b);const R={a:n,b};return wi.runKernel(_C,R)}const Ore=Ci({atan2_:Nre});function Fre(u){const n={x:ya(u,"x","atanh")};return wi.runKernel(yC,n)}const Bre=Ci({atanh_:Fre});function lk(u,e,n,b,R="NHWC",q){const re=u[3],fe=[...e,re],he=E_(R);return Ev(u,fe,n,q,b,null,null,he)}function w0(u,e,n,b,R,q,re="channelsLast"){const[fe,he]=eC(e);let be;if(re==="channelsLast")be=[fe,he,u[3],u[3]];else if(re==="channelsFirst")be=[fe,he,u[1],u[1]];else throw new Error(`Unknown dataFormat ${re}`);return Ev(u,be,n,b,R,q,!1,re)}function S_(u,e,n,b,R,q,re="NDHWC"){const[fe,he,be]=Fz(e);let Pe,je;if(re==="NDHWC")je="channelsLast",Pe=[fe,he,be,u[4],u[4]];else if(re==="NCDHW")je="channelsFirst",Pe=[fe,he,be,u[1],u[1]];else throw new Error(`Unknown dataFormat ${re}`);return yb(u,Pe,n,b,R,!1,je,q)}function Ev(u,e,n,b,R,q,re=!1,fe="channelsLast"){let[he,be,Pe,je]=[-1,-1,-1,-1];if(fe==="channelsLast")[he,be,Pe,je]=u;else if(fe==="channelsFirst")[he,je,be,Pe]=u;else throw new Error(`Unknown dataFormat ${fe}`);const[We,ft,,xt]=e,[zt,Ft]=eC(n),[jt,Re]=eC(b),Lr=AA(We,jt),Cr=AA(ft,Re),{padInfo:Gr,outHeight:yn,outWidth:Pn}=Vre(R,be,Pe,zt,Ft,Lr,Cr,q,fe),Vn=re?xt*je:xt;let un;return fe==="channelsFirst"?un=[he,Vn,yn,Pn]:fe==="channelsLast"&&(un=[he,yn,Pn,Vn]),{batchSize:he,dataFormat:fe,inHeight:be,inWidth:Pe,inChannels:je,outHeight:yn,outWidth:Pn,outChannels:Vn,padInfo:Gr,strideHeight:zt,strideWidth:Ft,filterHeight:We,filterWidth:ft,effectiveFilterHeight:Lr,effectiveFilterWidth:Cr,dilationHeight:jt,dilationWidth:Re,inShape:u,outShape:un,filterShape:e}}function yb(u,e,n,b,R,q=!1,re="channelsLast",fe){let[he,be,Pe,je,We]=[-1,-1,-1,-1,-1];if(re==="channelsLast")[he,be,Pe,je,We]=u;else if(re==="channelsFirst")[he,We,be,Pe,je]=u;else throw new Error(`Unknown dataFormat ${re}`);const[ft,xt,zt,,Ft]=e,[jt,Re,Lr]=Fz(n),[Cr,Gr,yn]=Fz(b),Pn=AA(ft,Cr),Vn=AA(xt,Gr),un=AA(zt,yn),{padInfo:Nn,outDepth:Kr,outHeight:Ma,outWidth:ui}=jre(R,be,Pe,je,jt,Re,Lr,Pn,Vn,un,fe),da=q?Ft*We:Ft;let Ia;return re==="channelsFirst"?Ia=[he,da,Kr,Ma,ui]:re==="channelsLast"&&(Ia=[he,Kr,Ma,ui,da]),{batchSize:he,dataFormat:re,inDepth:be,inHeight:Pe,inWidth:je,inChannels:We,outDepth:Kr,outHeight:Ma,outWidth:ui,outChannels:da,padInfo:Nn,strideDepth:jt,strideHeight:Re,strideWidth:Lr,filterDepth:ft,filterHeight:xt,filterWidth:zt,effectiveFilterDepth:Pn,effectiveFilterHeight:Vn,effectiveFilterWidth:un,dilationDepth:Cr,dilationHeight:Gr,dilationWidth:yn,inShape:u,outShape:Ia,filterShape:e}}function Ure(u,e,n,b,R){b==null&&(b=tN(u,e,n));const q=u[0],re=u[1],fe=tC((q-e+2*b)/n+1,R),he=tC((re-e+2*b)/n+1,R);return[fe,he]}function $re(u,e,n,b,R,q){R==null&&(R=tN(u,e[0],b[0]));const re=[0,0,0,n];for(let fe=0;fe<3;fe++)u[fe]+2*R>=e[fe]&&(re[fe]=tC((u[fe]-e[fe]+2*R)/b[fe]+1,q));return re}function tN(u,e,n,b=1){const R=AA(e,b);return Math.floor((u[0]*(n-1)-n+R)/2)}function eC(u){return typeof u=="number"?[u,u,u]:u.length===2?[u[0],u[1],1]:u}function Fz(u){return typeof u=="number"?[u,u,u]:u}function AA(u,e){return e<=1?u:u+(u-1)*(e-1)}function Vre(u,e,n,b,R,q,re,fe,he){let be,Pe,je;if(typeof u=="number"){be={top:u,bottom:u,left:u,right:u,type:u===0?"VALID":"NUMBER"};const ft=Ure([e,n],q,b,u,fe);Pe=ft[0],je=ft[1]}else if(u==="same"){Pe=Math.ceil(e/b),je=Math.ceil(n/R);const We=Math.max(0,(Pe-1)*b+q-e),ft=Math.max(0,(je-1)*R+re-n),xt=Math.floor(We/2),zt=We-xt,Ft=Math.floor(ft/2),jt=ft-Ft;be={top:xt,bottom:zt,left:Ft,right:jt,type:"SAME"}}else if(u==="valid")be={top:0,bottom:0,left:0,right:0,type:"VALID"},Pe=Math.ceil((e-q+1)/b),je=Math.ceil((n-re+1)/R);else if(typeof u=="object"){const We=he==="channelsLast"?u[1][0]:u[2][0],ft=he==="channelsLast"?u[1][1]:u[2][1],xt=he==="channelsLast"?u[2][0]:u[3][0],zt=he==="channelsLast"?u[2][1]:u[3][1];be={top:We,bottom:ft,left:xt,right:zt,type:We===0&&ft===0&&xt===0&&zt===0?"VALID":"EXPLICIT"},Pe=tC((e-q+We+ft)/b+1,fe),je=tC((n-re+xt+zt)/R+1,fe)}else throw Error(`Unknown padding parameter: ${u}`);return{padInfo:be,outHeight:Pe,outWidth:je}}function jre(u,e,n,b,R,q,re,fe,he,be,Pe){let je,We,ft,xt;if(u==="valid"&&(u=0),typeof u=="number"){je={top:u,bottom:u,left:u,right:u,front:u,back:u,type:u===0?"VALID":"NUMBER"};const Ft=$re([e,n,b,1],[fe,he,be],1,[R,q,re],u,Pe);We=Ft[0],ft=Ft[1],xt=Ft[2]}else if(u==="same"){We=Math.ceil(e/R),ft=Math.ceil(n/q),xt=Math.ceil(b/re);const zt=(We-1)*R+fe-e,Ft=(ft-1)*q+he-n,jt=(xt-1)*re+be-b,Re=Math.floor(zt/2),Lr=zt-Re,Cr=Math.floor(Ft/2),Gr=Ft-Cr,yn=Math.floor(jt/2),Pn=jt-yn;je={top:Cr,bottom:Gr,left:yn,right:Pn,front:Re,back:Lr,type:"SAME"}}else throw Error(`Unknown padding parameter: ${u}`);return{padInfo:je,outDepth:We,outHeight:ft,outWidth:xt}}function tC(u,e){if(!e)return Math.trunc(u);switch(e){case"round":return Math.round(u);case"ceil":return Math.ceil(u);case"floor":return Math.floor(u);default:throw new Error(`Unknown roundingMode ${e}`)}}function w2(u){const[e,n,b]=eC(u);return e===1&&n===1&&b===1}function Fv(u,e){return w2(u)||w2(e)}function T2(u){return eC(u).every(e=>e>0)}function E_(u){if(u==="NHWC")return"channelsLast";if(u==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${u}`)}function $m(u,e,n){if(n!=null){if(typeof e=="string")throw Error(`Error in ${u}: pad must be an integer when using dimRoundingMode ${n} but got pad ${e}.`);if(typeof e=="number")Jn(CA(e),()=>`Error in ${u}: pad must be an integer when using dimRoundingMode ${n} but got pad ${e}.`);else if(typeof e=="object")e.forEach(b=>{b.forEach(R=>{Jn(CA(R),()=>`Error in ${u}: pad must be an integer when using dimRoundingMode ${n} but got pad ${R}.`)})});else throw Error(`Error in ${u}: Unknown padding parameter: ${e}`)}}function Gre(u,e){const b={x:ya(u,"x","reshape","string_or_numeric")},R={shape:e};return wi.runKernel(DR,b,R)}const Pi=Ci({reshape_:Gre});function qre(u,e,n,b,R){const q=ya(u,"x","avgPool","float32"),re=1;Jn(Fv(n,re),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${re}'`);let fe=q,he=!1;q.rank===3&&(he=!0,fe=Pi(q,[1,q.shape[0],q.shape[1],q.shape[2]])),Jn(fe.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${fe.rank}.`),$m("avgPool",b,R);const be={x:fe},Pe={filterSize:e,strides:n,pad:b,dimRoundingMode:R};let je=wi.runKernel(YL,be,Pe);return je=Gs(je,q.dtype),he?Pi(je,[je.shape[1],je.shape[2],je.shape[3]]):je}const rN=Ci({avgPool_:qre});function Hre(u,e,n,b,R,q="NDHWC"){const re=ya(u,"x","avgPool3d","float32");let fe=re,he=!1;re.rank===4&&(he=!0,fe=Pi(re,[1,re.shape[0],re.shape[1],re.shape[2],re.shape[3]])),Jn(fe.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${fe.rank}.`),Jn(q==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${q}`),Jn(typeof n=="number"&&n>0||Array.isArray(n)&&n[0]>0&&n[1]>0&&n[2]>0,()=>`Error in avgPool3d: Stride must be > 0, but got '${n}'`),$m("avgPool3d",b,R);const be={x:fe},Pe={filterSize:e,strides:n,pad:b,dimRoundingMode:R,dataFormat:q};let je=wi.runKernel(ZL,be,Pe);return je=Gs(je,fe.dtype),he?Pi(je,[je.shape[1],je.shape[2],je.shape[3],je.shape[4]]):je}const Wre=Ci({avgPool3d_:Hre});function Xre(u,e=0){Jn(u.length>=1,()=>"Pass at least one tensor to concat");const n=f$(u,"tensors","concat","string_or_numeric");if(n[0].dtype==="complex64"&&n.forEach(q=>{if(q.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor + with dtype ${q.dtype}. `)}),n.length===1)return m2(n[0]);const b=n,R={axis:e};return wi.runKernel(eR,b,R)}const Fm=Ci({concat_:Xre});function Yre(u,e,n=!1,b=!1){let R=ya(u,"a","matMul"),q=ya(e,"b","matMul");[R,q]=ap(R,q);const re={a:R,b:q},fe={transposeA:n,transposeB:b};return wi.runKernel(KL,re,fe)}const Uf=Ci({matMul_:Yre});function Zre(u){const n={x:ya(u,"x","sigmoid","float32")};return wi.runKernel(QC,n)}const VA=Ci({sigmoid_:Zre});function Kre(u,e,n){const b=ya(u,"x","slice","string_or_numeric");if(b.rank===0)throw new Error("Slicing scalar is not possible");const R={x:b},q={begin:e,size:n};return wi.runKernel(FR,R,q)}const Vh=Ci({slice_:Kre});function Jre(u){const n={x:ya(u,"x","tanh","float32")};return wi.runKernel(ik,n)}const YR=Ci({tanh_:Jre});function Qre(u,e,n){const b=ya(u,"x","batchToSpaceND"),R=e.reduce((fe,he)=>fe*he);Jn(b.rank>=1+e.length,()=>`input rank is ${b.rank} but should be > than blockShape.length ${e.length}`),Jn(n.length===e.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length ${e.length}`),Jn(b.shape[0]%R===0,()=>`input tensor batch is ${b.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(" * ")} === ${R}`);const q={x:b},re={blockShape:e,crops:n};return wi.runKernel(JL,q,re)}const nN=Ci({batchToSpaceND_:Qre});function ene(u){let e;return u.rank===0||u.rank===1?e=Pi(u,[1,1,1,u.size]):u.rank===2?e=Pi(u,[1,1,u.shape[0],u.shape[1]]):u.rank===3?e=Pi(u,[1,u.shape[0],u.shape[1],u.shape[2]]):e=u,e}function tne(u,e,n,b,R,q){q==null&&(q=.001);const re=ya(u,"x","batchNorm"),fe=ya(e,"mean","batchNorm"),he=ya(n,"variance","batchNorm");let be;R!=null&&(be=ya(R,"scale","batchNorm"));let Pe;b!=null&&(Pe=ya(b,"offset","batchNorm")),Jn(fe.rank===he.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),Jn(Pe==null||fe.rank===Pe.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),Jn(be==null||fe.rank===be.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");const We={x:ene(re),scale:be,offset:Pe,mean:fe,variance:he},ft={varianceEpsilon:q},xt=wi.runKernel(uR,We,ft);return Pi(xt,re.shape)}const ZR=Ci({batchNorm_:tne});function rne(u,e,n,b,R,q){const re=ya(u,"x","batchNorm"),fe=ya(e,"mean","batchNorm"),he=ya(n,"variance","batchNorm");let be;R!=null&&(be=ya(R,"scale","batchNorm"));let Pe;return b!=null&&(Pe=ya(b,"offset","batchNorm")),Jn(re.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${re.rank}.`),Jn(fe.rank===2||fe.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${fe.rank}.`),Jn(he.rank===2||he.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${he.rank}.`),be!=null&&Jn(be.rank===2||be.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${be.rank}.`),Pe!=null&&Jn(Pe.rank===2||Pe.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${Pe.rank}.`),ZR(re,fe,he,Pe,be,q)}const nne=Ci({batchNorm2d_:rne});function ane(u,e,n,b,R,q){const re=ya(u,"x","batchNorm"),fe=ya(e,"mean","batchNorm"),he=ya(n,"variance","batchNorm");let be;R!=null&&(be=ya(R,"scale","batchNorm"));let Pe;return b!=null&&(Pe=ya(b,"offset","batchNorm")),Jn(re.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${re.rank}.`),Jn(fe.rank===3||fe.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${fe.rank}.`),Jn(he.rank===3||he.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${he.rank}.`),be!=null&&Jn(be.rank===3||be.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${be.rank}.`),Pe!=null&&Jn(Pe.rank===3||Pe.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${Pe.rank}.`),ZR(re,fe,he,Pe,be,q)}const ine=Ci({batchNorm3d_:ane});function one(u,e,n,b,R,q){const re=ya(u,"x","batchNorm"),fe=ya(e,"mean","batchNorm"),he=ya(n,"variance","batchNorm");let be;R!=null&&(be=ya(R,"scale","batchNorm"));let Pe;return b!=null&&(Pe=ya(b,"offset","batchNorm")),Jn(re.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${re.rank}.`),Jn(fe.rank===4||fe.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${fe.rank}.`),Jn(he.rank===4||he.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${he.rank}.`),be!=null&&Jn(be.rank===4||be.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${be.rank}.`),Pe!=null&&Jn(Pe.rank===4||Pe.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${Pe.rank}.`),ZR(re,fe,he,Pe,be,q)}const sne=Ci({batchNorm4d_:one});function lne(u,e,n){const b=ya(u,"x","bincount"),R=ya(e,"weights","bincount");Jn(b.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${b.dtype}`),Jn(n>=0,()=>`size must be non-negative, but got ${n}.`),Jn(R.size===b.size||R.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${b.shape}, weights shape: ${R.shape}.`);const q={x:b,weights:R},re={size:n};return wi.runKernel(g8,q,re)}const une=Ci({bincount_:lne});function cne(u,e){let n=ya(u,"broadcastTo","x");const b=n.shape;if(A_(e),e.lengthn.rank){const be=n.shape.slice();for(;be.length=0;be--)if(R[be]===e[be])q[be]=1;else if(n.shape[be]!==1)throw new Error(`broadcastTo(): [${b}] cannot be broadcast to [${e}].`);if(q.map((be,Pe)=>be>1?Pe:-1).filter(be=>be>=0).length===0)return m2(n);const fe={x:n},he={reps:q};return wi.runKernel(ok,fe,he)}const KE=Ci({broadcastTo_:cne});function fne(u){const n={x:ya(u,"x","ceil","float32")};return wi.runKernel(bC,n)}const hne=Ci({ceil_:fne});function KR(u,e,n){A_(u),n=n||FA(e);const b={shape:u,value:e,dtype:n};return wi.runKernel(R8,{},b)}function dne(u,e,n){const b=ya(u,"x","clipByValue");if(Jn(e<=n,()=>`Error in clip: min (${e}) must be less than or equal to max (${n}).`),e===n)return KR(b.shape,e,b.dtype);const R={x:b},q={clipValueMin:e,clipValueMax:n};return wi.runKernel(wC,R,q)}const Ug=Ci({clipByValue_:dne});function pne(u){return Fm(u,0)}const vne=Ci({concat1d_:pne});function mne(u,e){return Fm(u,e)}const gne=Ci({concat2d_:mne});function yne(u,e){return Fm(u,e)}const _ne=Ci({concat3d_:yne});function xne(u,e){return Fm(u,e)}const bne=Ci({concat4d_:xne});function wne(u,e,n,b,R="NHWC",q=[1,1],re){const fe=ya(u,"x","conv2d","float32"),he=ya(e,"filter","conv2d","float32");let be=fe,Pe=!1;fe.rank===3&&(Pe=!0,be=Pi(fe,[1,fe.shape[0],fe.shape[1],fe.shape[2]])),Jn(be.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${be.rank}.`),Jn(he.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${he.rank}.`),$m("conv2d",b,re);const je=R==="NHWC"?be.shape[3]:be.shape[1];Jn(je===he.shape[2],()=>`Error in conv2d: depth of input (${je}) must match input depth for filter ${he.shape[2]}.`),Jn(Fv(n,q),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${q}'`),Jn(T2(q),()=>"Error in conv2D: Dilated rates should be larger than 0."),Jn(T2(n),()=>"Error in conv2D: Strides should be larger than 0.");const We={x:be,filter:he},ft={strides:n,pad:b,dataFormat:R,dilations:q,dimRoundingMode:re},xt=wi.runKernel(tR,We,ft);return Pe?Pi(xt,[xt.shape[1],xt.shape[2],xt.shape[3]]):xt}const A2=Ci({conv2d_:wne});function Tne(u,e,n,b,R="NWC",q=1,re){const fe=ya(u,"x","conv1d"),he=ya(e,"filter","conv1d");let be=fe,Pe=!1;fe.rank===2&&(Pe=!0,be=Pi(fe,[1,fe.shape[0],fe.shape[1]])),Jn(be.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${be.rank}.`),Jn(he.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${he.rank}.`),$m("conv1d",b,re),Jn(be.shape[2]===he.shape[1],()=>`Error in conv1d: depth of input (${be.shape[2]}) must match input depth for filter ${he.shape[1]}.`),Jn(Fv(n,q),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${q}'`),Jn(T2(q),()=>"Error in conv1D: Dilated rates should be larger than 0."),Jn(T2(n),()=>"Error in conv1D: Stride should be larger than 0."),Jn(R==="NWC",()=>`Error in conv1d: got dataFormat of ${R} but only NWC is currently supported.`);const je=Pi(he,[1,he.shape[0],he.shape[1],he.shape[2]]),We=Pi(be,[be.shape[0],1,be.shape[1],be.shape[2]]),Ft=A2(We,je,[1,n],b,"NHWC",[1,q],re);return Pe?Pi(Ft,[Ft.shape[2],Ft.shape[3]]):Pi(Ft,[Ft.shape[0],Ft.shape[2],Ft.shape[3]])}const T$=Ci({conv1d_:Tne});function Ane(u,e,n,b,R,q="NHWC",re){Jn(u.length===e.rank,()=>`Length of inShape (${u.length}) and rank of dy (${e.rank}) must match`);let fe=u,he=e,be=!1;e.rank===3&&(be=!0,he=Pi(e,[1,e.shape[0],e.shape[1],e.shape[2]]),fe=[1,u[0],u[1],u[2]]),Jn(fe.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${fe.length}.`),Jn(he.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${he.rank}`),Jn(n.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);const Pe=q==="NHWC"?fe[3]:fe[1],je=q==="NHWC"?he.shape[3]:he.shape[1];Jn(Pe===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${Pe}) must match input depth for filter ${n.shape[2]}.`),Jn(je===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${je}) must match output depth for filter ${n.shape[3]}.`),$m("conv2dDerInput",R,re);const We={dy:he,filter:n},ft={strides:b,pad:R,dataFormat:q,dimRoundingMode:re,inputShape:fe},xt=wi.runKernel(rR,We,ft);return be?Pi(xt,[xt.shape[1],xt.shape[2],xt.shape[3]]):xt}const aN=Ci({conv2DBackpropInput_:Ane});function Sne(u,e,n,b,R,q){const re=ya(u,"x","conv2dTranspose"),fe=ya(e,"filter","conv2dTranspose");return aN(n,re,fe,b,R,"NHWC",q)}const A$=Ci({conv2dTranspose_:Sne});function Ene(u,e,n,b,R="NDHWC",q=[1,1,1]){const re=ya(u,"x","conv3d"),fe=ya(e,"filter","conv3d");let he=re,be=!1;re.rank===4&&(be=!0,he=Pi(re,[1,re.shape[0],re.shape[1],re.shape[2],re.shape[3]])),Jn(he.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${he.rank}.`),Jn(fe.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${fe.rank}.`),Jn(he.shape[4]===fe.shape[3],()=>`Error in conv3d: depth of input (${he.shape[4]}) must match input depth for filter ${fe.shape[3]}.`),Jn(Fv(n,q),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${q}'`),Jn(R==="NDHWC",()=>`Error in conv3d: got dataFormat of ${R} but only NDHWC is currently supported.`),Jn(T2(q),()=>"Error in conv3D: Dilated rates should be larger than 0."),Jn(T2(n),()=>"Error in conv3D: Strides should be larger than 0.");const Pe={x:he,filter:fe},je={strides:n,pad:b,dataFormat:R,dilations:q},We=wi.runKernel(nR,Pe,je);return be?Pi(We,[We.shape[1],We.shape[2],We.shape[3],We.shape[4]]):We}const Cne=Ci({conv3d_:Ene});function kne(u,e,n,b,R){Jn(u.length===e.rank,()=>`Length of inShape (${u.length}) and rank of dy (${e.rank}) must match`);let q=u,re=e,fe=!1;e.rank===4&&(fe=!0,re=Pi(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]),q=[1,u[0],u[1],u[2],u[3]]);const he=q[4],be=re.shape[4];Jn(q.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${q.length}.`),Jn(re.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${re.rank}`),Jn(n.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`),Jn(he===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${he}) must match input depth for filter ${n.shape[3]}.`),Jn(be===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${be}) must match output depth for filter ${n.shape[4]}.`);const Pe={dy:re,filter:n},je={pad:R,strides:b,inputShape:q},We=wi.runKernel(w8,Pe,je);return fe?Pi(We,[We.shape[1],We.shape[2],We.shape[3],We.shape[4]]):We}const S$=Ci({conv3DBackpropInput_:kne});function Mne(u,e,n,b,R){const q=ya(u,"x","conv3dTranspose"),re=ya(e,"filter","conv3dTranspose");return S$(n,q,re,b,R)}const Ine=Ci({conv3dTranspose_:Mne});function Lne(u){const n={x:ya(u,"x","cos","float32")};return wi.runKernel(TC,n)}const iN=Ci({cos_:Lne});function Rne(u){const n={x:ya(u,"x","cosh","float32")};return wi.runKernel(AC,n)}const E$=Ci({cosh_:Rne});function Dne(u,e=0,n=!1,b=!1){const q={x:ya(u,"x","cumprod")},re={axis:e,exclusive:n,reverse:b};return wi.runKernel(T8,q,re)}const Bz=Ci({cumprod_:Dne});function Pne(u,e=0,n=!1,b=!1){const q={x:ya(u,"x","cumsum")},re={axis:e,exclusive:n,reverse:b};return wi.runKernel(aR,q,re)}const C$=Ci({cumsum_:Pne});function zne(u,e,n,b=!1){const R=ya(u,"x","denseBincount"),q=ya(e,"weights","denseBincount");Jn(R.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${R.dtype}`),Jn(R.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${R.rank}.`),Jn(n>=0,()=>`size must be non-negative, but got ${n}.`),Jn(q.size===R.size||q.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${R.shape}, weights shape: ${q.shape}.`);const re={x:R,weights:q},fe={size:n,binaryOutput:b};return wi.runKernel(S8,re,fe)}const U9=Ci({denseBincount_:zne});function Nne(u,e,n="NHWC"){const b=ya(u,"x","depthToSpace","float32"),R=n==="NHWC"?b.shape[1]:b.shape[2],q=n==="NHWC"?b.shape[2]:b.shape[3],re=n==="NHWC"?b.shape[3]:b.shape[1];Jn(e>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${e}`),Jn(R*e>=0,()=>`Negative dimension size caused by overflow when multiplying + ${R} and ${e} for depthToSpace with input shape + ${b.shape}`),Jn(q*e>=0,()=>`Negative dimension size caused by overflow when multiplying + ${q} and ${e} for depthToSpace with input shape + ${b.shape}`),Jn(re%(e*e)===0,()=>`Dimension size must be evenly divisible by ${e*e} but is ${re} for depthToSpace with input shape ${b.shape}`);const fe={x:b},he={blockSize:e,dataFormat:n};return wi.runKernel(E8,fe,he)}const One=Ci({depthToSpace_:Nne});function Fne(u,e,n,b,R="NHWC",q=[1,1],re){const fe=ya(u,"x","depthwiseConv2d","float32"),he=ya(e,"filter","depthwiseConv2d","float32");let be=fe,Pe=!1;fe.rank===3&&(Pe=!0,be=Pi(fe,[1,fe.shape[0],fe.shape[1],fe.shape[2]])),Jn(be.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${be.rank}.`),Jn(he.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${he.rank}.`);const je=R==="NHWC"?be.shape[3]:be.shape[1];Jn(je===he.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${je}) must match the inChannels dimension in filter ${he.shape[2]}.`),$m("depthwiseConv2d",b,re);const We={x:be,filter:he},ft={strides:n,pad:b,dataFormat:R,dilations:q,dimRoundingMode:re},xt=wi.runKernel(iR,We,ft);return Pe?Pi(xt,[xt.shape[1],xt.shape[2],xt.shape[3]]):xt}const oN=Ci({depthwiseConv2d_:Fne});function Bne(u,e,n,b,R=[1,1],q="NHWC"){const re=ya(u,"x","dilation2d"),fe=ya(e,"filter","dilation2d");Jn(re.rank===3||re.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${re.rank}.`),Jn(fe.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${fe.rank}.`),Jn(q==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${q}`);let he=re,be=!1;re.rank===3&&(he=Pi(re,[1,re.shape[0],re.shape[1],re.shape[2]]),be=!0),Jn(he.shape[3]===fe.shape[2],()=>`Error in dilation2d: input and filter must have the same depth: ${he.shape[3]} vs ${fe.shape[2]}`);const Pe={x:he,filter:fe},je={strides:n,pad:b,dilations:R},We=wi.runKernel(oR,Pe,je);return be?Pi(We,[We.shape[1],We.shape[2],We.shape[3]]):We}const Une=Ci({dilation2d_:Bne});function IA(u,e){const n=u.length,b=[];for(let R=0;R1&&re===1&&b.unshift(q)}return b}function Hp(u,e){const n=[];for(let b=0;b1)&&n.unshift(q)}return n}function Yu(u,e){const n=Math.max(u.length,e.length),b=new Array(n);for(let R=0;R`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${b.rank}.`);const R=n.rank===1?n.size:n.shape[1],q=b.rank===1?b.size:b.shape[0];if(Jn(R===q,()=>`Error in dot: inner dimensions of inputs must match, but got ${R} and ${q}.`),n.rank===1&&b.rank===1){const re=Pi(n,[1,-1]),fe=Pi(b,[-1,1]),he=Uf(re,fe);return Pi(he,[])}else if(n.rank===1&&b.rank===2){const re=Pi(n,[1,-1]),fe=Pi(b,[b.shape[0],b.shape[1]]),he=Uf(re,fe);return Pi(he,[he.size])}else if(n.rank===2&&b.rank===1){const re=Pi(b,[-1,1]),fe=Uf(n,re);return Pi(fe,[fe.size])}else{const re=Pi(b,[b.shape[0],b.shape[1]]);return Uf(n,re)}}const Wne=Ci({dot_:Hne});function Xne(u,...e){const n=e.map((R,q)=>ya(R,`tensors${q}`,"einsum")),b={equation:u};return wi.runKernel(M8,n,b)}const VE=Ci({einsum_:Xne});function Yne(u){const n={x:ya(u,"x","elu","float32")};return wi.runKernel(EC,n)}const JR=Ci({elu_:Yne});function Zne(u){let e=ya(u,"x","erf");Jn(e.dtype==="int32"||e.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),e.dtype==="int32"&&(e=Gs(e,"float32"));const n={x:e};return wi.runKernel(CC,n)}const k$=Ci({erf_:Zne});function sN(u,e){for(let n=0;nu[q]);return[n,R]}function ip(u,e){const n=e.map(b=>1);return M$(u,n,e)}function Cv(u,e,n){Jn(sN(e,n),()=>`${u} supports only inner-most axes for now. Got axes ${e} and rank-${n} input.`)}function kd(u,e){if(sN(u,e))return null;const n=[];for(let b=0;bn.push(b)),n}function _b(u){return u.map((e,n)=>[n,e]).sort((e,n)=>e[1]-n[1]).map(e=>e[0])}function op(u,e){const n=[];for(let b=e-u;b"Axis must be <= rank of the tensor");const b={input:n},R={dim:e};return wi.runKernel(lR,b,R)}const zm=Ci({expandDims_:sae});function lae(u){const n={x:ya(u,"x","expm1")};return wi.runKernel(MC,n)}const uae=Ci({expm1_:lae});function cae(u,e){const n=ya(u,"x","tile","string_or_numeric");Jn(n.rank===e.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${e}.`);const b={x:n},R={reps:e};return wi.runKernel(ok,b,R)}const ny=Ci({tile_:cae});function fae(u,e,n,b="float32"){e==null&&(e=u);const R=Tc([u,e],b),q=u<=e?u:e;for(let fe=0;fe`Error in localResponseNormalization: x must be rank 3 or 4 but got + rank ${q.rank}.`),Jn(CA(e),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${e}.`);let re=q,fe=!1;q.rank===3&&(fe=!0,re=Pi(q,[1,q.shape[0],q.shape[1],q.shape[2]]));const he={x:re},be={depthRadius:e,bias:n,alpha:b,beta:R},Pe=wi.runKernel(yR,he,be);return fe?Pi(Pe,[Pe.shape[1],Pe.shape[2],Pe.shape[3]]):Pe}const Cae=Ci({localResponseNormalization_:Eae});function kae(u){const n={x:ya(u,"x","log","float32")};return wi.runKernel(OC,n)}const _0=Ci({log_:kae});function Mae(u){const n={x:ya(u,"x","log1p")};return wi.runKernel(FC,n)}const fN=Ci({log1p_:Mae});function Iae(u,e){Jn(Az(u),()=>"The f passed in variableGrads(f) must be a function"),Jn(e==null||Array.isArray(e)&&e.every(be=>be instanceof xL),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");const n=e!=null;if(!n){e=[];for(const be in wi.registeredVariables)e.push(wi.registeredVariables[be])}const b=n?e.filter(be=>!be.trainable):null,R=e.length;e=e.filter(be=>be.trainable),Jn(e.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${R} variables is trainable.`);const q=!0,{value:re,grads:fe}=wi.gradients(u,e,null,q);Jn(fe.some(be=>be!=null),()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),Jn(re.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${re.rank} tensor`);const he={};return e.forEach((be,Pe)=>{fe[Pe]!=null&&(he[be.name]=fe[Pe])}),b?.forEach(be=>he[be.name]=null),{value:re,grads:he}}function E2(u){return wi.customGrad(u)}function Lae(u){const n={x:ya(u,"x","neg")};return wi.runKernel(SR,n)}const dd=Ci({neg_:Lae});function Rae(u){const n={x:ya(u,"x","softplus")};return wi.runKernel(ek,n)}const uk=Ci({softplus_:Rae});function Dae(u){const e=ya(u,"x","logSigmoid");return E2(b=>({value:dd(uk(dd(b))),gradFunc:re=>si(re,VA(dd(b)))}))(e)}const Pae=Ci({logSigmoid_:Dae});function zae(u,e){let n=ya(u,"a","sub"),b=ya(e,"b","sub");[n,b]=ap(n,b);const R={a:n,b};return wi.runKernel(nk,R)}const bl=Ci({sub_:zae});function Nae(u,e=-1){const n=ya(u,"logits","logSoftmax");if(e===-1&&(e=n.rank-1),e!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${e}`);return E2((R,q)=>{const fe=iy(R,e,!0),he=bl(R,fe),be=bl(Gs(he,"float32"),_0(Cl($g(he),e,!0)));return q([be]),{value:be,gradFunc:(je,We)=>{const[ft]=We,xt=!0,zt=$g(ft);return bl(je,si(Cl(je,e,xt),zt))}}})(n)}const R$=Ci({logSoftmax_:Nae});function Oae(u,e=null,n=!1){const b=ya(u,"x","logSumExp"),R=Ac(e,b.shape),q=iy(b,R,!0),re=bl(b,q),fe=$g(re),he=Cl(fe,R),be=_0(he),Pe=Ko(Pi(q,be.shape),be);if(n){const je=ip(Pe.shape,R);return Pi(Pe,je)}return Pe}const hN=Ci({logSumExp_:Oae});function Fae(u,e){const n=ya(u,"a","logicalAnd","bool"),b=ya(e,"b","logicalAnd","bool");Yu(n.shape,b.shape);const R={a:n,b};return wi.runKernel(vR,R)}const x_=Ci({logicalAnd_:Fae});function Bae(u){const n={x:ya(u,"x","logicalNot","bool")};return wi.runKernel(mR,n)}const dN=Ci({logicalNot_:Bae});function Uae(u,e){const n=ya(u,"a","logicalOr","bool"),b=ya(e,"b","logicalOr","bool");Yu(n.shape,b.shape);const R={a:n,b};return wi.runKernel(gR,R)}const D$=Ci({logicalOr_:Uae});function $ae(u,e){const n=ya(u,"a","logicalXor","bool"),b=ya(e,"b","logicalXor","bool");return Yu(n.shape,b.shape),x_(D$(u,e),dN(x_(u,e)))}const Vae=Ci({logicalXor_:$ae});function jae(u,e,n,b,R){const q=ya(u,"x","maxPool"),re=1;let fe=q,he=!1;q.rank===3&&(he=!0,fe=Pi(q,[1,q.shape[0],q.shape[1],q.shape[2]])),Jn(fe.rank===4,()=>`Error in maxPool: input must be rank 4 but got rank ${fe.rank}.`),Jn(Fv(n,re),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${re}'`),$m("maxPool",b,R);const be={x:fe},Pe={filterSize:e,strides:n,pad:b,dimRoundingMode:R},je=wi.runKernel(xR,be,Pe);return he?Pi(je,[je.shape[1],je.shape[2],je.shape[3]]):je}const pN=Ci({maxPool_:jae});function Gae(u,e=[1,1,1],n,b,R,q="NDHWC"){const re=ya(u,"x","maxPool3d");let fe=re,he=!1;re.rank===4&&(he=!0,fe=Pi(re,[1,re.shape[0],re.shape[1],re.shape[2],re.shape[3]])),Jn(fe.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${fe.rank}.`),Jn(q==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${q}`),$m("maxPool3d",b,R);const be={x:fe},Pe={filterSize:e,strides:n,pad:b,dimRoundingMode:R,dataFormat:q},je=wi.runKernel(bR,be,Pe);return he?Pi(je,[je.shape[1],je.shape[2],je.shape[3],je.shape[4]]):je}const qae=Ci({maxPool3d_:Gae});function Hae(u,e){let n=ya(u,"a","maximum"),b=ya(e,"b","maximum");[n,b]=ap(n,b),n.dtype==="bool"&&(n=Gs(n,"int32"),b=Gs(b,"int32")),Yu(n.shape,b.shape);const R={a:n,b};return wi.runKernel(BC,R)}const xb=Ci({maximum_:Hae});function Wae(u,e=null,n=!1){const R={x:ya(u,"x","mean")},q={axis:e,keepDims:n};return wi.runKernel(wR,R,q)}const rp=Ci({mean_:Wae});function Mp(u,e="float32"){if(A_(u),e==="complex64"){const b=Mp(u,"float32"),R=Mp(u,"float32");return MA(b,R)}const n=Nv(xo(u),e);return wi.makeTensor(n,u,e)}function C_(u,e="float32"){if(A_(u),e==="complex64"){const b=C_(u,"float32"),R=Mp(u,"float32");return MA(b,R)}const n=u8(xo(u),e);return wi.makeTensor(n,u,e)}function Xae(u,e){let n=ya(u,"a","minimum"),b=ya(e,"b","minimum");[n,b]=ap(n,b),n.dtype==="bool"&&(n=Gs(n,"int32"),b=Gs(b,"int32")),Yu(n.shape,b.shape);const R={a:n,b};return wi.runKernel(UC,R)}const LA=Ci({minimum_:Xae});function Yae(u,e,n){Jn(n==="reflect"||n==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);const b=ya(u,"x","mirrorPad");if(b.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");Jn(e.length===b.rank,()=>`Padding doesn't match input. Must be ${b.rank}. Got ${e.length}.`);const R=n==="reflect"?1:0;for(let fe=0;fe"Invalid number of paddings. Must be length of 2 each."),Jn(e[fe][0]>=0&&e[fe][0]<=b.shape[fe]-R&&e[fe][1]>=0&&e[fe][1]<=b.shape[fe]-R,()=>`Padding in dimension ${fe} cannot be greater than or equal to ${b.shape[fe]-R} or less than 0 for input of shape ${b.shape}`);const q={paddings:e,mode:n},re={x:b};return wi.runKernel(AR,re,q)}const Zae=Ci({mirrorPad_:Yae});function Kae(u,e){let n=ya(u,"a","mod"),b=ya(e,"b","mod");[n,b]=ap(n,b);const R={a:n,b};return wi.runKernel($C,R)}const Jae=Ci({mod_:Kae});function Qae(u,e=null,n=!1){u=ya(u,"x","moments");const b=Ac(e,u.shape),R=rp(u,b,n);let q=R.shape;n||(q=ip(R.shape,b));const re=jh(bl(Gs(u,"float32"),Pi(R,q))),fe=rp(re,b,n);return{mean:R,variance:fe}}const vN=Ci({moments_:Qae});function eie(u,e){let n=ya(u,"a","notEqual","string_or_numeric"),b=ya(e,"b","notEqual","string_or_numeric");[n,b]=ap(n,b),Yu(n.shape,b.shape);const R={a:n,b};return wi.runKernel(ER,R)}const rC=Ci({notEqual_:eie});function tie(u,e,n=1,b=0,R="int32"){if(e<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`);const re={indices:ya(u,"indices","oneHot","int32")},fe={dtype:R,depth:e,onValue:n,offValue:b};return wi.runKernel(kR,re,fe)}const P$=Ci({oneHot_:tie});function rie(u){const n={x:ya(u,"x","onesLike")};return wi.runKernel(CR,n)}const x0=Ci({onesLike_:rie});function nie(u,e,n=0){const b=ya(u,"x","pad");if(b.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const R={paddings:e,constantValue:n},q={x:b};return wi.runKernel(IR,q,R)}const mN=Ci({pad_:nie});function aie(u,e,n){const b=ya(u,"x","spaceToBatchND");Jn(b.rank>=1+e.length,()=>`input rank ${b.rank} should be > than [blockShape] ${e.length}`),Jn(n.length===e.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${e.length}`),Jn(b.shape.reduce((re,fe,he)=>he>0&&he<=e.length?re&&(fe+n[he-1][0]+n[he-1][1])%e[he-1]===0:re,!0),()=>`input spatial dimensions ${b.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${e.toString()}`);const R={x:b},q={blockShape:e,paddings:n};return wi.runKernel(UR,R,q)}const gN=Ci({spaceToBatchND_:aie});function iie(u,e,n,b,R,q,re){R==null&&(R=[1,1]),q==null&&(q=1),b===0&&(b="valid");const fe=ya(u,"x","maxPool");let he=fe,be=!1;fe.rank===3&&(be=!0,he=Pi(fe,[1,fe.shape[0],fe.shape[1],fe.shape[2]])),Jn(Fv(q,R),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${q} and dilations '${R}'`);const Pe=w0(he.shape,e,q,R,b),je=[Pe.dilationHeight,Pe.dilationWidth];let We;b==="same"?We=sie([Pe.filterHeight,Pe.filterWidth],je):We=[[0,0],[0,0]];const ft=je[0]===1&&je[1]===1,[xt,zt]=oie([Pe.inHeight,Pe.inWidth],je,We),Ft=ft?b:"valid",jt=ft?he:gN(he,je,xt),Lr=(n==="avg"?()=>rN(jt,e,q,Ft,re):()=>pN(jt,e,q,Ft,re))(),Cr=ft?Lr:nN(Lr,je,zt);return be?Pi(Cr,[Cr.shape[1],Cr.shape[2],Cr.shape[3]]):Cr}function oie(u,e,n){const b=n.map(Pe=>Pe[0]),R=n.map(Pe=>Pe[1]),q=u.concat(b,R),re=e.map((Pe,je)=>(Pe-q[je]%Pe)%Pe),fe=R.map((Pe,je)=>Pe+re[je]),he=e.map((Pe,je)=>[b[je],fe[je]]),be=e.map((Pe,je)=>[0,re[je]]);return[he,be]}function sie(u,e){const b=u.map((re,fe)=>re+(re-1)*(e[fe]-1)).map(re=>re-1),R=b.map(re=>Math.floor(re/2)),q=b.map((re,fe)=>re-R[fe]);return b.map((re,fe)=>[R[fe],q[fe]])}const lie=Ci({pool_:iie});function uie(u,e){const n=ya(u,"x","prelu"),b=ya(e,"alpha","prelu"),R={x:n,alpha:b};return wi.runKernel(LR,R)}const yN=Ci({prelu_:uie});function cie(u,e=null,n=!1){let b=ya(u,"x","prod");b.dtype==="bool"&&(b=Gs(b,"int32"));const R={x:b},q={axis:e,keepDims:n};return wi.runKernel(RR,R,q)}const fie=Ci({prod_:cie});var sL={exports:{}},hie=sL.exports,$9;function die(){return $9||($9=1,(function(u){(function(e,n,b){function R(he){var be=this,Pe=fe();be.next=function(){var je=2091639*be.s0+be.c*23283064365386963e-26;return be.s0=be.s1,be.s1=be.s2,be.s2=je-(be.c=je|0)},be.c=1,be.s0=Pe(" "),be.s1=Pe(" "),be.s2=Pe(" "),be.s0-=Pe(he),be.s0<0&&(be.s0+=1),be.s1-=Pe(he),be.s1<0&&(be.s1+=1),be.s2-=Pe(he),be.s2<0&&(be.s2+=1),Pe=null}function q(he,be){return be.c=he.c,be.s0=he.s0,be.s1=he.s1,be.s2=he.s2,be}function re(he,be){var Pe=new R(he),je=be&&be.state,We=Pe.next;return We.int32=function(){return Pe.next()*4294967296|0},We.double=function(){return We()+(We()*2097152|0)*11102230246251565e-32},We.quick=We,je&&(typeof je=="object"&&q(je,Pe),We.state=function(){return q(Pe,{})}),We}function fe(){var he=4022871197,be=function(Pe){Pe=String(Pe);for(var je=0;je>>0,We-=he,We*=he,he=We>>>0,We-=he,he+=We*4294967296}return(he>>>0)*23283064365386963e-26};return be}n&&n.exports?n.exports=re:this.alea=re})(hie,u)})(sL)),sL.exports}var lL={exports:{}},pie=lL.exports,V9;function vie(){return V9||(V9=1,(function(u){(function(e,n,b){function R(fe){var he=this,be="";he.x=0,he.y=0,he.z=0,he.w=0,he.next=function(){var je=he.x^he.x<<11;return he.x=he.y,he.y=he.z,he.z=he.w,he.w^=he.w>>>19^je^je>>>8},fe===(fe|0)?he.x=fe:be+=fe;for(var Pe=0;Pe>>0)/4294967296};return je.double=function(){do var We=be.next()>>>11,ft=(be.next()>>>0)/4294967296,xt=(We+ft)/(1<<21);while(xt===0);return xt},je.int32=be.next,je.quick=je,Pe&&(typeof Pe=="object"&&q(Pe,be),je.state=function(){return q(be,{})}),je}n&&n.exports?n.exports=re:this.xor128=re})(pie,u)})(lL)),lL.exports}var uL={exports:{}},mie=uL.exports,j9;function gie(){return j9||(j9=1,(function(u){(function(e,n,b){function R(fe){var he=this,be="";he.next=function(){var je=he.x^he.x>>>2;return he.x=he.y,he.y=he.z,he.z=he.w,he.w=he.v,(he.d=he.d+362437|0)+(he.v=he.v^he.v<<4^(je^je<<1))|0},he.x=0,he.y=0,he.z=0,he.w=0,he.v=0,fe===(fe|0)?he.x=fe:be+=fe;for(var Pe=0;Pe>>4),he.next()}function q(fe,he){return he.x=fe.x,he.y=fe.y,he.z=fe.z,he.w=fe.w,he.v=fe.v,he.d=fe.d,he}function re(fe,he){var be=new R(fe),Pe=he&&he.state,je=function(){return(be.next()>>>0)/4294967296};return je.double=function(){do var We=be.next()>>>11,ft=(be.next()>>>0)/4294967296,xt=(We+ft)/(1<<21);while(xt===0);return xt},je.int32=be.next,je.quick=je,Pe&&(typeof Pe=="object"&&q(Pe,be),je.state=function(){return q(be,{})}),je}n&&n.exports?n.exports=re:this.xorwow=re})(mie,u)})(uL)),uL.exports}var cL={exports:{}},yie=cL.exports,G9;function _ie(){return G9||(G9=1,(function(u){(function(e,n,b){function R(fe){var he=this;he.next=function(){var Pe=he.x,je=he.i,We,ft;return We=Pe[je],We^=We>>>7,ft=We^We<<24,We=Pe[je+1&7],ft^=We^We>>>10,We=Pe[je+3&7],ft^=We^We>>>3,We=Pe[je+4&7],ft^=We^We<<7,We=Pe[je+7&7],We=We^We<<13,ft^=We^We<<9,Pe[je]=ft,he.i=je+1&7,ft};function be(Pe,je){var We,ft=[];if(je===(je|0))ft[0]=je;else for(je=""+je,We=0;We0;--We)Pe.next()}be(he,fe)}function q(fe,he){return he.x=fe.x.slice(),he.i=fe.i,he}function re(fe,he){fe==null&&(fe=+new Date);var be=new R(fe),Pe=he&&he.state,je=function(){return(be.next()>>>0)/4294967296};return je.double=function(){do var We=be.next()>>>11,ft=(be.next()>>>0)/4294967296,xt=(We+ft)/(1<<21);while(xt===0);return xt},je.int32=be.next,je.quick=je,Pe&&(Pe.x&&q(Pe,be),je.state=function(){return q(be,{})}),je}n&&n.exports?n.exports=re:this.xorshift7=re})(yie,u)})(cL)),cL.exports}var fL={exports:{}},xie=fL.exports,q9;function bie(){return q9||(q9=1,(function(u){(function(e,n,b){function R(fe){var he=this;he.next=function(){var Pe=he.w,je=he.X,We=he.i,ft,xt;return he.w=Pe=Pe+1640531527|0,xt=je[We+34&127],ft=je[We=We+1&127],xt^=xt<<13,ft^=ft<<17,xt^=xt>>>15,ft^=ft>>>12,xt=je[We]=xt^ft,he.i=We,xt+(Pe^Pe>>>16)|0};function be(Pe,je){var We,ft,xt,zt,Ft,jt=[],Re=128;for(je===(je|0)?(ft=je,je=null):(je=je+"\0",ft=0,Re=Math.max(Re,je.length)),xt=0,zt=-32;zt>>15,ft^=ft<<4,ft^=ft>>>13,zt>=0&&(Ft=Ft+1640531527|0,We=jt[zt&127]^=ft+Ft,xt=We==0?xt+1:0);for(xt>=128&&(jt[(je&&je.length||0)&127]=-1),xt=127,zt=512;zt>0;--zt)ft=jt[xt+34&127],We=jt[xt=xt+1&127],ft^=ft<<13,We^=We<<17,ft^=ft>>>15,We^=We>>>12,jt[xt]=ft^We;Pe.w=Ft,Pe.X=jt,Pe.i=xt}be(he,fe)}function q(fe,he){return he.i=fe.i,he.w=fe.w,he.X=fe.X.slice(),he}function re(fe,he){fe==null&&(fe=+new Date);var be=new R(fe),Pe=he&&he.state,je=function(){return(be.next()>>>0)/4294967296};return je.double=function(){do var We=be.next()>>>11,ft=(be.next()>>>0)/4294967296,xt=(We+ft)/(1<<21);while(xt===0);return xt},je.int32=be.next,je.quick=je,Pe&&(Pe.X&&q(Pe,be),je.state=function(){return q(be,{})}),je}n&&n.exports?n.exports=re:this.xor4096=re})(xie,u)})(fL)),fL.exports}var hL={exports:{}},wie=hL.exports,H9;function Tie(){return H9||(H9=1,(function(u){(function(e,n,b){function R(fe){var he=this,be="";he.next=function(){var je=he.b,We=he.c,ft=he.d,xt=he.a;return je=je<<25^je>>>7^We,We=We-ft|0,ft=ft<<24^ft>>>8^xt,xt=xt-je|0,he.b=je=je<<20^je>>>12^We,he.c=We=We-ft|0,he.d=ft<<16^We>>>16^xt,he.a=xt-je|0},he.a=0,he.b=0,he.c=-1640531527,he.d=1367130551,fe===Math.floor(fe)?(he.a=fe/4294967296|0,he.b=fe|0):be+=fe;for(var Pe=0;Pe>>0)/4294967296};return je.double=function(){do var We=be.next()>>>11,ft=(be.next()>>>0)/4294967296,xt=(We+ft)/(1<<21);while(xt===0);return xt},je.int32=be.next,je.quick=je,Pe&&(typeof Pe=="object"&&q(Pe,be),je.state=function(){return q(be,{})}),je}n&&n.exports?n.exports=re:this.tychei=re})(wie,u)})(hL)),hL.exports}var dL={exports:{}};const Aie={},Sie=Object.freeze(Object.defineProperty({__proto__:null,default:Aie},Symbol.toStringTag,{value:"Module"})),Eie=Mee(Sie);var Cie=dL.exports,W9;function kie(){return W9||(W9=1,(function(u){(function(e,n,b){var R=256,q=6,re=52,fe="random",he=b.pow(R,q),be=b.pow(2,re),Pe=be*2,je=R-1,We;function ft(Cr,Gr,yn){var Pn=[];Gr=Gr==!0?{entropy:!0}:Gr||{};var Vn=jt(Ft(Gr.entropy?[Cr,Lr(n)]:Cr??Re(),3),Pn),un=new xt(Pn),Nn=function(){for(var Kr=un.g(q),Ma=he,ui=0;Kr=Pe;)Kr/=2,Ma/=2,ui>>>=1;return(Kr+ui)/Ma};return Nn.int32=function(){return un.g(4)|0},Nn.quick=function(){return un.g(4)/4294967296},Nn.double=Nn,jt(Lr(un.S),n),(Gr.pass||yn||function(Kr,Ma,ui,da){return da&&(da.S&&zt(da,un),Kr.state=function(){return zt(un,{})}),ui?(b[fe]=Kr,Ma):Kr})(Nn,Vn,"global"in Gr?Gr.global:this==b,Gr.state)}function xt(Cr){var Gr,yn=Cr.length,Pn=this,Vn=0,un=Pn.i=Pn.j=0,Nn=Pn.S=[];for(yn||(Cr=[yn++]);Vn=1||re===0);const fe=Math.sqrt(-2*Math.log(re)/re);e=this.mean+this.stdDev*R*fe,n=this.mean+this.stdDev*q*fe,(!this.truncated||this.isValidTruncated(e))&&(b=!0)}return(!this.truncated||this.isValidTruncated(n))&&(this.nextVal=this.convertValue(n)),this.convertValue(e)}convertValue(e){return this.dtype==null||this.dtype==="float32"?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class Iie{constructor(e=0,n=1,b,R){if(this.canReturnFloat=()=>this.dtype==null||this.dtype==="float32",this.min=e,this.range=n-e,this.dtype=b,R==null&&(R=Math.random()),typeof R=="number"&&(R=R.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${n} <= 1 and dtype is not float`);this.random=_N.alea(R)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}function Lie(u,e=0,n=1,b,R){if(A_(u),b!=null&&b==="bool")throw new Error(`Unsupported data type ${b}`);const q=new z$(e,n,b,!1,R),re=Tc(u,b);for(let fe=0;fe`Error in separableConv2d: input must be rank 4, but got rank ${Pe.rank}.`),Jn(he.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${he.rank}.`),Jn(be.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${he.rank}.`),Jn(be.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${be.shape[0]}.`),Jn(be.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${be.shape[1]}.`);const We=he.shape[2],ft=he.shape[3];Jn(be.shape[2]===We*ft,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${We*ft}, but got ${be.shape[2]}.`);const xt=oN(Pe,he,b,R,re,q),Ft=A2(xt,be,1,"valid",re);return je?Pi(Ft,[Ft.shape[1],Ft.shape[2],Ft.shape[3]]):Ft}const U$=Ci({separableConv2d_:jie});function Gie(u){const n={x:ya(u,"x","sign")};return wi.runKernel(JC,n)}const qie=Ci({sign_:Gie});function Hie(u){const n={x:ya(u,"x","sin","float32")};return wi.runKernel(ZC,n)}const $$=Ci({sin_:Hie});function Wie(u){const n={x:ya(u,"x","sinh")};return wi.runKernel(KC,n)}const V$=Ci({sinh_:Wie});function Xie(u,e,n){const b=ya(u,"x","slice1d");return Jn(b.rank===1,()=>`slice1d expects a rank-1 tensor, but got a rank-${b.rank} tensor`),Vh(b,[e],[n])}const xN=Ci({slice1d_:Xie});function Yie(u,e,n){const b=ya(u,"x","slice2d");return Jn(b.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${b.rank} tensor`),Vh(b,e,n)}const j$=Ci({slice2d_:Yie});function Zie(u,e,n){const b=ya(u,"x","slice3d");return Jn(b.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${b.rank} tensor`),Vh(b,e,n)}const bN=Ci({slice3d_:Zie});function Kie(u,e,n){const b=ya(u,"x","slice4d");return Jn(b.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${b.rank} tensor`),Vh(b,e,n)}const AL=Ci({slice4d_:Kie});function Jie(u,e=-1){const n=ya(u,"logits","softmax","float32");if(e===-1&&(e=n.rank-1),e!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${e}`);const b={logits:n},R={dim:e};return wi.runKernel(VR,b,R)}const tD=Ci({softmax_:Jie});function Qie(u){Jn(u.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${u.dtype}.`);const e={input:u};return wi.runKernel(L8,e)}const G$=Ci({fft_:Qie});function eoe(u){Jn(u.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${u.dtype}.`);const e={input:u};return wi.runKernel(P8,e)}const Uz=Ci({ifft_:eoe});function toe(u){const e=u.shape[u.shape.length-1],n=u.size/e;let b;if(e<=2){const R=Pi(u,[n,e]);b=Uz(R)}else{const R=[n,2*(e-1)],q=Pi(TL(u),[n,e]),re=Pi(uN(u),[n,e]),fe=C2(Vh(q,[0,1],[n,e-2]),1),he=si(C2(Vh(re,[0,1],[n,e-2]),1),Pu(-1)),be=Fm([q,fe],1),Pe=Fm([re,he],1),je=Pi(MA(be,Pe),[R[0],R[1]]);b=Uz(je)}if(b=TL(b),u.rank===3&&u.shape[0]!==0){const R=b,q=u.shape[0];b=Pi(b,[q,b.shape[0]/q,b.shape[1]]),R.dispose()}return b}const roe=Ci({irfft_:toe});function noe(u,e,n=0){const R={x:ya(u,"x","split")},q={numOrSizeSplits:e,axis:n};return wi.runKernel($R,R,q)}const Bg=Ci({split_:noe});function aoe(u,e){Jn(u.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${u.dtype}`);let n=u.shape[u.shape.length-1];const b=u.size/n;let R;if(e!=null&&e0),zt=u.shape.map(Ft=>Ft);zt[u.shape.length-1]=e,R=Vh(u,xt,zt),n=e}else if(e!=null&&e>n){const xt=u.shape.map(zt=>zt);xt[u.shape.length-1]=e-n,R=Fm([u,Mp(xt)],u.shape.length-1),n=e}else R=u;const q=tf(R),re=Pi(MA(R,q),[b,n]),fe=G$(re),he=Math.floor(n/2)+1,be=TL(fe),Pe=uN(fe),je=Bg(be,[he,n-he],be.shape.length-1),We=Bg(Pe,[he,n-he],Pe.shape.length-1),ft=R.shape.slice();return ft[R.shape.length-1]=he,Pi(MA(je[0],We[0]),ft)}const ioe=Ci({rfft_:aoe});function ooe(u,e){let n=ya(u,"a","squaredDifference"),b=ya(e,"b","squaredDifference");[n,b]=ap(n,b),Yu(n.shape,b.shape);const R={a:n,b},q={};return wi.runKernel(rk,R,q)}const q$=Ci({squaredDifference_:ooe});function soe(u,e){const n=ya(u,"x","squeeze","string_or_numeric");return Pi(n,mb(n.shape,e).newShape)}const ck=Ci({squeeze_:soe});function loe(u,e=0){const n=f$(u,"tensors","stack","string_or_numeric");Jn(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&Jn(e<=n[0].rank,()=>"Axis must be <= rank of the tensor");const b=n,R={axis:e};return wi.runKernel(MR,b,R)}const b_=Ci({stack_:loe});function uoe(u,e=0){const b={x:ya(u,"x","step")},R={alpha:e};return wi.runKernel(sk,b,R)}const fk=Ci({step_:uoe});function coe(u,e,n,b,R=0,q=0,re=0,fe=0,he=0){const Pe={x:ya(u,"x","stridedSlice","string_or_numeric")},je={begin:e,end:n,strides:b,beginMask:R,endMask:q,ellipsisMask:re,newAxisMask:fe,shrinkAxisMask:he};return wi.runKernel(X8,Pe,je)}const foe=Ci({stridedSlice_:coe});function hoe(u){const n={x:ya(u,"x","tan","float32")};return wi.runKernel(ak,n)}const doe=Ci({tan_:hoe});function og(u,e){bU(u);const n=WR(u,e);if(n.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return XR(u,null,n,e)}function p2(u,e,n){if(bU(u),e!=null&&e.length!==2)throw new Error("tensor2d() requires shape to have two numbers");const b=WR(u,n);if(b.length!==2&&b.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(b.length===1&&e==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return XR(u,e,b,n)}function z2(u,e,n){const b=e.shape.length,R=b>1?e.shape[b-1]:1,q=n.length;let re=1;for(let je=R;je= 0 but got ${e}`);if(e>R)throw new Error(`'k' passed to topk() must be <= the last dimension (${R}) but got ${e}`);const q={x:b},re={k:e,sorted:n},[fe,he]=wi.runKernel(Y8,q,re);return{values:fe,indices:he}}const voe=Ci({topk_:poe});function moe(u,e=0,n=1,b,R){if(A_(u),b!=null&&b==="bool")throw new Error("Unsupported data type $ { dtype }");const q=new z$(e,n,b,!0,R),re=Tc(u,b);for(let fe=0;fe0,()=>"The input tensor must be at least 1D");const b={x:n},R={axis:e},[q,re]=wi.runKernel(K8,b,R);return{values:q,indices:re}}const yoe=Ci({unique_:goe});function _oe(u,e,n){const b=ya(u,"x","unsortedSegmentSum"),R=ya(e,"segmentIds","unsortedSegmentSum","int32");Jn(CA(n),()=>"numSegments must be of dtype int");const q={x:b,segmentIds:R},re={numSegments:n};return wi.runKernel(GR,q,re)}const W$=Ci({unsortedSegmentSum_:_oe});function xoe(u,e=0){const n=ya(u,"x","unstack","string_or_numeric");Jn(e>=-n.shape.length&&e`Axis = ${e} is not in [-${n.shape.length}, ${n.shape.length})`);const b={value:n},R={axis:e};return wi.runKernel(jR,b,R)}const k2=Ci({unstack_:xoe});function bA(u,e=!0,n,b){return wi.makeVariable(u,e,n,b)}function X$(u,e){const n=[];for(let q=0;qfe).reverse()),Jn(b.rank===e.length,()=>`Error in transpose: rank of input ${b.rank} must match length of perm ${e}.`),e.forEach(re=>{Jn(re>=0&&re`All entries in 'perm' must be between 0 and ${b.rank-1} but got ${e}`)}),b.rank<=1)return b.clone();const R={x:b},q={perm:e};return b.dtype==="complex64"?Zi(()=>{let re=TL(b),fe=uN(b);return re=wi.runKernel(TA,{x:re},q),fe=wi.runKernel(TA,{x:fe},q),n&&(fe=dd(fe)),MA(re,fe)}):wi.runKernel(TA,R,q)}const ef=Ci({transpose_:boe});function woe(u,e){if(e==null)return u.shape.slice();if($f(u.shape,e))return e;if(u.shape.length===e.length){const n=[];for(let b=0;b`x has to be a floating point tensor since it's going to be scaled, but got a ${R.dtype} tensor instead.`),Jn(e>=0&&e<1,()=>`rate must be a float in the range [0, 1), but got ${e}.`),e===0)return u instanceof $p?R.clone():R;const q=woe(R,n),re=1-e,fe=Vl(eD(Ko(sb(q,0,1,"float32",b),re)),re);return si(R,fe)}const Aoe=Ci({dropout_:Toe});function Soe(u,e,n,b,R,q="NHWC",re){let fe=u;u.rank===3&&(fe=Pi(u,[1,u.shape[0],u.shape[1],u.shape[2]]));let he=e;he.rank===3&&(he=Pi(e,[1,e.shape[0],e.shape[1],e.shape[2]])),Jn(fe.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${fe.shape}.`),Jn(he.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${he.shape}.`),Jn(n.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);const be=q==="NHWC"?fe.shape[3]:fe.shape[1],Pe=q==="NHWC"?he.shape[3]:he.shape[1];Jn(be===n[2],()=>`Error in conv2dDerFilter: depth of input ${be}) must match input depth in filter (${n[2]}.`),Jn(Pe===n[3],()=>`Error in conv2dDerFilter: depth of dy (${Pe}) must match output depth for filter (${n[3]}).`),$m("conv2dDerFilter",R,re);const je={x:fe,dy:he},We={strides:b,pad:R,dataFormat:q,dimRoundingMode:re,filterShape:n};return wi.runKernel(x8,je,We)}const wN=Ci({conv2DBackpropFilter_:Soe});function TN(u,e,n){if(n==null||n==="linear")return u;if(n==="relu")return si(u,fk(e));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function AN(u,e){let n=e;const b=Hp(u.shape,e.shape);return b.length>0&&(n=Cl(n,b)),Pi(n,u.shape)}function SN(u,e,n,b){if(e==="linear")return u;if(e==="relu")return k_(u);if(e==="elu")return JR(u);if(e==="relu6")return N$(u);if(e==="prelu")return yN(u,n);if(e==="leakyrelu")return cN(u,b);if(e==="sigmoid")return VA(u);throw new Error(`Unknown fused activation ${e}.`)}const EN=(u,e)=>!(u>0)||e==="linear";function Eoe({x:u,filter:e,strides:n,pad:b,dataFormat:R="NHWC",dilations:q=[1,1],dimRoundingMode:re,bias:fe,activation:he="linear",preluActivationWeights:be,leakyreluAlpha:Pe}){if(he=he||"linear",EN(wi.state.gradientDepth,he)===!1){Jn(R==="NHWC",()=>`Error in fused conv2d: got dataFormat of ${R} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`);let yn=A2(u,e,n,b,R,q,re);return fe!=null&&(yn=Ko(yn,fe)),SN(yn,he,be,Pe)}const je=ya(u,"x","conv2d","float32"),We=ya(e,"filter","conv2d","float32");let ft=je,xt=!1;je.rank===3&&(xt=!0,ft=Pi(je,[1,je.shape[0],je.shape[1],je.shape[2]])),Jn(ft.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${ft.rank}.`),Jn(We.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${We.rank}.`),$m("fused conv2d",b,re);const zt=R==="NHWC"?ft.shape[3]:ft.shape[1];Jn(We.shape[2]===zt,()=>`Error in conv2d: depth of input (${zt}) must match input depth for filter ${We.shape[2]}.`),Jn(Fv(n,q),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${q}'`);const Ft=Ev(ft.shape,We.shape,n,q,b,re);let jt;fe!=null&&(jt=ya(fe,"bias","fused conv2d"),[jt]=ap(jt,je),R==="NHWC"?Yu(Ft.outShape,jt.shape):(Jn(jt.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${jt.shape.length}.`),Jn(jt.shape.length===0||jt.shape[0]===Ft.outChannels||jt.shape[0]===1,()=>`Error in fused conv2d: bias shape (${jt.shape}) is not compatible with the number of output channels (${Ft.outChannels})`)));let Re;if(be!=null){const yn=be.shape;if(Jn(yn.length<=1||yn.length===3,()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${yn.length}.`),yn.length===1)Jn(yn[0]===1||yn[0]===Ft.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${yn}) is not compatible with the number of output channels (${Ft.outChannels}).`);else if(yn.length===3)try{Yu(yn,Ft.outShape)}catch{const Vn=`Error in fused conv2d: PReLU activation weights (${yn}) is not compatible with the output shape of the conv2d (${Ft.outShape}).`;throw Error(Vn)}Re=ya(be,"prelu weights","fused conv2d")}const Lr=(yn,Pn)=>{Jn(R==="NHWC",()=>`Error in gradient of fused conv2D: got dataFormat of ${R} but only NHWC is currently supported.`);const[Vn,un,Nn,Kr]=Pn,Ma=TN(yn,Nn,he);Jn(w2(q),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${q}'`);const ui=aN(un.shape,Ma,Vn,n,b),da=wN(un,Ma,Vn.shape,n,b),Ia=[ui,da];if(Kr!=null){const aa=AN(Kr,Ma);Ia.push(aa)}return Ia},Cr={x:ft,filter:We,bias:jt,preluActivationWeights:Re},Gr={strides:n,pad:b,dataFormat:R,dilations:q,dimRoundingMode:re,activation:he,leakyreluAlpha:Pe};return fe==null?E2((Pn,Vn,un)=>{let Nn=wi.runKernel(yL,Cr,Gr);return un([Vn,Pn,Nn]),xt&&(Nn=Pi(Nn,[Nn.shape[1],Nn.shape[2],Nn.shape[3]])),{value:Nn,gradFunc:Lr}})(ft,We):E2((Pn,Vn,un,Nn)=>{let Kr=wi.runKernel(yL,Cr,Gr);return Nn([Vn,Pn,Kr,un]),xt&&(Kr=Pi(Kr,[Kr.shape[1],Kr.shape[2],Kr.shape[3]])),{value:Kr,gradFunc:Lr}})(ft,We,jt)}const Coe=Ci({fusedConv2d_:Eoe});function koe(u,e,n,b,R,q=[1,1],re){let fe=u;u.rank===3&&(fe=Pi(u,[1,u.shape[0],u.shape[1],u.shape[2]]));let he=e;he.rank===3&&(he=Pi(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const be={x:fe,dy:he},Pe={strides:b,pad:R,dimRoundingMode:re,dilations:q,filterShape:n};return wi.runKernel(C8,be,Pe)}const Moe=Ci({depthwiseConv2dNativeBackpropFilter_:koe});function Ioe(u,e,n,b,R,q=[1,1],re){let fe=e,he=!1;e.rank===3&&(he=!0,fe=Pi(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const be={dy:fe,filter:n},Pe={strides:b,pad:R,dimRoundingMode:re,dilations:q,inputShape:u},je=wi.runKernel(k8,be,Pe);return he?Pi(je,[je.shape[1],je.shape[2],je.shape[3]]):je}const Loe=Ci({depthwiseConv2dNativeBackpropInput_:Ioe});function Roe({a:u,b:e,transposeA:n=!1,transposeB:b=!1,bias:R,activation:q="linear",preluActivationWeights:re,leakyreluAlpha:fe=.2}){if(EN(wi.state.gradientDepth,q)===!1){let Kr=Uf(u,e,n,b);return R!=null&&(Kr=Ko(Kr,R)),SN(Kr,q,re,fe)}let he=ya(u,"a","fused matMul"),be=ya(e,"b","fused matMul");[he,be]=ap(he,be);const Pe=n?he.shape[he.rank-2]:he.shape[he.rank-1],je=b?be.shape[be.rank-1]:be.shape[be.rank-2],We=n?he.shape[he.rank-1]:he.shape[he.rank-2],ft=b?be.shape[be.rank-2]:be.shape[be.rank-1],xt=he.shape.slice(0,-2),zt=be.shape.slice(0,-2),Ft=xo(xt),jt=xo(zt);Jn(Pe===je,()=>`Error in fused matMul: inner shapes (${Pe}) and (${je}) of Tensors with shapes ${he.shape} and ${be.shape} and transposeA=${n} and transposeB=${b} must match.`);const Lr=Yu(he.shape.slice(0,-2),be.shape.slice(0,-2)).concat([We,ft]),Cr=n?Pi(he,[Ft,Pe,We]):Pi(he,[Ft,We,Pe]),Gr=b?Pi(be,[jt,ft,je]):Pi(be,[jt,je,ft]);let yn;R!=null&&(yn=ya(R,"bias","fused matMul"),[yn]=ap(yn,he),Yu(Lr,yn.shape));let Pn;re!=null&&(Pn=ya(re,"prelu weights","fused matMul"));const Vn=(Kr,Ma)=>{const[ui,da,Ia,aa]=Ma,Ka=TN(Pi(Kr,Ia.shape),Ia,q);let ai,Ui;if(!n&&!b?(ai=Uf(Ka,da,!1,!0),Ui=Uf(ui,Ka,!0,!1)):!n&&b?(ai=Uf(Ka,da,!1,!1),Ui=Uf(Ka,ui,!0,!1)):n&&!b?(ai=Uf(da,Ka,!1,!0),Ui=Uf(ui,Ka,!1,!1)):(ai=Uf(da,Ka,!0,!0),Ui=Uf(Ka,ui,!0,!0)),R!=null){const $i=AN(aa,Ka);return[ai,Ui,$i]}else return[ai,Ui]},un={a:Cr,b:Gr,bias:yn,preluActivationWeights:Pn},Nn={transposeA:n,transposeB:b,activation:q,leakyreluAlpha:fe};return R==null?E2((Ma,ui,da)=>{const Ia=wi.runKernel(gL,un,Nn);return da([Ma,ui,Ia]),{value:Pi(Ia,Lr),gradFunc:Vn}})(Cr,Gr):E2((Ma,ui,da,Ia)=>{const aa=wi.runKernel(gL,un,Nn);return Ia([Ma,ui,aa,da]),{value:Pi(aa,Lr),gradFunc:Vn}})(Cr,Gr,yn)}const Y9=Ci({fusedMatMul_:Roe});function Doe(u,e,n,b,R="bilinear",q=0){const re=ya(u,"image","cropAndResize"),fe=ya(e,"boxes","cropAndResize","float32"),he=ya(n,"boxInd","cropAndResize","int32"),be=fe.shape[0];Jn(re.rank===4,()=>`Error in cropAndResize: image must be rank 4,but got rank ${re.rank}.`),Jn(fe.rank===2&&fe.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${be},4] but had shape ${fe.shape}.`),Jn(he.rank===1&&he.shape[0]===be,()=>`Error in cropAndResize: boxInd must be have size [${be}] but had shape ${fe.shape}.`),Jn(b.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${b.length}.`),Jn(b[0]>=1&&b[1]>=1,()=>`cropSize must be atleast [1,1], but was ${b}`),Jn(R==="bilinear"||R==="nearest",()=>`method must be bilinear or nearest, but was ${R}`);const Pe={image:re,boxes:fe,boxInd:he},je={method:R,extrapolationValue:q,cropSize:b};return wi.runKernel(A8,Pe,je)}const Poe=Ci({cropAndResize_:Doe});function zoe(u){const e=ya(u,"image","flipLeftRight","float32");Jn(e.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${e.rank}.`);const n={image:e};return wi.runKernel(D8,n,{})}const Noe=Ci({flipLeftRight_:zoe});function Ooe(u){const e=ya(u,"image","grayscaleToRGB"),n=e.rank-1,b=e.shape[n];Jn(e.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${e.rank}.`),Jn(b===1,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${b}.`);const R=new Array(e.rank);return R.fill(1,0,n),R[n]=3,ny(e,R)}const Foe=Ci({grayscaleToRGB_:Ooe});function Boe(u){const e=ya(u,"image","RGBToGrayscale"),n=e.rank-1,b=e.shape[n];Jn(e.rank>=2,()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${e.rank}.`),Jn(b===3,()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${b}.`);const R=e.dtype,q=Gs(e,"float32"),re=og([.2989,.587,.114]);let fe;switch(e.rank){case 2:fe=VE("ij,j->i",q,re);break;case 3:fe=VE("ijk,k->ij",q,re);break;case 4:fe=VE("ijkl,l->ijk",q,re);break;case 5:fe=VE("ijklm,m->ijkl",q,re);break;case 6:fe=VE("ijklmn,n->ijklm",q,re);break;default:throw new Error("Not a valid tensor rank.")}return fe=zm(fe,-1),Gs(fe,R)}const Uoe=Ci({rgbToGrayscale_:Boe});function $oe(u,e,n=0,b=.5){const R=ya(u,"image","rotateWithOffset","float32");Jn(R.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${R.rank}.`);const q={image:R},re={radians:e,fillValue:n,center:b};return wi.runKernel(J8,q,re)}const Voe=Ci({rotateWithOffset_:$oe});function GA(u,e,n,b,R,q){b==null&&(b=.5),R==null&&(R=Number.NEGATIVE_INFINITY),q==null&&(q=0);const re=u.shape[0];return n=Math.min(n,re),Jn(0<=b&&b<=1,()=>`iouThreshold must be in [0, 1], but was '${b}'`),Jn(u.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${u.rank}'`),Jn(u.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${u.shape[1]}`),Jn(e.rank===1,()=>"scores must be a 1D tensor"),Jn(e.shape[0]===re,()=>`scores has incompatible shape with boxes. Expected ${re}, but was ${e.shape[0]}`),Jn(0<=q&&q<=1,()=>`softNmsSigma must be in [0, 1], but was '${q}'`),{maxOutputSize:n,iouThreshold:b,scoreThreshold:R,softNmsSigma:q}}function joe(u,e,n,b=.5,R=Number.NEGATIVE_INFINITY){const q=ya(u,"boxes","nonMaxSuppression","float32"),re=ya(e,"scores","nonMaxSuppression","float32"),fe=GA(q,re,n,b,R);n=fe.maxOutputSize,b=fe.iouThreshold,R=fe.scoreThreshold;const he={maxOutputSize:n,iouThreshold:b,scoreThreshold:R};return wi.runKernel(B8,{boxes:q,scores:re},he)}const Goe=Ci({nonMaxSuppression_:joe});function qoe(u,e,n){const b=Hoe(u,e,n),R=b<0?-(b+1):b;u.splice(R,0,e)}function Hoe(u,e,n){return Xoe(u,e,n||Woe)}function Woe(u,e){return u>e?1:u>>1);const fe=n(e,u[q]);fe>0?b=q+1:(R=q,re=!fe)}return re?b:-b-1}function CN(u,e,n,b,R){return IN(u,e,n,b,R,0)}function kN(u,e,n,b,R,q){return IN(u,e,n,b,R,0,!1,q,!0)}function MN(u,e,n,b,R,q){return IN(u,e,n,b,R,q,!0)}function IN(u,e,n,b,R,q,re=!1,fe=!1,he=!1){const be=[];for(let Ft=0;FtR&&be.push({score:e[Ft],boxIndex:Ft,suppressBeginIndex:0});be.sort(Z9);const Pe=q>0?-.5/q:0,je=[],We=[];for(;je.length0;){const Ft=be.pop(),{score:jt,boxIndex:Re,suppressBeginIndex:Lr}=Ft;if(jt=Lr;--Gr){const yn=Yoe(u,Re,je[Gr]);if(yn>=b){Cr=!0;break}if(Ft.score=Ft.score*Zoe(b,Pe,yn),Ft.score<=R)break}Ft.suppressBeginIndex=je.length,Cr||(Ft.score===jt?(je.push(Re),We.push(Ft.score)):Ft.score>R&&qoe(be,Ft,Z9))}const ft=je.length,xt=n-ft;fe&&xt>0&&(je.push(...new Array(xt).fill(0)),We.push(...new Array(xt).fill(0)));const zt={selectedIndices:je};return re&&(zt.selectedScores=We),he&&(zt.validOutputs=ft),zt}function Yoe(u,e,n){const b=u.subarray(e*4,e*4+4),R=u.subarray(n*4,n*4+4),q=Math.min(b[0],b[2]),re=Math.min(b[1],b[3]),fe=Math.max(b[0],b[2]),he=Math.max(b[1],b[3]),be=Math.min(R[0],R[2]),Pe=Math.min(R[1],R[3]),je=Math.max(R[0],R[2]),We=Math.max(R[1],R[3]),ft=(fe-q)*(he-re),xt=(je-be)*(We-Pe);if(ft<=0||xt<=0)return 0;const zt=Math.max(q,be),Ft=Math.max(re,Pe),jt=Math.min(fe,je),Re=Math.min(he,We),Lr=Math.max(jt-zt,0)*Math.max(Re-Ft,0);return Lr/(ft+xt-Lr)}function Zoe(u,e,n){const b=Math.exp(e*n*n);return n<=u?b:0}function Z9(u,e){return u.score-e.score||u.score===e.score&&e.boxIndex-u.boxIndex}async function Koe(u,e,n,b=.5,R=Number.NEGATIVE_INFINITY){const q=ya(u,"boxes","nonMaxSuppressionAsync"),re=ya(e,"scores","nonMaxSuppressionAsync"),fe=GA(q,re,n,b,R);n=fe.maxOutputSize,b=fe.iouThreshold,R=fe.scoreThreshold;const he=await Promise.all([q.data(),re.data()]),be=he[0],Pe=he[1],{selectedIndices:je}=CN(be,Pe,n,b,R);return q!==u&&q.dispose(),re!==e&&re.dispose(),og(je,"int32")}const Joe=Koe;function Qoe(u,e,n,b=.5,R=Number.NEGATIVE_INFINITY,q=0){const re=ya(u,"boxes","nonMaxSuppression"),fe=ya(e,"scores","nonMaxSuppression"),he=GA(re,fe,n,b,R,q);n=he.maxOutputSize,b=he.iouThreshold,R=he.scoreThreshold,q=he.softNmsSigma;const be={boxes:re,scores:fe},Pe={maxOutputSize:n,iouThreshold:b,scoreThreshold:R,softNmsSigma:q},je=wi.runKernel($8,be,Pe);return{selectedIndices:je[0],selectedScores:je[1]}}const ese=Ci({nonMaxSuppressionWithScore_:Qoe});async function tse(u,e,n,b=.5,R=Number.NEGATIVE_INFINITY,q=0){const re=ya(u,"boxes","nonMaxSuppressionAsync"),fe=ya(e,"scores","nonMaxSuppressionAsync"),he=GA(re,fe,n,b,R,q);n=he.maxOutputSize,b=he.iouThreshold,R=he.scoreThreshold,q=he.softNmsSigma;const be=await Promise.all([re.data(),fe.data()]),Pe=be[0],je=be[1],{selectedIndices:We,selectedScores:ft}=MN(Pe,je,n,b,R,q);return re!==u&&re.dispose(),fe!==e&&fe.dispose(),{selectedIndices:og(We,"int32"),selectedScores:og(ft)}}const rse=tse;function nse(u,e,n,b=.5,R=Number.NEGATIVE_INFINITY,q=!1){const re=ya(u,"boxes","nonMaxSuppression"),fe=ya(e,"scores","nonMaxSuppression"),he=GA(re,fe,n,b,R,null),be=he.maxOutputSize,Pe=he.iouThreshold,je=he.scoreThreshold,We={boxes:re,scores:fe},ft={maxOutputSize:be,iouThreshold:Pe,scoreThreshold:je,padToMaxOutputSize:q},xt=wi.runKernel(U8,We,ft);return{selectedIndices:xt[0],validOutputs:xt[1]}}const ase=Ci({nonMaxSuppressionPadded_:nse});async function ise(u,e,n,b=.5,R=Number.NEGATIVE_INFINITY,q=!1){const re=ya(u,"boxes","nonMaxSuppressionAsync"),fe=ya(e,"scores","nonMaxSuppressionAsync"),he=GA(re,fe,n,b,R,null),be=he.maxOutputSize,Pe=he.iouThreshold,je=he.scoreThreshold,[We,ft]=await Promise.all([re.data(),fe.data()]),{selectedIndices:xt,validOutputs:zt}=kN(We,ft,be,Pe,je,q);return re!==u&&re.dispose(),fe!==e&&fe.dispose(),{selectedIndices:og(xt,"int32"),validOutputs:Pu(zt,"int32")}}const ose=ise;function sse(u,e,n=!1,b=!1){const R=ya(u,"images","resizeBilinear");Jn(R.rank===3||R.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${R.rank}.`),Jn(e.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${e}.`),Jn(b===!1||n===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let q=R,re=!1;R.rank===3&&(re=!0,q=Pi(R,[1,R.shape[0],R.shape[1],R.shape[2]]));const fe={images:q},he={alignCorners:n,halfPixelCenters:b,size:e},be=wi.runKernel(zR,fe,he);return re?Pi(be,[be.shape[1],be.shape[2],be.shape[3]]):be}const Y$=Ci({resizeBilinear_:sse});function lse(u,e,n=!1,b=!1){const R=ya(u,"images","resizeNearestNeighbor");Jn(R.rank===3||R.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${R.rank}.`),Jn(e.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${e}.`),Jn(R.dtype==="float32"||R.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),Jn(b===!1||n===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let q=R,re=!1;R.rank===3&&(re=!0,q=Pi(R,[1,R.shape[0],R.shape[1],R.shape[2]]));const fe={images:q},he={alignCorners:n,halfPixelCenters:b,size:e},be=wi.runKernel(PR,fe,he);return re?Pi(be,[be.shape[1],be.shape[2],be.shape[3]]):be}const Z$=Ci({resizeNearestNeighbor_:lse});function use(u,e="binary",n=!1,b=.5){const R=ya(u,"image","threshold"),q=.2989,re=.587,fe=.114,he=R.shape[0]*R.shape[1];let be=si(og([b]),255),Pe,je,We,ft;if(Jn(R.rank===3,()=>`Error in threshold: image must be rank 3,but got rank ${R.rank}.`),Jn(R.shape[2]===3||R.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${R.shape[2]}.`),Jn(R.dtype==="int32"||R.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${R.dtype}.`),Jn(e==="otsu"||e==="binary",()=>`Method must be binary or otsu, but was ${e}`),R.shape[2]===3){[Pe,je,We]=Bg(R,[1,1,1],-1);const Ft=si(Pe,q),jt=si(je,re),Re=si(We,fe);ft=Ko(Ko(Ft,jt),Re)}else ft=u;if(e==="otsu"){const Ft=une(Gs(O$(ft),"int32"),h$([]),256);be=cse(Ft,he)}const xt=n?jA(ft,be):Vg(ft,be);return Gs(si(xt,255),"int32")}function cse(u,e){let n=og([-1]),b=og([0]),R=og([0]),q,re,fe,he,be,Pe;for(let je=0;je`Error in transform: image must be rank 4,but got rank ${re.rank}.`),Jn(fe.rank===2&&(fe.shape[0]===re.shape[0]||fe.shape[0]===1)&&fe.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),Jn(q==null||q.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${q}.`);const he={image:re,transforms:fe},be={interpolation:n,fillMode:b,fillValue:R,outputShape:q};return wi.runKernel(Z8,he,be)}const dse=Ci({transform_:hse});function pse(u,e,n){const b=ya(u,"a","bandPart");Jn(b.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${b.rank}.`);const R=b.shape,[q,re]=b.shape.slice(-2);let fe,he;typeof e=="number"?(Jn(e%1===0,()=>`bandPart(): numLower must be an integer, got ${e}.`),Jn(e<=q,()=>`bandPart(): numLower (${e}) must not be greater than the number of rows (${q}).`),fe=ya(e<0?q:e,"numLower","bandPart")):(Jn(e.dtype==="int32",()=>"bandPart(): numLower's dtype must be an int32."),fe=mm(wL(e,0),q,LA(e,q))),typeof n=="number"?(Jn(n%1===0,()=>`bandPart(): numUpper must be an integer, got ${n}.`),Jn(n<=re,()=>`bandPart(): numUpper (${n}) must not be greater than the number of columns (${re}).`),he=ya(n<0?re:n,"numUpper","bandPart")):(Jn(n.dtype==="int32",()=>"bandPart(): numUpper's dtype must be an int32."),he=mm(wL(n,0),re,LA(n,re)));const be=Pi(nC(0,q,1,"int32"),[-1,1]),Pe=nC(0,re,1,"int32"),je=bl(be,Pe),We=x_(jA(je,fe),P2(je,dd(he))),ft=Mp([q,re],b.dtype);return Pi(b_(k2(Pi(b,[-1,q,re])).map(xt=>mm(We,xt,ft))),R)}const vse=Ci({bandPart_:pse});function mse(u){let e;if(Array.isArray(u)){e=!1,Jn(u!=null&&u.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");const R=u[0].shape[0];for(let q=1;q`Gram-Schmidt: Non-unique lengths found in the input vectors: (${u[q].shape[0]} vs. ${R})`)}else e=!0,u=Bg(u,u.shape[0],0).map(R=>ck(R,[0]));Jn(u.length<=u[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${u.length}) exceeds number of dimensions (${u[0].shape[0]}).`);const n=[],b=u;for(let R=0;R{let q=b[R];if(R>0)for(let re=0;re=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${u.rank}`),u.rank===2)return K9(u,e);{const n=u.shape.slice(0,u.shape.length-2).reduce((he,be)=>he*be),b=k2(Pi(u,[n,u.shape[u.shape.length-2],u.shape[u.shape.length-1]]),0),R=[],q=[];b.forEach(he=>{const[be,Pe]=K9(he,e);R.push(be),q.push(Pe)});const re=Pi(b_(R,0),u.shape),fe=Pi(b_(q,0),u.shape);return[re,fe]}}function K9(u,e=!1){return wi.tidy(()=>{Jn(u.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${u.shape.length}D Tensor.`);const n=u.shape[0],b=u.shape[1];let R=L$(n),q=m2(u);const re=p2([[1]],[1,1]);let fe=m2(re);const he=n>=b?b:n;for(let be=0;be{const ft=Vh(q,[be,be],[n-be,1]),xt=QR(ft),zt=Vh(q,[be,be],[1,1]),Ft=mm(Vg(zt,0),p2([[-1]]),p2([[1]])),jt=bl(zt,si(Ft,xt)),Re=Vl(ft,jt);Re.shape[0]===1?fe=m2(re):fe=Fm([re,Vh(Re,[1,0],[Re.shape[0]-1,Re.shape[1]])],0);const Lr=dd(Vl(Uf(Ft,jt),xt)),Cr=Vh(q,[be,0],[n-be,b]),Gr=si(Lr,fe),yn=ef(fe);if(be===0)q=bl(Cr,Uf(Gr,Uf(yn,Cr)));else{const un=bl(Cr,Uf(Gr,Uf(yn,Cr)));q=Fm([Vh(q,[0,0],[be,b]),un],0)}const Pn=ef(Gr),Vn=Vh(R,[0,be],[n,R.shape[1]-be]);if(be===0)R=bl(Vn,Uf(Uf(Vn,fe),Pn));else{const un=bl(Vn,Uf(Uf(Vn,fe),Pn));R=Fm([Vh(R,[0,0],[n,be]),un],1)}return[fe,q,R]}),zc([Pe,je,We])}return!e&&n>b&&(R=Vh(R,[0,0],[n,b]),q=Vh(q,[0,0],[b,b])),[R,q]})}const _se=Ci({qr_:yse});var Om;(function(u){u[u.NONE=0]="NONE",u[u.MEAN=1]="MEAN",u[u.SUM=2]="SUM",u[u.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(Om||(Om={}));function xse(u,e,n=Om.SUM_BY_NONZERO_WEIGHTS){const b=ya(u,"losses","computeWeightedLoss");let R=null;e!=null&&(R=ya(e,"weights","computeWeightedLoss"));const q=R==null?b:si(b,R);if(n===Om.NONE)return q;if(n===Om.SUM)return Cl(q);if(n===Om.MEAN){if(R==null)return rp(q);{const re=b.size/R.size,fe=Vl(Cl(q),Cl(R));return re>1?Vl(fe,Pu(re)):fe}}if(n===Om.SUM_BY_NONZERO_WEIGHTS){if(R==null)return Vl(Cl(q),Pu(b.size));{const re=si(R,C_(b.shape)),fe=Gs(Cl(rC(re,Pu(0))),"float32");return Vl(Cl(q),fe)}}throw Error(`Unknown reduction: ${n}`)}const M_=Ci({computeWeightedLoss_:xse});function bse(u,e,n,b=Om.SUM_BY_NONZERO_WEIGHTS){const R=ya(u,"labels","absoluteDifference"),q=ya(e,"predictions","absoluteDifference");let re=null;n!=null&&(re=ya(n,"weights","absoluteDifference")),b0(R.shape,q.shape,"Error in absoluteDifference: ");const fe=iv(bl(R,q));return M_(fe,re,b)}const wse=Ci({absoluteDifference_:bse});function Tse(u,e,n,b,R=Om.SUM_BY_NONZERO_WEIGHTS){const q=ya(u,"labels","cosineDistance"),re=ya(e,"predictions","cosineDistance");let fe=null;b!=null&&(fe=ya(b,"weights","cosineDistance")),b0(q.shape,re.shape,"Error in cosineDistance: ");const he=Pu(1),be=bl(he,Cl(si(q,re),n,!0));return M_(be,fe,R)}const Ase=Ci({cosineDistance_:Tse});function Sse(u,e,n,b=Om.SUM_BY_NONZERO_WEIGHTS){let R=ya(u,"labels","hingeLoss");const q=ya(e,"predictions","hingeLoss");let re=null;n!=null&&(re=ya(n,"weights","hingeLoss")),b0(R.shape,q.shape,"Error in hingeLoss: ");const fe=Pu(1);R=bl(si(Pu(2),R),fe);const he=k_(bl(fe,si(R,q)));return M_(he,re,b)}const Ese=Ci({hingeLoss_:Sse});function Cse(u,e,n,b=1,R=Om.SUM_BY_NONZERO_WEIGHTS){const q=ya(u,"labels","huberLoss"),re=ya(e,"predictions","huberLoss");let fe=null;n!=null&&(fe=ya(n,"weights","huberLoss")),b0(q.shape,re.shape,"Error in huberLoss: ");const he=Pu(b),be=iv(bl(re,q)),Pe=LA(be,he),je=bl(be,Pe),We=Ko(si(Pu(.5),jh(Pe)),si(he,je));return M_(We,fe,R)}const kse=Ci({huberLoss_:Cse});function Mse(u,e,n,b=1e-7,R=Om.SUM_BY_NONZERO_WEIGHTS){const q=ya(u,"labels","logLoss"),re=ya(e,"predictions","logLoss");let fe=null;n!=null&&(fe=ya(n,"weights","logLoss")),b0(q.shape,re.shape,"Error in logLoss: ");const he=Pu(1),be=Pu(b),Pe=dd(si(q,_0(Ko(re,be)))),je=si(bl(he,q),_0(Ko(bl(he,re),be))),We=bl(Pe,je);return M_(We,fe,R)}const Ise=Ci({logLoss_:Mse});function Lse(u,e,n,b=Om.SUM_BY_NONZERO_WEIGHTS){const R=ya(u,"labels","meanSquaredError"),q=ya(e,"predictions","meanSquaredError");let re=null;n!=null&&(re=ya(n,"weights","meanSquaredError")),b0(R.shape,q.shape,"Error in meanSquaredError: ");const fe=q$(R,q);return M_(fe,re,b)}const Rse=Ci({meanSquaredError_:Lse});function Dse(u,e){const n=ya(u,"labels","sigmoidCrossEntropyWithLogits"),b=ya(e,"logits","sigmoidCrossEntropyWithLogits");b0(n.shape,b.shape,"Error in sigmoidCrossEntropyWithLogits: ");const R=k_(b),q=si(b,n),re=fN($g(dd(iv(b))));return Ko(bl(R,q),re)}function Pse(u,e,n,b=0,R=Om.SUM_BY_NONZERO_WEIGHTS){let q=ya(u,"multiClassLabels","sigmoidCrossEntropy");const re=ya(e,"logits","sigmoidCrossEntropy");let fe=null;if(n!=null&&(fe=ya(n,"weights","sigmoidCrossEntropy")),b0(q.shape,re.shape,"Error in sigmoidCrossEntropy: "),b>0){const be=Pu(b),Pe=Pu(1),je=Pu(.5);q=Ko(si(q,bl(Pe,be)),si(je,be))}const he=Dse(q,re);return M_(he,fe,R)}const zse=Ci({sigmoidCrossEntropy_:Pse});function Nse(u,e,n=-1){if(n===-1&&(n=e.rank-1),n!==e.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${e.rank} and dim was ${n}`);return E2((R,q,re)=>{const he=hN(q,[n],!0),be=bl(Gs(q,"float32"),he);re([R,be]);const Pe=dd(si(be,R));return{value:Cl(Pe,[n]),gradFunc:(ft,xt)=>{const[zt,Ft]=xt,jt=ip(ft.shape,[n]);return[si(Pi(ft,jt),bl(Gs(zt,"float32"),$g(Ft))),si(Pi(ft,jt),bl($g(Ft),Gs(zt,"float32")))]}}})(u,e)}function Ose(u,e,n,b=0,R=Om.SUM_BY_NONZERO_WEIGHTS){let q=ya(u,"onehotLabels","softmaxCrossEntropy");const re=ya(e,"logits","softmaxCrossEntropy");let fe=null;if(n!=null&&(fe=ya(n,"weights","softmaxCrossEntropy")),b0(q.shape,re.shape,"Error in softmaxCrossEntropy: "),b>0){const be=Pu(b),Pe=Pu(1),je=Pu(q.shape[1]);q=Ko(si(q,bl(Pe,be)),Vl(be,je))}const he=Nse(q,re);return M_(he,fe,R)}const Fse=Ci({softmaxCrossEntropy_:Ose});const y_={flipLeftRight:Noe,grayscaleToRGB:Foe,resizeNearestNeighbor:Z$,resizeBilinear:Y$,rgbToGrayscale:Uoe,rotateWithOffset:Voe,cropAndResize:Poe,nonMaxSuppression:Goe,nonMaxSuppressionAsync:Joe,nonMaxSuppressionWithScore:ese,nonMaxSuppressionWithScoreAsync:rse,nonMaxSuppressionPadded:ase,nonMaxSuppressionPaddedAsync:ose,threshold:fse,transform:dse},Bse={bandPart:vse,gramSchmidt:gse,qr:_se},Use={absoluteDifference:wse,computeWeightedLoss:M_,cosineDistance:Ase,hingeLoss:Ese,huberLoss:kse,logLoss:Ise,meanSquaredError:Rse,sigmoidCrossEntropy:zse,softmaxCrossEntropy:Fse};const $se=new Map,Vse=new Map;class qA{getClassName(){return this.constructor.className}static fromConfig(e,n){return new e(n)}}class v0{constructor(){this.classNameMap={}}static getMap(){return v0.instance==null&&(v0.instance=new v0),v0.instance}static register(e){v0.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Wo(u,e,n){Jn(u.className!=null,()=>"Class being registered does not have the static className property defined."),Jn(typeof u.className=="string",()=>"className is required to be a string, but got type "+typeof u.className),Jn(u.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),typeof e>"u"&&(e="Custom"),typeof n>"u"&&(n=u.className);const b=n,R=e+">"+b;return v0.register(u),$se.set(R,u),Vse.set(u,R),u}class bb extends qA{minimize(e,n=!1,b){const{value:R,grads:q}=this.computeGradients(e,b);if(b!=null){const re=b.map(fe=>({name:fe.name,tensor:q[fe.name]}));this.applyGradients(re)}else this.applyGradients(q);return zc(q),n?R:(R.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,n){return Iae(e,n)}dispose(){this.iterations_!=null&&zc(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:Pu(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty(bb,Symbol.hasInstance,{value:u=>u.minimize!=null&&u.computeGradients!=null&&u.applyGradients!=null});class K$ extends bb{static get className(){return"Adadelta"}constructor(e,n,b=null){super(),this.learningRate=e,this.rho=n,this.epsilon=b,this.accumulatedGrads=[],this.accumulatedUpdates=[],b==null&&(this.epsilon=wi.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(b=>b.name):Object.keys(e)).forEach((b,R)=>{const q=wi.registeredVariables[b],re=!1;this.accumulatedGrads[R]==null&&(this.accumulatedGrads[R]={originalName:`${b}/accum_grad`,variable:Zi(()=>tf(q).variable(re))}),this.accumulatedUpdates[R]==null&&(this.accumulatedUpdates[R]={originalName:`${b}/accum_var`,variable:Zi(()=>tf(q).variable(re))});const fe=Array.isArray(e)?e[R].tensor:e[b];if(fe==null)return;const he=this.accumulatedGrads[R].variable,be=this.accumulatedUpdates[R].variable;Zi(()=>{const Pe=Ko(si(he,this.rho),si(jh(fe),1-this.rho)),je=si(Vl(Ov(Ko(be,this.epsilon)),Ov(Ko(he,this.epsilon))),fe),We=Ko(si(be,this.rho),si(jh(je),1-this.rho));he.assign(Pe),be.assign(We);const ft=Ko(si(je,-this.learningRate),q);q.assign(ft)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(zc(this.accumulatedGrads.map(e=>e.variable)),zc(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map(n=>({name:n.originalName,tensor:n.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=e.length/2,b=!1;this.accumulatedGrads=e.slice(0,n).map(R=>({originalName:R.name,variable:R.tensor.variable(b)})),this.accumulatedUpdates=e.slice(n,n*2).map(R=>({originalName:R.name,variable:R.tensor.variable(b)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,n){return new e(n.learningRate,n.rho,n.epsilon)}}class J$ extends bb{static get className(){return"Adagrad"}constructor(e,n=.1){super(),this.learningRate=e,this.initialAccumulatorValue=n,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(b=>b.name):Object.keys(e)).forEach((b,R)=>{const q=wi.registeredVariables[b];this.accumulatedGrads[R]==null&&(this.accumulatedGrads[R]={originalName:`${b}/accumulator`,variable:Zi(()=>KR(q.shape,this.initialAccumulatorValue).variable(!1))});const re=Array.isArray(e)?e[R].tensor:e[b];if(re==null)return;const fe=this.accumulatedGrads[R].variable;Zi(()=>{const he=Ko(fe,jh(re));fe.assign(he);const be=Ko(si(Vl(re,Ov(Ko(he,wi.backend.epsilon()))),-this.learningRate),q);q.assign(be)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&zc(this.accumulatedGrads.map(e=>e.variable))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=!1;this.accumulatedGrads=e.map(b=>({originalName:b.name,variable:b.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,n){return new e(n.learningRate,n.initialAccumulatorValue)}}class Q$ extends bb{static get className(){return"Adam"}constructor(e,n,b,R=null){super(),this.learningRate=e,this.beta1=n,this.beta2=b,this.epsilon=R,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Zi(()=>{this.accBeta1=Pu(n).variable(),this.accBeta2=Pu(b).variable()}),R==null&&(this.epsilon=wi.backend.epsilon())}applyGradients(e){const n=Array.isArray(e)?e.map(b=>b.name):Object.keys(e);Zi(()=>{const b=bl(1,this.accBeta1),R=bl(1,this.accBeta2);n.forEach((q,re)=>{const fe=wi.registeredVariables[q],he=!1;this.accumulatedFirstMoment[re]==null&&(this.accumulatedFirstMoment[re]={originalName:`${q}/m`,variable:Zi(()=>tf(fe).variable(he))}),this.accumulatedSecondMoment[re]==null&&(this.accumulatedSecondMoment[re]={originalName:`${q}/v`,variable:Zi(()=>tf(fe).variable(he))});const be=Array.isArray(e)?e[re].tensor:e[q];if(be==null)return;const Pe=this.accumulatedFirstMoment[re].variable,je=this.accumulatedSecondMoment[re].variable,We=Ko(si(Pe,this.beta1),si(be,1-this.beta1)),ft=Ko(si(je,this.beta2),si(jh(be),1-this.beta2)),xt=Vl(We,b),zt=Vl(ft,R);Pe.assign(We),je.assign(ft);const Ft=Ko(si(Vl(xt,Ko(Ov(zt),this.epsilon)),-this.learningRate),fe);fe.assign(Ft)}),this.accBeta1.assign(si(this.accBeta1,this.beta1)),this.accBeta2.assign(si(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&zc(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&zc(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map(n=>({name:n.originalName,tensor:n.variable})))}async setWeights(e){e=await this.extractIterations(e),Zi(()=>{this.accBeta1.assign(S2(this.beta1,this.iterations_+1)),this.accBeta2.assign(S2(this.beta2,this.iterations_+1))});const n=e.length/2,b=!1;this.accumulatedFirstMoment=e.slice(0,n).map(R=>({originalName:R.name,variable:R.tensor.variable(b)})),this.accumulatedSecondMoment=e.slice(n,n*2).map(R=>({originalName:R.name,variable:R.tensor.variable(b)}))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,n){return new e(n.learningRate,n.beta1,n.beta2,n.epsilon)}}class eV extends bb{static get className(){return"Adamax"}constructor(e,n,b,R=null,q=0){super(),this.learningRate=e,this.beta1=n,this.beta2=b,this.epsilon=R,this.decay=q,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],Zi(()=>{this.iteration=Pu(0).variable(),this.accBeta1=Pu(n).variable()}),R==null&&(this.epsilon=wi.backend.epsilon())}applyGradients(e){const n=Array.isArray(e)?e.map(b=>b.name):Object.keys(e);Zi(()=>{const b=bl(1,this.accBeta1),R=Vl(-this.learningRate,Ko(si(this.iteration,this.decay),1));n.forEach((q,re)=>{const fe=wi.registeredVariables[q],he=!1;this.accumulatedFirstMoment[re]==null&&(this.accumulatedFirstMoment[re]={originalName:`${q}/m`,variable:tf(fe).variable(he)}),this.accumulatedWeightedInfNorm[re]==null&&(this.accumulatedWeightedInfNorm[re]={originalName:`${q}/v`,variable:tf(fe).variable(he)});const be=Array.isArray(e)?e[re].tensor:e[q];if(be==null)return;const Pe=this.accumulatedFirstMoment[re].variable,je=this.accumulatedWeightedInfNorm[re].variable,We=Ko(si(Pe,this.beta1),si(be,1-this.beta1)),ft=si(je,this.beta2),xt=iv(be),zt=xb(ft,xt);Pe.assign(We),je.assign(zt);const Ft=Ko(si(Vl(R,b),Vl(We,Ko(zt,this.epsilon))),fe);fe.assign(Ft)}),this.iteration.assign(Ko(this.iteration,1)),this.accBeta1.assign(si(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&zc(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&zc(this.accumulatedWeightedInfNorm.map(e=>e.variable))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,n){return new e(n.learningRate,n.beta1,n.beta2,n.epsilon,n.decay)}}class LN extends bb{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(b=>b.name):Object.keys(e)).forEach((b,R)=>{const q=Array.isArray(e)?e[R].tensor:e[b];if(q==null)return;const re=wi.registeredVariables[b];Zi(()=>{const fe=Ko(si(this.c,q),re);re.assign(fe)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=f1(Pu(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(e=await this.extractIterations(e),e.length!==0)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,n){return new e(n.learningRate)}}class tV extends LN{static get className(){return"Momentum"}constructor(e,n,b=!1){super(e),this.learningRate=e,this.momentum=n,this.useNesterov=b,this.accumulations=[],this.m=Pu(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(b=>b.name):Object.keys(e)).forEach((b,R)=>{const q=wi.registeredVariables[b];this.accumulations[R]==null&&(this.accumulations[R]={originalName:`${b}/momentum`,variable:Zi(()=>tf(q).variable(!1))});const re=this.accumulations[R].variable,fe=Array.isArray(e)?e[R].tensor:e[b];fe!=null&&Zi(()=>{let he;const be=Ko(si(this.m,re),fe);this.useNesterov?he=Ko(si(this.c,Ko(fe,si(be,this.m))),q):he=Ko(si(this.c,be),q),re.assign(be),q.assign(he)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&zc(this.accumulations.map(e=>e.variable))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=!1;this.accumulations=e.map(b=>({originalName:b.name,variable:b.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,n){return new e(n.learningRate,n.momentum,n.useNesterov)}}class rV extends bb{static get className(){return"RMSProp"}constructor(e,n=.9,b=0,R=null,q=!1){if(super(),this.learningRate=e,this.decay=n,this.momentum=b,this.epsilon=R,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=q,R==null&&(this.epsilon=wi.backend.epsilon()),e==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(b=>b.name):Object.keys(e)).forEach((b,R)=>{const q=wi.registeredVariables[b],re=!1;this.accumulatedMeanSquares[R]==null&&(this.accumulatedMeanSquares[R]={originalName:`${b}/rms`,variable:Zi(()=>tf(q).variable(re))}),this.accumulatedMoments[R]==null&&(this.accumulatedMoments[R]={originalName:`${b}/momentum`,variable:Zi(()=>tf(q).variable(re))}),this.accumulatedMeanGrads[R]==null&&this.centered&&(this.accumulatedMeanGrads[R]={originalName:`${b}/mg`,variable:Zi(()=>tf(q).variable(re))});const fe=Array.isArray(e)?e[R].tensor:e[b];if(fe==null)return;const he=this.accumulatedMeanSquares[R].variable,be=this.accumulatedMoments[R].variable;Zi(()=>{const Pe=Ko(si(he,this.decay),si(jh(fe),1-this.decay));if(this.centered){const je=this.accumulatedMeanGrads[R].variable,We=Ko(si(je,this.decay),si(fe,1-this.decay)),ft=Vl(si(fe,this.learningRate),Ov(bl(Pe,Ko(jh(We),this.epsilon)))),xt=Ko(si(be,this.momentum),ft);he.assign(Pe),je.assign(We),be.assign(xt);const zt=bl(q,xt);q.assign(zt)}else{const je=Ko(si(he,this.decay),si(jh(fe),1-this.decay)),We=Ko(si(be,this.momentum),Vl(si(fe,this.learningRate),Ov(Ko(je,this.epsilon))));he.assign(je),be.assign(We);const ft=bl(q,We);q.assign(ft)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&zc(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&zc(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&zc(this.accumulatedMoments.map(e=>e.variable))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map(n=>({name:n.originalName,tensor:n.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=this.centered?e.length/3:e.length/2,b=!1;this.accumulatedMeanSquares=e.slice(0,n).map(R=>({originalName:R.name,variable:R.tensor.variable(b)})),this.accumulatedMoments=e.slice(n,n*2).map(R=>({originalName:R.name,variable:R.tensor.variable(b)})),this.centered&&(this.accumulatedMeanGrads=e.slice(n*2,n*3).map(R=>({originalName:R.name,variable:R.tensor.variable(b)})))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,n){return new e(n.learningRate,n.decay,n.momentum,n.epsilon,n.centered)}}const jse=[K$,J$,Q$,eV,tV,rV,LN];function Gse(){for(const u of jse)Wo(u)}function RN(u,e){const n=u.shape.length,b=e.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(b<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${b}.`);if(e.dtype!=="int32")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.shape[b-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${e.shape[b-1]} vs. ${n}`);if(xo(u.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${u.shape}.`);const R=e.shape,q=R[R.length-1];let re=1;for(let je=0;jeje/be),1].slice(0,q);return[he,re,be,Pe]}const $z=-2,qse=-1;function nV(u,e,n){const b=u.shape.length;Jn(b===e.length,()=>`Error in slice${b}D: Length of begin ${e} must match the rank of the array (${b}).`),Jn(b===n.length,()=>`Error in slice${b}D: Length of size ${n} must match the rank of the array (${b}).`);for(let R=0;R`Error in slice${b}D: begin[${R}] + size[${R}] (${e[R]+n[R]}) would overflow input.shape[${R}] (${u.shape[R]})`)}function aV(u,e,n){const b=[];for(let R=0;R1){b=R;break}for(let R=b+1;R0||n[R]!==u[R])return!1;return!0}function oV(u,e){let n=u.length>0?u[u.length-1]:1;for(let b=0;b{Jn(re!==-1,()=>"slice() does not support negative begin indexing.")});let q;return n==null?q=new Array(R).fill(-1):typeof n=="number"?q=[n,...new Array(R-1).fill(-1)]:n.lengthre>=0?re:(Jn(re===-1,()=>`Negative size values should be exactly -1 but got ${re} for the slice() size at index ${fe}.`),u.shape[fe]-b[fe])),[b,q]}function sV(u,e,n,b,R,q,re,fe,he){let be;if(b==null?(be=new Array(e.length),be.fill(1)):be=b,re!=null&&(re&re-1)!==0)throw new Error("Multiple ellipses in slice is not allowed.");let Pe=!1;const je={dims:be.length,numAddAxisAfterEllipsis:0,begin:e.slice(),end:n.slice(),strides:be.slice(),beginMask:R,endMask:q,ellipsisMask:re,newAxisMask:fe,shrinkAxisMask:he};for(let Lr=0;Lr0?0:-1,We.strides[Lr]>0?Gr:Gr-1];if(Cr&&We.strides[Lr]<=0)throw Error("only stride 1 allowed on non-range indexing.");zt=zt&&We.strides[Lr]===1;const Vn=!!(We.beginMask&1<=Gr)throw Error(`slice index ${We.begin[Lr]} of dimension ${Lr} out of bounds.`)}else We.begin[Lr]=J9(We.begin[Lr],0,We.strides[Lr],Gr,yn,Pn),We.end[Lr]=J9(We.end[Lr],1,We.strides[Lr],Gr,yn,Pn);const Kr=We.strides[Lr]===1&&We.begin[Lr]===0&&We.end[Lr]===Gr;ft=ft&&Kr,xt=xt&&(Lr===0&&We.strides[Lr]===1||Kr)}else ft=ft&&We.strides[Lr]===1&&Vn,xt=xt&&(Lr===0&&We.strides[Lr]===1||Vn);let un,Nn=!1;if(We.beginValid&&We.endValid?(un=We.end[Lr]-We.begin[Lr],Nn=!0):Cr?(un=1,Nn=!0):Vn&&Gr>=0&&(We.strides[Lr]<0?un=-Gr:un=Gr,Nn=!0),Nn){let Kr;un===0||un<0!=We.strides[Lr]<0?Kr=0:Kr=Math.trunc(un/We.strides[Lr])+(un%We.strides[Lr]!==0?1:0),Ft.push(Kr)}else Ft.push(-1)}for(let Lr=0;Lr=0?jt.push(Ft[Cr]):Cr===$z&&jt.push(1)}return{finalShapeSparse:jt.filter((Lr,Cr)=>We.finalShapeGatherIndices[Cr]!==$z),finalShape:jt,isIdentity:ft,sliceDim0:xt,isSimpleSlice:zt,begin:We.begin,end:We.end,strides:We.strides}}function Hse(u,e){e.beginMask=0,e.endMask=0,e.shrinkAxisMask=0;let n=0;e.beginValid=u.begin!=null,e.endValid=u.end!=null,e.begin=new Array(e.dims),e.end=new Array(e.dims),e.strides=new Array(e.dims),e.finalShapeGatherIndices=[],e.finalShapeGatherIndicesSparse=[],e.inputShapeGatherIndicesSparse=new Array(e.dims);for(let b=0;b0?q[e]:q[e+1&1];{const re=u<0?b+u:u;return req[1]?q[1]:re}}class Wse{static sgd(e){return new LN(e)}static momentum(e,n,b=!1){return new tV(e,n,b)}static rmsprop(e,n=.9,b=0,R=null,q=!1){return new rV(e,n,b,R,q)}static adam(e=.001,n=.9,b=.999,R=null){return new Q$(e,n,b,R)}static adadelta(e=.001,n=.95,b=null){return new K$(e,n,b)}static adamax(e=.002,n=.9,b=.999,R=null,q=0){return new eV(e,n,b,R,q)}static adagrad(e,n=.1){return new J$(e,n)}}const Qx=Wse;const Xse=typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:u=>u();function SL(){return new Promise(u=>Xse(()=>u()))}function PN(u,e){const n=u[0].length;u.forEach((R,q)=>{Jn(R.length===n,()=>`Error in concat${n}D: rank of tensors[${q}] must be the same as the rank of the rest (${n})`)}),Jn(e>=0&&e`Error in concat${n}D: axis must be between 0 and ${n-1}.`);const b=u[0];u.forEach((R,q)=>{for(let re=0;re`Error in concat${n}D: Shape of tensors[${q}] (${R}) does not match the shape of the rest (${b}) along the non-concatenated axis ${q}.`)})}function h1(u,e){const n=u[0].slice();for(let b=1;b=0)if(fe>=0){if(fe!==q)throw new Error(`rt input.shape and shape=${e} are incompatible: rt input.shape[${R+u}] = ${q} but shape[${R+u}] = ${fe}`)}else b[re]=q}return b}function uV(u){const e={FIRST_DIM_SIZE:ry.FIRST_DIM_SIZE,VALUE_ROWIDS:ry.VALUE_ROWIDS,ROW_LENGTHS:ry.ROW_LENGTHS,ROW_SPLITS:ry.ROW_SPLITS,ROW_LIMITS:ry.ROW_LIMITS,ROW_STARTS:ry.ROW_STARTS},n=[];for(const b of u)if(b in e)n.push(e[b]);else break;return n}function cV(u){return u.length===0?0:u[0]===ry.FIRST_DIM_SIZE?u.length-1:u.length}function fV(u,e){if(u==null||e==null)return;const n=u.length,b=e.length;if(n>=b)throw new Error(`defaultValue.shape=${u} and ragged tensor flatValues.shape=${e}, are incompatible: defaultValue.rank = ${n} must be less than ragged tensor input flatValues.rank = ${b})`);for(let R=0;R=0&&re>=0&&q!==1&&q!==re)throw new Error(`defaultValue.shape=${u}, and ragged tensor input flatValues.shape=${e} are incompatible: defaultValue.shape[${R-u.length}] = ${q} but ragged tensor input.flatValues.shape[${R-u.length}] = ${re}`)}}const zN=30;function rD(u){return u<=zN?u:Sz(u,Math.floor(Math.sqrt(u)))}function NN(u,e,n){const b=n*(typeof u=="number"?u:u[0]),R=e*(typeof u=="number"?u:u[1]);return[b,R]}function hk(u,e,n,b=!0){let R=[];if(b)R=R.concat(e.slice(0)),R.push(u[0]/n),R=R.concat(u.slice(1));else{R=R.concat(u[0]);const q=e.length;for(let re=0;re=e*2+1||re%2===1?q.push(re):R.push(re);b.push(...R),b.push(0),b.push(...q)}return b}function pk(u,e,n,b=!0){const R=[];b?R.push(u[0]/n):R.push(u[0]*n);for(let q=1;q/g,Q9=",",eB="...";function HN(u,e){u=u.replace(/\s/g,"");const n=(u.length-u.replace(Yse,"").length)/nz.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${nz}").`);const[b,R]=u.split(nz);Jn(b.indexOf(eB)===-1,()=>`The ellipsis notation ("${eB}") is not supported yet.`);const q=b.split(Q9),re=q.length;if(e!==re)throw new Error(`Expected ${re} input tensors, received ${e}`);if(re>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const fe=[];for(let We=0;Wext.indexOf(ft)!==-1))throw new Error(`Output subscripts contain the label ${ft} not present in the input subscripts.`);fe.indexOf(ft)===-1&&fe.push(ft)}for(let We=0;WeR!==-1),{permutationIndices:n,expandDims:b}}function XN(u,e,n){const b=new Array(u);for(let R=0;R`Expected dimension ${b[e[R][re]]} at axis ${re} of input shaped ${JSON.stringify(q)}, but got dimension ${q[re]}`)}}function YN(u,e){const n=u,b=[];let R=0;u.length===0&&n.push(-1),R=u.length+1;for(let re=0;ree===n)}function Zse(u,e){const n=[];for(let b=0;b"Number of splits must evenly divide the axis."),b=new Array(e).fill(u.shape[n]/e);else{const R=e.reduce((re,fe)=>(fe===-1&&(re+=1),re),0);Jn(R<=1,()=>"There should be only one negative value in split array.");const q=e.indexOf(-1);if(q!==-1){const re=e.reduce((fe,he)=>he>0?fe+he:fe);e[q]=u.shape[n]-re}Jn(u.shape[n]===e.reduce((re,fe)=>re+fe),()=>"The sum of sizes must match the size of the axis dimension."),b=e}return b}function yV(u){return`Received SparseTensor with denseShape[0] = 0 but + indices.shape[0] = ${u}`}function _V(u,e){return`indices(${u}, 0) is invalid: ${e} < 0`}function xV(u,e,n){return`indices(${u}, 0) is invalid: ${e} >= ${n}`}function bV(u,e){return`only one output dimension may be -1, not both ${u} and ${e}`}function wV(u,e){return`size ${u} must be non-negative, not ${e}`}function TV(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function AV(u,e){const n=xo(u),b=xo(e);return`Input to reshape is a SparseTensor with ${n} + dense values, but the requested shape requires a multiple of ${b}. inputShape=${u} outputShape= ${e}`}function SV(u,e){const n=xo(u),b=xo(e);return`Input to reshape is a tensor with ${n} dense values, but the requested shape has ${b}. inputShape=${u} outputShape=${e}`}function Vz(){return"segment ids must be >= 0"}function EV(){return"segment ids are not increasing"}function CV(u,e){return`Segment id ${u} out of range [0, ${e}), possibly because segmentIds input is not sorted.`}function kV(u,e,n){return`Bad: indices[${u}] == ${e} out of range [0, ${n})`}function Kse(u,e){let n=!1,b;for(u<=zN?(b=u,n=!0):b=Sz(u,Math.floor(Math.sqrt(u)));!n;)b>e||b===u?n=!0:b=Sz(u,b+1);return b}function Jse(u,e,n){const b=[],R=u.length;for(let q=0;qR))throw new Error(`Expect batchDims in the range of [-${R}, ${R}], but got ${b}`);if(b<0&&(b+=R),b>q)throw new Error(`batchDims (${b}) must be less than rank(x) ( + ${q}).`);if(ncb(e))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function IV(u){return u.map(e=>ob(e))}const Qse=Object.freeze(Object.defineProperty({__proto__:null,ERF_A1:UN,ERF_A2:$N,ERF_A3:VN,ERF_A4:jN,ERF_A5:GN,ERF_P:BN,PARALLELIZE_THRESHOLD:zN,get RowPartitionType(){return ry},SELU_SCALE:aD,SELU_SCALEALPHA:nD,applyActivation:SN,assertAndGetBroadcastShape:Yu,assertAxesAreInnerMostDims:Cv,assertParamsConsistent:PN,assignToTypedArray:vV,axesAreInnerMostDims:sN,calculateShapes:z2,checkEinsumDimSizes:XN,checkPadOnDimRoundingMode:$m,combineLocations:M$,combineRaggedTensorToTensorShapes:lV,complexWithEvenIndex:dV,complexWithOddIndex:pV,computeConv2DInfo:Ev,computeConv3DInfo:yb,computeDefaultPad:tN,computeDilation2DInfo:lk,computeOptimalWindowSize:rD,computeOutAndReduceShapes:lv,computeOutShape:h1,computePool2DInfo:w0,computePool3DInfo:S_,convertConv2DDataFormat:E_,decodeEinsumEquation:HN,eitherStridesOrDilationsAreOne:Fv,expandShapeToKeepDim:ip,exponent:gV,exponents:mV,fromStringArrayToUint8:IV,fromUint8ToStringArray:T_,getAxesPermutation:kd,getBroadcastDims:IA,getComplexWithIndex:qN,getEinsumComputePath:YN,getEinsumPermutation:WN,getFusedBiasGradient:AN,getFusedDyActivation:TN,getImageCenter:NN,getInnerMostAxes:op,getPermuted:dk,getRaggedRank:cV,getReductionAxes:Hp,getReshaped:hk,getReshapedPermuted:pk,getRowPartitionTypesHelper:uV,getSliceBeginCoords:ON,getSliceSize:FN,getSparseFillEmptyRowsIndicesDenseShapeMismatch:yV,getSparseFillEmptyRowsNegativeIndexErrorMessage:_V,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:xV,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:TV,getSparseReshapeInputOutputMismatchErrorMessage:SV,getSparseReshapeInputOutputMultipleErrorMessage:AV,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:bV,getSparseReshapeNegativeOutputDimErrorMessage:wV,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:kV,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:Vz,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:EV,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:CV,getUndoAxesPermutation:_b,isIdentityPermutation:ZN,mergeRealAndImagArrays:w_,prepareAndValidate:RN,prepareSplitSize:KN,shouldFuse:EN,splitRealAndImagArrays:hV,stridesOrDilationsArePositive:T2,tupleValuesAreOne:w2,upcastType:sg,validateDefaultValueShape:fV,warn:Og},Symbol.toStringTag,{value:"Module"}));Gse();const LV={kernelName:HL,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(u,fk(Gs(n,"float32"),-1))}}};const ele={kernelName:dC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>{const b=jh(Gs(n,"float32")),R=Ov(bl(Pu(1),b));return dd(Vl(u,R))}}}};const tle={kernelName:pC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>{const b=Ov(bl(jh(Gs(n,"float32")),1));return Vl(u,b)}}}};const rle={kernelName:UA,inputsToSave:["a","b"],gradFunc:(u,e)=>{const[n,b]=e,R=Yu(n.shape,b.shape);return{a:()=>{let fe=u;const he=Hp(n.shape,R);return he.length>0&&(fe=Cl(fe,he)),Pi(fe,n.shape)},b:()=>{let fe=u;const he=Hp(b.shape,R);return he.length>0&&(fe=Cl(fe,he)),Pi(fe,b.shape)}}}};const nle={kernelName:h8,saveAllInputs:!0,gradFunc:(u,e)=>{const n={};return e.forEach((b,R)=>{n[R]=()=>u.clone()}),n}};const ale={kernelName:WL,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>tf(n)}}};const ile={kernelName:XL,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>tf(n)}}};const ole={kernelName:vC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>Vl(u,Ov(bl(Pu(1),jh(Gs(n,"float32")))))}}};const sle={kernelName:mC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>{const b=Ov(Ko(Pu(1),jh(Gs(n,"float32"))));return Vl(u,b)}}}};const lle={kernelName:_C,inputsToSave:["a","b"],gradFunc:(u,e)=>{const[n,b]=e,R=Yu(n.shape,b.shape);return{a:()=>{const fe=Ko(jh(n),jh(b));let he=si(u,Vl(b,fe));const be=Hp(n.shape,R);return be.length>0&&(he=Cl(he,be)),Pi(he,n.shape)},b:()=>{const fe=Ko(jh(n),jh(b));let he=dd(si(u,Vl(n,fe)));const be=Hp(b.shape,R);return be.length>0&&(he=Cl(he,be)),Pi(he,b.shape)}}}};const ule={kernelName:gC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>Vl(u,Ko(jh(Gs(n,"float32")),1))}}};const cle={kernelName:yC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>Vl(u,bl(Pu(1),jh(Gs(n,"float32"))))}}};function fle(u,e,n,b,R,q){const re=ya(u,"dy","avgPool3dGrad"),fe=ya(e,"input","avgPool3dGrad");let he=re,be=fe,Pe=!1;fe.rank===4&&(Pe=!0,he=Pi(re,[1,re.shape[0],re.shape[1],re.shape[2],re.shape[3]]),be=Pi(fe,[1,fe.shape[0],fe.shape[1],fe.shape[2],fe.shape[3]])),Jn(he.rank===5,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${he.rank}.`),Jn(be.rank===5,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${be.rank}.`),$m("avgPool3dGrad",R,q);const je={dy:he,input:be},We={filterSize:n,strides:b,pad:R,dimRoundingMode:q},ft=wi.runKernel(m8,je,We);return Pe?Pi(ft,[ft.shape[1],ft.shape[2],ft.shape[3],ft.shape[4]]):ft}const hle=Ci({avgPool3dGrad_:fle});const dle={kernelName:ZL,inputsToSave:["x"],gradFunc:(u,e,n)=>{const[b]=e,{filterSize:R,strides:q,pad:re,dimRoundingMode:fe}=n;return{x:()=>hle(u,b,R,q,re,fe)}}};function ple(u,e,n,b,R){const q=ya(u,"dy","avgPoolGrad"),re=ya(e,"input","avgPoolGrad");Jn(re.rank===q.rank,()=>`Rank of input (${re.rank}) does not match rank of dy (${q.rank})`);let fe=re,he=q,be=!1;re.rank===3&&(be=!0,fe=Pi(re,[1,re.shape[0],re.shape[1],re.shape[2]]),he=Pi(q,[1,q.shape[0],q.shape[1],q.shape[2]])),Jn(he.rank===4,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${he.rank}.`),Jn(fe.rank===4,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${fe.rank}.`);const Pe={dy:he,input:fe},je={filterSize:n,strides:b,pad:R},We=wi.runKernel(v8,Pe,je);return be?Pi(We,[We.shape[1],We.shape[2],We.shape[3]]):We}const vle=Ci({avgPoolGrad_:ple});const mle={kernelName:YL,inputsToSave:["x"],gradFunc:(u,e,n)=>{const[b]=e,{filterSize:R,strides:q,pad:re}=n;return{x:()=>vle(u,b,R,q,re)}}};const gle={kernelName:KL,inputsToSave:["a","b"],gradFunc:(u,e,n)=>{const[b,R]=e,{transposeA:q,transposeB:re}=n;return!q&&!re?{a:()=>Uf(u,R,!1,!0),b:()=>Uf(b,u,!0,!1)}:!q&&re?{a:()=>Uf(u,R,!1,!1),b:()=>Uf(u,b,!0,!1)}:q&&!re?{a:()=>Uf(R,u,!1,!0),b:()=>Uf(b,u,!1,!1)}:{a:()=>Uf(R,u,!0,!0),b:()=>Uf(u,b,!0,!0)}}};const yle={kernelName:JL,gradFunc:(u,e,n)=>{const{blockShape:b,crops:R}=n;return{x:()=>gN(u,b,R)}}};const _le={kernelName:mte,gradFunc:(u,e,n)=>{const b=n,R=b.inputShape,q=b.shape,re=Array.from(q);for(let he=R.length-1;he>=0;he--)if(R[he]===q[he])re[he]=1;else if(R[he]!==1)throw new Error(`broadcastTo(): [${R}] cannot be broadcast to [${q}].`);const fe=[];for(let he=0;he1&&fe.push(he);return{x:()=>Cl(u,fe,!0)}}};const xle={kernelName:xC,gradFunc:u=>({x:()=>u.clone()})};const ble={kernelName:bC,gradFunc:u=>({x:()=>tf(u)})};const wle={kernelName:wC,inputsToSave:["x"],gradFunc:(u,e,n)=>{const[b]=e,{clipValueMin:R,clipValueMax:q}=n;return{x:()=>mm(x_(P2(b,R),jA(b,q)),u,tf(u))}}};const Tle={kernelName:QL,inputsToSave:["x"],gradFunc:LV.gradFunc};const Ale={kernelName:eR,saveAllInputs:!0,gradFunc:(u,e,n)=>{const b=e.map(he=>he.shape),{axis:R}=n,q=Ac(R,e[0].shape)[0],re=b.map(he=>he[q]);return Bg(u,re,q).map(he=>()=>he)}};const Sle={kernelName:tR,inputsToSave:["x","filter"],gradFunc:(u,e,n)=>{const[b,R]=e,{dilations:q,strides:re,pad:fe,dataFormat:he}=n;return Jn(w2(q),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${q}'`),{x:()=>aN(b.shape,u,R,re,fe,he),filter:()=>wN(b,u,R.shape,re,fe,he)}}};const Ele={kernelName:rR,inputsToSave:["dy","filter"],gradFunc:(u,e,n)=>{const[b,R]=e,{strides:q,pad:re,dataFormat:fe,dimRoundingMode:he}=n;return{dy:()=>A2(u,R,q,re,fe,1,he),filter:()=>wN(u,b,R.shape,q,re,fe,he)}}};function Cle(u,e,n,b,R){let q=u;u.rank===4&&(q=Pi(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]]));let re=e;re.rank===4&&(re=Pi(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]])),Jn(q.rank===5,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${q.shape}.`),Jn(re.rank===5,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${re.shape}.`),Jn(n.length===5,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),Jn(q.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${q.shape[4]}) must match input depth in filter (${n[3]}.`),Jn(re.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${re.shape[4]}) must match output depth for filter (${n[4]}).`);const fe={x:q,dy:re},he={strides:b,pad:R,filterShape:n};return wi.runKernel(b8,fe,he)}const kle=Ci({conv3DBackpropFilter_:Cle});const Mle={kernelName:nR,inputsToSave:["x","filter"],gradFunc:(u,e,n)=>{const{dilations:b,strides:R,pad:q}=n;Jn(w2(b),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${b}'`);const[re,fe]=e;return{x:()=>S$(re.shape,u,fe,R,q),filter:()=>kle(re,u,fe.shape,R,q)}}};const Ile={kernelName:TC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(dd($$(Gs(n,"float32"))),u)}}};const Lle={kernelName:AC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(V$(Gs(n,"float32")),u)}}};const Rle={kernelName:aR,inputsToSave:["x"],gradFunc:(u,e,n)=>{const[b]=e,{axis:R,exclusive:q,reverse:re}=n;return{x:()=>{const fe=kd([R],b.rank);let he=C$(u,R,q,!re);return fe!=null&&(he=ef(he,fe)),he}}}};const Dle={kernelName:iR,inputsToSave:["x","filter"],gradFunc:(u,e,n)=>{const{dilations:b,strides:R,pad:q,dimRoundingMode:re}=n,fe=b??[1,1];Jn(w2(fe),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${fe}'`);const[he,be]=e;return Jn(he.rank===4,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${he.rank}.`),Jn(be.rank===4,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${be.rank}.`),Jn(he.shape[3]===be.shape[2],()=>`Error in gradient of depthwiseConv2d: number of input channels (${he.shape[3]}) must match the inChannels dimension in filter ${be.shape[2]}.`),Jn(Fv(R,fe),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${R} and dilations '${fe}'.`),$m("depthwiseConv2d",q,re),{x:()=>Loe(he.shape,u,be,R,q,fe,re),filter:()=>Moe(he,u,be.shape,R,q,fe,re)}}};const Ple={kernelName:oR,inputsToSave:["x","filter"],gradFunc:(u,e,n)=>{const[b,R]=e,q={x:b,filter:R,dy:u},re={x:b,filter:R,dy:u};return{x:()=>wi.runKernel(Ez,q,n),filter:()=>wi.runKernel(Cz,re,n)}}};const zle={kernelName:EC,outputsToSave:[!0],gradFunc:(u,e)=>{const[n]=e,b={dy:u,y:n};return{x:()=>wi.runKernel(I8,b)}}};const Nle={kernelName:CC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e,b=si($g(dd(jh(n))),2/Math.sqrt(Math.PI));return{x:()=>si(u,b)}}};const Ole={kernelName:kC,outputsToSave:[!0],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(u,n)}}};const Fle={kernelName:lR,inputsToSave:["input"],gradFunc:(u,e)=>{const[n]=e;return{input:()=>Pi(u,n.shape)}}};const Ble={kernelName:MC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(u,$g(n))}}};const Ule={kernelName:IC,gradFunc:u=>({x:()=>tf(u)})};const $le={kernelName:LC,inputsToSave:["a","b"],gradFunc:(u,e)=>{const[n,b]=e,R=Yu(n.shape,b.shape);return{a:()=>{const fe=Vl(u,Gs(b,"float32")),he=Hp(n.shape,R);return he.length>0?Pi(Cl(fe,he),n.shape):fe},b:()=>{let fe=si(u,Gs(n,"float32"));const he=Hp(b.shape,R);he.length>0&&(fe=Pi(Cl(fe,he),b.shape));const be=jh(b);return dd(Vl(fe,Gs(be,"float32")))}}}};const Vle={kernelName:uR,inputsToSave:["x","mean","variance","scale"],gradFunc:(u,e,n)=>{const{varianceEpsilon:b}=n,[R,q,re,fe]=e,he=fe??Pu(1),be=Hp(q.shape,R.shape),Pe=[];if(q.rank===1){for(let Cr=0;Crq.rank===1?Pi(si(si(u,ny(Pi(ft,[1,1,1,q.shape[0]]),Pe)),he),R.shape):Pi(si(si(u,ft),he),R.shape),mean:()=>{let Cr=si(si(ft,Pu(-1)),We);return q.rank===1&&(Cr=Cl(Cr,be)),Pi(Cr,q.shape)},variance:()=>{let Cr=si(si(xt,je),We);return q.rank===1&&(Cr=Cl(Cr,be)),Pi(Cr,q.shape)},scale:()=>{const Cr=si(je,ft);let Gr=si(u,Cr);return q.rank===1&&(Gr=Cl(Gr,be)),Pi(Gr,q.shape)},offset:()=>{let Cr=u;return q.rank===1&&(Cr=Cl(Cr,be)),Pi(Cr,q.shape)}}}};const jle={kernelName:cR,inputsToSave:["x","indices"],gradFunc:(u,e,n)=>{const[b,R]=e,{axis:q,batchDims:re}=n,fe=Ac(q,b.shape)[0],he=(be,Pe,je)=>()=>{const We=be.shape,ft=Pe.size,xt=We.slice(0,fe),zt=xt.length,Ft=We.slice(q,We.length).slice(1),jt=Ft.length,Re=tB(0,zt),Lr=tB(zt+1,zt+1+jt),Cr=rB([xt,[ft],Ft]),Gr=Pi(je,Cr),yn=Pi(Pe,[ft]),Pn=rB([[zt],Re,Lr]),Vn=ef(Gr,Pn);let un=W$(Vn,yn,be.shape[fe]);const Nn=_b(Pn);return un=ef(un,Nn),un};if(re===1){const be=b.shape[0],Pe=b.split(be,0);return{x:()=>b_(Pe.map((ft,xt)=>he(ft,R.slice(xt,1),u.slice(xt,1))())).reshape(b.shape),indices:()=>R}}else return{x:he(b,R,u),indices:()=>R}}};function tB(u,e){const n=[];for(let b=u;b{const[n,b]=e;return{a:()=>tf(n),b:()=>tf(b)}}};const qle={kernelName:DC,gradFunc:u=>({x:()=>Gs(u,"float32")})};const Hle={kernelName:PC,gradFunc:u=>({x:()=>tf(u)})};const Wle={kernelName:zC,gradFunc:u=>({x:()=>tf(u)})};const Xle={kernelName:NC,gradFunc:u=>({x:()=>tf(u)})};const Yle={kernelName:hR,inputsToSave:["x"],gradFunc:(u,e,n)=>{const[b]=e,{alpha:R}=n,q=Vg(b,0);return{x:()=>mm(q,u,si(u,R))}}};const Zle={kernelName:FC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>Vl(u,Ko(n,1))}}};const Kle={kernelName:OC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>Vl(u,Gs(n,"float32"))}}};const Jle={kernelName:yte,inputsToSave:[],outputsToSave:[!0],gradFunc:(u,e,n)=>{const[b]=e,{axis:R}=n;return{logits:()=>{const re=$g(b);return bl(u,si(Cl(u,R,!0),re))}}}};function Qle(u,e,n,b=5,R=1,q=1,re=.5){const fe={x:u,y:e,dy:n},he={depthRadius:b,bias:R,alpha:q,beta:re};return wi.runKernel(N8,fe,he)}const eue=Ci({localResponseNormalizationBackprop_:Qle});const tue={kernelName:yR,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(u,e,n)=>{const[b,R]=e,{depthRadius:q,bias:re,alpha:fe,beta:he}=n;return{x:()=>eue(b,R,u,q,re,fe,he)}}};function RV(u,e,n,b){return e.ranksi(u,Gs(v1(n,e),u.dtype))}}const nB={kernelName:_R,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(u,e,n)=>{const b=n,{reductionIndices:R}=b,q=e[0],re=e[1],fe=Ac(R,q.shape),he=RV(u,re,q,fe);return{x:()=>he.x()}}};const rue={kernelName:BC,inputsToSave:["a","b"],gradFunc:(u,e)=>{const[n,b]=e;return{a:()=>si(u,Gs(P2(n,b),"float32")),b:()=>si(u,Gs(wL(n,b),"float32"))}}};function nue(u,e,n,b,R,q,re){const fe=ya(u,"dy","maxPool3dGrad"),he=ya(e,"input","maxPool3dGrad"),be=ya(n,"output","maxPool3dGrad");let Pe=fe,je=he,We=be,ft=!1;he.rank===4&&(ft=!0,Pe=Pi(fe,[1,fe.shape[0],fe.shape[1],fe.shape[2],fe.shape[3]]),je=Pi(he,[1,he.shape[0],he.shape[1],he.shape[2],he.shape[3]]),We=Pi(be,[1,be.shape[0],be.shape[1],be.shape[2],be.shape[3]])),Jn(Pe.rank===5,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${Pe.rank}.`),Jn(je.rank===5,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${je.rank}.`),Jn(We.rank===5,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${We.rank}.`),$m("maxPool3dGrad",q,re);const xt={dy:Pe,input:je,output:We},zt={filterSize:b,strides:R,pad:q,dimRoundingMode:re},Ft=wi.runKernel(F8,xt,zt);return ft?Pi(Ft,[Ft.shape[1],Ft.shape[2],Ft.shape[3],Ft.shape[4]]):Ft}const aue=Ci({maxPool3dGrad_:nue});const iue={kernelName:bR,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(u,e,n)=>{const[b,R]=e,{filterSize:q,strides:re,pad:fe,dimRoundingMode:he}=n;return{x:()=>aue(u,b,R,q,re,fe,he)}}};function oue(u,e,n,b,R,q,re){const fe=ya(u,"dy","maxPoolGrad"),he=ya(e,"input","maxPoolGrad"),be=ya(n,"output","maxPoolGrad");Jn(he.rank===fe.rank,()=>`Rank of input (${he.rank}) does not match rank of dy (${fe.rank})`),Jn(fe.rank===4,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${fe.rank}.`),Jn(he.rank===4,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${he.rank}.`),$m("maxPoolGrad",q,re);const Pe={dy:fe,input:he,output:be},je={filterSize:b,strides:R,pad:q,dimRoundingMode:re};return wi.runKernel(O8,Pe,je)}const sue=Ci({maxPoolGrad_:oue});const lue={kernelName:xR,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(u,e,n)=>{const[b,R]=e,{filterSize:q,strides:re,pad:fe}=n;return{x:()=>sue(u,b,R,q,re,fe)}}};const uue={kernelName:wR,inputsToSave:["x"],gradFunc:(u,e,n)=>{const[b]=e,{axis:R}=n,q=Ac(R,b.shape),fe=lv(b.shape,q)[1],he=xo(fe);return{x:()=>{const Pe=b.shape.slice();q.forEach(ft=>{Pe[ft]=1});const je=Pi(u,Pe);return Vl(si(je,C_(b.shape,"float32")),he)}}}};const cue={kernelName:TR,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(u,e,n)=>{const b=n,{axis:R}=b,[q,re]=e,fe=Ac(R,q.shape),he=RV(u,re,q,fe);return{x:()=>he.x()}}};const fue={kernelName:UC,inputsToSave:["a","b"],gradFunc:(u,e)=>{const[n,b]=e;return{a:()=>si(u,Gs(jA(n,b),"float32")),b:()=>si(u,Gs(Vg(n,b),"float32"))}}};const hue={kernelName:AR,inputsToSave:["x"],gradFunc:(u,e,n)=>{const b=e[0],{paddings:R}=n,q=R.map(re=>re[0]);return{x:()=>Vh(u,q,b.shape)}}};const due={kernelName:$C,inputsToSave:["a","b"],gradFunc:(u,e)=>{const[n,b]=e,R=Yu(n.shape,b.shape);return{a:()=>{const fe=Hp(n.shape,R);return fe.length>0?Pi(Cl(u,fe),n.shape):u},b:()=>{const fe=si(u,dd(eD(Vl(n,b)))),he=Hp(b.shape,R);return he.length>0?Pi(Cl(fe,he),b.shape):fe}}}};const pue={kernelName:VC,inputsToSave:["a","b"],gradFunc:(u,e)=>{const[n,b]=e,R=Yu(n.shape,b.shape);return{a:()=>{const fe=si(u,Gs(b,"float32")),he=Hp(n.shape,R);return he.length>0?Pi(Cl(fe,he),n.shape):fe},b:()=>{const fe=si(u,Gs(n,"float32")),he=Hp(b.shape,R);return he.length>0?Pi(Cl(fe,he),b.shape):fe}}}};const vue={kernelName:SR,gradFunc:u=>({x:()=>dd(u)})};const mue={kernelName:kR,inputsToSave:["indices"],gradFunc:(u,e)=>{const n=e[0];return{indices:()=>Mp(n.shape,"float32")}}};const gue={kernelName:CR,gradFunc:u=>({x:()=>tf(u)})};const yue={kernelName:MR,saveAllInputs:!0,gradFunc:(u,e,n)=>{const{axis:b}=n;return k2(u,b).map(q=>()=>q)}};const aB={kernelName:IR,inputsToSave:["x"],gradFunc:(u,e,n)=>{const b=e[0],{paddings:R}=n,q=R.map(re=>re[0]);return{x:()=>Vh(u,q,b.shape)}}};const _ue={kernelName:jC,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(u,e)=>{const[n,b,R]=e,q=n,re=b,fe=Yu(q.shape,re.shape);return{a:()=>{const Pe=Gs(re,"float32");let je=si(u,si(Pe,S2(q,bl(Pe,Pu(1)))));const We=Hp(q.shape,fe);return We.length>0&&(je=Cl(je,We)),Pi(je,q.shape)},b:()=>{const Pe=Vg(q,0),je=mm(Pe,_0(q),tf(q));let We=si(u,si(R,je));const ft=Hp(re.shape,fe);return ft.length>0&&(We=Cl(We,ft)),Pi(We,re.shape)}}}};const xue={kernelName:LR,inputsToSave:["x","alpha"],gradFunc:(u,e)=>{const[n,b]=e,R=Vg(n,0);return{x:()=>mm(R,u,si(u,b)),alpha:()=>{let q=mm(R,tf(u),si(u,n));const re=Hp(b.shape,u.shape);return re.length>0&&(q=Cl(q,re)),Pi(q,b.shape)}}}};function bue(u,e,n){const b=u.shape.slice();b[n]=1;const R=Pi(e,b),q=Bz(u,n,!0,!1),re=Bz(u,n,!0,!0),fe=si(q,re);return si(R,fe)}function wue(u,e,n){const b=u.shape.length,R=b-n.length,q=kd(n,b);let re=u;q!=null&&(re=ef(u,q));const fe=re.shape.slice(),be=fe.splice(b-n.length,n.length).reduce((We,ft)=>We*ft,1);fe.push(be);const Pe=re.reshape(fe);let je=bue(Pe,e,R);if(je=je.reshape(re.shape),q!=null){const We=_b(q);je=ef(je,We)}return je}const Tue={kernelName:RR,inputsToSave:["x"],gradFunc:(u,e,n)=>{const[b]=e,{axis:R}=n;let q=[];return R==null?q=b.shape.map((re,fe)=>fe):typeof R=="number"?q=[R]:q=R,{x:()=>wue(b,u,q)}}};const Aue={kernelName:SC,inputsToSave:["a","b"],gradFunc:(u,e)=>{const[n,b]=e,R=Yu(n.shape,b.shape);return{a:()=>{const fe=Vl(u,Gs(b,"float32")),he=Hp(n.shape,R);return he.length>0?Pi(Cl(fe,he),n.shape):fe},b:()=>{let fe=si(u,Gs(n,"float32"));const he=Hp(b.shape,R);he.length>0&&(fe=Pi(Cl(fe,he),b.shape));const be=jh(b);return dd(Vl(fe,Gs(be,"float32")))}}}};const Sue={kernelName:GC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>Vl(u,dd(jh(n)))}}};const Eue={kernelName:HC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e,b=si(jA(n,6),fk(n));return{x:()=>si(u,Gs(b,"float32"))}}};const Cue={kernelName:qC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(u,Gs(fk(n),"float32"))}}};const kue={kernelName:DR,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>Pi(u,n.shape)}}};const Mue={kernelName:zR,inputsToSave:["images"],gradFunc:(u,e,n)=>{const[b]=e,R={dy:u,images:b};return{images:()=>wi.runKernel(q8,R,n)}}};const Iue={kernelName:PR,inputsToSave:["images"],gradFunc:(u,e,n)=>{const[b]=e,R={dy:u,images:b};return{images:()=>wi.runKernel(G8,R,n)}}};const Lue={kernelName:NR,gradFunc:(u,e,n)=>{const{dims:b}=n,R=Ac(b,u.shape);return{x:()=>C2(u,R)}}};const Rue={kernelName:WC,gradFunc:u=>({x:()=>tf(u)})};const Due={kernelName:XC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>dd(Vl(u,si(S2(n,1.5),2)))}}};const Pue={kernelName:OR,inputsToSave:["condition"],gradFunc:(u,e)=>{const[n]=e;return{condition:()=>Gs(tf(n),"float32"),t:()=>si(u,Gs(n,u.dtype)),e:()=>si(u,Gs(dN(n),u.dtype))}}};const zue={kernelName:YC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>{const b=Vg(n,Pu(0)),R=Pu(nD),q=Pu(aD),re=si(u,q),fe=si(si(u,R),$g(Gs(n,"float32")));return mm(b,re,fe)}}}};const Nue={kernelName:QC,outputsToSave:[!0],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(u,si(n,bl(Pu(1),n)))}}};const Oue={kernelName:JC,gradFunc:u=>({x:()=>tf(u)})};const Fue={kernelName:ZC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(iN(Gs(n,"float32")),u)}}};const Bue={kernelName:KC,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(E$(Gs(n,"float32")),u)}}};const Uue={kernelName:FR,inputsToSave:["x"],gradFunc:(u,e,n)=>{const[b]=e,{begin:R,size:q}=n,re=b.shape,[fe,he]=DN(b,R,q),be=[];for(let Pe=0;PemN(u,be)}}};const $ue={kernelName:VR,outputsToSave:[!0],gradFunc:(u,e,n)=>{const[b]=e,{dim:R}=n,q=!0,re=si(u,b);return{logits:()=>bl(re,si(Cl(re,[R],q),b))}}};const Vue={kernelName:ek,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(u,VA(n))}}};const iB={kernelName:UR,gradFunc:(u,e,n)=>{const{blockShape:b,paddings:R}=n;return{x:()=>nN(u,b,R)}}};const oB={kernelName:$R,gradFunc:(u,e,n)=>{const{axis:b}=n;return{x:()=>Fm(u,b)}}};const jue={kernelName:tk,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>Vl(u,si(Ov(Gs(n,"float32")),2))}}};const Gue={kernelName:H8,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(u,si(Gs(n,"float32"),2))}}};const que={kernelName:rk,inputsToSave:["a","b"],gradFunc:(u,e)=>{const[n,b]=e,R=Pu(2);return{a:()=>si(u,si(R,bl(n,b))),b:()=>si(u,si(R,bl(b,n)))}}};const Hue={kernelName:sk,gradFunc:u=>({x:()=>tf(u)})};const Wue={kernelName:nk,inputsToSave:["a","b"],gradFunc:(u,e)=>{const[n,b]=e,R=Yu(n.shape,b.shape);return{a:()=>{let fe=u;const he=Hp(n.shape,R);return he.length>0&&(fe=Cl(fe,he)),Pi(fe,n.shape)},b:()=>{let fe=u;const he=Hp(b.shape,R);return he.length>0&&(fe=Cl(fe,he)),Pi(dd(fe),b.shape)}}}};const Xue={kernelName:BR,inputsToSave:["x"],gradFunc:(u,e,n)=>{const[b]=e,R=b.shape.slice(),{axis:q}=n;Ac(q,b.shape).forEach(be=>{R[be]=1});const fe=Pi(u,R),he=si(fe,C_(b.shape,"float32"));return{x:()=>he}}};const Yue={kernelName:ak,inputsToSave:["x"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>Vl(u,jh(iN(n)))}}};const Zue={kernelName:ik,outputsToSave:[!0],gradFunc:(u,e)=>{const[n]=e;return{x:()=>si(bl(Pu(1),jh(n)),u)}}};const Kue={kernelName:ok,inputsToSave:["x"],gradFunc:(u,e,n)=>{const[b]=e,{reps:R}=n;return{x:()=>{let re=tf(b);if(b.rank===1)for(let fe=0;fe{const b=n,{perm:R}=b,q=_b(R);return{x:()=>ef(u,q)}}};const Que={kernelName:jR,gradFunc:(u,e,n)=>{const b=n,{axis:R}=b;return{value:()=>b_(u,R)}}};const ece={kernelName:GR,inputsToSave:["segmentIds"],gradFunc:(u,e)=>{const[n]=e;return{x:()=>tce(u,n)}}};function tce(u,e){const n=xb(e,tf(e)),b=lN(u,n);let R=P2(e,Pu(0,"int32"));const q=b.rank-R.rank;for(let fe=0;fe({x:()=>tf(u)})};const nce=[LV,ele,tle,rle,nle,ale,ile,ole,sle,lle,ule,cle,dle,mle,gle,yle,_le,xle,ble,wle,Tle,Ale,Ele,Sle,Mle,Ile,Lle,Rle,Dle,Ple,Aue,zle,Nle,Ole,Fle,Ble,$le,Ule,Vle,jle,Gle,qle,Hle,Wle,Xle,Yle,Zle,Kle,Jle,tue,nB,nB,rue,iue,lue,uue,cue,fue,hue,due,pue,vue,mue,gue,yue,aB,aB,_ue,xue,Tue,Sue,Eue,Cue,kue,Mue,Iue,Lue,Rue,Due,Pue,zue,Nue,Oue,Fue,Bue,Uue,$ue,Vue,iB,iB,oB,oB,jue,que,Gue,Hue,Wue,Xue,Yue,Zue,Kue,Jue,Que,ece,rce];for(const u of nce)xte(u);go().prototype.abs=function(){return this.throwIfDisposed(),iv(this)};go().prototype.acos=function(){return this.throwIfDisposed(),wre(this)};go().prototype.acosh=function(){return this.throwIfDisposed(),Are(this)};go().prototype.add=function(u){return this.throwIfDisposed(),Ko(this,u)};go().prototype.all=function(u,e){return this.throwIfDisposed(),w$(this,u,e)};go().prototype.any=function(u,e){return this.throwIfDisposed(),Oz(this,u,e)};go().prototype.argMax=function(u){return this.throwIfDisposed(),QE(this,u)};go().prototype.argMin=function(u){return this.throwIfDisposed(),Mre(this,u)};go().prototype.asScalar=function(){return this.throwIfDisposed(),Jn(this.size===1,()=>"The array must have only 1 element."),Pi(this,[])};go().prototype.asType=function(u){return this.throwIfDisposed(),Gs(this,u)};go().prototype.as1D=function(){return this.throwIfDisposed(),Pi(this,[this.size])};go().prototype.as2D=function(u,e){return this.throwIfDisposed(),Pi(this,[u,e])};go().prototype.as3D=function(u,e,n){return this.throwIfDisposed(),Pi(this,[u,e,n])};go().prototype.as4D=function(u,e,n,b){return this.throwIfDisposed(),Pi(this,[u,e,n,b])};go().prototype.as5D=function(u,e,n,b,R){return this.throwIfDisposed(),Pi(this,[u,e,n,b,R])};go().prototype.asin=function(){return this.throwIfDisposed(),Lre(this)};go().prototype.asinh=function(){return this.throwIfDisposed(),Dre(this)};go().prototype.atan=function(){return this.throwIfDisposed(),zre(this)};go().prototype.atan2=function(u){return this.throwIfDisposed(),Ore(this,u)};go().prototype.atanh=function(){return this.throwIfDisposed(),Bre(this)};go().prototype.avgPool=function(u,e,n,b){return this.throwIfDisposed(),rN(this,u,e,n,b)};go().prototype.batchToSpaceND=function(u,e){return this.throwIfDisposed(),nN(this,u,e)};go().prototype.batchNorm=function(u,e,n,b,R){return this.throwIfDisposed(),ZR(this,u,e,n,b,R)};go().prototype.broadcastTo=function(u){return this.throwIfDisposed(),KE(this,u)};go().prototype.cast=function(u){return this.throwIfDisposed(),Gs(this,u)};go().prototype.ceil=function(){return this.throwIfDisposed(),hne(this)};go().prototype.clipByValue=function(u,e){return this.throwIfDisposed(),Ug(this,u,e)};go().prototype.concat=function(u,e){return this.throwIfDisposed(),u instanceof $p&&(u=[u]),Fm([this,...u],e)};go().prototype.conv1d=function(u,e,n,b,R,q){return this.throwIfDisposed(),T$(this,u,e,n,b,R,q)};go().prototype.conv2dTranspose=function(u,e,n,b,R){return this.throwIfDisposed(),A$(this,u,e,n,b,R)};go().prototype.conv2d=function(u,e,n,b,R,q){return this.throwIfDisposed(),A2(this,u,e,n,b,R,q)};go().prototype.cos=function(){return this.throwIfDisposed(),iN(this)};go().prototype.cosh=function(){return this.throwIfDisposed(),E$(this)};go().prototype.cumprod=function(u,e,n){return this.throwIfDisposed(),Bz(this,u,e,n)};go().prototype.cumsum=function(u,e,n){return this.throwIfDisposed(),C$(this,u,e,n)};go().prototype.depthToSpace=function(u,e){return this.throwIfDisposed(),One(this,u,e)};go().prototype.depthwiseConv2d=function(u,e,n,b,R,q){return this.throwIfDisposed(),oN(this,u,e,n,b,R,q)};go().prototype.dilation2d=function(u,e,n,b,R){return this.throwIfDisposed(),Une(this,u,e,n,b,R)};go().prototype.divNoNan=function(u){return this.throwIfDisposed(),qne(this,u)};go().prototype.div=function(u){return this.throwIfDisposed(),Vl(this,u)};go().prototype.dot=function(u){return this.throwIfDisposed(),Wne(this,u)};go().prototype.elu=function(){return this.throwIfDisposed(),JR(this)};go().prototype.equal=function(u){return this.throwIfDisposed(),v1(this,u)};go().prototype.erf=function(){return this.throwIfDisposed(),k$(this)};go().prototype.euclideanNorm=function(u,e){return this.throwIfDisposed(),iae(this,u,e)};go().prototype.exp=function(){return this.throwIfDisposed(),$g(this)};go().prototype.expandDims=function(u){return this.throwIfDisposed(),zm(this,u)};go().prototype.expm1=function(){return this.throwIfDisposed(),uae(this)};go().prototype.fft=function(){return this.throwIfDisposed(),G$(this)};go().prototype.flatten=function(){return this.throwIfDisposed(),Pi(this,[this.size])};go().prototype.floor=function(){return this.throwIfDisposed(),eD(this)};go().prototype.floorDiv=function(u){return this.throwIfDisposed(),b$(this,u)};go().prototype.gather=function(u,e,n){return this.throwIfDisposed(),lN(this,u,e,n)};go().prototype.greaterEqual=function(u){return this.throwIfDisposed(),P2(this,u)};go().prototype.greater=function(u){return this.throwIfDisposed(),Vg(this,u)};go().prototype.ifft=function(){return this.throwIfDisposed(),Uz(this)};go().prototype.irfft=function(){return this.throwIfDisposed(),roe(this)};go().prototype.isFinite=function(){return this.throwIfDisposed(),yae(this)};go().prototype.isInf=function(){return this.throwIfDisposed(),xae(this)};go().prototype.isNaN=function(){return this.throwIfDisposed(),wae(this)};go().prototype.leakyRelu=function(u){return this.throwIfDisposed(),cN(this,u)};go().prototype.lessEqual=function(u){return this.throwIfDisposed(),jA(this,u)};go().prototype.less=function(u){return this.throwIfDisposed(),wL(this,u)};go().prototype.localResponseNormalization=function(u,e,n,b){return this.throwIfDisposed(),Cae(this,u,e,n,b)};go().prototype.logSigmoid=function(){return this.throwIfDisposed(),Pae(this)};go().prototype.logSoftmax=function(u){return this.throwIfDisposed(),R$(this,u)};go().prototype.logSumExp=function(u,e){return this.throwIfDisposed(),hN(this,u,e)};go().prototype.log=function(){return this.throwIfDisposed(),_0(this)};go().prototype.log1p=function(){return this.throwIfDisposed(),fN(this)};go().prototype.logicalAnd=function(u){return this.throwIfDisposed(),x_(this,u)};go().prototype.logicalNot=function(){return this.throwIfDisposed(),dN(this)};go().prototype.logicalOr=function(u){return this.throwIfDisposed(),D$(this,u)};go().prototype.logicalXor=function(u){return this.throwIfDisposed(),Vae(this,u)};go().prototype.matMul=function(u,e,n){return this.throwIfDisposed(),Uf(this,u,e,n)};go().prototype.maxPool=function(u,e,n,b){return this.throwIfDisposed(),pN(this,u,e,n,b)};go().prototype.max=function(u,e){return this.throwIfDisposed(),iy(this,u,e)};go().prototype.maximum=function(u){return this.throwIfDisposed(),xb(this,u)};go().prototype.mean=function(u,e){return this.throwIfDisposed(),rp(this,u,e)};go().prototype.min=function(u,e){return this.throwIfDisposed(),bL(this,u,e)};go().prototype.minimum=function(u){return this.throwIfDisposed(),LA(this,u)};go().prototype.mirrorPad=function(u,e){return this.throwIfDisposed(),Zae(this,u,e)};go().prototype.mod=function(u){return this.throwIfDisposed(),Jae(this,u)};go().prototype.mul=function(u){return this.throwIfDisposed(),si(this,u)};go().prototype.neg=function(){return this.throwIfDisposed(),dd(this)};go().prototype.norm=function(u,e,n){return this.throwIfDisposed(),QR(this,u,e,n)};go().prototype.notEqual=function(u){return this.throwIfDisposed(),rC(this,u)};go().prototype.oneHot=function(u,e=1,n=0){return this.throwIfDisposed(),P$(this,u,e,n)};go().prototype.onesLike=function(){return this.throwIfDisposed(),x0(this)};go().prototype.pad=function(u,e){return this.throwIfDisposed(),mN(this,u,e)};go().prototype.pool=function(u,e,n,b,R,q){return this.throwIfDisposed(),lie(this,u,e,n,b,R,q)};go().prototype.pow=function(u){return this.throwIfDisposed(),S2(this,u)};go().prototype.prelu=function(u){return this.throwIfDisposed(),yN(this,u)};go().prototype.prod=function(u,e){return this.throwIfDisposed(),fie(this,u,e)};go().prototype.reciprocal=function(){return this.throwIfDisposed(),Nie(this)};go().prototype.relu=function(){return this.throwIfDisposed(),k_(this)};go().prototype.relu6=function(){return this.throwIfDisposed(),N$(this)};go().prototype.reshapeAs=function(u){return this.throwIfDisposed(),Pi(this,u.shape)};go().prototype.reshape=function(u){return this.throwIfDisposed(),Pi(this,u)};go().prototype.resizeBilinear=function(u,e,n){return this.throwIfDisposed(),Y$(this,u,e,n)};go().prototype.resizeNearestNeighbor=function(u,e,n){return this.throwIfDisposed(),Z$(this,u,e,n)};go().prototype.reverse=function(u){return this.throwIfDisposed(),C2(this,u)};go().prototype.rfft=function(){return this.throwIfDisposed(),ioe(this)};go().prototype.round=function(){return this.throwIfDisposed(),O$(this)};go().prototype.rsqrt=function(){return this.throwIfDisposed(),F$(this)};go().prototype.selu=function(){return this.throwIfDisposed(),B$(this)};go().prototype.separableConv2d=function(u,e,n,b,R,q){return this.throwIfDisposed(),U$(this,u,e,n,b,R,q)};go().prototype.sigmoid=function(){return this.throwIfDisposed(),VA(this)};go().prototype.sign=function(){return this.throwIfDisposed(),qie(this)};go().prototype.sin=function(){return this.throwIfDisposed(),$$(this)};go().prototype.sinh=function(){return this.throwIfDisposed(),V$(this)};go().prototype.slice=function(u,e){return this.throwIfDisposed(),Vh(this,u,e)};go().prototype.softmax=function(u){return this.throwIfDisposed(),tD(this,u)};go().prototype.softplus=function(){return this.throwIfDisposed(),uk(this)};go().prototype.spaceToBatchND=function(u,e){return this.throwIfDisposed(),gN(this,u,e)};go().prototype.split=function(u,e){return this.throwIfDisposed(),Bg(this,u,e)};go().prototype.sqrt=function(){return this.throwIfDisposed(),Ov(this)};go().prototype.square=function(){return this.throwIfDisposed(),jh(this)};go().prototype.squaredDifference=function(u){return this.throwIfDisposed(),q$(this,u)};go().prototype.squeeze=function(u){return this.throwIfDisposed(),ck(this,u)};go().prototype.stack=function(u,e){this.throwIfDisposed();const n=u instanceof $p?[this,u]:[this,...u];return b_(n,e)};go().prototype.step=function(u){return this.throwIfDisposed(),fk(this,u)};go().prototype.stridedSlice=function(u,e,n,b,R,q,re,fe){return this.throwIfDisposed(),foe(this,u,e,n,b,R,q,re,fe)};go().prototype.sub=function(u){return this.throwIfDisposed(),bl(this,u)};go().prototype.sum=function(u,e){return this.throwIfDisposed(),Cl(this,u,e)};go().prototype.tan=function(){return this.throwIfDisposed(),doe(this)};go().prototype.tanh=function(){return this.throwIfDisposed(),YR(this)};go().prototype.tile=function(u){return this.throwIfDisposed(),ny(this,u)};go().prototype.toBool=function(){return this.throwIfDisposed(),Gs(this,"bool")};go().prototype.toFloat=function(){return this.throwIfDisposed(),Gs(this,"float32")};go().prototype.toInt=function(){return this.throwIfDisposed(),Gs(this,"int32")};go().prototype.topk=function(u,e){return this.throwIfDisposed(),voe(this,u,e)};go().prototype.transpose=function(u){return this.throwIfDisposed(),ef(this,u)};go().prototype.unique=function(u){return this.throwIfDisposed(),yoe(this,u)};go().prototype.unsortedSegmentSum=function(u,e){return this.throwIfDisposed(),W$(this,u,e)};go().prototype.unstack=function(u){return this.throwIfDisposed(),k2(this,u)};go().prototype.where=function(u,e){return this.throwIfDisposed(),mm(u,this,e)};go().prototype.zerosLike=function(){return this.throwIfDisposed(),tf(this)};class o1 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,o1.prototype)}}class m0 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,m0.prototype)}}class di extends Error{constructor(e){super(e),Object.setPrototypeOf(this,di.prototype)}}class rc extends Error{constructor(e){super(e),Object.setPrototypeOf(this,rc.prototype)}}class JN extends Error{constructor(e){super(e),Object.setPrototypeOf(this,JN.prototype)}}class DV{constructor(e){this.maxEntries=e||100,this.cache=new Map}get(e){let n;return this.cache.has(e)&&(n=this.cache.get(e),this.cache.delete(e),this.cache.set(e,n)),n}put(e,n){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxEntries){const b=this.cache.keys().next().value;this.cache.delete(b)}this.cache.set(e,n)}getMaxEntries(){return this.maxEntries}setMaxEntries(e){if(e<0)throw new Error(`The maxEntries of LRU caches must be at least 0, but got ${e}.`);if(this.maxEntries>e)for(let n=0;nn.toUpperCase())}let f0={};function QN(u){if(u==null)return null;const e={};return e.className=u.getClassName(),e.config=u.getConfig(),e}function jz(u){if(!(u==null||typeof u!="object"))if(Array.isArray(u))u.forEach(e=>jz(e));else{const e=Object.keys(u);for(const n of e){const b=u[n];b!=null&&typeof b=="object"&&(!Array.isArray(b)&&b.type==="ndarray"&&typeof b.value=="number"?u[n]=b.value:jz(b))}}}function vk(u,e={},n={},b="object",R=!1){if(typeof u=="string"){const q=u;let re;if(q in n)re=n[q];else if(q in f0)re=f0[q];else if(re=e[q],re==null)throw new di(`Unknown ${b}: ${u}. This may be due to one of the following reasons: +1. The ${b} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. +2. The custom ${b} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return re}else{const q=u;if(q.className==null||q.config==null)throw new di(`${b}: Improper config format: ${JSON.stringify(q)}. +'className' and 'config' must set.`);const re=q.className;let fe,he;if(re in n?[fe,he]=n[re]:re in f0?[fe,he]=f0.className:re in e&&([fe,he]=e[re]),fe==null)throw new di(`Unknown ${b}: ${re}. This may be due to one of the following reasons: +1. The ${b} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. +2. The custom ${b} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(he!=null){const be={};for(const ft of Object.keys(f0))be[ft]=f0[ft];for(const ft of Object.keys(n))be[ft]=n[ft];const Pe=q.config;Pe.customObjects=be;const je=Object.assign({},f0);for(const ft of Object.keys(n))f0[ft]=n[ft];jz(q.config);const We=he(fe,q.config,n,R);return f0=Object.assign({},je),We}else{const be=Object.assign({},f0);for(const je of Object.keys(n))f0[je]=n[je];const Pe=new fe(q.config);return f0=Object.assign({},be),Pe}}}function ace(u,e){return ue?1:0}function X6(u,e){return-1*ace(u,e)}function lb(u){if(u==null)return u;const e=[];for(const n of u)e.indexOf(n)===-1&&e.push(n);return e}function ice(u){if(u==null)throw new di(`Invalid value in obj: ${JSON.stringify(u)}`);for(const e in u)if(u.hasOwnProperty(e))return!1;return!0}function N2(u,e,n){if(n!=null&&u.indexOf(n)<0)throw new di(`${n} is not a valid ${e}. Valid values are ${u} or null/undefined.`)}function eO(u,e,n=0,b=1/0){return s1(n>=0),s1(b>=n),Array.isArray(u)&&u.length>=n&&u.length<=b&&u.every(R=>typeof R===e)}function sv(u,e){Array.isArray(u)?(Jn(u.length>0,()=>`${e} is unexpectedly an empty array.`),u.forEach((n,b)=>sv(n,`element ${b+1} of ${e}`))):Jn(Number.isInteger(u)&&u>0,()=>`Expected ${e} to be a positive integer, but got ${PV(u)}.`)}function PV(u){return u===null?"null":Array.isArray(u)?"["+u.map(e=>PV(e)).join(",")+"]":typeof u=="string"?`"${u}"`:`${u}`}function oce(u,e,n){let b=n!=null?n():Pm(),R;return(...re)=>{const fe=n!=null?n():Pm();return fe-b0){const n=`${u}_${e}`;return mA.set(n,1),n}else return u}const vce=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function UV(u){return!!u.match(vce)}function mce(u){return u===parseInt(u.toString(),10)}function ub(u,e,n){e==null&&(e=0),n==null&&(n=u.length);let b=1;for(let R=e;Re&&(e=b)}return e}function sy(u,e){if(e{if(u.shape.length!==2)throw new di(`repeat() expects a rank-2 tensor, but received a rank-${u.shape.length} tensor.`);const n=mk(u,1);return Gz(n,[1,e,1])})}function yce(u){const e=[ub(u.shape)];return Pi(u,e)}function _ce(u){if(u.rank<=1)throw new di(`batchFlatten requires a minimum rank of 2. Got rank: ${u.rank}.`);const e=[u.shape[0],ub(u.shape,1)];return Pi(u,e)}function y2(u,e,n){return Zi(()=>{switch(u.rank){case 1:return xN(u,e,n);case 2:return j$(u,[e,0],[n,u.shape[1]]);case 3:return bN(u,[e,0,0],[n,u.shape[1],u.shape[2]]);case 4:return AL(u,[e,0,0,0],[n,u.shape[1],u.shape[2],u.shape[3]]);case 5:return Vh(u,[e,0,0,0,0],[n,u.shape[1],u.shape[2],u.shape[3],u.shape[4]]);case 6:return Vh(u,[e,0,0,0,0,0],[n,u.shape[1],u.shape[2],u.shape[3],u.shape[4],u.shape[5]]);default:throw new di(`sliceAlongFirstAxis() received an unsupported tensor rank: ${u.rank}`)}})}function iz(u,e,n){return Zi(()=>{switch(u.rank){case 1:return xN(u,e,n);case 2:return j$(u,[0,e],[u.shape[0],n]);case 3:return bN(u,[0,0,e],[u.shape[0],u.shape[1],n]);case 4:return AL(u,[0,0,0,e],[u.shape[0],u.shape[1],u.shape[2],n]);default:throw new di(`sliceAlongLastAxis() received an unsupported tensor rank: ${u.rank}`)}})}function Z6(u,e,n,b){return Zi(()=>{switch(u.rank){case 1:return xN(u,e,n);case 2:switch(b){case 1:return y2(u,e,n);case 2:return iz(u,e,n);default:throw new di(`The axis is not within the rank of the tensor ${b}`)}case 3:switch(b){case 1:return y2(u,e,n);case 2:return bN(u,[0,e,0],[u.shape[0],n,u.shape[2]]);case 3:return iz(u,e,n);default:throw new di(`The axis is not within the rank of the tensor ${b}`)}case 4:switch(b){case 1:return y2(u,e,n);case 2:return AL(u,[0,e,0,0],[u.shape[0],n,u.shape[2],u.shape[3]]);case 3:return AL(u,[0,0,e,0],[u.shape[0],u.shape[1],n,u.shape[3]]);case 4:return iz(u,e,n);default:throw new di(`The axis is not within the rank of the tensor ${b}`)}default:throw new di(`sliceAlongLastAxis() received an unsupported tensor rank: ${u.rank}`)}})}function tO(u,e=-1){let n;return e<0&&(n=u[0].rank,n!==0?e=n:e=0),e===u[0].rank&&(e=-1),Fm(u,e)}function uB(u,e){switch(u.rank){case 1:return vne([u,e]);case 2:return gne([u,e],0);case 3:return _ne([u,e],0);case 4:return bne([u,e],0);default:throw new di(`concatAlongFirstAxis() received an unsupported tensor rank: ${u.rank}`)}}function Gz(u,e){if(Array.isArray(e)||(e=[e]),u.rank!==e.length)throw new di(`The length of input n (${e.length}) does not match the number of dimensions in input x (${u.rank})`);return ny(u,e)}function oD(u,e=0,n=1,b,R){return Rie(u,e,n,b,R)}function p1(u,e,n,b){if(u.rank<2||e.rank<2)throw new rc(`dot requires both inputs to be rank >= 2 but got x shape = ${u.shape} and y shape = ${e.shape}`);if(e.rank>=3){const R=u.shape.slice(-1)[0],q=e.shape.slice(-2)[0];if(R!==q)throw new rc(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${u.shape} and y shape = ${e.shape}`)}if(u.rank===2&&e.rank===2)return Y9({a:u,b:e,transposeA:!1,transposeB:!1,bias:b?qz(u.rank,b,ly()):null,activation:n});{const R=u.shape.slice(),q=R.pop();u=Pi(u,[-1,q]);const re=e.shape.slice(),fe=re.pop(),he=re.pop(),be=[...re,fe],Pe=Array.from({length:e.rank},(xt,zt)=>zt===0?e.rank-2:zt<=e.rank-2?zt-1:zt);e=Pi(ef(e,Pe),[he,-1]);const je=[...R,...be];return Pi(Y9({a:u,b:e,transposeA:!1,transposeB:!1,bias:b?qz(u.rank,b,ly()):null,activation:n}),je)}}function $V(u,e,n){return Zi(()=>(Array.isArray(e)?e=og(e,"int32"):e=Gs(e,"int32"),lN(u,e,n)))}function gk(u){return si(u,u)}function qz(u,e,n){const b=e.shape;if(e.rank!==1&&e.rank!==u)throw new di(`Unexpected bias dimensions: ${e.rank}; expected it to be 1 or ${u}`);if(u===5){if(n==="channelsFirst")return b.length===1?Pi(e,[1,b[0],1,1,1]):Pi(e,[1,b[3],b[0],b[1],b[2]]);if(n==="channelsLast")return b.length===1?Pi(e,[1,1,1,1,b[0]]):Pi(e,[1].concat(b))}else if(u===4){if(n==="channelsFirst")return b.length===1?Pi(e,[1,b[0],1,1]):Pi(e,[1,b[2],b[0],b[1]]);if(n==="channelsLast")return b.length===1?Pi(e,[1,1,1,b[0]]):Pi(e,[1].concat(b))}else if(u===3){if(n==="channelsFirst")return b.length===1?Pi(e,[1,b[0],1]):Pi(e,[1,b[1],b[0]]);if(n==="channelsLast")return b.length===1?Pi(e,[1,1,b[0]]):Pi(e,[1].concat(b))}else if(u<3)return e;throw new di(`Unsupported input rank by biasAdd: ${e.rank}`)}function cy(u,e,n){return Zi(()=>(n==null&&(n=ly()),sp(n),Ko(u,qz(u.rank,e,n))))}function xce(u,e=1){if(e!==1)throw new rc(`Support for alpha values other than 1 (${e}) is not implemented yet.`);return JR(u)}function bce(u){return Zi(()=>Vl(u,Ko(iv(u),1)))}function VV(u,e,n,b){return Zi(()=>Aoe(u,e,n,b))}function wce(u){return Zi(()=>{const e=Ko(.5,si(.2,u));return Ug(e,0,1)})}function yk(u,e,n=!1){return n?u():e()}const Tce=["fanIn","fanOut","fanAvg"],Ace=["normal","uniform","truncatedNormal"];function Sce(u){N2(Tce,"FanMode",u)}function Ece(u){N2(Ace,"Distribution",u)}class T0 extends qA{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class jV extends T0{apply(e,n){return Mp(e,n)}}jV.className="Zeros";Wo(jV);class rO extends T0{apply(e,n){return C_(e,n)}}rO.className="Ones";Wo(rO);class GV extends T0{constructor(e){if(super(),typeof e!="object")throw new di(`Expected argument of type ConstantConfig but got ${e}`);if(e.value===void 0)throw new di(`config must have value set but got ${e}`);this.value=e.value}apply(e,n){return Zi(()=>si(Pu(this.value),C_(e,n)))}getConfig(){return{value:this.value}}}GV.className="Constant";Wo(GV);class qV extends T0{constructor(e){super(),this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,n){return sb(e,this.minval,this.maxval,n,this.seed)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}qV.className="RandomUniform";Wo(qV);class HV extends T0{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,n){if(n=n||"float32",n!=="float32"&&n!=="int32")throw new rc(`randomNormal does not support dType ${n}.`);return oD(e,this.mean,this.stddev,n,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}HV.className="RandomNormal";Wo(HV);class WV extends T0{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,n){if(n=n||"float32",n!=="float32"&&n!=="int32")throw new rc(`truncatedNormal does not support dType ${n}.`);return H$(e,this.mean,this.stddev,n,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}WV.className="TruncatedNormal";Wo(WV);class XV extends T0{constructor(e){super(),this.gain=e.gain!=null?e.gain:1}apply(e,n){return Zi(()=>{if(e.length!==2||e[0]!==e[1])throw new di("Identity matrix initializer can only be used for 2D square matrices.");return si(this.gain,L$(e[0]))})}getConfig(){return{gain:this.gain}}}XV.className="Identity";Wo(XV);function Cce(u,e="channelsLast"){let n,b;if(sp(e),u.length===2)n=u[0],b=u[1];else if([3,4,5].indexOf(u.length)!==-1){if(e==="channelsFirst"){const R=ub(u,2);n=u[1]*R,b=u[0]*R}else if(e==="channelsLast"){const R=ub(u,0,u.length-2);n=u[u.length-2]*R,b=u[u.length-1]*R}}else{const R=ub(u);n=Math.sqrt(R),b=Math.sqrt(R)}return[n,b]}class lg extends T0{constructor(e){if(super(),e.scale<0)throw new di(`scale must be a positive float. Got: ${e.scale}`);this.scale=e.scale==null?1:e.scale,this.mode=e.mode==null?"fanIn":e.mode,Sce(this.mode),this.distribution=e.distribution==null?"normal":e.distribution,Ece(this.distribution),this.seed=e.seed}apply(e,n){const b=Cce(e),R=b[0],q=b[1];let re=this.scale;if(this.mode==="fanIn"?re/=Math.max(1,R):this.mode==="fanOut"?re/=Math.max(1,q):re/=Math.max(1,(R+q)/2),this.distribution==="normal"){const fe=Math.sqrt(re);if(n=n||"float32",n!=="float32"&&n!=="int32")throw new rc(`${this.getClassName()} does not support dType ${n}.`);return H$(e,0,fe,n,this.seed)}else{const fe=Math.sqrt(3*re);return sb(e,-fe,fe,n,this.seed)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}lg.className="VarianceScaling";Wo(lg);class nO extends lg{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return lg.className}}nO.className="GlorotUniform";Wo(nO);class aO extends lg{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return lg.className}}aO.className="GlorotNormal";Wo(aO);class iO extends lg{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return lg.className}}iO.className="HeNormal";Wo(iO);class oO extends lg{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return lg.className}}oO.className="HeUniform";Wo(oO);class sO extends lg{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return lg.className}}sO.className="LeCunNormal";Wo(sO);class lO extends lg{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return lg.className}}lO.className="LeCunUniform";Wo(lO);class YV extends T0{constructor(e){super(),this.DEFAULT_GAIN=1,this.ELEMENTS_WARN_SLOW=2e3,this.gain=e.gain==null?this.DEFAULT_GAIN:e.gain,this.seed=e.seed}apply(e,n){return Zi(()=>{if(e.length<2)throw new rc("Shape must be at least 2D.");if(n!=="int32"&&n!=="float32"&&n!==void 0)throw new TypeError(`Unsupported data type ${n}.`);n=n;const b=xo(e.slice(0,-1)),R=e[e.length-1],q=b*R;q>this.ELEMENTS_WARN_SLOW&&console.warn(`Orthogonal initializer is being called on a matrix with more than ${this.ELEMENTS_WARN_SLOW} (${q}) elements: Slowness may result.`);const re=[Math.max(R,b),Math.min(R,b)],fe=oD(re,0,1,n,this.seed),he=Bse.qr(fe,!1);let be=he[0];const je=he[1].flatten().stridedSlice([0],[Math.min(R,b)*Math.min(R,b)],[Math.min(R,b)+1]);return be=si(be,je.sign()),bb*R);return e}const hB="Variable";class kce{constructor(e,n="float32",b=hB,R=!0,q=null){this.dtype=n??"float32",this.shape=e.shape,this.id=NV(),b=b??hB,this.originalName=FV(b),this.name=BV(this.originalName),this.trainable_=R,this.constraint=q,this.val=bA(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),Mce(this.val,e),this.val.id!==e.id&&(this.val.assign(e),this.constraint!=null&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}}function Mce(u,e){if(u.shape.toString()!==e.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(u.shape)+" vs. "+JSON.stringify(e.shape))}function Wz(u){return u.map(e=>e.read())}function uO(u){u.forEach(e=>{e[0].write(e[1])})}class jp{constructor(e){this.dtype=e.dtype,this.shape=e.shape,e.shape!=null?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}}class m1{constructor(e,n,b,R,q,re,fe){this.dtype=e,this.shape=n,this.sourceLayer=b,this.inputs=R,this.callArgs=q,this.outputTensorIndex=fe,this.id=NV(),re!=null&&(this.originalName=FV(re),this.name=BV(this.originalName)),this.rank=n.length}}let Ice=0;class sD{constructor(e,n){this.callArgs=n,this.id=Ice++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(const b of e.inboundLayers)b?.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){const e=[];for(const n of this.inboundLayers)n!=null?e.push(n.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}let Lce=0;class Sc extends qA{constructor(e={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=Lce++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let n=e.name;if(!n){const b=this.getClassName();n=m_(b)+"_"+iD(b)}if(this.name=n,this.trainable_=e.trainable==null?!0:e.trainable,e.inputShape!=null||e.batchInputShape!=null){let b;if(e.batchInputShape!=null)b=e.batchInputShape;else if(e.inputShape!=null){let q=null;e.batchSize!=null&&(q=e.batchSize),b=[q].concat(e.inputShape)}this.batchInputShape=b;let R=e.dtype;R==null&&(R=e.inputDType),R==null&&(R="float32"),this.dtype=R}e.weights!=null?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,n){return e.name+"_ib-"+n.toString()}getNodeAtIndex(e,n){if(this.inboundNodes.length===0)throw new m0(`The layer has never been called and thus has no defined ${n}.`);if(this.inboundNodes.length<=e)throw new di(`Asked to get ${n} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return Nm(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return Nm(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new o1(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(this.inboundNodes.length===0)throw new o1(`Layer ${this.name} is not connected, no input to return.`);return Nm(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(this.inboundNodes.length===0)throw new o1(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new o1(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return Nm(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map(e=>e())}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach(n=>n.trainable=e),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter(e=>e.trainable):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter(e=>!e.trainable).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){const n=uh(e);if(this.inputSpec==null||this.inputSpec.length===0)return;const b=uh(this.inputSpec);if(n.length!==b.length)throw new di(`Layer ${this.name} expects ${b.length} inputs, but it received ${n.length} input tensors. Input received: ${e}`);for(let R=0;Rre.maxNDim)throw new di(`Input ${R} is incompatible with layer ${this.name}: expected max_ndim=${re.maxNDim}, found ndim=${fe}`);if(re.minNDim!=null&&fe=0?he[Pe]:he[he.length+Pe];if(je!=null&&[je,null].indexOf(We)===-1)throw new di(`Input ${R} is incompatible with layer ${this.name}: expected axis ${Pe} of input shape to have value ${je} but got shape ${he}.`)}}if(re.shape!=null)for(let he=0;he{if(!this.built){this.assertInputCompatibility(e);const re=[];for(const fe of uh(e))re.push(fe.shape);this.build(Nm(re)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),this._refCount===null&&q&&(this._refCount=1)}if(this.assertInputCompatibility(e),q){let re=this.call(e,n);this.supportsMasking&&this.setMaskMetadata(e,re);const fe=uh(re),he=[];for(let be of fe)b.indexOf(be)!==-1&&(be=be.clone()),he.push(be);if(re=Nm(he),this.activityRegularizer!=null)throw new rc("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return re}else{const re=Rce(e),fe=this.computeOutputShape(re);let he;const be=Dce(e);if(this.warnOnIncompatibleInputShape(Array.isArray(e)?re[0]:re),fe!=null&&fe.length>0&&Array.isArray(fe[0])?he=fe.map((Pe,je)=>new m1(be,Pe,this,uh(e),n,this.name,je)):he=new m1(be,fe,this,uh(e),n,this.name),this.addInboundNode(e,he,null,null,re,fe,n),this._refCount++,this.activityRegularizer!=null)throw new rc("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return he}})}warnOnIncompatibleInputShape(e){if(this.batchInputShape!=null)if(e.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(e)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let n=!1;this.batchInputShape.forEach((b,R)=>{b!=null&&e[R]!=null&&e[R]!==b&&(n=!0)}),n&&console.warn(`The shape of the input tensor (${JSON.stringify(e)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(this.inboundNodes==null||this.inboundNodes.length===0)throw new o1(`The layer ${this.name} has never been called and thus has no defined output shape.`);const e=[];for(const n of this.inboundNodes){const b=JSON.stringify(n.outputShapes);e.indexOf(b)===-1&&e.push(b)}if(e.length===1){const n=this.inboundNodes[0].outputShapes;return Array.isArray(n)&&Array.isArray(n[0])&&n.length===1?n[0]:n}else throw new o1(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new m0(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return CL(this.weights)}build(e){this.built=!0}getWeights(e=!1){return Wz(e?this.trainableWeights:this.weights)}setWeights(e){Zi(()=>{const n=this.weights;if(n.length!==e.length)throw new di(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${n.length} weights. Provided weights: ${e}...`);if(n.length===0)return;const b=[],R=Wz(n);for(let q=0;qq.apply(Pe.read())),re==null&&(re=!0),re?this._trainableWeights.push(Pe):this._nonTrainableWeights.push(Pe),Pe}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){e==null||Array.isArray(e)&&e.length===0||(e=uh(e),this._losses!==void 0&&this._losses!==null&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,n){if(!this.supportsMasking){if(n!=null)if(Array.isArray(n))n.forEach(b=>{if(b!=null)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)});else throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);return null}return n}setMaskMetadata(e,n,b){if(!this.supportsMasking)return;const R=this.computeMask(e,b),q=uh(n),re=uh(R);if(q.length!==re.length)throw new Error(`${this.name} outputs ${q.length} tensors but ${q.length} masks for those tensors`);for(let fe=0;fee.dispose()),this.weights.length}assertNotDisposed(){if(this._refCount===0)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(this._refCount===null)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return--this._refCount===0&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}}function Rce(u){u=uh(u);const e=[];for(const n of u)e.push(n.shape);return Nm(e)}function Dce(u){return"float32"}function ZV(u,e,n){if((e==null||n!=null&&n>0)&&(e=u.sourceLayer,n=u.nodeIndex),e.inboundNodes.length===0)return[u];{const b=e.inboundNodes[n];if(b.inboundLayers.length===0)return b.inputTensors;{const R=[];for(let q=0;qxt.name),he=[],be=e.names();for(const xt of fe)be.indexOf(xt)!==-1?he.push(e.getValue(xt)):he.push(null);const Pe=fe.join(",")+"|"+e.names().sort().join(",");let je=kL.get(Pe),We;if(je==null){const xt=Bce(re,e);je=xt.sorted,We=xt.recipientCounts,kL.put(Pe,je),ML.put(Pe,We)}We={},R||Object.assign(We,ML.get(Pe));const ft=new nb(e);for(let xt=0;xt0,()=>"Expected at least one fetch, got none");let n=[],b={};if(u.length===1){const R=dB(u[0],e);n=R.sorted,b=R.recipientMap}else{const R=new Set;for(const q of u){const{sorted:re,recipientMap:fe}=dB(q,e);for(const he of re)R.has(he.name)||(n.push(he),R.add(he.name));for(const he in fe)b[he]==null&&(b[he]=new Set),fe[he].forEach(be=>b[he].add(be))}}return{sorted:n,recipientCounts:Uce(b)}}function Uce(u){const e={};for(const n in u)e[n]=u[n].size;return e}function dB(u,e){const n=new Set,b=[],R={};for(const fe of e.names())n.add(fe);const q=[],re=[];for(q.push(u);q.length>0;){const fe=q[q.length-1];if(n.has(fe.name)){q.pop();continue}const he=re[re.length-1]===q.length-1;if(fe.inputs.length===0||he)q.pop(),b.push(fe),n.add(fe.name),he&&re.pop();else{re.push(q.length-1);for(const be of fe.inputs)R[be.name]==null&&(R[be.name]=new Set),R[be.name].add(fe.name),!n.has(be.name)&&q.push(be)}}return{sorted:b,recipientMap:R}}function $ce(u){let e;if(u.sourceLayer.inboundNodes.length===1)e=u.sourceLayer.output;else{let n=null;for(let b=0;b100,Fce);function cO(u,e){return Zi(()=>Ov(Cl(si(u,u),e,!0)))}class xk extends qA{getConfig(){return{}}}class KV extends xk{constructor(e){super(),this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return Zi(()=>{const n=cO(e,this.axis),b=Ug(n,0,this.maxValue);return si(e,Vl(b,Ko(Vp(),n)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}KV.className="MaxNorm";Wo(KV);class JV extends xk{constructor(e){super(),this.defaultAxis=0,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return Zi(()=>Vl(e,Ko(Vp(),cO(e,this.axis))))}getConfig(){return{axis:this.axis}}}JV.className="UnitNorm";Wo(JV);class QV extends xk{apply(e){return k_(e)}}QV.className="NonNeg";Wo(QV);class ej extends xk{constructor(e){super(),this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=e.minValue!=null?e.minValue:this.defaultMinValue,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.rate=e.rate!=null?e.rate:this.defaultRate,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return Zi(()=>{const n=cO(e,this.axis),b=Ko(si(this.rate,Ug(n,this.minValue,this.maxValue)),si(1-this.rate,n));return si(e,Vl(b,Ko(Vp(),n)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}ej.className="MinMaxNorm";Wo(ej);const pB={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Gp(u){return QN(u)}function vB(u,e={}){return vk(u,v0.getMap().classNameMap,e,"constraint")}function qp(u){if(u==null)return null;if(typeof u=="string"){const n={className:u in pB?pB[u]:u,config:{}};return vB(n)}else return u instanceof xk?u:vB(u)}async function o2(u){if(u==null)return;const e=[],n=[],b=[];for(const R in u){const q=u[R];if(typeof q!="number"){const re=q;e.push(re.data()),n.push(R),b.push(re)}}if(e.length>0){const R=await Promise.all(e);for(let q=0;qKo(this.totals[R],si(q,b)));this.totals[R]=fe,re?.dispose()}}}async onEpochEnd(e,n){if(n!=null)for(const b of this.params.metrics)this.totals[b]!=null&&(typeof this.totals[b]=="number"?n[b]=this.totals[b]/this.seen:Zi(()=>{const R=si(Vl(1,this.seen),this.totals[b]);n[b]=R,this.totals[b].dispose(),f1(n[b])}))}}class Hce extends aC{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,n){n==null&&(n={}),this.epoch.push(e);for(const b in n)this.history[b]==null&&(this.history[b]=[]),this.history[b].push(n[b])}async syncData(){const e=[],n=[],b=[];for(const q in this.history){const re=this.history[q];for(let fe=0;fenew Wce(b,e))}class p0{constructor(){}static registerCallbackConstructor(e,n){Jn(e>=0&&Number.isInteger(e),()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`),p0.checkForDuplicate(n),p0.constructors[e]==null&&(p0.constructors[e]=[]),p0.constructors[e].push(n)}static checkForDuplicate(e){for(const n in p0.constructors)p0.constructors[+n].forEach(R=>{if(R===e)throw new di("Duplicate callback constructor.")})}static clear(){p0.constructors={}}static createCallbacks(e){const n=[];for(const b in p0.constructors){const R=+b;e>=R&&n.push(...p0.constructors[R])}return n.map(b=>new b)}}p0.constructors={};function nj(u,e,n,b,R,q,re,fe,he){const be=new Hce,Pe=[new qce,...p0.createCallbacks(e)];u!=null&&Pe.push(...u),Pe.push(be);const je=new Gce(Pe);return je.setParams({epochs:n,initialEpoch:b,samples:R,steps:q,batchSize:re,verbose:e,doValidation:fe,metrics:he}),{callbackList:je,history:be}}function __(u,e={},n=!1){return vk(u,v0.getMap().classNameMap,e,"layer",n)}function IL(u,e){return Zi(()=>{u.dtype!=="float32"&&(u=Gs(u,"float32"));const n=Cl(gk(u),e,!0),b=KR(n.shape,Vp()),R=Ov(xb(n,b));return Vl(u,R)})}function lD(u,e){return Zi(()=>rp(gk(bl(e,u)),-1))}function fO(u,e){return Zi(()=>rp(iv(bl(e,u)),-1))}function hO(u,e){return Zi(()=>{const n=bl(u,e),b=Ug(iv(u),Vp(),Number.MAX_VALUE),R=iv(Vl(n,b));return si(100,rp(R,-1))})}function Xce(u,e){return Zi(()=>{const n=Ug(e,Vp(),Number.MAX_VALUE),b=_0(Ko(1,n)),R=Ug(u,Vp(),Number.MAX_VALUE),q=_0(Ko(1,R));return rp(gk(bl(b,q)),-1)})}function Yce(u,e){return Zi(()=>{const n=xb(0,bl(1,si(u,e)));return rp(gk(n),-1)})}function Zce(u,e){return Zi(()=>{const n=xb(0,bl(1,si(u,e)));return rp(n,-1)})}function Kce(u,e){return Zi(()=>{const n=Cl(si(u,e),-1),b=iy(si(bl(1,u),e),-1);return xb(0,Ko(1,bl(b,n)))})}function Jce(u,e){return Zi(()=>{const n=Math.log(2),b=bl(e,u),R=bl(Ko(b,uk(si(-2,b))),n);return rp(R,-1)})}function iC(u,e,n=!1){return Zi(()=>{if(n)e=tD(e);else{const b=Cl(e,e.shape.length-1,!0);e=Vl(e,b)}return e=Ug(e,Vp(),1-Vp()),dd(Cl(si(Gs(u,"float32"),_0(e)),e.shape.length-1))})}function LL(u,e,n=!1){return Zi(()=>{const b=Gs(eD(yce(u)),"int32");e=Ug(e,Vp(),1-Vp());const R=e.shape,q=Pi(P$(b,R[R.length-1]),R);return iC(q,e,n)})}function Qce(u,e){if(!$f(u.shape,e.shape))throw new di(`logits and labels must have the same shape, but got shapes ${JSON.stringify(u.shape)} and ${JSON.stringify(e.shape)}`);return Zi(()=>{const n=k_(e),b=dd(iv(e));return Ko(bl(n,si(e,u)),fN($g(b)))})}function uD(u,e){return Zi(()=>{let n;return n=Ug(e,Vp(),1-Vp()),n=_0(Vl(n,bl(1,n))),rp(Qce(u,n),-1)})}function efe(u,e){return Zi(()=>{const n=Ug(u,Vp(),1),b=Ug(e,Vp(),1);return Cl(si(u,_0(Vl(n,b))),-1)})}function tfe(u,e){return Zi(()=>{const n=_0(Ko(Vp(),e));return rp(bl(e,si(u,n)),-1)})}function aj(u,e){return Zi(()=>{const n=IL(u,-1),b=IL(e,-1),R=si(n,b);return dd(Cl(R,-1))})}const RL={meanSquaredError:lD,meanAbsoluteError:fO,meanAbsolutePercentageError:hO,meanSquaredLogarithmicError:Xce,squaredHinge:Yce,hinge:Zce,categoricalHinge:Kce,logcosh:Jce,categoricalCrossentropy:iC,sparseCategoricalCrossentropy:LL,binaryCrossentropy:uD,kullbackLeiblerDivergence:efe,poisson:tfe,cosineProximity:aj};function oz(u){if(typeof u=="string"){if(u in RL)return RL[u];let e=`Unknown loss ${u}`;throw u.toLowerCase().includes("softmaxcrossentropy")&&(e=`Unknown loss ${u}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new di(e)}else return u}function ij(u,e){return Zi(()=>{const n=si(.5,x0(e)),b=d1(Vg(e,n),u.dtype);return rp(v1(u,b),-1)})}function oj(u,e){return Zi(()=>d1(v1(QE(u,-1),QE(e,-1)),"float32"))}function rfe(u,e){return Zi(()=>Gs(Cl(x_(v1(u,1),v1(e,1))),"float32"))}function nfe(u,e){return Zi(()=>Gs(Cl(x_(v1(u,0),v1(e,1))),"float32"))}function afe(u,e){return Zi(()=>{const n=rfe(u,e),b=nfe(u,e),R=Ko(n,b);return Gs(mm(Vg(R,0),Vl(n,R),0),"float32")})}function ife(u,e){return uD(u,e)}function ofe(u,e){return u.rank===e.rank&&(u=ck(u,[u.rank-1])),e=QE(e,-1),e.dtype!==u.dtype&&(e=Gs(e,u.dtype)),Gs(v1(u,e),"float32")}const sfe=lD,lfe=lD,ufe=fO,cfe=fO,ffe=hO,hfe=hO,sj=iC,dfe=aj,lj=LL,DL={binaryAccuracy:ij,categoricalAccuracy:oj,precision:afe,categoricalCrossentropy:sj,sparseCategoricalCrossentropy:lj,mse:sfe,MSE:lfe,mae:ufe,MAE:cfe,mape:ffe,MAPE:hfe,cosine:dfe};function pfe(u){if(typeof u=="string"&&u in DL)return DL[u];if(typeof u!="string"&&u!=null)return u;throw new di(`Unknown metric ${u}`)}function K6(u){if(s1(u!==null,`Unknown LossOrMetricFn ${u}`),typeof u=="string")return u;{let e;for(const n of Object.keys(RL))if(RL[n]===u){e=n;break}if(e!==void 0)return e;for(const n of Object.keys(DL))if(DL[n]===u){e=n;break}return e!==void 0?e:u.name}}function vfe(u){const e={Adagrad:()=>Qx.adagrad(.01),Adadelta:()=>Qx.adadelta(1,.95,Vp()),Adam:()=>Qx.adam(.001,.9,.999,Vp()),Adamax:()=>Qx.adamax(.002,.9,.999,Vp(),0),RMSProp:()=>Qx.rmsprop(.001,.9,0,Vp()),SGD:()=>Qx.sgd(.01)};if(e.adagrad=e.Adagrad,e.adadelta=e.Adadelta,e.adam=e.Adam,e.adamax=e.Adamax,e.rmsprop=e.RMSProp,e.sgd=e.SGD,u in e)return e[u]();throw new di(`Unknown Optimizer ${u}`)}const gB=1*1024*1024;function yB(u,e,n=!1){if(u==null||typeof u!="object"||Object.getPrototypeOf(u)!==Object.prototype||!Xz(u))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){const b=JSON.stringify(u);b.length>gB&&console.warn(`User-defined metadata of model "${e}" is too large in size (length=${b.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= ${gB}.`)}}function Xz(u){if(u===null)return!0;if(typeof u=="object")if(Object.getPrototypeOf(u)===Object.prototype){const e=Object.keys(u);for(const n of e)if(typeof n!="string"||!Xz(u[n]))return!1;return!0}else if(Array.isArray(u)){for(const e of u)if(!Xz(e))return!1;return!0}else return!1;else{const e=typeof u;return e==="string"||e==="number"||e==="boolean"}}function mfe(u,e,n,b=console.log){const R=yfe(u),q=["Layer (type)","Input Shape","Output shape","Param #"];R?(e=e||90,n=n||[.32,.61,.89,1]):(e=e||115,n=n||[.24,.48,.7,.8,1]),n[n.length-1]<=1&&(n=n.map(Pe=>Math.floor(e*Pe)));let re;if(!R){q.push("Receives inputs"),re=[];for(const Pe in u.nodesByDepth)re.push(...u.nodesByDepth[Pe])}b("_".repeat(e)),PL(q,n,b),b("=".repeat(e));const fe=u.layers;for(let Pe=0;Pe1||R.length===1&&R[0].inboundLayers.length>1){e=!1;break}b.push(...R)}if(e)for(const R of u.layers){let q=!1;for(const re of R.inboundNodes)if(b.indexOf(re)!==-1)if(q){e=!1;break}else q=!0;if(!e)break}return e}function PL(u,e,n=console.log){let b="";for(let R=0;R0&&(b=b.slice(0,b.length-1)+" "),b+=u[R],b=b.slice(0,e[R]),b+=" ".repeat(e[R]-b.length);n(b)}function _fe(u,e,n){let b,R;try{R=u.inboundNodes.map(he=>JSON.stringify(he.inputShapes)).join(",")}catch{R="multiple"}try{b=JSON.stringify(u.outputShape)}catch{b="multiple"}const q=u.name,re=u.getClassName(),fe=[`${q} (${re})`,R,b,u.countParams().toString()];PL(fe,e,n)}function xfe(u,e,n,b){let R,q;try{q=u.inboundNodes.map(je=>JSON.stringify(je.inputShapes)).join(",")}catch{q="multiple"}try{R=JSON.stringify(u.outputShape)}catch{R="multiple"}const re=[];for(const je of u.inboundNodes)if(!(n!=null&&n.length>0&&n.indexOf(je)===-1))for(let We=0;We{const e=Object.keys(u);if(e.length===0)return!1;const n=e[0].split("/");return!isNaN(parseInt(n[n.length-1],10))};class ey extends Sc{constructor(e){if(super({}),this.containerNodes=new Set,this.name=e.name,this.name==null){const Re=this.getClassName().toLowerCase();this.name=iD(Re)}if(this.supportsMasking=!1,this.trainable_=!0,Array.isArray(e.inputs)?this.inputs=e.inputs.slice():this.inputs=[e.inputs],Array.isArray(e.outputs)?this.outputs=e.outputs.slice():this.outputs=[e.outputs],lb(this.inputs).length!==this.inputs.length)throw new di(`The list of inputs passed to the model is redundant. All inputs should only appear once. Found: ${this.inputs.map(Re=>Re.name)}`);lb(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(Re=>Re.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const Re of this.outputs){const Lr=Re.sourceLayer,Cr=Re.nodeIndex,Gr=Re.tensorIndex;this.outputLayers.push(Lr),this.outputLayersNodeIndices.push(Cr),this.outputLayersTensorIndices.push(Gr)}for(const Re of this.inputs){const Lr=Re.sourceLayer,Cr=Re.nodeIndex,Gr=Re.tensorIndex;s1(Cr===0,"input layer has >1 nodes"),s1(Gr===0,"input layer has >1 tensors"),this.inputLayers.push(Lr),this.inputLayersNodeIndices.push(Cr),this.inputLayersTensorIndices.push(Gr)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let Re=0;ReRe.shape),this.internalOutputShapes=this.outputs.map(Re=>Re.shape);const n={},b={},R={},q={},re={},fe=[],he=(Re,Lr,Cr,Gr,yn,Pn)=>{(Gr==null||yn==null||Pn==null)&&(Gr=Re.sourceLayer,yn=Re.nodeIndex,Pn=Re.tensorIndex);const Vn=Gr.inboundNodes[yn];if(Cr.indexOf(Vn)!==-1)throw new m0(`The tensor ${Re.name} at layer "${Gr.name}" is part of a cycle.`);if(Lr.indexOf(Vn)!==-1)return;this.containerNodes.add(ey.nodeKey(Gr,yn)),Gr.id in re||(re[Gr.id]=Object.keys(re).length),Cr.indexOf(Vn)===-1&&Cr.push(Vn);const un=Vn.inboundLayers.length;for(let Nn=0;Nn=0;)Cr.splice(Cr.indexOf(Vn),1);fe.push(Vn)},be=[],Pe=[];for(const Re of this.outputs)he(Re,be,Pe);const je=fe.slice().reverse();for(const Re of je){b[Re.id]=Re,Re.id in n||(n[Re.id]=0);let Lr=n[Re.id];const Cr=R[Re.outboundLayer.id]==null?0:R[Re.outboundLayer.id];Lr=Math.max(Lr,Cr),R[Re.outboundLayer.id]=Lr,q[Re.outboundLayer.id]=Re.outboundLayer,n[Re.id]=Lr;for(let Gr=0;GrparseInt(Re,10)).sort(X6);this.layers=[];for(const Re of xt){const Lr=ft[Re];Lr.sort((Cr,Gr)=>{const yn=re[Cr.id],Pn=re[Gr.id];return ynPn?1:0});for(const Cr of Lr)Cr instanceof ey&&this.internalContainerRefs.push(Cr),this.layers.push(Cr)}this.layersByDepth=ft,xt=Object.keys(We).map(Re=>parseInt(Re,10)).sort(X6);const zt=this.inputs.slice(),Ft=[];for(const Re of xt)for(const Lr of We[Re]){const Cr=Lr.outboundLayer;if(Cr!=null){for(const Gr of Lr.inputTensors)if(zt.indexOf(Gr)===-1)throw new m0(`Graph disconnected: cannot obtain value for tensor ${Gr} at layer "${Cr.name}". The following previous layers were accessed without issue: ${Ft}`);for(const Gr of Lr.outputTensors)zt.push(Gr);Ft.push(Cr.name)}}this.nodesByDepth=We;const jt=this.layers.map(Re=>Re.name);for(const Re of jt){const Lr=jt.filter(Cr=>Cr===Re).length;if(Lr!==1)throw new m0(`The name "${Re}" is used ${Lr} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(jt))}this.outboundNodes=[],this.inboundNodes=[],new sD({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(Re=>null),outputMasks:this.outputs.map(Re=>null),inputShapes:this.inputs.map(Re=>Re.shape),outputShapes:this.outputs.map(Re=>Re.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(this._refCount===0)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const e={refCountAfterDispose:null,numDisposedVariables:0};if(--this._refCount===0){for(const n of this.layers)e.numDisposedVariables+=n.dispose().numDisposedVariables;for(const n of this.internalContainerRefs)e.numDisposedVariables+=n.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach(n=>{n._trainableWeights.forEach(b=>b.trainable=e)}),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new di("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(const n of this.layers)e=e.concat(n.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const n of this.layers)e.push(...n.nonTrainableWeights);if(!this.trainable){const n=[];for(const b of this.layers)n.push(...b.trainableWeights);return n.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,n=!0){const b={};let R=0;const q=bfe(e);q&&this.parseWeights(e);for(const fe of this.layers)for(const[he,be]of fe.weights.entries()){const Pe=q?`${be.name.split("/").slice(0,-1).join("/")+"/"}${he}`:be.originalName;if(b[Pe]!=null)throw new di(`Duplicate weight name: ${Pe}`);b[Pe]=be,R++}const re=[];for(const fe in e){let he=fe;if(b[fe]==null){const be=fe.split("/");he=be.slice(0,-2).concat([be[be.length-1]]).join("/")}if(b[he]!=null)re.push([b[he],e[fe]]);else if(n)throw new di(`Provided weight data has no target variable: ${fe}`);delete b[he]}if(n){const fe=[];for(const he in b)fe.push(he);if(fe.length>0)throw new di(`${fe.length} of ${R} weights are not set: ${fe}`)}uO(re)}parseWeights(e){for(const n in Object.keys(e)){const b=n.split("/"),R=["vars","layer_checkpoint_dependencies"],q=b.map(re=>re.startsWith("_")?re.slice(1):re).filter(re=>!R.includes(re)).join("/");q!==n&&(e[q]=e[n],delete e[n])}}updatedConfig(){const e=this.getConfig(),n={};return n.className=this.getClassName(),n.config=e,n.kerasVersion=`tfjs-layers ${cj}`,n.backend="TensorFlow.js",n}toJSON(e,n=!0){const b=Zz(this.updatedConfig());return n?JSON.stringify(b):b}call(e,n){return Zi(()=>{e=uh(e);const b=new nb;for(let R=0;R{e=uh(e);let b;return n==null?b=M2(null,e.length):b=uh(n),this.runInternalGraph(e,b)[1]})}computeOutputShape(e){const n=EL(e);if(n.length!==this.inputLayers.length)throw new di(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const b={};for(let fe=0;feparseInt(fe,10)).sort(X6);if(R.length>1)for(const fe of R){const he=this.nodesByDepth[fe];for(const be of he){const Pe=be.outboundLayer;if(this.inputLayers.map(zt=>zt.id).indexOf(Pe.id)!==-1)continue;const je=[];for(let zt=0;ztparseInt(he,10)).sort(X6);for(const he of R){const be=this.nodesByDepth[he];for(const Pe of be){const je=Pe.outboundLayer,We=Pe.inputTensors,ft=Pe.outputTensors,xt=new Array;for(const zt of We)zt.id in b&&xt.push(b[zt.id]);if(xt.length===We.length){let zt={},Ft,jt,Re,Lr;if(Pe.callArgs!=null&&(zt=Pe.callArgs),xt.length===1){const[Cr,Gr]=xt[0];zt.mask==null&&(zt.mask=Gr),Re=uh(je.call(Cr,zt)),Lr=uh(je.computeMask(Cr,Gr)),Ft=[Cr],jt=[Gr]}else Ft=xt.map(Cr=>Cr[0]),jt=xt.map(Cr=>Cr[1]),zt.mask==null&&(zt.mask=jt),Re=uh(je.call(Ft,zt)),Lr=uh(je.computeMask(Ft,jt));if(je.activityRegularizer)throw new rc("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let Cr=0;Cr{const e=[];for(const n of this.layers)for(let b=0;b0){const zt=[];for(let Ft=0;Ft0&&Ft.apply(Nm(Re),Lr)}function be(Ft){const jt=Ft.name,Re=__(Ft,n.customObjects!=null?n.customObjects:{});Re.setFastWeightInitDuringBuild(R),q[jt]=Re,Ft.inboundNodes.forEach(Cr=>{if(!(Cr instanceof Array))throw new di(`Corrupted configuration, expected array for nodeData: ${Cr}`);fe(Re,Cr)})}const Pe=n.name,je=n.layers;for(const Ft of je)be(Ft);for(;!ice(re);)for(const Ft of je){const jt=q[Ft.name];if(jt.name in re){const Re=re[jt.name];delete re[jt.name];for(const Lr of Re)he(jt,Lr)}}const We=[],ft=[],xt=n.inputLayers;for(const Ft of xt){const jt=Ft[0],Re=Ft[1],Lr=Ft[2];s1(jt in q);const Gr=q[jt].inboundNodes[Re].outputTensors;We.push(Gr[Lr])}const zt=n.outputLayers;for(const Ft of zt){const jt=Ft[0],Re=Ft[1],Lr=Ft[2];s1(jt in q);const Gr=q[jt].inboundNodes[Re].outputTensors;ft.push(Gr[Lr])}return new e({inputs:We,outputs:ft,name:Pe})}get stateful(){if(this._stateful)throw new di("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const e of this.layers)if(e.stateful)return!0;return!1}resetStates(){Zi(()=>{this.layers.forEach(e=>{e.stateful&&e.resetStates()})})}}function wfe(u,e,n){const b=e.length;if(u==null||Array.isArray(u)&&u.length===0)return e.map(R=>null);if(b===1)return Array.isArray(u)&&u.length===1?u:typeof u=="object"&&e[0]in u?[u[e[0]]]:[u];if(Array.isArray(u)){if(u.length!==b)throw new Error(`Provided ${n} is an array of ${u.length} element(s), but the model has ${b} outputs. Make sure a set of weights is provided for each model output.`);return u}else if(typeof u=="object"&&Object.keys(u).length>0&&typeof u[Object.keys(u)[0]]=="object"){const R=[];return e.forEach(q=>{q in u?R.push(u[q]):R.push(null)}),R}else throw new Error(`The model has multiple (${b}) outputs, so ${n} must be either an array with ${b} elements or an object with ${e} keys. Provided ${n} not understood: ${JSON.stringify(u)}`)}function fj(u,e){return wfe(u,e,"classWeight")}async function hj(u,e,n,b){if(n!=null){const R=Zi(()=>{if(u.shape.length===1)return m2(u);if(u.shape.length===2){if(u.shape[1]>1)return QE(u,1);if(u.shape[1]===1)return Pi(u,[u.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${u.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}else throw new Error(`Unexpected rank of target (y) tensor (${u.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)}),q=Array.from(await R.data());zc(R);const re=[];return q.forEach(fe=>{if(n[fe]==null)throw new Error(`classWeight must contain all classes in the training data. The class ${fe} exists in the data but not in classWeight`);re.push(n[fe])}),og(re,"float32")}else return null}function Tfe(u,e){return si(u,e)}const Afe=32;function dj(u,e){let n,b;const R=e;n=R.xs,b=R.ys,Jn(n!=null&&b!=null,()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${e}`);const q=_B("input",u.inputNames,n),re=_B("output",u.outputNames,b),fe=q[0].shape[0];Jn(q.length===u.inputs.length,()=>`LayersModel has ${u.inputs.length} inputs, but the dataset provides ${q.length} inputs. (Expected input keys: ${JSON.stringify(u.inputNames)})`),Jn(re.length===u.outputs.length,()=>`LayersModel has ${u.outputs.length} outputs, but the dataset provides ${re.length} outputs. (Expected output keys: ${JSON.stringify(u.outputNames)})`);for(let he=0;he`Batch size mismatch: input ${u.inputNames[he]} has ${q[he].shape[0]}; expected ${fe} based on input ${u.inputNames[0]}.`);for(let he=0;he`Batch size mismatch: output ${u.outputNames[he]} has ${re[he].shape[0]}; expected ${fe} based on input ${u.inputNames[0]}.`);return{xs:q,ys:re}}function _B(u,e,n){if(n instanceof $p)return[n];if(Array.isArray(n))return Jn(n.length===e.length,()=>`Received an array of ${n.length} Tensors, but expected ${e.length} to match the ${u} keys ${e}.`),n;{const b=[];for(const R of e){if(n[R]==null)throw new di(`The feature data generated by the dataset lacks the required ${u} key '${R}'.`);b.push(n[R])}return b}}function Sfe(u){if(u.length===3)throw new rc("Validation with sample weights is not implemented yet.");return{xs:u[0],ys:u[1]}}async function Efe(u,e,n){const b=n.batchesPerEpoch!=null;if(Jn(u.optimizer!=null,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),Jn(n!=null,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),Jn(n.epochs!=null&&n.epochs>0&&Number.isInteger(n.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`),Jn(!b||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`),Jn(n.validationSplit==null,()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."),u.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");u.isTraining=!0;try{const R=n.validationData!=null;let q,re;if(R)if(xB(n.validationData))Jn(n.validationBatches==null||n.validationBatches>0&&Number.isInteger(n.validationBatches),()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`);else{const Ft=Sfe(n.validationData);q=Ft.xs,re=Ft.ys}const fe=u.makeTrainFunction(),he=u.getDedupedMetricsNames();let be;R?be=he.slice().concat(he.map(Ft=>"val_"+Ft)):be=he.slice();const Pe=rj(n.callbacks,n.yieldEvery),je=n.verbose==null?1:n.verbose,{callbackList:We,history:ft}=nj(Pe,je,n.epochs,null,null,Cfe(e,n),null,R,be);We.setModel(u),u.history=ft,await We.onTrainBegin(),u.stopTraining_=!1;let xt=n.initialEpoch==null?0:n.initialEpoch,zt=await e.iterator();for(;xt=n.batchesPerEpoch:Lr.done){if(R){let Cr;xB(n.validationData)?Cr=uh(await u.evaluateDataset(n.validationData,{batches:n.validationBatches})):Cr=uh(u.evaluate(q,re,{batchSize:n.validationBatchSize==null?Afe:n.validationBatchSize,verbose:0}));for(let Gr=0;Gr0)throw new rc("Verbose mode is not implemented yet.");Jn(!b||n.batches>0&&Number.isInteger(n.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`);const re=kfe(e)?e:await e.iterator();let fe=0,he=0;for(;!b||he{if(be.value){const{xs:Pe,ys:je}=dj(u,be.value),We=Pe.concat(je),ft=Zi(()=>R(We));if(zc(We),he===0)for(let zt=0;ztKo(q[zt],si(xt,Ft))),he>0&&zc(jt)}zc(ft),fe+=xt,++he}return q}),be.done){b&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${n.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let be=0;be0&&Number.isInteger(u),()=>`batchSize is required to be a positive integer, but got ${u}`)}function jE(u,e,n){return u==null?[null]:Array.isArray(u)?u.map(b=>y2(b,e,n-e)):y2(u,e,n-e)}function Kz(u,e){return Zi(()=>u==null?null:Array.isArray(u)?u.map(n=>Kz(n,e)):$V(u,e.dtype==="int32"?e:Gs(e,"int32")))}function lz(u,e){const n=[];let b=0,R=null;for(;b=u&&(R=u),n.push([b,R]),b=R;return n}function pj(u){const e=[];u instanceof $p&&(u=[u]);for(let n=0;nn.push(R.id));else if(e!=null)for(const R in e){const q=e[R];n.push(q.id)}const b=[];if(u instanceof $p)n.indexOf(u.id)===-1&&b.push(u);else if(Array.isArray(u))u.forEach(R=>{n.indexOf(R.id)===-1&&b.push(R)});else if(u!=null)for(const R in u){const q=u[R];n.indexOf(q.id)===-1&&b.push(q)}b.forEach(R=>{R.isDisposed||R.dispose()})}function Ife(u){return u instanceof $p}function Jz(u){return Array.isArray(u)}function bB(u){return!Ife(u)&&!Jz(u)}function wB(u,e,n,b=!0,R=""){if(e==null||e.length===0){if(u!=null){let re=!1;if(Jz(u)&&u.length>0)re=!0;else if(bB(u)){for(const fe in u)if(u.hasOwnProperty(fe)){re=!0;break}}else re=!0;if(re)throw new di(`Error when checking model ${R} expected no data, but got ${u}`)}return[]}if(u==null)return e.map(re=>null);let q;if(bB(u)){u=u,q=[];for(const re of e){if(u[re]==null)throw new di(`No data provided for "${re}". Need data for each key in: ${e}`);q.push(u[re])}}else if(Jz(u)){if(u=u,u.length!==e.length)throw new di(`Error when checking model ${R}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${e.length} Tensor(s), but instead got the following list of Tensor(s): ${u}`);q=u}else{if(u=u,e.length>1)throw new di(`The model ${R} expects ${e.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${u.shape}`);q=[u]}if(q=pj(q),n!=null)for(let re=0;re=0&&be!==Pe)throw new di(`${R} expected a batch of elements where each example has shape [${n[re].slice(1,n[re].length)}] (i.e.,tensor shape [*,${n[re].slice(1,n[re].length)}]) but the ${R} received an input with ${fe.shape[0]} examples, each with shape [${fe.shape.slice(1,fe.shape.length)}] (tensor shape [${fe.shape}])`)}}return q}function Lfe(u,e,n){const b=lb(u.map(q=>q.shape[0]));b.sort();const R=lb(e.map(q=>q.shape[0]));if(R.sort(),b.length>1)throw new di(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(u.map(q=>q.shape))}`);if(R.length>1)throw new di(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map(q=>q.shape))}`);if(b.length>0&&R.length>0&&!$f(b,R))throw new di(`Input Tensors should have the same number of samples as target Tensors. Found ${b[0]} input sample(s) and ${R[0]} target sample(s).`)}function Rfe(u,e,n){const b=[lD,uD,iC];for(let R=0;R1)throw new di(`The model expects ${e.length} ${R} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(u.shape)}.`);q=[u]}if(n!=null)for(let re=0;re[]);let n;if(typeof u=="string"||typeof u=="function")n=[u];else if(Array.isArray(u)||typeof u=="object")n=u;else throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${u}`);if(Array.isArray(n))return e.map(b=>n);{const b=[];for(const R of e){let q=n.hasOwnProperty(R)?n[R]:[];Array.isArray(q)||(q=[q]),b.push(q)}return b}}const Pfe="layers-model";class SA extends ey{constructor(e){super(e),this.isTraining=!1}summary(e,n,b=console.log){if(!this.built)throw new di("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");mfe(this,e,n,b)}compile(e){if(e.loss==null&&(e.loss=[]),this.loss=e.loss,typeof e.optimizer=="string")this.optimizer_=vfe(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof bb))throw new di("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let n=[];if(!Array.isArray(e.loss)&&typeof e.loss!="string"&&typeof e.loss!="function"){e.loss=e.loss;for(const re in e.loss)if(this.outputNames.indexOf(re)===-1)throw new di(`Unknown entry in loss dictionary: "${re}". Only expected the following keys: ${this.outputNames}`);for(const re of this.outputNames)e.loss[re]==null&&console.warn(`Output "${re}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${re} during training`),n.push(oz(e.loss[re]))}else if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new di(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);n=e.loss.map(fe=>oz(fe))}else{const re=oz(e.loss);this.outputs.forEach(fe=>{n.push(re)})}this.lossFunctions=n,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let re=0;re{for(let re=0;re1&&(this.metricsTensors.push([fe,re]),this.metricsNames.push(this.outputNames[re]+"_loss"))}});const R=Dfe(e.metrics,this.outputNames),q=(re,fe,he)=>{this.outputNames.length>1&&(fe=this.outputNames[re]+"_"+fe),this.metricsNames.push(fe),this.metricsTensors.push([he,re])};g2("metric",()=>{for(let re=0;re{let je,We,ft;for(const xt of be){if(typeof xt=="string"&&["accuracy","acc","crossentropy","ce"].indexOf(xt)!==-1){const Ft=this.internalOutputShapes[re];Ft[Ft.length-1]===1||this.lossFunctions[re]===uD?["accuracy","acc"].indexOf(xt)!==-1?We=ij:["crossentropy","ce"].indexOf(xt)!==-1&&(We=ife):this.lossFunctions[re]===LL?["accuracy","acc"].indexOf(xt)!==-1?We=ofe:["crossentropy","ce"].indexOf(xt)!==-1&&(We=lj):["accuracy","acc"].indexOf(xt)!==-1?We=oj:["crossentropy","ce"].indexOf(xt)!==-1&&(We=sj);let jt;["accuracy","acc"].indexOf(xt)!==-1?jt="acc":["crossentropy","ce"].indexOf(xt)!==-1&&(jt="ce"),ft=We,je=""+jt}else ft=pfe(xt),je=""+K6(xt);let zt;g2(je,()=>{zt=ft}),q(re,je,zt)}})(fe)}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){this.collectedTrainableWeights!=null&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,n,b={}){const R=b.batchSize==null?32:b.batchSize;sz(R);const re=this.standardizeUserDataXY(e,n,!0,R);try{const fe=re[0].concat(re[1]);this.makeTestFunction();const he=this.testFunction,be=this.testLoop(he,fe,R,b.verbose,b.steps);return Nm(be)}finally{Q0(re[0],e),Q0(re[1],n)}}async evaluateDataset(e,n){return this.makeTestFunction(),Mfe(this,e,n)}checkNumSamples(e,n,b,R="steps"){let q;if(b!=null){if(q=null,n!=null)throw new di(`If ${R} is set, batchSize must be null or undefined.Got batchSize = ${n}`)}else if(e!=null)Array.isArray(e)?q=e[0].shape[0]:q=e.shape[0];else throw new di(`Either the input data should have a defined shape, or ${R} shoud be specified.`);return q}execute(e,n){if(Array.isArray(n)&&n.length===0)throw new di("`outputs` is an empty Array, which is not allowed.");const b=Array.isArray(n),R=b?n:[n],q=this.retrieveSymbolicTensors(R),re=new nb;if(e instanceof $p&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new di(`The number of inputs provided (${e.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let he=0;hefe.name);for(let fe=0;fe0){const R=[];throw n.forEach((q,re)=>{q==null&&R.push(e[re])}),new di(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(R)}`)}return n}predictLoop(e,n=32,b=!1){return Zi(()=>{const R=this.checkNumSamples(e);if(b)throw new rc("Verbose predictLoop() is not implemented yet.");const q=lz(R,n),re=this.outputs.map(fe=>[]);for(let fe=0;fe{const be=q[fe][0],Pe=q[fe][1],je=jE(e,be,Pe),We=[];if(Array.isArray(je))for(let xt=0;xtre[Pe].push(be));return Nm(re.map(fe=>Fm(fe,0)))})}predict(e,n={}){const b=pj(e);TB(b,this.inputNames,this.feedInputShapes,!1);try{const R=n.batchSize==null?32:n.batchSize;return sz(R),this.predictLoop(b,R)}finally{Q0(b,e)}}predictOnBatch(e){TB(e,this.inputNames,this.feedInputShapes,!0);const n=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,n)}standardizeUserDataXY(e,n,b=!0,R){if(this.optimizer_==null)throw new m0("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const q=[];for(let re=0;re0&&e[0].shape[0]%R!==0)throw new di(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${R}. Found: ${e[0].shape[0]} sample(s).`);return[e,n]}async standardizeUserData(e,n,b,R,q=!0,re){const[fe,he]=this.standardizeUserDataXY(e,n,q,re);if(b!=null)throw new Error("sample weight is not supported yet.");let be=null;if(R!=null){const Pe=fj(R,this.outputNames);be=[];for(let je=0;je{const re=this.checkNumSamples(n,b,q,"steps"),fe=[];if(R>0)throw new rc("Verbose mode is not implemented yet.");if(q!=null)throw new rc("steps mode in testLoop() is not implemented yet");{const he=lz(re,b),be=og(sy(0,re));for(let Pe=0;Pe1){const re=sB(e.slice(0,b),R);q+=`_${re}`}n.push(q)}return n}makeTrainFunction(){return e=>{const n=[],b=e.slice(0,this.inputs.length),R=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),q=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+this.outputs.length*2),re=[],fe=()=>{const je=[];for(let zt=0;zt1&&zt{xt=Ko(xt,zt)}),xt},he=this.collectedTrainableWeights.map(je=>je.read());return[this.optimizer_.minimize(fe,!0,he)].concat(re)}}makeTestFunction(){this.testFunction=e=>Zi(()=>{const n=[];let b;const R=e.slice(0,this.inputs.length),q=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),re=[];for(let be=0;be0){if(Ft=!0,b.validationData.length===2)he=b.validationData[0],be=b.validationData[1];else throw b.validationData.length===3?new rc("validationData including sample weights is not supported yet."):new di(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${b.validationData} is invalid.`);const Nn=await this.standardizeUserData(he,be,null,null,!0,ft);Pe=Nn[0],je=Nn[1],jt=Pe.concat(je)}else if(b.validationSplit!=null&&b.validationSplit>0&&b.validationSplit<1){Ft=!0;const un=Math.floor(R[0].shape[0]*(1-b.validationSplit)),Nn=R[0].shape[0];Pe=jE(R,un,Nn),re=R,R=jE(R,0,un),je=jE(q,un,Nn),fe=q,q=jE(q,0,un),jt=Pe.concat(je)}else b.validationSteps!=null&&(Ft=!0);const Re=R.concat(q).concat(We);this.checkTrainableWeightsConsistency();const Lr=this.makeTrainFunction(),Cr=this.getDedupedMetricsNames();let Gr,yn;Ft?(this.makeTestFunction(),Gr=this.testFunction,yn=Cr.slice().concat(Cr.map(un=>"val_"+un))):(Gr=null,jt=[],yn=Cr.slice());const Pn=rj(b.callbacks,b.yieldEvery);return await this.fitLoop(Lr,Re,Cr,ft,b.epochs,b.verbose,Pn,Gr,jt,b.shuffle,yn,b.initialEpoch,null,null)}finally{this.isTraining=!1,Q0(R,e),Q0(q,n),Q0(re,e),Q0(fe,n),Q0(Pe,he),Q0(je,be),We!=null&&zc(We)}}async fitLoop(e,n,b,R,q,re,fe,he,be,Pe,je,We,ft,xt){R==null&&(R=32),q==null&&(q=1),Pe==null&&(Pe=!0),We==null&&(We=0);let zt=!1;if(he!=null&&be!=null&&(zt=!0),xt!=null&&(zt=!0,ft==null))throw new di("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const Ft=this.checkNumSamples(n,R,ft,"steps_per_epoch");let jt;Ft!=null&&(jt=sy(0,Ft)),re==null&&(re=1);const{callbackList:Re,history:Lr}=nj(fe,re,q,We,Ft,ft,R,zt,je);Re.setModel(this),this.history=Lr,await Re.onTrainBegin(),this.stopTraining_=!1;for(let Cr=We;Cr{const Nn=Pn[Vn][0],Kr=Pn[Vn][1],Ma=y2(yn,Nn,Kr-Nn);un.batch=Vn,un.size=Kr-Nn;const ui=Kz(n,Ma),da=e(ui);for(let Ia=0;Iam_(n))}else{const n=Object.keys(this.loss);e={};const b=this.loss;for(const R of n)if(typeof b[R]=="string")e[R]=m_(b[R]);else throw new Error("Serialization of non-string loss is not supported.")}return e}getMetricIdentifiers(){if(typeof this.metrics=="string"||typeof this.metrics=="function")return[m_(K6(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(e=>m_(K6(e)));{const e={};for(const n in this.metrics)e[n]=m_(K6(this.metrics[n]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(e.weighted_metrics!=null)throw new Error("Loading weight_metrics is not supported yet.");if(e.loss_weights!=null)throw new Error("Loading loss_weights is not supported yet.");if(e.sample_weight_mode!=null)throw new Error("Loading sample_weight_mode is not supported yet.");const n=Yz(e.optimizer_config),b=__(n);let R;if(typeof e.loss=="string")R=f2(e.loss);else if(Array.isArray(e.loss))R=e.loss.map(re=>f2(re));else if(e.loss!=null){R={};for(const re in e.loss)R[re]=f2(e.loss[re])}let q;if(Array.isArray(e.metrics))q=e.metrics.map(re=>f2(re));else if(e.metrics!=null){q={};for(const re in e.metrics)q[re]=f2(e.metrics[re])}this.compile({loss:R,metrics:q,optimizer:b})}async save(e,n){if(typeof e=="string"){const be=Kte(e);if(be.length===0)throw new di(`Cannot find any save handlers for URL '${e}'`);if(be.length>1)throw new di(`Found more than one (${be.length}) save handlers for URL '${e}'`);e=be[0]}if(e.save==null)throw new di("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const b=await O9(this.getNamedWeights(n)),fe={modelTopology:this.toJSON(null,!1),format:Pfe,generatedBy:`TensorFlow.js tfjs-layers v${cj}`,convertedBy:null};if((n==null?!1:n.includeOptimizer)&&this.optimizer!=null){fe.trainingConfig=this.getTrainingConfig();const be="optimizer",{data:Pe,specs:je}=await O9(await this.optimizer.getWeights(),be);b.specs.push(...je),b.data=Zte([b.data,Pe])}return this.userDefinedMetadata!=null&&(yB(this.userDefinedMetadata,this.name,!0),fe.userDefinedMetadata=this.userDefinedMetadata),fe.weightData=b.data,fe.weightSpecs=b.specs,e.save(fe)}setUserDefinedMetadata(e){yB(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}SA.className="Model";Wo(SA);class vj extends SA{}vj.className="Functional";Wo(vj);class oC extends SA{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=e.name!=null?e.name:iD("sequential_"),e.layers!=null)for(const n of e.layers)this.add(n)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some(b=>b<0))throw new di(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const n=e instanceof oC||e instanceof SA;let b;if(n){if(b=e,b.outputs.length!==1)throw new di("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(b.inputs.length!==1)throw new di("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(this.outputs.length===0){if(e.inboundNodes.length===0){if(e.batchInputShape==null)throw new di("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const R=Nce({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(R)}if(n)this.outputs=b.outputs,this.inputs=b.inputs;else{if(e.inboundNodes.length!==1)throw new di(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(e.inboundNodes[0].outputTensors.length!==1)throw new di("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=ZV(this.outputs[0])}this.inboundNodes=[],new sD({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:M2(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map(R=>R.shape),outputShapes:this.outputs[0].shape})}else{const R=e.apply(this.outputs[0]);if(Array.isArray(R))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[R],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(this.layers.length===0)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),this.layers.length===0)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{const e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,n){return this.model==null&&this.build(),this.model.call(e,n)}build(e){if(xf(e),this.inputs.length===0||this.outputs.length===0)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new SA({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,n,b=console.log){this.built||this.build(),super.summary(e,n,b)}setWeights(e){this.model==null&&this.build(),this.model.setWeights(e)}evaluate(e,n,b={}){if(!this.built)throw new m0("The model needs to be compiled before being used.");return this.model.evaluate(e,n,b)}async evaluateDataset(e,n){if(!this.built)throw new m0("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,n)}predict(e,n={}){return this.model==null&&this.build(),this.model.predict(e,n)}predictOnBatch(e){return this.model==null&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return this.model==null?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,n,b={}){if(!this.built)throw new m0("The model needs to be compiled before being used.");return this.model.fit(e,n,b)}async fitDataset(e,n){if(!this.built)throw new m0("The model needs to be compiled before being used.");return this.model.fitDataset(e,n)}async trainOnBatch(e,n){return this.model.trainOnBatch(e,n)}static fromConfig(e,n,b={},R=!1){let q,re={};if(n instanceof Array){if(n[0].className==null||n[0].className==="Merge")throw new di("Legacy serialization format not supported yet.");q=n}else Jn(n.layers!=null,()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."),q=n.layers,delete n.layers,re=n;const fe=new e(re);if(!(fe instanceof oC))throw new rc(`Sequential.fromConfig called on non-Sequential input: ${fe}`);for(const he of q){const Pe=__(he,void 0,R);R&&Pe.setFastWeightInitDuringBuild(!0),fe.add(Pe)}return fe}set stopTraining(e){if(this.model==null)throw new di("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(this.model==null)throw new di("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){const e=[];for(const n of this.layers){const b={};b.className=n.getClassName(),b.config=n.getConfig(),e.push(b)}return{name:this.name,layers:e}}}oC.className="Sequential";Wo(oC);let Bv=class extends qA{getConfig(){return{}}};class mj extends Bv{apply(e,n=1){return xce(e,n)}}mj.className="elu";Wo(mj);class gj extends Bv{apply(e){return B$(e)}}gj.className="selu";Wo(gj);class yj extends Bv{apply(e){return k_(e)}}yj.className="relu";Wo(yj);class _j extends Bv{apply(e){return Zi(()=>LA(6,k_(e)))}}_j.className="relu6";Wo(_j);class xj extends Bv{apply(e){return e}}xj.className="linear";Wo(xj);class bj extends Bv{apply(e){return VA(e)}}bj.className="sigmoid";Wo(bj);class wj extends Bv{apply(e){return wce(e)}}wj.className="hardSigmoid";Wo(wj);class Tj extends Bv{apply(e){return uk(e)}}Tj.className="softplus";Wo(Tj);class Aj extends Bv{apply(e){return bce(e)}}Aj.className="softsign";Wo(Aj);class Sj extends Bv{apply(e){return YR(e)}}Sj.className="tanh";Wo(Sj);let dO=class extends Bv{apply(e,n=-1){return tD(e,n)}};dO.className="softmax";Wo(dO);class Ej extends Bv{apply(e,n=-1){return R$(e,n)}}Ej.className="logSoftmax";Wo(Ej);class Cj extends Bv{apply(e){return Zi(()=>Zi(()=>{const n=Math.sqrt(2),b=si(.5,Ko(1,k$(Vl(e,n))));return si(e,b)}))}}Cj.className="gelu";Wo(Cj);class kj extends Bv{apply(e){return Zi(()=>si(.5,si(e,Ko(1,YR(si(Ov(Vl(2,Math.PI)),Ko(e,si(.044715,S2(e,3)))))))))}}kj.className="gelu_new";Wo(kj);class Mj extends Bv{apply(e){return Zi(()=>si(e,YR(uk(e))))}}Mj.className="mish";Wo(Mj);class Ij extends Bv{apply(e,n=1){return Zi(()=>si(VA(si(e,n)),e))}}Ij.className="swish";Wo(Ij);function hb(u){return u.getClassName()}function uz(u,e={}){return vk(u,v0.getMap().classNameMap,e,"activation")}function db(u){if(u==null){const e={};return e.className="linear",e.config={},uz(e)}if(typeof u=="string"){const e={};return e.className=u,e.config={},uz(e)}else return u instanceof Bv?u:uz(u)}function zfe(u){if(u!=null&&typeof u!="object")throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${u}`)}class Lj extends qA{}class Rj extends Lj{constructor(e){super(),zfe(e),this.l1=e==null||e.l1==null?.01:e.l1,this.l2=e==null||e.l2==null?.01:e.l2,this.hasL1=this.l1!==0,this.hasL2=this.l2!==0}apply(e){return Zi(()=>{let n=Mp([1]);return this.hasL1&&(n=Ko(n,Cl(si(this.l1,iv(e))))),this.hasL2&&(n=Ko(n,Cl(si(this.l2,gk(e))))),Pi(n,[])})}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,n){return new e({l1:n.l1,l2:n.l2})}}Rj.className="L1L2";Wo(Rj);const AB={l1l2:"L1L2"};function Lh(u){return QN(u)}function SB(u,e={}){return vk(u,v0.getMap().classNameMap,e,"regularizer")}function pd(u){if(u==null)return null;if(typeof u=="string"){const n={className:u in AB?AB[u]:u,config:{}};return SB(n)}else return u instanceof Lj?u:SB(u)}class Dj extends Sc{constructor(e){super(e??{}),this.supportsMasking=!0,e!=null&&(this.maxValue=e.maxValue)}call(e,n){e=Eu(e);let b=k_(e);return this.maxValue!=null&&(b=Ug(b,0,this.maxValue)),b}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},n=super.getConfig();return Object.assign(e,n),e}}Dj.className="ReLU";Wo(Dj);class Pj extends Sc{constructor(e){super(e??{}),this.DEFAULT_ALPHA=.3,e==null&&(e={}),this.alpha=e.alpha==null?this.DEFAULT_ALPHA:e.alpha}call(e,n){const b=Eu(e);return cN(b,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},n=super.getConfig();return Object.assign(e,n),e}}Pj.className="LeakyReLU";Wo(Pj);class zj extends Sc{constructor(e){if(super(e??{}),this.DEFAULT_ALPHA_INITIALIZER="zeros",e==null&&(e={}),this.supportsMasking=!0,this.alphaInitializer=hd(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=pd(e.alphaRegularizer),this.alphaConstraint=qp(e.alphaConstraint),e.sharedAxes==null)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else if(typeof e.sharedAxes=="number")this.sharedAxes=[e.sharedAxes];else throw new di(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`)}build(e){e=xf(e);const n=e.slice(1);if(this.sharedAxes!=null)for(const R of this.sharedAxes)n[R-1]=1;this.alpha=this.addWeight("alpha",n,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);const b={};if(this.sharedAxes!=null)for(let R=1;R{let b=Eu(e);const R=n.mask;if(R!=null){const q=si(bl(C_(b.shape),Gs(R,b.dtype)),Pu(-1e9));b=Ko(b,q)}return this.axis instanceof Array?this.axis.length>1?$g(bl(b,hN(b,this.axis,!0))):this.softmax(b,this.axis[0]):this.softmax(b,this.axis)})}computeOutputShape(e){return e}getConfig(){const e={axis:this.axis},n=super.getConfig();return Object.assign(e,n),e}}Fj.className="Softmax";Wo(Fj);function EA(u,e,n){if(typeof u=="number")return M2(u,e);if(u.length!==e)throw new di(`The ${n} argument must be an integer or tuple of ${e} integers. Received: ${u.length} elements.`);for(let b=0;b(sp(e),e==="channelsFirst"?ef(u,[0,2,3,1]):u))}function Bj(u,e){return Zi(()=>(sp(e),e==="channelsFirst"?ef(u,[0,2,3,4,1]):u))}function Nfe(u,e,n,b=1,R="valid",q,re=1){return Zi(()=>{if(q==null&&(q=ly()),sp(q),u.shape.length!==3)throw new di(`The input of a conv1dWithBias operation should be 3, but is ${u.shape.length} instead.`);if(e.shape.length!==3)throw new di(`The kernel for a conv1dWithBias operation should be 3, but is ${e.shape.length} instead`);if(n!=null&&n.shape.length!==1)throw new di(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if(q==="channelsFirst"&&(u=ef(u,[0,2,1])),R==="causal")throw new rc("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let fe=T$(u,e,b,R==="same"?"same":"valid","NWC",re);return n!=null&&(fe=cy(fe,n)),fe})}function EB(u,e,n,b=[1,1],R="valid",q,re,fe=null){return Zi(()=>{if(q==null&&(q=ly()),sp(q),u.rank!==3&&u.rank!==4)throw new di(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${u.rank}.`);if(e.rank!==3&&e.rank!==4)throw new di(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${u.rank}.`);let he=pO(u,q);if(R==="causal")throw new rc("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return he=Coe({x:he,filter:e,strides:b,pad:R==="same"?"same":"valid",dilations:re,dataFormat:"NHWC",bias:n,activation:fe}),q==="channelsFirst"&&(he=ef(he,[0,3,1,2])),he})}function Ofe(u,e,n,b=[1,1,1],R="valid",q,re){return Zi(()=>{if(q==null&&(q=ly()),sp(q),u.rank!==4&&u.rank!==5)throw new di(`conv3dWithBias expects input to be of rank 4 or 5, but received ${u.rank}.`);if(e.rank!==4&&e.rank!==5)throw new di(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${u.rank}.`);let fe=Bj(u,q);if(R==="causal")throw new rc("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return fe=Cne(fe,e,b,R==="same"?"same":"valid","NDHWC",re),n!=null&&(fe=cy(fe,n)),q==="channelsFirst"&&(fe=ef(fe,[0,4,1,2,3])),fe})}class cD extends Sc{constructor(e,n){if(super(n),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",cD.verifyArgs(n),this.rank=e,sv(this.rank,"rank"),this.rank!==1&&this.rank!==2&&this.rank!==3)throw new rc(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=EA(n.kernelSize,e,"kernelSize"),this.strides=EA(n.strides==null?1:n.strides,e,"strides"),this.padding=n.padding==null?"valid":n.padding,jg(this.padding),this.dataFormat=n.dataFormat==null?"channelsLast":n.dataFormat,sp(this.dataFormat),this.activation=db(n.activation),this.useBias=n.useBias==null?!0:n.useBias,this.biasInitializer=hd(n.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=qp(n.biasConstraint),this.biasRegularizer=pd(n.biasRegularizer),this.activityRegularizer=pd(n.activityRegularizer),this.dilationRate=EA(n.dilationRate==null?1:n.dilationRate,e,"dilationRate"),this.rank===1&&Array.isArray(this.dilationRate)&&this.dilationRate.length!==1)throw new di(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(this.rank===2){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==2)throw new di(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(this.rank===3){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==3)throw new di(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}}static verifyArgs(e){if(s1("kernelSize"in e,"required key 'kernelSize' not in config"),typeof e.kernelSize!="number"&&!eO(e.kernelSize,"number",1,3))throw new di(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){const e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:hb(this.activation),useBias:this.useBias,biasInitializer:Cd(this.biasInitializer),biasRegularizer:Lh(this.biasRegularizer),activityRegularizer:Lh(this.activityRegularizer),biasConstraint:Gp(this.biasConstraint)},n=super.getConfig();return Object.assign(e,n),e}}class HA extends cD{constructor(e,n){super(e,n),this.kernel=null,HA.verifyArgs(n),this.filters=n.filters,sv(this.filters,"filters"),this.kernelInitializer=hd(n.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=qp(n.kernelConstraint),this.kernelRegularizer=pd(n.kernelRegularizer)}build(e){e=xf(e);const n=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[n]==null)throw new di(`The channel dimension of the input should be defined. Found ${e[n]}`);const b=e[n],R=this.kernelSize.concat([b,this.filters]);this.kernel=this.addWeight("kernel",R,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[n]:b}}],this.built=!0}call(e,n){return Zi(()=>{e=Eu(e);let b;const R=this.bias==null?null:this.bias.read(),q=zV(this.activation.getClassName());if(q!=null&&this.rank===2)b=EB(e,this.kernel.read(),R,this.strides,this.padding,this.dataFormat,this.dilationRate,q);else{if(this.rank===1)b=Nfe(e,this.kernel.read(),R,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(this.rank===2)b=EB(e,this.kernel.read(),R,this.strides,this.padding,this.dataFormat,this.dilationRate);else if(this.rank===3)b=Ofe(e,this.kernel.read(),R,this.strides,this.padding,this.dataFormat,this.dilationRate);else throw new rc("convolutions greater than 3D are not implemented yet.");this.activation!=null&&(b=this.activation.apply(b))}return b})}computeOutputShape(e){e=xf(e);const n=[],b=this.dataFormat==="channelsLast"?e.slice(1,e.length-1):e.slice(2);for(let q=0;q 0 but got ${JSON.stringify(e.filters)}`)}}class bk extends HA{constructor(e){super(2,e),bk.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!eO(e.kernelSize,"number",1,2))throw new di(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}bk.className="Conv2D";Wo(bk);class wk extends HA{constructor(e){super(3,e),wk.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!(Array.isArray(e.kernelSize)&&(e.kernelSize.length===1||e.kernelSize.length===3)))throw new di(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}wk.className="Conv3D";Wo(wk);class Uj extends bk{constructor(e){if(super(e),this.inputSpec=[new jp({ndim:4})],this.padding!=="same"&&this.padding!=="valid")throw new di(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=xf(e),e.length!==4)throw new di("Input should have rank 4; Received input shape: "+JSON.stringify(e));const n=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[n]==null)throw new di("The channel dimension of the inputs should be defined. Found `None`.");const b=e[n],R=this.kernelSize.concat([this.filters,b]);this.kernel=this.addWeight("kernel",R,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new jp({ndim:4,axes:{[n]:b}})],this.built=!0}call(e,n){return Zi(()=>{let b=Eu(e);if(b.shape.length!==4)throw new di(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${b.shape.length}`);const R=b.shape,q=R[0];let re,fe;this.dataFormat==="channelsFirst"?(re=2,fe=3):(re=1,fe=2);const he=R[re],be=R[fe],Pe=this.kernelSize[0],je=this.kernelSize[1],We=this.strides[0],ft=this.strides[1],xt=l1(he,We,Pe,this.padding),zt=l1(be,ft,je,this.padding),Ft=[q,xt,zt,this.filters];this.dataFormat!=="channelsLast"&&(b=ef(b,[0,2,3,1]));let jt=A$(b,this.kernel.read(),Ft,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(jt=ef(jt,[0,3,1,2])),this.bias!=null&&(jt=cy(jt,this.bias.read(),this.dataFormat)),this.activation!=null&&(jt=this.activation.apply(jt)),jt})}computeOutputShape(e){e=xf(e);const n=e.slice();let b,R,q;this.dataFormat==="channelsFirst"?(b=1,R=2,q=3):(b=3,R=1,q=2);const re=this.kernelSize[0],fe=this.kernelSize[1],he=this.strides[0],be=this.strides[1];return n[b]=this.filters,n[R]=l1(n[R],he,re,this.padding),n[q]=l1(n[q],be,fe,this.padding),n}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}Uj.className="Conv2DTranspose";Wo(Uj);class $j extends wk{constructor(e){if(super(e),this.inputSpec=[new jp({ndim:5})],this.padding!=="same"&&this.padding!=="valid")throw new di(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=xf(e),e.length!==5)throw new di("Input should have rank 5; Received input shape: "+JSON.stringify(e));const n=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[n]==null)throw new di("The channel dimension of the inputs should be defined. Found `None`.");const b=e[n],R=this.kernelSize.concat([this.filters,b]);this.kernel=this.addWeight("kernel",R,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new jp({ndim:5,axes:{[n]:b}})],this.built=!0}call(e,n){return Zi(()=>{let b=Eu(e);if(b.shape.length!==5)throw new di(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${b.shape.length}`);const R=b.shape,q=R[0];let re,fe,he;this.dataFormat==="channelsFirst"?(he=2,re=3,fe=4):(he=1,re=2,fe=3);const be=R[he],Pe=R[re],je=R[fe],We=this.kernelSize[0],ft=this.kernelSize[1],xt=this.kernelSize[2],zt=this.strides[0],Ft=this.strides[1],jt=this.strides[2],Re=l1(be,zt,We,this.padding),Lr=l1(Pe,Ft,ft,this.padding),Cr=l1(je,jt,xt,this.padding),Gr=[q,Re,Lr,Cr,this.filters];this.dataFormat!=="channelsLast"&&(b=ef(b,[0,2,3,4,1]));let yn=Ine(b,this.kernel.read(),Gr,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(yn=ef(yn,[0,4,1,2,3])),this.bias!==null&&(yn=cy(yn,this.bias.read(),this.dataFormat)),this.activation!==null&&(yn=this.activation.apply(yn)),yn})}computeOutputShape(e){e=xf(e);const n=e.slice();let b,R,q,re;this.dataFormat==="channelsFirst"?(b=1,R=2,q=3,re=4):(b=4,R=1,q=2,re=3);const fe=this.kernelSize[0],he=this.kernelSize[1],be=this.kernelSize[2],Pe=this.strides[0],je=this.strides[1],We=this.strides[2];return n[b]=this.filters,n[R]=l1(n[R],Pe,fe,this.padding),n[q]=l1(n[q],je,he,this.padding),n[re]=l1(n[re],We,be,this.padding),n}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}$j.className="Conv3DTranspose";Wo($j);class Vj extends HA{constructor(e,n){if(super(e,n),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,n.filters==null)throw new di("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(n.kernelInitializer!=null||n.kernelRegularizer!=null||n.kernelConstraint!=null)throw new di("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(n.padding!=null&&n.padding!=="same"&&n.padding!=="valid")throw new di(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(n.padding)}`);this.depthMultiplier=n.depthMultiplier==null?1:n.depthMultiplier,this.depthwiseInitializer=hd(n.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=pd(n.depthwiseRegularizer),this.depthwiseConstraint=qp(n.depthwiseConstraint),this.pointwiseInitializer=hd(n.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=pd(n.pointwiseRegularizer),this.pointwiseConstraint=qp(n.pointwiseConstraint)}build(e){if(e=xf(e),e.length{e=Eu(e);let b;if(this.rank===1)throw new rc("1D separable convolution is not implemented yet.");return this.rank===2&&(this.dataFormat==="channelsFirst"&&(e=ef(e,[0,2,3,1])),b=U$(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(b=cy(b,this.bias.read(),this.dataFormat)),this.activation!=null&&(b=this.activation.apply(b)),this.dataFormat==="channelsFirst"&&(b=ef(b,[0,3,1,2])),b})}getConfig(){const e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=Cd(this.depthwiseInitializer),e.pointwiseInitializer=Cd(this.pointwiseInitializer),e.depthwiseRegularizer=Lh(this.depthwiseRegularizer),e.pointwiseRegularizer=Lh(this.pointwiseRegularizer),e.depthwiseConstraint=Gp(this.depthwiseConstraint),e.pointwiseConstraint=Gp(this.pointwiseConstraint),e}}Vj.className="SeparableConv";class jj extends Vj{constructor(e){super(2,e)}}jj.className="SeparableConv2D";Wo(jj);class fD extends HA{constructor(e){super(1,e),fD.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){const e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!eO(e.kernelSize,"number",1,1))throw new di(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}fD.className="Conv1D";Wo(fD);class Gj extends Sc{constructor(e){super(e),typeof e.cropping=="number"?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:typeof e.cropping[0]=="number"?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=e.dataFormat===void 0?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return this.dataFormat==="channelsFirst"?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,n){return Zi(()=>{if(e=Eu(e),this.dataFormat==="channelsLast"){const b=Z6(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return Z6(b,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}else{const b=Z6(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return Z6(b,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){const e={cropping:this.cropping,dataFormat:this.dataFormat},n=super.getConfig();return Object.assign(e,n),e}}Gj.className="Cropping2D";Wo(Gj);class qj extends Sc{constructor(e){super(e),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=e.size==null?this.DEFAULT_SIZE:e.size,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,sp(this.dataFormat),this.interpolation=e.interpolation==null?"nearest":e.interpolation,dce(this.interpolation)}computeOutputShape(e){if(this.dataFormat==="channelsFirst"){const n=e[2]==null?null:this.size[0]*e[2],b=e[3]==null?null:this.size[1]*e[3];return[e[0],e[1],n,b]}else{const n=e[1]==null?null:this.size[0]*e[1],b=e[2]==null?null:this.size[1]*e[2];return[e[0],n,b,e[3]]}}call(e,n){return Zi(()=>{let b=Eu(e);const R=b.shape;if(this.dataFormat==="channelsFirst"){b=ef(b,[0,2,3,1]);const q=this.size[0]*R[2],re=this.size[1]*R[3],fe=this.interpolation==="nearest"?y_.resizeNearestNeighbor(b,[q,re]):y_.resizeBilinear(b,[q,re]);return ef(fe,[0,3,1,2])}else{const q=this.size[0]*R[1],re=this.size[1]*R[2];return this.interpolation==="nearest"?y_.resizeNearestNeighbor(b,[q,re]):y_.resizeBilinear(b,[q,re])}})}getConfig(){const e={size:this.size,dataFormat:this.dataFormat,interpolation:this.interpolation},n=super.getConfig();return Object.assign(e,n),e}}qj.className="UpSampling2D";Wo(qj);function Ffe(u,e,n=[1,1],b="valid",R,q){return Zi(()=>{R==null&&(R=ly()),sp(R);let re=pO(u,R);if(u.rank!==4)throw new di(`Input for depthwiseConv2d is required to be 4-D, but is instead ${u.rank}-D`);if(e.rank!==4)throw new di(`depthwiseKernel is required to be 4-D, but is instead ${e.rank}-D`);return re=oN(re,e,n,b==="same"?"same":"valid","NHWC",q),R==="channelsFirst"&&(re=ef(re,[0,3,1,2])),re})}class Hj extends cD{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=e.depthMultiplier==null?1:e.depthMultiplier,this.depthwiseInitializer=hd(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=qp(e.depthwiseConstraint),this.depthwiseRegularizer=pd(e.depthwiseRegularizer)}build(e){if(e=xf(e),e.length<4)throw new di(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);const n=this.dataFormat==="channelsFirst"?1:3;if(e[n]==null||e[n]<0)throw new di(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[n]}).`);const b=e[n],R=[this.kernelSize[0],this.kernelSize[1],b,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",R,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[b*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,n){return Zi(()=>{e=Eu(e);let b=Ffe(e,this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(b=cy(b,this.bias.read(),this.dataFormat)),this.activation!=null&&(b=this.activation.apply(b)),b})}computeOutputShape(e){e=xf(e);const n=this.dataFormat==="channelsFirst"?e[2]:e[1],b=this.dataFormat==="channelsFirst"?e[3]:e[2],R=this.dataFormat==="channelsFirst"?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,q=oy(n,this.kernelSize[0],this.padding,this.strides[0]),re=oy(b,this.kernelSize[1],this.padding,this.strides[1]);return this.dataFormat==="channelsFirst"?[e[0],R,q,re]:[e[0],q,re,R]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=Cd(this.depthwiseInitializer),e.depthwiseRegularizer=Lh(this.depthwiseRegularizer),e.depthwiseConstraint=Gp(this.depthwiseRegularizer),e}}Hj.className="DepthwiseConv2D";Wo(Hj);function Wj(u,e,n,b){if(Array.isArray(u)){if(e!=null||n!=null)throw new di("When inputs is an array, neither initialState or constants should be provided");b!=null&&(n=u.slice(u.length-b,u.length),u=u.slice(0,u.length-b)),u.length>1&&(e=u.slice(1,u.length)),u=u[0]}function R(q){return q==null||Array.isArray(q)?q:[q]}return e=R(e),n=R(n),{inputs:u,initialState:e,constants:n}}function Xj(u,e,n,b=!1,R,q,re=!1,fe=!1){return Zi(()=>{const he=e.shape.length;if(he<3)throw new di(`Input should be at least 3D, but is ${he}D.`);const be=[1,0].concat(sy(2,he));e=ef(e,be),re&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),R!=null&&(R=Gs(Gs(R,"bool"),"float32"),R.rank===he-1&&(R=zm(R,-1)),R=ef(R,be)),b&&(e=C2(e,0),R!=null&&(R=C2(R,0)));const Pe=[];let je,We=n;const ft=e.shape[0],xt=k2(e);let zt;R!=null&&(zt=k2(R));for(let jt=0;jtu(Re,We));if(R==null)je=Lr[0],We=Lr[1];else{const Cr=Zi(()=>{const Gr=zt[jt],yn=bl(x0(Gr),Gr),Pn=Ko(si(Lr[0],Gr),si(We[0],yn)),Vn=We.map((un,Nn)=>Ko(si(Lr[1][Nn],Gr),si(un,yn)));return{output:Pn,newStates:Vn}});je=Cr.output,We=Cr.newStates}fe&&Pe.push(je)}let Ft;return fe&&(Ft=b_(Pe,1)),[je,Ft,We]})}class wb extends Sc{constructor(e){super(e);let n;if(e.cell==null)throw new di("cell property is missing for the constructor of RNN.");if(Array.isArray(e.cell)?n=new gO({cells:e.cell}):n=e.cell,n.stateSize==null)throw new di("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=n,this.returnSequences=e.returnSequences==null?!1:e.returnSequences,this.returnState=e.returnState==null?!1:e.returnState,this.goBackwards=e.goBackwards==null?!1:e.goBackwards,this._stateful=e.stateful==null?!1:e.stateful,this.unroll=e.unroll==null?!1:e.unroll,this.supportsMasking=!0,this.inputSpec=[new jp({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(this.states_==null){const e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;return sy(0,e).map(n=>null)}else return this.states_}setStates(e){this.states_=e}computeOutputShape(e){Hz(e)&&(e=e[0]),e=e;let n=this.cell.stateSize;Array.isArray(n)||(n=[n]);const b=n[0];let R;if(this.returnSequences?R=[e[0],e[1],b]:R=[e[0],b],this.returnState){const q=[];for(const re of n)q.push([e[0],re]);return[R].concat(q)}else return R}computeMask(e,n){return Zi(()=>{Array.isArray(n)&&(n=n[0]);const b=this.returnSequences?n:null;if(this.returnState){const R=this.states.map(q=>null);return[b].concat(R)}else return b})}get states(){if(this.states_==null){const e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,n=[];for(let b=0;bre.shape[re.shape.length-1]),q))throw new di(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=q.map(re=>new jp({shape:[null,re]}));this.stateful&&this.resetStates()}resetStates(e,n=!1){Zi(()=>{if(!this.stateful)throw new o1("Cannot call resetStates() on an RNN Layer that is not stateful.");const b=this.inputSpec[0].shape[0];if(b==null)throw new di("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.states_==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(R=>Mp([b,R])):this.states_=[Mp([b,this.cell.stateSize])];else if(e==null)zc(this.states_),this.keptStates!=null&&(zc(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(R=>Mp([b,R])):this.states_[0]=Mp([b,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new di(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);n===!0?this.keptStates.push(this.states_.slice()):zc(this.states_);for(let R=0;Rf1(R.clone()))})}apply(e,n){let b=n==null?null:n.initialState,R=n==null?null:n.constants;n==null&&(n={});const q=Wj(e,b,R,this.numConstants);e=q.inputs,b=q.initialState,R=q.constants;let re=[],fe=[];if(b!=null){n.initialState=b,re=re.concat(b),this.stateSpec=[];for(const be of b)this.stateSpec.push(new jp({shape:be.shape}));fe=fe.concat(this.stateSpec)}if(R!=null&&(n.constants=R,re=re.concat(R),this.numConstants=R.length),re[0]instanceof m1){const be=[e].concat(re),Pe=this.inputSpec.concat(fe),je=this.inputSpec;this.inputSpec=Pe;const We=super.apply(be,n);return this.inputSpec=je,We}else return super.apply(e,n)}call(e,n){return Zi(()=>{const b=n==null?null:n.mask,R=n==null?null:n.training;let q=n==null?null:n.initialState;e=Eu(e),q==null&&(this.stateful?q=this.states_:q=this.getInitialState(e));const re=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(q.length!==re)throw new di(`RNN Layer has ${re} state(s) but was passed ${q.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");const fe={training:R},be=Xj((xt,zt)=>{const Ft=this.cell.call([xt].concat(zt),fe);return[Ft[0],Ft.slice(1)]},e,q,this.goBackwards,b,null,this.unroll,this.returnSequences),Pe=be[0],je=be[1],We=be[2];this.stateful&&this.resetStates(We,R);const ft=this.returnSequences?je:Pe;return this.returnState?[ft].concat(We):ft})}getInitialState(e){return Zi(()=>{let n=Mp(e.shape);return n=Cl(n,[1,2]),n=mk(n),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(b=>b>1?Gz(n,[1,b]):n):this.cell.stateSize>1?[Gz(n,[1,this.cell.stateSize])]:[n]})}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.cell!=null&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){const e=super.getConfig(),n={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};this.numConstants!=null&&(n.numConstants=this.numConstants);const b=this.cell.getConfig();return this.getClassName()===wb.className&&(n.cell={className:this.cell.getClassName(),config:b}),Object.assign(Object.assign(Object.assign({},b),e),n)}static fromConfig(e,n,b={}){const R=n.cell,q=__(R,b);return new e(Object.assign(n,{cell:q}))}}wb.className="RNN";Wo(wb);class hD extends Sc{}class vO extends hD{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,sv(this.units,"units"),this.activation=db(e.activation==null?this.DEFAULT_ACTIVATION:e.activation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=hd(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=hd(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=hd(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=pd(e.kernelRegularizer),this.recurrentRegularizer=pd(e.recurrentRegularizer),this.biasRegularizer=pd(e.biasRegularizer),this.kernelConstraint=qp(e.kernelConstraint),this.recurrentConstraint=qp(e.recurrentConstraint),this.biasConstraint=qp(e.biasConstraint),this.dropout=RA([1,fb([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=RA([1,fb([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=xf(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,n){return Zi(()=>{if(e=e,e.length!==2)throw new di(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let b=e[1];e=e[0];const R=n.training==null?!1:n.training;0x0(e),rate:this.dropout,training:R,dropoutFunc:this.dropoutFunc})),0x0(b),rate:this.recurrentDropout,training:R,dropoutFunc:this.dropoutFunc}));let q;const re=this.dropoutMask,fe=this.recurrentDropoutMask;re!=null?q=p1(si(e,re),this.kernel.read()):q=p1(e,this.kernel.read()),this.bias!=null&&(q=cy(q,this.bias.read())),fe!=null&&(b=si(b,fe));let he=Ko(q,p1(b,this.recurrentKernel.read()));return this.activation!=null&&(he=this.activation.apply(he)),[he,he]})}getConfig(){const e=super.getConfig(),n={units:this.units,activation:hb(this.activation),useBias:this.useBias,kernelInitializer:Cd(this.kernelInitializer),recurrentInitializer:Cd(this.recurrentInitializer),biasInitializer:Cd(this.biasInitializer),kernelRegularizer:Lh(this.kernelRegularizer),recurrentRegularizer:Lh(this.recurrentRegularizer),biasRegularizer:Lh(this.biasRegularizer),activityRegularizer:Lh(this.activityRegularizer),kernelConstraint:Gp(this.kernelConstraint),recurrentConstraint:Gp(this.recurrentConstraint),biasConstraint:Gp(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign(Object.assign({},e),n)}}vO.className="SimpleRNNCell";Wo(vO);class Yj extends wb{constructor(e){e.cell=new vO(e),super(e)}call(e,n){return Zi(()=>{this.cell.dropoutMask!=null&&(zc(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(zc(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const b=n==null?null:n.mask,R=n==null?null:n.training,q=n==null?null:n.initialState;return super.call(e,{mask:b,training:R,initialState:q})})}static fromConfig(e,n){return new e(n)}}Yj.className="SimpleRNN";Wo(Yj);class mO extends hD{constructor(e){if(super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new di("GRUCell does not support reset_after parameter set to true.");this.units=e.units,sv(this.units,"units"),this.activation=db(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=db(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=hd(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=hd(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=hd(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=pd(e.kernelRegularizer),this.recurrentRegularizer=pd(e.recurrentRegularizer),this.biasRegularizer=pd(e.biasRegularizer),this.kernelConstraint=qp(e.kernelConstraint),this.recurrentConstraint=qp(e.recurrentConstraint),this.biasConstraint=qp(e.biasConstraint),this.dropout=RA([1,fb([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=RA([1,fb([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=xf(e);const n=e[e.length-1];this.kernel=this.addWeight("kernel",[n,this.units*3],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*3],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units*3],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,n){return Zi(()=>{if(e=e,e.length!==2)throw new di(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);const b=n.training==null?!1:n.training;let R=e[1];e=e[0],0x0(e),rate:this.dropout,training:b,count:3,dropoutFunc:this.dropoutFunc})),0x0(R),rate:this.recurrentDropout,training:b,count:3,dropoutFunc:this.dropoutFunc}));const q=this.dropoutMask,re=this.recurrentDropoutMask;let fe,he,be;0{this.cell.dropoutMask!=null&&(zc(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(zc(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const b=n==null?null:n.mask,R=n==null?null:n.training,q=n==null?null:n.initialState;return super.call(e,{mask:b,training:R,initialState:q})})}static fromConfig(e,n){return n.implmentation===0&&(n.implementation=1),new e(n)}}Zj.className="GRU";Wo(Zj);class dD extends hD{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,sv(this.units,"units"),this.activation=db(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=db(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=hd(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=hd(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=hd(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=pd(e.kernelRegularizer),this.recurrentRegularizer=pd(e.recurrentRegularizer),this.biasRegularizer=pd(e.biasRegularizer),this.kernelConstraint=qp(e.kernelConstraint),this.recurrentConstraint=qp(e.recurrentConstraint),this.biasConstraint=qp(e.biasConstraint),this.dropout=RA([1,fb([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=RA([1,fb([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var n;e=xf(e);const b=e[e.length-1];this.kernel=this.addWeight("kernel",[b,this.units*4],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*4],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint);let R;if(this.useBias){if(this.unitForgetBias){const q=this.biasInitializer,re=this.units;R=new(n=class extends T0{apply(he,be){const Pe=q.apply([re]),je=new rO().apply([re]),We=q.apply([re*2]);return uB(uB(Pe,je),We)}},n.className="CustomInit",n)}else R=this.biasInitializer;this.bias=this.addWeight("bias",[this.units*4],null,R,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,n){return Zi(()=>{const b=n.training==null?!1:n.training;if(e=e,e.length!==3)throw new di(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let R=e[1];const q=e[2];e=e[0],0x0(e),rate:this.dropout,training:b,count:4,dropoutFunc:this.dropoutFunc})),0x0(R),rate:this.recurrentDropout,training:b,count:4,dropoutFunc:this.dropoutFunc}));const re=this.dropoutMask,fe=this.recurrentDropoutMask;let he,be,Pe,je;0{this.cell.dropoutMask!=null&&(zc(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(zc(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const b=n==null?null:n.mask,R=n==null?null:n.training,q=n==null?null:n.initialState;return super.call(e,{mask:b,training:R,initialState:q})})}static fromConfig(e,n){return n.implmentation===0&&(n.implementation=1),new e(n)}}Kj.className="LSTM";Wo(Kj);class gO extends hD{constructor(e){super(e),this.cells=e.cells}get stateSize(){const e=[];for(const n of this.cells.slice().reverse())Array.isArray(n.stateSize)?e.push(...n.stateSize):e.push(n.stateSize);return e}call(e,n){return Zi(()=>{e=e;let b=e.slice(1);const R=[];for(const fe of this.cells.slice().reverse())Array.isArray(fe.stateSize)?R.push(b.splice(0,fe.stateSize.length)):R.push(b.splice(0,1));R.reverse();const q=[];let re;for(let fe=0;fe{g2(`RNNCell_${R}`,()=>{b.build(e),Array.isArray(b.stateSize)?n=b.stateSize[0]:n=b.stateSize,e=[e[0],n]})}),this.built=!0}getConfig(){const e=super.getConfig(),n=q=>({className:q.getClassName(),config:q.getConfig()}),R={cells:this.cells.map(n)};return Object.assign(Object.assign({},e),R)}static fromConfig(e,n,b={}){const R=[];for(const q of n.cells)R.push(__(q,b));return new e({cells:R})}get trainableWeights(){if(!this.trainable)return[];const e=[];for(const n of this.cells)e.push(...n.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const n of this.cells)e.push(...n.nonTrainableWeights);if(!this.trainable){const n=[];for(const b of this.cells)n.push(...b.trainableWeights);return n.concat(e)}return e}getWeights(){const e=[];for(const n of this.cells)e.push(...n.weights);return Wz(e)}setWeights(e){const n=[];for(const b of this.cells){const R=b.weights.length,q=e.splice(R);for(let re=0;req!=null?q(e(),n):VV(e(),n),fe=()=>yk(re,e,b);return!R||R<=1?f1(fe().clone()):Array(R).fill(void 0).map(fe).map(be=>f1(be.clone()))}var Bfe=function(u,e){var n={};for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&e.indexOf(b)<0&&(n[b]=u[b]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var R=0,b=Object.getOwnPropertySymbols(u);R{if(this.cell.dropoutMask!=null&&(zc(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(zc(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),n&&n.constants)throw new di("ConvRNN2D cell does not support constants");const b=n==null?null:n.mask,R=n==null?null:n.training,q=n==null?null:n.initialState;return super.call(e,{mask:b,training:R,initialState:q})})}computeOutputShape(e){let n=this.computeSingleOutputShape(e);return this.returnSequences||(n=[n[0],...n.slice(2)]),this.returnState&&(n=[n,...Array(2).fill([e[0],...n.slice(-3)])]),n}getInitialState(e){return Zi(()=>{const{stateSize:n}=this.cell,b=e.shape,R=this.computeSingleOutputShape(b),q=[R[0],...R.slice(2)],re=Mp(q);return Array.isArray(n)?Array(n.length).fill(re):[re]})}resetStates(e,n=!1){Zi(()=>{if(!this.stateful)throw new o1("Cannot call resetStates() on an RNN Layer that is not stateful.");const b=this.inputSpec[0].shape,R=this.computeSingleOutputShape(b),q=[R[0],...R.slice(2)];if(b[0]==null)throw new di("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.getStates()==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>Mp(q)):this.states_=[Mp(q)];else if(e==null)zc(this.states_),this.keptStates!=null&&(zc(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>Mp(q)):this.states_[0]=Mp(q);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new di(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);n?this.keptStates.push(this.states_.slice()):zc(this.states_);for(let fe=0;fef1(fe.clone()))})}computeSingleOutputShape(e){const{dataFormat:n,filters:b,kernelSize:R,padding:q,strides:re,dilationRate:fe}=this.cell,he=n==="channelsFirst",be=e[he?3:2],Pe=e[he?4:3],je=oy(be,R[0],q,re[0],fe[0]),We=oy(Pe,R[1],q,re[1],fe[1]);return[...e.slice(0,2),...he?[b,je,We]:[je,We,b]]}}Jj.className="ConvRNN2D";class yO extends dD{constructor(e){const{filters:n,kernelSize:b,strides:R,padding:q,dataFormat:re,dilationRate:fe}=e;super(Object.assign(Object.assign({},e),{units:n})),this.filters=n,sv(this.filters,"filters"),this.kernelSize=EA(b,2,"kernelSize"),this.kernelSize.forEach(he=>sv(he,"kernelSize")),this.strides=EA(R||1,2,"strides"),this.strides.forEach(he=>sv(he,"strides")),this.padding=q||"valid",jg(this.padding),this.dataFormat=re||"channelsLast",sp(this.dataFormat),this.dilationRate=EA(fe||1,2,"dilationRate"),this.dilationRate.forEach(he=>sv(he,"dilationRate"))}build(e){var n;e=xf(e);const b=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[b]==null)throw new di(`The channel dimension of the input should be defined. Found ${e[b]}`);const R=e[b],q=4,re=this.kernelSize.concat([R,this.filters*q]);this.kernel=this.addWeight("kernel",re,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const fe=this.kernelSize.concat([this.filters,this.filters*q]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",fe,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let he;if(this.unitForgetBias){const be=this.biasInitializer,Pe=this.filters;he=new(n=class extends T0{apply(We,ft){const xt=be.apply([Pe]),zt=C_([Pe]),Ft=be.apply([Pe*2]);return tO([xt,zt,Ft])}},n.className="CustomInit",n)}else he=this.biasInitializer;this.bias=this.addWeight("bias",[this.filters*q],null,he,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,n){return Zi(()=>{if(e.length!==3)throw new di(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const b=n.training||!1,R=e[0],q=e[1],re=e[2],fe=4;0x0(R),rate:this.dropout,training:b,count:fe,dropoutFunc:this.dropoutFunc}));const he=this.dropoutMask,be=($i,Hn,qa)=>!Hn||!Hn[qa]?$i:si(Hn[qa],$i);let Pe=be(R,he,0),je=be(R,he,1),We=be(R,he,2),ft=be(R,he,3);0x0(q),rate:this.recurrentDropout,training:b,count:fe,dropoutFunc:this.dropoutFunc}));const xt=this.recurrentDropoutMask;let zt=be(q,xt,0),Ft=be(q,xt,1),jt=be(q,xt,2),Re=be(q,xt,3);const Lr=3,[Cr,Gr,yn,Pn]=Bg(this.kernel.read(),fe,Lr),[Vn,un,Nn,Kr]=this.useBias?Bg(this.bias.read(),fe):[null,null,null,null];Pe=this.inputConv(Pe,Cr,Vn,this.padding),je=this.inputConv(je,Gr,un,this.padding),We=this.inputConv(We,yn,Nn,this.padding),ft=this.inputConv(ft,Pn,Kr,this.padding);const[Ma,ui,da,Ia]=Bg(this.recurrentKernel.read(),fe,Lr);zt=this.recurrentConv(zt,Ma),Ft=this.recurrentConv(Ft,ui),jt=this.recurrentConv(jt,da),Re=this.recurrentConv(Re,Ia);const aa=this.recurrentActivation.apply(Ko(Pe,zt)),Ka=this.recurrentActivation.apply(Ko(je,Ft)),ai=Ko(si(Ka,re),si(aa,this.activation.apply(Ko(We,jt)))),Ui=si(this.recurrentActivation.apply(Ko(ft,Re)),this.activation.apply(ai));return[Ui,Ui,ai]})}getConfig(){const e=super.getConfig(),{units:n}=e,b=Bfe(e,["units"]),R={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign(Object.assign({},b),R)}inputConv(e,n,b,R){const q=A2(e,n,this.strides,R||"valid",this.dataFormat==="channelsFirst"?"NCHW":"NHWC",this.dilationRate);return b?cy(q,b,this.dataFormat):q}recurrentConv(e,n){return A2(e,n,1,"same",this.dataFormat==="channelsFirst"?"NCHW":"NHWC")}}yO.className="ConvLSTM2DCell";Wo(yO);class Qj extends Jj{constructor(e){const n=new yO(e);super(Object.assign(Object.assign({},e),{cell:n}))}static fromConfig(e,n){return new e(n)}}Qj.className="ConvLSTM2D";Wo(Qj);class _O extends Sc{constructor(e){super(e),this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(this.noiseShape==null)return this.noiseShape;const n=e.shape,b=[];for(let R=0;R{this.invokeCallHook(e,n);const b=Eu(e);if(0VV(b,this.rate,q,this.seed),()=>b,R)}return e})}getConfig(){const e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},n=super.getConfig();return Object.assign(e,n),e}dispose(){return super.dispose()}}_O.className="Dropout";Wo(_O);class eG extends _O{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const n=e.shape;return[n[0],1,n[2]]}}eG.className="SpatialDropout1D";Wo(eG);class tG extends Sc{constructor(e){if(super(e),this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.batchInputShape==null&&e.inputShape==null&&e.inputDim!=null){let n=null;e.batchSize!=null&&(n=e.batchSize),this.batchInputShape=[n,e.inputDim]}this.units=e.units,sv(this.units,"units"),this.activation=db(e.activation),e.useBias!=null&&(this.useBias=e.useBias),this.kernelInitializer=hd(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=hd(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=qp(e.kernelConstraint),this.biasConstraint=qp(e.biasConstraint),this.kernelRegularizer=pd(e.kernelRegularizer),this.biasRegularizer=pd(e.biasRegularizer),this.activityRegularizer=pd(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){e=xf(e);const n=e[e.length-1];this.kernel==null&&(this.kernel=this.addWeight("kernel",[n,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:n}}],this.built=!0}computeOutputShape(e){e=xf(e);const n=e.slice();return n[n.length-1]=this.units,n}call(e,n){return Zi(()=>{this.invokeCallHook(e,n);const b=Eu(e),R=zV(this.activation.getClassName());let q;return R!=null?q=p1(b,this.kernel.read(),R,this.bias?this.bias.read():null):(q=p1(b,this.kernel.read()),this.bias!=null&&(q=cy(q,this.bias.read())),this.activation!=null&&(q=this.activation.apply(q))),q})}getConfig(){const e={units:this.units,activation:hb(this.activation),useBias:this.useBias,kernelInitializer:Cd(this.kernelInitializer),biasInitializer:Cd(this.biasInitializer),kernelRegularizer:Lh(this.kernelRegularizer),biasRegularizer:Lh(this.biasRegularizer),activityRegularizer:Lh(this.activityRegularizer),kernelConstraint:Gp(this.kernelConstraint),biasConstraint:Gp(this.biasConstraint)},n=super.getConfig();return Object.assign(e,n),e}}tG.className="Dense";Wo(tG);class rG extends Sc{constructor(e){e=e||{},super(e),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=xf(e);for(const n of e.slice(1))if(n==null)throw new di(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],ub(e,1)]}call(e,n){return Zi(()=>{this.invokeCallHook(e,n);let b=Eu(e);if(this.dataFormat==="channelsFirst"&&b.rank>1){const R=[0];for(let q=2;q{this.invokeCallHook(e,n);const b=Eu(e);return this.activation.apply(b)})}getConfig(){const e={activation:hb(this.activation)},n=super.getConfig();return Object.assign(e,n),e}}nG.className="Activation";Wo(nG);class aG extends Sc{constructor(e){super(e),this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,n){return Zi(()=>(e=Eu(e),gce(e,this.n)))}getConfig(){const e={n:this.n},n=super.getConfig();return Object.assign(e,n),e}}aG.className="RepeatVector";Wo(aG);class iG extends Sc{constructor(e){super(e),this.targetShape=e.targetShape;for(let n=0;n{this.invokeCallHook(e,n);const b=Eu(e),R=b.shape,q=R.slice(0,1).concat(this.fixUnknownDimension(R.slice(1),this.targetShape));return Pi(b,q)})}getConfig(){const e={targetShape:this.targetShape},n=super.getConfig();return Object.assign(e,n),e}}iG.className="Reshape";Wo(iG);class oG extends Sc{constructor(e){if(super(e),e.dims==null)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);const n=sy(1,e.dims.length+1);if(!$f(e.dims.slice().sort(),n))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new jp({ndim:this.dims.length+1})]}computeOutputShape(e){e=xf(e);const n=e.slice();return this.dims.forEach((b,R)=>{n[R+1]=e[b]}),n}call(e,n){return ef(Eu(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},n=super.getConfig();return Object.assign(e,n),e}}oG.className="Permute";Wo(oG);class sG extends Sc{constructor(e){super(e??{}),this.supportsMasking=!0,e!=null?this.maskValue=e.maskValue==null?0:e.maskValue:this.maskValue=0}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),n={maskValue:this.maskValue};return Object.assign(n,e),n}computeMask(e,n){const b=Eu(e);return Oz(rC(b,this.maskValue),-1)}call(e,n){return Zi(()=>{this.invokeCallHook(e,n);const b=Eu(e),re=Oz(rC(b,this.maskValue),-1,!0);return si(b,Gs(re,b.dtype))})}}sG.className="Masking";Wo(sG);class lG extends Sc{constructor(e){if(super(e),this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",e.batchInputShape==null&&e.inputShape==null){let n=null;e.batchSize!=null&&(n=e.batchSize),e.inputLength==null?this.batchInputShape=[n,null]:this.batchInputShape=[n].concat(uh(e.inputLength))}this.inputDim=e.inputDim,sv(this.inputDim,"inputDim"),this.outputDim=e.outputDim,sv(this.outputDim,"outputDim"),this.embeddingsInitializer=hd(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=pd(e.embeddingsRegularizer),this.activityRegularizer=pd(e.activityRegularizer),this.embeddingsConstraint=qp(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,n){return Zi(()=>this.maskZero?(e=Eu(e),rC(e,tf(e))):null)}computeOutputShape(e){if(e=xf(e),this.inputLength==null)return[...e,this.outputDim];const n=uh(this.inputLength);if(n.length!==e.length-1)throw new di(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let b=0;for(let R=0;R{this.invokeCallHook(e,n);let b=Eu(e);b.dtype!=="int32"&&(b=d1(b,"int32"));const R=$V(this.embeddings.read(),Pi(b,[b.size]));return Pi(R,xf(this.computeOutputShape(b.shape)))})}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:Cd(this.embeddingsInitializer),embeddingsRegularizer:Lh(this.embeddingsRegularizer),activityRegularizer:Lh(this.activityRegularizer),embeddingsConstraint:Gp(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},n=super.getConfig();return Object.assign(e,n),e}}lG.className="Embedding";Wo(lG);class O2 extends Sc{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new rc}computeElementwiseOpOutputShape(e,n){if(e==null||n==null)return null;if(e.length1)throw new di(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let b=e[0]==null?null:e[0].slice(1);for(let q=1;qq.length);e.indexOf(null)===-1&&lb(R).length===1?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,n){return Zi(()=>{if(e=e,this.reshapeRequired){const b=[],R=e.map(q=>q.rank);if(R.indexOf(null)===-1){const q=fb(R);for(let re of e){const fe=re.rank;for(let he=0;he1){const Pe=sy(1,be).concat([0]);b.push(ef(he,Pe)),q=!0}else b.push(he)}let re=this.mergeFunction(b);const fe=re.rank;if(q){if(fe==null){const he=re.shape,be=he.length,Pe=he[be-1],je=[Pe].concat(he.slice(0,he.length-1));re=Pi(ef(Pi(re,[-1,Pe]),[1,0]),je)}else if(fe>1){const he=[fe-1].concat(sy(0,fe-1));re=ef(re,he)}}return re}}else return this.mergeFunction(e)})}computeOutputShape(e){e=e;let n;e[0]==null?n=null:n=e[0].slice(1);for(let R=1;R{if(n==null)return null;if(!Array.isArray(n))throw new di("`mask` should be an Array");if(!Array.isArray(e))throw new di("`inputs` should be an Array");if(n.length!==e.length)throw new di(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${n.length})`);if(n.every(R=>R==null))return null;n=n.map(R=>R==null?R:zm(R,0));let b=n[0];for(let R=1;R{let n=e[0].clone();for(let b=1;b{let n=e[0].clone();for(let b=1;b{let n=e[0].clone();for(let b=1;b{let n=e[0];for(let b=1;b{let n=e[0];for(let b=1;b1)throw new di("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return Zi(()=>tO(e,this.axis))}computeOutputShape(e){if(!(Array.isArray(e)&&Array.isArray(e[0])))throw new di("A `Concatenate` layer should be called on a list of inputs.");const n=e,b=n[0].slice(),R=this.axis<0?b.length+this.axis:this.axis;for(const q of n.slice(1)){if(b[R]==null||q[R]==null){b[R]=null;break}b[R]+=q[R]}return b}computeMask(e,n){if(n==null)return null;if(!Array.isArray(n))throw new di("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new di("`inputs` should be an array for Concatenate");if(n.length!==e.length)throw new di(`Mismatch in the length of mask (${n.length}) and the legnth of inputs (${e.length})`);return Zi(()=>{let b=!0;if(n.forEach(re=>{if(re!=null){b=!1;return}}),b)return null;const R=[];for(let re=0;re3||e.shape.length>3)throw new rc("batchDot is not implemented for tensors of 4D or higher rank yet");if(Jn(u.shape.length>=2,()=>`batchDot requires the rank of x to be >= 2, but got ${u.shape.length}`),Jn(u.shape.length>=2,()=>`batchDot requires the rank of y to be >= 2, but got ${e.shape.length}`),typeof n=="number"&&(n=[n,n]),u.dtype==="complex64"||e.dtype==="complex64")throw new rc("batchDot is not implemented for complex64-type Tensors yet.");const b=u.shape.length,R=e.shape.length;n==null&&(n=[b-1,R-2]);const q=n;return Zi(()=>{let re;if(b>R){re=b-R;const he=[];for(let be=0;beb){re=R-b;const he=[];for(let be=0;be0){let he;b>R?he=b+R-3:he=b-1;const be=[];for(let Pe=he;Pe"A `Dot` layer should be called on a list of exactly 2 inputs.");const n=e[0],b=e[1];if(n.length>3||b.length>3)throw new rc("Dot layer does not support tensors of 4D or higher rank yet.");const R=this.interpretAxes(n,b);if(n[R[0]]!==b[R[1]])throw new di(`Dimension incompatibility: ${n[R[0]]} !== ${b[R[1]]}`)}mergeFunction(e){if(e.length!==2)throw new di(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let n=e[0],b=e[1],R;return Array.isArray(this.axes)?R=this.axes.map((q,re)=>GE(q,e[re].shape.length)):R=[GE(this.axes,n.shape.length),GE(this.axes,b.shape.length)],this.normalize&&(n=IL(n,R[0]),b=IL(b,R[1])),Ufe(n,b,R)}interpretAxes(e,n){let b;return Array.isArray(this.axes)?b=this.axes:b=[GE(this.axes,e.length),GE(this.axes,n.length)],b}computeOutputShape(e){Jn(Array.isArray(e)&&e.length===2&&Array.isArray(e[0])&&Array.isArray(e[1]),()=>"A `Dot` layer should be called on a list of exactly 2 inputs.");const n=e[0].slice(),b=e[1].slice();if(n.length>3||b.length>3)throw new rc("Dot layer does not support tensors of 4D or higher rank yet.");const R=this.interpretAxes(n,b);n.splice(R[0],1),b.splice(R[1],1),b.splice(0,1);const q=n.concat(b);return q.length===1&&q.push(1),q}computeMask(e,n){return null}getConfig(){const e={axes:this.axes,normalize:this.normalize},n=super.getConfig();return Object.assign(e,n),e}}vG.className="Dot";Wo(vG);class mG extends Sc{constructor(e){super(e),this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),n={stddev:this.stddev};return Object.assign(n,e),n}call(e,n){return Zi(()=>{this.invokeCallHook(e,n);const b=Eu(e);return yk(()=>Ko(oD(b.shape,0,this.stddev),b),()=>b,n.training||!1)})}}mG.className="GaussianNoise";Wo(mG);class gG extends Sc{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),n={rate:this.rate};return Object.assign(n,e),n}call(e,n){return Zi(()=>{this.invokeCallHook(e,n);const b=Eu(e);return this.rate>0&&this.rate<1?yk(()=>{const q=Math.sqrt(this.rate/(1-this.rate));return si(b,oD(b.shape,1,q))},()=>b,n.training||!1):b})}}gG.className="GaussianDropout";Wo(gG);class yG extends Sc{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||Eu(e).shape}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),n={rate:this.rate};return Object.assign(n,e),n}call(e,n){return Zi(()=>{if(this.rate<1&&this.rate>0){const b=this._getNoiseShape(e);return yk(()=>{const q=Eu(e),fe=-1.6732632423543772*1.0507009873554805;let he=P2(sb(b),this.rate);he=d1(he,"float32");const be=((1-this.rate)*(1+this.rate*fe**2))**-.5,Pe=-be*fe*this.rate,je=Ko(si(q,he),si(Ko(he,-1),fe));return Ko(si(je,be),Pe)},()=>Eu(e),n.training||!1)}return e})}}yG.className="AlphaDropout";Wo(yG);function sC(u,e,n,b,R,q=.001){let re;if(u.rank===2)re=nne(u,e,n,b,R,q);else if(u.rank===3)re=ine(u,e,n,b,R,q);else if(u.rank===4)re=sne(u,e,n,b,R,q);else throw new rc(`batchNormalization is not implemented for array of rank ${u.rank} yet`);return re}function $fe(u,e,n,b,R=.001){return Zi(()=>{const q=vN(u,b),re=q.mean,fe=q.variance;return[sC(u,re,fe,n,e,R),re,fe]})}function Vfe(u,e,n,b,R=.001){return Zi(()=>{const q=vN(u,b),re=q.mean,fe=q.variance,he=[];for(const xt of sy(0,u.rank))b.indexOf(xt)!==-1?he.push(1):he.push(u.shape[xt]);const be=Pi(re,he),Pe=Pi(fe,he),je=e==null?null:Pi(e,he),We=n==null?null:Pi(n,he);return[sC(u,be,Pe,We,je,R),re,fe]})}function jfe(u,e,n,b,R=.001){return $f(b.slice().sort(),sy(0,u.rank-1))?$fe(u,e,n,b,R):Vfe(u,e,n,b,R)}class _G extends Sc{constructor(e){e==null&&(e={}),super(e),this.supportsMasking=!0,this.axis=e.axis==null?-1:e.axis,this.momentum=e.momentum==null?.99:e.momentum,this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=hd(e.betaInitializer||"zeros"),this.gammaInitializer=hd(e.gammaInitializer||"ones"),this.movingMeanInitializer=hd(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=hd(e.movingVarianceInitializer||"ones"),this.betaConstraint=qp(e.betaConstraint),this.gammaConstraint=qp(e.gammaConstraint),this.betaRegularizer=pd(e.betaRegularizer),this.gammaRegularizer=pd(e.gammaRegularizer)}build(e){e=xf(e);const n=this.axis>=0?this.axis:this.axis+e.length,b=e[n];if(b==null)throw new di(`Axis ${n} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new jp({ndim:e.length,axes:{[n]:b}})];const R=[b];this.scale&&(this.gamma=this.addWeight("gamma",R,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",R,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",R,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",R,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,n){return Zi(()=>{const b=n.training==null?!1:n.training,R=Eu(e),q=R.shape,re=q.length,fe=sy(0,re),he=this.axis>=0?this.axis:this.axis+re;fe.splice(he,1);const be=M2(1,re);be[he]=q[he];const Pe=fe.slice();Pe.sort();const je=!$f(Pe,sy(0,re).slice(0,re-1)),We=()=>{if(je){const Re=Pi(this.movingMean.read(),be),Lr=Pi(this.movingVariance.read(),be),Cr=this.center?Pi(this.beta.read(),be):null,Gr=this.scale?Pi(this.gamma.read(),be):null;return sC(R,Re,Lr,Cr,Gr,this.epsilon)}else return sC(R,this.movingMean.read(),this.movingVariance.read(),this.beta==null?null:this.beta.read(),this.gamma==null?null:this.gamma.read(),this.epsilon)};if(!b)return We();const[ft,xt,zt]=jfe(R,this.gamma.read(),this.beta.read(),fe,this.epsilon),Ft=(Re,Lr,Cr)=>{Zi(()=>{const Gr=1-Cr,yn=Re.read(),Pn=si(bl(yn,Lr),Gr);Re.write(bl(yn,Pn))})};return Ft(this.movingMean,xt,this.momentum),Ft(this.movingVariance,zt,this.momentum),ft})}getConfig(){const e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Cd(this.betaInitializer),gammaInitializer:Cd(this.gammaInitializer),movingMeanInitializer:Cd(this.movingMeanInitializer),movingVarianceInitializer:Cd(this.movingVarianceInitializer),betaRegularizer:Lh(this.betaRegularizer),gammaRegularizer:Lh(this.gammaRegularizer),betaConstraint:Gp(this.betaConstraint),gammaConstraint:Gp(this.gammaConstraint)},n=super.getConfig();return Object.assign(e,n),e}}_G.className="BatchNormalization";Wo(_G);class xG extends Sc{constructor(e){if(e==null&&(e={}),super(e),this.axis=e.axis==null?-1:e.axis,typeof this.axis=="number"){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else if(Array.isArray(this.axis)){for(const n of this.axis)if(!Number.isInteger(n))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}else throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=hd(e.betaInitializer||"zeros"),this.gammaInitializer=hd(e.gammaInitializer||"ones"),this.betaRegularizer=pd(e.betaRegularizer),this.gammaRegularizer=pd(e.gammaRegularizer),this.supportsMasking=!0}build(e){e=xf(e);const n=e.length;typeof this.axis=="number"&&(this.axis=[this.axis]);for(let q=0;q=n)throw new Error(`Invalid axis: ${q}`);if(this.axis.length!==lb(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const b=this.axis.map(q=>e[q]),R=!0;this.scale?this.gamma=this.addWeight("gamma",b,"float32",this.gammaInitializer,this.gammaRegularizer,R):this.gamma=null,this.center?this.beta=this.addWeight("beta",b,"float32",this.betaInitializer,this.betaRegularizer,R):this.beta=null,this.built=!0}call(e,n){const b=Eu(e),R=b.shape,q=R.length;return Zi(()=>{let{mean:fe,variance:he}=vN(b,this.axis,!0);const be=M2(1,q);for(const zt of this.axis)be[zt]=R[zt];const Pe=zt=>zt!=null&&zt.shape.length!==q?Pi(zt,be):zt;let je=this.scale?Pe(this.gamma.read()):null,We=this.center?Pe(this.beta.read()):null;const ft=[],xt=[];for(let zt=0;zt{if(u.rank!==4)throw new di(`temporalPadding expects input tensor to be 4-D, but received a ${u.rank}-D tensor.`);if(e==null&&(e=[[1,1],[1,1]]),e.length!==2||e[0].length!==2||e[1].length!==2)throw new di("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(n==null&&(n=ly()),n!=="channelsLast"&&n!=="channelsFirst")throw new di(`Unknown data format: ${n}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let b;return n==="channelsFirst"?b=[[0,0],[0,0],e[0],e[1]]:b=[[0,0],e[0],e[1],[0,0]],mN(u,b)})}class bG extends Sc{constructor(e){if(e==null&&(e={}),super(e),this.dataFormat=e.dataFormat==null?ly():e.dataFormat,e.padding==null)this.padding=[[1,1],[1,1]];else if(typeof e.padding=="number")this.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,e.padding.length!==2)throw new di(`ZeroPadding2D expects padding to be a length-2 array, but received a length-${e.padding.length} array.`);let n,b;if(typeof e.padding[0]=="number")n=[e.padding[0],e.padding[0]],b=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,e.padding[0].length!==2)throw new di(`ZeroPadding2D expects height padding to be a length-2 array, but received a length-${e.padding[0].length} array.`);if(n=e.padding[0],e.padding[1].length!==2)throw new di(`ZeroPadding2D expects width padding to be a length-2 array, but received a length-${e.padding[1].length} array.`);b=e.padding[1]}this.padding=[n,b]}this.inputSpec=[new jp({ndim:4})]}computeOutputShape(e){e=xf(e);let n,b;return this.dataFormat==="channelsFirst"?(e[2]!=null&&e[2]>=0?n=e[2]+this.padding[0][0]+this.padding[0][1]:n=null,e[3]!=null&&e[3]>=0?b=e[3]+this.padding[1][0]+this.padding[1][1]:b=null,[e[0],e[1],n,b]):(e[1]!=null&&e[1]>=0?n=e[1]+this.padding[0][0]+this.padding[0][1]:n=null,e[2]!=null&&e[2]>=0?b=e[2]+this.padding[1][0]+this.padding[1][1]:b=null,[e[0],n,b,e[3]])}call(e,n){return Zi(()=>Gfe(Eu(e),this.padding,this.dataFormat))}getConfig(){const e={padding:this.padding,dataFormat:this.dataFormat},n=super.getConfig();return Object.assign(e,n),e}}bG.className="ZeroPadding2D";Wo(bG);function pD(u,e,n,b,R,q){return Zi(()=>{sp(R),OV(q),jg(b),n==null&&(n=[1,1]),b==null&&(b="valid"),R==null&&(R=ly()),q==null&&(q="max"),u=pO(u,R);let re;const fe=b==="same"?"same":"valid";return q==="max"?re=pN(u,e,n,fe):re=rN(u,e,n,fe),R==="channelsFirst"&&(re=ef(re,[0,3,1,2])),re})}function wG(u,e,n,b,R,q){return Zi(()=>{sp(R),OV(q),jg(b),n==null&&(n=[1,1,1]),b==null&&(b="valid"),R==null&&(R=ly()),q==null&&(q="max"),u=Bj(u,R);let re;const fe=b==="same"?"same":"valid";return q==="max"?re=qae(u,e,n,fe):re=Wre(u,e,n,fe),R==="channelsFirst"&&(re=ef(re,[0,4,1,2,3])),re})}class TG extends Sc{constructor(e){if(e.poolSize==null&&(e.poolSize=2),super(e),typeof e.poolSize=="number")this.poolSize=[e.poolSize];else if(Array.isArray(e.poolSize)&&e.poolSize.length===1&&typeof e.poolSize[0]=="number")this.poolSize=e.poolSize;else throw new di(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);if(sv(this.poolSize,"poolSize"),e.strides==null)this.strides=this.poolSize;else if(typeof e.strides=="number")this.strides=[e.strides];else if(Array.isArray(e.strides)&&e.strides.length===1&&typeof e.strides[0]=="number")this.strides=e.strides;else throw new di(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);sv(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,jg(this.padding),this.inputSpec=[new jp({ndim:3})]}computeOutputShape(e){e=xf(e);const n=oy(e[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],n,e[2]]}call(e,n){return Zi(()=>{this.invokeCallHook(e,n),e=mk(Eu(e),2);const b=this.poolingFunction(Eu(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return ck(b,[2])})}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},n=super.getConfig();return Object.assign(e,n),e}}class AG extends TG{constructor(e){super(e)}poolingFunction(e,n,b,R,q){return sp(q),jg(R),pD(e,n,b,R,q,"max")}}AG.className="MaxPooling1D";Wo(AG);class SG extends TG{constructor(e){super(e)}poolingFunction(e,n,b,R,q){return sp(q),jg(R),pD(e,n,b,R,q,"avg")}}SG.className="AveragePooling1D";Wo(SG);class EG extends Sc{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==2)throw new di(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];sv(this.poolSize,"poolSize"),sv(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,sp(this.dataFormat),jg(this.padding),this.inputSpec=[new jp({ndim:4})]}computeOutputShape(e){e=xf(e);let n=this.dataFormat==="channelsFirst"?e[2]:e[1],b=this.dataFormat==="channelsFirst"?e[3]:e[2];return n=oy(n,this.poolSize[0],this.padding,this.strides[0]),b=oy(b,this.poolSize[1],this.padding,this.strides[1]),this.dataFormat==="channelsFirst"?[e[0],e[1],n,b]:[e[0],n,b,e[3]]}call(e,n){return Zi(()=>(this.invokeCallHook(e,n),this.poolingFunction(Eu(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=super.getConfig();return Object.assign(e,n),e}}class CG extends EG{constructor(e){super(e)}poolingFunction(e,n,b,R,q){return sp(q),jg(R),pD(e,n,b,R,q,"max")}}CG.className="MaxPooling2D";Wo(CG);class kG extends EG{constructor(e){super(e)}poolingFunction(e,n,b,R,q){return sp(q),jg(R),pD(e,n,b,R,q,"avg")}}kG.className="AveragePooling2D";Wo(kG);class MG extends Sc{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==3)throw new di(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];sv(this.poolSize,"poolSize"),sv(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,sp(this.dataFormat),jg(this.padding),this.inputSpec=[new jp({ndim:5})]}computeOutputShape(e){e=xf(e);let n=this.dataFormat==="channelsFirst"?e[2]:e[1],b=this.dataFormat==="channelsFirst"?e[3]:e[2],R=this.dataFormat==="channelsFirst"?e[4]:e[3];return n=oy(n,this.poolSize[0],this.padding,this.strides[0]),b=oy(b,this.poolSize[1],this.padding,this.strides[1]),R=oy(R,this.poolSize[2],this.padding,this.strides[2]),this.dataFormat==="channelsFirst"?[e[0],e[1],n,b,R]:[e[0],n,b,R,e[4]]}call(e,n){return Zi(()=>(this.invokeCallHook(e,n),this.poolingFunction(Eu(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=super.getConfig();return Object.assign(e,n),e}}class IG extends MG{constructor(e){super(e)}poolingFunction(e,n,b,R,q){return sp(q),jg(R),wG(e,n,b,R,q,"max")}}IG.className="MaxPooling3D";Wo(IG);class LG extends MG{constructor(e){super(e)}poolingFunction(e,n,b,R,q){return sp(q),jg(R),wG(e,n,b,R,q,"avg")}}LG.className="AveragePooling3D";Wo(LG);class RG extends Sc{constructor(e){super(e),this.inputSpec=[new jp({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,n){throw new rc}}class DG extends RG{constructor(e){super(e||{})}call(e,n){return Zi(()=>{const b=Eu(e);return rp(b,1)})}}DG.className="GlobalAveragePooling1D";Wo(DG);class PG extends RG{constructor(e){super(e||{})}call(e,n){return Zi(()=>{const b=Eu(e);return iy(b,1)})}}PG.className="GlobalMaxPooling1D";Wo(PG);class zG extends Sc{constructor(e){super(e),this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,sp(this.dataFormat),this.inputSpec=[new jp({ndim:4})]}computeOutputShape(e){return e=e,this.dataFormat==="channelsLast"?[e[0],e[3]]:[e[0],e[1]]}call(e,n){throw new rc}getConfig(){const e={dataFormat:this.dataFormat},n=super.getConfig();return Object.assign(e,n),e}}class NG extends zG{call(e,n){return Zi(()=>{const b=Eu(e);return this.dataFormat==="channelsLast"?rp(b,[1,2]):rp(b,[2,3])})}}NG.className="GlobalAveragePooling2D";Wo(NG);class OG extends zG{call(e,n){return Zi(()=>{const b=Eu(e);return this.dataFormat==="channelsLast"?iy(b,[1,2]):iy(b,[2,3])})}}OG.className="GlobalMaxPooling2D";Wo(OG);class FG extends Sc{constructor(e){super(e),this.layer=e.layer}build(e){this.built=!0}get trainable(){return this.layer!=null?this.layer.trainable:!1}set trainable(e){this.layer!=null&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){const e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},n=super.getConfig();return Object.assign(e,n),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.layer!=null&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,n,b={}){const R=n.layer,q=__(R,b);delete n.layer;const re={layer:q};return Object.assign(re,n),new e(re)}}class BG extends FG{constructor(e){super(e),this.supportsMasking=!0}build(e){if(e=xf(e),e.length<3)throw new di(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];const n=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(n),this.layer.built=!0),super.build(e)}computeOutputShape(e){e=xf(e);const n=[e[0]].concat(e.slice(2)),b=this.layer.computeOutputShape(n),R=e[1];return[b[0],R].concat(b.slice(1))}call(e,n){return Zi(()=>(e=Eu(e),Xj((re,fe)=>[Eu(this.layer.call(re,n)),[]],e,[],!1,null,null,!1,!0)[1]))}}BG.className="TimeDistributed";Wo(BG);function qfe(u){N2(hce,"BidirectionalMergeMode",u)}const Hfe="concat";class UG extends FG{constructor(e){super(e);const n=e.layer.getConfig(),b={};b.className=e.layer.getClassName(),b.config=n,this.forwardLayer=__(b),n.goBackwards=n.goBackwards!==!0;const R={};if(R.className=e.layer.getClassName(),R.config=n,this.backwardLayer=__(R),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=e.mergeMode===void 0?Hfe:e.mergeMode,qfe(this.mergeMode),e.weights)throw new rc("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,this.forwardLayer!=null&&(this.forwardLayer.trainable=e),this.backwardLayer!=null&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){const n=e.length,b=Math.floor(n/2);this.forwardLayer.setWeights(e.slice(0,b)),this.backwardLayer.setWeights(e.slice(b))}computeOutputShape(e){let n=this.forwardLayer.computeOutputShape(e);Array.isArray(n)&&Array.isArray(n[0])||(n=[n]),n=n;let b,R,q;return this.returnState&&(q=n.slice(1)),b=n[0],b=b,this.mergeMode==="concat"?(b[b.length-1]*=2,R=[b]):this.mergeMode==null?R=[b,b.slice()]:R=[b],this.returnState?this.mergeMode==null?R.concat(q).concat(q.slice()):[b].concat(q).concat(q.slice()):Nm(R)}apply(e,n){let b=n==null?null:n.initialState,R=n==null?null:n.constants;n==null&&(n={});const q=Wj(e,b,R,this.numConstants);if(e=q.inputs,b=q.initialState,R=q.constants,Array.isArray(e)&&(b=e.slice(1),e=e[0]),(b==null||b.length===0)&&R==null)return super.apply(e,n);const re=[],fe=[];if(b!=null){const be=b.length;if(be%2>0)throw new di("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");n.initialState=b,re.push(...b);const Pe=b.map(je=>new jp({shape:je.shape}));this.forwardLayer.stateSpec=Pe.slice(0,be/2),this.backwardLayer.stateSpec=Pe.slice(be/2),fe.push(...Pe)}if(R!=null)throw new rc("Support for constants in Bidirectional layers is not implemented yet.");const he=re[0]instanceof m1;for(const be of re)if(be instanceof m1!==he)throw new di("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(he){const be=[e].concat(re),Pe=this.inputSpec.concat(fe),je=this.inputSpec;this.inputSpec=Pe;const We=super.apply(be,n);return this.inputSpec=je,We}else return super.apply(e,n)}call(e,n){return Zi(()=>{const b=n.initialState;let R,q;if(b==null)R=this.forwardLayer.call(e,n),q=this.backwardLayer.call(e,n);else{const he=b.slice(0,b.length/2),be=b.slice(b.length/2);R=this.forwardLayer.call(e,Object.assign(n,{initialState:he})),q=this.backwardLayer.call(e,Object.assign(n,{initialState:be}))}let re;this.returnState&&(Array.isArray(R)&&(re=R.slice(1).concat(q.slice(1))),R=R[0],q=q[0]),this.returnSequences&&(q=C2(q,1));let fe;return this.mergeMode==="concat"?fe=tO([R,q]):this.mergeMode==="sum"?fe=Ko(R,q):this.mergeMode==="ave"?fe=si(.5,Ko(R,q)):this.mergeMode==="mul"?fe=si(R,q):this.mergeMode==null&&(fe=[R,q]),this.returnState?this.mergeMode==null?fe.concat(re):[fe].concat(re):fe})}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){g2(this.forwardLayer.name,()=>{this.forwardLayer.build(e)}),g2(this.backwardLayer.name,()=>{this.backwardLayer.build(e)}),this.built=!0}computeMask(e,n){Array.isArray(n)&&(n=n[0]);let b;if(this.returnSequences?this.mergeMode==null?b=[n,n]:b=n:this.mergeMode==null?b=[null,null]:b=null,this.returnState){const q=this.forwardLayer.states.map(re=>null);return Array.isArray(b)?b.concat(q).concat(q):[b].concat(q).concat(q)}else return b}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.forwardLayer!=null&&this.forwardLayer.setFastWeightInitDuringBuild(e),this.backwardLayer!=null&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){const e={mergeMode:this.mergeMode},n=super.getConfig();return Object.assign(e,n),e}static fromConfig(e,n){const b=__(n.layer);if(delete n.layer,n.numConstants!=null)throw new rc("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const R=n;return R.layer=b,new e(R)}}UG.className="Bidirectional";Wo(UG);class $G extends Sc{constructor(e){super(e),this.scale=e.scale,e.offset?this.offset=e.offset:this.offset=0}getConfig(){const e={scale:this.scale,offset:this.offset},n=super.getConfig();return Object.assign(e,n),e}call(e,n){return Zi(()=>(e=Eu(e),e.dtype!=="float32"&&(e=d1(e,"float32")),Ko(si(e,this.scale),this.offset)))}}$G.className="Rescaling";Wo($G);const{resizeBilinear:Wfe,cropAndResize:Xfe}=y_;class VG extends Sc{constructor(e){super(e),this.height=e.height,this.width=e.width}centerCrop(e,n,b,R,q,re,fe,he){return Zi(()=>{let be,Pe=!1;const je=n/re,We=b/fe,ft=(R+n)/re,xt=(q+b)/fe,zt=[je,We,ft,xt],Ft=[];e.rank===3?(Pe=!0,be=b_([e])):be=e;for(let Gr=0;Gr{const q=Wfe(e,[n,b]);return d1(q,R)})}call(e,n){return Zi(()=>{const b=Eu(e),R=b.dtype,q=b.shape,re=q[q.length-3],fe=q[q.length-2];let he=0;re!==this.height&&(he=Math.floor((re-this.height)/2));let be=0;return fe!==this.width&&(be=Math.floor((fe-this.width)/2),be===0&&(be=1)),he>=0&&be>=0?this.centerCrop(b,he,be,this.height,this.width,re,fe,R):this.upsize(e,this.height,this.width,R)})}getConfig(){const e={height:this.height,width:this.width},n=super.getConfig();return Object.assign(e,n),e}computeOutputShape(e){e=xf(e);const n=e.length-3,b=e.length-2;return e[n]=this.height,e[b]=this.width,e}}VG.className="CenterCrop";Wo(VG);function Yfe(u,e,n,b){let R=Eu(u);if(R.dtype!=="int32"&&(R=d1(R,"int32")),e==="int")return R;const q=R.shape;if(R.rank===0&&(R=zm(R,-1)),e==="oneHot"&&R.shape[R.shape.length-1]!==1&&(R=zm(R,-1)),R.rank>2)throw new di(`When outputMode is not int, maximum output rank is 2 Received outputMode ${e} and input shape ${q} which would result in output rank ${R.rank}.`);const re=["multiHot","oneHot"].includes(e),fe=R;let he;if(typeof b<"u"&&e==="count"?he=U9(fe,b,n,re):he=U9(fe,[],n,re),e!=="tfIdf")return he;if(b)return si(he,b);throw new di("When outputMode is 'tfIdf', weights must be provided.")}class jG extends Sc{constructor(e){super(e),this.numTokens=e.numTokens,e.outputMode?this.outputMode=e.outputMode:this.outputMode="multiHot"}getConfig(){const e={numTokens:this.numTokens,outputMode:this.outputMode},n=super.getConfig();return Object.assign(e,n),e}computeOutputShape(e){return e=xf(e),e==null?[this.numTokens]:this.outputMode==="oneHot"&&e[e.length-1]!==1?(e.push(this.numTokens),e):(e[e.length-1]=this.numTokens,e)}call(e,n){return Zi(()=>{e=Eu(e),e.dtype!=="int32"&&(e=d1(e,"int32"));let b;if(typeof n.countWeights<"u"){if(this.outputMode!=="count")throw new di(`countWeights is not used when outputMode !== count. + Received countWeights=${n.countWeights}`);b=Eu(n.countWeights)}const R=iy(e),q=bL(e),re=Vg(this.numTokens,R).bufferSync().get(0),fe=P2(q,0).bufferSync().get(0);if(!(re&&fe))throw new di(`Input values must be between 0 < values <= numTokens with numTokens=${this.numTokens}`);return Yfe(e,this.outputMode,this.numTokens,b)})}}jG.className="CategoryEncoding";Wo(jG);const Zfe=["bilinear","nearest"],CB=new Set(Zfe);class GG extends Sc{constructor(e){if(super(e),this.height=e.height,this.width=e.width,e.interpolation)if(CB.has(e.interpolation))this.interpolation=e.interpolation;else throw new di(`Invalid interpolation parameter: ${e.interpolation} is not implemented`);else this.interpolation="bilinear";this.cropToAspectRatio=!!e.cropToAspectRatio}computeOutputShape(e){e=xf(e);const n=e[2];return[this.height,this.width,n]}getConfig(){const e={height:this.height,width:this.width,interpolation:this.interpolation,cropToAspectRatio:this.cropToAspectRatio},n=super.getConfig();return Object.assign(e,n),e}call(e,n){return Zi(()=>{const b=[this.height,this.width];if(this.interpolation==="bilinear")return y_.resizeBilinear(e,b,!this.cropToAspectRatio);if(this.interpolation==="nearest")return y_.resizeNearestNeighbor(e,b,!this.cropToAspectRatio);throw new Error(`Interpolation is ${this.interpolation} but only ${[...CB]} are supported`)})}}GG.className="Resizing";Wo(GG);class qG{constructor(e){this.seed=e}next(){if(this.seed!==void 0)return this.seed++}}qG.className="RandomSeed";class HG extends Sc{constructor(e){super(e),this.randomGenerator=new qG(e.seed)}getConfig(){const e={seed:this.randomGenerator.seed},n=super.getConfig();return Object.assign(e,n),e}}HG.className="BaseRandomLayer";const Kfe=["bilinear","nearest"],kB=new Set(Kfe);class WG extends HG{constructor(e){super(e);const{factor:n,interpolation:b="bilinear"}=e;if(this.factor=n,Array.isArray(this.factor)&&this.factor.length===2)this.widthLower=this.factor[0],this.widthUpper=this.factor[1];else if(!Array.isArray(this.factor)&&this.factor>0)this.widthLower=-this.factor,this.widthUpper=this.factor;else throw new di(`Invalid factor: ${this.factor}. Must be positive number or tuple of 2 numbers`);if(this.widthLower<-1||this.widthUpper<-1)throw new di(`factor must have values larger than -1. Got: ${this.factor}`);if(this.widthUpper{const b=Eu(e);this.imgHeight=b.shape[b.shape.length-3];const R=b.shape[b.shape.length-2];this.widthFactor=sb([1],1+this.widthLower,1+this.widthUpper,"float32",this.randomGenerator.next());let q=this.widthFactor.dataSync()[0]*R;q=Math.round(q);const re=[this.imgHeight,q];switch(this.interpolation){case"bilinear":return y_.resizeBilinear(e,re);case"nearest":return y_.resizeNearestNeighbor(e,re);default:throw new Error(`Interpolation is ${this.interpolation} + but only ${[...kB]} are supported`)}})}}WG.className="RandomWidth";Wo(WG);const Jfe=co();Jfe.registerFlag("KEEP_INTERMEDIATE_TENSORS",()=>!1,u=>{u&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")});var MB;(function(u){u[u.DT_INVALID=0]="DT_INVALID",u[u.DT_FLOAT=1]="DT_FLOAT",u[u.DT_DOUBLE=2]="DT_DOUBLE",u[u.DT_INT32=3]="DT_INT32",u[u.DT_UINT8=4]="DT_UINT8",u[u.DT_INT16=5]="DT_INT16",u[u.DT_INT8=6]="DT_INT8",u[u.DT_STRING=7]="DT_STRING",u[u.DT_COMPLEX64=8]="DT_COMPLEX64",u[u.DT_INT64=9]="DT_INT64",u[u.DT_BOOL=10]="DT_BOOL",u[u.DT_QINT8=11]="DT_QINT8",u[u.DT_QUINT8=12]="DT_QUINT8",u[u.DT_QINT32=13]="DT_QINT32",u[u.DT_BFLOAT16=14]="DT_BFLOAT16",u[u.DT_QINT16=15]="DT_QINT16",u[u.DT_QUINT16=16]="DT_QUINT16",u[u.DT_UINT16=17]="DT_UINT16",u[u.DT_COMPLEX128=18]="DT_COMPLEX128",u[u.DT_HALF=19]="DT_HALF",u[u.DT_RESOURCE=20]="DT_RESOURCE",u[u.DT_VARIANT=21]="DT_VARIANT",u[u.DT_UINT32=22]="DT_UINT32",u[u.DT_UINT64=23]="DT_UINT64",u[u.DT_FLOAT_REF=101]="DT_FLOAT_REF",u[u.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",u[u.DT_INT32_REF=103]="DT_INT32_REF",u[u.DT_UINT8_REF=104]="DT_UINT8_REF",u[u.DT_INT16_REF=105]="DT_INT16_REF",u[u.DT_INT8_REF=106]="DT_INT8_REF",u[u.DT_STRING_REF=107]="DT_STRING_REF",u[u.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",u[u.DT_INT64_REF=109]="DT_INT64_REF",u[u.DT_BOOL_REF=110]="DT_BOOL_REF",u[u.DT_QINT8_REF=111]="DT_QINT8_REF",u[u.DT_QUINT8_REF=112]="DT_QUINT8_REF",u[u.DT_QINT32_REF=113]="DT_QINT32_REF",u[u.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",u[u.DT_QINT16_REF=115]="DT_QINT16_REF",u[u.DT_QUINT16_REF=116]="DT_QUINT16_REF",u[u.DT_UINT16_REF=117]="DT_UINT16_REF",u[u.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",u[u.DT_HALF_REF=119]="DT_HALF_REF",u[u.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",u[u.DT_VARIANT_REF=121]="DT_VARIANT_REF",u[u.DT_UINT32_REF=122]="DT_UINT32_REF",u[u.DT_UINT64_REF=123]="DT_UINT64_REF"})(MB||(MB={}));var IB;(function(u){(function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"})(u.CheckpointFormatVersion||(u.CheckpointFormatVersion={}))})(IB||(IB={}));var LB;(function(u){u[u.FAIL=0]="FAIL",u[u.SHORTEST=1]="SHORTEST",u[u.LONGEST=2]="LONGEST"})(LB||(LB={}));function Al(u,e){Array.isArray(u)||(u=[u]),u.forEach(n=>{n!=null&&Jn(n.dtype!=="complex64",()=>`${e} does not support complex64 tensors in the CPU backend.`)})}const Qfe=X$;class vD extends o8{nextDataId(){return vD.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new _U(this,a1())}write(e,n,b){this.firstUse&&(this.firstUse=!1,co().get("IS_NODE")&&Og(` +============================ +Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, visit https://github.com/tensorflow/tfjs-node for more details. +============================`));const R={id:this.nextDataId()};return this.data.set(R,{values:e,dtype:b,refCount:1}),R}makeTensorInfo(e,n,b){let R;if(n==="string"&&b!=null&&b.length>0&&hC(b[0])){const q=b.map(re=>ob(re));R=this.write(q,e,n)}else R=this.write(b,e,n);return{dataId:R,shape:e,dtype:n}}refCount(e){return this.data.has(e)?this.data.get(e).refCount:0}incRef(e){const n=this.data.get(e);n.refCount++}decRef(e){if(this.data.has(e)){const n=this.data.get(e);n.refCount--}}move(e,n,b,R,q){this.data.set(e,{values:n,dtype:R,refCount:q})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){const{dtype:n,complexTensorInfos:b}=this.data.get(e);if(n==="complex64"){const R=this.readSync(b.real.dataId),q=this.readSync(b.imag.dataId);return w_(R,q)}return ute(this.data.get(e).values,n)}bufferSync(e){const n=this.readSync(e.dataId);if(e.dtype==="string")try{const b=n.map(R=>cb(R));return Tc(e.shape,e.dtype,b)}catch{throw new Error("Failed to decode encoded string bytes into utf-8")}return Tc(e.shape,e.dtype,n)}makeOutput(e,n,b){return a1().makeTensorFromTensorInfo(this.makeTensorInfo(n,b,e),this)}disposeData(e,n=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!n&&this.data.get(e).refCount>0)return!1;const{complexTensorInfos:b}=this.data.get(e);b!=null&&(this.disposeData(b.real.dataId,!0),this.disposeData(b.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){const n=Pm();return e(),{kernelMs:Pm()-n}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){Al([e],"where");const n=this.readSync(e.dataId);return Qfe(e.shape,n)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}vD.nextDataId=0;function XG(u){const e=new Float32Array(u.length);for(let n=0;n{const{x:e}=u.inputs,n=u.backend;Al(e,"abs");let b=new Float32Array(xo(e.shape));const R=n.data.get(e.dataId).values;return b=XG(R),n.makeOutput(b,e.shape,e.dtype)},the={kernelName:HL,backendName:"cpu",kernelFunc:ehe};function lp(u){return(e,n,b,R,q)=>{const re=Yu(e,n),fe=re.length,he=Zl(re),be=xo(re),Pe=zv(q,be),je=e.length,We=n.length,ft=Zl(e),xt=Zl(n),zt=IA(e,re),Ft=IA(n,re);if(zt.length+Ft.length===0)for(let jt=0;jtLr[Pn]=0);const Cr=c1(Lr,je,ft),Gr=Re.slice(-We);Ft.forEach(Pn=>Gr[Pn]=0);const yn=c1(Gr,We,xt);Pe[jt]=u(b[Cr],R[yn])}return[Pe,re]}}function ig(u){const{inputs:e,backend:n}=u,{real:b,imag:R}=e,q=n.data.get(b.dataId).values,re=n.data.get(R.dataId).values,fe=n.makeTensorInfo(b.shape,"complex64"),he=n.data.get(fe.dataId);return he.complexTensorInfos={real:n.makeTensorInfo(b.shape,"float32",q),imag:n.makeTensorInfo(R.shape,"float32",re)},fe}const rhe={kernelName:_8,backendName:"cpu",kernelFunc:ig};function zL(u,e,n="float32"){if(n==="complex64"){const R=zL(u,e,"float32"),q=zL(u,e,"float32");return ig({inputs:{real:R,imag:q},backend:u})}const b=Nv(xo(e),n);return u.makeTensorInfo(e,n,b)}function g1(u){const{inputs:e,backend:n}=u,{x:b}=e;return n.incRef(b.dataId),{dataId:b.dataId,shape:b.shape,dtype:b.dtype}}const nhe={kernelName:DC,backendName:"cpu",kernelFunc:g1};function I2(u){const{inputs:e,backend:n}=u,{input:b}=e,R=n.data.get(b.dataId).complexTensorInfos.real,q=n.data.get(R.dataId).values;return n.makeTensorInfo(R.shape,R.dtype,q)}const ahe={kernelName:j8,backendName:"cpu",kernelFunc:I2};function YG(u,e,n,b){if(b==="int32"){const R=Int32Array.from(u);return[e,"int32",R]}if(b==="bool"){const R=D2([0],n),[q,re]=lp((fe,he)=>fe!==he?1:0)(e,[],u,R,"bool");return[re,"bool",q]}throw new Error(`Error in Cast: failed to cast ${n} to ${b}`)}function vb(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{dtype:q}=b;if(q==="complex64"){if(R.dtype==="complex64")return g1({inputs:{x:R},backend:n});const Pe=zL(n,R.shape,R.dtype),je=vb({inputs:{x:R},backend:n,attrs:{dtype:"float32"}}),We=ig({inputs:{real:je,imag:Pe},backend:n});return n.disposeIntermediateTensorInfo(Pe),n.disposeIntermediateTensorInfo(je),We}if(R.dtype==="complex64"){const Pe=I2({inputs:{input:R},backend:n}),je=vb({inputs:{x:Pe},backend:n,attrs:{dtype:q}});return n.disposeIntermediateTensorInfo(Pe),je}if(!TU(R.dtype,q)){const Pe=g1({inputs:{x:R},backend:n});return{dataId:Pe.dataId,shape:Pe.shape,dtype:q}}const re=n.data.get(R.dataId).values,[fe,he,be]=YG(re,R.shape,R.dtype,q);return n.makeTensorInfo(fe,he,be)}const ihe={kernelName:xC,backendName:"cpu",kernelFunc:vb};function Wp(u,e,n,b){return n==null?({inputs:R,backend:q})=>{const{a:re,b:fe}=R,he=q;Al([re,fe],u);const be=he.data.get(re.dataId).values,Pe=he.data.get(fe.dataId).values,je=re.dtype==="string"?T_(be):be,We=re.dtype==="string"?T_(Pe):Pe,ft=b||re.dtype,[xt,zt]=e(re.shape,fe.shape,je,We,ft);return he.makeTensorInfo(zt,ft,xt)}:({inputs:R,backend:q})=>{const{a:re,b:fe}=R,he=q;if(re.dtype==="complex64"||fe.dtype==="complex64"){const be=vb({inputs:{x:re},backend:he,attrs:{dtype:"complex64"}}),Pe=he.data.get(be.dataId),je=Pe.complexTensorInfos.real,We=Pe.complexTensorInfos.imag,ft=he.data.get(je.dataId).values,xt=he.data.get(We.dataId).values,zt=vb({inputs:{x:fe},backend:he,attrs:{dtype:"complex64"}}),Ft=he.data.get(zt.dataId),jt=Ft.complexTensorInfos.real,Re=Ft.complexTensorInfos.imag,Lr=he.data.get(jt.dataId).values,Cr=he.data.get(Re.dataId).values,[Gr,yn,Pn]=n(re.shape,fe.shape,ft,xt,Lr,Cr),Vn=he.makeTensorInfo(Pn,"float32",Gr),un=he.makeTensorInfo(Pn,"float32",yn),Nn=ig({inputs:{real:Vn,imag:un},backend:he});return he.disposeIntermediateTensorInfo(be),he.disposeIntermediateTensorInfo(zt),he.disposeIntermediateTensorInfo(Vn),he.disposeIntermediateTensorInfo(un),Nn}else{const be=he.data.get(re.dataId).values,Pe=he.data.get(fe.dataId).values,je=b||re.dtype,[We,ft]=e(re.shape,fe.shape,be,Pe,je);return he.makeTensorInfo(ft,je,We)}}}function xO(u){return(e,n,b,R,q,re)=>{const fe=Yu(e,n),he=xo(fe),be=fe.length,Pe=Zl(fe),je=zv("float32",he),We=zv("float32",he),ft=IA(e,fe),xt=IA(n,fe),zt=w_(b,R),Ft=w_(q,re),jt=e.length,Re=Zl(e),Lr=n.length,Cr=Zl(n);if(ft.length+xt.length===0)for(let Gr=0;GrPn[Ma]=0);const Vn=c1(Pn,jt,Re),un=yn.slice(-Lr);xt.forEach(Ma=>un[Ma]=0);const Nn=c1(un,Lr,Cr),Kr=u(zt[Vn*2],zt[Vn*2+1],Ft[Nn*2],Ft[Nn*2+1]);je[Gr]=Kr.real,We[Gr]=Kr.imag}return[je,We,fe]}}const ZG=lp(((u,e)=>u+e)),ohe=xO(((u,e,n,b)=>({real:u+n,imag:e+b}))),DA=Wp(UA,ZG,ohe),she={kernelName:UA,backendName:"cpu",kernelFunc:DA};function bO(u,e,n,b,R){const q=xo(b),re=Nv(R,n);for(let fe=0;fe=R||(q>0?re[he]+=e[fe]:re[he]+=1)}return re}function KG(u,e,n,b=!1){const R=u.shape[0],q=u.shape[1],re=Tc([R,n],e.dtype);for(let fe=0;fe=n||(b?re.set(1,fe,be):e.size>0?re.set(re.get(fe,be)+e.get(fe,he),fe,be):re.set(re.get(fe,be)+1,fe,be))}return re}const JG=lp(((u,e)=>u&e)),lhe=Wp(y8,JG),uhe={kernelName:y8,backendName:"cpu",kernelFunc:lhe};function y1(u){return(e,n,b)=>{const R=np(n,e.length);for(let q=0;q{const{x:re}=b;Al(re,u);const fe=q,he=fe.data.get(re.dataId).values;let be;if(re.dtype==="string"){if(!Array.isArray(he))throw new Error("String tensor's value was not an instance of Array");be=T_(he)}else be=he;const Pe=n||re.dtype,je=e(be,Pe,R);return fe.makeTensorInfo(re.shape,Pe,je)}}const QG=y1(u=>Math.ceil(u)),che=Tb(bC,QG),fhe={kernelName:bC,backendName:"cpu",kernelFunc:che};function eq(u,e,n,b){const R=np(n,xo(e));if(b&&n!=="string"){let q=0;u.forEach(re=>{const fe=xo(re.shape);R.set(re.vals,q),q+=fe})}else{let q=0;u.forEach(re=>{const fe=n==="string"?T_(re.vals):re.vals;let he=0;for(let be=0;beu===e?1:0),rq=Wp(sR,tq,null,"bool"),hhe={kernelName:sR,backendName:"cpu",kernelFunc:rq};const nq=y1(u=>Math.exp(u)),aq=Tb(kC,nq,"float32"),dhe={kernelName:kC,backendName:"cpu",kernelFunc:aq};const iq=y1(u=>Math.expm1(u)),phe=Tb(MC,iq),vhe={kernelName:MC,backendName:"cpu",kernelFunc:phe};const oq=y1(u=>Math.floor(u)),mhe=Tb(IC,oq),ghe={kernelName:IC,backendName:"cpu",kernelFunc:mhe};const sq=lp((u,e)=>Math.floor(u/e)),yhe=Wp(LC,sq,null,"int32"),_he={kernelName:LC,backendName:"cpu",kernelFunc:yhe};function lq(u,e,n,b,R,q,re,fe,he){const be=Tc([b,q],n);for(let Pe=0;Pe=he/q)throw new Error(`Invalid indices: ${je} does not index into ${fe}`);for(let ft=0;ftu>e?1:0),xhe=Wp(fR,cq,null,"bool"),bhe={kernelName:fR,backendName:"cpu",kernelFunc:xhe};const fq=lp((u,e)=>u>=e?1:0),whe=Wp(RC,fq,null,"bool"),The={kernelName:RC,backendName:"cpu",kernelFunc:whe};const hq=lp((u,e)=>uu<=e?1:0),Ehe=Wp(pR,dq,null,"bool"),Che={kernelName:pR,backendName:"cpu",kernelFunc:Ehe};function pq(u,e,n){const b=(e-u)/(n-1),R=Nv(n,"float32");R[0]=u;for(let q=1;qMath.log(u)),khe=Tb(OC,vq),Mhe={kernelName:OC,backendName:"cpu",kernelFunc:khe};function mq(u,e,n,b){const R=zv(b,xo(n));for(let q=0;qfe)&&(fe=be)}R[q]=fe}return R}const gq=lp(((u,e)=>Math.max(u,e))),Ihe=Wp(BC,gq),Lhe={kernelName:BC,backendName:"cpu",kernelFunc:Ihe};const yq=lp(((u,e)=>Math.min(u,e))),Rhe=Wp(UC,yq),Dhe={kernelName:UC,backendName:"cpu",kernelFunc:Rhe};const wO=lp(((u,e)=>u*e)),Phe=xO(((u,e,n,b)=>({real:u*n-e*b,imag:u*b+e*n}))),mD=Wp(VC,wO,Phe),zhe={kernelName:VC,backendName:"cpu",kernelFunc:mD};function _q(u,e,n){const b=gb(-1,n);return wO([],e,b,u,n)}function Nhe(u){const{inputs:e,backend:n}=u,{x:b}=e;Al(b,"neg");const R=n.data.get(b.dataId).values,[q,re]=_q(R,b.shape,b.dtype);return n.makeTensorInfo(re,b.dtype,q)}const Ohe={kernelName:SR,backendName:"cpu",kernelFunc:Nhe};const xq=lp(((u,e)=>u!==e?1:0)),Fhe=Wp(ER,xq,null,"bool"),Bhe={kernelName:ER,backendName:"cpu",kernelFunc:Fhe};function TO(u,e,n,b,R){const q=e.length,re=xo(e),fe=Zl(e),he=Zl(R),be=zv(n,xo(R));for(let Pe=0;Pen.disposeIntermediateTensorInfo(Re)),n.makeTensorInfo(jt,Ft,xt)}const Vhe={kernelName:RR,backendName:"cpu",kernelFunc:$he};function jhe(u,e,n){u.forEach((b,R)=>{if(b<0||b>=n){const q=BA(R,e.length,Zl(e)).join(",");throw new Error(`indices[${q}] = ${b} is not in [0, ${n})`)}})}function Ghe(u,e){for(let n=0;nR)throw new Error("Ragged splits must not point past values");for(let q=1;qb[q])throw new Error("Ragged splits must be sorted in ascending order")}}function qhe(u,e,n,b){const R=[];let q=0;const re=e.length-1+n.length,fe=new Array(re).fill(null).map(()=>[0]);Ghe(n,b);let he=1;for(let be=0;be=0){const zt=fe[xt],Ft=zt[zt.length-1]-ft[Pe];for(let jt=Pe;jtR[re]=q)}return e}function RB(u,e){const n=u.slice(0,e);for(;n.length1)throw new Error("starts must be a scalar or vector");if(R.length>1)throw new Error("limits must be a scalar or vector");if(re.length>1)throw new Error("deltas must be a scalar or vector");const fe=e.length===0,he=R.length===0,be=re.length===0,Pe=[];fe||Pe.push(e[0]),he||Pe.push(R[0]),be||Pe.push(re[0]);for(let Ft=1;Ft0&&Rejt)Cr=0;else if(Cr=Math.ceil(Math.abs((Re-jt)/Lr)),Cr>DB)throw new Error(`Requires ((limit - start) / delta) <= ${DB}`);We[Ft+1]=We[Ft]+Cr}const ft=We[je],xt=np(n,ft);let zt=0;for(let Ft=0;Ftb&&(b=q)}return b}static getMaxWidthValueRowID(e){const n=e.length;if(n===0)return 0;let b=0,R=e[0],q=0;for(let re=1;re"Final length of result must be equal to firstDimension."),q}calculateOutputIndexRowSplit(e,n,b,R){const q=e.length,re=[];for(let fe=0;fe0&&re.length!==e[q-1])throw new Error("Invalid row split size.");return re}calculateOutputIndexValueRowID(e,n,b,R){const q=e.length,re=[];if(q===0)return[];let fe=0,he=e[0];if(he>=n.length)throw new Error(`Got currentValueRowId=${he}, which is not less than ${n.length}`);let be=n[he];re.push(be);for(let Pe=1;Pe=0&&(++fe,fe=n.length)throw new Error(`Got nextValueRowId=${je} which is not less than ${n.length}`);be=n[je]}re.push(be)}if(re.length!==e.length)throw new Error("Invalid row ids.");return re}calculateOutputIndex(e,n,b,R){const q=this.getRowPartitionTensor(e),re=this.getRowPartitionTypeByDimension(e);switch(re){case h0.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(q,n,b,R);case h0.ROW_SPLITS:if(q.length-1>n.length)throw new Error(`Row partition size is greater than output size: ${q.length-1} > ${n.length}`);return this.calculateOutputIndexRowSplit(q,n,b,R);default:throw new Error(`Unsupported partition type: ${h0[re]}`)}}getFirstDimensionSize(){const e=this.rowPartitionValues[0];if(this.rowPartitionTypes.length===0)throw new Error("No row_partition_types given.");const n=this.rowPartitionTypes[0];switch(n){case h0.FIRST_DIM_SIZE:return e[0];case h0.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case h0.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${h0[n]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");const n=this.getFirstDimensionSize(),b=this.calculateOutputSize(n),R=new Array(this.raggedRank+1);R[R.length-1]=1;for(let he=R.length-2;he>=0;--he)R[he]=R[he+1]*b[he+1];const q=zB(b,!1),re=np(this.valuesDType,xo(q));if(R[0]*b[0]>0){let he=this.calculateFirstParentOutputIndex(n,R[0],b[0]);for(let be=1;be<=this.raggedRank;++be)he=this.calculateOutputIndex(be-1,he,R[be],b[be]);this.setOutput(this.raggedRank,he,re,q)}return[q,re]}setOutput(e,n,b,R){if(b.length===0)return;const q=this.values,re=b;let fe=R.slice();fe=fe.slice(e+1);const he=xo(fe),be=n.length;let Pe=this.defaultValue;if(Pe.length!==he&&Pe.length!==1){const xt=this.defaultValueShape;Zi(()=>{const zt=Pi(Pe,xt);Pe=KE(zt,fe).dataSync()})}let je=0,We=0,ft=0;for(let xt=0;xt<=be;++xt){let zt=xt=be){const Ft=b.length;zt=Math.floor(Ft/he)}if(zt>ft)if(this.defaultValue.length===1)re.subarray(ft*he,zt*he).fill(this.defaultValue[0]),ft=zt;else for(;zt>ft;){const Ft=re.slice(ft*he);PB(Ft,Pe,he),++ft}zt<0?(je=xt+1,We=ft):(je=xt,We=ft,ft=We+1)}}}function PB(u,e,n){for(let b=0;b= 0`);if(b<-1)throw new Error(`Dimension ${b} must be >= -1`);b=-1}n.push(b)}return n}function Aq(u,e,n,b,R,q,re,fe,he,be){return new NL(u,e,n,b,R,q,re,fe,he,be).compute()}function Sq(u,e,n,b){const R=u===e,q=u1;if(R||q||re)return Nv(0,b);const fe=Math.abs(Math.ceil((e-u)/n)),he=Nv(fe,b);e1/Math.sqrt(u)),Yhe=Tb(XC,Eq),Zhe={kernelName:XC,backendName:"cpu",kernelFunc:Yhe};function v2(u,e,n,b,R,q,re,fe,he,be){const Pe=[b/R,R],je=u.values,We=e.values;if(b===0)return Tc(n,e.dtype);const ft=he instanceof Sv?he:Tc(Pe,e.dtype);typeof he=="string"||typeof he=="number"?ft.values.fill(he):typeof he=="boolean"&&ft.values.fill(+he);for(let xt=0;xt=b/R)throw new Error(`Invalid indices: ${zt} does not index into ${n}`);for(let jt=0;jt1/(1+Math.exp(-u))),Cq=ch(QC,u=>1/(1+Math.exp(-u))),Jhe={kernelName:QC,backendName:"cpu",kernelFunc:Cq};function kq(u,e,n,b,R){const q=iV(b,e,n),re=xo(n),fe=Zl(b);if(q){const je=oV(e,fe);return R==="string"?u.slice(je,je+re):u.subarray(je,je+re)}const he=R==="string"?T_(u):u,be=Tc(b,R,he),Pe=Tc(n,R);for(let je=0;jext+e[zt]);Pe.set(be.get(...ft),...We)}return R==="string"?IV(Pe.values):Pe.values}function L2(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{begin:q,size:re}=b;Al(R,"slice");const[fe,he]=DN(R,q,re);nV(R,fe,he);const be=n.data.get(R.dataId).values,Pe=kq(be,fe,he,R.shape,R.dtype);return n.makeTensorInfo(he,R.dtype,Pe)}const Qhe={kernelName:FR,backendName:"cpu",kernelFunc:L2};function Mq(u,e,n,b,R,q,re){const fe=e[0],he=q[0],be=new Array(he),Pe=new Array(fe),je=e[1];if(he===0){if(fe!==0)throw new Error(yV(fe));const Ft=np(n,0),jt=np(R,0);return[Ft,[0,je],jt,be,Pe]}let We=!0,ft=0;const xt=new Array(he).fill(0);for(let Ft=0;Ft=he)throw new Error(xV(Ft,jt,he));++xt[jt],We=We&&jt>=ft,ft=jt}let zt=!0;for(let Ft=0;Ft0&&(xt[Ft]+=xt[Ft-1])}if(zt&&We){const Ft=u,jt=b;for(let Re=0;Re0){ft[We-1]=1;for(let Ft=We-2;Ft>=0;--Ft)ft[Ft]=ft[Ft+1]*b[Ft+1]}const xt=[];if(fe>0){xt[fe-1]=1;for(let Ft=fe-2;Ft>=0;--Ft)xt[Ft]=xt[Ft+1]*he[Ft+1]}const zt=np(n,re*fe);for(let Ft=0;Ft0?R[fe-1]+1:0;if(je<0)throw new Error(Vz());const We=e.slice();We[0]=je;const ft=We.reduce((Lr,Cr)=>Lr*Cr,1),xt=np(n,ft);if(fe===0)return je>0&&xt.fill(re),[xt,We];if(je<=0)throw new Error(Vz());let zt=0,Ft=1,jt=0,Re=R[zt];for(;;){let Lr=0;if(Ft=Lr)throw new Error(EV())}if(Re<0||Re>=je)throw new Error(CV(Re,je));Re>jt&&xt.fill(re,jt*be,Re*be);for(let Cr=zt;Cr=he[0])throw new Error(kV(Cr,b[Cr],he[0]));for(let yn=0;ynfe)break}return jtMath.sqrt(u)),tde=ch(tk,u=>Math.sqrt(u)),rde={kernelName:tk,backendName:"cpu",kernelFunc:tde};const Lq=lp(((u,e)=>{const n=u-e;return n*n})),nde=Wp(rk,Lq),ade={kernelName:rk,backendName:"cpu",kernelFunc:nde};const Rq=y1((u,e)=>{const{pattern:n,replaceGlobal:b,rewrite:R}=e;return u.replace(new RegExp(n,b?"g":""),R)}),ide=Tb(W8,Rq),ode={kernelName:W8,backendName:"cpu",kernelFunc:ide};function Dq(u,e,n,b){const R=Tc(u,e.dtype);for(let q=0;q0?0:fe-he);let ft=0;ft+=be*this.leftPad.length;for(let Re=0;ReRe.forEach(Lr=>zt[Ft++]=Lr);for(let Re=0;Re0){jt(e[We+je-1]);for(let Re=0;Re0){let he=n[0];if(he!==0)throw new Error(`First split value must be 0, got ${he}`);for(let be=1;be=he;if(Pe=Pe&&n[be]<=b,!Pe)throw new Error(`Invalid split value ${n[be]}, must be in [${he}, ${b}]`);he=n[be]}if(he!==b)throw new Error(`Last split value must be data size. Expected ${b}, got ${he}`)}const q=R-1,re=np("int32",R);if(b===0||R===0){const he=new Array(b);for(let be=0;be<=q;++be)re[be]=0;return[he,re]}re[0]=0;for(let he=1;he<=q;++he){const be=n[he]-n[he-1];let Pe=0;this.nGramWidths.forEach(je=>{Pe+=this.getNumNGrams(be,je)}),this.preserveShort&&be>0&&Pe===0&&(Pe=1),re[he]=re[he-1]+Pe}const fe=new Array(re[q]);for(let he=0;he{const We=n[he+1]-n[he],ft=this.getNumNGrams(We,je);this.createNGrams(e,be,fe,Pe,ft,je),Pe+=ft}),this.preserveShort&&Pe===re[he]){const je=n[he+1]-n[he];if(je===0)continue;const We=je+2*this.padWidth;this.createNGrams(e,be,fe,Pe,1,We)}}return[fe,re]}}function Pq(u,e,n,b,R,q,re,fe){return new sde(n,b,R,q,re,fe).compute(u,e)}function lde(u,e,n,b){if(!u.length)return;if(e.length===0){for(let q=0;qu-e)),ude=xO(((u,e,n,b)=>({real:u-n,imag:e-b}))),SO=Wp(nk,Oq,ude),cde={kernelName:nk,backendName:"cpu",kernelFunc:SO};function Fq(u,e){const n=new Array(u.rank);for(let R=0;R{const n=e.value-u.value;return n===0?u.index-e.index:n};function Bq(u,e,n=0,b=u.length-1){for(;b>n;){if(b-n>600){const fe=b-n+1,he=e-n+1,be=Math.log(fe),Pe=.5*Math.exp(2*be/3),je=.5*Math.sqrt(be*Pe*(fe-Pe)/fe)*Math.sign(he-fe/2),We=Math.max(n,Math.floor(e-he*Pe/fe+je)),ft=Math.min(b,Math.floor(e+(fe-he)*Pe/fe+je));Bq(u,e,We,ft)}const R=u[e];let q=n,re=b;for(yA(u,n,e),XE(u[b],R)>0&&yA(u,n,b);q0;)re=re-1}XE(u[n],R)===0?yA(u,n,re):(re=re+1,yA(u,re,b)),re<=e&&(n=re+1),e<=re&&(b=re-1)}}function Uq(u,e,n,b,R){const q=e[e.length-1],[re,fe]=[u.length/q,q],he=zv(n,re*b),be=zv("int32",re*b);for(let je=0;jext[Lr]={value:Re,index:Lr}),b{for(let Ft=0;Ftnew vD,1);const Vq=ch(EC,u=>u>=0?u:Math.exp(u)-1),hde={kernelName:EC,backendName:"cpu",kernelFunc:Vq};function jq(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{alpha:q}=b;Al([R],"leakyRelu");const re=xo(R.shape),fe=n.data.get(R.dataId).values,he=zv("float32",re);for(let be=0;beu<0?e*u:u);function Gq(u){const{inputs:e,backend:n}=u,{x:b,alpha:R}=e;Al([b,R],"prelu");const q=n.data.get(b.dataId).values,re=n.data.get(R.dataId).values,[fe,he]=pde(b.shape,R.shape,q,re,"float32");return n.makeTensorInfo(he,"float32",fe)}const vde={kernelName:LR,backendName:"cpu",kernelFunc:Gq};const qq=ch(qC,u=>Math.max(0,u)),mde={kernelName:qC,backendName:"cpu",kernelFunc:qq};const Hq=ch(HC,u=>Math.min(Math.max(0,u),6)),gde={kernelName:HC,backendName:"cpu",kernelFunc:Hq};function OL(u,e,n,b,R){if(n==="linear")return g1({inputs:{x:e},backend:u});if(n==="relu")return qq({inputs:{x:e},backend:u});if(n==="elu")return Vq({inputs:{x:e},backend:u});if(n==="relu6")return Hq({inputs:{x:e},backend:u});if(n==="prelu")return Gq({inputs:{x:e,alpha:b},backend:u});if(n==="leakyrelu")return jq({inputs:{x:e},backend:u,attrs:{alpha:R}});if(n==="sigmoid")return Cq({inputs:{x:e},backend:u});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function Gh(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{shape:q}=b,re=xo(R.shape),fe=wU(q,re),he=xo(fe);Jn(re===he,()=>`The new shape (${fe}) has ${he} elements and the old shape (${R.shape}) has ${re} elements. The new shape and old shape must have the same number of elements.`),n.incRef(R.dataId);const be=n.data.get(R.dataId);if(be.complexTensorInfos!=null){const Pe=be.complexTensorInfos.real,je=be.complexTensorInfos.imag;Pe.shape=fe,je.shape=fe}return{dataId:R.dataId,shape:fe,dtype:R.dtype}}const yde={kernelName:DR,backendName:"cpu",kernelFunc:Gh};function Wq(u){const{inputs:e,backend:n,attrs:b}=u,{a:R,b:q}=e,{transposeA:re,transposeB:fe}=b;Al([R,q],"matMul");const he=R.shape.length,be=q.shape.length,Pe=re?R.shape[he-2]:R.shape[he-1],je=fe?q.shape[be-1]:q.shape[be-2],We=re?R.shape[he-1]:R.shape[he-2],ft=fe?q.shape[be-2]:q.shape[be-1],xt=R.shape.slice(0,-2),zt=q.shape.slice(0,-2),Ft=xo(xt),jt=xo(zt),Lr=Yu(R.shape.slice(0,-2),q.shape.slice(0,-2)).concat([We,ft]);Jn(Pe===je,()=>`Error in matMul: inner shapes (${Pe}) and (${je}) of Tensors with shapes ${R.shape} and ${q.shape} and transposeA=${re} and transposeB=${fe} must match.`);const Cr=re?[Ft,Pe,We]:[Ft,We,Pe],Gr=fe?[jt,ft,je]:[jt,je,ft],yn=Gh({inputs:{x:R},backend:n,attrs:{shape:Cr}}),Pn=Gh({inputs:{x:q},backend:n,attrs:{shape:Gr}}),Vn=re?yn.shape[1]:yn.shape[2],un=re?yn.shape[2]:yn.shape[1],Nn=fe?Pn.shape[1]:Pn.shape[2],Kr=Math.max(Ft,jt),Ma=n.data.get(yn.dataId).values,ui=n.data.get(Pn.dataId).values,da=Zl(yn.shape),Ia=Zl(Pn.shape),[aa,Ka,ai]=re?[da[0],1,da[1]]:[da[0],da[1],1],[Ui,$i,Hn]=fe?[1,Ia[1],Ia[0]]:[Ia[1],1,Ia[0]],qa=un*Nn,ki=Tc([Kr,un,Nn],yn.dtype),no=ki.values,oo=n.blockSize;for(let Li=0;LiMath.acos(u)),Tde={kernelName:dC,backendName:"cpu",kernelFunc:wde};const Ade=ch(pC,u=>Math.acosh(u)),Sde={kernelName:pC,backendName:"cpu",kernelFunc:Ade};function Ede(u){const{inputs:e,backend:n}=u,b=e;Al(e,"addN");const R=b.map(fe=>n.data.get(fe.dataId).values),q=Tc(b[0].shape,b[0].dtype),re=q.values;for(let fe=0;feRe&&(Re=Gr,Lr=Cr)}ft[Ft]=Lr}return be.forEach(Ft=>n.disposeIntermediateTensorInfo(Ft)),n.makeTensorInfo(Pe,"int32",ft)}const Dde={kernelName:WL,backendName:"cpu",kernelFunc:Rde};function Pde(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{axis:q}=b;Al(R,"argMin");let re=Ac(q,R.shape);const fe=kd(re,R.shape.length);let he=R;const be=[];fe!=null&&(he=Um({inputs:{x:R},backend:n,attrs:{perm:fe}}),be.push(he),re=op(re.length,he.shape.length)),re=[re[0]],Cv("argMin",re,he.shape.length);const[Pe,je]=lv(he.shape,re),We=xo(Pe),ft=Nv(We,"int32"),xt=xo(je),zt=n.data.get(he.dataId).values;for(let Ft=0;Ftn.disposeIntermediateTensorInfo(Ft)),n.makeTensorInfo(Pe,"int32",ft)}const zde={kernelName:XL,backendName:"cpu",kernelFunc:Pde};const Nde=ch(vC,u=>Math.asin(u)),Ode={kernelName:vC,backendName:"cpu",kernelFunc:Nde};const Fde=ch(mC,u=>Math.asinh(u)),Bde={kernelName:mC,backendName:"cpu",kernelFunc:Fde};const Ude=ch(gC,u=>Math.atan(u)),$de={kernelName:gC,backendName:"cpu",kernelFunc:Ude};const Vde=lp((u,e)=>Math.atan2(u,e)),jde=Wp(_C,Vde),Gde={kernelName:_C,backendName:"cpu",kernelFunc:jde};const qde=ch(yC,u=>Math.atanh(u)),Hde={kernelName:yC,backendName:"cpu",kernelFunc:qde};function EO(u,e,n,b,R,q){const re=R.strideHeight,fe=R.strideWidth,he=R.dilationHeight,be=R.dilationWidth,Pe=R.effectiveFilterHeight,je=R.effectiveFilterWidth,We=R.padInfo.top,ft=R.padInfo.left,xt=q==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,zt=Tc(R.outShape,n),Ft=zt.values,jt=R.outShape[1]*R.outShape[2]*R.outShape[3],Re=R.outShape[2]*R.outShape[3],Lr=R.outShape[3];for(let Cr=0;CrKa?Ka=oo:q==="avg"&&(ai+=oo,Ui++)}if(isNaN(Ka))break}const $i=Ma+ui*Lr+Pn;Ft[$i]=q==="avg"?ai/Ui:Ka}}}return zt}function Xq(u,e,n,b,R=!1,q=!1){const re=Tc(b.outShape,"int32"),fe=b.strideHeight,he=b.strideWidth,be=b.dilationHeight,Pe=b.dilationWidth,je=b.effectiveFilterHeight,We=b.effectiveFilterWidth,ft=b.padInfo.top,xt=b.padInfo.left,zt=Tc(e,n,u);for(let Ft=0;FtNn&&(Nn=aa,R?Kr=q?((Ft*b.inHeight+Ma)*b.inWidth+da)*b.inChannels+jt:(Ma*b.inWidth+da)*b.inChannels+jt:Kr=ui*We+Ia)}}re.set(Kr,Ft,Re,yn,jt)}}return re}function Yq(u,e,n,b,R,q){const re=R.strideDepth,fe=R.strideHeight,he=R.strideWidth,be=R.dilationDepth,Pe=R.dilationHeight,je=R.dilationWidth,We=R.effectiveFilterDepth,ft=R.effectiveFilterHeight,xt=R.effectiveFilterWidth,zt=R.padInfo.front,Ft=R.padInfo.top,jt=R.padInfo.left,Re=q==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,Lr=Tc(R.outShape,n),Cr=Lr.values,Gr=R.outShape[1]*R.outShape[2]*R.outShape[3]*R.outShape[4],yn=R.outShape[2]*R.outShape[3]*R.outShape[4],Pn=R.outShape[3]*R.outShape[4],Vn=R.outShape[4];for(let un=0;unel?el=Hc:q==="avg"&&(Ps+=Hc,ou++),isNaN(el))break}if(isNaN(el))break}if(isNaN(el))break}const As=Do+Ma;Cr[As]=q==="avg"?Ps/Math.max(ou,1):el}}}}return Lr}function Wde(u,e){const n=Tc(e.outShape,"int32"),b=e.strideDepth,R=e.strideHeight,q=e.strideWidth,re=e.dilationDepth,fe=e.dilationHeight,he=e.dilationWidth,be=e.effectiveFilterDepth,Pe=e.effectiveFilterHeight,je=e.effectiveFilterWidth,We=e.padInfo.front,ft=e.padInfo.top,xt=e.padInfo.left;for(let zt=0;zt=ui&&(ui=Hn,da=aa*Pe*je+ai*Pe+$i)}}}n.set(da,zt,jt,Gr,un,Ft)}}}return n}function Xde(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e;Al(R,"avgPool");const{filterSize:q,strides:re,pad:fe,dimRoundingMode:he}=b,be=1;Jn(Fv(re,be),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${re} and dilations '${be}'`);const Pe=w0(R.shape,q,re,be,fe,he);let je;if(Pe.filterWidth===1&&Pe.filterHeight===1&&$f(Pe.inShape,Pe.outShape))je=g1({inputs:{x:R},backend:n});else{const We=n.data.get(R.dataId).values,ft=Zl(R.shape),xt=EO(We,R.shape,R.dtype,ft,Pe,"avg");je=n.makeTensorInfo(Pe.outShape,R.dtype,xt.values)}return je}const Yde={kernelName:YL,backendName:"cpu",kernelFunc:Xde};function Zde(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{filterSize:q,strides:re,pad:fe,dimRoundingMode:he,dataFormat:be}=b;Al(R,"avgPool3d");const Pe=S_(R.shape,q,re,1,fe,he,be),je=n.data.get(R.dataId).values,We=Yq(je,R.shape,R.dtype,Zl(R.shape),Pe,"avg");return n.makeTensorInfo(We.shape,"float32",We.values)}const Kde={kernelName:ZL,backendName:"cpu",kernelFunc:Zde};function Jde(u){const{inputs:e,backend:n,attrs:b}=u,{dy:R,input:q}=e,{filterSize:re,strides:fe,pad:he,dimRoundingMode:be}=b;Al([R,q],"avgPool3DGrad");const Pe=S_(q.shape,re,fe,1,he,be),je=Pe.strideDepth,We=Pe.strideHeight,ft=Pe.strideWidth,xt=Pe.filterDepth,zt=Pe.filterHeight,Ft=Pe.filterWidth,jt=Pe.dilationDepth,Re=Pe.dilationHeight,Lr=Pe.dilationWidth,Cr=Pe.effectiveFilterDepth,Gr=Pe.effectiveFilterHeight,yn=Pe.effectiveFilterWidth,Pn=Cr-1-Pe.padInfo.front,Vn=yn-1-Pe.padInfo.left,un=Gr-1-Pe.padInfo.top,Nn=Tc(q.shape,"float32"),Kr=1/(xt*zt*Ft),Ma=n.bufferSync(R);for(let ui=0;ui=Pe.outDepth||Math.floor(ki)!==ki))for(let no=0;no=Pe.outHeight||Math.floor(oo)!==oo))for(let Li=0;Li=Pe.outWidth||Math.floor(Do)!==Do)continue;const el=Ma.get(ui,ki,oo,Do,da);Hn+=el}}}Nn.set(Hn*Kr,ui,Ia,aa,Ka,da)}return n.makeTensorInfo(Nn.shape,Nn.dtype,Nn.values)}const Qde={kernelName:m8,backendName:"cpu",kernelFunc:Jde};function epe(u){const{inputs:e,backend:n,attrs:b}=u,{dy:R,input:q}=e,re=q;Al([R,q],"avgPoolGrad");const{filterSize:fe,strides:he,pad:be}=b,Pe=w0(re.shape,fe,he,1,be),je=Pe.strideHeight,We=Pe.strideWidth,ft=Pe.filterHeight,xt=Pe.filterWidth,zt=Pe.dilationHeight,Ft=Pe.dilationWidth,jt=Pe.effectiveFilterHeight,Re=Pe.effectiveFilterWidth,Lr=Re-1-Pe.padInfo.left,Cr=jt-1-Pe.padInfo.top,Gr=Tc(re.shape,"float32"),yn=1/(ft*xt),Pn=n.data.get(R.dataId).values,Vn=Tc(R.shape,"float32",Pn);for(let un=0;un=Pe.outHeight||Math.floor(Ka)!==Ka))for(let ai=0;ai=Pe.outWidth||Math.floor(Ui)!==Ui)continue;const $i=Vn.get(un,Ka,Ui,Nn);Ia+=$i}}Gr.set(Ia*yn,un,Kr,Ma,Nn)}return n.makeTensorInfo(Gr.shape,Gr.dtype,Gr.values)}const tpe={kernelName:v8,backendName:"cpu",kernelFunc:epe};function rpe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,scale:q,offset:re,mean:fe,variance:he}=e;Jn(fe.shape.length===he.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),Jn(re==null||fe.shape.length===re.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),Jn(q==null||fe.shape.length===q.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),Al([R,fe,he,q,re],"batchNorm");let{varianceEpsilon:be}=b;be==null&&(be=.001);const Pe=n.data.get(R.dataId).values,je=n.data.get(fe.dataId).values,We=n.data.get(he.dataId).values,ft=q?n.data.get(q.dataId).values:new Float32Array([1]),xt=re?n.data.get(re.dataId).values:new Float32Array([0]),zt=new Float32Array(Pe.length),Ft=xt.length,jt=ft.length,Re=We.length,Lr=je.length;let Cr=0,Gr=0,yn=0,Pn=0;for(let Vn=0;Vn=Ft&&(Cr=0),Gr>=Lr&&(Gr=0),yn>=jt&&(yn=0),Pn>=Re&&(Pn=0);return n.makeTensorInfo(R.shape,R.dtype,zt)}const npe={kernelName:uR,backendName:"cpu",kernelFunc:rpe};function ape(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{blockShape:q,crops:re}=b;Al([R],"batchToSpaceND");const fe=q.reduce((jt,Re)=>jt*Re),he=hk(R.shape,q,fe),be=dk(he.length,q.length),Pe=pk(R.shape,q,fe),je=ON(re,q.length),We=FN(Pe,re,q.length),ft=Gh({inputs:{x:R},backend:n,attrs:{shape:he}}),xt=Um({inputs:{x:ft},backend:n,attrs:{perm:be}}),zt=Gh({inputs:{x:xt},backend:n,attrs:{shape:Pe}}),Ft=L2({inputs:{x:zt},backend:n,attrs:{begin:je,size:We}});return n.disposeIntermediateTensorInfo(ft),n.disposeIntermediateTensorInfo(xt),n.disposeIntermediateTensorInfo(zt),Ft}const ipe={kernelName:JL,backendName:"cpu",kernelFunc:ape};function ope(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,weights:q}=e,{size:re}=b,fe=n.data.get(R.dataId).values,he=n.data.get(q.dataId).values,be=bO(fe,he,q.dtype,q.shape,re);return n.makeTensorInfo([re],q.dtype,be)}const spe={kernelName:g8,backendName:"cpu",kernelFunc:ope};function lpe(u){const{inputs:e,backend:n}=u,{s0:b,s1:R}=e,q=n.data.get(b.dataId).values,re=n.data.get(R.dataId).values,fe=Yu(Array.from(q),Array.from(re));return n.makeTensorInfo([fe.length],"int32",Int32Array.from(fe))}const upe={kernelName:kU,backendName:"cpu",kernelFunc:lpe};const cpe=ch(wC,(u,e)=>{const n=e;return u>n.clipValueMax?n.clipValueMax:u{const{x:e}=u.inputs,n=u.backend,b=new Float32Array(xo(e.shape)),R=n.data.get(e.dataId),q=R.complexTensorInfos.real,re=R.complexTensorInfos.imag,fe=n.data.get(q.dataId).values,he=n.data.get(re.dataId).values;for(let be=0;bezt.shape);PN(re,q);let fe=h1(e.map(zt=>zt.shape),q);if(xo(fe)===0)return n.makeTensorInfo(fe,e[0].dtype,[]);const he=e.filter(zt=>xo(zt.shape)>0);if(he.length===1)return g1({inputs:{x:he[0]},backend:n});if(he[0].dtype==="complex64"){const zt=he.map(Cr=>I2({inputs:{input:Cr},backend:n})),Ft=he.map(Cr=>PA({inputs:{input:Cr},backend:n})),jt=zA({inputs:zt,backend:n,attrs:{axis:q}}),Re=zA({inputs:Ft,backend:n,attrs:{axis:q}}),Lr=ig({inputs:{real:jt,imag:Re},backend:n});return zt.forEach(Cr=>n.disposeIntermediateTensorInfo(Cr)),Ft.forEach(Cr=>n.disposeIntermediateTensorInfo(Cr)),n.disposeIntermediateTensorInfo(jt),n.disposeIntermediateTensorInfo(Re),Lr}const be=he.map(zt=>{const jt=[-1,xo(zt.shape.slice(q))];return Gh({inputs:{x:zt},backend:n,attrs:{shape:jt}})}),Pe=be.map(zt=>({vals:n.data.get(zt.dataId).values,shape:zt.shape}));fe=h1(be.map(zt=>zt.shape),1);const je=be[0].shape[0]===1,We=eq(Pe,fe,e[0].dtype,je),ft=h1(he.map(zt=>zt.shape),q),xt=n.makeTensorInfo(ft,e[0].dtype,We);return be.forEach(zt=>n.disposeIntermediateTensorInfo(zt)),xt}const vpe={kernelName:eR,backendName:"cpu",kernelFunc:zA};function Zq(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,filter:q}=e,{strides:re,pad:fe,dataFormat:he,dilations:be,dimRoundingMode:Pe}=b;Al([R,q],"conv2d");const je=E_(he),We=Ev(R.shape,q.shape,re,be,fe,Pe,!1,je),ft=We.filterHeight,xt=We.filterWidth,zt=We.dilationHeight,Ft=We.dilationWidth,jt=We.padInfo.left,Re=We.padInfo.top,Lr=We.dataFormat==="channelsLast",Cr=new Sv(We.outShape,R.dtype),Gr=Zl(R.shape),yn=Zl(q.shape),Pn=Gr[0],Vn=Lr?Gr[1]:Gr[2],un=Lr?Gr[2]:1,Nn=Lr?1:Gr[1],Kr=Cr.strides[0],Ma=Lr?Cr.strides[1]:Cr.strides[2],ui=Lr?Cr.strides[2]:1,da=Lr?1:Cr.strides[1],Ia=n.data.get(R.dataId).values,aa=n.data.get(q.dataId).values,Ka=Cr.values;for(let ai=0;ai=We.inHeight)continue;const Li=no*yn[0],Do=Ui+oo*Vn;for(let el=0;el=We.inWidth)continue;const du=Li+As*yn[1],ko=Do+nc*un;let Ec=du;for(let Cc=0;Cc=be.inDepth)continue;const ai=aa*un[0],Ui=Kr+Ka*Vn[1];for(let $i=0;$i=be.inHeight)continue;const oo=ai+ki*un[1],Li=Ui+no*Vn[2];for(let Do=0;Do=be.inWidth)continue;const nc=oo+ou*un[2],du=Li+As*be.inChannels;let ko=nc;for(let Ec=0;EcMath.cos(u)),kpe={kernelName:TC,backendName:"cpu",kernelFunc:Cpe};const Mpe=ch(AC,u=>Math.cosh(u)),Ipe={kernelName:AC,backendName:"cpu",kernelFunc:Mpe};function Lpe(u){const{inputs:e,backend:n,attrs:b}=u,{image:R,boxes:q,boxInd:re}=e,{cropSize:fe,method:he,extrapolationValue:be}=b,[Pe,je,We,ft]=R.shape,xt=q.shape[0],[zt,Ft]=fe,jt=Tc([xt,zt,Ft,ft],"float32"),Re=n.data.get(q.dataId).values,Lr=n.data.get(re.dataId).values,Cr=n.data.get(R.dataId).values,Gr=Zl(R.shape),yn=Zl(jt.shape);for(let Pn=0;Pn=Pe)continue;const da=zt>1?(Kr-un)*(je-1)/(zt-1):0,Ia=Ft>1?(Ma-Nn)*(We-1)/(Ft-1):0;for(let aa=0;aa1?un*(je-1)+aa*da:.5*(un+Kr)*(je-1);if(Ka<0||Ka>je-1){for(let ai=0;ai1?Nn*(We-1)+Hn*Ia:.5*(Nn+Ma)*(We-1);if(qa<0||qa>We-1){for(let Li=0;Li1?Nn*(We-1)+ai*Ia:.5*(Nn+Ma)*(We-1);if(Ui<0||Ui>We-1){for(let qa=0;qajt+xt-Re-1:(jt,Re)=>jt+Re;for(let jt=0;jtjt+xt-Re-1:(jt,Re)=>jt+Re;for(let jt=0;jt`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${re}`);const fe=R.shape[0],he=R.shape[1],be=R.shape[2],Pe=R.shape[3],je=he*q,We=be*q,ft=Pe/(q*q),xt=n.data.get(R.dataId).values,zt=new Float32Array(fe*je*We*ft);let Ft=0;for(let jt=0;jt`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${re} and dilations '${We}'`);const ft=Ev(R.shape,q.shape,re,We,fe,be,!0),{filterHeight:xt,filterWidth:zt,dilationHeight:Ft,dilationWidth:jt,padInfo:Re}=ft,Lr=Re.left,Cr=Re.top,Gr=ft.outChannels/ft.inChannels,yn=new Sv(ft.outShape,R.dtype),Pn=n.data.get(R.dataId).values,Vn=n.data.get(q.dataId).values,un=yn.values;for(let Nn=0;Nn=ft.inHeight)continue;const ai=aa*je[0],Ui=Kr+Ka*Pe[1];for(let $i=0;$i=ft.inWidth)continue;const oo=ai+ki*je[1],Li=Ui+no*ft.inChannels;let Do=Hn,el=oo;for(let Ps=0;Ps{const{x:b,filter:R}=u,{strides:q,pad:re,dilations:fe}=n,he=e,be=he.data.get(b.dataId).values,Pe=b.shape.length,je=he.data.get(R.dataId).values,We=R.shape.length,{batchSize:ft,inHeight:xt,inWidth:zt,inChannels:Ft,outHeight:jt,outWidth:Re,padInfo:Lr,strideHeight:Cr,strideWidth:Gr,filterHeight:yn,filterWidth:Pn,dilationHeight:Vn,dilationWidth:un,outShape:Nn}=lk(b.shape,R.shape,q,re,"NHWC",fe),Kr=xo(Nn),Ma=Nn.length,ui=np(b.dtype,Kr);for(let Ia=0;Ia=0&&no=0&&LiHn&&(Hn=Ps)}}}const qa=c1([Ia,aa,ai,$i],Ma,Zl(Nn));ui[qa]=Hn}}}return{dataId:he.write(D2(ui,b.dtype),Nn,b.dtype),shape:Nn,dtype:b.dtype}}};const Ype={kernelName:Cz,backendName:"cpu",kernelFunc:({inputs:u,backend:e,attrs:n})=>{const{x:b,filter:R,dy:q}=u,{strides:re,pad:fe,dilations:he}=n,be=e,Pe=ay(b.shape,be.data.get(b.dataId).values),je=ay(R.shape,be.data.get(R.dataId).values),{batchSize:We,inHeight:ft,inWidth:xt,inChannels:zt,outHeight:Ft,outWidth:jt,padInfo:Re,strideHeight:Lr,strideWidth:Cr,filterHeight:Gr,filterWidth:yn,dilationHeight:Pn,dilationWidth:Vn,outShape:un}=lk(b.shape,R.shape,re,fe,"NHWC",he);Jn(q.rank===un.length,()=>`Error in ${Cz}, dy must have the same rank as output ${un.length}, but got ${q.rank}`);const Nn=ay(un,be.data.get(q.dataId).values),Kr=SU(R.shape,R.dtype);for(let ui=0;ui=0&&ki=0&&ooUi&&(Ui=Li,$i=qa,Hn=no)}}}Kr[$i][Hn][ai]+=Nn[ui][da][aa][ai]}}}return{dataId:be.write(D2(Kr,b.dtype),R.shape,R.dtype),shape:R.shape,dtype:R.dtype}}};const Zpe={kernelName:Ez,backendName:"cpu",kernelFunc:({inputs:u,backend:e,attrs:n})=>{const{x:b,filter:R,dy:q}=u,{strides:re,pad:fe,dilations:he}=n,be=e,Pe=ay(b.shape,be.data.get(b.dataId).values),je=ay(R.shape,be.data.get(R.dataId).values),{batchSize:We,inHeight:ft,inWidth:xt,inChannels:zt,outHeight:Ft,outWidth:jt,padInfo:Re,strideHeight:Lr,strideWidth:Cr,filterHeight:Gr,filterWidth:yn,dilationHeight:Pn,dilationWidth:Vn,outShape:un}=lk(b.shape,R.shape,re,fe,"NHWC",he);Jn(q.rank===un.length,()=>`Error in ${Ez}, dy must have the same rank as output ${un.length}, but got ${q.rank}`);const Nn=ay(un,be.data.get(q.dataId).values),Kr=SU(b.shape,b.dtype);for(let ui=0;ui=0&&ki=0&&ooUi&&(Ui=Li,$i=ki,Hn=oo)}}}Kr[ui][$i][Hn][ai]+=Nn[ui][da][aa][ai]}}}return{dataId:be.write(D2(Kr,b.dtype),b.shape,b.dtype),shape:b.shape,dtype:b.dtype}}};function Kpe(u){const{inputs:e,backend:n,attrs:b}=u,{image:R}=e,{canvas:q,options:re}=b,{contextOptions:fe,imageOptions:he}=re||{},be=he?.alpha||1,Pe=fe?.contextType||"2d";if(Pe!=="2d")throw new Error(`Context type ${fe.contextType} is not supported by the CPU backend.`);const je=q.getContext(Pe,fe?.contextAttributes||{});if(je==null)throw new Error(`Could not get the context with ${Pe} type.`);const[We,ft]=R.shape.slice(0,2),xt=R.shape.length===2?1:R.shape[2],zt=n.data.get(R.dataId).values,Ft=R.dtype==="float32"?255:1,jt=new Uint8ClampedArray(ft*We*4);for(let Lr=0;Lr1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${Pn}.`)}else if(R.dtype==="int32"&&(Pn<0||Pn>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${Pn}.`);xt===1?(Cr[0]=Pn*Ft,Cr[1]=Pn*Ft,Cr[2]=Pn*Ft):Cr[yn]=Pn*Ft}const Gr=Lr*4;jt[Gr+0]=Math.round(Cr[0]),jt[Gr+1]=Math.round(Cr[1]),jt[Gr+2]=Math.round(Cr[2]),jt[Gr+3]=Math.round(Cr[3])}q.width=ft,q.height=We;const Re=new ImageData(jt,ft,We);return je.putImageData(Re,0,0),R}const Jpe={kernelName:gte,backendName:"cpu",kernelFunc:Kpe};function Tk(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{axis:q,keepDims:re}=b;Al(R,"sum");let fe;R.dtype==="bool"?fe=vb({inputs:{x:R},backend:n,attrs:{dtype:"int32"}}):fe=g1({inputs:{x:R},backend:n});const he=fe.shape.length,be=Ac(q,fe.shape),Pe=kd(be,he);let je=be,We=fe;Pe!=null&&(We=Um({inputs:{x:fe},backend:n,attrs:{perm:Pe}}),je=op(je.length,he)),Cv("sum",je,We.shape.length);const[ft,xt]=lv(We.shape,je),zt=sg(We.dtype,"int32");let Ft=zL(n,ft,zt);const jt=xo(xt),Re=n.data.get(Ft.dataId).values,Lr=n.data.get(We.dataId).values;for(let Cr=0;Cr=0&&(We=Tk({inputs:{x:We},backend:n,attrs:{axis:be[zt]-(re.length-ft),keepDims:!1}}),xt.push(We)),ft--)}for(const zt of xt)zt!==We&&n.disposeIntermediateTensorInfo(zt);return We}const tve={kernelName:M8,backendName:"cpu",kernelFunc:eve};function rve(u){const{inputs:e,backend:n}=u,{dy:b,y:R}=e;Al([b,R],"eluGrad");const q=new Float32Array(xo(R.shape)),re=n.data.get(R.dataId).values,fe=n.data.get(b.dataId).values;for(let he=0;he=0?q[he]=fe[he]:q[he]=fe[he]*(be+1)}return n.makeTensorInfo(R.shape,"float32",q)}const nve={kernelName:I8,backendName:"cpu",kernelFunc:rve};const ave=BN,ive=UN,ove=$N,sve=VN,lve=jN,uve=GN,cve=ch(CC,u=>{const e=Math.sign(u),n=Math.abs(u),b=1/(1+ave*n);return e*(1-((((uve*b+lve)*b+sve)*b+ove)*b+ive)*b*Math.exp(-n*n))}),fve={kernelName:CC,backendName:"cpu",kernelFunc:cve};function FL(u){const{inputs:e,backend:n,attrs:b}=u,{input:R}=e,{dim:q}=b,re=R.shape.length,fe=R.shape.slice();let he=q;return q<0&&(Jn(-(re+1)<=q,()=>`Axis must be in the interval [${-(re+1)}, ${re}]`),he=re+q+1),fe.splice(he,0,1),Gh({inputs:{x:R},backend:n,attrs:{shape:fe}})}const hve={kernelName:lR,backendName:"cpu",kernelFunc:FL};const dve=lp((u,e)=>u/e),CO=Wp(SC,dve),Qz={kernelName:SC,backendName:"cpu",kernelFunc:CO};function Jq(u,e,n){const b=u.shape,R=b[0],q=b[1],re=n.data.get(u.dataId),fe=re.complexTensorInfos.real,he=re.complexTensorInfos.imag,be=[R,q],Pe=xo(be),je=zv("float32",Pe),We=zv("float32",Pe);for(let Ft=0;Ft{const{image:b}=u,R=n,q=zv(b.dtype,xo(b.shape)),[re,fe,he,be]=b.shape,Pe=R.data.get(b.dataId).values;for(let We=0;We=0&&Lr=0,()=>`GatherV2: the index value ${Gr} is not in [0, ${Pe-1}]`)}let je=fe;fe==null&&(je=0);const We=xo(q.shape),ft=MV(R,q,he,je),xt=Gh({inputs:{x:R},backend:n,attrs:{shape:[ft.batchSize,ft.outerSize,ft.dimSize,ft.sliceSize]}}),zt=Gh({inputs:{x:q},backend:n,attrs:{shape:[ft.batchSize,We/ft.batchSize]}}),Ft=[ft.batchSize,ft.outerSize,We/ft.batchSize,ft.sliceSize],jt=n.bufferSync(zt),Re=n.bufferSync(xt),Lr=uq(Re,jt,Ft);return n.disposeIntermediateTensorInfo(xt),n.disposeIntermediateTensorInfo(zt),n.makeTensorInfo(ft.outputShape,Lr.dtype,Lr.values)}const Mve={kernelName:cR,backendName:"cpu",kernelFunc:kve};function Ive(u){const{inputs:e,backend:n}=u,{input:b}=e,R=xo(b.shape),q=b.shape[b.shape.length-1],re=R/q,fe=Gh({inputs:{x:b},backend:n,attrs:{shape:[re,q]}}),he=Jq(fe,!0,n),be=Gh({inputs:{x:he},backend:n,attrs:{shape:b.shape}});return n.disposeIntermediateTensorInfo(fe),n.disposeIntermediateTensorInfo(he),be}const Lve={kernelName:P8,backendName:"cpu",kernelFunc:Ive};const Rve=ch(PC,u=>Number.isFinite(u)?1:0,"bool"),Dve={kernelName:PC,backendName:"cpu",kernelFunc:Rve};const Pve=ch(zC,u=>Math.abs(u)===1/0?1:0,"bool"),zve={kernelName:zC,backendName:"cpu",kernelFunc:Pve};const Nve=ch(NC,u=>Number.isNaN(u)?1:0,"bool"),Ove={kernelName:NC,backendName:"cpu",kernelFunc:Nve};function Fve(u){const{backend:e,attrs:n}=u,{start:b,stop:R,num:q}=n,re=pq(b,R,q);return e.makeTensorInfo([re.length],"float32",re)}const Bve={kernelName:LU,backendName:"cpu",kernelFunc:Fve};const Uve=ch(FC,u=>Math.log1p(u)),$ve={kernelName:FC,backendName:"cpu",kernelFunc:Uve};const Vve=lp((u,e)=>u&&e),jve=Wp(vR,Vve,null,"bool"),Gve={kernelName:vR,backendName:"cpu",kernelFunc:jve};const qve=ch(mR,u=>u?0:1,"bool"),Hve={kernelName:mR,backendName:"cpu",kernelFunc:qve};const Wve=lp((u,e)=>u||e),Xve=Wp(gR,Wve,null,"bool"),Yve={kernelName:gR,backendName:"cpu",kernelFunc:Xve};function Zve(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{depthRadius:q,bias:re,alpha:fe,beta:he}=b;Al(R,"LRN");const be=R.shape[3],Pe=be-1,je=n.data.get(R.dataId).values,We=xo(R.shape),ft=new Float32Array(We);function xt(zt){const Ft=zt%be;let jt=zt-Ft+Math.max(0,Ft-q);const Re=zt-Ft+Math.min(Ft+q,Pe);let Lr=0;for(;jt<=Re;jt++){const Cr=je[jt];Lr+=Cr*Cr}return Lr}for(let zt=0;zt`Error in maxPool: Either strides or dilations must be 1. Got strides ${re} and dilations '${be}'`);const Pe=w0(R.shape,q,re,be,fe,he);let je;if(Pe.filterWidth===1&&Pe.filterHeight===1&&$f(Pe.inShape,Pe.outShape))je=g1({inputs:{x:R},backend:n});else{const We=n.data.get(R.dataId).values,ft=Zl(R.shape),xt=EO(We,R.shape,R.dtype,ft,Pe,"max");je=n.makeTensorInfo(Pe.outShape,R.dtype,xt.values)}return je}const rme={kernelName:xR,backendName:"cpu",kernelFunc:tme};function nme(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{filterSize:q,strides:re,pad:fe,dimRoundingMode:he,dataFormat:be}=b;Al(R,"maxPool3d");const Pe=S_(R.shape,q,re,1,fe,he,be),je=n.data.get(R.dataId).values,We=Yq(je,R.shape,R.dtype,Zl(R.shape),Pe,"max");return n.makeTensorInfo(We.shape,"float32",We.values)}const ame={kernelName:bR,backendName:"cpu",kernelFunc:nme};function ime(u){const{inputs:e,backend:n,attrs:b}=u,{dy:R,input:q}=e,{filterSize:re,strides:fe,pad:he,dimRoundingMode:be}=b;Al([R,q],"maxPool3DGrad");const Pe=S_(q.shape,re,fe,1,he,be),je=n.bufferSync(q),We=Wde(je,Pe),ft=Pe.strideDepth,xt=Pe.strideHeight,zt=Pe.strideWidth,Ft=Pe.dilationDepth,jt=Pe.dilationHeight,Re=Pe.dilationWidth,Lr=Pe.effectiveFilterDepth,Cr=Pe.effectiveFilterHeight,Gr=Pe.effectiveFilterWidth,yn=Lr-1-Pe.padInfo.front,Pn=Gr-1-Pe.padInfo.left,Vn=Cr-1-Pe.padInfo.top,un=Tc(q.shape,"float32"),Nn=n.bufferSync(R);for(let Kr=0;Kr=Pe.outDepth||Math.floor(Hn)!==Hn))for(let qa=0;qa=Pe.outHeight||Math.floor(ki)!==ki))for(let no=0;no=Pe.outWidth||Math.floor(oo)!==oo)continue;const Li=Lr*Cr*Gr-1-We.get(Kr,Hn,ki,oo,Ma),Do=$i*Cr*Gr+qa*Gr+no,el=Li===Do?1:0;if(el===0)continue;const Ps=Nn.get(Kr,Hn,ki,oo,Ma);Ui+=Ps*el}}}un.set(Ui,Kr,ui,da,Ia,Ma)}return n.makeTensorInfo(un.shape,un.dtype,un.values)}const ome={kernelName:F8,backendName:"cpu",kernelFunc:ime};function sme(u){const{inputs:e,backend:n,attrs:b}=u,{dy:R,input:q,output:re}=e,fe=q;Al([q,re],"maxPoolGrad");const{filterSize:he,strides:be,pad:Pe,dimRoundingMode:je}=b,We=w0(fe.shape,he,be,1,Pe,je),ft=n.data.get(fe.dataId).values,xt=Tc(We.outShape,fe.dtype,Xq(ft,fe.shape,fe.dtype,We).values),zt=We.strideHeight,Ft=We.strideWidth,jt=We.dilationHeight,Re=We.dilationWidth,Lr=We.effectiveFilterHeight,Cr=We.effectiveFilterWidth,Gr=Cr-1-We.padInfo.left,yn=Lr-1-We.padInfo.top,Pn=Tc(fe.shape,"float32"),Vn=n.data.get(R.dataId).values,un=Tc(R.shape,"float32",Vn);for(let Nn=0;Nn=We.outHeight||Math.floor(ai)!==ai))for(let Ui=0;Ui=We.outWidth||Math.floor($i)!==$i)continue;const Hn=Lr*Cr-1-xt.get(Nn,ai,$i,Kr),qa=Ka*Cr+Ui,ki=Hn===qa?1:0;if(ki===0)continue;const no=un.get(Nn,ai,$i,Kr);aa+=no*ki}}Pn.set(aa,Nn,Ma,ui,Kr)}return n.makeTensorInfo(Pn.shape,Pn.dtype,Pn.values)}const lme={kernelName:O8,backendName:"cpu",kernelFunc:sme};function ume(u,e,n,b,R){const q=Zl(e),re=EO(u,e,n,q,R,"max"),fe=Xq(u,e,n,R,!0,b);return[re.values,fe.values]}const cme={kernelName:RU,backendName:"cpu",kernelFunc:({inputs:u,attrs:e,backend:n})=>{const{x:b}=u,{filterSize:R,strides:q,pad:re,includeBatchInIndex:fe}=e,he=n;Al(b,"MaxPoolWithArgmax");const be=he.data.get(b.dataId).values,Pe=w0(b.shape,R,q,[1,1],re),[je,We]=ume(be,b.shape,b.dtype,fe,Pe),ft=he.write(je,Pe.outShape,b.dtype),xt=he.write(We,Pe.outShape,b.dtype);return[{dataId:ft,shape:Pe.outShape,dtype:b.dtype},{dataId:xt,shape:Pe.outShape,dtype:"int32"}]}};function fme(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{axis:q,keepDims:re}=b,fe=Ac(q,R.shape),be=lv(R.shape,fe)[1],Pe=xo(be),je=[],We=n.makeTensorInfo([],"float32",new Float32Array([Pe]));je.push(We);const ft=vb({inputs:{x:R},backend:n,attrs:{dtype:"float32"}});je.push(ft);const xt=CO({inputs:{a:ft,b:We},backend:n});je.push(xt);const zt=Tk({inputs:{x:xt},backend:n,attrs:{axis:q,keepDims:re}});return je.forEach(Ft=>n.disposeIntermediateTensorInfo(Ft)),zt}const hme={kernelName:wR,backendName:"cpu",kernelFunc:fme};function dme(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{axis:q,keepDims:re}=b;Al(R,"min");const fe=Ac(q,R.shape);let he=fe;const be=kd(he,R.shape.length);let Pe=R;be!=null&&(Pe=Um({inputs:{x:R},backend:n,attrs:{perm:be}}),he=op(he.length,R.shape.length)),Cv("min",he,Pe.shape.length);const[je,We]=lv(Pe.shape,he),ft=xo(We),xt=Nv(xo(je),Pe.dtype),zt=n.data.get(Pe.dataId).values;for(let jt=0;jtLr[0]+R.shape[Cr]+Lr[1]),he=q.map(Lr=>Lr[0]),be=q.map((Lr,Cr)=>Lr[0]+R.shape[Cr]),Pe=re==="reflect"?0:1,je=n.data.get(R.dataId).values,We=R.shape.length,ft=Zl(R.shape),xt=xo(fe),zt=fe.length,Ft=Zl(fe),jt=zv(R.dtype,xt);for(let Lr=0;Lr=be[yn]&&(Cr[yn]=(be[yn]-1)*2-Cr[yn]+Pe);Cr=Cr.map((yn,Pn)=>yn-he[Pn]);const Gr=c1(Cr,We,ft);jt[Lr]=je[Gr]}return{dataId:n.write(jt,fe,R.dtype),shape:fe,dtype:R.dtype}}const mme={kernelName:AR,backendName:"cpu",kernelFunc:vme};const gme=lp(((u,e)=>{const n=u%e;return u<0&&e<0||u>=0&&e>=0?n:(n+e)%e})),yme=Wp($C,gme),_me={kernelName:$C,backendName:"cpu",kernelFunc:yme};function eH(u){const{inputs:e,backend:n,attrs:b}=u,{logits:R}=e,{dim:q}=b,re=R.shape.length;let fe=q;if(fe===-1&&(fe=re-1),fe!==re-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${re} and dim was ${fe}`);const he=Ac([fe],R.shape),be=Qq({inputs:{x:R},backend:n,attrs:{reductionIndices:he,keepDims:!1}}),Pe=ip(be.shape,he),je=Gh({inputs:{x:be},backend:n,attrs:{shape:Pe}}),We=SO({inputs:{a:R,b:je},backend:n}),ft=aq({inputs:{x:We},backend:n}),xt=Tk({inputs:{x:ft},backend:n,attrs:{axis:he,keepDims:!1}}),zt=Gh({inputs:{x:xt},backend:n,attrs:{shape:Pe}}),Ft=CO({inputs:{a:ft,b:zt},backend:n});return n.disposeIntermediateTensorInfo(be),n.disposeIntermediateTensorInfo(je),n.disposeIntermediateTensorInfo(We),n.disposeIntermediateTensorInfo(ft),n.disposeIntermediateTensorInfo(xt),n.disposeIntermediateTensorInfo(zt),Ft}const xme={kernelName:VR,backendName:"cpu",kernelFunc:eH};function bme(u){const{inputs:e,backend:n,attrs:b}=u,{logits:R}=e,{numSamples:q,seed:re,normalized:fe}=b;Al(R,"multinomial");const he=fe?R:eH({inputs:{logits:R},backend:n,attrs:{dim:-1}}),be=he.shape[0],Pe=he.shape[1],je=n.data.get(he.dataId).values,We=[be,q],ft=Nv(xo(We),"int32");for(let xt=0;xt=0&&je[We]{b0(q,Pe.shape,"All tensors passed to stack must have matching shapes"),Jn(re===Pe.dtype,()=>"All tensors passed to stack must have matching dtypes")});const fe=[],he=e.map(Pe=>{const je=FL({inputs:{input:Pe},backend:n,attrs:{dim:R}});return fe.push(je),je}),be=zA({inputs:he,backend:n,attrs:{axis:R}});return fe.forEach(Pe=>n.disposeIntermediateTensorInfo(Pe)),be}const Nme={kernelName:MR,backendName:"cpu",kernelFunc:rH};function Ome(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{paddings:q,constantValue:re}=b;Al(R,"pad");const fe=q.map((Re,Lr)=>Re[0]+R.shape[Lr]+Re[1]),he=q.map(Re=>Re[0]),be=n.data.get(R.dataId).values,Pe=xo(R.shape),je=R.shape.length,We=Zl(R.shape),ft=xo(fe),xt=fe.length,zt=Zl(fe),Ft=zv(R.dtype,ft);re!==0&&Ft.fill(re);for(let Re=0;Reyn+he[Pn]),Gr=c1(Cr,xt,zt);Ft[Gr]=be[Re]}return{dataId:n.write(Ft,fe,R.dtype),shape:fe,dtype:R.dtype}}const nH={kernelName:IR,backendName:"cpu",kernelFunc:Ome};const Fme=lp((u,e)=>Math.pow(u,e)),Bme=Wp(jC,Fme),Ume={kernelName:jC,backendName:"cpu",kernelFunc:Bme};function $me(u){const{inputs:e,backend:n,attrs:b}=u,{paramsNestedSplits:R,paramsDenseValues:q,indices:re}=e,{outputRaggedRank:fe}=b,he=R.map(jt=>n.data.get(jt.dataId).values),be=R.map(jt=>jt.shape),Pe=n.data.get(q.dataId).values,je=n.data.get(re.dataId).values,[We,ft,xt]=wq(he,be,Pe,q.shape,q.dtype,je,re.shape),zt=We.map(jt=>n.makeTensorInfo([jt.length],"int32",jt)),Ft=n.makeTensorInfo(xt,q.dtype,ft);return zt.concat([Ft])}const Vme={kernelName:PU,backendName:"cpu",kernelFunc:$me};function jme(u){const{inputs:e,backend:n}=u,{starts:b,limits:R,deltas:q}=e,re=n.data.get(b.dataId).values,fe=n.data.get(R.dataId).values,he=n.data.get(q.dataId).values,[be,Pe]=Tq(re,b.shape,b.dtype,fe,R.shape,he,q.shape),je=n.makeTensorInfo([be.length],"int32",be),We=n.makeTensorInfo([Pe.length],b.dtype,Pe);return[je,We]}const Gme={kernelName:zU,backendName:"cpu",kernelFunc:jme};function qme(u){const{inputs:e,backend:n,attrs:b}=u,{shape:R,values:q,defaultValue:re,rowPartitionTensors:fe}=e,{rowPartitionTypes:he}=b,be=n.data.get(R.dataId).values,Pe=n.data.get(q.dataId).values,je=n.data.get(re.dataId).values,We=fe.map(Ft=>n.data.get(Ft.dataId).values),ft=fe.map(Ft=>Ft.shape),[xt,zt]=Aq(be,R.shape,Pe,q.shape,q.dtype,je,re.shape,We,ft,he);return n.makeTensorInfo(xt,q.dtype,zt)}const Hme={kernelName:NU,backendName:"cpu",kernelFunc:qme};function Wme(u){const{backend:e,attrs:n}=u,{start:b,stop:R,dtype:q,step:re}=n,fe=Sq(b,R,re,q);return e.makeTensorInfo([fe.length],q,fe)}const Xme={kernelName:V8,backendName:"cpu",kernelFunc:Wme};const Yme=ch(GC,u=>1/u),Zme={kernelName:GC,backendName:"cpu",kernelFunc:Yme};function Kme(u){const{inputs:e,backend:n,attrs:b}=u,{images:R}=e,{alignCorners:q,halfPixelCenters:re,size:fe}=b;Al(R,"resizeBilinear");const he=Zl(R.shape),[be,Pe]=fe,[je,We,ft,xt]=R.shape,zt=n.data.get(R.dataId).values,Ft=new Float32Array(xo([je,be,Pe,xt])),jt=[q&&be>1?We-1:We,q&&Pe>1?ft-1:ft],Re=[q&&be>1?be-1:be,q&&Pe>1?Pe-1:Pe];let Lr=0;const Cr=jt[0]/Re[0],Gr=jt[1]/Re[1];for(let yn=0;yn1?be-1:be,re&&ft>1?Pe-1:Pe],Ft=[re&&We>1?We-1:We,re&&ft>1?ft-1:ft],jt=zt[0]/Ft[0],Re=zt[1]/Ft[1],Lr=n.data.get(q.dataId).values;let Cr=0;for(let Gr=0;Gr1?We-1:We,q&&Pe>1?ft-1:ft],Re=[q&&be>1?be-1:be,q&&Pe>1?Pe-1:Pe],Lr=jt[0]/Re[0],Cr=jt[1]/Re[1];let Gr=0;for(let yn=0;yn1?Pe-1:Pe,re&&xt>1?je-1:je],Re=[re&&ft>1?ft-1:ft,re&&xt>1?xt-1:xt],Lr=jt[0]/Re[0],Cr=jt[1]/Re[1],Gr=1/Lr,yn=1/Cr,Pn=Math.ceil(Gr)*2+2,Vn=Math.ceil(yn)*2+2;for(let un=0;un=ft)continue;const ki=Nn+qa*he[1],no=qa*Lr,oo=Math.min(Pe-1,re?Math.round(no):Math.floor(no));if(Kr===oo)for(let Li=0;Li=xt)continue;const el=ki+Do*he[2],Ps=Do*Cr,ou=Math.min(je-1,re?Math.round(Ps):Math.floor(Ps));Ia===ou&&($i+=Ft[el+Ui])}}zt[aa+Ui]=$i}}}}return n.makeTensorInfo(R.shape,R.dtype,zt)}const age={kernelName:G8,backendName:"cpu",kernelFunc:nge};function ige(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{dims:q}=b;Al(R,"reverse");const re=R.shape.length,fe=Ac(q,R.shape);if(re===0)return g1({inputs:{x:R},backend:n});const he=new Sv(R.shape,R.dtype),be=n.bufferSync(R);for(let Pe=0;PeWe[ft]=R.shape[ft]-1-We[ft]),he.set(be.get(...We),...je)}return n.makeTensorInfo(he.shape,he.dtype,he.values)}const oge={kernelName:NR,backendName:"cpu",kernelFunc:ige};const sge={kernelName:J8,backendName:"cpu",kernelFunc:({inputs:u,attrs:e,backend:n})=>{const{image:b}=u,{radians:R,fillValue:q,center:re}=e,fe=n,he=zv(b.dtype,xo(b.shape)),[be,Pe,je,We]=b.shape,[ft,xt]=NN(re,Pe,je),zt=255,Ft=Math.sin(R),jt=Math.cos(R),Re=fe.data.get(b.dataId).values;for(let Cr=0;Cr=0&&da=0&&Ia{const e=Math.floor(u);return u-e<.5?Math.floor(u):u-e>.5?Math.ceil(u):e%2===0?e:e+1}),uge={kernelName:WC,backendName:"cpu",kernelFunc:lge};function cge(u){const{inputs:e,backend:n,attrs:b}=u,{indices:R,updates:q}=e,{shape:re}=b,{sliceRank:fe,numUpdates:he,sliceSize:be,strides:Pe,outputSize:je}=z2(q,R,re),We=!0,ft=n.bufferSync(R),xt=n.bufferSync(q),zt=v2(ft,xt,re,je,be,he,fe,Pe,0,We);return n.makeTensorInfo(re,zt.dtype,zt.values)}const fge={kernelName:OU,backendName:"cpu",kernelFunc:cge};function hge(u,e){let n=0,b=u.length,R=0;for(;n1||R.shape.length===1?1:xo(R.shape.slice(1));for(let xt=0;xtu>=0?xge*u:_ge*(Math.exp(u)-1)),wge={kernelName:YC,backendName:"cpu",kernelFunc:bge};const Tge=ch(JC,u=>u<0?-1:u>0?1:0),Age={kernelName:JC,backendName:"cpu",kernelFunc:Tge};const Sge=ch(ZC,u=>Math.sin(u)),Ege={kernelName:ZC,backendName:"cpu",kernelFunc:Sge};const Cge=ch(KC,u=>Math.sinh(u)),kge={kernelName:KC,backendName:"cpu",kernelFunc:Cge};const Mge=11920928955078125e-23,NB=Math.log(Mge)+2,Ige=ch(ek,u=>{const e=u>-NB,n=uNumber(Ft)))),n.makeTensorInfo([zt.length],b.dtype,new Int32Array(zt))]}const zge={kernelName:UU,backendName:"cpu",kernelFunc:Pge};function Nge(u){const{inputs:e,backend:n}=u,{inputIndices:b,inputShape:R,newShape:q}=e;if(b.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape + ${b.shape}`);if(R.shape.length!==1)throw new Error(`Input shape should be a vector but received shape + ${R.shape}`);if(q.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${q.shape}`);const re=Array.from(n.data.get(R.dataId).values),fe=n.data.get(b.dataId).values,he=Array.from(n.data.get(q.dataId).values),[be,Pe,je]=Iq(fe,b.shape,b.dtype,re,he);return[n.makeTensorInfo(Pe,b.dtype,be),n.makeTensorInfo([je.length],q.dtype,new Int32Array(je))]}const Oge={kernelName:$U,backendName:"cpu",kernelFunc:Nge};function Fge(u){const{inputs:e,backend:n}=u,{data:b,indices:R,segmentIds:q}=e;if(b.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(R.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${R.shape}`);if(q.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape + ${q.shape}`);if(R.shape[0]!==q.shape[0])throw new Error("segmentIds and indices should have same size.");const re=n.data.get(b.dataId).values,fe=n.data.get(R.dataId).values,he=n.data.get(q.dataId).values,[be,Pe]=AO(re,b.shape,b.dtype,fe,he,!0);return n.makeTensorInfo(Pe,b.dtype,be)}const Bge={kernelName:VU,backendName:"cpu",kernelFunc:Fge};function Uge(u){const{inputs:e,backend:n}=u,{data:b,indices:R,segmentIds:q}=e;if(b.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(R.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${R.shape}`);if(q.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape + ${q.shape}`);if(R.shape[0]!==q.shape[0])throw new Error("segmentIds and indices should have same size.");const re=n.data.get(b.dataId).values,fe=n.data.get(R.dataId).values,he=n.data.get(q.dataId).values,[be,Pe]=AO(re,b.shape,b.dtype,fe,he);return n.makeTensorInfo(Pe,b.dtype,be)}const $ge={kernelName:jU,backendName:"cpu",kernelFunc:Uge};function Vge(u){const{inputs:e,backend:n,attrs:b}=u,{sparseIndices:R,sparseValues:q,defaultValue:re}=e,{outputShape:fe}=b,{sliceRank:he,numUpdates:be,sliceSize:Pe,strides:je,outputSize:We}=z2(q,R,fe),ft=!1,xt=n.bufferSync(R);let zt;switch(q.dtype){case"bool":{const Ft=n.bufferSync(q),jt=!!n.data.get(re.dataId).values[0];zt=v2(xt,Ft,fe,We,Pe,be,he,je,jt,ft);break}case"float32":{const Ft=n.bufferSync(q),jt=n.data.get(re.dataId).values[0];zt=v2(xt,Ft,fe,We,Pe,be,he,je,jt,ft);break}case"int32":{const Ft=n.bufferSync(q),jt=n.data.get(re.dataId).values[0];zt=v2(xt,Ft,fe,We,Pe,be,he,je,jt,ft);break}case"string":{const Ft=n.bufferSync(q),jt=cb(n.data.get(re.dataId).values[0]);zt=v2(xt,Ft,fe,We,Pe,be,he,je,jt,ft);break}default:throw new Error(`Unsupported type ${q.dtype}`)}return n.makeTensorInfo(fe,zt.dtype,zt.values)}const jge={kernelName:GU,backendName:"cpu",kernelFunc:Vge};function Gge(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{numOrSizeSplits:q,axis:re}=b,fe=Ac(re,R.shape)[0],he=KN(R,q,fe),be=new Array(R.shape.length).fill(0),Pe=R.shape.slice();return he.map(je=>{const We=[...Pe];We[fe]=je;const ft=L2({inputs:{x:R},backend:n,attrs:{begin:be,size:We}});return be[fe]+=je,ft})}const qge={kernelName:$R,backendName:"cpu",kernelFunc:Gge};const Hge={kernelName:H8,backendName:"cpu",kernelFunc:({inputs:u,backend:e})=>{const{x:n}=u,b=e;Al(n,"square");const R=b.data.get(n.dataId).values,q=new Float32Array(R.length);for(let fe=0;fe{const n=e;return isNaN(u)?NaN:u>0?1:n.alpha}),Xge={kernelName:sk,backendName:"cpu",kernelFunc:Wge};function Yge(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{begin:q,end:re,strides:fe,beginMask:he,endMask:be,ellipsisMask:Pe,newAxisMask:je,shrinkAxisMask:We}=b;Al(R,"stridedSlice");const{finalShapeSparse:ft,finalShape:xt,isIdentity:zt,sliceDim0:Ft,isSimpleSlice:jt,begin:Re,end:Lr,strides:Cr}=sV(R.shape,q,re,fe,he,be,Pe,je,We);let Gr;if(zt)Gr=Gh({inputs:{x:R},backend:n,attrs:{shape:xt}});else if(Ft||jt){Jn(R.shape.length>=1,()=>`Input must have rank at least 1, got: ${R.shape.length}`);const yn=aV(Re,Lr,Cr),Pn=L2({inputs:{x:R},backend:n,attrs:{begin:Re,size:yn}});Gr=Gh({inputs:{x:Pn},backend:n,attrs:{shape:xt}}),n.disposeIntermediateTensorInfo(Pn)}else{const yn=n.bufferSync(R),Pn=Dq(ft,yn,Cr,Re);Gr=n.makeTensorInfo(xt,Pn.dtype,Pn.values)}return Gr}const Zge={kernelName:X8,backendName:"cpu",kernelFunc:Yge};function Kge(u){const{inputs:e,backend:n,attrs:b}=u,{separator:R,nGramWidths:q,leftPad:re,rightPad:fe,padWidth:he,preserveShortSequences:be}=b,{data:Pe,dataSplits:je}=e,We=n.data.get(Pe.dataId).values,ft=n.data.get(je.dataId).values,[xt,zt]=Pq(We,ft,R,q,re,fe,he,be);return[n.makeTensorInfo([xt.length],"string",xt),n.makeTensorInfo(je.shape,"int32",zt)]}const Jge={kernelName:qU,backendName:"cpu",kernelFunc:Kge};function Qge(u){const{inputs:e,backend:n,attrs:b}=u,{skipEmpty:R}=b,{input:q,delimiter:re}=e;if(q.dtype!=="string")throw new Error("Input must be of datatype string");if(q.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${q.shape}`);if(re.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${re.shape}`);const fe=n.data.get(q.dataId).values,he=n.data.get(re.dataId).values[0],[be,Pe,je]=zq(fe,he,R),We=Pe.length;return[n.makeTensorInfo([We,2],"int32",be),n.makeTensorInfo([We],"string",Pe),n.makeTensorInfo([2],"int32",new Int32Array(je))]}const e0e={kernelName:HU,backendName:"cpu",kernelFunc:Qge};function t0e(u){const{inputs:e,backend:n,attrs:b}=u,{numBuckets:R}=b,{input:q}=e;if(q.dtype!=="string")throw new Error("Input must be of datatype string");if(R<=0)throw new Error("Number of buckets must be at least 1");const re=n.data.get(q.dataId).values,fe=Nq(re,R);return n.makeTensorInfo(q.shape,"int32",fe)}const r0e={kernelName:WU,backendName:"cpu",kernelFunc:t0e};const n0e=ch(ak,u=>Math.tan(u)),a0e={kernelName:ak,backendName:"cpu",kernelFunc:n0e};const i0e=ch(ik,u=>Math.tanh(u)),o0e={kernelName:ik,backendName:"cpu",kernelFunc:i0e};function s0e(u){const{inputs:e,backend:n}=u,{tensor:b,indices:R,updates:q}=e,{sliceRank:re,numUpdates:fe,sliceSize:he,strides:be,outputSize:Pe}=z2(q,R,b.shape),je=!1,We=n.bufferSync(R),ft=n.bufferSync(q),xt=n.bufferSync(b),zt=v2(We,ft,b.shape,Pe,he,fe,re,be,xt,je);return n.makeTensorInfo(b.shape,zt.dtype,zt.values)}const l0e={kernelName:FU,backendName:"cpu",kernelFunc:s0e};function u0e(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{reps:q}=b;Al(R,"tile");const re=Fq(n.bufferSync(R),q);return n.makeTensorInfo(re.shape,re.dtype,re.values)}const c0e={kernelName:ok,backendName:"cpu",kernelFunc:u0e};function f0e(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{k:q,sorted:re}=b;Al(R,"topk");const fe=n.data.get(R.dataId).values,[he,be]=Uq(fe,R.shape,R.dtype,q,re);return[n.makeTensorInfo(he.shape,he.dtype,he.values),n.makeTensorInfo(be.shape,be.dtype,be.values)]}const h0e={kernelName:Y8,backendName:"cpu",kernelFunc:f0e};function d0e(u){const{inputs:e,attrs:n,backend:b}=u,{image:R,transforms:q}=e,{interpolation:re,fillMode:fe,fillValue:he,outputShape:be}=n,[Pe,je,We,ft]=R.shape,[xt,zt]=be??[je,We],Ft=[Pe,xt,zt,ft],jt=Zl(R.shape),Re=jt[0],Lr=jt[1],Cr=jt[2],Gr=Zl(Ft),yn=Gr[0],Pn=Gr[1],Vn=Gr[2],un=zv(R.dtype,xo(Ft));un.fill(he);const Nn=b.data.get(R.dataId).values,Kr=b.data.get(q.dataId).values;for(let ui=0;uie-1)if(e<=1)n=0;else{const b=2*e;n-=b*Math.trunc(n/b),n>=e&&(n=b-n-1)}return s8(0,n,e-1)}function m0e(u,e){let n=u;if(n<0)if(e<=1)n=0;else{const b=e-1;n+=e*(Math.trunc(-n/b)+1)}else if(n>e-1)if(e<=1)n=0;else{const b=e-1;n-=e*Math.trunc(n/b)}return s8(0,n,e-1)}function g0e(u,e){return u}function y0e(u,e){return s8(0,u,e-1)}function YE(u,e,n,b,R,q,re,fe,he,be,Pe){const je=re*b+fe*R+he*q+be;return 0<=fe&&fen.disposeIntermediateTensorInfo(xt)),ft}const E0e={kernelName:GR,backendName:"cpu",kernelFunc:S0e};const C0e=[bde,the,Tde,Sde,she,Cde,Mde,Lde,Dde,zde,Ode,Bde,$de,Gde,Hde,Yde,Kde,Qde,tpe,_de,npe,ipe,spe,uhe,upe,ihe,fhe,fpe,rhe,dpe,vpe,mpe,ype,xpe,wpe,Ape,Epe,kpe,Ipe,Rpe,Ppe,Npe,Fpe,Upe,$pe,jpe,qpe,Wpe,Xpe,Ype,Zpe,Jpe,tve,hde,nve,hhe,fve,dhe,hve,vhe,yve,_ve,bve,ghe,_he,Tve,Sve,Cve,Mve,bhe,The,nhe,Lve,ppe,Dve,zve,Ove,dde,She,Che,Bve,Mhe,$ve,Gve,Hve,Yve,Kve,Qve,eme,Lhe,rme,ame,ome,lme,cme,hme,pme,Dhe,mme,_me,wme,zhe,Ohe,Sme,kme,Lme,Bhe,Dme,zme,Nme,nH,Ume,vde,Vhe,Vme,Gme,Hme,Xme,ahe,Qz,Zme,mde,gde,yde,Jme,ege,rge,age,oge,sge,uge,Zhe,fge,mge,yge,wge,Jhe,Age,Ege,kge,Qhe,xme,Lge,Dge,zge,Oge,Bge,$ge,jge,qge,rde,Hge,ade,ode,Xge,Zge,Jge,e0e,r0e,cde,Qpe,a0e,o0e,l0e,c0e,h0e,p0e,Uhe,w0e,A0e,E0e,Pme];for(const u of C0e)YU(u);const h2={},J6={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function k0e(u,e){h2[u]=e}function uy(u,e){if(!(u in h2)||e!=null){const b=I0e(u,e);if(b!==null)h2[u]=b;else return console.log("Could not get context for WebGL version",u),null}const n=h2[u];return n==null||n.isContextLost()?(delete h2[u],uy(u)):(n.disable(n.DEPTH_TEST),n.disable(n.STENCIL_TEST),n.disable(n.BLEND),n.disable(n.DITHER),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SAMPLE_COVERAGE),n.enable(n.SCISSOR_TEST),n.enable(n.CULL_FACE),n.cullFace(n.BACK),h2[u])}function M0e(u){if(!co().getBool("IS_SAFARI")&&typeof OffscreenCanvas<"u"&&u===2)return new OffscreenCanvas(300,150);if(typeof document<"u")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function I0e(u,e){if(u!==1&&u!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");const n=e??M0e(u);return n.addEventListener("webglcontextlost",b=>{b.preventDefault(),delete h2[u]},!1),co().getBool("SOFTWARE_WEBGL_ENABLED")&&(J6.failIfMajorPerformanceCaveat=!1),u===1?n.getContext("webgl",J6)||n.getContext("experimental-webgl",J6):n.getContext("webgl2",J6)}var lC;(function(u){u[u.DENSE=0]="DENSE",u[u.SHARED_BATCH=1]="SHARED_BATCH"})(lC||(lC={}));var Fg;(function(u){u[u.RENDER=0]="RENDER",u[u.UPLOAD=1]="UPLOAD",u[u.PIXELS=2]="PIXELS",u[u.DOWNLOAD=3]="DOWNLOAD"})(Fg||(Fg={}));var Av;(function(u){u[u.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",u[u.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",u[u.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",u[u.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",u[u.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"})(Av||(Av={}));function Ak(u,e){return[e,u]}function L0e(u,e){return u*e}function Q6(u){const e=xo(u),n=Math.ceil(e/4);return wz(n)}function WA(u,e){return[Math.max(1,Math.ceil(e/2)),Math.max(1,Math.ceil(u/2))]}function R0e(u,e){const[n,b]=WA(u,e);return n*b*4}function MO(u,e){const n=u;let b,R,q,re,fe,he,be,Pe,je,We;return co().getNumber("WEBGL_VERSION")===2?(b=n.R32F,R=n.R16F,q=n.RGBA16F,re=n.RGBA32F,fe=n.RED,be=4,Pe=1,je=n.HALF_FLOAT,We=n.FLOAT,he=n.RGBA8):(b=u.RGBA,R=u.RGBA,q=u.RGBA,re=n.RGBA,fe=u.RGBA,be=4,Pe=4,je=e!=null?e.HALF_FLOAT_OES:null,We=u.FLOAT,he=u.RGBA),{internalFormatFloat:b,internalFormatHalfFloat:R,internalFormatPackedHalfFloat:q,internalFormatPackedFloat:re,textureFormatFloat:fe,downloadTextureFormat:he,downloadUnpackNumChannels:be,defaultNumChannels:Pe,textureTypeHalfFloat:je,textureTypeFloat:We}}function Js(u,e){const n=e();return co().getBool("DEBUG")&&D0e(u),n}function D0e(u){const e=u.getError();if(e!==u.NO_ERROR)throw new Error("WebGL Error: "+O0e(u,e))}const P0e=596e-10,z0e=65504;function N0e(u){return!!(co().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||u===0||P0eu.getExtension(e),'Extension "'+e+'" not supported on this browser.')}function F0e(u,e){const n=I_(u,()=>u.createShader(u.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(Js(u,()=>u.shaderSource(n,e)),Js(u,()=>u.compileShader(n)),u.getShaderParameter(n,u.COMPILE_STATUS)===!1)throw console.log(u.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}function B0e(u,e){const n=I_(u,()=>u.createShader(u.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(Js(u,()=>u.shaderSource(n,e)),Js(u,()=>u.compileShader(n)),co().get("ENGINE_COMPILE_ONLY"))return n;if(u.getShaderParameter(n,u.COMPILE_STATUS)===!1)throw aH(e,u.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}const U0e=/ERROR: [0-9]+:([0-9]+):/g;function aH(u,e){const n=U0e.exec(e);if(n==null){console.log(`Couldn't parse line number in error: ${e}`),console.log(u);return}const b=+n[1],R=u.split(` +`),q=R.length.toString().length+2,re=R.map((je,We)=>wA((We+1).toString(),q)+je);let fe=0;for(let je=0;jeu.createProgram(),"Unable to create WebGLProgram.")}function V0e(u,e){if(Js(u,()=>u.linkProgram(e)),!co().get("ENGINE_COMPILE_ONLY")&&u.getProgramParameter(e,u.LINK_STATUS)===!1)throw console.log(u.getProgramInfoLog(e)),new Error("Failed to link vertex and fragment shaders.")}function cz(u,e){if(Js(u,()=>u.validateProgram(e)),u.getProgramParameter(e,u.VALIDATE_STATUS)===!1)throw console.log(u.getProgramInfoLog(e)),new Error("Shader program validation failed.")}function j0e(u,e){const n=I_(u,()=>u.createBuffer(),"Unable to create WebGLBuffer");return Js(u,()=>u.bindBuffer(u.ARRAY_BUFFER,n)),Js(u,()=>u.bufferData(u.ARRAY_BUFFER,e,u.STATIC_DRAW)),n}function G0e(u,e){const n=I_(u,()=>u.createBuffer(),"Unable to create WebGLBuffer");return Js(u,()=>u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,n)),Js(u,()=>u.bufferData(u.ELEMENT_ARRAY_BUFFER,e,u.STATIC_DRAW)),n}function q0e(u){return I_(u,()=>u.createTexture(),"Unable to create WebGLTexture.")}function H0e(u,e){const n=co().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(u<=0||e<=0){const b=`[${u}x${e}]`;throw new Error("Requested texture size "+b+" is invalid.")}if(u>n||e>n){const b=`[${u}x${e}]`,R=`[${n}x${n}]`;throw new Error("Requested texture size "+b+" greater than WebGL maximum on this browser / GPU "+R+".")}}function W0e(u){return I_(u,()=>u.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function FB(u,e,n,b,R,q,re){const fe=u.getAttribLocation(e,n);return fe===-1?!1:(Js(u,()=>u.bindBuffer(u.ARRAY_BUFFER,b)),Js(u,()=>u.vertexAttribPointer(fe,R,u.FLOAT,!1,q,re)),Js(u,()=>u.enableVertexAttribArray(fe)),!0)}function X0e(u,e,n){Q0e(u,n),Js(u,()=>u.activeTexture(u.TEXTURE0+n)),Js(u,()=>u.bindTexture(u.TEXTURE_2D,e))}function Y0e(u,e,n){return I_(u,()=>u.getUniformLocation(e,n),'uniform "'+n+'" not present in program.')}function Z0e(u,e,n){return u.getUniformLocation(e,n)}function K0e(u,e,n,b){Js(u,()=>X0e(u,e,b)),Js(u,()=>u.uniform1i(n,b))}function fz(u,e,n){Js(u,()=>u.bindFramebuffer(u.FRAMEBUFFER,n)),Js(u,()=>u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,e,0))}function BB(u,e){Js(u,()=>u.bindFramebuffer(u.FRAMEBUFFER,e)),Js(u,()=>u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,null,0))}function tL(u){const e=u.checkFramebufferStatus(u.FRAMEBUFFER);if(e!==u.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+J0e(u,e))}function J0e(u,e){switch(e){case u.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case u.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case u.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case u.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${e}`}}function I_(u,e,n){const b=Js(u,()=>e());if(b==null)throw new Error(n);return b}function Q0e(u,e){const n=u.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,b=e+u.TEXTURE0;if(bn){const R=`[gl.TEXTURE0, gl.TEXTURE${n}]`;throw new Error(`textureUnit must be in ${R}.`)}}function NA(u,e=2){return xo(u.slice(0,u.length-e))}function OA(u){if(u.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[u.length>1?u[u.length-2]:1,u[u.length-1]]}function rL(u){let e=[1,1,1];return u.length===0||u.length===1&&u[0]===1||(e=[NA(u),...OA(u)]),e}function eye(u,e=!1){let n=co().getNumber("WEBGL_MAX_TEXTURE_SIZE"),b=co().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");b===1/0&&co().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(b=n/2),e&&(n=n*2,b=b*2,u=u.map((fe,he)=>he>=u.length-2?l8(u[he]):u[he]),u.length===1&&(u=[2,u[0]])),u.length!==2&&(u=mb(u).newShape);let R=xo(u),q=null;u.length<=1&&R<=n?q=[1,R]:u.length===2&&u[0]<=n&&u[1]<=n?q=u:u.length===3&&u[0]*u[1]<=n&&u[2]<=n?q=[u[0]*u[1],u[2]]:u.length===3&&u[0]<=n&&u[1]*u[2]<=n?q=[u[0],u[1]*u[2]]:u.length===4&&u[0]*u[1]*u[2]<=n&&u[3]<=n?q=[u[0]*u[1]*u[2],u[3]]:u.length===4&&u[0]<=n&&u[1]*u[2]*u[3]<=n&&(q=[u[0],u[1]*u[2]*u[3]]);const re=q!=null&&Math.max(...q)>b&&Math.min(...q)<=(e?2:1)&&Math.min(...q)>0;if(q==null||re)if(e){const fe=NA(u);let he=2,be=2;u.length&&([he,be]=OA(u)),R=fe*(he/2)*(be/2),q=wz(R).map(Pe=>Pe*2)}else q=wz(R);return q}function nL(u){return u%2===0}function UL(u,e){if(u=u.slice(-2),e=e.slice(-2),$f(u,e)||!u.length||!e.length||u[0]===0||u[1]===0||e[0]===0||e[1]===0)return!0;if(u.length!==e.length){const n=u[u.length-1],b=e[e.length-1];if(n===b||nL(n)&&nL(b)&&(u[0]===1||e[0]===1))return!0}return u[1]===e[1]&&nL(u[0])&&nL(e[0])}let hz,dz;function tye(u){if(hz==null){const e=uy(u);hz=e.getParameter(e.MAX_TEXTURE_SIZE)}return hz}function rye(u){if(dz==null){const e=uy(u);dz=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,dz)}function nye(u){if(u===0)return 0;let e;const n=uy(u);return g0(n,"EXT_disjoint_timer_query_webgl2")&&u===2?e=2:g0(n,"EXT_disjoint_timer_query")?e=1:e=0,e}function g0(u,e){return u.getExtension(e)!=null}function UB(u){try{if(uy(u)!=null)return!0}catch(e){return console.log("Error when getting WebGL context: ",e),!1}return!1}function aye(u){if(u===0)return!1;const e=uy(u);if(u===1){if(!g0(e,"OES_texture_float"))return!1}else if(!g0(e,"EXT_color_buffer_float"))return!1;return t8(e)}function iye(u){if(u===0)return!1;const e=uy(u);if(u===1){if(!g0(e,"OES_texture_float")||!g0(e,"WEBGL_color_buffer_float"))return!1}else{if(g0(e,"EXT_color_buffer_float"))return t8(e);const b="EXT_color_buffer_half_float";if(g0(e,b)){const R=e.getExtension(b);return oye(e,R)}return!1}return t8(e)}function t8(u){const e=MO(u),n=u.createTexture();u.bindTexture(u.TEXTURE_2D,n),u.texImage2D(u.TEXTURE_2D,0,e.internalFormatFloat,1,1,0,e.textureFormatFloat,e.textureTypeFloat,null);const q=u.createFramebuffer();u.bindFramebuffer(u.FRAMEBUFFER,q),u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,n,0);const re=u.checkFramebufferStatus(u.FRAMEBUFFER)===u.FRAMEBUFFER_COMPLETE;return u.bindTexture(u.TEXTURE_2D,null),u.bindFramebuffer(u.FRAMEBUFFER,null),u.deleteTexture(n),u.deleteFramebuffer(q),re}function oye(u,e){const n=MO(u,e),b=u.createTexture();u.bindTexture(u.TEXTURE_2D,b),u.texImage2D(u.TEXTURE_2D,0,n.internalFormatHalfFloat,1,1,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const re=u.createFramebuffer();u.bindFramebuffer(u.FRAMEBUFFER,re),u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,b,0);const fe=u.checkFramebufferStatus(u.FRAMEBUFFER)===u.FRAMEBUFFER_COMPLETE;return u.bindTexture(u.TEXTURE_2D,null),u.bindFramebuffer(u.FRAMEBUFFER,null),u.deleteTexture(b),u.deleteFramebuffer(re),fe}function sye(u){return u!==2?!1:uy(u).fenceSync!=null}function Sk(u,e){Array.isArray(u)||(u=[u]),u.forEach(n=>{n!=null&&Jn(n.dtype!=="complex64",()=>`${e} does not support complex64 tensors in the WebGL backend.`)})}const kl=co();kl.registerFlag("HAS_WEBGL",()=>kl.getNumber("WEBGL_VERSION")>0);kl.registerFlag("WEBGL_VERSION",()=>UB(2)?2:UB(1)?1:0);kl.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);kl.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>kl.get("WEBGL_VERSION")===2);kl.registerFlag("WEBGL_CPU_FORWARD",()=>!0);kl.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);kl.registerFlag("WEBGL_PACK",()=>kl.getBool("HAS_WEBGL"));kl.registerFlag("WEBGL_PACK_NORMALIZATION",()=>kl.getBool("WEBGL_PACK"));kl.registerFlag("WEBGL_PACK_CLIP",()=>kl.getBool("WEBGL_PACK"));kl.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>kl.getBool("WEBGL_PACK"));kl.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>kl.getBool("WEBGL_PACK"));kl.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>kl.getBool("WEBGL_PACK"));kl.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>kl.getBool("WEBGL_PACK"));kl.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>kl.getBool("WEBGL_PACK"));kl.registerFlag("WEBGL_PACK_REDUCE",()=>kl.getBool("WEBGL_PACK"));kl.registerFlag("WEBGL_LAZILY_UNPACK",()=>kl.getBool("WEBGL_PACK"));kl.registerFlag("WEBGL_CONV_IM2COL",()=>kl.getBool("WEBGL_PACK"));kl.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",()=>kl.getBool("WEBGL_PACK"));kl.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>tye(kl.getNumber("WEBGL_VERSION")));kl.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>rye(kl.getNumber("WEBGL_VERSION")));kl.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{const u=kl.getNumber("WEBGL_VERSION");return u===0?0:nye(u)});kl.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>kl.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!l$());kl.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>aye(kl.getNumber("WEBGL_VERSION")));kl.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>kl.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:kl.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));kl.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>iye(kl.getNumber("WEBGL_VERSION")));kl.registerFlag("WEBGL_FENCE_API_ENABLED",()=>sye(kl.getNumber("WEBGL_VERSION")));kl.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>kl.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);kl.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,u=>{if(typeof u!="number")throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${u}.`);if(u<0&&u!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${u}.`)});kl.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>l$()?1:-1,u=>{if(typeof u!="number")throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${u}.`);if(u<0&&u!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${u}.`)});kl.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128);kl.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1);kl.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5);kl.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128);kl.registerFlag("WEBGL_EXP_CONV",()=>!1);kl.registerFlag("SOFTWARE_WEBGL_ENABLED",()=>kl.getBool("IS_TEST"));kl.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",()=>1/0);kl.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",()=>!1);kl.registerFlag("WEBGL2_ISNAN_CUSTOM",()=>!1);kl.registerFlag("ENGINE_COMPILE_ONLY",()=>!1);function ym(){let u,e,n,b,R,q,re,fe,he,be;return co().getNumber("WEBGL_VERSION")===2?(u="#version 300 es",e="in",n="out",b="in",R="texture",q="outputColor",re="out vec4 outputColor;",fe=co().getBool("WEBGL2_ISNAN_CUSTOM")?` + bool isnan_custom(float val) { + uint floatToUint = floatBitsToUint(val); + return (floatToUint & 0x7fffffffu) > 0x7f800000u; + } + + bvec4 isnan_custom(vec4 val) { + return bvec4(isnan_custom(val.x), + isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w)); + } + + #define isnan(value) isnan_custom(value) + `:"",he="",be=` + #define round(value) newRound(value) + int newRound(float value) { + return int(floor(value + 0.5)); + } + + ivec4 newRound(vec4 value) { + return ivec4(floor(value + vec4(0.5))); + } + `):(u="",e="attribute",n="varying",b="varying",R="texture2D",q="gl_FragColor",re="",fe=` + #define isnan(value) isnan_custom(value) + bool isnan_custom(float val) { + return (val > 0. || val < 1. || val == 0.) ? false : true; + } + bvec4 isnan_custom(vec4 val) { + return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w)); + } + `,he=` + uniform float INFINITY; + + bool isinf(float val) { + return abs(val) == INFINITY; + } + bvec4 isinf(vec4 val) { + return equal(abs(val), vec4(INFINITY)); + } + `,be=` + int round(float value) { + return int(floor(value + 0.5)); + } + + ivec4 round(vec4 value) { + return ivec4(floor(value + vec4(0.5))); + } + `),{version:u,attribute:e,varyingVs:n,varyingFs:b,texture2D:R,output:q,defineOutput:re,defineSpecialNaN:fe,defineSpecialInf:he,defineRound:be}}function F2(u,e,n="index"){const b=Zl(e);return b.map((R,q)=>{const re=`int ${u[q]} = ${n} / ${R}`,fe=q===b.length-1?`int ${u[q+1]} = ${n} - ${u[q]} * ${R}`:`index -= ${u[q]} * ${R}`;return`${re}; ${fe};`}).join("")}function gD(u,e,n="index"){const b=Zl(e);return b.map((R,q)=>{const re=`int ${u[q]} = ${n} / outShapeStrides[${q}]`,fe=q===b.length-1?`int ${u[q+1]} = ${n} - ${u[q]} * outShapeStrides[${q}]`:`index -= ${u[q]} * outShapeStrides[${q}]`;return`${re}; ${fe};`}).join("")}function lye(u,e){const n=u.length,b=u.map(q=>`${e}[${q}]`),R=new Array(n-1);R[n-2]=b[n-1];for(let q=n-3;q>=0;--q)R[q]=`(${R[q+1]} * ${b[q+1]})`;return R}function uye(u,e,n="index"){const b=u.map((q,re)=>re),R=lye(b,e);return R.map((q,re)=>{const fe=`int ${u[re]} = ${n} / ${R[re]}`,he=re===R.length-1?`int ${u[re+1]} = ${n} - ${u[re]} * ${R[re]}`:`index -= ${u[re]} * ${R[re]}`;return`${fe}; ${he};`}).join("")}function IO(u){const e=Zl(u).map(n=>n.toString());return` + int getFlatIndex(ivec3 coords) { + return coords.x * ${e[0]} + coords.y * ${e[1]} + coords.z; + } +`}function LO(){return` + int getFlatIndex(ivec3 coords) { + return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z; + } +`}const iH=` + const float FLOAT_MAX = 1.70141184e38; + const float FLOAT_MIN = 1.17549435e-38; + + lowp vec4 encode_float(highp float v) { + if (isnan(v)) { + return vec4(255, 255, 255, 255); + } + + highp float av = abs(v); + + if(av < FLOAT_MIN) { + return vec4(0.0, 0.0, 0.0, 0.0); + } else if(v > FLOAT_MAX) { + return vec4(0.0, 0.0, 128.0, 127.0) / 255.0; + } else if(v < -FLOAT_MAX) { + return vec4(0.0, 0.0, 128.0, 255.0) / 255.0; + } + + highp vec4 c = vec4(0,0,0,0); + + highp float e = floor(log2(av)); + highp float m = exp2(fract(log2(av))) - 1.0; + + c[2] = floor(128.0 * m); + m -= c[2] / 128.0; + c[1] = floor(32768.0 * m); + m -= c[1] / 32768.0; + c[0] = floor(8388608.0 * m); + + highp float ebias = e + 127.0; + c[3] = floor(ebias / 2.0); + ebias -= c[3] * 2.0; + c[2] += floor(ebias) * 128.0; + + c[3] += 128.0 * step(0.0, -v); + + return c / 255.0; + } +`;const{getBroadcastDims:oH}=Qse;function cye(u,e,n){const b=[];if(u.forEach(ft=>{const xt=xo(ft.shapeInfo.logicalShape);if(ft.shapeInfo.isUniform?b.push(`uniform float ${ft.name}${xt>1?`[${xt}]`:""};`):(b.push(`uniform sampler2D ${ft.name};`),b.push(`uniform int offset${ft.name};`)),n.enableShapeUniforms){const{uniformShape:zt}=RO(n.packedInputs,ft.shapeInfo.logicalShape,ft.shapeInfo.texShape);switch(zt.length){case 1:b.push(`uniform int ${ft.name}Shape;`);break;case 2:b.push(`uniform ivec2 ${ft.name}Shape;`);break;case 3:b.push(`uniform ivec3 ${ft.name}Shape;`);break;case 4:b.push(`uniform ivec4 ${ft.name}Shape;`);break}b.push(`uniform ivec2 ${ft.name}TexShape;`)}}),n.enableShapeUniforms){switch(e.logicalShape.length){case 1:b.push("uniform int outShape;");break;case 2:b.push("uniform ivec2 outShape;"),b.push("uniform int outShapeStrides;");break;case 3:b.push("uniform ivec3 outShape;"),b.push("uniform ivec2 outShapeStrides;");break;case 4:b.push("uniform ivec4 outShape;"),b.push("uniform ivec3 outShapeStrides;");break}b.push("uniform ivec2 outTexShape;")}n.customUniforms&&n.customUniforms.forEach(ft=>{b.push(`uniform ${ft.type} ${ft.name}${ft.arrayIndex?`[${ft.arrayIndex}]`:""};`)});const R=b.join(` +`),q=u.map(ft=>fye(ft,e,n.packedInputs,n.enableShapeUniforms)).join(` +`),re=e.texShape,fe=ym(),he=pye(fe);let be,Pe,je=gye(fe);return e.isPacked?(be=hye(e.logicalShape,re,n.enableShapeUniforms),Pe=mye(fe)):(be=dye(e.logicalShape,re,n.enableShapeUniforms),Pe=vye(fe)),n.packedInputs&&(je+=bye),[je,he,Pe,R,be,q,n.userCode].join(` +`)}function XA(u,e=!1){const n=u.shapeInfo.logicalShape;switch(n.length){case 0:return Dye(u,e);case 1:return zye(u,e);case 2:return Oye(u,e);case 3:return Bye(u,e);case 4:return $ye(u,e);case 5:return Vye(u);case 6:return jye(u);default:throw new Error(`${n.length}-D input sampling is not yet supported`)}}function sH(u,e){switch(u.shapeInfo.logicalShape.length){case 0:return Rye(u);case 1:return Pye(u,e);case 2:return Nye(u,e);case 3:return Fye(u,e);default:return Uye(u,e)}}function fye(u,e,n=!1,b){let R="";n?R+=sH(u,b):R+=XA(u,b);const q=u.shapeInfo.logicalShape,re=e.logicalShape;return q.length<=re.length&&(n?R+=Gye(u,e):R+=qye(u,e)),R}function hye(u,e,n){switch(u.length){case 0:return lH();case 1:return wye(u,e,n);case 2:return Iye(u,e,n);case 3:return Aye(u,e,n);default:return Eye(u,e,n)}}function dye(u,e,n){switch(u.length){case 0:return lH();case 1:return Tye(u,e,n);case 2:return Lye(u,e,n);case 3:return Sye(u,e,n);case 4:return Cye(u,e,n);case 5:return kye(u,e);case 6:return Mye(u,e);default:throw new Error(`${u.length}-D output sampling is not yet supported`)}}function pye(u){return` + float sampleTexture(sampler2D textureSampler, vec2 uv) { + return ${u.texture2D}(textureSampler, uv).r; + } + `}function vye(u){return` + void setOutput(float val) { + ${u.output} = vec4(val, 0, 0, 0); + } + `}function mye(u){return` + void setOutput(vec4 val) { + ${u.output} = val; + } + `}function gye(u){return`${u.version} + precision highp float; + precision highp int; + precision highp sampler2D; + ${u.varyingFs} vec2 resultUV; + ${u.defineOutput} + const vec2 halfCR = vec2(0.5, 0.5); + + struct ivec5 + { + int x; + int y; + int z; + int w; + int u; + }; + + struct ivec6 + { + int x; + int y; + int z; + int w; + int u; + int v; + }; + + uniform float NAN; + ${u.defineSpecialNaN} + ${u.defineSpecialInf} + ${u.defineRound} + + int imod(int x, int y) { + return x - y * (x / y); + } + + int idiv(int a, int b, float sign) { + int res = a / b; + int mod = imod(a, b); + if (sign < 0. && mod != 0) { + res -= 1; + } + return res; + } + + //Based on the work of Dave Hoskins + //https://www.shadertoy.com/view/4djSRW + #define HASHSCALE1 443.8975 + float random(float seed){ + vec2 p = resultUV * seed; + vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1); + p3 += dot(p3, p3.yzx + 19.19); + return fract((p3.x + p3.y) * p3.z); + } + + ${yye} + ${_ye} + ${xye} + `}const yye=` +vec2 uvFromFlat(int texNumR, int texNumC, int index) { + int texR = index / texNumC; + int texC = index - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); +} +vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { + int texelIndex = index / 2; + int texR = texelIndex / texNumC; + int texC = texelIndex - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); +} +`,_ye=` +vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, + int texNumC, int row, int col) { + int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); + int texR = texelIndex / texNumC; + int texC = texelIndex - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); +} +`,xye=` +vec2 packedUVfrom3D(int texNumR, int texNumC, + int texelsInBatch, int texelsInLogicalRow, int b, + int row, int col) { + int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2); + int texR = index / texNumC; + int texC = index - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); +} +`,bye=` + float getChannel(vec4 frag, vec2 innerDims) { + vec2 modCoord = mod(innerDims, 2.); + return modCoord.x == 0. ? + (modCoord.y == 0. ? frag.r : frag.g) : + (modCoord.y == 0. ? frag.b : frag.a); + } + float getChannel(vec4 frag, int dim) { + float modCoord = mod(float(dim), 2.); + return modCoord == 0. ? frag.r : frag.g; + } +`;function lH(){return` + int getOutputCoords() { + return 0; + } + `}function wye(u,e,n){const b=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)];return b[0]===1?n?` + int getOutputCoords() { + return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0)); + } + `:` + int getOutputCoords() { + return 2 * int(resultUV.x * ${b[1]}.0); + } + `:b[1]===1?n?` + int getOutputCoords() { + return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0)); + } + `:` + int getOutputCoords() { + return 2 * int(resultUV.y * ${b[0]}.0); + } + `:n?` + int getOutputCoords() { + ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(packedTexShape[0], packedTexShape[1])); + return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y); + } + `:` + int getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${b[0]}, ${b[1]})); + return 2 * (resTexRC.x * ${b[1]} + resTexRC.y); + } + `}function Tye(u,e,n){return e[0]===1?n?` + int getOutputCoords() { + return int(resultUV.x * float(outTexShape[1])); + } + `:` + int getOutputCoords() { + return int(resultUV.x * ${e[1]}.0); + } + `:e[1]===1?n?` + int getOutputCoords() { + return int(resultUV.y * float(outTexShape[0])); + } + `:` + int getOutputCoords() { + return int(resultUV.y * ${e[0]}.0); + } + `:n?` + int getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(outTexShape[0], outTexShape[1])); + return resTexRC.x * outTexShape[1] + resTexRC.y; + } + `:` + int getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${e[0]}, ${e[1]})); + return resTexRC.x * ${e[1]} + resTexRC.y; + } + `}function Aye(u,e,n){if(n)return` + ivec3 getOutputCoords() { + ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); + int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0)); + int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0)); + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(packedTexShape[0], packedTexShape[1])); + int index = resTexRC.x * packedTexShape[1] + resTexRC.y; + + int b = index / texelsInBatch; + index -= b * texelsInBatch; + + int r = 2 * (index / texelsInLogicalRow); + int c = imod(index, texelsInLogicalRow) * 2; + + return ivec3(b, r, c); + } + `;const b=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)],R=Math.ceil(u[2]/2),q=R*Math.ceil(u[1]/2);return` + ivec3 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${b[0]}, ${b[1]})); + int index = resTexRC.x * ${b[1]} + resTexRC.y; + + int b = index / ${q}; + index -= b * ${q}; + + int r = 2 * (index / ${R}); + int c = imod(index, ${R}) * 2; + + return ivec3(b, r, c); + } + `}function Sye(u,e,n){if(n)return` + ivec3 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(outTexShape[0], outTexShape[1])); + int index = resTexRC.x * outTexShape[1] + resTexRC.y; + ${gD(["r","c","d"],u)} + return ivec3(r, c, d); + } +`;const b=F2(["r","c","d"],u);return` + ivec3 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${e[0]}, ${e[1]})); + int index = resTexRC.x * ${e[1]} + resTexRC.y; + ${b} + return ivec3(r, c, d); + } + `}function Eye(u,e,n){if(n)return` + ivec4 getOutputCoords() { + ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(packedTexShape[0], packedTexShape[1])); + int index = resTexRC.x * packedTexShape[1] + resTexRC.y; + + int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0)); + int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0)); + int texelsInBatchN = texelsInBatch * outShape[1]; + + int b2 = index / texelsInBatchN; + index -= b2 * texelsInBatchN; + + int b = index / texelsInBatch; + index -= b * texelsInBatch; + + int r = 2 * (index / texelsInLogicalRow); + int c = imod(index, texelsInLogicalRow) * 2; + + return ivec4(b2, b, r, c); + } + `;const b=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)],R=Math.ceil(u[u.length-1]/2),q=R*Math.ceil(u[u.length-2]/2);let re=q,fe="",he="b, r, c";for(let be=2;be=1?Pe="coords = 0;":Pe=fe.map(Re=>`coords.${je[Re+be]} = 0;`).join(` +`);let We="";re<2&&q>0?We="coords":We=u.shapeInfo.logicalShape.map((Re,Lr)=>`coords.${je[Lr+be]}`).join(", ");let ft="return outputValue;";const zt=xo(u.shapeInfo.logicalShape)===1,jt=xo(e.logicalShape)===1;if(q===1&&!zt&&!jt)ft=` + return vec4(outputValue.xy, outputValue.xy); + `;else if(zt&&!jt)re===1?ft=` + return vec4(outputValue.x, outputValue.x, 0., 0.); + `:ft=` + return vec4(outputValue.x); + `;else if(fe.length){const Re=q-2,Lr=q-1;fe.indexOf(Re)>-1&&fe.indexOf(Lr)>-1?ft="return vec4(outputValue.x);":fe.indexOf(Re)>-1?ft="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":fe.indexOf(Lr)>-1&&(ft="return vec4(outputValue.xx, outputValue.zz);")}return` + vec4 ${R}() { + ${he} coords = getOutputCoords(); + ${Pe} + vec4 outputValue = get${b}(${We}); + ${ft} + } + `}function qye(u,e){const n=u.name,b=n.charAt(0).toUpperCase()+n.slice(1),R="get"+b+"AtOutCoords",q=e.texShape,re=u.shapeInfo.texShape,fe=u.shapeInfo.logicalShape.length,he=e.logicalShape.length;if(!u.shapeInfo.isUniform&&fe===he&&u.shapeInfo.flatOffset==null&&$f(re,q))return` + float ${R}() { + return sampleTexture(${n}, resultUV); + } + `;const be=Th(he),Pe=oH(u.shapeInfo.logicalShape,e.logicalShape),je=he-fe;let We;const ft=["x","y","z","w","u","v"];fe===0?We="":he<2&&Pe.length>=1?We="coords = 0;":We=Pe.map(zt=>`coords.${ft[zt+je]} = 0;`).join(` +`);let xt="";return he<2&&fe>0?xt="coords":xt=u.shapeInfo.logicalShape.map((zt,Ft)=>`coords.${ft[Ft+je]}`).join(", "),` + float ${R}() { + ${be} coords = getOutputCoords(); + ${We} + return get${b}(${xt}); + } + `}function Th(u){if(u<=1)return"int";if(u===2)return"ivec2";if(u===3)return"ivec3";if(u===4)return"ivec4";if(u===5)return"ivec5";if(u===6)return"ivec6";throw Error(`GPU for rank ${u} is not yet supported`)}function RO(u,e,n){const{newShape:b,keptDims:R}=mb(e),q=e.length,re=u&&q===3&&e[0]===1,fe=re?e.slice(1):b,he=!u&&q>1&&!$f(e,n)&&b.lengthu[n]).join(", ")}function Hye(u,e,n,b){const R=n.map((Pe,je)=>{const We={logicalShape:Pe.shape,texShape:Pe.isUniform?null:Pe.texData.texShape,isUniform:Pe.isUniform,isPacked:Pe.isUniform?!1:Pe.texData.isPacked,flatOffset:null};return Pe.texData!=null&&Pe.texData.slice!=null&&Pe.texData.slice.flatOffset>0&&(We.flatOffset=Pe.texData.slice.flatOffset),{name:e.variableNames[je],shapeInfo:We}}),q=R.map(Pe=>Pe.shapeInfo),re={logicalShape:b.shape,texShape:b.texData.texShape,isUniform:!1,isPacked:b.texData.isPacked,flatOffset:null},fe=cye(R,re,e),he=B0e(u.gl,fe),be=u.createProgram(he);return co().get("ENGINE_COMPILE_ONLY")?{program:e,fragmentShader:he,source:fe,webGLProgram:be,inShapeInfos:q,outShapeInfo:re,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(u.buildVao(be),Object.assign({program:e,fragmentShader:he,source:fe,webGLProgram:be,inShapeInfos:q,outShapeInfo:re},uH(u,e,be)))}function uH(u,e,n){const b=[],R=[];let q,re,fe,he=null,be=null;be=u.getUniformLocation(n,"NAN",!1),co().getNumber("WEBGL_VERSION")===1&&(he=u.getUniformLocation(n,"INFINITY",!1));const Pe=!1;for(const je of e.variableNames){const We={name:je,uniform:u.getUniformLocation(n,je,Pe),offset:u.getUniformLocation(n,`offset${je}`,Pe)};e.enableShapeUniforms&&(We.shape=u.getUniformLocation(n,`${je}Shape`,Pe),We.texShape=u.getUniformLocation(n,`${je}TexShape`,Pe)),b.push(We)}if(e.enableShapeUniforms&&(q=u.getUniformLocation(n,"outShape",Pe),fe=u.getUniformLocation(n,"outShapeStrides",Pe),re=u.getUniformLocation(n,"outTexShape",Pe)),e.customUniforms)for(const je of e.customUniforms)R.push(u.getUniformLocation(n,je.name,Pe));return{variablesLocations:b,customUniformLocations:R,infLoc:he,nanLoc:be,outShapeLocation:q,outShapeStridesLocation:fe,outTexShapeLocation:re}}function $B(u,e){if(u.length!==e.length)throw Error(`Binary was compiled with ${u.length} inputs, but was executed with ${e.length} inputs`);u.forEach((n,b)=>{const R=n.logicalShape,q=e[b],re=q.shape;if(!$f(R,re))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${R} and ${re} must match`);if(n.isUniform&&q.isUniform)return;const fe=n.texShape,he=q.isUniform?null:q.texData.texShape;if(!$f(fe,he))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${fe} and ${he} must match`)})}function Wye(u,e,n,b,R){e.program.enableShapeUniforms||($B(e.inShapeInfos,n),$B([e.outShapeInfo],[b]));const q=b.texData.texture,re=b.texData.texShape;b.texData.isPacked?u.setOutputPackedMatrixTexture(q.texture,re[0],re[1]):u.setOutputMatrixTexture(q.texture,re[0],re[1]),u.setProgram(e.webGLProgram),u.bindVertexArray(e.webGLProgram.vao),co().getNumber("WEBGL_VERSION")===1&&e.infLoc!==null&&u.gl.uniform1f(e.infLoc,1/0),e.nanLoc!==null&&u.gl.uniform1f(e.nanLoc,NaN);for(let he=0;he{const fe=re.texData!=null&&re.texData.slice!=null&&re.texData.slice.flatOffset>0;if(u.enableShapeUniforms&&!re.isUniform){const he=re.texData.texShape,{useSqueezeShape:be,uniformShape:Pe,keptDims:je}=RO(u.packedInputs,re.shape,he);let We="",ft="",xt="";if(Pe.length===1&&u.packedInputs){const Gr=[Math.ceil(he[0]/2),Math.ceil(he[1]/2)];We=`${Gr[0]>1}_${Gr[1]>1}`}else if(Pe.length===2&&!u.packedInputs)ft=`${Pe[0]>1}_${Pe[1]>1}`;else if(Pe.length>2&&!u.packedInputs){const Gr=Zl(Pe);xt=`${Gr[0]===he[1]}_${Gr[Gr.length-1]===he[1]}`}const zt=re.shape.length,Ft=Pe.length===2&&$f(re.shape,he),jt=xo(re.shape)===1,Re=IA(re.shape,n.shape),Lr=!u.packedInputs&&zt===n.shape.length&&$f(he,n.texData.texShape),Cr=u.packedInputs||Pe.length>2?"":`${he[0]>1}_${he[1]>1}`;b+=`${zt}_${Lr}_${be?je:""}_${Pe.length}_${jt}_${Re}_${Ft}_${We}_${ft}_${xt}_${Cr}_${fe}`}else{const he=re.isUniform?"uniform":re.texData.texShape;b+=`${re.shape}_${he}_${fe}`}});const R=u.userCode;let q=u.constructor.name;return q+="_"+b+"_"+R+`${co().getNumber("WEBGL_VERSION")}`,q}function Uv(u){return co().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&u<=4}class Yye{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=lC.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const n=ym();this.outputShape=e,this.enableShapeUniforms=Uv(this.outputShape.length),this.userCode=` + ivec3 outCoordsFromFlatIndex(int index) { + ${this.enableShapeUniforms?gD(["r","c","d"],e):F2(["r","c","d"],e)} + return ivec3(r, c, d); + } + + void main() { + ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1])); + int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y); + + vec4 result = vec4(0.); + + for (int i=0; i<4; i++) { + int flatIndex = index + i; + ivec3 rc = outCoordsFromFlatIndex(flatIndex); + result[i] = getA(rc.x, rc.y, rc.z); + } + + ${n.output} = result; + } + `}}class Zye{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=lC.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const n=ym();this.outputShape=e,this.enableShapeUniforms=Uv(this.outputShape.length),this.userCode=` + ivec3 outCoordsFromFlatIndex(int index) { + ${this.enableShapeUniforms?gD(["r","c","d"],e):F2(["r","c","d"],e)} + return ivec3(r, c, d); + } + + void main() { + ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1])); + int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y); + + vec4 result = vec4(0.); + + for (int i=0; i<4; i++) { + int flatIndex = index + i; + ivec3 rc = outCoordsFromFlatIndex(flatIndex); + result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z)); + } + + ${n.output} = result; + } + `}}class Kye{constructor(e){this.variableNames=["A"],this.outTexUsage=Fg.DOWNLOAD;const n=ym();this.outputShape=e,this.userCode=` + ${iH} + + void main() { + float x = getAAtOutCoords(); + ${n.output} = encode_float(x); + } + `}}class Jye{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=Fg.DOWNLOAD;const n=ym();this.outputShape=e,this.userCode=` + ${iH} + + void main() { + ivec3 coords = getOutputCoords(); + float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z)); + ${n.output} = encode_float(x); + } + `}}const Qye={R:0,G:1,B:2,A:3};class VB{constructor(e,n=!1,b="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const R=ym();this.outputShape=e,this.enableShapeUniforms=Uv(this.outputShape.length);let q="result";n&&(q="floor(result * 255. + 0.5)");let re="";for(let fe=0;feu.bindTexture(fe,re)),Js(u,()=>u.texParameteri(fe,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE)),Js(u,()=>u.texParameteri(fe,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE)),Js(u,()=>u.texParameteri(fe,u.TEXTURE_MIN_FILTER,u.NEAREST)),Js(u,()=>u.texParameteri(fe,u.TEXTURE_MAG_FILTER,u.NEAREST)),co().getNumber("WEBGL_VERSION")===1?Js(u,()=>u.texImage2D(fe,0,b,e,n,0,R,q,null)):Js(u,()=>u.texStorage2D(fe,1,b,e,n)),Js(u,()=>u.bindTexture(u.TEXTURE_2D,null)),{texture:re,texShape:[n,e]}}function cH(u){return u.internalFormatFloat}function a1e(u,e,n,b){const[R,q]=Ak(e,n);return Ek(u,R,q,cH(b),b.textureFormatFloat,u.FLOAT)}function fH(u){return u.internalFormatHalfFloat}function i1e(u,e,n,b){const[R,q]=Ak(e,n);return Ek(u,R,q,fH(b),b.textureFormatFloat,b.textureTypeHalfFloat)}function hH(u){return u.downloadTextureFormat}function o1e(u,e,n,b){const[R,q]=Ak(e,n);return Ek(u,R,q,hH(b),u.RGBA,u.UNSIGNED_BYTE)}function dH(u){return u.internalFormatPackedFloat}function s1e(u,e,n,b){const[R,q]=WA(e,n);return Ek(u,R,q,dH(b),u.RGBA,u.FLOAT)}function pH(u){return u.internalFormatPackedHalfFloat}function l1e(u,e,n,b){const[R,q]=WA(e,n);return Ek(u,R,q,pH(b),u.RGBA,b.textureTypeHalfFloat)}function u1e(u,e,n){return Js(u,()=>u.bindBuffer(u.ARRAY_BUFFER,n)),FB(u,e,"clipSpacePos",n,3,20,0)&&FB(u,e,"uv",n,2,20,12)}function c1e(u,e,n,b,R,q){Js(u,()=>u.bindTexture(u.TEXTURE_2D,e));let re,fe,he;R instanceof Uint8Array?(re=new Uint8Array(n*b*4),fe=u.UNSIGNED_BYTE,he=u.RGBA):(re=new Float32Array(n*b*4),fe=u.FLOAT,he=q.internalFormatPackedFloat),re.set(R),co().getNumber("WEBGL_VERSION")===2?Js(u,()=>u.texSubImage2D(u.TEXTURE_2D,0,0,0,n,b,u.RGBA,fe,re)):Js(u,()=>u.texImage2D(u.TEXTURE_2D,0,he,n,b,0,u.RGBA,fe,re)),Js(u,()=>u.bindTexture(u.TEXTURE_2D,null))}function f1e(u,e,n){Js(u,()=>u.bindTexture(u.TEXTURE_2D,e)),n.data instanceof Uint8Array?co().getNumber("WEBGL_VERSION")===2?Js(u,()=>u.texSubImage2D(u.TEXTURE_2D,0,0,0,n.width,n.height,u.RGBA,u.UNSIGNED_BYTE,n.data)):Js(u,()=>u.texImage2D(u.TEXTURE_2D,0,u.RGBA,n.width,n.height,0,u.RGBA,u.UNSIGNED_BYTE,n.data)):co().getNumber("WEBGL_VERSION")===2?Js(u,()=>u.texSubImage2D(u.TEXTURE_2D,0,0,0,u.RGBA,u.UNSIGNED_BYTE,n)):Js(u,()=>u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,n)),Js(u,()=>u.bindTexture(u.TEXTURE_2D,null))}function h1e(u,e,n,b){const R=u.createBuffer();Js(u,()=>u.bindBuffer(u.PIXEL_PACK_BUFFER,R));const fe=4*4*e*n;return Js(u,()=>u.bufferData(u.PIXEL_PACK_BUFFER,fe,u.STREAM_READ)),Js(u,()=>u.readPixels(0,0,n,e,u.RGBA,u.FLOAT,0)),Js(u,()=>u.bindBuffer(u.PIXEL_PACK_BUFFER,null)),R}function d1e(u,e,n){const b=u,R=new Float32Array(n);return b.bindBuffer(b.PIXEL_PACK_BUFFER,e),b.getBufferSubData(b.PIXEL_PACK_BUFFER,0,R),b.bindBuffer(b.PIXEL_PACK_BUFFER,null),R}function p1e(u,e,n,b){const[R,q]=Ak(e,n),re=4,fe=new Uint8Array(L0e(e*n,re));return Js(u,()=>u.readPixels(0,0,R,q,b.downloadTextureFormat,u.UNSIGNED_BYTE,fe)),new Float32Array(fe.buffer)}function v1e(u,e,n,b,R,q,re,fe){const he=u,be=new Float32Array(R0e(q,re));return he.bindBuffer(he.PIXEL_PACK_BUFFER,e),he.getBufferSubData(he.PIXEL_PACK_BUFFER,0,be),he.bindBuffer(he.PIXEL_PACK_BUFFER,null),be}function m1e(u,e,n){const b=new Float32Array(e*n*4);return Js(u,()=>u.readPixels(0,0,n,e,u.RGBA,u.FLOAT,b)),b}class pz{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];const n=co().getNumber("WEBGL_VERSION");if(e!=null?(this.gl=e,k0e(n,e)):this.gl=uy(n),e=this.gl,co().getNumber("WEBGL_VERSION")===2){const q=e;this.createVertexArray=()=>Js(q,()=>q.createVertexArray()),this.bindVertexArray=re=>Js(q,()=>q.bindVertexArray(re)),this.deleteVertexArray=re=>Js(q,()=>q.deleteVertexArray(re)),this.getVertexArray=()=>Js(q,()=>q.getParameter(q.VERTEX_ARRAY_BINDING))}else if(e!=null){const q=e.getExtension("OES_vertex_array_object");if(q==null)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>Js(e,()=>q.createVertexArrayOES()),this.bindVertexArray=re=>Js(e,()=>q.bindVertexArrayOES(re)),this.deleteVertexArray=re=>Js(e,()=>q.deleteVertexArrayOES(re)),this.getVertexArray=()=>Js(e,()=>e.getParameter(q.VERTEX_ARRAY_BINDING_OES))}let b="WEBGL_color_buffer_float";const R="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),co().getNumber("WEBGL_VERSION")===1){const q="OES_texture_float",re="OES_texture_half_float";if(this.textureFloatExtension=eL(this.gl,q),g0(this.gl,re))this.textureHalfFloatExtension=eL(this.gl,re);else if(co().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(b),g0(this.gl,R))this.colorBufferHalfFloatExtension=eL(this.gl,R);else if(co().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(b="EXT_color_buffer_float",g0(this.gl,b))this.colorBufferFloatExtension=this.gl.getExtension(b);else if(g0(this.gl,R))this.colorBufferHalfFloatExtension=this.gl.getExtension(R);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=r1e(this.gl),this.indexBuffer=n1e(this.gl),this.framebuffer=W0e(this.gl),this.textureConfig=MO(this.gl,this.textureHalfFloatExtension)}get debug(){return co().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program!=null&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),this.outputTexture!=null&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");const e=this.gl;Js(e,()=>e.finish()),Js(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),Js(e,()=>e.deleteFramebuffer(this.framebuffer)),Js(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),Js(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),Js(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,n){return this.throwIfDisposed(),a1e(this.gl,e,n,this.textureConfig)}createFloat16MatrixTexture(e,n){return this.throwIfDisposed(),i1e(this.gl,e,n,this.textureConfig)}createUnsignedBytesMatrixTexture(e,n){return this.throwIfDisposed(),o1e(this.gl,e,n,this.textureConfig)}uploadPixelDataToTexture(e,n){this.throwIfDisposed(),f1e(this.gl,e,n)}uploadDenseMatrixToTexture(e,n,b,R){this.throwIfDisposed(),c1e(this.gl,e,n,b,R,this.textureConfig)}createFloat16PackedMatrixTexture(e,n){return this.throwIfDisposed(),l1e(this.gl,e,n,this.textureConfig)}createPackedMatrixTexture(e,n){return this.throwIfDisposed(),s1e(this.gl,e,n,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(BB(this.gl,this.framebuffer),this.outputTexture=null),Js(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,n,b){return this.downloadMatrixDriver(e,()=>p1e(this.gl,n,b,this.textureConfig))}downloadPackedMatrixFromBuffer(e,n,b,R,q,re){return v1e(this.gl,e,n,b,R,q,re,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,n){return d1e(this.gl,e,n)}createBufferFromTexture(e,n,b){this.bindTextureToFrameBuffer(e);const R=h1e(this.gl,n,b,this.textureConfig);return this.unbindTextureToFrameBuffer(),R}createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let n,b;if(co().getBool("WEBGL_FENCE_API_ENABLED")){const R=e,q=R.fenceSync(R.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),b=()=>{const re=R.clientWaitSync(q,0,0);return re===R.ALREADY_SIGNALED||re===R.CONDITION_SATISFIED},n=q}else co().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(n=this.beginQuery(),this.endQuery(),b=()=>this.isQueryAvailable(n,co().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):b=()=>!0;return{query:n,isFencePassed:b}}downloadMatrixFromPackedTexture(e,n,b){return this.downloadMatrixDriver(e,()=>m1e(this.gl,n,b))}createProgram(e){this.throwIfDisposed();const n=this.gl;this.vertexShader==null&&(this.vertexShader=t1e(n));const b=$0e(n);Js(n,()=>n.attachShader(b,this.vertexShader)),Js(n,()=>n.attachShader(b,e)),V0e(n,b);const R=Object.assign(b,{vao:this.createVertexArray()});return this.debug&&cz(n,R),R}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);const n=this.gl;Js(n,()=>n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),u1e(n,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&(Js(this.gl,()=>this.gl.deleteProgram(e)),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&cz(this.gl,this.program),Js(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,n,b=!0){return this.throwIfDisposed(),b?Y0e(this.gl,e,n):Z0e(this.gl,e,n)}getAttributeLocation(e,n){return this.throwIfDisposed(),Js(this.gl,()=>this.gl.getAttribLocation(e,n))}getUniformLocationNoThrow(e,n){return this.throwIfDisposed(),this.gl.getUniformLocation(e,n)}setInputMatrixTexture(e,n,b){this.throwIfDisposed(),this.throwIfNoProgram(),K0e(this.gl,e,n,b)}setOutputMatrixTexture(e,n,b){this.setOutputMatrixTextureDriver(e,b,n)}setOutputPackedMatrixTexture(e,n,b){this.throwIfDisposed();const[R,q]=WA(n,b);this.setOutputMatrixTextureDriver(e,R,q)}setOutputMatrixWriteRegion(e,n,b,R){this.setOutputMatrixWriteRegionDriver(b,e,R,n)}setOutputPackedMatrixWriteRegion(e,n,b,R){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&cz(this.gl,this.program),tL(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;if(this.debug){const n=this.getVertexArray();console.assert(n===this.program.vao,"VAO changed between setProgram and executeProgram!"),this.debugValidate()}Js(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),Js(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=eL(this.gl,co().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(co().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){const b=this.gl,R=this.getQueryTimerExtensionWebGL2(),q=b.createQuery();return b.beginQuery(R.TIME_ELAPSED_EXT,q),q}const e=this.getQueryTimerExtensionWebGL1(),n=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,n),n}endQuery(){if(co().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){const n=this.gl,b=this.getQueryTimerExtensionWebGL2();n.endQuery(b.TIME_ELAPSED_EXT);return}const e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await A9(()=>this.disposed||this.isQueryAvailable(e,co().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,co().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,n){if(n===0)return null;if(n===2){const b=this.gl;return b.getQueryParameter(e,b.QUERY_RESULT)/1e6}else{const b=this.getQueryTimerExtensionWebGL1();return b.getQueryObjectEXT(e,b.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,n){if(n===0)return!0;if(n===2){const b=this.gl,R=this.getQueryTimerExtensionWebGL2(),q=b.getQueryParameter(e,b.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(R.GPU_DISJOINT_EXT)),q&&!this.disjoint}else{const b=this.getQueryTimerExtensionWebGL1(),R=b.getQueryObjectEXT(e,b.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(b.GPU_DISJOINT_EXT)),R&&!this.disjoint}}pollFence(e){return new Promise(n=>{this.addItemToPoll(()=>e.isFencePassed(),()=>n())})}pollItems(){const e=g1e(this.itemsToPoll.map(n=>n.isDoneFn));for(let n=0;n<=e;++n){const{resolveFn:b}=this.itemsToPoll[n];b()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,n){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:n}),this.itemsToPoll.length>1)return;let b;"setTimeoutCustom"in co().platform&&(b=co().platform.setTimeoutCustom.bind(co().platform)),A9(()=>(this.pollItems(),this.itemsToPoll.length===0),()=>0,null,b)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),fz(this.gl,e,this.framebuffer),this.debug&&tL(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(fz(this.gl,this.outputTexture,this.framebuffer),this.debug&&tL(this.gl)):BB(this.gl,this.framebuffer)}downloadMatrixDriver(e,n){this.bindTextureToFrameBuffer(e);const b=n();return this.unbindTextureToFrameBuffer(),b}setOutputMatrixTextureDriver(e,n,b){this.throwIfDisposed();const R=this.gl;fz(R,e,this.framebuffer),this.debug&&tL(R),this.outputTexture=e,Js(R,()=>R.viewport(0,0,n,b)),Js(R,()=>R.scissor(0,0,n,b))}setOutputMatrixWriteRegionDriver(e,n,b,R){this.throwIfDisposed(),Js(this.gl,()=>this.gl.scissor(e,n,b,R))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(this.program==null)throw new Error("No GPU program is currently set.")}}function g1e(u){let e=0;for(;e`${u}.${n}`)}function vm(u,e){return e===1?[u]:yH(u,e)}function u_e(u,e){if(u===1)return"rc";let n="";for(let b=0;b ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let n="";for(let b=this.rank-2;b= ${this.enableShapeUniforms?`outShape[${b}]`:this.outputShape[b]}`,b= ${b}; + bool rEdge = rp1 >= ${R}; + `}getOutput(e){const n=this.getSourceCoordsArr(e);return this.rank===1?`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`:`getA(${n[0]}), + cEdge ? 0. : getA(${n[1]}), + rEdge ? 0. : getA(${n[2]}), + rEdge || cEdge ? 0. : getA(${n[3]})`}}class _H{constructor(e,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=Uv(this.outputShape.length);let b="";for(let R=0;R<4;R++){let q="thisRC = rc;";R%2===1&&(q+="thisRC.z += 1;"),R>1&&(q+="thisRC.y += 1;"),b+=` + ${q} + ${R>0?"if(thisRC.y < rows && thisRC.z < cols){":""} + int flatIndex = getFlatIndex(thisRC); + + ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex); + vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z)); + + result[${R}] = + getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims); + ${R>0?"}":""} + `}this.userCode=` + ${f_e(n,this.enableShapeUniforms)} + ${this.enableShapeUniforms?LO():IO(e)} + + void main() { + ivec3 rc = getOutputCoords(); + + vec4 result = vec4(0.); + + ivec3 thisRC; + int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]}; + int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]}; + + ${b} + + setOutput(result); + } + `}}function f_e(u,e){return` + ivec3 inputCoordsFromReshapedOutCoords(int index) { + ${e?uye(["r","c","d"],"inputShape"):F2(["r","c","d"],u)} + return ivec3(r, c, d); + } + `}class h_e{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,n,b){const R=GB(n,b),q=qB(e,R,b);q in this.freeTextures||(this.freeTextures[q]=[]),q in this.usedTextures||(this.usedTextures[q]=[]);const re=jB(e,R,this.gpgpu.gl,this.gpgpu.textureConfig,b);if(this.freeTextures[q].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=re,this.log();const he=this.freeTextures[q].pop();return this.usedTextures[q].push(he),he}let fe;return R===Av.PACKED_2X2_FLOAT32?fe=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):R===Av.PACKED_2X2_FLOAT16?fe=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):R===Av.UNPACKED_FLOAT32?fe=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):R===Av.UNPACKED_FLOAT16?fe=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):R===Av.PACKED_4X1_UNSIGNED_BYTE&&(fe=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[q].push(fe),this.numUsedTextures++,this._numBytesAllocated+=re,this.log(),fe}releaseTexture(e,n,b,R){if(this.freeTextures==null)return;const q=GB(b,R),re=qB(n,q,R);re in this.freeTextures||(this.freeTextures[re]=[]);const fe=jB(n,q,this.gpgpu.gl,this.gpgpu.textureConfig,R),he=co().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");he!==-1&&this._numBytesAllocated>he?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=fe):(this.freeTextures[re].push(e),this.numFreeTextures++,this._numBytesFree+=fe),this.numUsedTextures--;const be=this.usedTextures[re],Pe=be&&be.indexOf(e);if(Pe==null||Pe<0)throw new Error("Cannot release a texture that was never provided by this texture manager");be[Pe]=be[be.length-1],be.pop(),this.log()}log(){if(!this.logEnabled)return;const e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);const n=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*n)}%)`)}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(this.freeTextures!=null){for(const e in this.freeTextures)this.freeTextures[e].forEach(n=>{this.gpgpu.deleteMatrixTexture(n.texture)});for(const e in this.usedTextures)this.usedTextures[e].forEach(n=>{this.gpgpu.deleteMatrixTexture(n.texture)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}function d_e(u,e){const n=u;if(e===n.R32F)return 4;if(e===n.R16F)return 2;if(e===n.RGBA32F)return 16;if(e===u.RGBA)return 16;if(e===n.RGBA16F)return 8;if(e===n.RGBA8)return 4;throw new Error(`Unknown internal format ${e}`)}function jB(u,e,n,b,R){const q=p_e(e,b);let re;if(R){const[he,be]=WA(u[0],u[1]);re=he*be}else{const[he,be]=Ak(u[0],u[1]);re=he*be}const fe=d_e(n,q);return re*fe}function p_e(u,e){switch(u){case Av.PACKED_2X2_FLOAT32:return dH(e);case Av.PACKED_2X2_FLOAT16:return pH(e);case Av.UNPACKED_FLOAT32:return cH(e);case Av.UNPACKED_FLOAT16:return fH(e);case Av.PACKED_4X1_UNSIGNED_BYTE:return hH(e);default:throw new Error(`Unknown physical texture type ${u}`)}}function v_e(u){return co().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?u?Av.PACKED_2X2_FLOAT32:Av.UNPACKED_FLOAT32:u?Av.PACKED_2X2_FLOAT16:Av.UNPACKED_FLOAT16}function GB(u,e){if(u===Fg.UPLOAD)return Av.PACKED_2X2_FLOAT32;if(u===Fg.RENDER||u==null)return v_e(e);if(u===Fg.DOWNLOAD||u===Fg.PIXELS)return Av.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${u}`)}function qB(u,e,n){return`${u[0]}_${u[1]}_${e}_${n}`}class u1{constructor(e,n){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=Uv(this.outputShape.length),this.userCode=` + float unaryOperation(float x) { + ${n} + } + + void main() { + float x = getAAtOutCoords(); + float y = unaryOperation(x); + + setOutput(y); + } + `}}const A0="if (isnan(x)) return x;",m_e="return x;",HB="return abs(x);",g_e="return (x >= 0.0) ? x : (exp(x) - 1.0);",y_e=A0+` + return (x < 0.0) ? 0.0 : x; +`,__e=A0+` + return (x < 0.0) ? 0.0 : min(6.0, x); +`,eb="return x;",x_e="return 1.0 / (1.0 + exp(-1.0 * x));";const b_e="return x;",w_e=` + vec4 result; + + result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); + result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0); + result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0); + result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); + + return result; +`,T_e=` + vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); + bvec4 isNaN = isnan(x); + + result.r = isNaN.r ? x.r : result.r; + result.g = isNaN.g ? x.g : result.g; + result.b = isNaN.b ? x.b : result.b; + result.a = isNaN.a ? x.a : result.a; + + return result; +`,A_e=` + vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); + bvec4 isNaN = isnan(x); + + result.r = isNaN.r ? x.r : result.r; + result.g = isNaN.g ? x.g : result.g; + result.b = isNaN.b ? x.b : result.b; + result.a = isNaN.a ? x.a : result.a; + + return result; +`,S_e="return 1.0 / (1.0 + exp(-1.0 * x));";class ab{constructor(e,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=Uv(this.outputShape.length),this.userCode=` + vec4 unaryOperation(vec4 x) { + ${n} + } + + void main() { + vec4 x = getAAtOutCoords(); + vec4 y = unaryOperation(x); + + setOutput(y); + } + `}}class E_e{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=Uv(this.outputShape.length);const n=e.length,b=vm("rc",n),R=Th(n),q=u_e(n,b),re=b.slice(-2),fe=n<=1?"rc":`vec2(${re.join(",")})`;this.userCode=` + void main() { + ${R} rc = getOutputCoords(); + vec4 packedInput = getA(${q}); + + setOutput(getChannel(packedInput, ${fe})); + } + `}}const C_e=X$,k_e=1e-7,M_e=1e-4,aL={};function I_e(u){return u in aL||(aL[u]={}),aL[u]}const L_e=co().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"),R_e=600;function D_e(){return co().global.screen==null?1024:co().global.screen.height*co().global.screen.width*window.devicePixelRatio*R_e/1024/1024}class yD extends o8{nextDataId(){return yD.nextDataId++}constructor(e){if(super(),this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!co().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");let n;if(e!=null){if(e instanceof pz)n=e;else{const b=uy(co().getNumber("WEBGL_VERSION"),e);n=new pz(b)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{const b=uy(co().getNumber("WEBGL_VERSION"));n=new pz(b),this.binaryCache=I_e(co().getNumber("WEBGL_VERSION")),this.gpgpuCreatedLocally=!0}this.gpgpu=n,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new h_e(this.gpgpu),this.numMBBeforeWarning=D_e(),this.texData=new _U(this,a1())}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}writeTexture(e,n,b,R,q,re){const fe=this.makeTensorInfo(n,b),he=this.texData.get(fe.dataId);he.isPacked=!1,he.texture={texture:e,texShape:[R,q]},he.texShape=[R,q];const be=rL(n),Pe=new VB(be,!1,re),je=this.runWebGLProgram(Pe,[fe],b,[[R,q]]);return je.shape=n,he.texture=null,this.disposeIntermediateTensorInfo(fe),je.dataId}write(e,n,b){if((co().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||co().getBool("DEBUG"))&&this.checkNumericalProblems(e),b==="complex64"&&e!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");const R={id:this.nextDataId()};return this.texData.set(R,{shape:n,dtype:b,values:e,usage:Fg.UPLOAD,refCount:1}),R}refCount(e){return this.texData.has(e)?this.texData.get(e).refCount:0}incRef(e){const n=this.texData.get(e);n.refCount++}decRef(e){if(this.texData.has(e)){const n=this.texData.get(e);n.refCount--}}move(e,n,b,R,q){if(co().getBool("DEBUG")&&this.checkNumericalProblems(n),R==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:b,dtype:R,values:n,usage:Fg.UPLOAD,refCount:q})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){const n=this.texData.get(e),{values:b,dtype:R,complexTensorInfos:q,slice:re,shape:fe,isPacked:he}=n;if(re!=null){let We;he?We=new ab(fe,eb):We=new u1(fe,eb);const ft=this.runWebGLProgram(We,[{dataId:e,shape:fe,dtype:R}],R),xt=this.readSync(ft.dataId);return this.disposeIntermediateTensorInfo(ft),xt}if(b!=null)return this.convertAndCacheOnCPU(e);if(R==="string")return b;const be=this.activeTimers!=null;let Pe;be&&(Pe=Pm());let je;if(R==="complex64"){const We=this.readSync(q.real.dataId),ft=this.readSync(q.imag.dataId);je=w_(We,ft)}else je=this.getValuesFromTexture(e);return be&&(this.downloadWaitMs+=Pm()-Pe),this.convertAndCacheOnCPU(e,je)}async read(e){if(this.pendingRead.has(e)){const xt=this.pendingRead.get(e);return new Promise(zt=>xt.push(zt))}const n=this.texData.get(e),{values:b,shape:R,slice:q,dtype:re,complexTensorInfos:fe,isPacked:he}=n;if(q!=null){let xt;he?xt=new ab(R,eb):xt=new u1(R,eb);const zt=this.runWebGLProgram(xt,[{dataId:e,shape:R,dtype:re}],re),Ft=this.read(zt.dataId);return this.disposeIntermediateTensorInfo(zt),Ft}if(b!=null)return this.convertAndCacheOnCPU(e);if(co().getBool("DEBUG")&&!co().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&co().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let be=null,Pe;if(re!=="complex64"&&co().get("WEBGL_BUFFER_SUPPORTED")){Pe=this.decode(e);const xt=this.texData.get(Pe.dataId);be=this.gpgpu.createBufferFromTexture(xt.texture.texture,...Q6(R))}this.pendingRead.set(e,[]),re!=="complex64"&&await this.gpgpu.createAndWaitForFence();let je;if(re==="complex64"){const xt=await Promise.all([this.read(fe.real.dataId),this.read(fe.imag.dataId)]),zt=xt[0],Ft=xt[1];je=w_(zt,Ft)}else if(be==null)je=this.getValuesFromTexture(e);else{const xt=xo(R);je=this.gpgpu.downloadFloat32MatrixFromBuffer(be,xt)}if(Pe!=null&&this.disposeIntermediateTensorInfo(Pe),be!=null){const xt=this.gpgpu.gl;Js(xt,()=>xt.deleteBuffer(be))}const We=this.convertAndCacheOnCPU(e,je),ft=this.pendingRead.get(e);return this.pendingRead.delete(e),ft.forEach(xt=>xt(We)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&a1().removeDataId(e,this),this.pendingDeletes--),We}readToGPU(e,n={}){const b=this.texData.get(e),{values:R,shape:q,slice:re,dtype:fe,isPacked:he,texture:be}=b;if(fe==="complex64")throw new Error("Does not support reading texture for complex64 dtype.");if(re!=null){let ft;he?ft=new ab(q,eb):ft=new u1(q,eb);const xt=this.runWebGLProgram(ft,[{dataId:e,shape:q,dtype:fe}],fe),zt=this.readToGPU(xt,n);return this.disposeIntermediateTensorInfo(xt),zt}if(be==null)throw R!=null?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");const Pe=this.decode(e,n.customTexShape),je=a1().makeTensorFromTensorInfo(Pe),We=this.texData.get(Pe.dataId);return Object.assign({tensorRef:je},We.texture)}bufferSync(e){const n=this.readSync(e.dataId);if(e.dtype==="string")try{const b=n.map(R=>cb(R));return Tc(e.shape,e.dtype,b)}catch{throw new Error("Failed to decode encoded string bytes into utf-8")}return Tc(e.shape,e.dtype,n)}checkNumericalProblems(e){if(e!=null)for(let n=0;n0}time(e){const n=this.activeTimers,b=[];let R=!1;this.programTimersStack==null?(this.programTimersStack=b,R=!0):this.activeTimers.push(b),this.activeTimers=b,e();const q=_2(this.activeTimers.map(he=>he.query)).filter(he=>he!=null),re=_2(this.activeTimers.map(he=>he.name)).filter(he=>he!=null);this.activeTimers=n,R&&(this.programTimersStack=null);const fe={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(co().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const he=await Promise.all(q);fe.kernelMs=ate(he),fe.getExtraProfileInfo=()=>he.map((be,Pe)=>({name:re[Pe],ms:be})).map(be=>`${be.name}: ${be.ms}`).join(", ")}else fe.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,fe})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return co().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:Pm(),endMs:null}}endTimer(e){return co().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=Pm(),e)}async getQueryTime(e){if(co().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);const n=e;return n.endMs-n.startMs}disposeData(e,n=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(n?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!n&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);const{complexTensorInfos:b}=this.texData.get(e);return b!=null&&(this.disposeData(b.real.dataId,n),this.disposeData(b.imag.dataId,n)),this.texData.delete(e),!0}releaseGPUData(e){const{texture:n,dtype:b,texShape:R,usage:q,isPacked:re,slice:fe}=this.texData.get(e),he=fe&&fe.origDataId||e,be=this.dataRefCount.get(he);be>1?this.dataRefCount.set(he,be-1):(this.dataRefCount.delete(he),n!=null&&(this.numBytesInGPU-=this.computeBytes(R,b),this.textureManager.releaseTexture(n,R,q,re)));const Pe=this.texData.get(e);Pe.texture=null,Pe.texShape=null,Pe.isPacked=!1,Pe.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,n=L_e){return co().getBool("WEBGL_CPU_FORWARD")&&e.every(b=>this.texData.get(b.dataId).texture==null&&xo(b.shape)0&&hC(b[0])){const q=b.map(re=>ob(re));R=this.write(q,e,n)}else R=this.write(b,e,n);return this.texData.get(R).usage=null,{dataId:R,shape:e,dtype:n}}makeOutput(e,n,b){return a1().makeTensorFromTensorInfo(this.makeTensorInfo(e,n,b),this)}unpackTensor(e){const n=new E_e(e.shape);return this.runWebGLProgram(n,[e],e.dtype)}packTensor(e){const n=new c_e(e.shape);return this.runWebGLProgram(n,[e],e.dtype,null,!0)}packedReshape(e,n){const b=[NA(e.shape),...OA(e.shape)],R={dtype:e.dtype,shape:b,dataId:e.dataId},q=[NA(n),...OA(n)],re=new _H(q,b),fe=!0,he=[b],be=this.runWebGLProgram(re,[R],e.dtype,he,fe);return{dataId:be.dataId,shape:n,dtype:be.dtype}}decode(e,n){const b=this.texData.get(e),{isPacked:R,shape:q,dtype:re}=b;if(n!=null){const We=xo(q),ft=n[0]*n[1]*4;Jn(We<=ft,()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.")}const fe=rL(q);let he;R?he=new Zye(fe):he=new Yye(fe);const be=!0,Pe=[n??Q6(fe)],je=this.runWebGLProgram(he,[{shape:fe,dtype:re,dataId:e}],re,Pe,be,n);return{dtype:re,shape:q,dataId:je.dataId}}runWebGLProgram(e,n,b,R,q=!1,re){const fe=this.makeTensorInfo(e.outputShape,b),he=this.texData.get(fe.dataId);if(e.packedOutput&&(he.isPacked=!0),e.outPackingScheme===lC.DENSE){const jt=re??Q6(e.outputShape);he.texShape=jt.map(Re=>Re*2)}if(e.outTexUsage!=null&&(he.usage=e.outTexUsage),xo(fe.shape)===0)return he.values=zv(fe.dtype,0),fe;const be=[],Pe=n.map(jt=>{if(jt.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let Re=this.texData.get(jt.dataId);if(Re.texture==null){if(!e.packedInputs&&xo(jt.shape)<=co().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:jt.shape,texData:null,isUniform:!0,uniformValues:Re.values};e.packedInputs&&(Re.isPacked=!0,Re.shape=jt.shape)}if(this.uploadToGPU(jt.dataId),!!Re.isPacked!=!!e.packedInputs)jt=Re.isPacked?this.unpackTensor(jt):this.packTensor(jt),be.push(jt),Re=this.texData.get(jt.dataId);else if(Re.isPacked&&!UL(Re.shape,jt.shape)){const Lr=jt,Cr=jt.shape;jt.shape=Re.shape,jt=this.packedReshape(jt,Cr),be.push(jt),Re=this.texData.get(jt.dataId),Lr.shape=Cr}return{shape:jt.shape,texData:Re,isUniform:!1}});this.uploadToGPU(fe.dataId);const je={shape:fe.shape,texData:he,isUniform:!1},We=Xye(e,Pe,je),ft=this.getAndSaveBinary(We,()=>Hye(this.gpgpu,e,Pe,je)),xt=this.activeTimers!=null;let zt;xt&&(zt=this.startTimer()),co().get("ENGINE_COMPILE_ONLY")||Wye(this.gpgpu,ft,Pe,je,R),be.forEach(jt=>this.disposeIntermediateTensorInfo(jt)),xt&&(zt=this.endTimer(zt),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(zt)}));const Ft=co().getNumber("WEBGL_FLUSH_THRESHOLD");if(Ft>0){const jt=Pm();jt-this.lastGlFlushTime>Ft&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=jt)}if(!co().getBool("WEBGL_LAZILY_UNPACK")&&he.isPacked&&q===!1){const jt=this.unpackTensor(fe);return this.disposeIntermediateTensorInfo(fe),jt}return fe}compileAndRun(e,n,b,R,q=!1){return b=b||n[0].dtype,this.runWebGLProgram(e,n,b,R,q)}getAndSaveBinary(e,n){return e in this.binaryCache||(this.binaryCache[e]=n()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(co().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(n=>{this.gpgpu.deleteProgram(this.binaryCache[n].webGLProgram),delete this.binaryCache[n]}),this.textureManager.dispose(),this.canvas!=null&&typeof HTMLCanvasElement<"u"&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)}floatPrecision(){return this.floatPrecisionValue==null&&(this.floatPrecisionValue=Zi(()=>{if(!co().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=co().getBool("DEBUG");co().set("DEBUG",!1);const n=this.abs(Pu(1e-8)).dataSync()[0];if(co().set("DEBUG",e),n>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?k_e:M_e}uploadToGPU(e){const n=this.texData.get(e),{shape:b,dtype:R,values:q,texture:re,usage:fe,isPacked:he}=n;if(re!=null)return;const be=this.activeTimers!=null;let Pe;be&&(Pe=Pm());let je=n.texShape;if(je==null&&(je=eye(b,he),n.texShape=je),q!=null){const We=rL(b);let ft,xt=je[1],zt=je[0];const Ft=q instanceof Uint8Array||q instanceof Uint8ClampedArray;(he||!Ft)&&([xt,zt]=WA(je[0],je[1])),he?ft=new e1e(We,Ft):ft=new VB(We,Ft);const jt=Ft?[zt,xt]:je,Re=this.makeTensorInfo(jt,R),Lr=this.texData.get(Re.dataId);Ft?Lr.usage=Fg.PIXELS:Lr.usage=Fg.UPLOAD,Lr.texShape=jt,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(Re.dataId),xt,zt,q);const Cr=[[zt,xt]],yn=this.runWebGLProgram(ft,[Re],R,Cr,!0),Pn=this.texData.get(yn.dataId);n.texShape=Pn.texShape,n.isPacked=Pn.isPacked,n.usage=Pn.usage,co().get("ENGINE_COMPILE_ONLY")?this.disposeData(yn.dataId):(n.texture=Pn.texture,n.values=null,this.texData.delete(yn.dataId)),this.disposeIntermediateTensorInfo(Re),be&&(this.uploadWaitMs+=Pm()-Pe)}else{const We=this.acquireTexture(je,fe,R,he);n.texture=We}}convertAndCacheOnCPU(e,n){const b=this.texData.get(e),{dtype:R}=b;return n!=null&&(b.values=P_e(n,R)),b.values}acquireTexture(e,n,b,R){if(this.numBytesInGPU+=this.computeBytes(e,b),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){const q=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${q} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,n,R)}computeBytes(e,n){return e[0]*e[1]*mL(n)}checkCompileCompletion(){for(const[,e]of Object.entries(this.binaryCache))this.checkCompletion_(e)}async checkCompileCompletionAsync(){const e=[];if(this.gpgpu.parallelCompilationExtension){for(const[,n]of Object.entries(this.binaryCache))e.push(this.checkCompletionAsync_(n));return Promise.all(e)}else{for(const[,n]of Object.entries(this.binaryCache)){const b=new Promise(R=>{try{this.checkCompletion_(n),R(!0)}catch(q){throw q}});e.push(b)}return Promise.all(e)}}async checkCompletionAsync_(e){return this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(e):(await SL(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)===!1)throw console.log(this.gpgpu.gl.getProgramInfoLog(e.webGLProgram)),this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS)===!1?(aH(e.source,this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)),new Error("Failed to compile fragment shader.")):new Error("Failed to link vertex and fragment shaders.");return!0}getUniformLocations(){for(const e of Object.values(this.binaryCache)){this.gpgpu.buildVao(e.webGLProgram);const{variablesLocations:n,customUniformLocations:b,infLoc:R,nanLoc:q,outShapeLocation:re,outShapeStridesLocation:fe,outTexShapeLocation:he}=uH(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=n,e.customUniformLocations=b,e.infLoc=R,e.nanLoc=q,e.outShapeLocation=re,e.outShapeStridesLocation=fe,e.outTexShapeLocation=he}}createTensorFromGPUData(e,n,b){e.channels=e.channels||"RGBA";const{texture:R,height:q,width:re,channels:fe}=e,he=a1().backend;if(!he.gpgpu.gl.isTexture(R))throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");const be=he.writeTexture(R,n,b,q,re,fe);return a1().makeTensorFromDataId(be,n,b,he)}}yD.nextDataId=0;function P_e(u,e){if(e==="float32"||e==="complex64")return u;if(e==="int32"||e==="bool"){const n=e==="int32"?new Int32Array(u.length):new Uint8Array(u.length);for(let b=0;bnew yD,2);const PO=` + if (isnan(a)) return a; + if (isnan(b)) return b; +`;class R2{constructor(e,n,b){this.variableNames=["A","B"],this.outputShape=Yu(n,b),this.enableShapeUniforms=Uv(this.outputShape.length),this.userCode=` + float binaryOperation(float a, float b) { + ${e} + } + + void main() { + float a = getAAtOutCoords(); + float b = getBAtOutCoords(); + setOutput(binaryOperation(a, b)); + } + `}}const U2=` + result.r = isNaN.r ? NAN : result.r; + result.g = isNaN.g ? NAN : result.g; + result.b = isNaN.b ? NAN : result.b; + result.a = isNaN.a ? NAN : result.a; +`;class JA{constructor(e,n,b,R=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=Yu(n,b);const q=this.outputShape.length;this.enableShapeUniforms=Uv(q);let re="";if(R)if(q===0||xo(this.outputShape)===1)re=` + result.y = 0.; + result.z = 0.; + result.w = 0.; + `;else if(re=` + ${Th(q)} coords = getOutputCoords(); + `,q===1)this.enableShapeUniforms?re+=` + result.y = (coords + 1) >= outShape ? 0. : result.y; + result.z = 0.; + result.w = 0.; + `:re+=` + result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y; + result.z = 0.; + result.w = 0.; + `;else{const he=vm("coords",q);this.enableShapeUniforms?re+=` + bool nextRowOutOfBounds = + (${he[q-2]} + 1) >= outShape[${q} - 2]; + bool nextColOutOfBounds = + (${he[q-1]} + 1) >= outShape[${q} - 1]; + result.y = nextColOutOfBounds ? 0. : result.y; + result.z = nextRowOutOfBounds ? 0. : result.z; + result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; + `:re+=` + bool nextRowOutOfBounds = + (${he[q-2]} + 1) >= ${this.outputShape[q-2]}; + bool nextColOutOfBounds = + (${he[q-1]} + 1) >= ${this.outputShape[q-1]}; + result.y = nextColOutOfBounds ? 0. : result.y; + result.z = nextRowOutOfBounds ? 0. : result.z; + result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; + `}this.userCode=` + vec4 binaryOperation(vec4 a, vec4 b) { + ${e} + } + + void main() { + vec4 a = getAAtOutCoords(); + vec4 b = getBAtOutCoords(); + + vec4 result = binaryOperation(a, b); + ${re} + + setOutput(result); + } + `}}function ug(u){const{inputs:e,backend:n}=u,{x:b}=e;return n.incRef(b.dataId),{dataId:b.dataId,shape:b.shape,dtype:b.dtype}}const z_e={kernelName:DC,backendName:"webgl",kernelFunc:ug};function Ab(u){const{inputs:e,backend:n}=u,{real:b,imag:R}=e,q=n.makeTensorInfo(b.shape,"complex64"),re=n.texData.get(q.dataId),fe=ug({inputs:{x:b},backend:n}),he=ug({inputs:{x:R},backend:n});return re.complexTensorInfos={real:fe,imag:he},q}const N_e={kernelName:_8,backendName:"webgl",kernelFunc:Ab};const xH="return (a < 0.) ? b * a : a;",bH=` + vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); + return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); +`;function O_e(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{alpha:q}=b,re=n.makeTensorInfo([],"float32",gb(q,"float32")),fe=co().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new JA(bH,R.shape,re.shape):new R2(xH,R.shape,re.shape),he=n.runWebGLProgram(fe,[R,re],"float32");return n.disposeIntermediateTensorInfo(re),he}const F_e={kernelName:hR,backendName:"webgl",kernelFunc:O_e};const wH="return (a < 0.) ? b * a : a;",TH=` + vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); + return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); +`;function B_e(u){const{inputs:e,backend:n}=u,{x:b,alpha:R}=e,q=co().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new JA(TH,b.shape,R.shape):new R2(wH,b.shape,R.shape);return n.runWebGLProgram(q,[b,R],"float32")}const U_e={kernelName:LR,backendName:"webgl",kernelFunc:B_e};const QA="if (isnan(x)) return x;";function rf({opSnippet:u,packedOpSnippet:e,cpuKernelImpl:n,dtype:b}){return({inputs:R,backend:q})=>{const{x:re}=R,fe=q,he=b||re.dtype;if(fe.shouldExecuteOnCPU([re])&&n!=null){const je=fe.texData.get(re.dataId),We=n(je.values,he);return fe.makeTensorInfo(re.shape,he,We)}const be=co().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&e!=null;let Pe;return be?Pe=new ab(re.shape,e):Pe=new u1(re.shape,u),fe.runWebGLProgram(Pe,[re],he)}}function kv({opSnippet:u,packedOpSnippet:e,checkOutOfBounds:n=!1,supportsComplex:b=!1,cpuKernelImpl:R,dtype:q}){return({inputs:re,backend:fe})=>{const{a:he,b:be}=re,Pe=fe;if(b&&he.dtype==="complex64"){const xt=Pe.texData.get(he.dataId),zt=Pe.texData.get(be.dataId),[Ft,jt]=[[xt.complexTensorInfos.real,zt.complexTensorInfos.real],[xt.complexTensorInfos.imag,zt.complexTensorInfos.imag]].map(Lr=>{const[Cr,Gr]=Lr,yn={dataId:Cr.dataId,dtype:Cr.dtype,shape:he.shape},Pn={dataId:Gr.dataId,dtype:Gr.dtype,shape:be.shape},Vn=new R2(u,he.shape,be.shape);return Pe.runWebGLProgram(Vn,[yn,Pn],sg(Cr.dtype,Gr.dtype))}),Re=Ab({inputs:{real:Ft,imag:jt},backend:Pe});return Pe.disposeIntermediateTensorInfo(Ft),Pe.disposeIntermediateTensorInfo(jt),Re}const je=q||sg(he.dtype,be.dtype);if((he.dtype==="string"||be.dtype==="string"||Pe.shouldExecuteOnCPU([he,be]))&&R!=null){const xt=Pe.texData.get(he.dataId).values,zt=Pe.texData.get(be.dataId).values,Ft=he.dtype==="string"?T_(xt):xt,jt=he.dtype==="string"?T_(zt):zt,[Re,Lr]=R(he.shape,be.shape,Ft,jt,je),Cr=Pe.makeTensorInfo(Lr,je),Gr=Pe.texData.get(Cr.dataId);return Gr.values=Re,Cr}const We=co().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&e!=null;let ft;return We?ft=new JA(e,he.shape,be.shape,n):ft=new R2(u,he.shape,be.shape),Pe.runWebGLProgram(ft,[he,be],je)}}function uC(u,e=!1){if(u==="linear")return e?b_e:m_e;if(u==="relu")return e?T_e:y_e;if(u==="elu")return e?w_e:g_e;if(u==="relu6")return e?A_e:__e;if(u==="prelu")return e?TH:wH;if(u==="leakyrelu")return e?bH:xH;if(u==="sigmoid")return e?S_e:x_e;throw new Error(`Activation ${u} has not been implemented for the WebGL backend.`)}class AH{constructor(e,n,b,R=!1,q=!1,re=!1,fe=null,he=!1,be=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=b,this.enableShapeUniforms=Uv(this.outputShape.length);const Pe=R?e[1]:e[2],je=Math.ceil(Pe/2),We=R?"i * 2, rc.y":"rc.y, i * 2",ft=q?"rc.z, i * 2":"i * 2, rc.z",xt=R?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],zt=q?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let Ft="",jt="";fe&&(he?Ft=`vec4 activation(vec4 a) { + vec4 b = getPreluActivationWeightsAtOutCoords(); + ${fe} + }`:be?Ft=`vec4 activation(vec4 a) { + vec4 b = getLeakyreluAlphaAtOutCoords(); + ${fe} + }`:Ft=`vec4 activation(vec4 x) { + ${fe} + }`,jt="result = activation(result);");const Re=re?"result += getBiasAtOutCoords();":"";re&&this.variableNames.push("bias"),he&&this.variableNames.push("preluActivationWeights"),be&&this.variableNames.push("leakyreluAlpha");let Lr="rc.x",Cr="rc.x";e[0]`The new shape (${he}) has ${be} elements and the old shape (${R.shape}) has ${fe} elements. The new shape and old shape must have the same number of elements.`);const Pe=re.texData.get(R.dataId);return Pe.isPacked&&!UL(R.shape,he)&&!(Pe.texture!==null&&UL(Pe.shape,he))?V_e(R,he,re):(re.incRef(R.dataId),{dataId:R.dataId,shape:he,dtype:R.dtype})}const j_e={kernelName:DR,backendName:"webgl",kernelFunc:$s};class ZB{constructor(e,n){this.variableNames=["x"];const{windowSize:b,batchSize:R,inSize:q,outSize:re}=e;this.outputShape=[R,re];const fe=Math.floor(b/4)*4,he=b%4;let be="sumValue += dot(values, ones);";if(n!=null){const je=1/n;be=`sumValue += dot(values * ${CA(je)?je.toPrecision(2):je}, ones);`}let Pe="";q%b>0&&(Pe=` + if (inIdx < 0 || inIdx >= ${q}) { + return 0.0; + } + `),this.userCode=` + const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); + + float getValue(int batch, int inIdx) { + ${Pe} + return getX(batch, inIdx); + } + + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int outIdx = coords[1]; + int inOffset = outIdx * ${b}; + + float sumValue = 0.0; + + for (int i = 0; i < ${fe}; i += 4) { + int inIdx = inOffset + i; + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), + getValue(batch, inIdx + 3) + ); + + ${be} + } + + int inIdx = inOffset + ${fe}; + if (${he===1}) { + vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0); + + ${be} + } else if (${he===2}) { + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), 0.0, 0.0); + + ${be} + } else if (${he===3}) { + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), 0.0); + + ${be} + } + setOutput(sumValue); + } + `}}class G_e{constructor(e,n){this.variableNames=["x"];const{windowSize:b,batchSize:R,inSize:q,outSize:re}=e;this.outputShape=[R,re];let fe="0.0",he="";n==="prod"?fe="1.0":n==="min"?(fe="1.0 / 1e-20",he="min"):n==="max"&&(fe="-1.0 / 1e-20",he="max");let be=`${n}(${n}(${n}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;n==="sum"?be="sumValue":n==="prod"?be="prodValue":n==="all"?be="allValue":n==="any"&&(be="anyValue");const Pe=Math.floor(b/4)*4,je=b%4;let We=` + if (${n==="sum"}) { + sumValue += dot(values, ones); + } else if (${n==="prod"}) { + vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]); + prodValue *= tmp[0] * tmp[1]; + } else { + minMaxValue = ${he}(values, minMaxValue); + if (${n==="min"} || ${n==="max"}) { + minMaxValue = ${he}(values, minMaxValue); + bvec4 isNaN = isnan(values); + if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) { + minMaxValue = vec4(NAN); + } + } + } + `,ft="vec4";n==="all"?(fe="1.0",We=` + bool reducedAllValue = all(values); + float floatedReducedAllValue = float(reducedAllValue); + allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0); + `,ft="bvec4"):n==="any"&&(fe="0.0",We=` + bool reducedAnyValue = any(values); + float floatedReducedAnyValue = float(reducedAnyValue); + anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0); + `,ft="bvec4");let xt="";q%b>0&&(xt=` + if (inIdx < 0 || inIdx >= ${q}) { + return initializationValue; + } + `),this.userCode=` + const float initializationValue = ${fe}; + const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); + + float getValue(int batch, int inIdx) { + ${xt} + return getX(batch, inIdx); + } + + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int outIdx = coords[1]; + int inOffset = outIdx * ${b}; + + vec4 minMaxValue = vec4(${fe}); + float prodValue = 1.0; + float sumValue = 0.0; + float allValue = 1.0; + float anyValue = 0.0; + + for (int i = 0; i < ${Pe}; i += 4) { + int inIdx = inOffset + i; + ${ft} values = ${ft}( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), + getValue(batch, inIdx + 3) + ); + + ${We} + } + + int inIdx = inOffset + ${Pe}; + if (${je===1}) { + ${ft} values = ${ft}( + getValue(batch, inIdx), + initializationValue, + initializationValue, + initializationValue + ); + + ${We} + } else if (${je===2}) { + ${ft} values = ${ft}( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + initializationValue, + initializationValue + ); + + ${We} + } else if (${je===3}) { + ${ft} values = ${ft}( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), + initializationValue + ); + + ${We} + } + setOutput(${be}); + } + `}}function q_e(u){const e=[];for(;e.length===0||e[e.length-1].outSize!==1;){const n=e.length?e[e.length-1].outSize:u[1],b=rD(n);e.push({inSize:n,windowSize:b,outSize:Math.ceil(n/b)})}return e}function $2(u,e,n,b){const R=q_e(u.shape);let q=u;for(let re=0;re6)throw Error(`Transpose for rank ${e} is not yet supported`);const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],b=new Array(e);for(let R=0;R6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const R=Th(this.rank),q=yH("rc",this.rank),re=new Array(this.rank);for(let Pe=0;Pe`Error in matMul: inner shapes (${je}) and (${We}) of Tensors with shapes ${u.shape} and ${e.shape} and transposeA=${n} and transposeB=${b} must match.`);const Gr=n?[jt,je,ft]:[jt,ft,je],yn=b?[Re,xt,We]:[Re,We,xt],Pn=$s({inputs:{x:u},backend:R,attrs:{shape:Gr}}),Vn=$s({inputs:{x:e},backend:R,attrs:{shape:yn}}),un=[Pn,Vn],Nn=Math.max(jt,Re),Kr=n?Pn.shape[1]:Pn.shape[2],Ma=q!=null,ui=re!=null,da=he==="leakyrelu",Ia=he!=null?uC(he,!0):null,aa=Ma||ui||da||Ia!=null;let Ka;if((ft===1||xt===1)&&Kr>SH&&aa===!1){let Ui=Pn,$i=Vn;n&&(Ui=gm({inputs:{x:Pn},backend:R,attrs:{perm:[0,2,1]}}),un.push(Ui)),b&&($i=gm({inputs:{x:Vn},backend:R,attrs:{perm:[0,2,1]}}),un.push($i));const Hn=xt!==1,qa=xt===1;let ki=Ui;Hn&&(ki=$s({inputs:{x:Ui},backend:R,attrs:{shape:[Nn,Kr,1]}}),un.push(ki));const no=xt===1?2:1;let oo=$i;qa&&(oo=$s({inputs:{x:$i},backend:R,attrs:{shape:[Nn,1,Kr]}}),un.push(oo));const Li=zO({inputs:{a:ki,b:oo},backend:R});Ka=xD({inputs:{x:Li},backend:R,attrs:{axis:no,keepDims:!0}}),un.push(Li)}else{const Ui=sg(u.dtype,e.dtype),$i=new AH(Gr,yn,[Nn,ft,xt],n,b,Ma,Ia,ui,da),Hn=[Pn,Vn];if(q!=null&&Hn.push(q),ui&&Hn.push(re),da){const qa=R.makeTensorInfo([],"float32",gb(fe,"float32"));Hn.push(qa),un.push(qa)}Ka=R.runWebGLProgram($i,Hn,Ui)}const ai=$s({inputs:{x:Ka},backend:R,attrs:{shape:Cr}});un.push(Ka);for(const Ui of un)R.disposeIntermediateTensorInfo(Ui);return ai}function J_e(u){const{inputs:e,backend:n,attrs:b}=u,{a:R,b:q,bias:re,preluActivationWeights:fe}=e,{transposeA:he,transposeB:be,activation:Pe,leakyreluAlpha:je}=b;return $L({a:R,b:q,transposeA:he,transposeB:be,backend:n,bias:re,preluActivationWeights:fe,leakyreluAlpha:je,activation:Pe})}const Q_e={kernelName:gL,backendName:"webgl",kernelFunc:J_e};const KB="return abs(x);";function exe(u){const{inputs:e,backend:n}=u,{x:b}=e;if(n.shouldExecuteOnCPU([b])&&b.dtype!=="complex64"){const q=n.texData.get(b.dataId),re=mH(q.values);return n.makeTensorInfo(b.shape,b.dtype,re)}let R;return co().getBool("WEBGL_PACK_UNARY_OPERATIONS")?R=new ab(b.shape,KB):R=new u1(b.shape,KB),n.runWebGLProgram(R,[b],b.dtype)}const txe={kernelName:HL,backendName:"webgl",kernelFunc:exe};const rxe=A0+` + if (abs(x) > 1.) { + return NAN; + } + return acos(x); +`,nxe=rf({opSnippet:rxe}),axe={kernelName:dC,backendName:"webgl",kernelFunc:nxe};const ixe=A0+` + if (x < 1.0) return NAN; +return log(x + sqrt(x * x - 1.0));`,oxe=rf({opSnippet:ixe}),sxe={kernelName:pC,backendName:"webgl",kernelFunc:oxe};const JB="return a + b;",lxe=kv({opSnippet:JB,packedOpSnippet:JB,supportsComplex:!0,cpuKernelImpl:y1e}),uxe={kernelName:UA,backendName:"webgl",kernelFunc:lxe};class cxe{constructor(e,n){this.outputShape=[],this.outputShape=e,this.variableNames=n.map((q,re)=>`T${re}`);const b=[];this.variableNames.forEach(q=>{b.push(`float v${q} = get${q}AtOutCoords();`)});const R=this.variableNames.map(q=>`v${q}`).join(" + ");this.userCode=` + void main() { + ${b.join(` + `)} + + float result = ${R}; + setOutput(result); + } + `}}class fxe{constructor(e,n){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=n.map((q,re)=>`T${re}`);const b=[];this.variableNames.forEach(q=>{b.push(`vec4 v${q} = get${q}AtOutCoords();`)});const R=this.variableNames.map(q=>`v${q}`).join(" + ");this.userCode=` + void main() { + ${b.join(` + `)} + + vec4 result = ${R}; + setOutput(result); + } + `}}function pL(u){const{inputs:e,backend:n}=u,b=e;if(b.length===1)return ug({inputs:{x:b[0]},backend:n});if(b.length>co().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const he=Math.floor(b.length/2),be=pL({inputs:b.slice(0,he),backend:n}),Pe=pL({inputs:b.slice(he),backend:n});return pL({inputs:[be,Pe],backend:n})}const R=b.map(he=>he.dtype).reduce((he,be)=>sg(he,be)),q=b.map(he=>he.shape),fe=co().getBool("WEBGL_PACK")?new fxe(b[0].shape,q):new cxe(b[0].shape,q);return n.runWebGLProgram(fe,b,R)}const hxe={kernelName:h8,backendName:"webgl",kernelFunc:pL};function dxe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{axis:q,keepDims:re}=b,fe=R.shape.length,he=Ac(q,R.shape);let be=he;const Pe=kd(be,fe);let je=R;Pe!=null&&(je=gm({inputs:{x:R},backend:n,attrs:{perm:Pe}}),be=op(be.length,fe)),Cv("all",be,fe);const[We,ft]=lv(je.shape,be),xt=xo(ft),zt=$s({inputs:{x:je},backend:n,attrs:{shape:[-1,xt]}}),Ft=$2(zt,zt.dtype,"all",n);let jt;if(re){const Re=ip(We,he);jt=$s({inputs:{x:Ft},backend:n,attrs:{shape:Re}})}else jt=$s({inputs:{x:Ft},backend:n,attrs:{shape:We}});return n.disposeIntermediateTensorInfo(zt),n.disposeIntermediateTensorInfo(Ft),Pe!=null&&n.disposeIntermediateTensorInfo(je),jt}const pxe={kernelName:d8,backendName:"webgl",kernelFunc:dxe};function vxe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{axis:q,keepDims:re}=b,fe=R.shape.length,he=Ac(q,R.shape);let be=he;const Pe=kd(be,fe);let je=R;Pe!=null&&(je=gm({inputs:{x:R},backend:n,attrs:{perm:Pe}}),be=op(be.length,fe)),Cv("any",be,fe);const[We,ft]=lv(je.shape,be),xt=xo(ft),zt=$s({inputs:{x:je},backend:n,attrs:{shape:[-1,xt]}}),Ft=$2(zt,zt.dtype,"any",n);let jt;if(re){const Re=ip(We,he);jt=$s({inputs:{x:Ft},backend:n,attrs:{shape:Re}})}else jt=$s({inputs:{x:Ft},backend:n,attrs:{shape:We}});return n.disposeIntermediateTensorInfo(zt),n.disposeIntermediateTensorInfo(Ft),Pe!=null&&n.disposeIntermediateTensorInfo(je),jt}const mxe={kernelName:p8,backendName:"webgl",kernelFunc:vxe};class gxe{constructor(e,n,b){this.variableNames=["A"];const{windowSize:R,batchSize:q,outSize:re}=e;b||this.variableNames.push("bestIndicesA"),this.outputShape=[q,re];const fe=n==="max"?">":"<",he=b?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int outIdx = coords[1]; + int inOffset = outIdx * ${R}; + + int bestIndex = inOffset; + float bestValue = getA(batch, bestIndex); + + for (int i = 0; i < ${R}; i++) { + int inIdx = ${he}; + float candidate = getA(batch, inIdx); + if (candidate ${fe} bestValue) { + bestValue = candidate; + bestIndex = inIdx; + } + } + setOutput(float(bestIndex)); + } + `}}class yxe{constructor(e,n,b,R){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,Jn(e.length>2,()=>`Packed arg${b.charAt(0).toUpperCase()+b.slice(1)} supports only inputs with rank above 2.`);const q=e[e.length-1],re=Math.ceil(q/n);this.outputShape=e.slice(0,-1),re>1&&this.outputShape.push(re),R||this.variableNames.push("bestIndicesA");const fe=this.outputShape,he=fe.length,be=Th(he),Pe=vm("coords",he);let je,We;if(re===1){We=he+1;const Vn=Th(We);je=` + ${Vn} sourceLocR = ${Vn}(${Pe.join()}, 0); + ++${Pe[he-1]}; + ${Vn} sourceLocG = ${Vn}(${Pe.join()}, 0); + ++${Pe[he-2]}; + ${Vn} sourceLocA = ${Vn}(${Pe.join()}, 0); + --${Pe[he-1]}; + ${Vn} sourceLocB = ${Vn}(${Pe.join()}, 0); + --${Pe[he-2]};`}else We=he,je=` + ${be} sourceLocR = coords; + ++${Pe[he-1]}; + ${be} sourceLocG = coords; + ++${Pe[he-2]}; + ${be} sourceLocA = coords; + --${Pe[he-1]}; + ${be} sourceLocB = coords; + --${Pe[he-2]};`;const ft=["x","y","z","w","u","v"].slice(0,We),xt="."+ft[We-1],zt=ft.map(Vn=>"int "+Vn),Ft=vm("sourceLocR",We-1).concat("inIdx.r"),jt=vm("sourceLocG",We-1).concat("inIdx.g"),Re=vm("sourceLocB",We-1).concat("inIdx.b"),Lr=vm("sourceLocA",We-1).concat("inIdx.a"),Cr=b==="max"?"greaterThan":"lessThan",Gr=R?"":` + inIdx = round(vec4(getBestIndicesAChannel(${Ft.join()}), + getBestIndicesAChannel(${jt.join()}), + getBestIndicesAChannel(${Re.join()}), + getBestIndicesAChannel(${Lr.join()})));`,yn=`vec4( + getAChannel(${Ft.join()}), + hasNextCol ? getAChannel(${jt.join()}) : 0., + hasNextRow ? getAChannel(${Re.join()}) : 0., + hasNextRow && hasNextCol ? getAChannel(${Lr.join()}) : 0.)`,Pn=R?"":` + float getBestIndicesAChannel(${zt.join()}) { + return getChannel(getBestIndicesA(${ft.join()}), + vec2(${ft.slice(-2).join()})); + }`;this.userCode=` + float getAChannel(${zt.join()}) { + return getChannel(getA(${ft.join()}), + vec2(${ft.slice(-2).join()})); + } + ${Pn} + void main() { + ${be} coords = getOutputCoords(); + bool hasNextCol = ${Pe[he-1]} < ${fe[he-1]-1}; + bool hasNextRow = ${Pe[he-2]} < ${fe[he-2]-1}; + ${je} + ivec4 srcIdx = ivec4(sourceLocR${xt}, sourceLocG${xt}, + sourceLocB${xt}, sourceLocA${xt}) * ${n}; + ivec4 inIdx = srcIdx; + vec4 bestIndex = vec4(inIdx); + vec4 bestValue = ${yn}; + + for (int i = 0; i < ${n}; i++) { + inIdx = srcIdx; + ${Gr} + vec4 candidate = ${yn}; + bvec4 nan = isnan(candidate); + bvec4 replace = bvec4( + vec4(${Cr}(candidate, bestValue)) * (vec4(1.0) - vec4(nan))); + + bestValue = vec4(replace.x ? candidate.x : bestValue.x, + replace.y ? candidate.y : bestValue.y, + replace.z ? candidate.z : bestValue.z, + replace.w ? candidate.w : bestValue.w); + bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace)); + srcIdx++; + } + setOutput(bestIndex); + } + `}}function EH(u,e,n,b=null){let R=e.shape[0],q=e.shape[1];b!=null&&(R=b.shape[0],q=b.shape[1]);const re=rD(q),fe={windowSize:re,inSize:q,batchSize:R,outSize:Math.ceil(q/re)},he=new gxe(fe,n,b==null),be=[e];b!=null&&be.push(b);const Pe=u.runWebGLProgram(he,be,"int32");if(Pe.shape[1]===1)return Pe;const je=EH(u,e,n,Pe);return u.disposeIntermediateTensorInfo(Pe),je}function CH(u,e,n,b=null){const R=b!=null?b.shape:e.shape,q=R[R.length-1],re=rD(q),fe=new yxe(R,re,n,b==null),he=b==null?[e]:[e,b],be=u.runWebGLProgram(fe,he,"int32");if(be.shape.length===e.shape.length){const Pe=CH(u,e,n,be);return u.disposeIntermediateTensorInfo(be),Pe}return be}function kH(u,e,n,b){const R=[n];if(Cv("arg"+b.charAt(0).toUpperCase()+b.slice(1),R,e.shape.length),!co().getBool("WEBGL_PACK_REDUCE")||e.shape.length<=2){const q=[],re=u.texData.get(e.dataId),fe=re!==null&&re.isPacked;let he=e;fe&&(he=u.unpackTensor(e),q.push(he));const[be,Pe]=lv(he.shape,R),je=xo(Pe),We=$s({inputs:{x:he},backend:u,attrs:{shape:[-1,je]}});q.push(We);const ft=EH(u,We,b);q.push(ft);const xt=$s({inputs:{x:ft},backend:u,attrs:{shape:be}});return q.forEach(zt=>u.disposeIntermediateTensorInfo(zt)),xt}return CH(u,e,b)}function _xe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{axis:q}=b;let re=Ac(q,R.shape);const fe=kd(re,R.shape.length);let he=R;const be=[];fe!=null&&(he=gm({inputs:{x:R},backend:n,attrs:{perm:fe}}),be.push(he),re=op(re.length,he.shape.length)),Cv("argMax",[re[0]],he.shape.length);const Pe=kH(n,he,re[0],"max");return be.forEach(je=>n.disposeIntermediateTensorInfo(je)),Pe}const xxe={kernelName:WL,backendName:"webgl",kernelFunc:_xe};function bxe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{axis:q}=b;let re=Ac(q,R.shape);const fe=kd(re,R.shape.length);let he=R;const be=[];fe!=null&&(he=gm({inputs:{x:R},backend:n,attrs:{perm:fe}}),be.push(he),re=op(re.length,he.shape.length)),Cv("argMin",[re[0]],he.shape.length);const Pe=kH(n,he,re[0],"min");return be.forEach(je=>n.disposeIntermediateTensorInfo(je)),Pe}const wxe={kernelName:XL,backendName:"webgl",kernelFunc:bxe};const Txe=A0+` + if (abs(x) > 1.) { + return NAN; + } + return asin(x); +`,Axe=rf({opSnippet:Txe}),Sxe={kernelName:vC,backendName:"webgl",kernelFunc:Axe};const Exe=A0+"return log(x + sqrt(x * x + 1.0));",Cxe=rf({opSnippet:Exe}),kxe={kernelName:mC,backendName:"webgl",kernelFunc:Cxe};const Mxe=A0+` + return atan(x); +`,Ixe=rf({opSnippet:Mxe}),Lxe={kernelName:gC,backendName:"webgl",kernelFunc:Ixe};const Rxe=PO+` + return atan(a, b); +`,Dxe=` + vec4 result = atan(a, b); + bvec4 isNaNA = isnan(a); + bvec4 isNaNB = isnan(b); + bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w); + `+U2+` + return result; +`,Pxe=kv({opSnippet:Rxe,packedOpSnippet:Dxe}),zxe={kernelName:_C,backendName:"webgl",kernelFunc:Pxe};const Nxe=A0+` + if ((x < -1.0) || (x > 1.0)) return NAN; +return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,Oxe=rf({opSnippet:Nxe}),Fxe={kernelName:yC,backendName:"webgl",kernelFunc:Oxe};class cC{constructor(e,n,b,R=!1,q=!1){if(this.variableNames=["x"],n==="avg"&&b)throw new Error("Cannot compute positions for average pool.");const re=e.filterWidth,fe=e.strideHeight,he=e.strideWidth,be=e.dilationHeight,Pe=e.dilationWidth,je=e.effectiveFilterHeight,We=e.effectiveFilterWidth,ft=e.padInfo.top,xt=e.padInfo.left;this.outputShape=e.outShape;const zt=n==="avg",Ft=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,jt=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`;let Re="0.0";if(zt||(Re="-1.0 / 1e-20"),b){this.userCode=` + const ivec2 strides = ivec2(${fe}, ${he}); + const ivec2 pads = ivec2(${ft}, ${xt}); + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords[0]; + int d = coords[3]; + + ivec2 xRCCorner = coords.yz * strides - pads; + int xRCorner = xRCCorner.x; + int xCCorner = xRCCorner.y; + + // max/min x(?, ?, d) to get y(yR, yC, d). + // ? = to be determined + float minMaxValue = 0.0; + float minMaxValueFound = 0.0; + int minMaxPosition = 0; + float avgValue = 0.0; + + for (int wR = 0; wR < ${je}; + wR += ${be}) { + int xR = xRCorner + wR; + + if (xR < 0 || xR >= ${e.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${We}; + wC += ${Pe}) { + int xC = xCCorner + wC; + + if (xC < 0 || xC >= ${e.inWidth}) { + continue; + } + + float value = getX(batch, xR, xC, d); + + // If a min / max value has already been found, use it. If not, + // use the current value. + float currMinMaxValue = mix( + value, minMaxValue, minMaxValueFound); + if (value >= currMinMaxValue) { + minMaxValue = value; + minMaxValueFound = 1.0; + minMaxPosition = ${R?q?Ft:jt:`wR * ${We} + wC`}; + } + } + } + setOutput(float(minMaxPosition)); + } + `;return}const Lr="max";let Cr=`${n}(${n}(${n}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;n==="avg"&&(Cr="avgValue / max(count, 1.0)");const Gr=Math.floor(re/4)*4,yn=re%4,Pn=` + if (${zt}) { + avgValue += dot(values, ones); + } else { + minMaxValue = ${Lr}(values, minMaxValue); + } + `;this.userCode=` + const ivec2 strides = ivec2(${fe}, ${he}); + const ivec2 pads = ivec2(${ft}, ${xt}); + const float initializationValue = ${Re}; + const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); + + float count = 0.0; + + float getValue(int batch, int xR, int xC, int d) { + if (xC < 0 || xC >= ${e.inWidth}) { + return initializationValue; + } + count += 1.0; + return getX(batch, xR, xC, d); + } + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords[0]; + int d = coords[3]; + + ivec2 xRCCorner = coords.yz * strides - pads; + int xRCorner = xRCCorner.x; + int xCCorner = xRCCorner.y; + + // max/min x(?, ?, d) to get y(yR, yC, d). + // ? = to be determined + vec4 minMaxValue = vec4(${Re}); + float avgValue = 0.0; + count = 0.0; + + for (int wR = 0; wR < ${je}; + wR += ${be}) { + int xR = xRCorner + wR; + + if (xR < 0 || xR >= ${e.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${Gr}; wC += 4) { + int xC = xCCorner + wC * ${Pe}; + + vec4 values = vec4( + getValue(batch, xR, xC, d), + getValue(batch, xR, xC + ${Pe}, d), + getValue(batch, xR, xC + 2 * ${Pe}, d), + getValue(batch, xR, xC + 3 * ${Pe}, d) + ); + + ${Pn} + } + + int xC = xCCorner + ${Gr}; + if (${yn===1}) { + vec4 values = vec4( + getValue(batch, xR, xC, d), + initializationValue, + initializationValue, + initializationValue + ); + + ${Pn} + } else if (${yn===2}) { + vec4 values = vec4( + getValue(batch, xR, xC, d), + getValue(batch, xR, xC + ${Pe}, d), + initializationValue, + initializationValue + ); + + ${Pn} + } else if (${yn===3}) { + vec4 values = vec4( + getValue(batch, xR, xC, d), + getValue(batch, xR, xC + ${Pe}, d), + getValue(batch, xR, xC + 2 * ${Pe}, d), + initializationValue + ); + + ${Pn} + } + } + setOutput(${Cr}); + } + `}}class NO{constructor(e,n,b,R=!1,q=!1){if(this.variableNames=["x"],n==="avg"&&b)throw new Error("Cannot compute positions for average pool.");const re=e.filterWidth,fe=e.strideDepth,he=e.strideHeight,be=e.strideWidth,Pe=e.dilationDepth,je=e.dilationHeight,We=e.dilationWidth,ft=e.effectiveFilterDepth,xt=e.effectiveFilterHeight,zt=e.effectiveFilterWidth,Ft=e.padInfo.front,jt=e.padInfo.top,Re=e.padInfo.left;this.outputShape=e.outShape;const Lr=n==="avg";let Cr="0.0";if(Lr||(Cr="-1.0 / 1e-20"),b){this.userCode=` + const ivec3 strides = + ivec3(${fe}, ${he}, ${be}); + const ivec3 pads = ivec3(${Ft}, ${jt}, ${Re}); + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int ch = coords.u; + + ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; + int xDCorner = xCorner.x; + int xRCorner = xCorner.y; + int xCCorner = xCorner.z; + + // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch). + // ? = to be determined + float minMaxValue = 0.0; + float minMaxValueFound = 0.0; + int minMaxPosition = 0; + + for (int wD = 0; wD < ${ft}; + wD += ${Pe}) { + int xD = xDCorner + wD; + + if (xD < 0 || xD >= ${e.inDepth}) { + continue; + } + + for (int wR = 0; wR < ${xt}; + wR += ${je}) { + int xR = xRCorner + wR; + + if (xR < 0 || xR >= ${e.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${zt}; + wC += ${We}) { + int xC = xCCorner + wC; + + if (xC < 0 || xC >= ${e.inWidth}) { + continue; + } + + float value = getX(batch, xD, xR, xC, ch); + + // If a min / max value has already been found, use it. If not, + // use the current value. + float currMinMaxValue = mix( + value, minMaxValue, minMaxValueFound); + if (value >= currMinMaxValue) { + minMaxValue = value; + minMaxValueFound = 1.0; + minMaxPosition = ${R?q?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${xt} * ${zt} + + wR * ${zt} + wC`}; + } + } + } + } + setOutput(float(minMaxPosition)); + } + `;return}const Gr="max";let yn=`${n}(${n}(${n}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;n==="avg"&&(yn="avgValue / max(count, 1.0)");const Pn=Math.floor(re/4)*4,Vn=re%4,un=` + if (${Lr}) { + avgValue += dot(values, ones); + } else { + minMaxValue = ${Gr}(values, minMaxValue); + } + `;this.userCode=` + const ivec3 strides = + ivec3(${fe}, ${he}, ${be}); + const ivec3 pads = ivec3(${Ft}, ${jt}, ${Re}); + const float initializationValue = ${Cr}; + const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); + + float count = 0.0; + + float getValue(int batch, int xD, int xR, int xC, int ch) { + if (xC < 0 || xC >= ${e.inWidth}) { + return initializationValue; + } + count += 1.0; + return getX(batch, xD, xR, xC, ch); + } + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int ch = coords.u; + + ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; + int xDCorner = xCorner.x; + int xRCorner = xCorner.y; + int xCCorner = xCorner.z; + + // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch). + // ? = to be determined + vec4 minMaxValue = vec4(${Cr}); + float avgValue = 0.0; + count = 0.0; + + for (int wD = 0; wD < ${ft}; + wD += ${Pe}) { + int xD = xDCorner + wD; + + if (xD < 0 || xD >= ${e.inDepth}) { + continue; + } + + for (int wR = 0; wR < ${xt}; + wR += ${je}) { + int xR = xRCorner + wR; + + if (xR < 0 || xR >= ${e.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${Pn}; wC += 4) { + int xC = xCCorner + wC * ${We}; + + vec4 values = vec4( + getValue(batch, xD, xR, xC, ch), + getValue(batch, xD, xR, xC + ${We}, ch), + getValue(batch, xD, xR, xC + 2 * ${We}, ch), + getValue(batch, xD, xR, xC + 3 * ${We}, ch) + ); + + ${un} + } + + int xC = xCCorner + ${Pn}; + if (${Vn===1}) { + vec4 values = vec4( + getValue(batch, xD, xR, xC, ch), + initializationValue, + initializationValue, + initializationValue + ); + + ${un} + } else if (${Vn===2}) { + vec4 values = vec4( + getValue(batch, xD, xR, xC, ch), + getValue(batch, xD, xR, xC + ${We}, ch), + initializationValue, + initializationValue + ); + + ${un} + } else if (${Vn===3}) { + vec4 values = vec4( + getValue(batch, xD, xR, xC, ch), + getValue(batch, xD, xR, xC + ${We}, ch), + getValue(batch, xD, xR, xC + 2 * ${We}, ch), + initializationValue + ); + + ${un} + } + } + } + setOutput(${yn}); + } + `}}function Bxe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e;Sk(R,"avgPool");const{filterSize:q,strides:re,pad:fe,dimRoundingMode:he}=b,be=1;Jn(Fv(re,be),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${re} and dilations '${be}'`);const Pe=w0(R.shape,q,re,be,fe,he);if(Pe.filterWidth===1&&Pe.filterHeight===1&&$f(Pe.inShape,Pe.outShape))return ug({inputs:{x:R},backend:n});const je=new cC(Pe,"avg",!1);return n.runWebGLProgram(je,[R],"float32")}const Uxe={kernelName:YL,backendName:"webgl",kernelFunc:Bxe};function $xe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{filterSize:q,strides:re,pad:fe,dimRoundingMode:he,dataFormat:be}=b,Pe=[1,1,1],je=S_(R.shape,q,re,Pe,fe,he,be),We=new NO(je,"avg",!1);return n.runWebGLProgram(We,[R],"float32")}const Vxe={kernelName:ZL,backendName:"webgl",kernelFunc:$xe};class jxe{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const n=e.filterHeight,b=e.filterWidth,R=e.strideHeight,q=e.strideWidth,re=e.dilationHeight,fe=e.dilationWidth,he=e.effectiveFilterHeight,be=e.effectiveFilterWidth,Pe=he-1-e.padInfo.top,je=be-1-e.padInfo.left,We=1/(n*b);this.userCode=` + const ivec2 pads = ivec2(${Pe}, ${je}); + const float avgMultiplier = float(${We}); + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + + ivec2 dyRCCorner = coords.yz - pads; + int dyRCorner = dyRCCorner.x; + int dyCCorner = dyRCCorner.y; + + // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + for (int wR = 0; wR < ${he}; + wR += ${re}) { + float dyR = float(dyRCorner + wR) / ${R}.0; + + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + for (int wC = 0; wC < ${be}; + wC+= ${fe}) { + float dyC = float(dyCCorner + wC) / ${q}.0; + + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + float dyValue = getDy(b, idyR, idyC, d); + + dotProd += dyValue * avgMultiplier; + } + } + setOutput(dotProd); + } + `}}class Gxe{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const n=e.filterDepth,b=e.filterHeight,R=e.filterWidth,q=e.strideDepth,re=e.strideHeight,fe=e.strideWidth,he=e.dilationDepth,be=e.dilationHeight,Pe=e.dilationWidth,je=e.effectiveFilterDepth,We=e.effectiveFilterHeight,ft=e.effectiveFilterWidth,xt=je-1-e.padInfo.front,zt=We-1-e.padInfo.top,Ft=ft-1-e.padInfo.left,jt=1/(n*b*R);this.userCode=` + const ivec3 pads = ivec3(${xt}, ${zt}, ${Ft}); + const float avgMultiplier = float(${jt}); + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int ch = coords.u; + + ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; + int dyDCorner = dyCorner.x; + int dyRCorner = dyCorner.y; + int dyCCorner = dyCorner.z; + + // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get + // dx(xD, xR, xC, ch). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + + for (int wD = 0; wD < ${je}; + wD += ${he}) { + float dyD = float(dyDCorner + wD) / ${q}.0; + + if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { + continue; + } + int idyD = int(dyD); + + for (int wR = 0; wR < ${We}; + wR += ${be}) { + float dyR = float(dyRCorner + wR) / ${re}.0; + + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || + fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + for (int wC = 0; wC < ${ft}; + wC += ${Pe}) { + float dyC = float(dyCCorner + wC) / ${fe}.0; + + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + float dyValue = getDy(batch, idyD, idyR, idyC, ch); + + dotProd += dyValue * avgMultiplier; + } + } + } + setOutput(dotProd); + } + `}}function qxe(u){const{inputs:e,backend:n,attrs:b}=u,{dy:R,input:q}=e,re=q,{filterSize:fe,strides:he,pad:be,dimRoundingMode:Pe}=b,je=[1,1,1],We=S_(re.shape,fe,he,je,be,Pe),ft=new Gxe(We);return n.runWebGLProgram(ft,[R],re.dtype)}const Hxe={kernelName:m8,backendName:"webgl",kernelFunc:qxe};function Wxe(u){const{inputs:e,backend:n,attrs:b}=u,{dy:R,input:q}=e,re=q;Sk([R,q],"avgPoolGrad");const{filterSize:fe,strides:he,pad:be}=b,Pe=w0(re.shape,fe,he,1,be),je=new jxe(Pe);return n.runWebGLProgram(je,[R],re.dtype)}const Xxe={kernelName:v8,backendName:"webgl",kernelFunc:Wxe};function Yxe(u){const{inputs:e,backend:n,attrs:b}=u,{a:R,b:q}=e,{transposeA:re,transposeB:fe}=b;return $L({a:R,b:q,transposeA:re,transposeB:fe,backend:n})}const Zxe={kernelName:KL,backendName:"webgl",kernelFunc:Yxe};class Kxe{constructor(e,n,b,R,q,re){this.outputShape=[],this.variableNames=["x","mean","variance"],Yu(e,n),Yu(e,b);let fe="0.0";R!=null&&(Yu(e,R),this.variableNames.push("offset"),fe="getOffsetAtOutCoords()");let he="1.0";q!=null&&(Yu(e,q),this.variableNames.push("scale"),he="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` + void main() { + float x = getXAtOutCoords(); + float mean = getMeanAtOutCoords(); + float variance = getVarianceAtOutCoords(); + float offset = ${fe}; + float scale = ${he}; + float inv = scale * inversesqrt(variance + float(${re})); + setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1))); + } + `}}class Jxe{constructor(e,n,b,R,q,re){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],Yu(e,n),Yu(e,b);let fe="vec4(0.0)";R!=null&&(Yu(e,R),this.variableNames.push("offset"),fe="getOffsetAtOutCoords()");let he="vec4(1.0)";q!=null&&(Yu(e,q),this.variableNames.push("scale"),he="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` + void main() { + vec4 offset = ${fe}; + vec4 scale = ${he}; + + vec4 x = getXAtOutCoords(); + vec4 mean = getMeanAtOutCoords(); + vec4 variance = getVarianceAtOutCoords(); + + vec4 inv = scale * inversesqrt(variance + vec4(${re})); + + setOutput((x - mean) * inv + offset); + } + `}}const Qxe=({inputs:u,backend:e,attrs:n})=>{const{x:b,mean:R,variance:q,offset:re,scale:fe}=u;Jn(R.shape.length===q.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),Jn(re==null||R.shape.length===re.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),Jn(fe==null||R.shape.length===fe.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:he}=n;he==null&&(he=.001);const be=[b,R,q];let Pe=null;re!=null&&(Pe=re.shape,be.push(re));let je=null;fe!=null&&(je=fe.shape,be.push(fe));const We=co().getBool("WEBGL_PACK_NORMALIZATION")?new Jxe(b.shape,R.shape,q.shape,Pe,je,he):new Kxe(b.shape,R.shape,q.shape,Pe,je,he);return e.runWebGLProgram(We,be,be[0].dtype)},ebe={kernelName:uR,backendName:"webgl",kernelFunc:Qxe};class tbe{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const n=Th(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const b=rbe(this.rank);let R;const q=e.map((re,fe)=>`sourceLoc.${r8[fe]} = start[${fe}] + coords.${r8[fe]};`);R=` + ${n} sourceLoc; + ${n} coords = getOutputCoords(); + ${q.join(` +`)} + `,this.userCode=` + void main() { + ${R} + setOutput(getSource(${b})); + } + `}}const r8=["x","y","z","w","u","v"];function rbe(u){if(u===1)return"sourceLoc";if(u<=6)return r8.slice(0,u).map(e=>"sourceLoc."+e).join(",");throw Error(`Slicing for rank ${u} is not yet supported`)}class nbe{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=Th(this.rank),b=vm("coords",this.rank),R=vm("sourceLoc",this.rank),q=this.rank===1?"sourceLoc":`vec2(${R.slice(-2).join()})`,re=`getChannel(getSource(${R.join()}), ${q})`,fe=` + result.x = ${re}; + if (++${b[this.rank-1]} < ${e[this.rank-1]}) { + ++${R[this.rank-1]}; + result.y = ${re}; + --${R[this.rank-1]}; + } + `,he=this.rank===1?"":` + --${b[this.rank-1]}; + if (++${b[this.rank-2]} < ${e[this.rank-2]}) { + ++${R[this.rank-2]}; + result.z = ${re}; + if (++${b[this.rank-1]} < ${e[this.rank-1]}) { + ++${R[this.rank-1]}; + result.w = ${re}; + } + } + `,be=this.rank<=4?`sourceLoc = coords + + ${n}(${e.map((Pe,je)=>`start[${je}]`).join()});`:e.map((Pe,je)=>`${R[je]} = ${b[je]} + start[${je}];`).join(` +`);this.userCode=` + void main() { + ${n} coords = getOutputCoords(); + ${n} sourceLoc; + ${be} + vec4 result = vec4(0.); + ${fe} + ${he} + setOutput(result); + } + `}}function abe(u,e,n,b){const R=b.texData.get(u.dataId),q=b.makeTensorInfo(n,u.dtype),re=b.texData.get(q.dataId);Object.assign(re,R),re.refCount=1,re.shape=n,re.dtype=u.dtype;let fe=oV(e,Zl(u.shape));R.slice&&(fe+=R.slice.flatOffset),re.slice={flatOffset:fe,origDataId:R.slice&&R.slice.origDataId||u.dataId};const he=b.dataRefCount.get(re.slice.origDataId)||1;return b.dataRefCount.set(re.slice.origDataId,he+1),q}function eS(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{begin:q,size:re}=b,[fe,he]=DN(R,q,re);if(nV(R,fe,he),xo(he)===0)return n.makeTensorInfo(he,R.dtype,[]);if(n.shouldExecuteOnCPU([R])||R.dtype==="string"){const je=n.texData.get(R.dataId),We=Z1e(je.values,fe,he,R.shape,R.dtype);return n.makeTensorInfo(he,R.dtype,We)}const{isPacked:be}=n.texData.get(R.dataId),Pe=iV(R.shape,fe,he);if(be||!Pe){const je=co().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new nbe(he):new tbe(he),We=[fe];return n.runWebGLProgram(je,[R],R.dtype,We)}return n.uploadToGPU(R.dataId),abe(R,fe,he,n)}const ibe={kernelName:FR,backendName:"webgl",kernelFunc:eS};const obe=u=>{const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{blockShape:q,crops:re}=b;Jn(R.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");const fe=q.reduce((Re,Lr)=>Re*Lr),he=hk(R.shape,q,fe),be=dk(he.length,q.length),Pe=pk(R.shape,q,fe),je=ON(re,q.length),We=FN(Pe,re,q.length),ft=[],xt=$s({inputs:{x:R},backend:n,attrs:{shape:he}}),zt=gm({inputs:{x:xt},backend:n,attrs:{perm:be}}),Ft=$s({inputs:{x:zt},backend:n,attrs:{shape:Pe}}),jt=eS({inputs:{x:Ft},backend:n,attrs:{begin:je,size:We}});return ft.push(xt),ft.push(zt),ft.push(Ft),ft.forEach(Re=>n.disposeIntermediateTensorInfo(Re)),jt},sbe={kernelName:JL,backendName:"webgl",kernelFunc:obe};function lbe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,weights:q}=e,{size:re}=b,fe=n.readSync(R.dataId),he=n.readSync(q.dataId),be=vH(fe,he,q.dtype,q.shape,re);return n.makeTensorInfo([re],q.dtype,be)}const ube={kernelName:g8,backendName:"webgl",kernelFunc:lbe};const cbe=` + int r = int(a.r) & int(b.r); + int g = int(a.g) & int(b.g); + int rb = int(a.b) & int(b.b); + int ra = int(a.a) & int(b.a); + return vec4(r, g, rb, ra); +`,fbe=` + return float(int(a.r) & int(b.r)); +`;function hbe(u){const{inputs:e,backend:n}=u,{a:b,b:R}=e,q=co().getBool("WEBGL_PACK_BINARY_OPERATIONS"),re=co().getNumber("WEBGL_VERSION");if(n.shouldExecuteOnCPU([b,R])||re===1){const he=n.texData.get(b.dataId).values,be=n.texData.get(R.dataId).values,[Pe,je]=x1e(b.shape,R.shape,he,be,b.dtype),We=n.makeTensorInfo(je,b.dtype),ft=n.texData.get(We.dataId);return ft.values=Pe,We}let fe;return q?fe=new JA(cbe,b.shape,R.shape,!1):fe=new R2(fbe,b.shape,R.shape),n.runWebGLProgram(fe,[b,R],b.dtype)}const dbe={kernelName:y8,backendName:"webgl",kernelFunc:hbe};function pbe(u){const{inputs:e,backend:n}=u,{s0:b,s1:R}=e,q=n.readSync(b.dataId),re=n.readSync(R.dataId),fe=Yu(Array.from(q),Array.from(re));return n.makeTensorInfo([fe.length],"int32",Int32Array.from(fe))}const vbe={kernelName:kU,backendName:"webgl",kernelFunc:pbe};const mbe="return float(a != b);",MH=kv({opSnippet:mbe,cpuKernelImpl:$1e,dtype:"bool"}),gbe={kernelName:ER,backendName:"webgl",kernelFunc:MH};function Ck(u){const{inputs:e,backend:n}=u,{input:b}=e,R=n.texData.get(b.dataId);return ug({inputs:{x:R.complexTensorInfos.real},backend:n})}const ybe={kernelName:j8,backendName:"webgl",kernelFunc:Ck};const _be="return float(int(x));";function xbe(u,e){const n=new u1(u.shape,_be),b=e.runWebGLProgram(n,[u],"int32");return{dataId:b.dataId,shape:b.shape,dtype:b.dtype}}function n8(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{dtype:q}=b;if(q==="complex64"){if(R.dtype==="complex64")return ug({inputs:{x:R},backend:n});const re=Mp(R.shape),fe=n8({inputs:{x:R},backend:n,attrs:{dtype:"float32"}}),he=Ab({inputs:{real:fe,imag:re},backend:n});return re.dispose(),n.disposeIntermediateTensorInfo(fe),he}if(R.dtype==="complex64"){const re=Ck({inputs:{input:R},backend:n}),fe=n8({inputs:{x:re},backend:n,attrs:{dtype:q}});return n.disposeIntermediateTensorInfo(re),fe}if(!TU(R.dtype,q)){const re=ug({inputs:{x:R},backend:n});return{dataId:re.dataId,shape:re.shape,dtype:q}}if(n.shouldExecuteOnCPU([R])){const re=n.texData.get(R.dataId).values,[fe,he,be]=b1e(re,R.shape,R.dtype,q);return n.makeTensorInfo(fe,he,be)}if(q==="int32")return xbe(R,n);if(q==="bool"){const re=n.makeTensorInfo([],"bool",zv("bool",1)),he=MH({inputs:{a:R,b:re},backend:n});return n.disposeIntermediateTensorInfo(re),he}throw new Error(`Error in Cast: failed to cast ${R.dtype} to ${q}`)}const bbe={kernelName:xC,backendName:"webgl",kernelFunc:n8};const QB="return ceil(x);",wbe=rf({opSnippet:QB,packedOpSnippet:QB,cpuKernelImpl:w1e}),Tbe={kernelName:bC,backendName:"webgl",kernelFunc:wbe};class Abe{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode=` + + void main() { + float value = getAAtOutCoords(); + if (isnan(value)) { + setOutput(value); + return; + } + + setOutput(clamp(value, minVal, maxVal)); + } + `}}class Sbe{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode=` + void main() { + vec4 value = getAAtOutCoords(); + + if (any(isnan(value))) { + setOutput(value); + return; + } + + setOutput(clamp(value, vec4(minVal), vec4(maxVal))); + } + `}}function Ebe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{clipValueMin:q,clipValueMax:re}=b;let fe;co().getBool("WEBGL_PACK_CLIP")?fe=new Sbe(R.shape):fe=new Abe(R.shape);const he=[[q],[re]];return n.runWebGLProgram(fe,[R],R.dtype,he)}const Cbe={kernelName:wC,backendName:"webgl",kernelFunc:Ebe};class kbe{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` + void main() { + float re = abs(getRealAtOutCoords()); + float im = abs(getImagAtOutCoords()); + float mx = max(re, im); + + // sadly the length function in glsl is not underflow-safe + // (at least not on Intel GPUs). So the safe solution is + // to ensure underflow-safety in all cases. + setOutput( + mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx)) + ); + } + `}}function eU(u,e){return{dataId:e.dataId,dtype:e.dtype,shape:u.shape}}function Mbe(u){const{inputs:e,backend:n}=u,{x:b}=e,R=n.texData.get(b.dataId),q=new kbe(b.shape),re=[eU(b,R.complexTensorInfos.real),eU(b,R.complexTensorInfos.imag)];return n.runWebGLProgram(q,re,re[0].dtype)}const Ibe={kernelName:QL,backendName:"webgl",kernelFunc:Mbe};class Lbe{constructor(e){this.outputShape=[],this.outputShape=h1(e,1),this.variableNames=e.map((re,fe)=>`T${fe}`);const n=new Array(e.length-1);n[0]=e[0][1];for(let re=1;re`T${Ft}`);const he=new Array(e.length-1);he[0]=e[0][n];for(let zt=1;zt= ${he[zt-1]}) { + return getChannel( + getT${zt}(${iL(fe,be,Ft)}), + vec2(${iL(Pe,be,Ft)})); + }`}const ft=he.length,xt=he[he.length-1];We+=` + return getChannel( + getT${ft}(${iL(fe,be,xt)}), + vec2(${iL(Pe,be,xt)}));`,this.userCode=` + float getValue(${fe.map(zt=>"int "+zt)}) { + ${We} + } + + void main() { + ${q} coords = getOutputCoords(); + vec4 result = vec4(getValue(${re}), 0., 0., 0.); + + ${re[R-1]} = ${re[R-1]} + 1; + if (${re[R-1]} < ${b[R-1]}) { + result.g = getValue(${re}); + } + + ${re[R-2]} = ${re[R-2]} + 1; + if (${re[R-2]} < ${b[R-2]}) { + result.a = getValue(${re}); + } + + ${re[R-1]} = ${re[R-1]} - 1; + if (${re[R-2]} < ${b[R-2]} && + ${re[R-1]} < ${b[R-1]}) { + result.b = getValue(${re}); + } + setOutput(result); + } + `}}function iL(u,e,n){const b=u.indexOf(e);return u.map((q,re)=>re===b?`${q} - ${n}`:q).join()}function bD(u){const{inputs:e,backend:n}=u,{input:b}=e,R=n.texData.get(b.dataId);return ug({inputs:{x:R.complexTensorInfos.imag},backend:n})}const Dbe={kernelName:z8,backendName:"webgl",kernelFunc:bD};function ZE(u,e,n){const b=u[0].dtype;if(b==="complex64"){const ft=u.map(Re=>Ck({inputs:{input:Re},backend:n})),xt=u.map(Re=>bD({inputs:{input:Re},backend:n})),zt=ZE(ft,e,n),Ft=ZE(xt,e,n),jt=Ab({inputs:{real:zt,imag:Ft},backend:n});return ft.forEach(Re=>n.disposeIntermediateTensorInfo(Re)),xt.forEach(Re=>n.disposeIntermediateTensorInfo(Re)),n.disposeIntermediateTensorInfo(zt),n.disposeIntermediateTensorInfo(Ft),jt}let R=n.shouldExecuteOnCPU(u);if(b==="string"&&(R=!0),R){const ft=u.map(Cr=>{const yn=[-1,xo(Cr.shape.slice(e))];return $s({inputs:{x:Cr},backend:n,attrs:{shape:yn}})}),xt=ft.map(Cr=>({vals:n.readSync(Cr.dataId),shape:Cr.shape})),zt=h1(ft.map(Cr=>Cr.shape),1),Ft=ft[0].shape[0]===1,jt=T1e(xt,zt,b,Ft),Re=h1(u.map(Cr=>Cr.shape),e),Lr=n.makeTensorInfo(Re,b,jt);return ft.forEach(Cr=>n.disposeIntermediateTensorInfo(Cr)),Lr}const q=u.filter(ft=>xo(ft.shape)>0),re=co().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&q[0].shape.length>1;if(q.length===1){const ft=re?new u1(u[0].shape,eb):new ab(u[0].shape,eb);return n.runWebGLProgram(ft,u,b)}const fe=co().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(q.length>fe){const ft=[];for(let zt=0;ztxt.shape),e);return n.runWebGLProgram(ft,q,b)}const{tensors2D:he,outShape:be}=Pbe(q,e,n),Pe=new Lbe(he.map(ft=>ft.shape)),je=n.runWebGLProgram(Pe,he,b);he.forEach(ft=>n.disposeIntermediateTensorInfo(ft));const We=$s({inputs:{x:je},attrs:{shape:be},backend:n});return n.disposeIntermediateTensorInfo(je),We}function Pbe(u,e,n){const b=h1(u.map(q=>q.shape),e);return{tensors2D:u.map(q=>$s({inputs:{x:q},attrs:{shape:[-1,xo(q.shape.slice(e))]},backend:n})),outShape:b}}function IH(u){const{inputs:e,backend:n,attrs:b}=u,{axis:R}=b,q=Ac(R,e[0].shape)[0],re=e.map(be=>be.shape);PN(re,q);const fe=h1(e.map(be=>be.shape),q);if(xo(fe)===0)return n.makeTensorInfo(fe,e[0].dtype,[]);const he=e.filter(be=>xo(be.shape)>0);return he.length===1?ug({inputs:{x:he[0]},backend:n}):ZE(he,q,n)}const zbe={kernelName:eR,backendName:"webgl",kernelFunc:IH};class LH{constructor(e,n=!1,b=null,R=!1,q=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const re=e.padInfo.top,fe=e.padInfo.left,he=e.strideHeight,be=e.strideWidth,Pe=e.dilationHeight,je=e.dilationWidth,We=e.filterHeight,ft=e.filterWidth,xt=Math.floor(e.inChannels/4)*4,zt=e.inChannels%4,Ft=e.dataFormat==="channelsLast",jt=Ft?1:2,Re=Ft?2:3,Lr=Ft?3:1;let Cr="",Gr="";b&&(R?Cr=`float activation(float a) { + float b = getPreluActivationWeightsAtOutCoords(); + ${b} + }`:q?Cr=`float activation(float a) { + float b = getLeakyreluAlphaAtOutCoords(); + ${b} + }`:Cr=` + float activation(float x) { + ${b} + } + `,Gr="result = activation(result);");const yn=n?"result += getBiasAtOutCoords();":"";n&&this.variableNames.push("bias"),R&&this.variableNames.push("preluActivationWeights"),q&&this.variableNames.push("leakyreluAlpha"),this.userCode=` + ${Cr} + + const ivec2 strides = ivec2(${he}, ${be}); + const ivec2 pads = ivec2(${re}, ${fe}); + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords[0]; + int d2 = coords[${Lr}]; + + ivec2 xRCCorner = + ivec2(coords[${jt}], coords[${Re}]) * strides - pads; + int xRCorner = xRCCorner.x; + int xCCorner = xRCCorner.y; + + // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + for (int wR = 0; wR < ${We}; wR++) { + int xR = xRCorner + wR * ${Pe}; + + if (xR < 0 || xR >= ${e.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${ft}; wC++) { + int xC = xCCorner + wC * ${je}; + + if (xC < 0 || xC >= ${e.inWidth}) { + continue; + } + + for (int d1 = 0; d1 < ${xt}; d1 += 4) { + vec4 wValues = vec4( + getW(wR, wC, d1, d2), + getW(wR, wC, d1 + 1, d2), + getW(wR, wC, d1 + 2, d2), + getW(wR, wC, d1 + 3, d2) + ); + + if (${Ft}) { + vec4 xValues = vec4( + getX(batch, xR, xC, d1), + getX(batch, xR, xC, d1 + 1), + getX(batch, xR, xC, d1 + 2), + getX(batch, xR, xC, d1 + 3) + ); + dotProd += dot(xValues, wValues); + } else { + vec4 xValues = vec4( + getX(batch, d1, xR, xC), + getX(batch, d1 + 1, xR, xC), + getX(batch, d1 + 2, xR, xC), + getX(batch, d1 + 3, xR, xC) + ); + dotProd += dot(xValues, wValues); + } + } + + if (${zt===1}) { + + if (${Ft}) { + dotProd += + getX(batch, xR, xC, ${xt}) * + getW(wR, wC, ${xt}, d2); + } else { + dotProd += + getX(batch, ${xt}, xR, xC) * + getW(wR, wC, ${xt}, d2); + } + + } else if (${zt===2}) { + vec2 wValues = vec2( + getW(wR, wC, ${xt}, d2), + getW(wR, wC, ${xt} + 1, d2) + ); + + if (${Ft}) { + vec2 xValues = vec2( + getX(batch, xR, xC, ${xt}), + getX(batch, xR, xC, ${xt} + 1) + ); + dotProd += dot(xValues, wValues); + } else { + vec2 xValues = vec2( + getX(batch, ${xt}, xR, xC), + getX(batch, ${xt} + 1, xR, xC) + ); + dotProd += dot(xValues, wValues); + } + + } else if (${zt===3}) { + vec3 wValues = vec3( + getW(wR, wC, ${xt}, d2), + getW(wR, wC, ${xt} + 1, d2), + getW(wR, wC, ${xt} + 2, d2) + ); + + if (${Ft}) { + vec3 xValues = vec3( + getX(batch, xR, xC, ${xt}), + getX(batch, xR, xC, ${xt} + 1), + getX(batch, xR, xC, ${xt} + 2) + ); + dotProd += dot(xValues, wValues); + } else { + vec3 xValues = vec3( + getX(batch, ${xt}, xR, xC), + getX(batch, ${xt} + 1, xR, xC), + getX(batch, ${xt} + 2, xR, xC) + ); + dotProd += dot(xValues, wValues); + } + + } + } + } + + float result = dotProd; + ${yn} + ${Gr} + setOutput(result); + } + `}}class Nbe{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const n=e.padInfo.front,b=e.padInfo.top,R=e.padInfo.left,q=e.strideDepth,re=e.strideHeight,fe=e.strideWidth,he=e.dilationDepth,be=e.dilationHeight,Pe=e.dilationWidth,je=e.filterDepth,We=e.filterHeight,ft=e.filterWidth,xt=Math.floor(e.inChannels/4)*4,zt=e.inChannels%4;this.userCode=` + const ivec3 strides = ivec3(${q}, ${re}, ${fe}); + const ivec3 pads = ivec3(${n}, ${b}, ${R}); + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int d2 = coords.u; + + ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; + int xFCorner = xFRCCorner.x; + int xRCorner = xFRCCorner.y; + int xCCorner = xFRCCorner.z; + + // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get + // y(yF, yR, yC, d2). ? = to be determined. : = across all + // values in that axis. + float dotProd = 0.0; + for (int wF = 0; wF < ${je}; wF++) { + int xF = xFCorner + wF * ${he}; + + if (xF < 0 || xF >= ${e.inDepth}) { + continue; + } + + for (int wR = 0; wR < ${We}; wR++) { + int xR = xRCorner + wR * ${be}; + + if (xR < 0 || xR >= ${e.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${ft}; wC++) { + int xC = xCCorner + wC * ${Pe}; + + if (xC < 0 || xC >= ${e.inWidth}) { + continue; + } + + for (int d1 = 0; d1 < ${xt}; d1 += 4) { + vec4 xValues = vec4( + getX(batch, xF, xR, xC, d1), + getX(batch, xF, xR, xC, d1 + 1), + getX(batch, xF, xR, xC, d1 + 2), + getX(batch, xF, xR, xC, d1 + 3) + ); + vec4 wValues = vec4( + getW(wF, wR, wC, d1, d2), + getW(wF, wR, wC, d1 + 1, d2), + getW(wF, wR, wC, d1 + 2, d2), + getW(wF, wR, wC, d1 + 3, d2) + ); + + dotProd += dot(xValues, wValues); + } + + if (${zt===1}) { + dotProd += + getX(batch, xF, xR, xC, ${xt}) * + getW(wF, wR, wC, ${xt}, d2); + } else if (${zt===2}) { + vec2 xValues = vec2( + getX(batch, xF, xR, xC, ${xt}), + getX(batch, xF, xR, xC, ${xt} + 1) + ); + vec2 wValues = vec2( + getW(wF, wR, wC, ${xt}, d2), + getW(wF, wR, wC, ${xt} + 1, d2) + ); + dotProd += dot(xValues, wValues); + } else if (${zt===3}) { + vec3 xValues = vec3( + getX(batch, xF, xR, xC, ${xt}), + getX(batch, xF, xR, xC, ${xt} + 1), + getX(batch, xF, xR, xC, ${xt} + 2) + ); + vec3 wValues = vec3( + getW(wF, wR, wC, ${xt}, d2), + getW(wF, wR, wC, ${xt} + 1, d2), + getW(wF, wR, wC, ${xt} + 2, d2) + ); + dotProd += dot(xValues, wValues); + } + } + } + } + setOutput(dotProd); + } + `}}class RH{constructor(e,n=!1,b=null,R=!1,q=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=Uv(this.outputShape.length);const re=e.padInfo.left,fe=e.strideWidth,he=e.dilationWidth,be=e.filterHeight,Pe=e.filterWidth,je=Pe;let We=` + int xR; int xC; int xCOffset; + vec4 wTexel; vec4 previous; vec4 final;`;for(let Ft=0;Ft=0 && xR < inDims[0]) { + `;for(let Ft=0;Ft<(je+1)/2;Ft++){const jt=Ft*2;if(We+=` + xC = xCCorner + ${jt*he}; + `,fe===1){if(jt= 0 && xCOffset < inDims[1] && xTexelC${jt}Ready == 0) { + xTexelC${jt} = getX(batch, xR, xCOffset, d1); + + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + xTexelC${jt}.zw = vec2(0.0); + } + xTexelC${jt}Ready = 1; + } + `,he===1&&jt>0?We+=` + xC${jt} = vec4(xTexelC${jt-2}.zw, xTexelC${jt}.xy); + `:We+=` + xCOffset = xC + 1 - 2; + + if (xCOffset >= 0 && xCOffset < inDims[1]) { + previous = getX(batch, xR, xCOffset, d1); + + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + previous.zw = vec2(0.0); + } + + xC${jt} = vec4(previous.zw, xTexelC${jt}.xy); + } else { + xC${jt} = vec4(0.0, 0.0, xTexelC${jt}.xy); + } + `):We+=` + if (xC >= 0 && xC < inDims[1] && xTexelC${jt}Ready == 0) { + xTexelC${jt} = getX(batch, xR, xC, d1); + if (xC + 1 >= inDims[1]) { + xTexelC${jt}.zw = vec2(0.0); + } + xTexelC${jt}Ready = 1; + } + + xC${jt} = xTexelC${jt}; + `,jt+1= 0 && xCOffset < inDims[1] && xTexelC${jt+1}Ready == 0) { + xTexelC${jt+1} = getX(batch, xR, xCOffset, d1); + + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + xTexelC${jt+1}.zw = vec2(0.0); + } + xTexelC${jt+1}Ready = 1; + } + `,he>1?We+=` + xCOffset -= 2; + if (xCOffset >= 0 && xCOffset < inDims[1]) { + previous = getX(batch, xR, xCOffset, d1); + xC${jt+1} = vec4(previous.zw, xTexelC${jt+1}.xy); + } else { + xC${jt+1} = vec4(0.0, 0.0, xTexelC${jt+1}.xy); + } + `:We+=` + xC${jt+1} = vec4(xTexelC${jt}.zw, xTexelC${jt+1}.xy); + `):Re===1?We+=` + xC${jt+1} = xTexelC${jt}; + `:We+=` + xCOffset = xC + ${Re}; + + if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${jt+1}Ready == 0) { + xTexelC${jt+1} = getX(batch, xR, xCOffset, d1); + if (xCOffset + 1 >= inDims[1]) { + xTexelC${jt+1}.zw = vec2(0.0); + } + xTexelC${jt+1}Ready = 1; + } + + xC${jt+1} = xTexelC${jt+1}; + `}}else jt= 0 && xCOffset < inDims[1] && xTexelC${jt}Ready == 0) { + xTexelC${jt} = getX(batch, xR, xCOffset, d1); + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + xTexelC${jt}.zw = vec2(0.0); + } + xTexelC${jt}Ready = 1; + } + + if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${jt+1}Ready == 0) { + xTexelC${jt+1} = getX(batch, xR, xC + 1, d1); + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xC + 2 >= inDims[1]) { + xTexelC${jt+1}.zw = vec2(0.0); + } + xTexelC${jt+1}Ready = 1; + } + + xC${jt} = vec4(xTexelC${jt}.zw, xTexelC${jt+1}.zw); + `,jt+1= 0 && xCOffset < inDims[1]) { + final = getX(batch, xR, xCOffset, d1); + } + xC${jt+1} = vec4(xTexelC${jt+1}.xy, final.xy); + `)):(We+=` + if(xC >= 0 && xC < inDims[1] && xTexelC${jt}Ready == 0) { + xTexelC${jt} = getX(batch, xR, xC, d1); + if (xC + 1 >= inDims[1]) { + xTexelC${jt}.zw = vec2(0.0); + } + xTexelC${jt}Ready = 1; + } + + xCOffset = xC + strides[1]; + if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${jt+1}Ready == 0) { + xTexelC${jt+1} = getX(batch, xR, xCOffset, d1); + if (xCOffset + 1 >= inDims[1]) { + xTexelC${jt+1}.zw = vec2(0.); + } + xTexelC${jt+1}Ready = 1; + } + + xC${jt} = vec4( + xTexelC${jt}.xy, xTexelC${jt+1}.xy); + `,jt+1= 0) { + // Use custom imod instead mod. On Intel GPU, mod may generate + // unexpected value. + // https://github.com/tensorflow/tfjs/issues/5447 + offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1]; + d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) / + inChannels); + + if(d1 < inputShape[${fe}] && d1 >= 0) { + + ch = imod(pos, inChannels); + + if (${q}) { + innerDims = vec2(d1, ch); + result[${Pe*2+je}] = getChannel( + getA(rc.x, d0, int(innerDims.x), + int(innerDims.y)), innerDims); + } else { + innerDims = vec2(d0, d1); + result[${Pe*2+je}] = getChannel( + getA(rc.x, ch, int(innerDims.x), + int(innerDims.y)), innerDims); + } + } + } + } + `;this.userCode=` + void main() { + ivec3 rc = getOutputCoords(); + + vec4 result = vec4(0); + + int blockIndex, pos, offsetY, d0, offsetX, d1, ch; + vec2 innerDims; + + ${be} + + ${R.output} = result; + } + `}}function VL(u,e){const n=u.length;return n>=3?e?[...u.slice(0,-3),u[n-3]*u[n-2],u[n-1]]:[...u.slice(0,-3),u[n-3],u[n-2]*u[n-1]]:!e&&n===1&&u[0]>1?[u[0],1]:null}function DH({x:u,filter:e,convInfo:n,backend:b,bias:R=null,preluActivationWeights:q=null,leakyreluAlpha:re=0,activation:fe=null}){const he=u.shape,be=b.texData.get(u.dataId),Pe=n.inChannels,je=he[0]*he[1]*he[2],We=n.outChannels,ft=n.dataFormat==="channelsLast",xt=!1,zt=!1;let Ft;const jt=[];if(q!=null){const Cr=VL(q.shape,ft);Cr!=null&&(q=$s({inputs:{x:q},backend:b,attrs:{shape:Cr}}),jt.push(q))}if(R!=null){const Cr=VL(R.shape,ft);Cr!=null&&(R=$s({inputs:{x:R},backend:b,attrs:{shape:Cr}}),jt.push(R))}if(!((je===1||We===1)&&Pe>SH)&&be.isPacked&&ft&&be.texture!=null&&he[2]%2!==0&&$f(be.shape.slice(-3),he.slice(-3))){const Cr=he[0]*he[1]*(he[2]+1),Gr={dataId:u.dataId,shape:[1,Cr,n.inChannels],dtype:u.dtype},yn=be.shape;be.shape=be.shape.slice(),be.shape[be.shape.length-2]++,Jn(UL(be.shape,Gr.shape),()=>`packed reshape ${be.shape} to ${Gr.shape} isn't free`);const Pn=$s({inputs:{x:e},backend:b,attrs:{shape:[1,n.inChannels,n.outChannels]}});jt.push(Pn);const Vn=$L({a:Gr,b:Pn,backend:b,transposeA:xt,transposeB:zt,bias:R,activation:fe,preluActivationWeights:q,leakyreluAlpha:re}),un=b.texData.get(Vn.dataId);Jn(un.isPacked,()=>"batchMatMul result is expected to be packed"),be.shape=yn,un.shape=n.outShape,Ft=ug({inputs:{x:Vn},backend:b}),Ft.shape=n.outShape,jt.push(Vn)}else{const Cr=n.outHeight*n.outWidth,Gr=$s({inputs:{x:u},backend:b,attrs:{shape:ft?[n.batchSize,Cr,n.inChannels]:[n.batchSize,n.inChannels,Cr]}}),yn=$s({inputs:{x:e},backend:b,attrs:{shape:[1,n.inChannels,n.outChannels]}}),Pn=$L({a:ft?Gr:yn,b:ft?yn:Gr,transposeA:!ft,transposeB:zt,backend:b,bias:R,activation:fe,preluActivationWeights:q,leakyreluAlpha:re});Ft=$s({inputs:{x:Pn},backend:b,attrs:{shape:n.outShape}}),jt.push(Gr),jt.push(yn),jt.push(Pn)}for(const Cr of jt)b.disposeIntermediateTensorInfo(Cr);return Ft}function PH({x:u,filter:e,convInfo:n,backend:b,bias:R=null,preluActivationWeights:q=null,leakyreluAlpha:re=0,activation:fe=null}){const{filterWidth:he,filterHeight:be,inChannels:Pe,outWidth:je,outHeight:We,dataFormat:ft}=n,xt=ft==="channelsLast",zt=he*be*Pe,Ft=We*je,jt=[n.batchSize,zt,Ft],Re=!0,Lr=!1,Cr=[];if(q!=null){const ai=VL(q.shape,xt);ai!=null&&(q=$s({inputs:{x:q},backend:b,attrs:{shape:ai}}),Cr.push(q))}if(R!=null){const ai=VL(R.shape,xt);ai!=null&&(R=$s({inputs:{x:R},backend:b,attrs:{shape:ai}}),Cr.push(R))}const Gr=$s({inputs:{x:e},backend:b,attrs:{shape:[1,zt,xo(e.shape)/zt]}});Cr.push(Gr);const yn=new Obe(jt,n),Pn=[u.shape,[n.padInfo.top,n.padInfo.left],[n.strideHeight,n.strideWidth],[n.dilationHeight,n.dilationWidth],[n.inChannels],[n.filterWidth*n.inChannels],[n.outWidth]],Vn=b.runWebGLProgram(yn,[u],"float32",Pn),un=$s({inputs:{x:Vn},backend:b,attrs:{shape:jt}});Cr.push(Vn),Cr.push(un);const Nn=R!=null,Kr=q!=null,Ma=fe==="leakyrelu",ui=fe?uC(fe,!0):null,da=new AH(xt?un.shape:Gr.shape,xt?Gr.shape:un.shape,xt?[n.batchSize,Ft,n.outChannels]:[n.batchSize,n.outChannels,Ft],Re,Lr,Nn,ui,Kr,Ma),Ia=xt?[un,Gr]:[Gr,un];if(R&&Ia.push(R),Kr&&Ia.push(q),Ma){const ai=b.makeTensorInfo([],"float32",gb(re,"float32"));Ia.push(ai),Cr.push(ai)}const aa=b.runWebGLProgram(da,Ia,"float32"),Ka=$s({inputs:{x:aa},backend:b,attrs:{shape:n.outShape}});Cr.push(aa);for(const ai of Cr)b.disposeIntermediateTensorInfo(ai);return Ka}function Fbe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,filter:q}=e,{strides:re,pad:fe,dataFormat:he,dilations:be,dimRoundingMode:Pe}=b,je=E_(he),We=Ev(R.shape,q.shape,re,be,fe,Pe,!1,je);let ft;if(We.filterHeight===1&&We.filterWidth===1&&We.dilationHeight===1&&We.dilationWidth===1&&We.strideHeight===1&&We.strideWidth===1&&(We.padInfo.type==="SAME"||We.padInfo.type==="VALID"))ft=DH({x:R,filter:q,convInfo:We,backend:n});else if(We.strideWidth<=2&&je==="channelsLast"&&co().getBool("WEBGL_EXP_CONV")){const zt=new RH(We),Ft=[[We.padInfo.top,We.padInfo.left],[We.strideHeight,We.strideWidth],[We.dilationHeight,We.dilationWidth],[We.inHeight,We.inWidth]];ft=n.runWebGLProgram(zt,[R,q],"float32",Ft)}else if(co().getBool("WEBGL_CONV_IM2COL"))ft=PH({x:R,filter:q,convInfo:We,backend:n});else{const zt=new LH(We);ft=n.runWebGLProgram(zt,[R,q],"float32")}const xt=$s({inputs:{x:ft},backend:n,attrs:{shape:We.outShape}});return n.disposeIntermediateTensorInfo(ft),xt}const Bbe={kernelName:tR,backendName:"webgl",kernelFunc:Fbe};class Ube{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const n=e.strideHeight,b=e.strideWidth,R=e.padInfo.top,q=e.padInfo.left,re=e.dataFormat==="channelsLast";this.userCode=` + void main() { + ivec4 coords = getOutputCoords(); + int wR = coords.x; + int wC = coords.y; + int d1 = coords.z; + int d2 = coords.w; + + // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + + for (int b = 0; b < ${e.batchSize}; b++) { + for (int yR = 0; yR < ${e.outHeight}; yR++) { + int xR = wR + yR * ${n} - ${R}; + + if (xR < 0 || xR >= ${e.inHeight}) { + continue; + } + + for (int yC = 0; yC < ${e.outWidth}; yC++) { + int xC = wC + yC * ${b} - ${q}; + + if (xC < 0 || xC >= ${e.inWidth}) { + continue; + } + + ${re?`float dyValue = getDy(b, yR, yC, d2); + float xValue = getX(b, xR, xC, d1); + dotProd += (xValue * dyValue);`:`float dyValue = getDy(b, d2, yR, yC); + float xValue = getX(b, d1, xR, xC); + dotProd += (xValue * dyValue);`} + } + } + } + setOutput(dotProd); + } + `}}class $be{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const n=e.filterHeight,b=e.filterWidth,R=e.strideHeight,q=e.strideWidth,re=e.dataFormat==="channelsLast",fe=n-1-e.padInfo.top,he=b-1-e.padInfo.left,be=re?1:2,Pe=re?2:3,je=re?3:1;this.userCode=` + const ivec2 pads = ivec2(${fe}, ${he}); + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords[0]; + int d1 = coords[${je}]; + + ivec2 dyCorner = ivec2(coords[${be}], coords[${Pe}]) - pads; + int dyRCorner = dyCorner.x; + int dyCCorner = dyCorner.y; + + // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + for (int wR = 0; wR < ${n}; wR++) { + float dyR = float(dyRCorner + wR) / ${R}.0; + + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + int wRPerm = ${n} - 1 - wR; + + for (int wC = 0; wC < ${b}; wC++) { + float dyC = float(dyCCorner + wC) / ${q}.0; + + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + int wCPerm = ${b} - 1 - wC; + + for (int d2 = 0; d2 < ${e.outChannels}; d2++) { + + if (${re}) { + float xValue = getDy(batch, idyR, idyC, d2); + float wValue = getW(wRPerm, wCPerm, d1, d2); + dotProd += xValue * wValue; + } else { + float xValue = getDy(batch, d2, idyR, idyC); + float wValue = getW(wRPerm, wCPerm, d1, d2); + dotProd += xValue * wValue; + } + + } + } + } + setOutput(dotProd); + } + `}}class Vbe{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const n=e.strideDepth,b=e.strideHeight,R=e.strideWidth,q=e.padInfo.front,re=e.padInfo.top,fe=e.padInfo.left;this.userCode=` + void main() { + ivec5 coords = getOutputCoords(); + int wF = coords.x; + int wR = coords.y; + int wC = coords.z; + int d1 = coords.w; + int d2 = coords.u; + + float dotProd = 0.0; + + for (int b = 0; b < ${e.batchSize}; b++) { + for (int yF = 0; yF < ${e.outDepth}; yF++) { + int xF = wF + yF * ${n} - ${q}; + + if (xF < 0 || xF >= ${e.inDepth}) { + continue; + } + + for (int yR = 0; yR < ${e.outHeight}; yR++) { + int xR = wR + yR * ${b} - ${re}; + + if (xR < 0 || xR >= ${e.inHeight}) { + continue; + } + + for (int yC = 0; yC < ${e.outWidth}; yC++) { + int xC = wC + yC * ${R} - ${fe}; + + if (xC < 0 || xC >= ${e.inWidth}) { + continue; + } + + float dyValue = getDy(b, yF, yR, yC, d2); + float xValue = getX(b, xF, xR, xC, d1); + dotProd += (xValue * dyValue); + } + } + } + } + setOutput(dotProd); + } + `}}class jbe{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const n=e.filterDepth,b=e.filterHeight,R=e.filterWidth,q=e.strideDepth,re=e.strideHeight,fe=e.strideWidth,he=n-1-e.padInfo.front,be=b-1-e.padInfo.top,Pe=R-1-e.padInfo.left;this.userCode=` + const ivec3 pads = ivec3(${he}, ${be}, ${Pe}); + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int d1 = coords.u; + + + ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; + int dyFCorner = dyCorner.x; + int dyRCorner = dyCorner.y; + int dyCCorner = dyCorner.z; + + float dotProd = 0.0; + for (int wF = 0; wF < ${n}; wF++) { + float dyF = float(dyFCorner + wF) / ${q}.0; + + if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) { + continue; + } + int idyF = int(dyF); + + int wFPerm = ${n} - 1 - wF; + + for (int wR = 0; wR < ${b}; wR++) { + float dyR = float(dyRCorner + wR) / ${re}.0; + + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || + fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + int wRPerm = ${b} - 1 - wR; + + for (int wC = 0; wC < ${R}; wC++) { + float dyC = float(dyCCorner + wC) / ${fe}.0; + + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + int wCPerm = ${R} - 1 - wC; + + for (int d2 = 0; d2 < ${e.outChannels}; d2++) { + float xValue = getDy(batch, idyF, idyR, idyC, d2); + float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2); + dotProd += xValue * wValue; + } + } + } + } + setOutput(dotProd); + } + `}}function Gbe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,dy:q}=e,{strides:re,pad:fe,dataFormat:he,dimRoundingMode:be,filterShape:Pe}=b,je=E_(he),We=Ev(R.shape,Pe,re,1,fe,be,!1,je),ft=new Ube(We);return n.runWebGLProgram(ft,[R,q],"float32")}const qbe={kernelName:x8,backendName:"webgl",kernelFunc:Gbe};class Hbe{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=Uv(this.outputShape.length);const n=e.filterHeight,b=e.filterWidth,R=n-1-e.padInfo.top,q=b-1-e.padInfo.left;this.userCode=` + const ivec2 pads = ivec2(${R}, ${q}); + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords[0]; + int d1 = coords[3]; + + ivec2 dyCorner = ivec2(coords[1], coords[2]) - pads; + int dyRCorner = dyCorner.x; + int dyCCorner = dyCorner.y; + + vec4 result = vec4(0.); + for (int wR = 0; wR < ${n}; wR++) { + float dyR = float(dyRCorner + wR) / strides[0]; + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + int wRPerm = ${n} - 1 - wR; + + for (int wC = 0; wC < ${b}; wC++) { + int wCPerm = ${b} - 1 - wC; + + float dyC = float(dyCCorner + wC) / strides[1]; + bool idyCVal = (dyC >= 0.0) && (dyC < ${e.outWidth}.0) + && (fract(dyC) == 0.0); + int idyC = int(dyC); + + float dyC2 = float(dyCCorner + wC + 1) / strides[1]; + bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${e.outWidth}.0) + && (fract(dyC2) == 0.0); + int idyC2 = int(dyC2); + + if (idyCVal && idyCVal2) { + for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { + vec4 wValue = getW(wRPerm, wCPerm, d1, d2); + vec4 dySample = getDy(batch, idyR, idyC, d2); + vec4 dySample2 = (idyC / 2 == idyC2 / 2) ? + dySample : getDy(batch, idyR, idyC2, d2); + + vec2 dyValue = mod(float(idyC), 2.) == 0. ? + dySample.xy : dySample.zw; + result.xy += vec2(dot(dyValue, wValue.xy), + dot(dyValue, wValue.zw)); + + dyValue = mod(float(idyC2), 2.) == 0. ? + dySample2.xy : dySample2.zw; + result.zw += vec2(dot(dyValue, wValue.xy), + dot(dyValue, wValue.zw)); + } + } else if (idyCVal) { + for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { + vec4 wValue = getW(wRPerm, wCPerm, d1, d2); + vec4 dySample = getDy(batch, idyR, idyC, d2); + vec2 dyValue = mod(float(idyC), 2.) == 0. ? + dySample.xy : dySample.zw; + result.xy += vec2(dot(dyValue, wValue.xy), + dot(dyValue, wValue.zw)); + } + } else if (idyCVal2) { + for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { + vec4 wValue = getW(wRPerm, wCPerm, d1, d2); + vec4 dySample = getDy(batch, idyR, idyC2, d2); + vec2 dyValue = mod(float(idyC2), 2.) == 0. ? + dySample.xy : dySample.zw; + result.zw += vec2(dot(dyValue, wValue.xy), + dot(dyValue, wValue.zw)); + } + } + } + } + setOutput(result); + } + `}}function Wbe(u){const{inputs:e,backend:n,attrs:b}=u,{dy:R,filter:q}=e,{inputShape:re,strides:fe,pad:he,dataFormat:be,dimRoundingMode:Pe}=b,je=E_(be),We=Ev(re,q.shape,fe,1,he,Pe,!1,je);if(co().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&je==="channelsLast"){const ft=[[We.strideHeight,We.strideWidth]],xt=new Hbe(We);return n.runWebGLProgram(xt,[R,q],"float32",ft)}else{const ft=new $be(We);return n.runWebGLProgram(ft,[R,q],"float32")}}const Xbe={kernelName:rR,backendName:"webgl",kernelFunc:Wbe};function Ybe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,filter:q}=e,{strides:re,pad:fe,dilations:he}=b,be=yb(R.shape,q.shape,re,he,fe),Pe=new Nbe(be);return n.runWebGLProgram(Pe,[R,q],"float32")}const Zbe={kernelName:nR,backendName:"webgl",kernelFunc:Ybe};function Kbe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,dy:q}=e,{strides:re,pad:fe,filterShape:he}=b,be=yb(R.shape,he,re,1,fe),Pe=new Vbe(be);return n.runWebGLProgram(Pe,[R,q],"float32")}const Jbe={kernelName:b8,backendName:"webgl",kernelFunc:Kbe};function Qbe(u){const{inputs:e,backend:n,attrs:b}=u,{dy:R,filter:q}=e,{pad:re,strides:fe,inputShape:he}=b,be=yb(he,q.shape,fe,1,re),Pe=new jbe(be);return n.runWebGLProgram(Pe,[R,q],"float32")}const ewe={kernelName:w8,backendName:"webgl",kernelFunc:Qbe};const twe=QA+` + return cos(x); +`,rwe=` + vec4 result = cos(x); + bvec4 isNaN = isnan(x); + ${U2} + return result; +`,nwe=rf({opSnippet:twe,packedOpSnippet:rwe}),awe={kernelName:TC,backendName:"webgl",kernelFunc:nwe};const iwe=` + float e2x = exp(-x); + return (e2x + 1.0 / e2x) / 2.0; +`,owe=rf({opSnippet:iwe}),swe={kernelName:AC,backendName:"webgl",kernelFunc:owe};class lwe{constructor(e,n,b,R,q){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[re,fe,he,be]=e,[Pe]=n,[je,We]=b;this.outputShape=[Pe,je,We,be];const ft=R==="bilinear"?1:0,[xt,zt]=[`${fe-1}.0`,`${he-1}.0`],[Ft,jt,Re]=je>1?[`${(fe-1)/(je-1)}`,"(y2-y1) * height_ratio",`y1*${xt} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${xt}`],[Lr,Cr,Gr]=We>1?[`${(he-1)/(We-1)}`,"(x2-x1) * width_ratio",`x1*${zt} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${zt}`];this.userCode=` + const float height_ratio = float(${Ft}); + const float width_ratio = float(${Lr}); + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int y = coords[1]; + int x = coords[2]; + int d = coords[3]; + + // get box vals + float y1 = getBoxes(b,0); + float x1 = getBoxes(b,1); + float y2 = getBoxes(b,2); + float x2 = getBoxes(b,3); + + // get image in batch index + int bInd = round(getBoxInd(b)); + if(bInd < 0 || bInd >= ${re}) { + return; + } + + float height_scale = ${jt}; + float width_scale = ${Cr}; + + float in_y = ${Re}; + if( in_y < 0.0 || in_y > ${xt} ) { + setOutput(float(${q})); + return; + } + float in_x = ${Gr}; + if( in_x < 0.0 || in_x > ${zt} ) { + setOutput(float(${q})); + return; + } + + vec2 sourceFracIndexCR = vec2(in_x,in_y); + if(${ft} == 1) { + // Compute the four integer indices. + ivec2 sourceFloorCR = ivec2(sourceFracIndexCR); + ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR)); + + float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d); + float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d); + float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d); + float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d); + + vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR); + + float top = topLeft + (topRight - topLeft) * fracCR.x; + float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x; + float newValue = top + (bottom - top) * fracCR.y; + setOutput(newValue); + } else { + // Compute the coordinators of nearest neighbor point. + ivec2 sourceNearestCR = ivec2(floor( + sourceFracIndexCR + vec2(0.5,0.5))); + float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d); + setOutput(newValue); + } + } + `}}const uwe=u=>{const{inputs:e,backend:n,attrs:b}=u,{image:R,boxes:q,boxInd:re}=e,{cropSize:fe,method:he,extrapolationValue:be}=b,Pe=new lwe(R.shape,q.shape,fe,he,be);return n.runWebGLProgram(Pe,[R,q,re],"float32")},cwe={kernelName:A8,backendName:"webgl",kernelFunc:uwe};var fC;(function(u){u.Prod="*",u.Sum="+"})(fC||(fC={}));class tU{constructor(e,n,b,R){this.op=e,this.outputShape=n,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];const q=this.outputShape.length,re=this.op===fC.Prod?"1.0":"0.0",fe=b?re:`getX(${rU(q,"coords",this.op)})`,he=this.outputShape[this.outputShape.length-1];let be="",Pe="";b?(be=R?`end != ${he-1}`:"end != 0",Pe=R?"end + 1":"end - 1"):(be=R?`end + pow2 < ${he}`:"end >= pow2",Pe=R?"end + pow2":"end - pow2"),this.userCode=` + void main() { + ${Th(q)} coords = getOutputCoords(); + int end = ${nU(q,"coords",this.op)}; + float val = ${fe}; + int pow2 = int(pow(2.0, index)); + if (${be}) { + int idx = ${Pe}; + ${nU(q,"coords",this.op)} = idx; + val ${this.op}= getX(${rU(q,"coords",this.op)}); + } + setOutput(val); + } + `}}function rU(u,e,n){if(u===1)return`${e}`;if(u===2)return`${e}.x, ${e}.y`;if(u===3)return`${e}.x, ${e}.y, ${e}.z`;if(u===4)return`${e}.x, ${e}.y, ${e}.z, ${e}.w`;throw new Error(`Cumulative ${n} for rank ${u} is not yet supported`)}function nU(u,e,n){if(u===1)return`${e}`;if(u===2)return`${e}.y`;if(u===3)return`${e}.z`;if(u===4)return`${e}.w`;throw new Error(`Cumulative ${n} for rank ${u} is not yet supported`)}function zH(u,e,n,b,R,q){const re=e.shape.length,fe=kd([b],re);let he=e;fe!=null&&(he=gm({inputs:{x:e},backend:n,attrs:{perm:fe}}));const be=op(1,re)[0];if(be!==re-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${e.shape.length-1} but got axis=${b}`);const Pe=he.shape[be];let je=ug({inputs:{x:he},backend:n});for(let We=0;We<=Math.ceil(Math.log2(Pe))-1;We++){const ft=new tU(u,he.shape,!1,q),xt=[[We]],zt=je;je=n.runWebGLProgram(ft,[je],je.dtype,xt),n.disposeIntermediateTensorInfo(zt)}if(R){const We=new tU(u,he.shape,R,q),ft=je;je=n.runWebGLProgram(We,[je],je.dtype),n.disposeIntermediateTensorInfo(ft)}if(fe!=null){const We=_b(fe),ft=gm({inputs:{x:je},backend:n,attrs:{perm:We}});return n.disposeIntermediateTensorInfo(je),n.disposeIntermediateTensorInfo(he),ft}return je}function fwe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{axis:q,exclusive:re,reverse:fe}=b;return zH(fC.Prod,R,n,q,re,fe)}const hwe={kernelName:T8,backendName:"webgl",kernelFunc:fwe};function dwe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{axis:q,exclusive:re,reverse:fe}=b;return zH(fC.Sum,R,n,q,re,fe)}const pwe={kernelName:aR,backendName:"webgl",kernelFunc:dwe};function vwe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,weights:q}=e,{size:re,binaryOutput:fe}=b;if(R.shape.length===1){const he=n.readSync(R.dataId),be=n.readSync(q.dataId),Pe=vH(he,be,q.dtype,q.shape,re);return n.makeTensorInfo([re],q.dtype,Pe)}else if(R.shape.length===2){const he=n.bufferSync(R),be=n.bufferSync(q),Pe=_1e(he,be,re,fe);return n.makeTensorInfo(Pe.shape,q.dtype,Pe.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${R.shape.length}.`)}const mwe={kernelName:S8,backendName:"webgl",kernelFunc:vwe};class gwe{constructor(e,n,b){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=n,this.dataFormat=b,this.userCode=` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int h = ${this.getHeightCoordString()}; + int w = ${this.getWidthCoordString()}; + int d = ${this.getDepthCoordString()}; + + int in_h = h / ${n}; + int offset_h = imod(h, ${n}); + int in_w = w / ${n}; + int offset_w = imod(w, ${n}); + int offset_d = (offset_h * ${n} + offset_w) * + ${this.getOutputDepthSize()}; + int in_d = d + offset_d; + + float result = ${this.getInputSamplingString()}; + setOutput(result); + } + `}getHeightCoordString(){return this.dataFormat==="NHWC"?"coords[1]":"coords[2]"}getWidthCoordString(){return this.dataFormat==="NHWC"?"coords[2]":"coords[3]"}getDepthCoordString(){return this.dataFormat==="NHWC"?"coords[3]":"coords[1]"}getOutputDepthSize(){return this.dataFormat==="NHWC"?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return this.dataFormat==="NHWC"?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}function ywe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{blockSize:q,dataFormat:re}=b,fe=R.shape[0],he=re==="NHWC"?R.shape[1]:R.shape[2],be=re==="NHWC"?R.shape[2]:R.shape[3],Pe=re==="NHWC"?R.shape[3]:R.shape[1],je=he*q,We=be*q,ft=Pe/(q*q),xt=re==="NHWC"?[fe,je,We,ft]:[fe,ft,je,We],zt=new gwe(xt,q,re);return n.runWebGLProgram(zt,[R],R.dtype)}const _we={kernelName:E8,backendName:"webgl",kernelFunc:ywe};class NH{constructor(e,n=!1,b=null,R=!1,q=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=Uv(this.outputShape.length);const re=e.filterHeight,fe=e.filterWidth,he=e.outChannels/e.inChannels;let be="",Pe="";b&&(R?be=`float activation(float a) { + float b = getPreluActivationWeightsAtOutCoords(); + ${b} + }`:q?be=`float activation(float a) { + float b = getLeakyreluAlphaAtOutCoords(); + ${b} + }`:be=` + float activation(float x) { + ${b} + } + `,Pe="result = activation(result);");const je=n?"result += getBiasAtOutCoords();":"";n&&this.variableNames.push("bias"),R&&this.variableNames.push("preluActivationWeights"),q&&this.variableNames.push("leakyreluAlpha"),this.userCode=` + ${be} + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords.x; + ivec2 xRCCorner = coords.yz * strides - pads; + int d2 = coords.w; + int d1 = d2 / ${he}; + int q = d2 - d1 * ${he}; + + int xRCorner = xRCCorner.x; + int xCCorner = xRCCorner.y; + + // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations. + for (int wR = 0; wR < ${re}; wR++) { + int xR = xRCorner + wR * dilations[0]; + + if (xR < 0 || xR >= inDims[0]) { + continue; + } + + for (int wC = 0; wC < ${fe}; wC++) { + int xC = xCCorner + wC * dilations[1]; + + if (xC < 0 || xC >= inDims[1]) { + continue; + } + + float xVal = getX(batch, xR, xC, d1); + float wVal = getW(wR, wC, d1, q); + dotProd += xVal * wVal; + } + } + + float result = dotProd; + ${je} + ${Pe} + setOutput(result); + } + `}}class OH{constructor(e,n=!1,b=null,R=!1,q=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=Uv(this.outputShape.length);const re=e.outChannels/e.inChannels,fe=e.padInfo.left,he=e.strideWidth,be=e.dilationWidth,Pe=e.filterHeight,je=e.filterWidth,We=je;let ft=` + int xR; int xC; int xCOffset; + vec4 wTexel; vec4 previous; vec4 final;`;for(let jt=0;jt=0 && xR < inDims[0]) { + `;for(let jt=0;jt<(We+1)/2;jt++){const Re=jt*2;if(ft+=` + xC = xCCorner + ${Re*be}; + `,he===1){if(Re= 0 && xCOffset < inDims[1] && xTexelC${Re}Ready == 0) { + xTexelC${Re} = getX(batch, xR, xCOffset, d1); + + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + xTexelC${Re}.zw = vec2(0.0); + } + xTexelC${Re}Ready = 1; + } + `,be===1&&Re>0?ft+=` + xC${Re} = vec4(xTexelC${Re-2}.zw, xTexelC${Re}.xy); + `:ft+=` + xCOffset = xC + 1 - 2; + + if (xCOffset >= 0 && xCOffset < inDims[1]) { + previous = getX(batch, xR, xCOffset, d1); + + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + previous.zw = vec2(0.0); + } + + xC${Re} = vec4(previous.zw, xTexelC${Re}.xy); + } else { + xC${Re} = vec4(0.0, 0.0, xTexelC${Re}.xy); + } + `):ft+=` + if (xC >= 0 && xC < inDims[1] && xTexelC${Re}Ready == 0) { + xTexelC${Re} = getX(batch, xR, xC, d1); + if (xC + 1 >= inDims[1]) { + xTexelC${Re}.zw = vec2(0.0); + } + xTexelC${Re}Ready = 1; + } + + xC${Re} = xTexelC${Re}; + `,Re+1= 0 && xCOffset < inDims[1] && xTexelC${Re+1}Ready == 0) { + xTexelC${Re+1} = getX(batch, xR, xCOffset, d1); + + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + xTexelC${Re+1}.zw = vec2(0.0); + } + xTexelC${Re+1}Ready = 1; + } + `,be>1?ft+=` + xCOffset -= 2; + if (xCOffset >= 0 && xCOffset < inDims[1]) { + previous = getX(batch, xR, xCOffset, d1); + xC${Re+1} = vec4(previous.zw, xTexelC${Re+1}.xy); + } else { + xC${Re+1} = vec4(0.0, 0.0, xTexelC${Re+1}.xy); + } + `:ft+=` + xC${Re+1} = vec4(xTexelC${Re}.zw, xTexelC${Re+1}.xy); + `):Lr===1?ft+=` + xC${Re+1} = xTexelC${Re}; + `:ft+=` + xCOffset = xC + ${Lr}; + + if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${Re+1}Ready == 0) { + xTexelC${Re+1} = getX(batch, xR, xCOffset, d1); + if (xCOffset + 1 >= inDims[1]) { + xTexelC${Re+1}.zw = vec2(0.0); + } + xTexelC${Re+1}Ready = 1; + } + + xC${Re+1} = xTexelC${Re+1}; + `}}else Re= 0 && xCOffset < inDims[1] && xTexelC${Re}Ready == 0) { + xTexelC${Re} = getX(batch, xR, xCOffset, d1); + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + xTexelC${Re}.zw = vec2(0.0); + } + xTexelC${Re}Ready = 1; + } + + if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${Re+1}Ready == 0) { + xTexelC${Re+1} = getX(batch, xR, xC + 1, d1); + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xC + 2 >= inDims[1]) { + xTexelC${Re+1}.zw = vec2(0.0); + } + xTexelC${Re+1}Ready = 1; + } + + xC${Re} = vec4(xTexelC${Re}.zw, xTexelC${Re+1}.zw); + `,Re+1= 0 && xCOffset < inDims[1]) { + final = getX(batch, xR, xCOffset, d1); + } + xC${Re+1} = vec4(xTexelC${Re+1}.xy, final.xy); + `)):(ft+=` + if(xC >= 0 && xC < inDims[1] && xTexelC${Re}Ready == 0) { + xTexelC${Re} = getX(batch, xR, xC, d1); + if (xC + 1 >= inDims[1]) { + xTexelC${Re}.zw = vec2(0.0); + } + xTexelC${Re}Ready = 1; + } + + xCOffset = xC + strides[1]; + if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${Re+1}Ready == 0) { + xTexelC${Re+1} = getX(batch, xR, xCOffset, d1); + if (xCOffset + 1 >= inDims[1]) { + xTexelC${Re+1}.zw = vec2(0.); + } + xTexelC${Re+1}Ready = 1; + } + + xC${Re} = vec4( + xTexelC${Re}.xy, xTexelC${Re+1}.xy); + `,Re+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${re} and dilations '${Pe}'`);const je=Ev(R.shape,q.shape,re,Pe,fe,be,!0);let We;co().getBool("WEBGL_PACK_DEPTHWISECONV")&&je.strideWidth<=2&&je.outChannels/je.inChannels===1?We=new OH(je):We=new NH(je);const ft=[[je.padInfo.top,je.padInfo.left],[je.strideHeight,je.strideWidth],[je.dilationHeight,je.dilationWidth],[je.inHeight,je.inWidth]];return n.runWebGLProgram(We,[R,q],"float32",ft)}const bwe={kernelName:iR,backendName:"webgl",kernelFunc:xwe};class wwe{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const n=e.strideHeight,b=e.strideWidth,R=e.padInfo.top,q=e.padInfo.left,re=e.outChannels/e.inChannels;this.userCode=` + void main() { + ivec4 coords = getOutputCoords(); + int wR = coords.x; + int wC = coords.y; + int d1 = coords.z; + int dm = coords.w; + int d2 = d1 * ${re} + dm; + + float dotProd = 0.0; + + // TO DO: Vec4 over the batch size + for (int b = 0; b < ${e.batchSize}; b++) { + for (int yR = 0; yR < ${e.outHeight}; yR++) { + int xR = wR + yR * ${n} - ${R}; + + if (xR < 0 || xR >= ${e.inHeight}) { + continue; + } + + for (int yC = 0; yC < ${e.outWidth}; yC++) { + int xC = wC + yC * ${b} - ${q}; + + if (xC < 0 || xC >= ${e.inWidth}) { + continue; + } + + float dyValue = getDy(b, yR, yC, d2); + float xValue = getX(b, xR, xC, d1); + dotProd += (xValue * dyValue); + } + } + } + setOutput(dotProd); + } + `}}class Twe{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const n=e.filterHeight,b=e.filterWidth,R=e.strideHeight,q=e.strideWidth,re=n-1-e.padInfo.top,fe=b-1-e.padInfo.left,he=e.outChannels/e.inChannels;this.userCode=` + const ivec2 pads = ivec2(${re}, ${fe}); + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords[0]; + int d1 = coords[3]; + ivec2 dyCorner = coords.yz - pads; + int dyRCorner = dyCorner.x; + int dyCCorner = dyCorner.y; + + float dotProd = 0.0; + + for (int wR = 0; wR < ${n}; wR++) { + float dyR = float(dyRCorner + wR) / ${R}.0; + + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + int wRPerm = ${n} - 1 - wR; + + for (int wC = 0; wC < ${b}; wC++) { + float dyC = float(dyCCorner + wC) / ${q}.0; + + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + int wCPerm = ${b} - 1 - wC; + + // TO DO: Vec4 over the channelMul + for (int dm = 0; dm < ${he}; dm++) { + int d2 = d1 * ${he} + dm; + float xValue = getDy(batch, idyR, idyC, d2); + float wValue = getW(wRPerm, wCPerm, d1, dm); + dotProd += xValue * wValue; + } + } + } + setOutput(dotProd); + } + `}}function Awe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,dy:q}=e,{strides:re,dilations:fe,pad:he,dimRoundingMode:be,filterShape:Pe}=b,je=Ev(R.shape,Pe,re,fe,he,be,!0),We=new wwe(je);return n.runWebGLProgram(We,[R,q],"float32")}const Swe={kernelName:C8,backendName:"webgl",kernelFunc:Awe};function Ewe(u){const{inputs:e,backend:n,attrs:b}=u,{dy:R,filter:q}=e,{strides:re,dilations:fe,pad:he,dimRoundingMode:be,inputShape:Pe}=b,je=Ev(Pe,q.shape,re,fe,he,be,!0),We=new Twe(je);return n.runWebGLProgram(We,[R,q],"float32")}const Cwe={kernelName:k8,backendName:"webgl",kernelFunc:Ewe};class kwe{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode=` + void main() { + ivec2 coords = getOutputCoords(); + float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0; + setOutput(val); + } + `}}function Mwe(u){const{inputs:e,backend:n}=u,{x:b}=e,R=[...b.shape,...b.shape],q=xo(b.shape),re=$s({inputs:{x:b},backend:n,attrs:{shape:[q]}}),fe=new kwe(q),he=n.runWebGLProgram(fe,[re],re.dtype),be=$s({inputs:{x:he},backend:n,attrs:{shape:R}});return n.disposeIntermediateTensorInfo(re),n.disposeIntermediateTensorInfo(he),be}const Iwe={kernelName:MU,backendName:"webgl",kernelFunc:Mwe};class Lwe{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:n,inWidth:b,padInfo:R,strideHeight:q,strideWidth:re,filterHeight:fe,filterWidth:he,dilationHeight:be,dilationWidth:Pe}=e,{top:je,left:We}=R;this.userCode=` + const ivec2 strides = ivec2(${q}, ${re}); + const ivec2 pads = ivec2(${je}, ${We}); + const float neg_infinity = -3.4e38; + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords.x; + int d1 = coords.w; + ivec2 outTopLeftCorner = + coords.yz * strides - pads; + int hBeg = outTopLeftCorner.x; + int wBeg = outTopLeftCorner.y; + + float curVal = neg_infinity; + for (int h = 0; h < ${fe}; h++) { + int hIn = hBeg + h * ${be}; + + if (hIn >= 0 && hIn < ${n}) { + for (int w = 0; w < ${he}; w++) { + int wIn = wBeg + w * ${Pe}; + + if (wIn >= 0 && wIn < ${b}) { + float xVal = getX(batch, hIn, wIn, d1); + float wVal = getW(h, w, d1); + + float val = xVal + wVal; + if (val > curVal) { + curVal = val; + } + } + } + } + } + + float result = curVal; + setOutput(result); + } + `}}function Rwe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,filter:q}=e,{strides:re,pad:fe,dilations:he}=b,be=lk(R.shape,q.shape,re,fe,"NHWC",he);let Pe;const je=new Lwe(be);Pe=n.runWebGLProgram(je,[R,q],"float32");const We=$s({inputs:{x:Pe},backend:n,attrs:{shape:be.outShape}});return n.disposeIntermediateTensorInfo(Pe),We}const Dwe={kernelName:oR,backendName:"webgl",kernelFunc:Rwe};function Pwe(u){const{inputs:e,backend:n,attrs:b}=u,{equation:R}=b,q=e,{allDims:re,summedDims:fe,idDims:he}=HN(R,q.length);XN(re.length,he,q);const{path:be,steps:Pe}=YN(fe,he),je=Pe.length;let We=null,ft=re.length;const xt=[];for(let zt=0;zt=0&&(We=xD({inputs:{x:We},backend:n,attrs:{axis:be[zt]-(re.length-ft),keepDims:!1}}),xt.push(We)),ft--)}for(const zt of xt)zt!==We&&n.disposeIntermediateTensorInfo(zt);return We}const zwe={kernelName:M8,backendName:"webgl",kernelFunc:Pwe};const Nwe="return (x >= 0.0) ? x : (exp(x) - 1.0);",Owe=` + vec4 result; + + result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); + result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0); + result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0); + result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); + + return result; +`,Fwe=rf({opSnippet:Nwe,packedOpSnippet:Owe}),Bwe={kernelName:EC,backendName:"webgl",kernelFunc:Fwe};const Uwe="return (b >= 0.0) ? a : a * (b + 1.0);",$we=` + vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.))); + return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); +`,Vwe=u=>{const{inputs:e,backend:n}=u,{dy:b,y:R}=e,q=co().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new JA($we,b.shape,R.shape):new R2(Uwe,b.shape,R.shape);return n.runWebGLProgram(q,[b,R],b.dtype)},jwe={kernelName:I8,backendName:"webgl",kernelFunc:Vwe};const Gwe=` + return vec4(equal(a, b)); +`,qwe="return float(a == b);",Hwe=kv({opSnippet:qwe,packedOpSnippet:Gwe,dtype:"bool",cpuKernelImpl:A1e}),Wwe={kernelName:sR,backendName:"webgl",kernelFunc:Hwe};const Xwe=` + // Error function is calculated approximately with elementary function. + // See "Handbook of Mathematical Functions with Formulas, + // Graphs, and Mathematical Tables", Abramowitz and Stegun. + float p = ${BN}; + float a1 = ${UN}; + float a2 = ${$N}; + float a3 = ${VN}; + float a4 = ${jN}; + float a5 = ${GN}; + + float sign = sign(x); + x = abs(x); + float t = 1.0 / (1.0 + p * x); + return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x)); +`,Ywe=rf({opSnippet:Xwe}),Zwe={kernelName:CC,backendName:"webgl",kernelFunc:Ywe};const Kwe=QA+` + return exp(x); +`,Jwe=` + vec4 result = exp(x); + bvec4 isNaN = isnan(x); + result.r = isNaN.r ? x.r : result.r; + result.g = isNaN.g ? x.g : result.g; + result.b = isNaN.b ? x.b : result.b; + result.a = isNaN.a ? x.a : result.a; + + return result; +`,FH=rf({opSnippet:Kwe,packedOpSnippet:Jwe,cpuKernelImpl:S1e,dtype:"float32"}),Qwe={kernelName:kC,backendName:"webgl",kernelFunc:FH};function a8(u){const{inputs:e,attrs:n,backend:b}=u,{dim:R}=n,{input:q}=e,re=q.shape.length,fe=q.shape.slice();let he=R;return R<0&&(Jn(-(re+1)<=R,()=>`Axis must be in the interval [${-(re+1)}, ${re}]`),he=re+R+1),fe.splice(he,0,1),$s({inputs:{x:q},backend:b,attrs:{shape:fe}})}const e2e={kernelName:lR,backendName:"webgl",kernelFunc:a8};const aU="return exp(x) - 1.0;",t2e=rf({opSnippet:aU,packedOpSnippet:aU,cpuKernelImpl:E1e}),r2e={kernelName:MC,backendName:"webgl",kernelFunc:t2e};class iU{constructor(e,n,b){this.variableNames=["real","imag"];const R=n[1];this.outputShape=n;const q=b?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,re=b?`${R}.0`:"1.0";let fe;if(e==="real")fe="return real * expR - imag * expI;";else if(e==="imag")fe="return real * expI + imag * expR;";else throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);this.userCode=` + const float exponentMultiplier = ${q}; + + float unaryOpComplex(float real, float expR, float imag, float expI) { + ${fe} + } + + float mulMatDFT(int batch, int index) { + float indexRatio = float(index) / float(${R}); + float exponentMultiplierTimesIndexRatio = + exponentMultiplier * indexRatio; + + float result = 0.0; + + for (int i = 0; i < ${R}; i++) { + // x = (-2|2 * PI / N) * index * i; + float x = exponentMultiplierTimesIndexRatio * float(i); + float expR = cos(x); + float expI = sin(x); + float real = getReal(batch, i); + float imag = getImag(batch, i); + + result += + unaryOpComplex(real, expR, imag, expI) / ${re}; + } + + return result; + } + + void main() { + ivec2 coords = getOutputCoords(); + setOutput(mulMatDFT(coords[0], coords[1])); + } + `}}function BH(u,e,n){const b=n.texData.get(u.dataId),R=xo(u.shape),q=u.shape[u.shape.length-1],re=R/q,fe=$s({inputs:{x:u},backend:n,attrs:{shape:[re,q]}}),he=fe.shape,be=new iU("real",he,e),Pe=new iU("imag",he,e),je=[{dataId:b.complexTensorInfos.real.dataId,dtype:b.complexTensorInfos.real.dtype,shape:he},{dataId:b.complexTensorInfos.imag.dataId,dtype:b.complexTensorInfos.imag.dtype,shape:he}],We=n.runWebGLProgram(be,je,"float32"),ft=n.runWebGLProgram(Pe,je,"float32"),xt=Ab({inputs:{real:We,imag:ft},backend:n});n.disposeIntermediateTensorInfo(We),n.disposeIntermediateTensorInfo(ft);const zt=$s({inputs:{x:xt},backend:n,attrs:{shape:u.shape}});return n.disposeIntermediateTensorInfo(fe),n.disposeIntermediateTensorInfo(xt),zt}function n2e(u){const{inputs:e,backend:n}=u,{input:b}=e;return BH(b,!1,n)}const a2e={kernelName:L8,backendName:"webgl",kernelFunc:n2e};class i2e{constructor(e,n){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode=` + void main() { + // Input can be obtained from uniform value. + setOutput(value); + } + `}}function kk(u){const{backend:e,attrs:n}=u,{shape:b,value:R}=n;let{dtype:q}=n;if(q=q||FA(R),q==="string"){const re=np(q,xo(b));return re.fill(R),e.makeTensorInfo(b,q,re)}else{const re=new i2e(b,R),fe=[[R]];return e.runWebGLProgram(re,[],q,fe)}}const o2e={kernelName:R8,backendName:"webgl",kernelFunc:kk};class s2e{constructor(e){this.variableNames=["Image"],this.outputShape=[];const n=e[2];this.outputShape=e,this.userCode=` + void main() { + ivec4 coords = getOutputCoords(); + int x = coords[2]; + + int coordX = ${n} - x - 1; + float outputValue; + if(coordX >= 0 && coordX < ${n}) { + outputValue = getImage(coords[0], coords[1], coordX, coords[3]); + } else { + outputValue = getImage(coords[0], coords[1], coords[2], coords[3]); + } + setOutput(outputValue); + } + `}}const l2e={kernelName:D8,backendName:"webgl",kernelFunc:({inputs:u,backend:e})=>{const{image:n}=u,b=e,R=new s2e(n.shape);return b.runWebGLProgram(R,[n],n.dtype)}};const oU="return floor(x);",u2e=rf({opSnippet:oU,packedOpSnippet:oU,cpuKernelImpl:C1e}),c2e={kernelName:IC,backendName:"webgl",kernelFunc:u2e};const f2e=` + float s = sign(a) * sign(b); + int ia = round(a); + int ib = round(b); + if (ib != 0) { + // Windows (D3D) wants guaranteed non-zero int division at compile-time. + return float(idiv(ia, ib, s)); + } else { + return NAN; + } +`,h2e=` + ivec4 ia = round(a); + ivec4 ib = round(b); + bvec4 cond = notEqual(ib, ivec4(0)); + ivec4 result = ivec4(0); + vec4 s = sign(a) * sign(b); + + // Windows (D3D) wants guaranteed non-zero int division at compile-time. + if (cond[0]) { + result[0] = idiv(ia[0], ib[0], s[0]); + } + if (cond[1]) { + result[1] = idiv(ia[1], ib[1], s[1]); + } + if (cond[2]) { + result[2] = idiv(ia[2], ib[2], s[2]); + } + if (cond[3]) { + result[3] = idiv(ia[3], ib[3], s[3]); + } + return vec4(result); +`,d2e=kv({opSnippet:f2e,packedOpSnippet:h2e,dtype:"int32"}),p2e={kernelName:LC,backendName:"webgl",kernelFunc:d2e};class v2e{constructor(e){this.variableNames=["A"];const n=ym(),[b,R]=e;this.outputShape=e,this.userCode=` + void main() { + ivec3 coords = getOutputCoords(); + int texR = coords[0]; + int texC = coords[1]; + int depth = coords[2]; + vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${R}.0, ${b}.0); + + vec4 values = ${n.texture2D}(A, uv); + float value; + if (depth == 0) { + value = values.r; + } else if (depth == 1) { + value = values.g; + } else if (depth == 2) { + value = values.b; + } else if (depth == 3) { + value = values.a; + } + + setOutput(floor(value * 255.0 + 0.5)); + } + `}}class m2e{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const n=ym(),[b,R]=e;this.outputShape=e,this.userCode=` + void main() { + ivec3 coords = getOutputCoords(); + int texR = coords[0]; + int texC = coords[1]; + int depth = coords[2]; + + vec4 result = vec4(0.); + + for(int row=0; row<=1; row++) { + for(int col=0; col<=1; col++) { + texC = coords[1] + row; + depth = coords[2] + col; + + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${R}.0, ${b}.0); + vec4 values = ${n.texture2D}(A, uv); + float value; + if (depth == 0) { + value = values.r; + } else if (depth == 1) { + value = values.g; + } else if (depth == 2) { + value = values.b; + } else if (depth == 3) { + value = values.a; + } + + result[row * 2 + col] = floor(value * 255.0 + 0.5); + } + } + + ${n.output} = result; + } + `}}const g2e={kernelName:_te,backendName:"webgl",kernelFunc:y2e};let gA,vz=co().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");function y2e(u){const{inputs:e,backend:n,attrs:b}=u;let{pixels:R}=e;const{numChannels:q}=b,re=typeof HTMLVideoElement<"u"&&R instanceof HTMLVideoElement,fe=typeof HTMLImageElement<"u"&&R instanceof HTMLImageElement,[he,be]=re?[R.videoWidth,R.videoHeight]:[R.width,R.height],Pe=[be,he],je=[be,he,q];if(fe||re){const zt=co().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");(gA==null||zt!==vz)&&(vz=zt,gA=document.createElement("canvas").getContext("2d",{willReadFrequently:vz})),gA.canvas.width=he,gA.canvas.height=be,gA.drawImage(R,0,0,he,be),R=gA.canvas}const We=n.makeTensorInfo(Pe,"int32");n.texData.get(We.dataId).usage=Fg.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(We.dataId),R);const ft=co().getBool("WEBGL_PACK")?new m2e(je):new v2e(je),xt=n.runWebGLProgram(ft,[We],"int32");return n.disposeData(We.dataId),xt}function _2e(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,filter:q,bias:re,preluActivationWeights:fe}=e,{strides:he,pad:be,dataFormat:Pe,dilations:je,dimRoundingMode:We,activation:ft,leakyreluAlpha:xt}=b,zt=E_(Pe),Ft=Ev(R.shape,q.shape,he,je,be,We,!1,zt);let jt;const Re=[],Lr=re!=null,Cr=fe!=null,Gr=ft==="leakyrelu",yn=()=>{const Vn=[R,q],un=(Nn,Kr)=>{if(Kr==="NCHW"&&Nn.shape.length===1&&Nn.shape[0]!==1){const Ma=$s({inputs:{x:Nn},backend:n,attrs:{shape:[Nn.shape[0],1,1]}});return Re.push(Ma),Ma}return Nn};if(Lr&&Vn.push(un(re,Pe)),Cr&&Vn.push(un(fe,Pe)),Gr){const Nn=n.makeTensorInfo([],"float32",gb(xt,"float32"));Vn.push(Nn),Re.push(Nn)}return Vn};if(Ft.filterHeight===1&&Ft.filterWidth===1&&Ft.dilationHeight===1&&Ft.dilationWidth===1&&Ft.strideHeight===1&&Ft.strideWidth===1&&(Ft.padInfo.type==="SAME"||Ft.padInfo.type==="VALID"))jt=DH({x:R,filter:q,convInfo:Ft,backend:n,bias:re,activation:ft,preluActivationWeights:fe,leakyreluAlpha:xt});else if(Ft.strideWidth<=2&&zt==="channelsLast"&&co().getBool("WEBGL_EXP_CONV")){const Vn=ft?uC(ft,!0):null,un=new RH(Ft,Lr,Vn,Cr,Gr),Nn=[[Ft.padInfo.top,Ft.padInfo.left],[Ft.strideHeight,Ft.strideWidth],[Ft.dilationHeight,Ft.dilationWidth],[Ft.inHeight,Ft.inWidth]],Kr=yn();jt=n.runWebGLProgram(un,Kr,"float32",Nn)}else if(co().getBool("WEBGL_CONV_IM2COL"))jt=PH({x:R,filter:q,convInfo:Ft,backend:n,bias:re,activation:ft,preluActivationWeights:fe,leakyreluAlpha:xt});else{const Vn=ft?uC(ft,!1):null,un=new LH(Ft,Lr,Vn,Cr,Gr),Nn=yn();jt=n.runWebGLProgram(un,Nn,"float32")}const Pn=$s({inputs:{x:jt},backend:n,attrs:{shape:Ft.outShape}});return Re.push(jt),Re.forEach(Vn=>n.disposeIntermediateTensorInfo(Vn)),Pn}const x2e={kernelName:yL,backendName:"webgl",kernelFunc:_2e};function b2e(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,filter:q,bias:re,preluActivationWeights:fe}=e,{strides:he,pad:be,dilations:Pe,dimRoundingMode:je,activation:We,leakyreluAlpha:ft}=b,xt=[];let zt=Pe;zt==null&&(zt=[1,1]),Jn(Fv(he,zt),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${he} and dilations '${zt}'`);const Ft=Ev(R.shape,q.shape,he,zt,be,je,!0),jt=co().getBool("WEBGL_PACK_DEPTHWISECONV")&&Ft.strideWidth<=2&&Ft.outChannels/Ft.inChannels===1,Re=We?uC(We,jt):null,Lr=[R,q],Cr=re!=null,Gr=fe!=null,yn=We==="leakyrelu";if(Cr&&Lr.push(re),Gr&&Lr.push(fe),yn){const Nn=n.makeTensorInfo([],"float32",gb(ft,"float32"));Lr.push(Nn),xt.push(Nn)}let Pn;jt?Pn=new OH(Ft,Cr,Re,Gr,yn):Pn=new NH(Ft,Cr,Re,Gr,yn);const Vn=[[Ft.padInfo.top,Ft.padInfo.left],[Ft.strideHeight,Ft.strideWidth],[Ft.dilationHeight,Ft.dilationWidth],[Ft.inHeight,Ft.inWidth]],un=n.runWebGLProgram(Pn,Lr,"float32",Vn);return xt.forEach(Nn=>n.disposeIntermediateTensorInfo(Nn)),un}const w2e={kernelName:XU,backendName:"webgl",kernelFunc:b2e};class T2e{constructor(e,n,b,R){this.sliceDim=e,this.strides=n,this.paramsShape=R,this.variableNames=["x","indices"],this.outputShape=b;const q=Th(b.length);let re=` + int index;`;for(let fe=0;fe= ${this.paramsShape[fe]}; + flattenIndex += index * ${this.strides[fe]};`;this.userCode=` + void main() { + ${q} coords = getOutputCoords(); + int flattenIndex = 0; + bool out_of_bounds = false; + + ${re} + + setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1])); + } + `}}function A2e(u){const{inputs:e,backend:n}=u,{params:b,indices:R}=e,q=R.shape,re=q[q.length-1],fe=xo(b.shape),[he,be,Pe,je]=RN(b,R),We=$s({inputs:{x:R},backend:n,attrs:{shape:[be,re]}}),ft=$s({inputs:{x:b},backend:n,attrs:{shape:[xo(b.shape)/Pe,Pe]}});if(n.shouldExecuteOnCPU([b,R])||b.dtype==="string"){const jt=n.readSync(R.dataId),Re=n.bufferSync(b),Lr=k1e(jt,Re,b.dtype,be,re,Pe,je,b.shape,fe);return n.makeTensorInfo(he,b.dtype,Lr.values)}const xt=new T2e(re,je,[be,Pe],b.shape),zt=n.runWebGLProgram(xt,[ft,We],ft.dtype),Ft=$s({inputs:{x:zt},backend:n,attrs:{shape:he}});return n.disposeIntermediateTensorInfo(We),n.disposeIntermediateTensorInfo(ft),n.disposeIntermediateTensorInfo(zt),Ft}const S2e={kernelName:IU,backendName:"webgl",kernelFunc:A2e};class E2e{constructor(e,n){this.variableNames=["A","indices"],this.outputShape=n,this.rank=n.length;const b=Th(this.rank),R=C2e(e);this.userCode=` + void main() { + ${b} resRC = getOutputCoords(); + int index = int(getIndices(resRC.x, resRC.z)); + float inBounds = (index >= 0) && (index < ${e[2]}) ? 1.0 : 0.0; + setOutput(inBounds * getA(${R})); + } + `}}function C2e(u,e){const n=["resRC.x","resRC.y","resRC.z","resRC.w"],b=[];for(let R=0;R=0,()=>`GatherV2: the index value ${Gr} is not in [0, ${Lr-1}]`)}}const be=MV(R,q,he,fe),Pe=xo(q.shape),je=[],We=$s({inputs:{x:R},backend:n,attrs:{shape:[be.batchSize,be.outerSize,be.dimSize,be.sliceSize]}}),ft=$s({inputs:{x:q},backend:n,attrs:{shape:[be.batchSize,Pe/be.batchSize]}});je.push(We),je.push(ft);const xt=[be.batchSize,be.outerSize,Pe/be.batchSize,be.sliceSize];if(n.shouldExecuteOnCPU([R,q])||R.dtype==="string"){const Re=n.bufferSync(ft),Lr=n.bufferSync(We),Cr=M1e(Lr,Re,xt);return je.forEach(Gr=>n.disposeIntermediateTensorInfo(Gr)),n.makeTensorInfo(be.outputShape,Cr.dtype,Cr.values)}const zt=new E2e(We.shape,xt),Ft=n.runWebGLProgram(zt,[We,ft],We.dtype);je.push(Ft);const jt=$s({inputs:{x:Ft},backend:n,attrs:{shape:be.outputShape}});return je.forEach(Re=>n.disposeIntermediateTensorInfo(Re)),jt}const k2e={kernelName:cR,backendName:"webgl",kernelFunc:UH};const M2e="return float(a > b);",I2e=` + return vec4(greaterThan(a, b)); +`,L2e=kv({opSnippet:M2e,packedOpSnippet:I2e,cpuKernelImpl:I1e,dtype:"bool"}),R2e={kernelName:fR,backendName:"webgl",kernelFunc:L2e};const D2e="return float(a >= b);",P2e=` + return vec4(greaterThanEqual(a, b)); +`,z2e=kv({opSnippet:D2e,packedOpSnippet:P2e,dtype:"bool",cpuKernelImpl:L1e}),N2e={kernelName:RC,backendName:"webgl",kernelFunc:z2e};function O2e(u){const{inputs:e,backend:n}=u,{input:b}=e;return BH(b,!0,n)}const F2e={kernelName:P8,backendName:"webgl",kernelFunc:O2e};const B2e="return float(!isnan(x) && !isinf(x));",U2e=rf({opSnippet:B2e,dtype:"bool"}),$2e={kernelName:PC,backendName:"webgl",kernelFunc:U2e};const V2e="return float(isinf(x));",j2e=rf({opSnippet:V2e,dtype:"bool"}),G2e={kernelName:zC,backendName:"webgl",kernelFunc:j2e};const q2e="return float(isnan(x));",H2e=rf({opSnippet:q2e,dtype:"bool"}),W2e={kernelName:NC,backendName:"webgl",kernelFunc:H2e};const X2e="return float(a < b);",Y2e=` + return vec4(lessThan(a, b)); +`,Z2e=kv({opSnippet:X2e,packedOpSnippet:Y2e,cpuKernelImpl:R1e,dtype:"bool"}),K2e={kernelName:dR,backendName:"webgl",kernelFunc:Z2e};const J2e="return float(a <= b);",Q2e=` + return vec4(lessThanEqual(a, b)); +`,e3e=kv({opSnippet:J2e,packedOpSnippet:Q2e,cpuKernelImpl:D1e,dtype:"bool"}),t3e={kernelName:pR,backendName:"webgl",kernelFunc:e3e};function r3e(u){const{backend:e,attrs:n}=u,{start:b,stop:R,num:q}=n,re=P1e(b,R,q);return e.makeTensorInfo([re.length],"float32",re)}const n3e={kernelName:LU,backendName:"webgl",kernelFunc:r3e};const a3e=QA+` + return x < 0.0 ? 0./0. : log(x); +`,i3e=` + vec4 result = log(x); + bvec4 isNaN = isnan(x); + result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r); + result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g); + result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b); + result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a); + return result; +`,o3e=rf({opSnippet:a3e,packedOpSnippet:i3e,cpuKernelImpl:z1e}),s3e={kernelName:OC,backendName:"webgl",kernelFunc:o3e};const l3e=QA+` + return log(1.0 + x); +`,u3e=rf({opSnippet:l3e}),c3e={kernelName:FC,backendName:"webgl",kernelFunc:u3e};const f3e="return float(a >= 1.0 && b >= 1.0);",h3e=` + return vec4( + vec4(greaterThanEqual(a, vec4(1.0))) * + vec4(greaterThanEqual(b, vec4(1.0)))); +`,d3e=kv({opSnippet:f3e,packedOpSnippet:h3e,dtype:"bool"}),p3e={kernelName:vR,backendName:"webgl",kernelFunc:d3e};const v3e="return float(!(x >= 1.0));",m3e=rf({opSnippet:v3e}),g3e={kernelName:mR,backendName:"webgl",kernelFunc:m3e};const y3e="return float(a >= 1.0 || b >= 1.0);",_3e=` + return min( + vec4(greaterThanEqual(a, vec4(1.0))) + + vec4(greaterThanEqual(b, vec4(1.0))), + vec4(1.0)); +`,x3e=kv({opSnippet:y3e,packedOpSnippet:_3e,dtype:"bool"}),b3e={kernelName:gR,backendName:"webgl",kernelFunc:x3e};class w3e{constructor(e,n,b,R,q){this.variableNames=["x"],this.outputShape=[];const re=n,fe=e[3]-1;this.outputShape=e;let he;const be=`float(${b}) + float(${R}) * sum`;q===.5?he=`inversesqrt(${be})`:q===1?he=`1.0/(${be})`:he=`exp(log(${be}) * float(-${q}));`,this.userCode=` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int r = coords[1]; + int c = coords[2]; + int d = coords[3]; + float x = getX(b, r, c, d); + float sum = 0.0; + for (int j = -${re}; j <= ${re}; j++) { + int idx = d + j; + if (idx >= 0 && idx <= ${fe}) { + float z = getX(b, r, c, idx); + sum += z * z; + } + } + float val = x * ${he}; + setOutput(val); + } + `}}class T3e{constructor(e,n,b,R,q){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const re=n,fe=e[3]-1;this.outputShape=e;let he;const be=`float(${b}) + float(${R}) * sum`;q===.5?he=`inversesqrt(${be})`:q===1?he=`1.0/(${be})`:he=`exp(log(${be}) * float(-${q}));`,this.userCode=` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords.x; + int r = coords.y; + int c = coords.z; + int d = coords.w; + + bool hasNextCol = d < ${this.outputShape[3]}; + bool hasNextRow = c < ${this.outputShape[2]}; + + vec4 sum = vec4(0.); + vec4 xFragAtOutputCoords = getX(b, r, c, d); + + vec4 xAtOutputCoords = vec4( + getChannel(xFragAtOutputCoords, vec2(c, d)), + hasNextCol ? + getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0, + hasNextRow ? + getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0, + (hasNextRow && hasNextCol) ? + getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0 + ); + + int firstChannel = d - ${re}; + vec2 cache = vec2(0.); + if(firstChannel >= 0){ + vec4 firstChannelFrag = getX(b, r, c, firstChannel); + cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel)); + if(hasNextRow){ + cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel)); + } + } + + ivec2 depth = ivec2(d, d + 1); + for (int j = - ${re}; j <= ${re}; j++) { + ivec2 idx = depth + j; + bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0)); + bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${fe})); + + bool depthInRange = aboveLowerBound.x && belowUpperBound.x; + bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y; + + if(depthInRange || depthPlusOneInRange){ + vec4 z = vec4(0.); + vec4 xFragAtCurrentDepth; + z.xz = cache.xy; + if(depthPlusOneInRange && hasNextCol){ + xFragAtCurrentDepth = idx.y != d ? + getX(b, r, c, idx.y) : xFragAtOutputCoords; + z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y)); + if(hasNextRow){ + z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y)); + } + } + cache.xy = z.yw; + sum += z * z; + } + } + vec4 result = xAtOutputCoords * ${he}; + setOutput(result); + } + `}}const A3e=u=>{const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{depthRadius:q,bias:re,alpha:fe,beta:he}=b,be=co().getBool("WEBGL_PACK_NORMALIZATION")?new T3e(R.shape,q,re,fe,he):new w3e(R.shape,q,re,fe,he);return n.runWebGLProgram(be,[R],R.dtype)},S3e={kernelName:yR,backendName:"webgl",kernelFunc:A3e};class E3e{constructor(e,n,b,R,q){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=n,this.bias=b,this.alpha=R,this.beta=q,this.userCode=` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int r = coords[1]; + int c = coords[2]; + + float result = 0.0; + for (int d = 0; d < ${this.depth}; ++d) { + int depthBegin = int(max(0.0, float(d - ${n}))); + int depthEnd = int(min(float(${this.depth}), + float(d + ${n} + 1))); + + const int MIN_DEPTH_BEGIN = 0; + const int MAX_DEPTH_END = ${this.depth}; + + float norm = 0.0; + for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) { + if (k < depthBegin){ + continue; + } + else if (k >= depthBegin && k < depthEnd) { + norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k); + } + else { + break; + } + } + + norm = float(${R}) * norm + float(${b}); + + for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){ + if (k < depthBegin){ + continue; + } + else if (k >= depthBegin && k < depthEnd){ + float dyi = -2.0 * float(${R}) + * float(${q}) + * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d) + / norm; + if (k == d) { + dyi += pow(norm, -1.0 * ${q}); + } + if (k == coords[3]) { + dyi *= getDy(b, r, c, d); + result += dyi; + } + } + else { + break; + } + } + } + setOutput(result); + } + `}}const C3e=u=>{const{inputs:e,backend:n,attrs:b}=u,{x:R,y:q,dy:re}=e,{depthRadius:fe,bias:he,alpha:be,beta:Pe}=b,je=new E3e(R.shape,fe,he,be,Pe);return n.runWebGLProgram(je,[R,q,re],R.dtype)},k3e={kernelName:N8,backendName:"webgl",kernelFunc:C3e};function M3e(u,e,n,b){const R=xo(e),re=xo(u.shape)/R,fe=$s({inputs:{x:u},attrs:{shape:[re,R]},backend:b}),he=$2(fe,u.dtype,"max",b),be=$s({inputs:{x:he},attrs:{shape:n},backend:b});return b.disposeIntermediateTensorInfo(fe),b.disposeIntermediateTensorInfo(he),be}function $H(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{reductionIndices:q,keepDims:re}=b,fe=R.shape.length,he=Ac(q,R.shape);let be=he;const Pe=kd(be,fe),je=Pe!=null,We=n.shouldExecuteOnCPU([R]);let ft=R;if(je){if(We){const Lr=n.texData.get(ft.dataId).values,Cr=new Array(fe);for(let Pn=0;Pn`Error in maxPool: Either strides or dilations must be 1. Got strides ${re} and dilations '${be}'`);const Pe=w0(R.shape,q,re,be,fe,he);if(Pe.filterWidth===1&&Pe.filterHeight===1&&$f(Pe.inShape,Pe.outShape))return ug({inputs:{x:R},backend:n});const je=new cC(Pe,"max",!1);return n.runWebGLProgram(je,[R],R.dtype)}const N3e={kernelName:xR,backendName:"webgl",kernelFunc:z3e};function O3e(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{filterSize:q,strides:re,pad:fe,dataFormat:he,dimRoundingMode:be}=b,Pe=[1,1,1],je=S_(R.shape,q,re,Pe,fe,be,he),We=new NO(je,"max",!1);return n.runWebGLProgram(We,[R],R.dtype)}const F3e={kernelName:bR,backendName:"webgl",kernelFunc:O3e};class B3e{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const n=e.strideHeight,b=e.strideWidth,R=e.dilationHeight,q=e.effectiveFilterHeight,re=e.effectiveFilterWidth,fe=q-1-e.padInfo.top,he=re-1-e.padInfo.left,be=q*re-1;this.userCode=` + const ivec2 pads = ivec2(${fe}, ${he}); + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + + ivec2 dyRCCorner = coords.yz - pads; + int dyRCorner = dyRCCorner.x; + int dyCCorner = dyRCCorner.y; + + // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + for (int wR = 0; wR < ${q}; + wR += ${R}) { + float dyR = float(dyRCorner + wR) / ${n}.0; + + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + for (int wC = 0; wC < ${re}; wC++) { + float dyC = float(dyCCorner + wC) / ${b}.0; + + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + float dyValue = getDy(b, idyR, idyC, d); + int maxPosValue = ${be} - int(getMaxPos(b, idyR, idyC, d)); + + // Get the current value, check it against the value from the + // position matrix. + int curPosValue = wR * ${re} + wC; + float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); + + dotProd += dyValue * mask; + } + } + setOutput(dotProd); + } + `}}class U3e{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const n=e.strideDepth,b=e.strideHeight,R=e.strideWidth,q=e.dilationDepth,re=e.dilationHeight,fe=e.dilationWidth,he=e.effectiveFilterDepth,be=e.effectiveFilterHeight,Pe=e.effectiveFilterWidth,je=he-1-e.padInfo.front,We=be-1-e.padInfo.top,ft=Pe-1-e.padInfo.left,xt=he*be*Pe-1;this.userCode=` + const ivec3 pads = ivec3(${je}, ${We}, ${ft}); + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int ch = coords.u; + + ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; + int dyDCorner = dyCorner.x; + int dyRCorner = dyCorner.y; + int dyCCorner = dyCorner.z; + + // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get + // dx(xD, xR, xC, ch). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + + for (int wD = 0; wD < ${he}; + wD += ${q}) { + float dyD = float(dyDCorner + wD) / ${n}.0; + + if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { + continue; + } + int idyD = int(dyD); + + for (int wR = 0; wR < ${be}; + wR += ${re}) { + float dyR = float(dyRCorner + wR) / ${b}.0; + + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || + fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + for (int wC = 0; wC < ${Pe}; + wC += ${fe}) { + float dyC = float(dyCCorner + wC) / ${R}.0; + + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + float dyValue = getDy(batch, idyD, idyR, idyC, ch); + int maxPosValue = ${xt} - + int(getMaxPos(batch, idyD, idyR, idyC, ch)); + + // Get the current value, check it against the value from the + // position matrix. + int curPosValue = + wD * ${be} * ${Pe} + + wR * ${Pe} + wC; + float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); + + dotProd += dyValue * mask; + } + } + } + setOutput(dotProd); + } + `}}function $3e(u){const{inputs:e,backend:n,attrs:b}=u,{dy:R,input:q}=e,re=q,{filterSize:fe,strides:he,pad:be,dimRoundingMode:Pe}=b,je=[1,1,1],We=S_(re.shape,fe,he,je,be,Pe),ft=new NO(We,"max",!0),xt=n.runWebGLProgram(ft,[re],re.dtype),zt=new U3e(We),Ft=n.runWebGLProgram(zt,[R,xt],re.dtype);return n.disposeIntermediateTensorInfo(xt),Ft}const V3e={kernelName:F8,backendName:"webgl",kernelFunc:$3e};function j3e(u){const{inputs:e,backend:n,attrs:b}=u,{dy:R,input:q,output:re}=e,fe=q;Sk([q,re],"maxPoolGrad");const{filterSize:he,strides:be,pad:Pe,dimRoundingMode:je}=b,We=w0(fe.shape,he,be,1,Pe,je),ft=!0,xt=new cC(We,"max",ft),zt=n.runWebGLProgram(xt,[fe],fe.dtype),Ft=new B3e(We),jt=n.runWebGLProgram(Ft,[R,zt],fe.dtype);return n.disposeIntermediateTensorInfo(zt),jt}const G3e={kernelName:O8,backendName:"webgl",kernelFunc:j3e};function q3e(u,e,n,b){let R=new cC(n,"max",!1);const q=b.runWebGLProgram(R,[u],"float32");R=new cC(n,"max",!0,!0,e);const re=b.runWebGLProgram(R,[u],"float32");return[q,re]}const H3e={kernelName:RU,backendName:"webgl",kernelFunc:({inputs:u,attrs:e,backend:n})=>{const{x:b}=u,{filterSize:R,strides:q,pad:re,includeBatchInIndex:fe}=e,he=n;Jn(b.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${b.shape.length}.`);const be=[1,1];Jn(Fv(q,be),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${q} and dilations '${be}'`);const Pe=w0(b.shape,R,q,be,re),[je,We]=q3e(b,fe,Pe,he);return[je,We]}};function W3e(u,e,n,b){const R=xo(e),re=xo(u.shape)/R,fe=$s({inputs:{x:u},attrs:{shape:[re,R]},backend:b}),he=$2(fe,"float32","mean",b),be=$s({inputs:{x:he},attrs:{shape:n},backend:b});return b.disposeIntermediateTensorInfo(fe),b.disposeIntermediateTensorInfo(he),be}const X3e={kernelName:wR,backendName:"webgl",kernelFunc:({inputs:u,attrs:e,backend:n})=>{const{x:b}=u,{keepDims:R,axis:q}=e,re=n,fe=b.shape.length,he=Ac(q,b.shape);let be=he;const Pe=kd(be,fe),je=Pe!=null,We=re.shouldExecuteOnCPU([b]),ft=[];let xt=b;if(je){if(We){const Cr=re.texData.get(xt.dataId).values,Gr=new Array(fe);for(let Vn=0;VnPe[0]+e[je]+Pe[1]);const R=e.length,q=Th(R),re=n.map(Pe=>Pe[0]).join(","),fe=n.map((Pe,je)=>Pe[0]+e[je]).join(","),he=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,R),be=b==="reflect"?0:1;if(R===1){this.userCode=` + int start = ${re}; + int end = ${fe}; + + void main() { + int outC = getOutputCoords(); + if (outC < start) { + outC = start * 2 - outC - ${be}; + } else if(outC >= end) { + outC = (end - 1) * 2 - outC + ${be}; + } + setOutput(getX(outC - start)); + } + `;return}this.userCode=` + ${q} start = ${q}(${re}); + ${q} end = ${q}(${fe}); + + void main() { + ${q} outC = getOutputCoords(); + for (int i = 0; i < ${R}; i++) { + if (outC[i] < start[i]) { + outC[i] = start[i] * 2 - outC[i] - ${be}; + } else if(outC[i] >= end[i]) { + outC[i] = (end[i] - 1) * 2 - outC[i] + ${be}; + } + } + ${q} coords = outC - start; + setOutput(getX(${he})); + } + `}}class rTe{constructor(e,n,b){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n.map((xt,zt)=>xt[0]+e[zt]+xt[1]);const R=e.length,q=Th(R),re=n.map(xt=>xt[0]).join(","),fe=n.map((xt,zt)=>xt[0]+e[zt]).join(","),he=vm("rc",R),be=vm("source",R),Pe=`${he[R-1]} < ${this.outputShape[R-1]}`,je=R===1?"source":`vec2(${be.slice(-2).join()})`,We=b==="reflect"?0:1;let ft="";if(R===1){const xt=` + ${q} source = rc; + if (source < start) { + source = start * 2 - source - ${We}; + } else if (source >= end) { + source = (end - 1) * 2 - source + ${We}; + } + source -= start; + `;ft=` + ${q} rc = outputLoc; + ${xt} + result[0] = getChannel(getX(${be.join()}), ${je}); + ${he[R-1]} += 1; + if(${Pe}) { + ${xt} + result[1] = getChannel(getX(${be.join()}), ${je}); + } + `}else{const xt=` + ${q} source = rc; + ${q} lt = ${q}(lessThan(source, start)); + ${q} gte = ${q}(greaterThanEqual(source, end)); + ${q} orig = 1 - (lt + gte); + source = orig * source + + lt * (start * 2 - source - ${We}) + + gte * ((end - 1) * 2 - source + ${We}); + source -= start; + `;ft=` + ${q} rc = outputLoc; + ${xt} + result[0] = getChannel(getX(${be.join()}), ${je}); + ${he[R-1]} += 1; + if(${Pe}) { + ${xt} + result[1] = getChannel(getX(${be.join()}), ${je}); + } + rc = outputLoc; + ${he[R-2]} += 1; + if(${he[R-2]} < ${this.outputShape[R-2]}) { + ${xt} + result[2] = getChannel(getX(${be.join()}), ${je}); + ${he[R-1]} += 1; + if(${Pe}) { + ${xt} + result[3] = getChannel(getX(${be.join()}), ${je}); + } + } + `}this.userCode=` + const ${q} start = ${q}(${re}); + const ${q} end = ${q}(${fe}); + + void main() { + ${q} outputLoc = getOutputCoords(); + vec4 result = vec4(0.); + ${ft} + setOutput(result); + } + `}}const nTe=({inputs:u,backend:e,attrs:n})=>{const{x:b}=u,{paddings:R,mode:q}=n,re=co().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new rTe(b.shape,R,q):new tTe(b.shape,R,q);return e.runWebGLProgram(re,[b],b.dtype)},aTe={kernelName:AR,backendName:"webgl",kernelFunc:nTe};const iTe=`if (b == 0.0) return NAN; + return mod(a, b);`,oTe=` + vec4 result = mod(a, b); + bvec4 isNaN = equal(b, vec4(0.0)); + `+U2+` + return result; +`,sTe=kv({opSnippet:iTe,packedOpSnippet:oTe}),lTe={kernelName:$C,backendName:"webgl",kernelFunc:sTe};class uTe{constructor(e,n,b){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,b],this.userCode=` + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + + float r = random(seed); + float cdf = 0.0; + + for (int i = 0; i < ${n-1}; i++) { + cdf += getProbs(batch, i); + + if (r < cdf) { + setOutput(float(i)); + return; + } + } + + // If no other event happened, last event happened. + setOutput(float(${n-1})); + } + `}}const cTe=` +if (a == b) { + return 1.0; +}; +return a / b;`,fTe=` + // vec4 one = vec4(equal(a, b)); + // return one + (vec4(1.0) - one) * a / b; + vec4 result = a / b; + if(a.x == b.x) { + result.x = 1.; + } + if(a.y == b.y) { + result.y = 1.; + } + if(a.z == b.z) { + result.z = 1.; + } + if(a.w == b.w) { + result.w = 1.; + } + + return result; +`,VH=kv({opSnippet:cTe,packedOpSnippet:fTe,checkOutOfBounds:!0}),hTe={kernelName:SC,backendName:"webgl",kernelFunc:VH};const sU="return a - b;",jH=kv({opSnippet:sU,packedOpSnippet:sU,supportsComplex:!0,cpuKernelImpl:i_e}),dTe={kernelName:nk,backendName:"webgl",kernelFunc:jH};function GH(u){const{inputs:e,backend:n,attrs:b}=u,{logits:R}=e,{dim:q}=b,re=Ac([q],R.shape),fe=$H({inputs:{x:R},backend:n,attrs:{reductionIndices:re,keepDims:!1}}),he=ip(fe.shape,re),be=$s({inputs:{x:fe},backend:n,attrs:{shape:he}}),Pe=jH({inputs:{a:R,b:be},backend:n}),je=FH({inputs:{x:Pe},backend:n}),We=xD({inputs:{x:je},backend:n,attrs:{axis:re,keepDims:!1}}),ft=$s({inputs:{x:We},backend:n,attrs:{shape:he}}),xt=VH({inputs:{a:je,b:ft},backend:n});return n.disposeIntermediateTensorInfo(fe),n.disposeIntermediateTensorInfo(be),n.disposeIntermediateTensorInfo(Pe),n.disposeIntermediateTensorInfo(je),n.disposeIntermediateTensorInfo(We),n.disposeIntermediateTensorInfo(ft),xt}const pTe={kernelName:VR,backendName:"webgl",kernelFunc:GH};function vTe(u){const{inputs:e,backend:n,attrs:b}=u,{logits:R}=e,{numSamples:q,seed:re,normalized:fe}=b,he=fe?R:GH({inputs:{logits:R},backend:n,attrs:{dim:R.shape.length-1}}),be=he.shape[0],Pe=he.shape[1],je=new uTe(be,Pe,q),We=[[re]],ft=n.runWebGLProgram(je,[he],"int32",We);return fe||n.disposeIntermediateTensorInfo(he),ft}const mTe={kernelName:DU,backendName:"webgl",kernelFunc:vTe};const gTe=A0+` + return -x; +`,yTe=` + vec4 result = -x; + bvec4 isNaN = isnan(x); + + result.r = isNaN.r ? x.r : result.r; + result.g = isNaN.g ? x.g : result.g; + result.b = isNaN.b ? x.b : result.b; + result.a = isNaN.a ? x.a : result.a; + + return result; +`;function _Te(u){const{inputs:e,backend:n}=u,{x:b}=e;if(n.shouldExecuteOnCPU([b])){const q=n.texData.get(b.dataId),[re,fe]=U1e(q.values,b.shape,b.dtype);return n.makeTensorInfo(fe,b.dtype,re)}let R;return co().getBool("WEBGL_PACK_UNARY_OPERATIONS")?R=new ab(b.shape,yTe):R=new u1(b.shape,gTe),n.runWebGLProgram(R,[b],b.dtype)}const xTe={kernelName:SR,backendName:"webgl",kernelFunc:_Te};const bTe=CN;function wTe(u){Og("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:e,backend:n,attrs:b}=u,{boxes:R,scores:q}=e,{maxOutputSize:re,iouThreshold:fe,scoreThreshold:he}=b,be=n.readSync(R.dataId),Pe=n.readSync(q.dataId),{selectedIndices:je}=bTe(be,Pe,re,fe,he);return n.makeTensorInfo([je.length],"int32",new Int32Array(je))}const TTe={kernelName:B8,backendName:"webgl",kernelFunc:wTe};const ATe=kN;function STe(u){Og("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:e,backend:n,attrs:b}=u,{boxes:R,scores:q}=e,{maxOutputSize:re,iouThreshold:fe,scoreThreshold:he,padToMaxOutputSize:be}=b,Pe=n.readSync(R.dataId),je=n.readSync(q.dataId),{selectedIndices:We,validOutputs:ft}=ATe(Pe,je,re,fe,he,be);return[n.makeTensorInfo([We.length],"int32",new Int32Array(We)),n.makeTensorInfo([],"int32",new Int32Array([ft]))]}const ETe={kernelName:U8,backendName:"webgl",kernelFunc:STe};const CTe=MN;function kTe(u){Og("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:e,backend:n,attrs:b}=u,{boxes:R,scores:q}=e,{maxOutputSize:re,iouThreshold:fe,scoreThreshold:he,softNmsSigma:be}=b,Pe=n.readSync(R.dataId),je=n.readSync(q.dataId),We=re,ft=fe,xt=he,zt=be,{selectedIndices:Ft,selectedScores:jt}=CTe(Pe,je,We,ft,xt,zt);return[n.makeTensorInfo([Ft.length],"int32",new Int32Array(Ft)),n.makeTensorInfo([jt.length],"float32",new Float32Array(jt))]}const MTe={kernelName:$8,backendName:"webgl",kernelFunc:kTe};class ITe{constructor(e,n,b,R){this.variableNames=["indices"],this.outputShape=[e,n],this.userCode=` + void main() { + ivec2 coords = getOutputCoords(); + int index = round(getIndices(coords.x)); + setOutput(mix(float(${R}), float(${b}), + float(index == coords.y))); + } + `}}const LTe=u=>{const{inputs:e,backend:n,attrs:b}=u,{indices:R}=e,{dtype:q,depth:re,onValue:fe,offValue:he}=b,be=xo(R.shape),Pe=new ITe(be,re,fe,he),je=$s({inputs:{x:R},backend:n,attrs:{shape:[be]}}),We=n.runWebGLProgram(Pe,[je],q);n.disposeIntermediateTensorInfo(je);const ft=[...R.shape,re],xt=$s({inputs:{x:We},backend:n,attrs:{shape:ft}});return n.disposeIntermediateTensorInfo(We),xt},RTe={kernelName:kR,backendName:"webgl",kernelFunc:LTe};function jL(u){const{inputs:e,backend:n}=u,{x:b}=e;if(b.dtype==="complex64"){const R=Ck({inputs:{input:b},backend:n}),q=jL({inputs:{x:R},backend:n}),re=bD({inputs:{input:b},backend:n}),fe=jL({inputs:{x:re},backend:n}),he=Ab({inputs:{real:q,imag:fe},backend:n});return n.disposeIntermediateTensorInfo(R),n.disposeIntermediateTensorInfo(q),n.disposeIntermediateTensorInfo(re),n.disposeIntermediateTensorInfo(fe),he}else return kk({attrs:{shape:b.shape,dtype:b.dtype,value:b.dtype==="string"?"":0},backend:n})}const DTe={kernelName:qR,backendName:"webgl",kernelFunc:jL};function qH(u){const{inputs:e,backend:n}=u,{x:b}=e;if(b.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(b.dtype==="complex64"){const R=Ck({inputs:{input:b},backend:n}),q=qH({inputs:{x:R},backend:n}),re=bD({inputs:{input:b},backend:n}),fe=jL({inputs:{x:re},backend:n}),he=Ab({inputs:{real:q,imag:fe},backend:n});return n.disposeIntermediateTensorInfo(R),n.disposeIntermediateTensorInfo(q),n.disposeIntermediateTensorInfo(re),n.disposeIntermediateTensorInfo(fe),he}else return kk({attrs:{shape:b.shape,dtype:b.dtype,value:1},backend:n})}const PTe={kernelName:CR,backendName:"webgl",kernelFunc:qH};function zTe(u){const{inputs:e,backend:n,attrs:b}=u,{axis:R}=b;if(e.length===1)return a8({inputs:{input:e[0]},backend:n,attrs:{dim:R}});const q=e[0].shape,re=e[0].dtype;e.forEach(Pe=>{b0(q,Pe.shape,"All tensors passed to stack must have matching shapes"),Jn(re===Pe.dtype,()=>"All tensors passed to stack must have matching dtypes")});const fe=[],he=e.map(Pe=>{const je=a8({inputs:{input:Pe},backend:n,attrs:{dim:R}});return fe.push(je),je}),be=IH({inputs:he,backend:n,attrs:{axis:R}});return fe.forEach(Pe=>n.disposeIntermediateTensorInfo(Pe)),be}const NTe={kernelName:MR,backendName:"webgl",kernelFunc:zTe};class OTe{constructor(e,n,b){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=n.map((be,Pe)=>be[0]+e[Pe]+be[1]);const R=e.length,q=Th(R),re=n.map(be=>be[0]).join(","),fe=n.map((be,Pe)=>be[0]+e[Pe]).join(","),he=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,R);if(R===1){this.userCode=` + int start = ${re}; + int end = ${fe}; + + void main() { + int outC = getOutputCoords(); + if (outC < start || outC >= end) { + setOutput(value); + } else { + setOutput(getX(outC - start)); + } + } + `;return}this.userCode=` + ${q} start = ${q}(${re}); + ${q} end = ${q}(${fe}); + + void main() { + ${q} outC = getOutputCoords(); + if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) { + setOutput(value); + } else { + ${q} coords = outC - start; + setOutput(getX(${he})); + } + } + `}}class FTe{constructor(e,n,b){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=n.map((zt,Ft)=>zt[0]+e[Ft]+zt[1]);const R=e.length,q=Th(R),re=n.map(zt=>zt[0]).join(","),fe=n.map((zt,Ft)=>zt[0]+e[Ft]).join(","),he=vm("rc",R),be=vm("source",R),Pe=`${he[R-1]} < ${this.outputShape[R-1]}`,je=R===1?"source":`vec2(${be.slice(-2).join()})`,We=[`${q} rc = outputLoc;`,`${he[R-1]} += 1; + if(${Pe}) { + `,R===1?"":`} + rc = outputLoc; + ${he[R-2]} += 1; + if(${he[R-2]} < ${this.outputShape[R-2]}) {`,R===1?"":` ${he[R-1]} += 1; + if(${Pe}) {`],ft=R===1?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let xt="";for(let zt=0,Ft=R===1?2:4;zt{const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{paddings:q,constantValue:re}=b;if(xo(R.shape)===0){const be=q.map((Pe,je)=>Pe[0]+R.shape[je]+Pe[1]);return kk({backend:n,attrs:{shape:be,value:re,dtype:R.dtype}})}const fe=co().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new FTe(R.shape,q,re):new OTe(R.shape,q,re),he=[[re]];return n.runWebGLProgram(fe,[R],R.dtype,he)},BTe={kernelName:IR,backendName:"webgl",kernelFunc:HH};const UTe=` + if(a < 0.0 && floor(b) < b){ + return NAN; + } + if (b == 0.0) { + return 1.0; + } + return (round(mod(b, 2.0)) != 1) ? + pow(abs(a), b) : sign(a) * pow(abs(a), b); +`,$Te=` + // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise. + vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1))); + vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1); + vec4 result = multiplier * pow(abs(a), b); + + // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS + bvec4 isExpZero = equal(b, vec4(0.0)); + result.r = isExpZero.r ? 1.0 : result.r; + result.g = isExpZero.g ? 1.0 : result.g; + result.b = isExpZero.b ? 1.0 : result.b; + result.a = isExpZero.a ? 1.0 : result.a; + + bvec4 isNaN1 = lessThan(a, vec4(0.0)); + bvec4 isNaN2 = lessThan(floor(b), b); + bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w); + `+U2+` + return result; +`,VTe=kv({opSnippet:UTe,packedOpSnippet:$Te}),jTe={kernelName:jC,backendName:"webgl",kernelFunc:VTe};function GTe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{axis:q,keepDims:re}=b,fe=R.shape.length,he=[],be=Ac(q,R.shape);let Pe=be;const je=kd(Pe,fe);let We=R;je!=null&&(We=gm({inputs:{x:R},backend:n,attrs:{perm:je}}),Pe=op(Pe.length,fe),he.push(We)),Cv("prod",Pe,fe);let ft;if(n.shouldExecuteOnCPU([We])){const xt=n.texData.get(We.dataId).values,{outVals:zt,outShape:Ft,outDtype:jt}=V1e(We.shape,We.dtype,xt,Pe);ft=n.makeTensorInfo(Ft,jt,zt)}else{const[xt,zt]=lv(We.shape,Pe),Ft=xo(zt),jt=$s({inputs:{x:We},backend:n,attrs:{shape:[-1,Ft]}}),Re=Q8(R.dtype),Lr=$2(jt,Re,"prod",n);ft=$s({inputs:{x:Lr},backend:n,attrs:{shape:xt}}),he.push(jt),he.push(Lr)}if(re){he.push(ft);const xt=ip(ft.shape,be);ft=$s({inputs:{x:ft},backend:n,attrs:{shape:xt}})}return he.forEach(xt=>n.disposeIntermediateTensorInfo(xt)),ft}const qTe={kernelName:RR,backendName:"webgl",kernelFunc:GTe};function HTe(u){const{inputs:e,backend:n,attrs:b}=u,{paramsNestedSplits:R,paramsDenseValues:q,indices:re}=e,{outputRaggedRank:fe}=b,he=R.map(jt=>n.readSync(jt.dataId)),be=R.map(jt=>jt.shape),Pe=n.readSync(q.dataId),je=n.readSync(re.dataId),[We,ft,xt]=j1e(he,be,Pe,q.shape,q.dtype,je,re.shape,fe),zt=We.map(jt=>n.makeTensorInfo([jt.length],"int32",jt)),Ft=n.makeTensorInfo(xt,q.dtype,ft);return zt.concat([Ft])}const WTe={kernelName:PU,backendName:"webgl",kernelFunc:HTe};function XTe(u){const{inputs:e,backend:n}=u,{starts:b,limits:R,deltas:q}=e,re=n.readSync(b.dataId),fe=n.readSync(R.dataId),he=n.readSync(q.dataId),[be,Pe]=G1e(re,b.shape,b.dtype,fe,R.shape,he,q.shape),je=n.makeTensorInfo([be.length],"int32",be),We=n.makeTensorInfo([Pe.length],b.dtype,Pe);return[je,We]}const YTe={kernelName:zU,backendName:"webgl",kernelFunc:XTe};function ZTe(u){const{inputs:e,backend:n,attrs:b}=u,{shape:R,values:q,defaultValue:re,rowPartitionTensors:fe}=e,{rowPartitionTypes:he}=b,be=n.readSync(R.dataId),Pe=n.readSync(q.dataId),je=n.readSync(re.dataId),We=fe.map(Ft=>n.readSync(Ft.dataId)),ft=fe.map(Ft=>Ft.shape),[xt,zt]=q1e(be,R.shape,Pe,q.shape,q.dtype,je,re.shape,We,ft,he);return n.makeTensorInfo(xt,q.dtype,zt)}const KTe={kernelName:NU,backendName:"webgl",kernelFunc:ZTe};const WH=u=>{const{backend:e,attrs:n}=u,{start:b,stop:R,step:q,dtype:re}=n,fe=H1e(b,R,q,re);return e.makeTensorInfo([fe.length],re,fe)},JTe={kernelName:V8,backendName:"webgl",kernelFunc:WH};const QTe="return 1.0 / x;",eAe=rf({opSnippet:QTe}),tAe={kernelName:GC,backendName:"webgl",kernelFunc:eAe};const rAe=A0+` + return (x < 0.0) ? 0.0 : x; +`,nAe=` + vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); + bvec4 isNaN = isnan(x); + + result.r = isNaN.r ? x.r : result.r; + result.g = isNaN.g ? x.g : result.g; + result.b = isNaN.b ? x.b : result.b; + result.a = isNaN.a ? x.a : result.a; + + return result; +`,aAe=rf({opSnippet:rAe,packedOpSnippet:nAe}),iAe={kernelName:qC,backendName:"webgl",kernelFunc:aAe};const oAe=A0+` + return (x < 0.0) ? 0.0 : min(6.0, x); +`,sAe=` + vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); + bvec4 isNaN = isnan(x); + + result.r = isNaN.r ? x.r : result.r; + result.g = isNaN.g ? x.g : result.g; + result.b = isNaN.b ? x.b : result.b; + result.a = isNaN.a ? x.a : result.a; + + return result; +`,lAe=rf({opSnippet:oAe,packedOpSnippet:sAe}),uAe={kernelName:HC,backendName:"webgl",kernelFunc:lAe};class cAe{constructor(e,n,b,R,q){this.variableNames=["A"],this.outputShape=[];const[re,fe,he,be]=e;this.outputShape=[re,n,b,be];const Pe=[R&&n>1?fe-1:fe,R&&b>1?he-1:he],je=[R&&n>1?n-1:n,R&&b>1?b-1:b];let We;q?We="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":We="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + const vec2 effectiveInputOverOutputRatioRC = vec2( + ${Pe[0]/je[0]}, + ${Pe[1]/je[1]}); + const vec2 inputShapeRC = vec2(${fe}.0, ${he}.0); + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + ivec2 yRC = coords.yz; + + // Fractional source index. + vec2 sourceFracIndexRC = ${We}; + + // Compute the four integer indices. + ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0))); + ivec2 sourceCeilRC = ivec2( + min(inputShapeRC - 1.0, ceil(sourceFracIndexRC))); + + float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d); + float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d); + float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d); + float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d); + + vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC); + + float top = topLeft + (topRight - topLeft) * fracRC.y; + float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y; + float newValue = top + (bottom - top) * fracRC.x; + + setOutput(newValue); + } + `}}class fAe{constructor(e,n,b,R,q){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[re,fe,he,be]=e;this.outputShape=[re,n,b,be];const Pe=[R&&n>1?fe-1:fe,R&&b>1?he-1:he],je=[R&&n>1?n-1:n,R&&b>1?b-1:b];let We;q?We="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":We="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + const vec3 effectiveInputOverOutputRatioRC = vec3( + ${Pe[0]/je[0]}, + ${Pe[1]/je[1]}, + ${Pe[1]/je[1]}); + const vec3 inputShapeRC = vec3(${fe}.0, ${he}.0, + ${he}.0); + + float getAValue(int b, int r, int c, int d) { + return getChannel(getA(b, r, c, d), vec2(c, d)); + } + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + // Calculate values for next column in yRC.z. + ivec3 yRC = coords.yzz + ivec3(0, 0, 1); + + // Fractional source index. + vec3 sourceFracIndexRC = ${We}; + + // Compute the four integer indices. + ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0))); + ivec3 sourceCeilRC = ivec3( + min(inputShapeRC - 1.0, ceil(sourceFracIndexRC))); + + // Should we calculate next column and row elements in 2x2 packed cell. + bool hasNextCol = d < ${be-1}; + bool hasNextRow = coords.z < ${b-1}; + + // In parallel, construct four corners for all four components in + // packed 2x2 cell. + vec4 topLeft = vec4( + getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d), + hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1) + : 0.0, + hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d) + : 0.0, + (hasNextRow && hasNextCol) ? + getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0); + + vec4 bottomLeft = vec4( + getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d), + hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1) + : 0.0, + hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d) + : 0.0, + (hasNextRow && hasNextCol) ? + getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0); + + vec4 topRight = vec4( + getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d), + hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1) + : 0.0, + hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d) + : 0.0, + (hasNextRow && hasNextCol) ? + getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0); + + vec4 bottomRight = vec4( + getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d), + hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1) + : 0.0, + hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d) + : 0.0, + (hasNextRow && hasNextCol) ? + getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0); + + vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC); + + vec4 top = mix(topLeft, topRight, fracRC.yyzz); + vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz); + vec4 newValue = mix(top, bottom, fracRC.x); + + setOutput(newValue); + } + `}}function hAe(u){const{inputs:e,backend:n,attrs:b}=u,{images:R}=e,{alignCorners:q,halfPixelCenters:re,size:fe}=b,[he,be]=fe,Pe=co().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new fAe(R.shape,he,be,q,re):new cAe(R.shape,he,be,q,re);return n.runWebGLProgram(Pe,[R],"float32")}const dAe={kernelName:zR,backendName:"webgl",kernelFunc:hAe};class pAe{constructor(e,n,b){this.variableNames=["dy"],this.outputShape=[],this.outputShape=n;const[,R,q]=n,[,re,fe]=e,he=[b&&re>1?R-1:R,b&&fe>1?q-1:q],be=[b&&re>1?re-1:re,b&&fe>1?fe-1:fe],Pe=he[0]/be[0],je=he[1]/be[1],We=1/Pe,ft=1/je,xt=Math.ceil(We)*2+2,zt=Math.ceil(ft)*2+2;this.userCode=` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + int r = coords[1]; + int c = coords[2]; + + float accumulator = 0.0; + + const float heightScale = float(${Pe}); + const float widthScale = float(${je}); + + const float invHeightScale = float(${We}); + const float invWidthScale = float(${ft}); + + const int winHeight = int(${xt}); + const int winWidth = int(${zt}); + + // Compute bounds for where in dy we will look + float startRLerp = floor(float(r) * invHeightScale); + int startDyR = int(startRLerp - float(winHeight / 2)); + + float startCLerp = floor(float(c) * invWidthScale); + int startDyC = int(startCLerp - float(winWidth / 2)); + + // Loop over dy + for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) { + int dyR = dyROffset + startDyR; + + // Guard against the window exceeding the bounds of dy + if (dyR < 0 || dyR >= ${re}) { + continue; + } + + for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) { + int dyC = dyCOffset + startDyC; + + // Guard against the window exceeding the bounds of dy + if (dyC < 0 || dyC >= ${fe}) { + continue; + } + + float dxR = float(dyR) * heightScale; + int topDxRIndex = int(floor(dxR)); + int bottomDxRIndex = int(min(ceil(dxR), ${R-1}.0)); + float dxRLerp = dxR - float(topDxRIndex); + float inverseDxRLerp = 1.0 - dxRLerp; + + float dxC = float(dyC) * widthScale; + int leftDxCIndex = int(floor(dxC)); + int rightDxCIndex = int(min(ceil(dxC), ${q-1}.0)); + float dxCLerp = dxC - float(leftDxCIndex); + float inverseDxCLerp = 1.0 - dxCLerp; + + if (r == topDxRIndex && c == leftDxCIndex) { + // topLeft + accumulator += + getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp; + } + + if (r == topDxRIndex && c == rightDxCIndex) { + // topRight + accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp; + } + + if (r == bottomDxRIndex && c == leftDxCIndex) { + // bottomLeft + accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp; + } + + if (r == bottomDxRIndex && c == rightDxCIndex) { + // bottomRight + accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp; + } + } + } + // End loop over dy + + setOutput(accumulator); + } + `}}function vAe(u){const{inputs:e,backend:n,attrs:b}=u,{images:R,dy:q}=e,{alignCorners:re}=b,fe=new pAe(q.shape,R.shape,re);return n.runWebGLProgram(fe,[q],q.dtype)}const mAe={kernelName:q8,backendName:"webgl",kernelFunc:vAe};class gAe{constructor(e,n,b,R,q){this.variableNames=["A"],this.outputShape=[];const[re,fe,he,be]=e;this.outputShape=[re,n,b,be];const Pe=[R&&n>1?fe-1:fe,R&&b>1?he-1:he],je=[R&&n>1?n-1:n,R&&b>1?b-1:b],We=R?"0.5":"0.0";let ft;q?ft="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":ft="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + const vec2 effectiveInputOverOutputRatioRC = vec2( + ${Pe[0]/je[0]}, + ${Pe[1]/je[1]}); + const vec2 inputShapeRC = vec2(${fe}.0, ${he}.0); + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + ivec2 yRC = coords.yz; + + // Fractional source index. + vec2 sourceFracIndexRC = ${ft}; + + // Compute the coordinators of nearest neighbor point. + ivec2 sourceNearestRC = ivec2( + min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${We}))); + float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d); + + setOutput(newValue); + } + `}}class yAe{constructor(e,n,b,R,q){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[re,fe,he,be]=e;this.outputShape=[re,n,b,be];const Pe=[R&&n>1?fe-1:fe,R&&b>1?he-1:he],je=[R&&n>1?n-1:n,R&&b>1?b-1:b],We=R?"0.5":"0.0";let ft;q?ft="max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":ft="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + const vec3 effectiveInputOverOutputRatioRC = vec3( + ${Pe[0]/je[0]}, + ${Pe[1]/je[1]}, + ${Pe[1]/je[1]}); + const vec3 inputShapeRC = vec3(${fe}.0, ${he}.0, + ${he}.0); + + float getAValue(int b, int r, int c, int d) { + return getChannel(getA(b, r, c, d), vec2(c, d)); + } + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + // Calculate values for next column in yRC.z. + ivec3 yRC = coords.yzz + ivec3(0, 0, 1); + + // Fractional source index. + vec3 sourceFracIndexRC = ${ft}; + + // Compute the coordinators of nearest neighbor point. + ivec3 sourceNearestRC = ivec3( + min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${We}))); + + // Should we calculate next column and row elements in 2x2 packed cell. + bool hasNextCol = d < ${be-1}; + bool hasNextRow = coords.z < ${b-1}; + + vec4 newValue = vec4( + getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d), + hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1) + : 0.0, + hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d) + : 0.0, + (hasNextRow && hasNextCol) ? + getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0); + + setOutput(newValue); + } + `}}function _Ae(u){const{inputs:e,backend:n,attrs:b}=u,{images:R}=e,{alignCorners:q,halfPixelCenters:re,size:fe}=b,[he,be]=fe,Pe=co().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new yAe(R.shape,he,be,q,re):new gAe(R.shape,he,be,q,re);return n.runWebGLProgram(Pe,[R],R.dtype)}const xAe={kernelName:PR,backendName:"webgl",kernelFunc:_Ae};class bAe{constructor(e,n,b){this.variableNames=["dy"],this.outputShape=[],this.outputShape=n;const[,R,q]=n,[,re,fe]=e,he=[b&&re>1?R-1:R,b&&fe>1?q-1:q],be=[b&&re>1?re-1:re,b&&fe>1?fe-1:fe],Pe=he[0]/be[0],je=he[1]/be[1],We=1/Pe,ft=1/je,xt=Math.ceil(We)*2+2,zt=Math.ceil(ft)*2+2;this.userCode=` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + int r = coords[1]; + int c = coords[2]; + + float accumulator = 0.0; + + const float heightScale = float(${Pe}); + const float widthScale = float(${je}); + + const float invHeightScale = float(${We}); + const float invWidthScale = float(${ft}); + + const int winHeight = int(${xt}); + const int winWidth = int(${zt}); + + // Compute bounds for where in dy we will look + float startRLerp = floor(float(r) * invHeightScale); + int startDyR = int(floor(startRLerp - float(winHeight / 2))); + + float startCLerp = floor(float(c) * invWidthScale); + int startDyC = int(floor(startCLerp - float(winWidth / 2))); + + // Loop over dy + for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) { + int dyR = dyROffset + startDyR; + + // Guard against the window exceeding the bounds of dy + if (dyR < 0 || dyR >= ${re}) { + continue; + } + + for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) { + int dyC = dyCOffset + startDyC; + + // Guard against the window exceeding the bounds of dy + if (dyC < 0 || dyC >= ${fe}) { + continue; + } + + float sourceFracRow = + float(${he[0]}) * + (float(dyR) / float(${be[0]})); + + float sourceFracCol = + float(${he[1]}) * + (float(dyC) / float(${be[1]})); + + int sourceNearestRow = int(min( + float(int(${R}) - 1), + ${b} ? float(round(sourceFracRow)) : + float(floor(sourceFracRow)))); + + int sourceNearestCol = int(min( + float(int(${q}) - 1), + ${b} ? float(round(sourceFracCol)) : + float(floor(sourceFracCol)))); + + if (r == sourceNearestRow && c == sourceNearestCol) { + accumulator += getDy(b, dyR, dyC, d); + } + } + } + // End loop over dy + + setOutput(accumulator); + } + `}}function wAe(u){const{inputs:e,backend:n,attrs:b}=u,{images:R,dy:q}=e,{alignCorners:re}=b,fe=new bAe(q.shape,R.shape,re);return n.runWebGLProgram(fe,[q],q.dtype)}const TAe={kernelName:G8,backendName:"webgl",kernelFunc:wAe};class AAe{constructor(e,n){this.variableNames=["x"];const b=e.length;if(b>4)throw new Error(`WebGL backend: Reverse of rank-${b} tensor is not yet supported`);if(this.outputShape=e,b===1){this.userCode=` + void main() { + int coord = getOutputCoords(); + setOutput(getX(${e[0]} - coord - 1)); + } + `;return}const R=fe=>n.indexOf(fe)!==-1&&e[fe]!==1?`${e[fe]} - coords[${fe}] - 1`:`coords[${fe}]`,q=e.map((fe,he)=>R(he)).join(","),re=Th(b);this.userCode=` + void main() { + ${re} coords = getOutputCoords(); + setOutput(getX(${q})); + } + `}}class SAe{constructor(e,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;const b=e.length;if(b>4)throw new Error(`WebGL backend: Reverse of rank-${b} tensor is not yet supported`);this.outputShape=e;const R=vm("rc",b),q=`${R[b-1]} + 1 < ${this.outputShape[b-1]}`,re=`${R[b-2]} + 1 < ${this.outputShape[b-2]}`,fe=Th(b);b===1?this.userCode=` + void main(){ + int rc = getOutputCoords(); + vec4 result = vec4(0.); + result.r = getChannel(getX(${e[0]} - rc - 1), + ${e[0]} - rc - 1); + if(${q}){ + result.g = getChannel(getX(${e[0]} - (rc + 1) - 1), + ${e[0]} - (rc + 1) - 1); + } + setOutput(result); + } + `:this.userCode=` + void main() { + ${fe} rc = getOutputCoords(); + vec4 result = vec4(0.); + result.r = ${he(R.slice())}; + if(${q}){ + result.g = ${be(R.slice())}; + } + if(${re}) { + result.b = ${Pe(R.slice())}; + if(${q}) { + result.a = ${je(R.slice())}; + } + } + setOutput(result); + } + `;function he(xt){return We(xt)}function be(xt){return xt[b-1]="("+xt[b-1]+" + 1)",We(xt)}function Pe(xt){return xt[b-2]="("+xt[b-2]+" + 1)",We(xt)}function je(xt){return xt[b-1]="("+xt[b-1]+" + 1)",xt[b-2]="("+xt[b-2]+" + 1)",We(xt)}function We(xt){const zt=e.map((Re,Lr)=>ft(Lr,xt)),Ft=zt.join(","),jt=zt.slice(-2).join(",");return`getChannel(getX(${Ft}), vec2(${jt}))`}function ft(xt,zt){return n.indexOf(xt)!==-1&&e[xt]!==1?`${e[xt]} - ${zt[xt]} - 1`:`${zt[xt]}`}}}function EAe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{dims:q}=b,re=R.shape.length,fe=Ac(q,R.shape);if(re===0)return ug({inputs:{x:R},backend:n});const he=co().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new SAe(R.shape,fe):new AAe(R.shape,fe);return n.runWebGLProgram(he,[R],R.dtype)}const CAe={kernelName:NR,backendName:"webgl",kernelFunc:EAe};class kAe{constructor(e,n){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const b=e[1],R=e[2];this.outputShape=e;let q="";typeof n=="number"?q=`float outputValue = ${n.toFixed(2)};`:q=` + vec3 fill = vec3(${n.join(",")}); + float outputValue = fill[coords[3]];`,this.userCode=` + void main() { + ivec4 coords = getOutputCoords(); + int x = coords[2]; + int y = coords[1]; + float coordXFloat = (float(x) - params[0]) * params[3] - + (float(y) - params[1]) * params[2]; + float coordYFloat = (float(x) - params[0]) * params[2] + + (float(y) - params[1]) * params[3]; + int coordX = int(round(coordXFloat + params[0])); + int coordY = int(round(coordYFloat + params[1])); + ${q} + if(coordX >= 0 && coordX < ${R} && coordY >= 0 && coordY < ${b}) { + outputValue = getImage(coords[0], coordY, coordX, coords[3]); + } + setOutput(outputValue); + } + `}}const MAe={kernelName:J8,backendName:"webgl",kernelFunc:({inputs:u,attrs:e,backend:n})=>{const{image:b}=u,{radians:R,fillValue:q,center:re}=e,fe=n,he=new kAe(b.shape,q),[be,Pe]=NN(re,b.shape[1],b.shape[2]),je=[[be,Pe,Math.sin(R),Math.cos(R)]];return fe.runWebGLProgram(he,[b],b.dtype,je)}};const IAe=` + // OpenGL ES does not support round function. + // The algorithm is based on banker's rounding. + float base = floor(x); + if ((x - base) < 0.5) { + return floor(x); + } else if ((x - base) > 0.5) { + return ceil(x); + } else { + if (mod(base, 2.0) == 0.0) { + return base; + } else { + return base + 1.0; + } + } +`,LAe=rf({opSnippet:IAe}),RAe={kernelName:WC,backendName:"webgl",kernelFunc:LAe};const DAe="return inversesqrt(x);",PAe=rf({opSnippet:DAe,cpuKernelImpl:W1e}),zAe={kernelName:XC,backendName:"webgl",kernelFunc:PAe};class OO{constructor(e,n,b,R,q,re,fe=!0,he=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=re;const be=Th(q.length),Pe=Th(re.length);let je="";b===1?je="i":b===2&&(je="i, j");const We=`getIndices(${je})`;let ft="";R===1?ft="i":R===2&&(ft="i, coords[1]");const xt=`getUpdates(${ft})`;let zt="";he&&(zt="coords[0], coords[1]");const Ft=`getDefaultValue(${zt})`,jt=n>1?"strides[j]":"strides";this.userCode=` + ${be} strides = ${be}(${q}); + + void main() { + ${Pe} coords = getOutputCoords(); + float sum = 0.0; + bool found = false; + for (int i = 0; i < ${e}; i++) { + int flattenedIndex = 0; + for (int j = 0; j < ${n}; j++) { + int index = round(${We}); + flattenedIndex += index * ${jt}; + } + if (flattenedIndex == coords[0]) { + sum += ${xt}; + found = true; + } + } + setOutput(mix(${Ft}, sum, float(found))); + } + `}}class NAe{constructor(e,n,b,R,q,re,fe=!0,he=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=re;const be=Th(q.length),Pe=Th(re.length);let je="";b===1?je="i":b===2&&(je="i, j");const We=`getIndices(${je})`;let ft="";R===1?ft="i":R===2&&(ft="i, coords[1]");const xt=`getUpdates(${ft})`;let zt="";he&&(zt="coords[0], coords[1]");const Ft=`getDefaultValue(${zt})`,jt=n>1?"strides[j]":"strides",Re=n>1?"strides[j + 1]":"strides";this.userCode=` + ${be} strides = ${be}(${q}); + + void main() { + ${Pe} coords = getOutputCoords(); + vec4 sum = vec4(0.); + vec4 found = vec4(0.); + for (int i = 0; i < ${e}; i+=2) { + ivec2 flattenedIndex = ivec2(0); + for (int j = 0; j < ${n}; j+=2) { + ivec4 index = round(${We}); + flattenedIndex += index.xz * ${jt}; + if (j + 1 < ${n}) { + flattenedIndex += index.yw * ${Re}; + } + } + if (flattenedIndex[0] == coords[0] || flattenedIndex[1] == coords[0] || + flattenedIndex[0] == coords[0] + 1 || flattenedIndex[1] == coords[0] + 1) { + vec4 updVals = ${xt}; + if (flattenedIndex[0] == coords[0]) { + sum.xy += updVals.xy; + found.xy = vec2(1.); + } else if (flattenedIndex[0] == coords[0] + 1) { + sum.zw += updVals.xy; + found.zw = vec2(1.); + } + if (flattenedIndex[1] == coords[0]) { + sum.xy += updVals.zw; + found.xy = vec2(1.); + } else if (flattenedIndex[1] == coords[0] + 1) { + sum.zw += updVals.zw; + found.zw = vec2(1.); + } + } + } + setOutput(mix(${Ft}, sum, found)); + } + `}}function OAe(u){const{inputs:e,backend:n,attrs:b}=u,{indices:R,updates:q}=e,{shape:re}=b,{sliceRank:fe,numUpdates:he,sliceSize:be,strides:Pe,outputSize:je}=z2(q,R,re),We=[je/be,be];if(je===0)return n.makeTensorInfo(re,R.dtype);const ft=$s({inputs:{x:R},backend:n,attrs:{shape:[he,fe]}}),xt=$s({inputs:{x:q},backend:n,attrs:{shape:[he,be]}}),zt=n.makeTensorInfo([],"float32",new Float32Array([0]));let Ft;co().getBool("WEBGL_PACK")?Ft=new NAe(he,fe,ft.shape.length,xt.shape.length,Pe,We):Ft=new OO(he,fe,ft.shape.length,xt.shape.length,Pe,We);const jt=n.runWebGLProgram(Ft,[xt,ft,zt],xt.dtype),Re=$s({inputs:{x:jt},backend:n,attrs:{shape:re}});return n.disposeIntermediateTensorInfo(ft),n.disposeIntermediateTensorInfo(xt),n.disposeIntermediateTensorInfo(jt),n.disposeIntermediateTensorInfo(zt),Re}const FAe={kernelName:OU,backendName:"webgl",kernelFunc:OAe};class BAe{constructor(e,n,b,R){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,b];const q="while (left < right) {",re=`for (int i = 0; i < ${Math.ceil(Math.log2(n+1))}; ++i) { if (left >= right) break;`,fe=co().getNumber("WEBGL_VERSION")===2?q:re,he=R==="left"?"<":"<=";this.userCode=` + int findBound(int batch, float value) { + int left = 0; + int right = numInputs; + int mid; + ${fe} + mid = (left + right) / 2; + if (getSortedSequence(batch, mid) ${he} value) { + left = mid + 1; + } else { + right = mid; + } + } + return right; + } + + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int valueIndex = coords[1]; + + float value = getValues(batch, valueIndex); + + setOutput(float(findBound(batch, value))); + } + `}}function UAe(u){const{inputs:e,backend:n,attrs:b}=u,{sortedSequence:R,values:q}=e,{side:re}=b,fe=new BAe(R.shape[0],R.shape[1],q.shape[1],re),he=[[R.shape[1]]];return n.runWebGLProgram(fe,[R,q],"int32",he)}const $Ae={kernelName:BU,backendName:"webgl",kernelFunc:UAe};class VAe{constructor(e,n,b){this.variableNames=["c","a","b"],this.outputShape=n;let R,q;if(b>4)throw Error(`Where for rank ${b} is not yet supported`);if(b===1)q="resRC",R="resRC";else{const fe=["resRC.x","resRC.y","resRC.z","resRC.w"],he=[],be=[];for(let Pe=0;Pe= 1.0) { + setOutput(getA(${q})); + } else { + setOutput(getB(${q})); + } + } + `}}function jAe(u){const{inputs:e,backend:n}=u,{condition:b,t:R,e:q}=e,re=new VAe(b.shape.length,R.shape,R.shape.length);return n.runWebGLProgram(re,[b,R,q],sg(R.dtype,q.dtype))}const GAe={kernelName:OR,backendName:"webgl",kernelFunc:jAe};const qAe=` + // Stable and Attracting Fixed Point (0, 1) for Normalized Weights. + // see: https://arxiv.org/abs/1706.02515 + float scaleAlpha = ${nD}; + float scale = ${aD}; + return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0); +`,HAe=rf({opSnippet:qAe}),WAe={kernelName:YC,backendName:"webgl",kernelFunc:HAe};const XAe=QA+` + return 1.0 / (1.0 + exp(-1.0 * x)); +`,YAe=` + vec4 result = 1.0 / (1.0 + exp(-1.0 * x)); + bvec4 isNaN = isnan(x); + + result.r = isNaN.r ? x.r : result.r; + result.g = isNaN.g ? x.g : result.g; + result.b = isNaN.b ? x.b : result.b; + result.a = isNaN.a ? x.a : result.a; + + return result; +`,ZAe=rf({opSnippet:XAe,packedOpSnippet:YAe,cpuKernelImpl:Y1e}),KAe={kernelName:QC,backendName:"webgl",kernelFunc:ZAe};const JAe=` + if (isnan(x)) { return 0.0; } + return sign(x); +`,QAe=rf({opSnippet:JAe}),eSe={kernelName:JC,backendName:"webgl",kernelFunc:QAe};const tSe=QA+` + return sin(x); +`,rSe=` + vec4 result = sin(x); + bvec4 isNaN = isnan(x); + ${U2} + return result; +`,nSe=rf({opSnippet:tSe,packedOpSnippet:rSe}),aSe={kernelName:ZC,backendName:"webgl",kernelFunc:nSe};const iSe=` + float e2x = exp(x); + return (e2x - 1.0 / e2x) / 2.0; +`,oSe=rf({opSnippet:iSe}),sSe={kernelName:KC,backendName:"webgl",kernelFunc:oSe};const lSe=` + float epsilon = 1.1920928955078125e-7; + float threshold = log(epsilon) + 2.0; + + bool too_large = x > -threshold; + bool too_small = x < threshold; + + float result; + float exp_x = exp(x); + + if (too_large){ + result = x; + } + else if (too_small){ + result = exp_x; + } + else{ + result = log(exp_x + 1.0); + } + return result; +`,uSe=rf({opSnippet:lSe}),cSe={kernelName:ek,backendName:"webgl",kernelFunc:uSe};const fSe=u=>{const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{blockShape:q,paddings:re}=b;Jn(R.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");const fe=q.reduce((jt,Re)=>jt*Re),he=[[0,0]];he.push(...re);for(let jt=1+q.length;jtn.disposeIntermediateTensorInfo(jt)),Ft},hSe={kernelName:UR,backendName:"webgl",kernelFunc:fSe};function dSe(u){const{inputs:e,backend:n}=u,{indices:b,values:R,denseShape:q,defaultValue:re}=e;if(q.shape.length!==1)throw new Error(`Dense shape must be a vector, saw: + ${q.shape}`);if(b.shape.length!==2)throw new Error(`Indices must be a matrix, saw: + ${b.shape}`);if(R.shape.length!==1)throw new Error(`Values must be a vector, saw: + ${R.shape}`);if(re.shape.length!==0)throw new Error(`Default value must be a scalar, saw: + ${re.shape}`);const fe=n.readSync(b.dataId),he=n.readSync(R.dataId),be=n.readSync(q.dataId),Pe=n.readSync(re.dataId)[0],[je,We,ft,xt,zt]=K1e(fe,b.shape,b.dtype,he,R.dtype,be,Pe);return[n.makeTensorInfo(We,b.dtype,je),n.makeTensorInfo([We[0]],R.dtype,ft),n.makeTensorInfo([xt.length],"bool",new Uint8Array(xt.map(Ft=>Number(Ft)))),n.makeTensorInfo([zt.length],b.dtype,new Int32Array(zt))]}const pSe={kernelName:UU,backendName:"webgl",kernelFunc:dSe};function vSe(u){const{inputs:e,backend:n}=u,{inputIndices:b,inputShape:R,newShape:q}=e;if(b.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${b.shape}`);if(R.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${R.shape}`);if(q.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${q.shape}`);const re=Array.from(n.readSync(R.dataId)),fe=n.readSync(b.dataId),he=Array.from(n.readSync(q.dataId)),[be,Pe,je]=J1e(fe,b.shape,b.dtype,re,he);return[n.makeTensorInfo(Pe,b.dtype,be),n.makeTensorInfo([je.length],q.dtype,new Int32Array(je))]}const mSe={kernelName:$U,backendName:"webgl",kernelFunc:vSe};function gSe(u){const{inputs:e,backend:n}=u,{data:b,indices:R,segmentIds:q}=e;if(b.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(R.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${R.shape}`);if(q.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape + ${q.shape}`);const re=n.readSync(b.dataId),fe=n.readSync(R.dataId),he=n.readSync(q.dataId),[be,Pe]=gH(re,b.shape,b.dtype,fe,he,!0);return n.makeTensorInfo(Pe,b.dtype,be)}const ySe={kernelName:VU,backendName:"webgl",kernelFunc:gSe};function _Se(u){const{inputs:e,backend:n}=u,{data:b,indices:R,segmentIds:q}=e;if(b.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(R.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${R.shape}`);if(q.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape + ${q.shape}`);const re=n.readSync(b.dataId),fe=n.readSync(R.dataId),he=n.readSync(q.dataId),[be,Pe]=gH(re,b.shape,b.dtype,fe,he);return n.makeTensorInfo(Pe,b.dtype,be)}const xSe={kernelName:jU,backendName:"webgl",kernelFunc:_Se};function bSe(u){const{inputs:e,backend:n,attrs:b}=u,{sparseIndices:R,sparseValues:q,defaultValue:re}=e,{outputShape:fe}=b,{sliceRank:he,numUpdates:be,sliceSize:Pe,strides:je,outputSize:We}=z2(q,R,fe),ft=!1;if(q.dtype==="string"){const jt=n.bufferSync(R),Re=n.bufferSync(q),Lr=cb(n.readSync(re.dataId)[0]),Cr=X1e(jt,Re,fe,We,Pe,be,he,je,Lr,ft);return n.makeTensorInfo(fe,Cr.dtype,Cr.values)}const xt=new OO(be,he,R.shape.length,q.shape.length,je,[We,1],ft),zt=n.runWebGLProgram(xt,[q,R,re],q.dtype),Ft=$s({inputs:{x:zt},backend:n,attrs:{shape:fe}});return n.disposeIntermediateTensorInfo(zt),Ft}const wSe={kernelName:GU,backendName:"webgl",kernelFunc:bSe};function TSe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{numOrSizeSplits:q,axis:re}=b,fe=Ac(re,R.shape)[0],he=KN(R,q,fe),be=R.shape.length,Pe=new Array(be).fill(0),je=R.shape.slice();return he.map(We=>{const ft=[...je];ft[fe]=We;const xt=eS({inputs:{x:R},backend:n,attrs:{begin:Pe,size:ft}});return Pe[fe]+=We,xt})}const ASe={kernelName:$R,backendName:"webgl",kernelFunc:TSe};const lU="return sqrt(x);",SSe=rf({opSnippet:lU,packedOpSnippet:lU,cpuKernelImpl:Q1e}),ESe={kernelName:tk,backendName:"webgl",kernelFunc:SSe};const CSe="return x * x;",kSe=rf({opSnippet:CSe}),MSe={kernelName:H8,backendName:"webgl",kernelFunc:kSe};const uU="return (a - b) * (a - b);",ISe=kv({opSnippet:uU,packedOpSnippet:uU}),LSe={kernelName:rk,backendName:"webgl",kernelFunc:ISe};function RSe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e;if(R.dtype!=="string")throw new Error("Input must be of datatype string");const q=n.readSync(R.dataId),re=T_(q),fe=e_e(re,"string",b);return n.makeTensorInfo(R.shape,"string",fe)}const DSe={kernelName:W8,backendName:"webgl",kernelFunc:RSe};function PSe({inputs:u,attrs:e,backend:n}){const{x:b}=u,R=A0+` + return x > 0.0 ? 1.0 : float(${e.alpha}); + `,q=new u1(b.shape,R);return n.runWebGLProgram(q,[b],b.dtype)}const zSe={kernelName:sk,backendName:"webgl",kernelFunc:PSe};class NSe{constructor(e,n,b){this.variableNames=["x"],this.outputShape=b;const R=b.length,q=Th(b.length),re=Th(b.length);let fe="";if(R===1)fe="coords * strides + begin";else{let he=0;fe=b.map((be,Pe)=>(he++,b.length===1?`coords * strides[${Pe}] + begin[${Pe}]`:`coords[${he-1}] * strides[${Pe}] + begin[${Pe}]`)).join(",")}this.userCode=` + ${q} begin = ${q}(${e}); + ${q} strides = ${q}(${n}); + + void main() { + ${re} coords = getOutputCoords(); + setOutput(getX(${fe})); + } + `}}function OSe(u){const{inputs:e,backend:n,attrs:b}=u,{x:R}=e,{begin:q,end:re,strides:fe,beginMask:he,endMask:be,ellipsisMask:Pe,newAxisMask:je,shrinkAxisMask:We}=b,{finalShapeSparse:ft,finalShape:xt,isIdentity:zt,sliceDim0:Ft,isSimpleSlice:jt,begin:Re,end:Lr,strides:Cr}=sV(R.shape,q,re,fe,he,be,Pe,je,We);let Gr;if(zt)Gr=$s({inputs:{x:R},backend:n,attrs:{shape:xt}});else if(Ft||jt){Jn(R.shape.length>=1,()=>`Input must have rank at least 1, got: ${R.shape.length}`);const Pn=aV(Re,Lr,Cr),Vn=eS({inputs:{x:R},backend:n,attrs:{begin:Re,size:Pn}});Gr=$s({inputs:{x:Vn},backend:n,attrs:{shape:xt}}),n.disposeIntermediateTensorInfo(Vn)}else if(n.shouldExecuteOnCPU([R])){const Vn=n.readSync(R.dataId),un=Tc(R.shape,R.dtype,Vn),Nn=t_e(ft,un,Cr,Re);Gr=n.makeTensorInfo(xt,R.dtype,Nn.values)}else{const Vn=new NSe(Re,Cr,ft);Gr=n.runWebGLProgram(Vn,[R],R.dtype)}const yn=$s({inputs:{x:Gr},backend:n,attrs:{shape:xt}});return n.disposeIntermediateTensorInfo(Gr),yn}const FSe={kernelName:X8,backendName:"webgl",kernelFunc:OSe};function BSe(u){const{inputs:e,backend:n,attrs:b}=u,{separator:R,nGramWidths:q,leftPad:re,rightPad:fe,padWidth:he,preserveShortSequences:be}=b,{data:Pe,dataSplits:je}=e,We=n.readSync(Pe.dataId),ft=n.readSync(je.dataId),[xt,zt]=r_e(We,ft,R,q,re,fe,he,be);return[n.makeTensorInfo([xt.length],"string",xt),n.makeTensorInfo(je.shape,"int32",zt)]}const USe={kernelName:qU,backendName:"webgl",kernelFunc:BSe};function $Se(u){const{inputs:e,backend:n,attrs:b}=u,{skipEmpty:R}=b,{input:q,delimiter:re}=e;if(q.dtype!=="string")throw new Error("Input must be of datatype string");if(q.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${q.shape}`);if(re.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${re.shape}`);const fe=n.readSync(q.dataId),he=n.readSync(re.dataId)[0],[be,Pe,je]=n_e(fe,he,R),We=Pe.length;return[n.makeTensorInfo([We,2],"int32",be),n.makeTensorInfo([We],"string",Pe),n.makeTensorInfo([2],"int32",new Int32Array(je))]}const VSe={kernelName:HU,backendName:"webgl",kernelFunc:$Se};function jSe(u){const{inputs:e,backend:n,attrs:b}=u,{numBuckets:R}=b,{input:q}=e;if(q.dtype!=="string")throw new Error("Input must be of datatype string");if(R<=0)throw new Error("Number of buckets must be at least 1");const re=n.readSync(q.dataId),fe=a_e(re,R);return n.makeTensorInfo(q.shape,"int32",fe)}const GSe={kernelName:WU,backendName:"webgl",kernelFunc:jSe};const qSe="return tan(x);",HSe=rf({opSnippet:qSe}),WSe={kernelName:ak,backendName:"webgl",kernelFunc:HSe};const XSe=` + float e2x = exp(-2.0 * abs(x)); + return sign(x) * (1.0 - e2x) / (1.0 + e2x); +`,YSe=rf({opSnippet:XSe}),ZSe={kernelName:ik,backendName:"webgl",kernelFunc:YSe};function KSe(u){const{inputs:e,backend:n,attrs:b}=u,{tensor:R,indices:q,updates:re}=e,{sliceRank:fe,numUpdates:he,sliceSize:be,strides:Pe,outputSize:je}=z2(re,q,R.shape),We=[je/be,be];if(je===0)return n.makeTensorInfo(R.shape,q.dtype);const ft=$s({inputs:{x:q},backend:n,attrs:{shape:[he,fe]}}),xt=$s({inputs:{x:re},backend:n,attrs:{shape:[he,be]}}),zt=$s({inputs:{x:R},backend:n,attrs:{shape:We}}),Ft=new OO(he,fe,ft.shape.length,xt.shape.length,Pe,We,!1,!0),jt=n.runWebGLProgram(Ft,[xt,ft,zt],zt.dtype),Re=$s({inputs:{x:jt},backend:n,attrs:{shape:R.shape}});return n.disposeIntermediateTensorInfo(ft),n.disposeIntermediateTensorInfo(xt),n.disposeIntermediateTensorInfo(zt),n.disposeIntermediateTensorInfo(jt),Re}const JSe={kernelName:FU,backendName:"webgl",kernelFunc:KSe};class QSe{constructor(e,n){this.variableNames=["A"];const b=new Array(e.length);for(let re=0;re5)throw Error(`Tile for rank ${e} is not yet supported`);if(e===1)return`imod(resRC, ${u[0]})`;const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],b=[];for(let R=0;R5){const he=n.readSync(R.dataId),be=R.dtype==="string"?he.map(We=>cb(We)):he,Pe=Tc(R.shape,R.dtype,be),je=o_e(Pe,q);return n.makeTensorInfo(je.shape,je.dtype,je.values)}const re=new QSe(R.shape,q);return n.runWebGLProgram(re,[R],R.dtype)}const t5e={kernelName:ok,backendName:"webgl",kernelFunc:XH};class r5e{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode=` + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int elemIdx = coords[1]; + + // We compare elements pair-wise within a group of size 2 * inc. + // The comparing rule for each group alternates between ascending + // and descending. Within each group, we compare each pair at + // positions i and i+inc. To decide whether an element at position i + // is x0 or x1, we mod it by 2 * inc, if the result is smaller than + // inc, it is in the first half of the group, we denote it as x0, + // otherwise we denote it as x1. + // For example, as shown in the Bitonic top K paper referenced above, + // Figure5(a) shows that element[1] is in the + // second half of the group when group size is 2, but it is in the + // first half of the group when group size is 4. + + bool isFirstInPair = imod(elemIdx, 2 * inc) < inc; + int i = isFirstInPair ? elemIdx : elemIdx - inc; + + int i0 = firstPass == 1 ? i : int(getIndices(batch, i)); + int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc)); + float x0 = i0 < n ? getX(batch, i0) : negativeInf; + float x1 = i1 < n ? getX(batch, i1) : negativeInf; + + // Denotes which direction indices are in (ascending or descending). + bool reverse = imod(elemIdx, 2 * dir) >= dir; + bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0); + if (reverse == isGreater) { // Elements in opposite order of direction + int iTemp = i0; + i0 = i1; + i1 = iTemp; + } + if (isFirstInPair) { + setOutput(float(i0)); + } else { + setOutput(float(i1)); + } + } + `}}class n5e{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode=` + void main() { + // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ... + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int elemIdx = coords[1]; + + // The output size is half of the previous size. + // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4), + // we only need to output the indices at positions |, the indices at + // positions _ can be thrown away, see Figure5(b) After Phase 2 + // (Merge phase) in the Bitonic Top K paper referenced above. + // For example, the paper shows we only need to output the orange bars. + // The output sequence should look like this | | | | | | | |. + // Because the sequence is halved, to map the output index back + // to the previous sequence to find the corresponding value, + // we need to double the index. When we double the index, + // we basically interpolate a position, so 2i looks like + // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position + // of each 2k positions by - elemIdx % k. E.g. for output at + // index 4,5,6,7, we want to get the corresponding element at + // original index 8,9,10,11, for output at index 8,9,10,11, + // we want to get the corresponding element at original index + // 16,17,18,19, so on and so forth. + + int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k)); + int i0 = firstPass == 1 ? i : int(getIndices(batch, i)); + int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k)); + + float x0 = getX(batch, i0); + float x1 = i1 < n ? getX(batch, i1) : x0; + + setOutput(x0 >= x1 ? float(i0) : float(i1)); + } + `}}function s2(u,e){e!==null&&u.disposeIntermediateTensorInfo(e)}function cU(u){let e=1;for(;ehe){const Nn=n.readSync(R.dataId),[Kr,Ma]=s_e(Nn,be,R.dtype,q,re);return[n.makeTensorInfo(Kr.shape,Kr.dtype,Kr.values),n.makeTensorInfo(Ma.shape,Ma.dtype,Ma.values)]}if(q===0)return be[be.length-1]=0,[n.makeTensorInfo(be,R.dtype,[]),n.makeTensorInfo(be,"int32",[])];if(Pe===1)return[R,kk({attrs:{shape:be,dtype:"int32",value:0},backend:n})];const je=n.texData.get(R.dataId),We=je!==null&&je.isPacked,ft=We?n.unpackTensor(R):R,zt=xo(be)/Pe,Ft=$s({inputs:{x:ft},attrs:{shape:[zt,Pe]},backend:n});We&&s2(n,ft);const jt=cU(q),Re=cU(Pe);let Lr=null;const Cr=()=>Lr===null?[Ft,Ft]:[Ft,Lr],Gr=(Nn,Kr,Ma)=>{const ui=Cr(),da=new r5e(Ma),aa=[[Pe],[Lr===null?1:0],[Number.NEGATIVE_INFINITY],[Nn],[Kr]],Ka=Lr;Lr=n.runWebGLProgram(da,ui,"int32",aa),s2(n,Ka)};for(let Nn=1;Nn=1;Ma/=2)Gr(Kr,Ma,[zt,Re])}for(let Nn=Re;Nn>jt;Nn/=2){const Kr=Cr(),Ma=new n5e([zt,Nn/2]),da=[[Pe],[Lr===null?1:0],[jt]],Ia=Lr;Lr=n.runWebGLProgram(Ma,Kr,"int32",da),s2(n,Ia);const aa=jt/2,Ka=aa*2;for(let ai=aa;ai>=1;ai/=2)Gr(Ka,ai,Lr.shape)}let yn=Lr;Lr=eS({inputs:{x:Lr},backend:n,attrs:{begin:0,size:[zt,q]}}),s2(n,yn);let Pn=UH({inputs:{x:Ft,indices:Lr},backend:n,attrs:{axis:1,batchDims:1}});s2(n,Ft);const Vn=be.slice(0,-1);Vn.push(q),yn=Lr,Lr=$s({inputs:{x:Lr},attrs:{shape:Vn},backend:n}),s2(n,yn);const un=Pn;return Pn=$s({inputs:{x:Pn},attrs:{shape:Vn},backend:n}),s2(n,un),[Pn,Lr]}const i5e={kernelName:Y8,backendName:"webgl",kernelFunc:a5e};class o5e{constructor(e,n,b,R,q,re){this.variableNames=["Image","Transforms"],this.outputShape=re;const fe=b==="nearest"?1:2;let he;switch(R){case"constant":he=1;break;case"reflect":he=2;break;case"wrap":he=3;break;case"nearest":he=4;break;default:he=1;break}this.userCode=` + float mapCoord(float outCoord, float len) { + float inCoord = outCoord; + if(${he} == 2) { + if (inCoord < 0.0) { + if (len <= 1.0) { + inCoord = 0.0; + } else { + float sz2 = 2.0 * len; + if (inCoord < sz2) { + inCoord = sz2 * float(int(float(-inCoord / sz2))) + + inCoord; + } + inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0; + } + } else if (inCoord > len - 1.0) { + if (len <= 1.0) { + inCoord = 0.0; + } else { + float sz2 = 2.0 * len; + inCoord -= sz2 * float(int(float(inCoord / sz2))); + if (inCoord >= len) { + inCoord = sz2 - inCoord - 1.0; + } + } + } + return clamp(inCoord, 0.0, len - 1.0); + } else if (${he} == 3) { + if (inCoord < 0.0) { + if (len <= 1.0) { + inCoord = 0.0; + } else { + float sz = len - 1.0; + inCoord += len * (float(int(float(-inCoord / sz))) + 1.0); + } + } else if (inCoord > len - 1.0) { + if (len <= 1.0) { + inCoord = 0.0; + } else { + float sz = len - 1.0; + inCoord -= len * float(int(float(inCoord / sz))); + } + } + return clamp(inCoord, 0.0, len - 1.0); + } else if (${he} == 4) { + return clamp(outCoord, 0.0, len - 1.0); + } else { + return outCoord; + } + } + + float readWithFillValue(int batch, int coordY, int coordX, + int channel) { + float outputValue; + if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${n}) { + outputValue = getImage(batch, coordY, coordX, channel); + } else { + outputValue = float(${q}); + } + return outputValue; + } + + void main() { + ivec4 coords = getOutputCoords(); + float outputValue; + int batch = coords[0]; + int x = coords[2]; + int y = coords[1]; + int channel = coords[3]; + float xf = float(x); + float yf = float(y); + float a1 = getTransforms(batch, 0); + float a2 = getTransforms(batch, 1); + float a3 = getTransforms(batch, 2); + float b1 = getTransforms(batch, 3); + float b2 = getTransforms(batch, 4); + float b3 = getTransforms(batch, 5); + float c1 = getTransforms(batch, 6); + float c2 = getTransforms(batch, 7); + float projection = c1 * xf + c2 * yf + 1.0; + if (projection == 0.0) { + outputValue = float(${q}); + } else { + float inX = (a1 * xf + a2 * yf + a3) / projection; + float inY = (b1 * xf + b2 * yf + b3) / projection; + float mapX = mapCoord(inX, float(${n})); + float mapY = mapCoord(inY, float(${e})); + + if (${fe} == 1) { + int coordY = int(round(mapY)); + int coordX = int(round(mapX)); + outputValue = readWithFillValue(batch, coordY, coordX, + channel); + } else { + float yFloor = floor(mapY); + float xFloor = floor(mapX); + float yCeil = yFloor + 1.0; + float xCeil = xFloor + 1.0; + float valueYFloor = (xCeil - mapX) * + readWithFillValue(batch, int(yFloor), int(xFloor), channel) + + (mapX - xFloor) * + readWithFillValue(batch, int(yFloor), int(xCeil), channel); + float valueYCeil = (xCeil - mapX) * + readWithFillValue(batch, int(yCeil), int(xFloor), channel) + + (mapX - xFloor) * + readWithFillValue(batch, int(yCeil), int(xCeil), channel); + outputValue = (yCeil - mapY) * valueYFloor + + (mapY - yFloor) * valueYCeil; + } + } + setOutput(outputValue); + } + `}}function s5e(u){const{inputs:e,backend:n,attrs:b}=u,{image:R,transforms:q}=e,{interpolation:re,fillMode:fe,fillValue:he,outputShape:be}=b,[Pe,je,We,ft]=R.shape,[xt,zt]=be??[je,We],Ft=[Pe,xt,zt,ft],jt=new o5e(je,We,re,fe,he,Ft);return n.runWebGLProgram(jt,[R,q],"float32")}const l5e={kernelName:Z8,backendName:"webgl",kernelFunc:s5e};function u5e(u){const{inputs:e,attrs:n,backend:b}=u,{axis:R}=n,{x:q}=e;Sk(q,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");const re=b.readSync(q.dataId),{outputValues:fe,outputShape:he,indices:be}=l_e(re,R,q.shape,q.dtype);return[b.makeTensorInfo(he,q.dtype,fe),b.makeTensorInfo([be.length],"int32",be)]}const c5e={kernelName:K8,backendName:"webgl",kernelFunc:u5e};function f5e(u){const{inputs:e,backend:n,attrs:b}=u,{value:R}=e;let{axis:q}=b;q<0&&(q+=R.shape.length);const re=R,fe=re.shape.length,he=R.shape[q],be=new Array(fe-1);let Pe=0;for(let zt=0;ztn.disposeIntermediateTensorInfo(zt)),xt}const h5e={kernelName:jR,backendName:"webgl",kernelFunc:f5e};class d5e{constructor(e,n){this.variableNames=["x","segmentIds"];const b=e.windowSize,R=e.batchSize,q=e.inSize,re=e.numSegments,fe=re*Math.ceil(q/b);this.outputShape=[R,fe];const he="0.0",be="sumValue",Pe=Math.floor(b/4)*4,je=b%4,We=` + sumValue += dot(values, segFilter); + `;let ft="";q%b>0&&(ft=` + if (inIdx < 0 || inIdx >= ${q}) { + return initializationValue; + } + `);let xt="";q%b>0&&(xt=` + if (inIdx < 0 || inIdx >= ${q}) { + return -1.0; + } + `),this.userCode=` + const float initializationValue = ${he}; + + float getValue(int batch, int inIdx) { + ${ft} + return getX(batch, inIdx); + } + + float getSegmentIdAtIndex(int inIdx) { + ${xt} + return getSegmentIds(inIdx); + } + + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int outIdx = coords[1]; + int inOffset = int(floor(float(outIdx) / float( + ${re})) * float(${b})); + int currentSeg = int(mod(float(outIdx), float(${re}))); + + float sumValue = 0.0; + + for (int i = 0; i < ${Pe}; i += 4) { + int inIdx = inOffset + i; + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), + getValue(batch, inIdx + 3) + ); + + vec4 segFilter = vec4( + int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0 + ); + + ${We} + } + + int inIdx = inOffset + ${Pe}; + if (${je===1}) { + vec4 values = vec4( + getValue(batch, inIdx), + initializationValue, + initializationValue, + initializationValue + ); + + int inIdxSeg = int(getSegmentIdAtIndex(inIdx)); + + vec4 segFilter = vec4( + int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, + 0, + 0, + 0 + ); + + ${We} + } else if (${je===2}) { + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + initializationValue, + initializationValue + ); + + vec4 segFilter = vec4( + int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, + 0, + 0 + ); + + ${We} + } else if (${je===3}) { + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), + initializationValue + ); + + vec4 segFilter = vec4( + int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0, + 0 + ); + + ${We} + } + setOutput(${be}); + } + `}}function p5e(u){const{inputs:e,backend:n,attrs:b}=u,{x:R,segmentIds:q}=e,{numSegments:re}=b,fe=R.shape.length,he=[];let be=0;const Pe=kd([be],fe);let je=R;Pe!=null&&(je=gm({inputs:{x:R},backend:n,attrs:{perm:Pe}}),he.push(je),be=op(1,fe)[0]);const We=Jse(je.shape,be,re),ft=xo([je.shape[be]]),xt=$s({inputs:{x:je},backend:n,attrs:{shape:[-1,ft]}});he.push(xt);const zt=Q8(R.dtype),Ft=(Cr,Gr,yn,Pn,Vn)=>{const un=Cr.shape[0],Nn=Cr.shape[1],Kr=Kse(Nn,Vn),Ma={windowSize:Kr,inSize:Nn,batchSize:un,numSegments:Vn},ui=new d5e(Ma,Gr),da=n.compileAndRun(ui,[Cr,yn],Pn);if(he.push(da),da.shape[1]===Vn)return da;const Ia=WH({backend:n,attrs:{start:0,stop:Vn,step:1,dtype:"float32"}}),aa=XH({inputs:{x:Ia},backend:n,attrs:{reps:[Nn/Kr]}});return he.push(Ia),he.push(aa),Ft(da,Gr,aa,Pn,Vn)},jt=Ft(xt,"unsortedSegmentSum",q,zt,re),Re=$s({inputs:{x:jt},backend:n,attrs:{shape:We}});let Lr=Re;if(Pe!=null){he.push(Re);const Cr=_b(Pe);Lr=gm({inputs:{x:Lr},backend:n,attrs:{perm:Cr}})}return he.forEach(Cr=>n.disposeIntermediateTensorInfo(Cr)),Lr}const v5e={kernelName:GR,backendName:"webgl",kernelFunc:p5e};const m5e=[Q_e,txe,axe,sxe,uxe,hxe,pxe,mxe,xxe,wxe,Sxe,kxe,Lxe,zxe,Fxe,Uxe,Vxe,Hxe,Xxe,Zxe,ebe,sbe,ube,dbe,vbe,bbe,Tbe,Cbe,N_e,Ibe,zbe,Bbe,qbe,Xbe,Zbe,Jbe,ewe,awe,swe,cwe,hwe,pwe,mwe,_we,bwe,Swe,Cwe,Iwe,Dwe,zwe,Bwe,jwe,Wwe,Zwe,Qwe,e2e,r2e,a2e,o2e,l2e,c2e,p2e,g2e,x2e,w2e,S2e,k2e,R2e,N2e,z_e,F2e,Dbe,$2e,G2e,W2e,F_e,K2e,t3e,n3e,s3e,c3e,p3e,g3e,b3e,S3e,k3e,I3e,P3e,N3e,F3e,V3e,G3e,H3e,X3e,Z3e,eTe,aTe,lTe,mTe,$_e,xTe,TTe,ETe,MTe,gbe,RTe,PTe,NTe,BTe,jTe,U_e,qTe,WTe,YTe,KTe,JTe,ybe,hTe,tAe,iAe,uAe,j_e,dAe,mAe,xAe,TAe,CAe,MAe,RAe,zAe,FAe,$Ae,GAe,WAe,KAe,eSe,aSe,sSe,ibe,pTe,cSe,hSe,pSe,mSe,ySe,xSe,wSe,ASe,ESe,MSe,LSe,DSe,zSe,FSe,USe,VSe,GSe,dTe,Z_e,WSe,ZSe,JSe,t5e,i5e,l5e,K_e,c5e,h5e,v5e,DTe];for(const u of m5e)YU(u);function g5e(u,e,n,b,R,q){let re=1/0,fe=-1/0;for(let be=0;befe&&(fe=Pe)}let he=[];for(let be=0;beq&&(q=he)}let re=[];for(let fe=0;fee==null?null:g5e(u.kernels,e,b,R,q,re),[u.tick,e]),We=$u.useMemo(()=>je==null?null:je.map(fU),[je]),ft=$u.useMemo(()=>y5e(u.output,he,be,Pe),[u.tick]),xt=$u.useMemo(()=>ft.map(fU),[ft]);return Ei.jsxs("div",{className:"layer-viewer",children:[Ei.jsx("h3",{className:"layer-title",children:"Convolution Layer"}),Ei.jsxs("div",{className:"layer-details",children:[Ei.jsxs("div",{children:[Ei.jsx("strong",{children:"Kernel Size:"})," ",b," × ",R]}),Ei.jsxs("div",{children:[Ei.jsx("strong",{children:"Stride:"})," ",u.stride]}),Ei.jsxs("div",{children:[Ei.jsx("strong",{children:"Padding:"})," ",u.padding]}),Ei.jsxs("div",{children:[Ei.jsx("strong",{children:"Activation:"})," ",u.activationType]}),Ei.jsxs("div",{children:[Ei.jsx("strong",{children:"Output channels:"})," ",Pe]})]}),e!=null&&Ei.jsxs(Ei.Fragment,{children:[Ei.jsxs("h4",{children:["Kernel for output ",e," (min-max normalized)"]}),Ei.jsx("div",{className:"layer-grid",children:We.map((zt,Ft)=>Ei.jsx("img",{src:zt,alt:`Kernel ${Ft}`},`${u.layerIdx}-${Ft}-kernel`))})]}),Ei.jsx("h4",{children:"Activation Maps (min-max normalized)"}),Ei.jsx("div",{className:"layer-grid",children:xt.map((zt,Ft)=>Ei.jsx("img",{src:zt,alt:`Activation Map ${Ft}`,onClick:()=>n(e===Ft?null:Ft),style:{border:e===Ft?"4px solid lime":"none"}},`${u.layerIdx}-${Ft}-activation`))})]})}function x5e(u,e,n,b){let R=1/0,q=-1/0;for(let fe=0;feq&&(q=he)}let re=[];for(let fe=0;fex5e(u.output,n,b,R),[u.output]),re=$u.useMemo(()=>q.map(b5e),[q]);return Ei.jsxs("div",{className:"layer-viewer",children:[Ei.jsx("h3",{className:"layer-title",children:"MaxPool Layer"}),Ei.jsxs("div",{className:"layer-details",children:[Ei.jsxs("div",{children:[Ei.jsx("strong",{children:"Pool Size:"})," ",u.size,"x",u.size]}),Ei.jsxs("div",{children:[Ei.jsx("strong",{children:"Stride:"})," ",u.stride]})]}),Ei.jsx("h4",{children:"Outputs (min-max normalized)"}),Ei.jsx("div",{className:"layer-grid",children:re.map((fe,he)=>Ei.jsx("img",{src:fe,alt:`Output ${he}`},`${u.key}-${he}-output`))})]})}function T5e(u,e,n,b){const R=new Uint8ClampedArray(e*n*4);for(let q=0;qEi.jsxs("div",{className:"output-class-probability",children:[Ei.jsxs("strong",{children:["Class ",R,":"]})," ",e[R].toFixed(2)]},R))})]})}function C5e(u){function e(n,b){switch(n.type){case"input":return Ei.jsx(S5e,{output:n.output,shape:n.shape,onSampleIndexChange:u.onSampleIndexChange,tick:u.tick},b);case"conv2d":return Ei.jsx(_5e,{layerIdx:b,stride:n.stride,padding:n.padding,activationType:n.activationType,kernels:n.kernels,output:n.output,kernelShape:n.kernelShape,outputShape:n.outputShape,type:n.type,tick:u.tick},b);case"maxpool":return Ei.jsx(w5e,{stride:n.stride,size:n.size,output:n.output,shape:n.shape,tick:u.tick},b);case"flatten":return;case"dense":return Ei.jsxs("p",{children:["Dense Layer: ",n.details]},b);default:return Ei.jsx("p",{children:"Unknown Layer Type"},b)}}return Ei.jsxs("div",{children:[u.info&&u.info.slice(0,-1).map((n,b)=>e(n,b)),u.info&&u.info.length>0&&Ei.jsx(E5e,{probs:u.info[u.info.length-1]?.output,tick:u.tick})]})}var mz={},gz={},yz={exports:{}},_z,hU;function k5e(){if(hU)return _z;hU=1;var u="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return _z=u,_z}var xz,dU;function M5e(){if(dU)return xz;dU=1;var u=k5e();function e(){}function n(){}return n.resetWarningCache=e,xz=function(){function b(re,fe,he,be,Pe,je){if(je!==u){var We=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw We.name="Invariant Violation",We}}b.isRequired=b;function R(){return b}var q={array:b,bigint:b,bool:b,func:b,number:b,object:b,string:b,symbol:b,any:b,arrayOf:R,element:b,elementType:b,instanceOf:R,node:b,objectOf:R,oneOf:R,oneOfType:R,shape:R,exact:R,checkPropTypes:n,resetWarningCache:e};return q.PropTypes=q,q},xz}var pU;function I5e(){return pU||(pU=1,yz.exports=M5e()()),yz.exports}var vU;function L5e(){return vU||(vU=1,(function(u){function e(Gr){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(yn){return typeof yn}:function(yn){return yn&&typeof Symbol=="function"&&yn.constructor===Symbol&&yn!==Symbol.prototype?"symbol":typeof yn},e(Gr)}Object.defineProperty(u,"__esModule",{value:!0}),u.default=Cr;var n=re(qL()),b=R(I5e());function R(Gr){return Gr&&Gr.__esModule?Gr:{default:Gr}}function q(Gr){if(typeof WeakMap!="function")return null;var yn=new WeakMap,Pn=new WeakMap;return(q=function(un){return un?Pn:yn})(Gr)}function re(Gr,yn){if(Gr&&Gr.__esModule)return Gr;if(Gr===null||e(Gr)!=="object"&&typeof Gr!="function")return{default:Gr};var Pn=q(yn);if(Pn&&Pn.has(Gr))return Pn.get(Gr);var Vn={},un=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Nn in Gr)if(Nn!=="default"&&Object.prototype.hasOwnProperty.call(Gr,Nn)){var Kr=un?Object.getOwnPropertyDescriptor(Gr,Nn):null;Kr&&(Kr.get||Kr.set)?Object.defineProperty(Vn,Nn,Kr):Vn[Nn]=Gr[Nn]}return Vn.default=Gr,Pn&&Pn.set(Gr,Vn),Vn}function fe(Gr,yn){if(!(Gr instanceof yn))throw new TypeError("Cannot call a class as a function")}function he(Gr,yn){for(var Pn=0;Pn"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ft(Gr){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Pn){return Pn.__proto__||Object.getPrototypeOf(Pn)},Ft(Gr)}var jt=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],Re=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],Lr=typeof window<"u";function Cr(Gr){var yn=(function(Pn){Pe(un,Pn);var Vn=We(un);function un(Nn){var Kr;return fe(this,un),Kr=Vn.call(this,Nn),Kr.p=Promise.resolve(),Kr.resizeHandler=null,Kr.handlers={},Kr.syncWindowResize=Kr.syncWindowResize.bind(xt(Kr)),Kr.syncEventHandlers=Kr.syncEventHandlers.bind(xt(Kr)),Kr.attachUpdateEvents=Kr.attachUpdateEvents.bind(xt(Kr)),Kr.getRef=Kr.getRef.bind(xt(Kr)),Kr.handleUpdate=Kr.handleUpdate.bind(xt(Kr)),Kr.figureCallback=Kr.figureCallback.bind(xt(Kr)),Kr.updatePlotly=Kr.updatePlotly.bind(xt(Kr)),Kr}return be(un,[{key:"updatePlotly",value:function(Kr,Ma,ui){var da=this;this.p=this.p.then(function(){if(!da.unmounting){if(!da.el)throw new Error("Missing element reference");return Gr.react(da.el,{data:da.props.data,layout:da.props.layout,config:da.props.config,frames:da.props.frames})}}).then(function(){da.unmounting||(da.syncWindowResize(Kr),da.syncEventHandlers(),da.figureCallback(Ma),ui&&da.attachUpdateEvents())}).catch(function(Ia){da.props.onError&&da.props.onError(Ia)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(Kr){this.unmounting=!1;var Ma=Kr.frames&&Kr.frames.length?Kr.frames.length:0,ui=this.props.frames&&this.props.frames.length?this.props.frames.length:0,da=!(Kr.layout===this.props.layout&&Kr.data===this.props.data&&Kr.config===this.props.config&&ui===Ma),Ia=Kr.revision!==void 0,aa=Kr.revision!==this.props.revision;!da&&(!Ia||Ia&&!aa)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&Lr&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),Gr.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var Kr=this;!this.el||!this.el.removeListener||Re.forEach(function(Ma){Kr.el.on(Ma,Kr.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var Kr=this;!this.el||!this.el.removeListener||Re.forEach(function(Ma){Kr.el.removeListener(Ma,Kr.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(Kr){if(typeof Kr=="function"){var Ma=this.el,ui=Ma.data,da=Ma.layout,Ia=this.el._transitionData?this.el._transitionData._frames:null,aa={data:ui,layout:da,frames:Ia};Kr(aa,this.el)}}},{key:"syncWindowResize",value:function(Kr){var Ma=this;Lr&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return Gr.Plots.resize(Ma.el)},window.addEventListener("resize",this.resizeHandler),Kr&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(Kr){this.el=Kr,this.props.debug&&Lr&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var Kr=this;jt.forEach(function(Ma){var ui=Kr.props["on"+Ma],da=Kr.handlers[Ma],Ia=!!da;ui&&!Ia?Kr.addEventHandler(Ma,ui):!ui&&Ia?Kr.removeEventHandler(Ma):ui&&Ia&&ui!==da&&(Kr.removeEventHandler(Ma),Kr.addEventHandler(Ma,ui))})}},{key:"addEventHandler",value:function(Kr,Ma){this.handlers[Kr]=Ma,this.el.on(this.getPlotlyEventName(Kr),this.handlers[Kr])}},{key:"removeEventHandler",value:function(Kr){this.el.removeListener(this.getPlotlyEventName(Kr),this.handlers[Kr]),delete this.handlers[Kr]}},{key:"getPlotlyEventName",value:function(Kr){return"plotly_"+Kr.toLowerCase()}},{key:"render",value:function(){return n.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),un})(n.Component);return yn.propTypes={data:b.default.arrayOf(b.default.object),config:b.default.object,layout:b.default.object,frames:b.default.arrayOf(b.default.object),revision:b.default.number,onInitialized:b.default.func,onPurge:b.default.func,onError:b.default.func,onUpdate:b.default.func,debug:b.default.bool,style:b.default.object,className:b.default.string,useResizeHandler:b.default.bool,divId:b.default.string},jt.forEach(function(Pn){yn.propTypes["on"+Pn]=b.default.func}),yn.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},yn}})(gz)),gz}var vL={exports:{}},R5e=vL.exports,mU;function D5e(){return mU||(mU=1,(function(u){var e={};(function(n,b){u.exports?u.exports=b():n.moduleName=b()})(typeof self<"u"?self:R5e,()=>{var n=(()=>{var b=Object.create,R=Object.defineProperty,q=Object.defineProperties,re=Object.getOwnPropertyDescriptor,fe=Object.getOwnPropertyDescriptors,he=Object.getOwnPropertyNames,be=Object.getOwnPropertySymbols,Pe=Object.getPrototypeOf,je=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,ft=(ae,K,v)=>K in ae?R(ae,K,{enumerable:!0,configurable:!0,writable:!0,value:v}):ae[K]=v,xt=(ae,K)=>{for(var v in K||(K={}))je.call(K,v)&&ft(ae,v,K[v]);if(be)for(var v of be(K))We.call(K,v)&&ft(ae,v,K[v]);return ae},zt=(ae,K)=>q(ae,fe(K)),Ft=(ae,K)=>{var v={};for(var S in ae)je.call(ae,S)&&K.indexOf(S)<0&&(v[S]=ae[S]);if(ae!=null&&be)for(var S of be(ae))K.indexOf(S)<0&&We.call(ae,S)&&(v[S]=ae[S]);return v},jt=(ae,K)=>function(){return ae&&(K=(0,ae[he(ae)[0]])(ae=0)),K},Re=(ae,K)=>function(){return K||(0,ae[he(ae)[0]])((K={exports:{}}).exports,K),K.exports},Lr=(ae,K)=>{for(var v in K)R(ae,v,{get:K[v],enumerable:!0})},Cr=(ae,K,v,S)=>{if(K&&typeof K=="object"||typeof K=="function")for(let M of he(K))!je.call(ae,M)&&M!==v&&R(ae,M,{get:()=>K[M],enumerable:!(S=re(K,M))||S.enumerable});return ae},Gr=(ae,K,v)=>(v=ae!=null?b(Pe(ae)):{},Cr(R(v,"default",{value:ae,enumerable:!0}),ae)),yn=ae=>Cr(R({},"__esModule",{value:!0}),ae),Pn=Re({"src/version.js"(ae){ae.version="3.3.1"}}),Vn=Re({"node_modules/native-promise-only/lib/npo.src.js"(ae,K){(function(S,M,L){M[S]=M[S]||L(),typeof K<"u"&&K.exports&&(K.exports=M[S])})("Promise",typeof window<"u"?window:ae,function(){var S,M,L,t=Object.prototype.toString,r=typeof setImmediate<"u"?function(x){return setImmediate(x)}:setTimeout;try{Object.defineProperty({},"x",{}),S=function(x,A,k,I){return Object.defineProperty(x,A,{value:k,writable:!0,configurable:I!==!1})}}catch{S=function(A,k,I){return A[k]=I,A}}L=(function(){var x,A,k;function I(T,E){this.fn=T,this.self=E,this.next=void 0}return{add:function(E,_){k=new I(E,_),A?A.next=k:x=k,A=k,k=void 0},drain:function(){var E=x;for(x=A=M=void 0;E;)E.fn.call(E.self),E=E.next}}})();function a(f,x){L.add(f,x),M||(M=r(L.drain))}function l(f){var x,A=typeof f;return f!=null&&(A=="object"||A=="function")&&(x=f.then),typeof x=="function"?x:!1}function i(){for(var f=0;f0&&a(i,A))}catch(k){c.call(new d(A),k)}}}function c(f){var x=this;x.triggered||(x.triggered=!0,x.def&&(x=x.def),x.msg=f,x.state=2,x.chain.length>0&&a(i,x))}function p(f,x,A,k){for(var I=0;IYe?1:Ce>=Ye?0:NaN}v.descending=function(Ce,Ye){return YeCe?1:Ye>=Ce?0:NaN},v.min=function(Ce,Ye){var pt=-1,Dt=Ce.length,Ot,Wt;if(arguments.length===1){for(;++pt=Wt){Ot=Wt;break}for(;++ptWt&&(Ot=Wt)}else{for(;++pt=Wt){Ot=Wt;break}for(;++ptWt&&(Ot=Wt)}return Ot},v.max=function(Ce,Ye){var pt=-1,Dt=Ce.length,Ot,Wt;if(arguments.length===1){for(;++pt=Wt){Ot=Wt;break}for(;++ptOt&&(Ot=Wt)}else{for(;++pt=Wt){Ot=Wt;break}for(;++ptOt&&(Ot=Wt)}return Ot},v.extent=function(Ce,Ye){var pt=-1,Dt=Ce.length,Ot,Wt,dr;if(arguments.length===1){for(;++pt=Wt){Ot=dr=Wt;break}for(;++ptWt&&(Ot=Wt),dr=Wt){Ot=dr=Wt;break}for(;++ptWt&&(Ot=Wt),dr1)return dr/(Rr-1)},v.deviation=function(){var Ce=v.variance.apply(this,arguments);return Ce&&Math.sqrt(Ce)};function y(Ce){return{left:function(Ye,pt,Dt,Ot){for(arguments.length<3&&(Dt=0),arguments.length<4&&(Ot=Ye.length);Dt>>1;Ce(Ye[Wt],pt)<0?Dt=Wt+1:Ot=Wt}return Dt},right:function(Ye,pt,Dt,Ot){for(arguments.length<3&&(Dt=0),arguments.length<4&&(Ot=Ye.length);Dt>>1;Ce(Ye[Wt],pt)>0?Ot=Wt:Dt=Wt+1}return Dt}}}var g=y(c);v.bisectLeft=g.left,v.bisect=v.bisectRight=g.right,v.bisector=function(Ce){return y(Ce.length===1?function(Ye,pt){return c(Ce(Ye),pt)}:Ce)},v.shuffle=function(Ce,Ye,pt){(Dt=arguments.length)<3&&(pt=Ce.length,Dt<2&&(Ye=0));for(var Dt=pt-Ye,Ot,Wt;Dt;)Wt=Math.random()*Dt--|0,Ot=Ce[Dt+Ye],Ce[Dt+Ye]=Ce[Wt+Ye],Ce[Wt+Ye]=Ot;return Ce},v.permute=function(Ce,Ye){for(var pt=Ye.length,Dt=new Array(pt);pt--;)Dt[pt]=Ce[Ye[pt]];return Dt},v.pairs=function(Ce){for(var Ye=0,pt=Ce.length-1,Dt=Ce[0],Ot=new Array(pt<0?0:pt);Ye=0;)for(dr=Ce[Ye],pt=dr.length;--pt>=0;)Wt[--Ot]=dr[pt];return Wt};var f=Math.abs;v.range=function(Ce,Ye,pt){if(arguments.length<3&&(pt=1,arguments.length<2&&(Ye=Ce,Ce=0)),(Ye-Ce)/pt===1/0)throw new Error("infinite range");var Dt=[],Ot=x(f(pt)),Wt=-1,dr;if(Ce*=Ot,Ye*=Ot,pt*=Ot,pt<0)for(;(dr=Ce+pt*++Wt)>Ye;)Dt.push(dr/Ot);else for(;(dr=Ce+pt*++Wt)=Ye.length)return Ot?Ot.call(Ce,Rr):Dt?Rr.sort(Dt):Rr;for(var on=-1,En=Rr.length,Un=Ye[ln++],Gn,Xa,Kn,ma=new k,Aa;++on=Ye.length)return hr;var ln=[],on=pt[Rr++];return hr.forEach(function(En,Un){ln.push({key:En,values:dr(Un,Rr)})}),on?ln.sort(function(En,Un){return on(En.key,Un.key)}):ln}return Ce.map=function(hr,Rr){return Wt(Rr,hr,0)},Ce.entries=function(hr){return dr(Wt(v.map,hr,0),0)},Ce.key=function(hr){return Ye.push(hr),Ce},Ce.sortKeys=function(hr){return pt[Ye.length-1]=hr,Ce},Ce.sortValues=function(hr){return Dt=hr,Ce},Ce.rollup=function(hr){return Ot=hr,Ce},Ce},v.set=function(Ce){var Ye=new U;if(Ce)for(var pt=0,Dt=Ce.length;pt=0&&(Dt=Ce.slice(pt+1),Ce=Ce.slice(0,pt)),Ce)return arguments.length<2?this[Ce].on(Dt):this[Ce].on(Dt,Ye);if(arguments.length===2){if(Ye==null)for(Ce in this)this.hasOwnProperty(Ce)&&this[Ce].on(Dt,null);return this}};function ee(Ce){var Ye=[],pt=new k;function Dt(){for(var Ot=Ye,Wt=-1,dr=Ot.length,hr;++Wt=0&&(pt=Ce.slice(0,Ye))!=="xmlns"&&(Ce=Ce.slice(Ye+1)),Te.hasOwnProperty(pt)?{space:Te[pt],local:Ce}:Ce}},le.attr=function(Ce,Ye){if(arguments.length<2){if(typeof Ce=="string"){var pt=this.node();return Ce=v.ns.qualify(Ce),Ce.local?pt.getAttributeNS(Ce.space,Ce.local):pt.getAttribute(Ce)}for(Ye in Ce)this.each(Ne(Ye,Ce[Ye]));return this}return this.each(Ne(Ce,Ye))};function Ne(Ce,Ye){Ce=v.ns.qualify(Ce);function pt(){this.removeAttribute(Ce)}function Dt(){this.removeAttributeNS(Ce.space,Ce.local)}function Ot(){this.setAttribute(Ce,Ye)}function Wt(){this.setAttributeNS(Ce.space,Ce.local,Ye)}function dr(){var Rr=Ye.apply(this,arguments);Rr==null?this.removeAttribute(Ce):this.setAttribute(Ce,Rr)}function hr(){var Rr=Ye.apply(this,arguments);Rr==null?this.removeAttributeNS(Ce.space,Ce.local):this.setAttributeNS(Ce.space,Ce.local,Rr)}return Ye==null?Ce.local?Dt:pt:typeof Ye=="function"?Ce.local?hr:dr:Ce.local?Wt:Ot}function $e(Ce){return Ce.trim().replace(/\s+/g," ")}le.classed=function(Ce,Ye){if(arguments.length<2){if(typeof Ce=="string"){var pt=this.node(),Dt=(Ce=Xe(Ce)).length,Ot=-1;if(Ye=pt.classList){for(;++Ot=0;)(Wt=pt[Dt])&&(Ot&&Ot!==Wt.nextSibling&&Ot.parentNode.insertBefore(Wt,Ot),Ot=Wt);return this},le.sort=function(Ce){Ce=Je.apply(this,arguments);for(var Ye=-1,pt=this.length;++Ye=Ye&&(Ye=Ot+1);!(Rr=dr[Ye])&&++Ye0&&(Ce=Ce.slice(0,Ot));var dr=fr.get(Ce);dr&&(Ce=dr,Wt=Ur);function hr(){var on=this[Dt];on&&(this.removeEventListener(Ce,on,on.$),delete this[Dt])}function Rr(){var on=Wt(Ye,M(arguments));hr.call(this),this.addEventListener(Ce,this[Dt]=on,on.$=pt),on._=Ye}function ln(){var on=new RegExp("^__on([^.]+)"+v.requote(Ce)+"$"),En;for(var Un in this)if(En=Un.match(on)){var Gn=this[Un];this.removeEventListener(En[1],Gn,Gn.$),delete this[Un]}}return Ot?Ye?Rr:hr:Ye?H:ln}var fr=v.map({mouseenter:"mouseover",mouseleave:"mouseout"});L&&fr.forEach(function(Ce){"on"+Ce in L&&fr.remove(Ce)});function mr(Ce,Ye){return function(pt){var Dt=v.event;v.event=pt,Ye[0]=this.__data__;try{Ce.apply(this,Ye)}finally{v.event=Dt}}}function Ur(Ce,Ye){var pt=mr(Ce,Ye);return function(Dt){var Ot=this,Wt=Dt.relatedTarget;(!Wt||Wt!==Ot&&!(Wt.compareDocumentPosition(Ot)&8))&&pt.call(Ot,Dt)}}var Br,fn=0;function Fr(Ce){var Ye=".dragsuppress-"+ ++fn,pt="click"+Ye,Dt=v.select(r(Ce)).on("touchmove"+Ye,ue).on("dragstart"+Ye,ue).on("selectstart"+Ye,ue);if(Br==null&&(Br="onselectstart"in Ce?!1:j(Ce.style,"userSelect")),Br){var Ot=t(Ce).style,Wt=Ot[Br];Ot[Br]="none"}return function(dr){if(Dt.on(Ye,null),Br&&(Ot[Br]=Wt),dr){var hr=function(){Dt.on(pt,null)};Dt.on(pt,function(){ue(),hr()},!0),setTimeout(hr,0)}}}v.mouse=function(Ce){return Bt(Ce,xe())};var Qr=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Bt(Ce,Ye){Ye.changedTouches&&(Ye=Ye.changedTouches[0]);var pt=Ce.ownerSVGElement||Ce;if(pt.createSVGPoint){var Dt=pt.createSVGPoint();if(Qr<0){var Ot=r(Ce);if(Ot.scrollX||Ot.scrollY){pt=v.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var Wt=pt[0][0].getScreenCTM();Qr=!(Wt.f||Wt.e),pt.remove()}}return Qr?(Dt.x=Ye.pageX,Dt.y=Ye.pageY):(Dt.x=Ye.clientX,Dt.y=Ye.clientY),Dt=Dt.matrixTransform(Ce.getScreenCTM().inverse()),[Dt.x,Dt.y]}var dr=Ce.getBoundingClientRect();return[Ye.clientX-dr.left-Ce.clientLeft,Ye.clientY-dr.top-Ce.clientTop]}v.touch=function(Ce,Ye,pt){if(arguments.length<3&&(pt=Ye,Ye=xe().changedTouches),Ye){for(var Dt=0,Ot=Ye.length,Wt;Dt1?at:Ce<-1?-at:Math.asin(Ce)}function ur(Ce){return((Ce=Math.exp(Ce))-1/Ce)/2}function Dr(Ce){return((Ce=Math.exp(Ce))+1/Ce)/2}function kr(Ce){return((Ce=Math.exp(2*Ce))-1)/(Ce+1)}var Sr=Math.SQRT2,Jr=2,jn=4;v.interpolateZoom=function(Ce,Ye){var pt=Ce[0],Dt=Ce[1],Ot=Ce[2],Wt=Ye[0],dr=Ye[1],hr=Ye[2],Rr=Wt-pt,ln=dr-Dt,on=Rr*Rr+ln*ln,En,Un;if(on0&&(zo=zo.transition().duration(dr)),zo.call(Za.event)}function jo(){ma&&ma.domain(Kn.range().map(function(zo){return(zo-Ce.x)/Ce.k}).map(Kn.invert)),Va&&Va.domain(Aa.range().map(function(zo){return(zo-Ce.y)/Ce.k}).map(Aa.invert))}function Yo(zo){hr++||zo({type:"zoomstart"})}function pl(zo){jo(),zo({type:"zoom",scale:Ce.k,translate:[Ce.x,Ce.y]})}function Qo(zo){--hr||(zo({type:"zoomend"}),pt=null)}function Cs(){var zo=this,Ks=Xa.of(zo,arguments),_l=0,yu=v.select(r(zo)).on(ln,Yl).on(on,_u),au=Ta(v.mouse(zo)),Kc=Fr(zo);Ua.call(zo),Yo(Ks);function Yl(){_l=1,so(v.mouse(zo),au),pl(Ks)}function _u(){yu.on(ln,null).on(on,null),Kc(_l),Qo(Ks)}}function Tl(){var zo=this,Ks=Xa.of(zo,arguments),_l={},yu=0,au,Kc=".zoom-"+v.event.changedTouches[0].identifier,Yl="touchmove"+Kc,_u="touchend"+Kc,kf=[],Ju=v.select(zo),Ct=Fr(zo);zr(),Yo(Ks),Ju.on(Rr,null).on(Un,zr);function Ir(){var Ln=v.touches(zo);return au=Ce.k,Ln.forEach(function(Mn){Mn.identifier in _l&&(_l[Mn.identifier]=Ta(Mn))}),Ln}function zr(){var Ln=v.event.target;v.select(Ln).on(Yl,qn).on(_u,Ca),kf.push(Ln);for(var Mn=v.event.changedTouches,ei=0,Ja=Mn.length;ei1){var fo=Qa[0],Hi=Qa[1],hi=fo[0]-Hi[0],za=fo[1]-Hi[1];yu=hi*hi+za*za}}function qn(){var Ln=v.touches(zo),Mn,ei,Ja,Qa;Ua.call(zo);for(var mi=0,fo=Ln.length;mi1?1:Ye,pt=pt<0?0:pt>1?1:pt,Ot=pt<=.5?pt*(1+Ye):pt+Ye-pt*Ye,Dt=2*pt-Ot;function Wt(hr){return hr>360?hr-=360:hr<0&&(hr+=360),hr<60?Dt+(Ot-Dt)*hr/60:hr<180?Ot:hr<240?Dt+(Ot-Dt)*(240-hr)/60:Dt}function dr(hr){return Math.round(Wt(hr)*255)}return new ji(dr(Ce+120),dr(Ce),dr(Ce-120))}v.hcl=_r;function _r(Ce,Ye,pt){return this instanceof _r?(this.h=+Ce,this.c=+Ye,void(this.l=+pt)):arguments.length<2?Ce instanceof _r?new _r(Ce.h,Ce.c,Ce.l):Ce instanceof br?La(Ce.l,Ce.a,Ce.b):La((Ce=Wr((Ce=v.rgb(Ce)).r,Ce.g,Ce.b)).l,Ce.a,Ce.b):new _r(Ce,Ye,pt)}var rr=_r.prototype=new xa;rr.brighter=function(Ce){return new _r(this.h,this.c,Math.min(100,this.l+an*(arguments.length?Ce:1)))},rr.darker=function(Ce){return new _r(this.h,this.c,Math.max(0,this.l-an*(arguments.length?Ce:1)))},rr.rgb=function(){return yr(this.h,this.c,this.l).rgb()};function yr(Ce,Ye,pt){return isNaN(Ce)&&(Ce=0),isNaN(Ye)&&(Ye=0),new br(pt,Math.cos(Ce*=ct)*Ye,Math.sin(Ce)*Ye)}v.lab=br;function br(Ce,Ye,pt){return this instanceof br?(this.l=+Ce,this.a=+Ye,void(this.b=+pt)):arguments.length<2?Ce instanceof br?new br(Ce.l,Ce.a,Ce.b):Ce instanceof _r?yr(Ce.h,Ce.c,Ce.l):Wr((Ce=ji(Ce)).r,Ce.g,Ce.b):new br(Ce,Ye,pt)}var an=18,bn=.95047,In=1,Fn=1.08883,va=br.prototype=new xa;va.brighter=function(Ce){return new br(Math.min(100,this.l+an*(arguments.length?Ce:1)),this.a,this.b)},va.darker=function(Ce){return new br(Math.max(0,this.l-an*(arguments.length?Ce:1)),this.a,this.b)},va.rgb=function(){return Pa(this.l,this.a,this.b)};function Pa(Ce,Ye,pt){var Dt=(Ce+16)/116,Ot=Dt+Ye/500,Wt=Dt-pt/200;return Ot=Oa(Ot)*bn,Dt=Oa(Dt)*In,Wt=Oa(Wt)*Fn,new ji(sa(3.2404542*Ot-1.5371385*Dt-.4985314*Wt),sa(-.969266*Ot+1.8760108*Dt+.041556*Wt),sa(.0556434*Ot-.2040259*Dt+1.0572252*Wt))}function La(Ce,Ye,pt){return Ce>0?new _r(Math.atan2(pt,Ye)*Gt,Math.sqrt(Ye*Ye+pt*pt),Ce):new _r(NaN,NaN,Ce)}function Oa(Ce){return Ce>.206893034?Ce*Ce*Ce:(Ce-4/29)/7.787037}function Wa(Ce){return Ce>.008856?Math.pow(Ce,1/3):7.787037*Ce+4/29}function sa(Ce){return Math.round(255*(Ce<=.00304?12.92*Ce:1.055*Math.pow(Ce,1/2.4)-.055))}v.rgb=ji;function ji(Ce,Ye,pt){return this instanceof ji?(this.r=~~Ce,this.g=~~Ye,void(this.b=~~pt)):arguments.length<2?Ce instanceof ji?new ji(Ce.r,Ce.g,Ce.b):en(""+Ce,ji,ci):new ji(Ce,Ye,pt)}function Qi(Ce){return new ji(Ce>>16,Ce>>8&255,Ce&255)}function Xt(Ce){return Qi(Ce)+""}var Lt=ji.prototype=new xa;Lt.brighter=function(Ce){Ce=Math.pow(.7,arguments.length?Ce:1);var Ye=this.r,pt=this.g,Dt=this.b,Ot=30;return!Ye&&!pt&&!Dt?new ji(Ot,Ot,Ot):(Ye&&Ye>4,Dt=Dt>>4|Dt,Ot=Rr&240,Ot=Ot>>4|Ot,Wt=Rr&15,Wt=Wt<<4|Wt):Ce.length===7&&(Dt=(Rr&16711680)>>16,Ot=(Rr&65280)>>8,Wt=Rr&255)),Ye(Dt,Ot,Wt))}function rn(Ce,Ye,pt){var Dt=Math.min(Ce/=255,Ye/=255,pt/=255),Ot=Math.max(Ce,Ye,pt),Wt=Ot-Dt,dr,hr,Rr=(Ot+Dt)/2;return Wt?(hr=Rr<.5?Wt/(Ot+Dt):Wt/(2-Ot-Dt),Ce==Ot?dr=(Ye-pt)/Wt+(Ye0&&Rr<1?0:dr),new ra(dr,hr,Rr)}function Wr(Ce,Ye,pt){Ce=tn(Ce),Ye=tn(Ye),pt=tn(pt);var Dt=Wa((.4124564*Ce+.3575761*Ye+.1804375*pt)/bn),Ot=Wa((.2126729*Ce+.7151522*Ye+.072175*pt)/In),Wt=Wa((.0193339*Ce+.119192*Ye+.9503041*pt)/Fn);return br(116*Ot-16,500*(Dt-Ot),200*(Ot-Wt))}function tn(Ce){return(Ce/=255)<=.04045?Ce/12.92:Math.pow((Ce+.055)/1.055,2.4)}function wn(Ce){var Ye=parseFloat(Ce);return Ce.charAt(Ce.length-1)==="%"?Math.round(Ye*2.55):Ye}var dn=v.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});dn.forEach(function(Ce,Ye){dn.set(Ce,Qi(Ye))});function Nt(Ce){return typeof Ce=="function"?Ce:function(){return Ce}}v.functor=Nt,v.xhr=xr(V);function xr(Ce){return function(Ye,pt,Dt){return arguments.length===2&&typeof pt=="function"&&(Dt=pt,pt=null),Xr(Ye,pt,Ce,Dt)}}function Xr(Ce,Ye,pt,Dt){var Ot={},Wt=v.dispatch("beforesend","progress","load","error"),dr={},hr=new XMLHttpRequest,Rr=null;self.XDomainRequest&&!("withCredentials"in hr)&&/^(http(s)?:)?\/\//.test(Ce)&&(hr=new XDomainRequest),"onload"in hr?hr.onload=hr.onerror=ln:hr.onreadystatechange=function(){hr.readyState>3&&ln()};function ln(){var on=hr.status,En;if(!on&&Xn(hr)||on>=200&&on<300||on===304){try{En=pt.call(Ot,hr)}catch(Un){Wt.error.call(Ot,Un);return}Wt.load.call(Ot,En)}else Wt.error.call(Ot,hr)}return hr.onprogress=function(on){var En=v.event;v.event=on;try{Wt.progress.call(Ot,hr)}finally{v.event=En}},Ot.header=function(on,En){return on=(on+"").toLowerCase(),arguments.length<2?dr[on]:(En==null?delete dr[on]:dr[on]=En+"",Ot)},Ot.mimeType=function(on){return arguments.length?(Ye=on==null?null:on+"",Ot):Ye},Ot.responseType=function(on){return arguments.length?(Rr=on,Ot):Rr},Ot.response=function(on){return pt=on,Ot},["get","post"].forEach(function(on){Ot[on]=function(){return Ot.send.apply(Ot,[on].concat(M(arguments)))}}),Ot.send=function(on,En,Un){if(arguments.length===2&&typeof En=="function"&&(Un=En,En=null),hr.open(on,Ce,!0),Ye!=null&&!("accept"in dr)&&(dr.accept=Ye+",*/*"),hr.setRequestHeader)for(var Gn in dr)hr.setRequestHeader(Gn,dr[Gn]);return Ye!=null&&hr.overrideMimeType&&hr.overrideMimeType(Ye),Rr!=null&&(hr.responseType=Rr),Un!=null&&Ot.on("error",Un).on("load",function(Xa){Un(null,Xa)}),Wt.beforesend.call(Ot,hr),hr.send(En??null),Ot},Ot.abort=function(){return hr.abort(),Ot},v.rebind(Ot,Wt,"on"),Dt==null?Ot:Ot.get(Tn(Dt))}function Tn(Ce){return Ce.length===1?function(Ye,pt){Ce(Ye==null?pt:null)}:Ce}function Xn(Ce){var Ye=Ce.responseType;return Ye&&Ye!=="text"?Ce.response:Ce.responseText}v.dsv=function(Ce,Ye){var pt=new RegExp('["'+Ce+` +]`),Dt=Ce.charCodeAt(0);function Ot(ln,on,En){arguments.length<3&&(En=on,on=null);var Un=Xr(ln,Ye,on==null?Wt:dr(on),En);return Un.row=function(Gn){return arguments.length?Un.response((on=Gn)==null?Wt:dr(Gn)):on},Un}function Wt(ln){return Ot.parse(ln.responseText)}function dr(ln){return function(on){return Ot.parse(on.responseText,ln)}}Ot.parse=function(ln,on){var En;return Ot.parseRows(ln,function(Un,Gn){if(En)return En(Un,Gn-1);var Xa=function(Kn){for(var ma={},Aa=Un.length,Va=0;Va=Xa)return Un;if(Va)return Va=!1,En;var Ii=Kn;if(ln.charCodeAt(Ii)===34){for(var wo=Ii;wo++24?(isFinite(Ye)&&(clearTimeout(Yn),Yn=setTimeout(to,Ye)),An=0):(An=1,qi(to))}v.timer.flush=function(){_o(),Po()};function _o(){for(var Ce=Date.now(),Ye=ia;Ye;)Ce>=Ye.t&&Ye.c(Ce-Ye.t)&&(Ye.c=null),Ye=Ye.n;return Ce}function Po(){for(var Ce,Ye=ia,pt=1/0;Ye;)Ye.c?(Ye.t=0;--hr)Kn.push(Ot[ln[En[hr]][2]]);for(hr=+Gn;hr1&&Vt(Ce[pt[Dt-2]],Ce[pt[Dt-1]],Ce[Ot])<=0;)--Dt;pt[Dt++]=Ot}return pt.slice(0,Dt)}function bs(Ce,Ye){return Ce[0]-Ye[0]||Ce[1]-Ye[1]}v.geom.polygon=function(Ce){return Y(Ce,cs),Ce};var cs=v.geom.polygon.prototype=[];cs.area=function(){for(var Ce=-1,Ye=this.length,pt,Dt=this[Ye-1],Ot=0;++Ceut)hr=hr.L;else if(dr=Ye-Mo(hr,pt),dr>ut){if(!hr.R){Dt=hr;break}hr=hr.R}else{Wt>-ut?(Dt=hr.P,Ot=hr):dr>-ut?(Dt=hr,Ot=hr.N):Dt=Ot=hr;break}var Rr=Ll(Ce);if(ll.insert(Dt,Rr),!(!Dt&&!Ot)){if(Dt===Ot){Rl(Dt),Ot=Ll(Dt.site),ll.insert(Rr,Ot),Rr.edge=Ot.edge=pu(Dt.site,Rr.site),dl(Dt),dl(Ot);return}if(!Ot){Rr.edge=pu(Dt.site,Rr.site);return}Rl(Dt),Rl(Ot);var ln=Dt.site,on=ln.x,En=ln.y,Un=Ce.x-on,Gn=Ce.y-En,Xa=Ot.site,Kn=Xa.x-on,ma=Xa.y-En,Aa=2*(Un*ma-Gn*Kn),Va=Un*Un+Gn*Gn,Za=Kn*Kn+ma*ma,Ta={x:(ma*Va-Gn*Za)/Aa+on,y:(Un*Za-Kn*Va)/Aa+En};ts(Ot.edge,ln,Xa,Ta),Rr.edge=pu(ln,Ce,null,Ta),Ot.edge=pu(Ce,Xa,null,Ta),dl(Dt),dl(Ot)}}function Bi(Ce,Ye){var pt=Ce.site,Dt=pt.x,Ot=pt.y,Wt=Ot-Ye;if(!Wt)return Dt;var dr=Ce.P;if(!dr)return-1/0;pt=dr.site;var hr=pt.x,Rr=pt.y,ln=Rr-Ye;if(!ln)return hr;var on=hr-Dt,En=1/Wt-1/ln,Un=on/ln;return En?(-Un+Math.sqrt(Un*Un-2*En*(on*on/(-2*ln)-Rr+ln/2+Ot-Wt/2)))/En+Dt:(Dt+hr)/2}function Mo(Ce,Ye){var pt=Ce.N;if(pt)return Bi(pt,Ye);var Dt=Ce.site;return Dt.y===Ye?Dt.x:1/0}function Jl(Ce){this.site=Ce,this.edges=[]}Jl.prototype.prepare=function(){for(var Ce=this.edges,Ye=Ce.length,pt;Ye--;)pt=Ce[Ye].edge,(!pt.b||!pt.a)&&Ce.splice(Ye,1);return Ce.sort(as),Ce.length};function Qs(Ce){for(var Ye=Ce[0][0],pt=Ce[1][0],Dt=Ce[0][1],Ot=Ce[1][1],Wt,dr,hr,Rr,ln=hl,on=ln.length,En,Un,Gn,Xa,Kn,ma;on--;)if(En=ln[on],!(!En||!En.prepare()))for(Gn=En.edges,Xa=Gn.length,Un=0;Unut||f(Rr-dr)>ut)&&(Gn.splice(Un,0,new Iu(vu(En.site,ma,f(hr-Ye)ut?{x:Ye,y:f(Wt-Ye)ut?{x:f(dr-Ot)ut?{x:pt,y:f(Wt-pt)ut?{x:f(dr-Dt)=-Be)){var Un=Rr*Rr+ln*ln,Gn=on*on+ma*ma,Xa=(ma*Un-ln*Gn)/En,Kn=(Rr*Gn-on*Un)/En,ma=Kn+hr,Aa=Uo.pop()||new tu;Aa.arc=Ce,Aa.site=Ot,Aa.x=Xa+dr,Aa.y=ma+Math.sqrt(Xa*Xa+Kn*Kn),Aa.cy=ma,Ce.circle=Aa;for(var Va=null,Za=ps._;Za;)if(Aa.y0)){if(Kn/=Gn,Gn<0){if(Kn0){if(Kn>Un)return;Kn>En&&(En=Kn)}if(Kn=pt-hr,!(!Gn&&Kn<0)){if(Kn/=Gn,Gn<0){if(Kn>Un)return;Kn>En&&(En=Kn)}else if(Gn>0){if(Kn0)){if(Kn/=Xa,Xa<0){if(Kn0){if(Kn>Un)return;Kn>En&&(En=Kn)}if(Kn=Dt-Rr,!(!Xa&&Kn<0)){if(Kn/=Xa,Xa<0){if(Kn>Un)return;Kn>En&&(En=Kn)}else if(Xa>0){if(Kn0&&(Ot.a={x:hr+En*Gn,y:Rr+En*Xa}),Un<1&&(Ot.b={x:hr+Un*Gn,y:Rr+Un*Xa}),Ot}}}}}}function Eo(Ce){for(var Ye=ss,pt=Gu(Ce[0][0],Ce[0][1],Ce[1][0],Ce[1][1]),Dt=Ye.length,Ot;Dt--;)Ot=Ye[Dt],(!Os(Ot,Ce)||!pt(Ot)||f(Ot.a.x-Ot.b.x)=Wt)return;if(on>Un){if(!Dt)Dt={x:Xa,y:dr};else if(Dt.y>=hr)return;pt={x:Xa,y:hr}}else{if(!Dt)Dt={x:Xa,y:hr};else if(Dt.y1)if(on>Un){if(!Dt)Dt={x:(dr-Aa)/ma,y:dr};else if(Dt.y>=hr)return;pt={x:(hr-Aa)/ma,y:hr}}else{if(!Dt)Dt={x:(hr-Aa)/ma,y:hr};else if(Dt.y=Wt)return;pt={x:Wt,y:ma*Wt+Aa}}else{if(!Dt)Dt={x:Wt,y:ma*Wt+Aa};else if(Dt.x=on&&Aa.x<=Un&&Aa.y>=En&&Aa.y<=Gn?[[on,Gn],[Un,Gn],[Un,En],[on,En]]:[];Va.point=Rr[Kn]}),ln}function hr(Rr){return Rr.map(function(ln,on){return{x:Math.round(Dt(ln,on)/ut)*ut,y:Math.round(Ot(ln,on)/ut)*ut,i:on}})}return dr.links=function(Rr){return vc(hr(Rr)).edges.filter(function(ln){return ln.l&&ln.r}).map(function(ln){return{source:Rr[ln.l.i],target:Rr[ln.r.i]}})},dr.triangles=function(Rr){var ln=[];return vc(hr(Rr)).cells.forEach(function(on,En){for(var Un=on.site,Gn=on.edges.sort(as),Xa=-1,Kn=Gn.length,ma,Aa=Gn[Kn-1].edge,Va=Aa.l===Un?Aa.r:Aa.l;++XaZa&&(Za=on.x),on.y>Ta&&(Ta=on.y),Gn.push(on.x),Xa.push(on.y);else for(Kn=0;KnZa&&(Za=Ii),wo>Ta&&(Ta=wo),Gn.push(Ii),Xa.push(wo)}var so=Za-Aa,yo=Ta-Va;so>yo?Ta=Va+so:Za=Aa+yo;function jo(Qo,Cs,Tl,ec,wu,zo,Ks,_l){if(!(isNaN(Tl)||isNaN(ec)))if(Qo.leaf){var yu=Qo.x,au=Qo.y;if(yu!=null)if(f(yu-Tl)+f(au-ec)<.01)Yo(Qo,Cs,Tl,ec,wu,zo,Ks,_l);else{var Kc=Qo.point;Qo.x=Qo.y=Qo.point=null,Yo(Qo,Kc,yu,au,wu,zo,Ks,_l),Yo(Qo,Cs,Tl,ec,wu,zo,Ks,_l)}else Qo.x=Tl,Qo.y=ec,Qo.point=Cs}else Yo(Qo,Cs,Tl,ec,wu,zo,Ks,_l)}function Yo(Qo,Cs,Tl,ec,wu,zo,Ks,_l){var yu=(wu+Ks)*.5,au=(zo+_l)*.5,Kc=Tl>=yu,Yl=ec>=au,_u=Yl<<1|Kc;Qo.leaf=!1,Qo=Qo.nodes[_u]||(Qo.nodes[_u]=ql()),Kc?wu=yu:Ks=yu,Yl?zo=au:_l=au,jo(Qo,Cs,Tl,ec,wu,zo,Ks,_l)}var pl=ql();if(pl.add=function(Qo){jo(pl,Qo,+En(Qo,++Kn),+Un(Qo,Kn),Aa,Va,Za,Ta)},pl.visit=function(Qo){cf(Qo,pl,Aa,Va,Za,Ta)},pl.find=function(Qo){return xd(pl,Qo[0],Qo[1],Aa,Va,Za,Ta)},Kn=-1,Ye==null){for(;++KnWt||Un>dr||Gn=Ii,yo=pt>=wo,jo=yo<<1|so,Yo=jo+4;jopt&&(Wt=Ye.slice(pt,Wt),hr[dr]?hr[dr]+=Wt:hr[++dr]=Wt),(Dt=Dt[0])===(Ot=Ot[0])?hr[dr]?hr[dr]+=Ot:hr[++dr]=Ot:(hr[++dr]=null,Rr.push({i:dr,x:Rc(Dt,Ot)})),pt=gc.lastIndex;return pt=0&&!(Dt=v.interpolators[pt](Ce,Ye)););return Dt}v.interpolators=[function(Ce,Ye){var pt=typeof Ye;return(pt==="string"?dn.has(Ye.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Ye)?Lc:Df:Ye instanceof xa?Lc:Array.isArray(Ye)?ru:pt==="object"&&isNaN(Ye)?mc:Rc)(Ce,Ye)}],v.interpolateArray=ru;function ru(Ce,Ye){var pt=[],Dt=[],Ot=Ce.length,Wt=Ye.length,dr=Math.min(Ce.length,Ye.length),hr;for(hr=0;hr=0?Ce.slice(0,Ye):Ce,Dt=Ye>=0?Ce.slice(Ye+1):"in";return pt=Xc.get(pt)||rh,Dt=ph.get(Dt)||V,Lu(Dt(pt.apply(null,S.call(arguments,1))))};function Lu(Ce){return function(Ye){return Ye<=0?0:Ye>=1?1:Ce(Ye)}}function yp(Ce){return function(Ye){return 1-Ce(1-Ye)}}function al(Ce){return function(Ye){return .5*(Ye<.5?Ce(2*Ye):2-Ce(2-2*Ye))}}function Np(Ce){return Ce*Ce}function Ol(Ce){return Ce*Ce*Ce}function ns(Ce){if(Ce<=0)return 0;if(Ce>=1)return 1;var Ye=Ce*Ce,pt=Ye*Ce;return 4*(Ce<.5?pt:3*(Ce-Ye)+pt-.75)}function zh(Ce){return function(Ye){return Math.pow(Ye,Ce)}}function Pf(Ce){return 1-Math.cos(Ce*at)}function ic(Ce){return Math.pow(2,10*(Ce-1))}function bd(Ce){return 1-Math.sqrt(1-Ce*Ce)}function vh(Ce,Ye){var pt;return arguments.length<2&&(Ye=.45),arguments.length?pt=Ye/ke*Math.asin(1/Ce):(Ce=1,pt=Ye/4),function(Dt){return 1+Ce*Math.pow(2,-10*Dt)*Math.sin((Dt-pt)*ke/Ye)}}function Wh(Ce){return Ce||(Ce=1.70158),function(Ye){return Ye*Ye*((Ce+1)*Ye-Ce)}}function yc(Ce){return Ce<1/2.75?7.5625*Ce*Ce:Ce<2/2.75?7.5625*(Ce-=1.5/2.75)*Ce+.75:Ce<2.5/2.75?7.5625*(Ce-=2.25/2.75)*Ce+.9375:7.5625*(Ce-=2.625/2.75)*Ce+.984375}v.interpolateHcl=Jd;function Jd(Ce,Ye){Ce=v.hcl(Ce),Ye=v.hcl(Ye);var pt=Ce.h,Dt=Ce.c,Ot=Ce.l,Wt=Ye.h-pt,dr=Ye.c-Dt,hr=Ye.l-Ot;return isNaN(dr)&&(dr=0,Dt=isNaN(Dt)?Ye.c:Dt),isNaN(Wt)?(Wt=0,pt=isNaN(pt)?Ye.h:pt):Wt>180?Wt-=360:Wt<-180&&(Wt+=360),function(Rr){return yr(pt+Wt*Rr,Dt+dr*Rr,Ot+hr*Rr)+""}}v.interpolateHsl=Ld;function Ld(Ce,Ye){Ce=v.hsl(Ce),Ye=v.hsl(Ye);var pt=Ce.h,Dt=Ce.s,Ot=Ce.l,Wt=Ye.h-pt,dr=Ye.s-Dt,hr=Ye.l-Ot;return isNaN(dr)&&(dr=0,Dt=isNaN(Dt)?Ye.s:Dt),isNaN(Wt)?(Wt=0,pt=isNaN(pt)?Ye.h:pt):Wt>180?Wt-=360:Wt<-180&&(Wt+=360),function(Rr){return ci(pt+Wt*Rr,Dt+dr*Rr,Ot+hr*Rr)+""}}v.interpolateLab=Xh;function Xh(Ce,Ye){Ce=v.lab(Ce),Ye=v.lab(Ye);var pt=Ce.l,Dt=Ce.a,Ot=Ce.b,Wt=Ye.l-pt,dr=Ye.a-Dt,hr=Ye.b-Ot;return function(Rr){return Pa(pt+Wt*Rr,Dt+dr*Rr,Ot+hr*Rr)+""}}v.interpolateRound=mh;function mh(Ce,Ye){return Ye-=Ce,function(pt){return Math.round(Ce+Ye*pt)}}v.transform=function(Ce){var Ye=L.createElementNS(v.ns.prefix.svg,"g");return(v.transform=function(pt){if(pt!=null){Ye.setAttribute("transform",pt);var Dt=Ye.transform.baseVal.consolidate()}return new wd(Dt?Dt.matrix:nh)})(Ce)};function wd(Ce){var Ye=[Ce.a,Ce.b],pt=[Ce.c,Ce.d],Dt=zf(Ye),Ot=Td(Ye,pt),Wt=zf(Rd(pt,Ye,-Ot))||0;Ye[0]*pt[1]180?Ye+=360:Ye-Ce>180&&(Ce+=360),Dt.push({i:pt.push(Gf(pt)+"rotate(",null,")")-2,x:Rc(Ce,Ye)})):Ye&&pt.push(Gf(pt)+"rotate("+Ye+")")}function Ad(Ce,Ye,pt,Dt){Ce!==Ye?Dt.push({i:pt.push(Gf(pt)+"skewX(",null,")")-2,x:Rc(Ce,Ye)}):Ye&&pt.push(Gf(pt)+"skewX("+Ye+")")}function lu(Ce,Ye,pt,Dt){if(Ce[0]!==Ye[0]||Ce[1]!==Ye[1]){var Ot=pt.push(Gf(pt)+"scale(",null,",",null,")");Dt.push({i:Ot-4,x:Rc(Ce[0],Ye[0])},{i:Ot-2,x:Rc(Ce[1],Ye[1])})}else(Ye[0]!==1||Ye[1]!==1)&&pt.push(Gf(pt)+"scale("+Ye+")")}function id(Ce,Ye){var pt=[],Dt=[];return Ce=v.transform(Ce),Ye=v.transform(Ye),_c(Ce.translate,Ye.translate,pt,Dt),Ch(Ce.rotate,Ye.rotate,pt,Dt),Ad(Ce.skew,Ye.skew,pt,Dt),lu(Ce.scale,Ye.scale,pt,Dt),Ce=Ye=null,function(Ot){for(var Wt=-1,dr=Dt.length,hr;++Wt0?Wt=Ta:(pt.c=null,pt.t=NaN,pt=null,Ye.end({type:"end",alpha:Wt=0})):Ta>0&&(Ye.start({type:"start",alpha:Wt=Ta}),pt=Ga(Ce.tick)),Ce):Wt},Ce.start=function(){var Ta,Ii=Gn.length,wo=Xa.length,so=Dt[0],yo=Dt[1],jo,Yo;for(Ta=0;Ta=0;)Wt.push(on=ln[Rr]),on.parent=hr,on.depth=hr.depth+1;pt&&(hr.value=0),hr.children=ln}else pt&&(hr.value=+pt.call(Dt,hr,hr.depth)||0),delete hr.children;return qf(Ot,function(En){var Un,Gn;Ce&&(Un=En.children)&&Un.sort(Ce),pt&&(Gn=En.parent)&&(Gn.value+=En.value)}),dr}return Dt.sort=function(Ot){return arguments.length?(Ce=Ot,Dt):Ce},Dt.children=function(Ot){return arguments.length?(Ye=Ot,Dt):Ye},Dt.value=function(Ot){return arguments.length?(pt=Ot,Dt):pt},Dt.revalue=function(Ot){return pt&&(Nh(Ot,function(Wt){Wt.children&&(Wt.value=0)}),qf(Ot,function(Wt){var dr;Wt.children||(Wt.value=+pt.call(Dt,Wt,Wt.depth)||0),(dr=Wt.parent)&&(dr.value+=Wt.value)})),Ot},Dt};function Ru(Ce,Ye){return v.rebind(Ce,Ye,"sort","children","value"),Ce.nodes=Ce,Ce.links=Jp,Ce}function Nh(Ce,Ye){for(var pt=[Ce];(Ce=pt.pop())!=null;)if(Ye(Ce),(Ot=Ce.children)&&(Dt=Ot.length))for(var Dt,Ot;--Dt>=0;)pt.push(Ot[Dt])}function qf(Ce,Ye){for(var pt=[Ce],Dt=[];(Ce=pt.pop())!=null;)if(Dt.push(Ce),(dr=Ce.children)&&(Wt=dr.length))for(var Ot=-1,Wt,dr;++OtOt&&(Ot=hr),Dt.push(hr)}for(dr=0;drDt&&(pt=Ye,Dt=Ot);return pt}function pf(Ce){return Ce.reduce(Nf,0)}function Nf(Ce,Ye){return Ce+Ye[1]}v.layout.histogram=function(){var Ce=!0,Ye=Number,pt=Zh,Dt=Sd;function Ot(Wt,Un){for(var hr=[],Rr=Wt.map(Ye,this),ln=pt.call(this,Rr,Un),on=Dt.call(this,ln,Rr,Un),En,Un=-1,Gn=Rr.length,Xa=on.length-1,Kn=Ce?1:1/Gn,ma;++Un0)for(Un=-1;++Un=ln[0]&&ma<=ln[1]&&(En=hr[v.bisect(on,ma,1,Xa)-1],En.y+=Kn,En.push(Wt[Un]));return hr}return Ot.value=function(Wt){return arguments.length?(Ye=Wt,Ot):Ye},Ot.range=function(Wt){return arguments.length?(pt=Nt(Wt),Ot):pt},Ot.bins=function(Wt){return arguments.length?(Dt=typeof Wt=="number"?function(dr){return ku(dr,Wt)}:Nt(Wt),Ot):Dt},Ot.frequency=function(Wt){return arguments.length?(Ce=!!Wt,Ot):Ce},Ot};function Sd(Ce,Ye){return ku(Ce,Math.ceil(Math.log(Ye.length)/Math.LN2+1))}function ku(Ce,Ye){for(var pt=-1,Dt=+Ce[0],Ot=(Ce[1]-Dt)/Ye,Wt=[];++pt<=Ye;)Wt[pt]=Ot*pt+Dt;return Wt}function Zh(Ce){return[v.min(Ce),v.max(Ce)]}v.layout.pack=function(){var Ce=v.layout.hierarchy().sort(_h),Ye=0,pt=[1,1],Dt;function Ot(Wt,dr){var hr=Ce.call(this,Wt,dr),Rr=hr[0],ln=pt[0],on=pt[1],En=Dt==null?Math.sqrt:typeof Dt=="function"?Dt:function(){return Dt};if(Rr.x=Rr.y=0,qf(Rr,function(Gn){Gn.r=+En(Gn.value)}),qf(Rr,Jh),Ye){var Un=Ye*(Dt?1:Math.max(2*Rr.r/ln,2*Rr.r/on))/2;qf(Rr,function(Gn){Gn.r+=Un}),qf(Rr,Jh),qf(Rr,function(Gn){Gn.r-=Un})}return Od(Rr,ln/2,on/2,Dt?1:1/Math.max(2*Rr.r/ln,2*Rr.r/on)),hr}return Ot.size=function(Wt){return arguments.length?(pt=Wt,Ot):pt},Ot.radius=function(Wt){return arguments.length?(Dt=Wt==null||typeof Wt=="function"?Wt:+Wt,Ot):Dt},Ot.padding=function(Wt){return arguments.length?(Ye=+Wt,Ot):Ye},Ru(Ot,Ce)};function _h(Ce,Ye){return Ce.value-Ye.value}function Sf(Ce,Ye){var pt=Ce._pack_next;Ce._pack_next=Ye,Ye._pack_prev=Ce,Ye._pack_next=pt,pt._pack_prev=Ye}function Kh(Ce,Ye){Ce._pack_next=Ye,Ye._pack_prev=Ce}function Hf(Ce,Ye){var pt=Ye.x-Ce.x,Dt=Ye.y-Ce.y,Ot=Ce.r+Ye.r;return .999*Ot*Ot>pt*pt+Dt*Dt}function Jh(Ce){if(!(Ye=Ce.children)||!(Un=Ye.length))return;var Ye,pt=1/0,Dt=-1/0,Ot=1/0,Wt=-1/0,dr,hr,Rr,ln,on,En,Un;function Gn(Ta){pt=Math.min(Ta.x-Ta.r,pt),Dt=Math.max(Ta.x+Ta.r,Dt),Ot=Math.min(Ta.y-Ta.r,Ot),Wt=Math.max(Ta.y+Ta.r,Wt)}if(Ye.forEach(bp),dr=Ye[0],dr.x=-dr.r,dr.y=0,Gn(dr),Un>1&&(hr=Ye[1],hr.x=hr.r,hr.y=0,Gn(hr),Un>2))for(Rr=Ye[2],Ef(dr,hr,Rr),Gn(Rr),Sf(dr,Rr),dr._pack_prev=Rr,Sf(Rr,hr),hr=dr._pack_next,ln=3;lnma.x&&(ma=Ii),Ii.depth>Aa.depth&&(Aa=Ii)});var Va=Ye(Kn,ma)/2-Kn.x,Za=pt[0]/(ma.x+Ye(ma,Kn)/2+Va),Ta=pt[1]/(Aa.depth||1);Nh(Gn,function(Ii){Ii.x=(Ii.x+Va)*Za,Ii.y=Ii.depth*Ta})}return Un}function Wt(on){for(var En={A:null,children:[on]},Un=[En],Gn;(Gn=Un.pop())!=null;)for(var Xa=Gn.children,Kn,ma=0,Aa=Xa.length;ma0&&(Yc(xh(Kn,on,Un),on,Ii),Aa+=Ii,Va+=Ii),Za+=Kn.m,Aa+=Gn.m,Ta+=ma.m,Va+=Xa.m;Kn&&!qu(Xa)&&(Xa.t=Kn,Xa.m+=Za-Va),Gn&&!Wf(ma)&&(ma.t=Gn,ma.m+=Aa-Ta,Un=on)}return Un}function ln(on){on.x*=pt[0],on.y=on.depth*pt[1]}return Ot.separation=function(on){return arguments.length?(Ye=on,Ot):Ye},Ot.size=function(on){return arguments.length?(Dt=(pt=on)==null?ln:null,Ot):Dt?null:pt},Ot.nodeSize=function(on){return arguments.length?(Dt=(pt=on)==null?null:ln,Ot):Dt?pt:null},Ru(Ot,Ce)};function ih(Ce,Ye){return Ce.parent==Ye.parent?1:2}function Wf(Ce){var Ye=Ce.children;return Ye.length?Ye[0]:Ce.t}function qu(Ce){var Ye=Ce.children,pt;return(pt=Ye.length)?Ye[pt-1]:Ce.t}function Yc(Ce,Ye,pt){var Dt=pt/(Ye.i-Ce.i);Ye.c-=Dt,Ye.s+=pt,Ce.c+=Dt,Ye.z+=pt,Ye.m+=pt}function Nu(Ce){for(var Ye=0,pt=0,Dt=Ce.children,Ot=Dt.length,Wt;--Ot>=0;)Wt=Dt[Ot],Wt.z+=Ye,Wt.m+=Ye,Ye+=Wt.s+(pt+=Wt.c)}function xh(Ce,Ye,pt){return Ce.a.parent===Ye.parent?Ce.a:pt}v.layout.cluster=function(){var Ce=v.layout.hierarchy().sort(null).value(null),Ye=ih,pt=[1,1],Dt=!1;function Ot(Wt,dr){var hr=Ce.call(this,Wt,dr),Rr=hr[0],ln,on=0;qf(Rr,function(Kn){var ma=Kn.children;ma&&ma.length?(Kn.x=Ed(ma),Kn.y=Xf(ma)):(Kn.x=ln?on+=Ye(Kn,ln):0,Kn.y=0,ln=Kn)});var En=wr(Rr),Un=qr(Rr),Gn=En.x-Ye(En,Un)/2,Xa=Un.x+Ye(Un,En)/2;return qf(Rr,Dt?function(Kn){Kn.x=(Kn.x-Rr.x)*pt[0],Kn.y=(Rr.y-Kn.y)*pt[1]}:function(Kn){Kn.x=(Kn.x-Gn)/(Xa-Gn)*pt[0],Kn.y=(1-(Rr.y?Kn.y/Rr.y:1))*pt[1]}),hr}return Ot.separation=function(Wt){return arguments.length?(Ye=Wt,Ot):Ye},Ot.size=function(Wt){return arguments.length?(Dt=(pt=Wt)==null,Ot):Dt?null:pt},Ot.nodeSize=function(Wt){return arguments.length?(Dt=(pt=Wt)!=null,Ot):Dt?pt:null},Ru(Ot,Ce)};function Xf(Ce){return 1+v.max(Ce,function(Ye){return Ye.y})}function Ed(Ce){return Ce.reduce(function(Ye,pt){return Ye+pt.x},0)/Ce.length}function wr(Ce){var Ye=Ce.children;return Ye&&Ye.length?wr(Ye[0]):Ce}function qr(Ce){var Ye=Ce.children,pt;return Ye&&(pt=Ye.length)?qr(Ye[pt-1]):Ce}v.layout.treemap=function(){var Ce=v.layout.hierarchy(),Ye=Math.round,pt=[1,1],Dt=null,Ot=kn,Wt=!1,dr,hr="squarify",Rr=.5*(1+Math.sqrt(5));function ln(Kn,ma){for(var Aa=-1,Va=Kn.length,Za,Ta;++Aa0;)Va.push(Ta=Za[yo-1]),Va.area+=Ta.area,hr!=="squarify"||(wo=Un(Va,so))<=Ii?(Za.pop(),Ii=wo):(Va.area-=Va.pop().area,Gn(Va,so,Aa,!1),so=Math.min(Aa.dx,Aa.dy),Va.length=Va.area=0,Ii=1/0);Va.length&&(Gn(Va,so,Aa,!0),Va.length=Va.area=0),ma.forEach(on)}}function En(Kn){var ma=Kn.children;if(ma&&ma.length){var Aa=Ot(Kn),Va=ma.slice(),Za,Ta=[];for(ln(Va,Aa.dx*Aa.dy/Kn.value),Ta.area=0;Za=Va.pop();)Ta.push(Za),Ta.area+=Za.area,Za.z!=null&&(Gn(Ta,Za.z?Aa.dx:Aa.dy,Aa,!Va.length),Ta.length=Ta.area=0);ma.forEach(En)}}function Un(Kn,ma){for(var Aa=Kn.area,Va,Za=0,Ta=1/0,Ii=-1,wo=Kn.length;++IiZa&&(Za=Va));return Aa*=Aa,ma*=ma,Aa?Math.max(ma*Za*Rr/Aa,Aa/(ma*Ta*Rr)):1/0}function Gn(Kn,ma,Aa,Va){var Za=-1,Ta=Kn.length,Ii=Aa.x,wo=Aa.y,so=ma?Ye(Kn.area/ma):0,yo;if(ma==Aa.dx){for((Va||so>Aa.dy)&&(so=Aa.dy);++ZaAa.dx)&&(so=Aa.dx);++Za1);return Ce+Ye*Dt*Math.sqrt(-2*Math.log(Wt)/Wt)}},logNormal:function(){var Ce=v.random.normal.apply(v,arguments);return function(){return Math.exp(Ce())}},bates:function(Ce){var Ye=v.random.irwinHall(Ce);return function(){return Ye()/Ce}},irwinHall:function(Ce){return function(){for(var Ye=0,pt=0;pt2?fi:Fa,ln=Dt?Dd:_p;return Ot=Rr(Ce,Ye,ln,pt),Wt=Rr(Ye,Ce,ln,ul),hr}function hr(Rr){return Ot(Rr)}return hr.invert=function(Rr){return Wt(Rr)},hr.domain=function(Rr){return arguments.length?(Ce=Rr.map(Number),dr()):Ce},hr.range=function(Rr){return arguments.length?(Ye=Rr,dr()):Ye},hr.rangeRound=function(Rr){return hr.range(Rr).interpolate(mh)},hr.clamp=function(Rr){return arguments.length?(Dt=Rr,dr()):Dt},hr.interpolate=function(Rr){return arguments.length?(pt=Rr,dr()):pt},hr.ticks=function(Rr){return os(Ce,Rr)},hr.tickFormat=function(Rr,ln){return d3_scale_linearTickFormat(Ce,Rr,ln)},hr.nice=function(Rr){return ii(Ce,Rr),dr()},hr.copy=function(){return Yi(Ce,Ye,pt,Dt)},dr()}function bi(Ce,Ye){return v.rebind(Ce,Ye,"range","rangeRound","interpolate","clamp")}function ii(Ce,Ye){return Ai(Ce,Ni(bo(Ce,Ye)[2])),Ai(Ce,Ni(bo(Ce,Ye)[2])),Ce}function bo(Ce,Ye){Ye==null&&(Ye=10);var pt=Qn(Ce),Dt=pt[1]-pt[0],Ot=Math.pow(10,Math.floor(Math.log(Dt/Ye)/Math.LN10)),Wt=Ye/Dt*Ot;return Wt<=.15?Ot*=10:Wt<=.35?Ot*=5:Wt<=.75&&(Ot*=2),pt[0]=Math.ceil(pt[0]/Ot)*Ot,pt[1]=Math.floor(pt[1]/Ot)*Ot+Ot*.5,pt[2]=Ot,pt}function os(Ce,Ye){return v.range.apply(v,bo(Ce,Ye))}v.scale.log=function(){return rs(v.scale.linear().domain([0,1]),10,!0,[1,10])};function rs(Ce,Ye,pt,Dt){function Ot(hr){return(pt?Math.log(hr<0?0:hr):-Math.log(hr>0?0:-hr))/Math.log(Ye)}function Wt(hr){return pt?Math.pow(Ye,hr):-Math.pow(Ye,-hr)}function dr(hr){return Ce(Ot(hr))}return dr.invert=function(hr){return Wt(Ce.invert(hr))},dr.domain=function(hr){return arguments.length?(pt=hr[0]>=0,Ce.domain((Dt=hr.map(Number)).map(Ot)),dr):Dt},dr.base=function(hr){return arguments.length?(Ye=+hr,Ce.domain(Dt.map(Ot)),dr):Ye},dr.nice=function(){var hr=Ai(Dt.map(Ot),pt?Math:fs);return Ce.domain(hr),Dt=hr.map(Wt),dr},dr.ticks=function(){var hr=Qn(Dt),Rr=[],ln=hr[0],on=hr[1],En=Math.floor(Ot(ln)),Un=Math.ceil(Ot(on)),Gn=Ye%1?2:Ye;if(isFinite(Un-En)){if(pt){for(;En0;Xa--)Rr.push(Wt(En)*Xa);for(En=0;Rr[En]on;Un--);Rr=Rr.slice(En,Un)}return Rr},dr.copy=function(){return rs(Ce.copy(),Ye,pt,Dt)},bi(dr,Ce)}var fs={floor:function(Ce){return-Math.ceil(-Ce)},ceil:function(Ce){return-Math.floor(-Ce)}};v.scale.pow=function(){return ls(v.scale.linear(),1,[0,1])};function ls(Ce,Ye,pt){var Dt=To(Ye),Ot=To(1/Ye);function Wt(dr){return Ce(Dt(dr))}return Wt.invert=function(dr){return Ot(Ce.invert(dr))},Wt.domain=function(dr){return arguments.length?(Ce.domain((pt=dr.map(Number)).map(Dt)),Wt):pt},Wt.ticks=function(dr){return os(pt,dr)},Wt.tickFormat=function(dr,hr){return d3_scale_linearTickFormat(pt,dr,hr)},Wt.nice=function(dr){return Wt.domain(ii(pt,dr))},Wt.exponent=function(dr){return arguments.length?(Dt=To(Ye=dr),Ot=To(1/Ye),Ce.domain(pt.map(Dt)),Wt):Ye},Wt.copy=function(){return ls(Ce.copy(),Ye,pt)},bi(Wt,Ce)}function To(Ce){return function(Ye){return Ye<0?-Math.pow(-Ye,Ce):Math.pow(Ye,Ce)}}v.scale.sqrt=function(){return v.scale.pow().exponent(.5)},v.scale.ordinal=function(){return ro([],{t:"range",a:[[]]})};function ro(Ce,Ye){var pt,Dt,Ot;function Wt(hr){return Dt[((pt.get(hr)||(Ye.t==="range"?pt.set(hr,Ce.push(hr)):NaN))-1)%Dt.length]}function dr(hr,Rr){return v.range(Ce.length).map(function(ln){return hr+Rr*ln})}return Wt.domain=function(hr){if(!arguments.length)return Ce;Ce=[],pt=new k;for(var Rr=-1,ln=hr.length,on;++Rr0?pt[Wt-1]:Ce[0],WtUn?0:1;if(on=Fe)return Rr(on,Xa)+(ln?Rr(ln,1-Xa):"")+"Z";var Kn,ma,Aa,Va,Za=0,Ta=0,Ii,wo,so,yo,jo,Yo,pl,Qo,Cs=[];if((Va=(+dr.apply(this,arguments)||0)/2)&&(Aa=Dt===fu?Math.sqrt(ln*ln+on*on):+Dt.apply(this,arguments),Xa||(Ta*=-1),on&&(Ta=Zt(Aa/on*Math.sin(Va))),ln&&(Za=Zt(Aa/ln*Math.sin(Va)))),on){Ii=on*Math.cos(En+Ta),wo=on*Math.sin(En+Ta),so=on*Math.cos(Un-Ta),yo=on*Math.sin(Un-Ta);var Tl=Math.abs(Un-En-2*Ta)<=Ie?0:1;if(Ta&&Gc(Ii,wo,so,yo)===Xa^Tl){var ec=(En+Un)/2;Ii=on*Math.cos(ec),wo=on*Math.sin(ec),so=yo=null}}else Ii=wo=0;if(ln){jo=ln*Math.cos(Un-Za),Yo=ln*Math.sin(Un-Za),pl=ln*Math.cos(En+Za),Qo=ln*Math.sin(En+Za);var wu=Math.abs(En-Un+2*Za)<=Ie?0:1;if(Za&&Gc(jo,Yo,pl,Qo)===1-Xa^wu){var zo=(En+Un)/2;jo=ln*Math.cos(zo),Yo=ln*Math.sin(zo),pl=Qo=null}}else jo=Yo=0;if(Gn>ut&&(Kn=Math.min(Math.abs(on-ln)/2,+pt.apply(this,arguments)))>.001){ma=ln0?0:1}function Zc(Ce,Ye,pt,Dt,Ot){var Wt=Ce[0]-Ye[0],dr=Ce[1]-Ye[1],hr=(Ot?Dt:-Dt)/Math.sqrt(Wt*Wt+dr*dr),Rr=hr*dr,ln=-hr*Wt,on=Ce[0]+Rr,En=Ce[1]+ln,Un=Ye[0]+Rr,Gn=Ye[1]+ln,Xa=(on+Un)/2,Kn=(En+Gn)/2,ma=Un-on,Aa=Gn-En,Va=ma*ma+Aa*Aa,Za=pt-Dt,Ta=on*Gn-Un*En,Ii=(Aa<0?-1:1)*Math.sqrt(Math.max(0,Za*Za*Va-Ta*Ta)),wo=(Ta*Aa-ma*Ii)/Va,so=(-Ta*ma-Aa*Ii)/Va,yo=(Ta*Aa+ma*Ii)/Va,jo=(-Ta*ma+Aa*Ii)/Va,Yo=wo-Xa,pl=so-Kn,Qo=yo-Xa,Cs=jo-Kn;return Yo*Yo+pl*pl>Qo*Qo+Cs*Cs&&(wo=yo,so=jo),[[wo-Rr,so-ln],[wo*pt/Za,so*pt/Za]]}function kh(){return!0}function qc(Ce){var Ye=Ro,pt=Xo,Dt=kh,Ot=Ku,Wt=Ot.key,dr=.7;function hr(Rr){var ln=[],on=[],En=-1,Un=Rr.length,Gn,Xa=Nt(Ye),Kn=Nt(pt);function ma(){ln.push("M",Ot(Ce(on),dr))}for(;++En1?Ce.join("L"):Ce+"Z"}function sh(Ce){return Ce.join("L")+"Z"}function hs(Ce){for(var Ye=0,pt=Ce.length,Dt=Ce[0],Ot=[Dt[0],",",Dt[1]];++Ye1&&Ot.push("H",Dt[0]),Ot.join("")}function Ss(Ce){for(var Ye=0,pt=Ce.length,Dt=Ce[0],Ot=[Dt[0],",",Dt[1]];++Ye1){hr=Ye[1],Wt=Ce[Rr],Rr++,Dt+="C"+(Ot[0]+dr[0])+","+(Ot[1]+dr[1])+","+(Wt[0]-hr[0])+","+(Wt[1]-hr[1])+","+Wt[0]+","+Wt[1];for(var ln=2;ln9&&(Wt=pt*3/Math.sqrt(Wt),dr[hr]=Wt*Dt,dr[hr+1]=Wt*Ot));for(hr=-1;++hr<=Rr;)Wt=(Ce[Math.min(Rr,hr+1)][0]-Ce[Math.max(0,hr-1)][0])/(6*(1+dr[hr]*dr[hr])),Ye.push([Wt||0,dr[hr]*Wt||0]);return Ye}function dt(Ce){return Ce.length<3?Ku(Ce):Ce[0]+N(Ce,ot(Ce))}v.svg.line.radial=function(){var Ce=qc(St);return Ce.radius=Ce.x,delete Ce.x,Ce.angle=Ce.y,delete Ce.y,Ce};function St(Ce){for(var Ye,pt=-1,Dt=Ce.length,Ot,Wt;++ptIe)+",1 "+En}function ln(on,En,Un,Gn){return"Q 0,0 "+Gn}return Wt.radius=function(on){return arguments.length?(pt=Nt(on),Wt):pt},Wt.source=function(on){return arguments.length?(Ce=Nt(on),Wt):Ce},Wt.target=function(on){return arguments.length?(Ye=Nt(on),Wt):Ye},Wt.startAngle=function(on){return arguments.length?(Dt=Nt(on),Wt):Dt},Wt.endAngle=function(on){return arguments.length?(Ot=Nt(on),Wt):Ot},Wt};function er(Ce){return Ce.radius}v.svg.diagonal=function(){var Ce=Yt,Ye=Ut,pt=Mr;function Dt(Ot,Wt){var dr=Ce.call(this,Ot,Wt),hr=Ye.call(this,Ot,Wt),Rr=(dr.y+hr.y)/2,ln=[dr,{x:dr.x,y:Rr},{x:hr.x,y:Rr},hr];return ln=ln.map(pt),"M"+ln[0]+"C"+ln[1]+" "+ln[2]+" "+ln[3]}return Dt.source=function(Ot){return arguments.length?(Ce=Nt(Ot),Dt):Ce},Dt.target=function(Ot){return arguments.length?(Ye=Nt(Ot),Dt):Ye},Dt.projection=function(Ot){return arguments.length?(pt=Ot,Dt):pt},Dt};function Mr(Ce){return[Ce.x,Ce.y]}v.svg.diagonal.radial=function(){var Ce=v.svg.diagonal(),Ye=Mr,pt=Ce.projection;return Ce.projection=function(Dt){return arguments.length?pt(Nr(Ye=Dt)):Ye},Ce};function Nr(Ce){return function(){var Ye=Ce.apply(this,arguments),pt=Ye[0],Dt=Ye[1]-at;return[pt*Math.cos(Dt),pt*Math.sin(Dt)]}}v.svg.symbol=function(){var Ce=sn,Ye=jr;function pt(Dt,Ot){return($n.get(Ce.call(this,Dt,Ot))||xn)(Ye.call(this,Dt,Ot))}return pt.type=function(Dt){return arguments.length?(Ce=Nt(Dt),pt):Ce},pt.size=function(Dt){return arguments.length?(Ye=Nt(Dt),pt):Ye},pt};function jr(){return 64}function sn(){return"circle"}function xn(Ce){var Ye=Math.sqrt(Ce/Ie);return"M0,"+Ye+"A"+Ye+","+Ye+" 0 1,1 0,"+-Ye+"A"+Ye+","+Ye+" 0 1,1 0,"+Ye+"Z"}var $n=v.map({circle:xn,cross:function(Ce){var Ye=Math.sqrt(Ce/5)/2;return"M"+-3*Ye+","+-Ye+"H"+-Ye+"V"+-3*Ye+"H"+Ye+"V"+-Ye+"H"+3*Ye+"V"+Ye+"H"+Ye+"V"+3*Ye+"H"+-Ye+"V"+Ye+"H"+-3*Ye+"Z"},diamond:function(Ce){var Ye=Math.sqrt(Ce/(2*ua)),pt=Ye*ua;return"M0,"+-Ye+"L"+pt+",0 0,"+Ye+" "+-pt+",0Z"},square:function(Ce){var Ye=Math.sqrt(Ce)/2;return"M"+-Ye+","+-Ye+"L"+Ye+","+-Ye+" "+Ye+","+Ye+" "+-Ye+","+Ye+"Z"},"triangle-down":function(Ce){var Ye=Math.sqrt(Ce/Wn),pt=Ye*Wn/2;return"M0,"+pt+"L"+Ye+","+-pt+" "+-Ye+","+-pt+"Z"},"triangle-up":function(Ce){var Ye=Math.sqrt(Ce/Wn),pt=Ye*Wn/2;return"M0,"+-pt+"L"+Ye+","+pt+" "+-Ye+","+pt+"Z"}});v.svg.symbolTypes=$n.keys();var Wn=Math.sqrt(3),ua=Math.tan(30*ct);le.transition=function(Ce){for(var Ye=qo||++Ao,pt=yl(Ce),Dt=[],Ot,Wt,dr=Bo||{time:Date.now(),ease:ns,delay:0,duration:250},hr=-1,Rr=this.length;++hr0;)En[--Va].call(Ce,Aa);if(ma>=1)return dr.event&&dr.event.end.call(Ce,Ce.__data__,Ye),--Wt.count?delete Wt[Dt]:delete Ce[pt],1}dr||(hr=Ot.time,Rr=Ga(Un,0,hr),dr=Wt[Dt]={tween:new k,time:hr,timer:Rr,delay:Ot.delay,duration:Ot.duration,ease:Ot.ease,index:Ye},Ot=null,++Wt.count)}v.svg.axis=function(){var Ce=v.scale.linear(),Ye=Sl,pt=6,Dt=6,Ot=3,Wt=[10],dr=null,hr;function Rr(ln){ln.each(function(){var on=v.select(this),En=this.__chart__||Ce,Un=this.__chart__=Ce.copy(),Gn=dr??(Un.ticks?Un.ticks.apply(Un,Wt):Un.domain()),Xa=hr??(Un.tickFormat?Un.tickFormat.apply(Un,Wt):V),Kn=on.selectAll(".tick").data(Gn,Un),ma=Kn.enter().insert("g",".domain").attr("class","tick").style("opacity",ut),Aa=v.transition(Kn.exit()).style("opacity",ut).remove(),Va=v.transition(Kn.order()).style("opacity",1),Za=Math.max(pt,0)+Ot,Ta,Ii=$a(Un),wo=on.selectAll(".domain").data([0]),so=(wo.enter().append("path").attr("class","domain"),v.transition(wo));ma.append("line"),ma.append("text");var yo=ma.select("line"),jo=Va.select("line"),Yo=Kn.select("text").text(Xa),pl=ma.select("text"),Qo=Va.select("text"),Cs=Ye==="top"||Ye==="left"?-1:1,Tl,ec,wu,zo;if(Ye==="bottom"||Ye==="top"?(Ta=Su,Tl="x",wu="y",ec="x2",zo="y2",Yo.attr("dy",Cs<0?"0em":".71em").style("text-anchor","middle"),so.attr("d","M"+Ii[0]+","+Cs*Dt+"V0H"+Ii[1]+"V"+Cs*Dt)):(Ta=Ys,Tl="y",wu="x",ec="y2",zo="x2",Yo.attr("dy",".32em").style("text-anchor",Cs<0?"end":"start"),so.attr("d","M"+Cs*Dt+","+Ii[0]+"H0V"+Ii[1]+"H"+Cs*Dt)),yo.attr(zo,Cs*pt),pl.attr(wu,Cs*Za),jo.attr(ec,0).attr(zo,Cs*pt),Qo.attr(Tl,0).attr(wu,Cs*Za),Un.rangeBand){var Ks=Un,_l=Ks.rangeBand()/2;En=Un=function(yu){return Ks(yu)+_l}}else En.rangeBand?En=Un:Aa.call(Ta,Un,En);ma.call(Ta,En,Un),Va.call(Ta,Un,Un)})}return Rr.scale=function(ln){return arguments.length?(Ce=ln,Rr):Ce},Rr.orient=function(ln){return arguments.length?(Ye=ln in Ou?ln+"":Sl,Rr):Ye},Rr.ticks=function(){return arguments.length?(Wt=M(arguments),Rr):Wt},Rr.tickValues=function(ln){return arguments.length?(dr=ln,Rr):dr},Rr.tickFormat=function(ln){return arguments.length?(hr=ln,Rr):hr},Rr.tickSize=function(ln){var on=arguments.length;return on?(pt=+ln,Dt=+arguments[on-1],Rr):pt},Rr.innerTickSize=function(ln){return arguments.length?(pt=+ln,Rr):pt},Rr.outerTickSize=function(ln){return arguments.length?(Dt=+ln,Rr):Dt},Rr.tickPadding=function(ln){return arguments.length?(Ot=+ln,Rr):Ot},Rr.tickSubdivide=function(){return arguments.length&&Rr},Rr};var Sl="bottom",Ou={top:1,right:1,bottom:1,left:1};function Su(Ce,Ye,pt){Ce.attr("transform",function(Dt){var Ot=Ye(Dt);return"translate("+(isFinite(Ot)?Ot:pt(Dt))+",0)"})}function Ys(Ce,Ye,pt){Ce.attr("transform",function(Dt){var Ot=Ye(Dt);return"translate(0,"+(isFinite(Ot)?Ot:pt(Dt))+")"})}v.svg.brush=function(){var Ce=ge(on,"brushstart","brush","brushend"),Ye=null,pt=null,Dt=[0,0],Ot=[0,0],Wt,dr,hr=!0,Rr=!0,ln=Qu[0];function on(Kn){Kn.each(function(){var ma=v.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Xa).on("touchstart.brush",Xa),Aa=ma.selectAll(".background").data([0]);Aa.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),ma.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Va=ma.selectAll(".resize").data(ln,V);Va.exit().remove(),Va.enter().append("g").attr("class",function(wo){return"resize "+wo}).style("cursor",function(wo){return Zs[wo]}).append("rect").attr("x",function(wo){return/[ew]$/.test(wo)?-3:null}).attr("y",function(wo){return/^[ns]/.test(wo)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Va.style("display",on.empty()?"none":null);var Za=v.transition(ma),Ta=v.transition(Aa),Ii;Ye&&(Ii=$a(Ye),Ta.attr("x",Ii[0]).attr("width",Ii[1]-Ii[0]),Un(Za)),pt&&(Ii=$a(pt),Ta.attr("y",Ii[0]).attr("height",Ii[1]-Ii[0]),Gn(Za)),En(Za)})}on.event=function(Kn){Kn.each(function(){var ma=Ce.of(this,arguments),Aa={x:Dt,y:Ot,i:Wt,j:dr},Va=this.__chart__||Aa;this.__chart__=Aa,qo?v.select(this).transition().each("start.brush",function(){Wt=Va.i,dr=Va.j,Dt=Va.x,Ot=Va.y,ma({type:"brushstart"})}).tween("brush:brush",function(){var Za=ru(Dt,Aa.x),Ta=ru(Ot,Aa.y);return Wt=dr=null,function(Ii){Dt=Aa.x=Za(Ii),Ot=Aa.y=Ta(Ii),ma({type:"brush",mode:"resize"})}}).each("end.brush",function(){Wt=Aa.i,dr=Aa.j,ma({type:"brush",mode:"resize"}),ma({type:"brushend"})}):(ma({type:"brushstart"}),ma({type:"brush",mode:"resize"}),ma({type:"brushend"}))})};function En(Kn){Kn.selectAll(".resize").attr("transform",function(ma){return"translate("+Dt[+/e$/.test(ma)]+","+Ot[+/^s/.test(ma)]+")"})}function Un(Kn){Kn.select(".extent").attr("x",Dt[0]),Kn.selectAll(".extent,.n>rect,.s>rect").attr("width",Dt[1]-Dt[0])}function Gn(Kn){Kn.select(".extent").attr("y",Ot[0]),Kn.selectAll(".extent,.e>rect,.w>rect").attr("height",Ot[1]-Ot[0])}function Xa(){var Kn=this,ma=v.select(v.event.target),Aa=Ce.of(Kn,arguments),Va=v.select(Kn),Za=ma.datum(),Ta=!/^(n|s)$/.test(Za)&&Ye,Ii=!/^(e|w)$/.test(Za)&&pt,wo=ma.classed("extent"),so=Fr(Kn),yo,jo=v.mouse(Kn),Yo,pl=v.select(r(Kn)).on("keydown.brush",Tl).on("keyup.brush",ec);if(v.event.changedTouches?pl.on("touchmove.brush",wu).on("touchend.brush",Ks):pl.on("mousemove.brush",wu).on("mouseup.brush",Ks),Va.interrupt().selectAll("*").interrupt(),wo)jo[0]=Dt[0]-jo[0],jo[1]=Ot[0]-jo[1];else if(Za){var Qo=+/w$/.test(Za),Cs=+/^n/.test(Za);Yo=[Dt[1-Qo]-jo[0],Ot[1-Cs]-jo[1]],jo[0]=Dt[Qo],jo[1]=Ot[Cs]}else v.event.altKey&&(yo=jo.slice());Va.style("pointer-events","none").selectAll(".resize").style("display",null),v.select("body").style("cursor",ma.style("cursor")),Aa({type:"brushstart"}),wu();function Tl(){v.event.keyCode==32&&(wo||(yo=null,jo[0]-=Dt[1],jo[1]-=Ot[1],wo=2),ue())}function ec(){v.event.keyCode==32&&wo==2&&(jo[0]+=Dt[1],jo[1]+=Ot[1],wo=0,ue())}function wu(){var _l=v.mouse(Kn),yu=!1;Yo&&(_l[0]+=Yo[0],_l[1]+=Yo[1]),wo||(v.event.altKey?(yo||(yo=[(Dt[0]+Dt[1])/2,(Ot[0]+Ot[1])/2]),jo[0]=Dt[+(_l[0]0))return mr;do mr.push(Ur=new Date(+Kt)),Je(Kt,fr),Se(Kt);while(Ur=Qt)for(;Se(Qt),!Kt(Qt);)Qt.setTime(Qt-1)},function(Qt,fr){if(Qt>=Qt)if(fr<0)for(;++fr<=0;)for(;Je(Qt,-1),!Kt(Qt););else for(;--fr>=0;)for(;Je(Qt,1),!Kt(Qt););})},_t&&(vt.count=function(Kt,Qt){return S.setTime(+Kt),M.setTime(+Qt),Se(S),Se(M),Math.floor(_t(S,M))},vt.every=function(Kt){return Kt=Math.floor(Kt),!isFinite(Kt)||!(Kt>0)?null:Kt>1?vt.filter(At?function(Qt){return At(Qt)%Kt===0}:function(Qt){return vt.count(0,Qt)%Kt===0}):vt}),vt}var t=L(function(){},function(Se,Je){Se.setTime(+Se+Je)},function(Se,Je){return Je-Se});t.every=function(Se){return Se=Math.floor(Se),!isFinite(Se)||!(Se>0)?null:Se>1?L(function(Je){Je.setTime(Math.floor(Je/Se)*Se)},function(Je,_t){Je.setTime(+Je+_t*Se)},function(Je,_t){return(_t-Je)/Se}):t};var r=t.range,a=1e3,l=6e4,i=36e5,s=864e5,o=6048e5,c=L(function(Se){Se.setTime(Se-Se.getMilliseconds())},function(Se,Je){Se.setTime(+Se+Je*a)},function(Se,Je){return(Je-Se)/a},function(Se){return Se.getUTCSeconds()}),p=c.range,d=L(function(Se){Se.setTime(Se-Se.getMilliseconds()-Se.getSeconds()*a)},function(Se,Je){Se.setTime(+Se+Je*l)},function(Se,Je){return(Je-Se)/l},function(Se){return Se.getMinutes()}),y=d.range,g=L(function(Se){Se.setTime(Se-Se.getMilliseconds()-Se.getSeconds()*a-Se.getMinutes()*l)},function(Se,Je){Se.setTime(+Se+Je*i)},function(Se,Je){return(Je-Se)/i},function(Se){return Se.getHours()}),C=g.range,f=L(function(Se){Se.setHours(0,0,0,0)},function(Se,Je){Se.setDate(Se.getDate()+Je)},function(Se,Je){return(Je-Se-(Je.getTimezoneOffset()-Se.getTimezoneOffset())*l)/s},function(Se){return Se.getDate()-1}),x=f.range;function A(Se){return L(function(Je){Je.setDate(Je.getDate()-(Je.getDay()+7-Se)%7),Je.setHours(0,0,0,0)},function(Je,_t){Je.setDate(Je.getDate()+_t*7)},function(Je,_t){return(_t-Je-(_t.getTimezoneOffset()-Je.getTimezoneOffset())*l)/o})}var k=A(0),I=A(1),T=A(2),E=A(3),_=A(4),h=A(5),m=A(6),w=k.range,F=I.range,z=T.range,U=E.range,V=_.range,G=h.range,j=m.range,O=L(function(Se){Se.setDate(1),Se.setHours(0,0,0,0)},function(Se,Je){Se.setMonth(Se.getMonth()+Je)},function(Se,Je){return Je.getMonth()-Se.getMonth()+(Je.getFullYear()-Se.getFullYear())*12},function(Se){return Se.getMonth()}),H=O.range,W=L(function(Se){Se.setMonth(0,1),Se.setHours(0,0,0,0)},function(Se,Je){Se.setFullYear(Se.getFullYear()+Je)},function(Se,Je){return Je.getFullYear()-Se.getFullYear()},function(Se){return Se.getFullYear()});W.every=function(Se){return!isFinite(Se=Math.floor(Se))||!(Se>0)?null:L(function(Je){Je.setFullYear(Math.floor(Je.getFullYear()/Se)*Se),Je.setMonth(0,1),Je.setHours(0,0,0,0)},function(Je,_t){Je.setFullYear(Je.getFullYear()+_t*Se)})};var ee=W.range,ue=L(function(Se){Se.setUTCSeconds(0,0)},function(Se,Je){Se.setTime(+Se+Je*l)},function(Se,Je){return(Je-Se)/l},function(Se){return Se.getUTCMinutes()}),xe=ue.range,ge=L(function(Se){Se.setUTCMinutes(0,0,0)},function(Se,Je){Se.setTime(+Se+Je*i)},function(Se,Je){return(Je-Se)/i},function(Se){return Se.getUTCHours()}),_e=ge.range,Y=L(function(Se){Se.setUTCHours(0,0,0,0)},function(Se,Je){Se.setUTCDate(Se.getUTCDate()+Je)},function(Se,Je){return(Je-Se)/s},function(Se){return Se.getUTCDate()-1}),se=Y.range;function ce(Se){return L(function(Je){Je.setUTCDate(Je.getUTCDate()-(Je.getUTCDay()+7-Se)%7),Je.setUTCHours(0,0,0,0)},function(Je,_t){Je.setUTCDate(Je.getUTCDate()+_t*7)},function(Je,_t){return(_t-Je)/o})}var ne=ce(0),ye=ce(1),le=ce(2),Z=ce(3),de=ce(4),pe=ce(5),Te=ce(6),Ne=ne.range,$e=ye.range,Ze=le.range,Xe=Z.range,it=de.range,yt=pe.range,bt=Te.range,mt=L(function(Se){Se.setUTCDate(1),Se.setUTCHours(0,0,0,0)},function(Se,Je){Se.setUTCMonth(Se.getUTCMonth()+Je)},function(Se,Je){return Je.getUTCMonth()-Se.getUTCMonth()+(Je.getUTCFullYear()-Se.getUTCFullYear())*12},function(Se){return Se.getUTCMonth()}),ht=mt.range,Ve=L(function(Se){Se.setUTCMonth(0,1),Se.setUTCHours(0,0,0,0)},function(Se,Je){Se.setUTCFullYear(Se.getUTCFullYear()+Je)},function(Se,Je){return Je.getUTCFullYear()-Se.getUTCFullYear()},function(Se){return Se.getUTCFullYear()});Ve.every=function(Se){return!isFinite(Se=Math.floor(Se))||!(Se>0)?null:L(function(Je){Je.setUTCFullYear(Math.floor(Je.getUTCFullYear()/Se)*Se),Je.setUTCMonth(0,1),Je.setUTCHours(0,0,0,0)},function(Je,_t){Je.setUTCFullYear(Je.getUTCFullYear()+_t*Se)})};var ze=Ve.range;v.timeDay=f,v.timeDays=x,v.timeFriday=h,v.timeFridays=G,v.timeHour=g,v.timeHours=C,v.timeInterval=L,v.timeMillisecond=t,v.timeMilliseconds=r,v.timeMinute=d,v.timeMinutes=y,v.timeMonday=I,v.timeMondays=F,v.timeMonth=O,v.timeMonths=H,v.timeSaturday=m,v.timeSaturdays=j,v.timeSecond=c,v.timeSeconds=p,v.timeSunday=k,v.timeSundays=w,v.timeThursday=_,v.timeThursdays=V,v.timeTuesday=T,v.timeTuesdays=z,v.timeWednesday=E,v.timeWednesdays=U,v.timeWeek=k,v.timeWeeks=w,v.timeYear=W,v.timeYears=ee,v.utcDay=Y,v.utcDays=se,v.utcFriday=pe,v.utcFridays=yt,v.utcHour=ge,v.utcHours=_e,v.utcMillisecond=t,v.utcMilliseconds=r,v.utcMinute=ue,v.utcMinutes=xe,v.utcMonday=ye,v.utcMondays=$e,v.utcMonth=mt,v.utcMonths=ht,v.utcSaturday=Te,v.utcSaturdays=bt,v.utcSecond=c,v.utcSeconds=p,v.utcSunday=ne,v.utcSundays=Ne,v.utcThursday=de,v.utcThursdays=it,v.utcTuesday=le,v.utcTuesdays=Ze,v.utcWednesday=Z,v.utcWednesdays=Xe,v.utcWeek=ne,v.utcWeeks=Ne,v.utcYear=Ve,v.utcYears=ze,Object.defineProperty(v,"__esModule",{value:!0})})}}),Kr=Re({"node_modules/d3-time-format/dist/d3-time-format.js"(ae,K){(function(v,S){typeof ae=="object"&&typeof K<"u"?S(ae,Nn()):(v=v||self,S(v.d3=v.d3||{},v.d3))})(ae,function(v,S){function M(et){if(0<=et.y&&et.y<100){var ut=new Date(-1,et.m,et.d,et.H,et.M,et.S,et.L);return ut.setFullYear(et.y),ut}return new Date(et.y,et.m,et.d,et.H,et.M,et.S,et.L)}function L(et){if(0<=et.y&&et.y<100){var ut=new Date(Date.UTC(-1,et.m,et.d,et.H,et.M,et.S,et.L));return ut.setUTCFullYear(et.y),ut}return new Date(Date.UTC(et.y,et.m,et.d,et.H,et.M,et.S,et.L))}function t(et,ut,Be){return{y:et,m:ut,d:Be,H:0,M:0,S:0,L:0}}function r(et){var ut=et.dateTime,Be=et.date,Ie=et.time,ke=et.periods,Fe=et.days,at=et.shortDays,ct=et.months,Gt=et.shortMonths,Vt=p(ke),Zt=d(ke),ur=p(Fe),Dr=d(Fe),kr=p(at),Sr=d(at),Jr=p(ct),jn=d(ct),ha=p(Gt),oa=d(Gt),_a={a:Pa,A:La,b:Oa,B:Wa,c:null,d:O,e:O,f:xe,H,I:W,j:ee,L:ue,m:ge,M:_e,p:sa,q:ji,Q:Qt,s:fr,S:Y,u:se,U:ce,V:ne,w:ye,W:le,x:null,X:null,y:Z,Y:de,Z:pe,"%":Kt},xa={a:Qi,A:Xt,b:Lt,B:$r,c:null,d:Te,e:Te,f:it,H:Ne,I:$e,j:Ze,L:Xe,m:yt,M:bt,p:en,q:rn,Q:Qt,s:fr,S:mt,u:ht,U:Ve,V:ze,w:Se,W:Je,x:null,X:null,y:_t,Y:At,Z:vt,"%":Kt},ra={a:yr,A:br,b:an,B:bn,c:In,d:_,e:_,f:U,H:m,I:m,j:h,L:z,m:E,M:w,p:rr,q:T,Q:G,s:j,S:F,u:g,U:C,V:f,w:y,W:x,x:Fn,X:va,y:k,Y:A,Z:I,"%":V};_a.x=Ha(Be,_a),_a.X=Ha(Ie,_a),_a.c=Ha(ut,_a),xa.x=Ha(Be,xa),xa.X=Ha(Ie,xa),xa.c=Ha(ut,xa);function Ha(Wr,tn){return function(wn){var dn=[],Nt=-1,xr=0,Xr=Wr.length,Tn,Xn,ia;for(wn instanceof Date||(wn=new Date(+wn));++Nt53)return null;"w"in dn||(dn.w=1),"Z"in dn?(xr=L(t(dn.y,0,1)),Xr=xr.getUTCDay(),xr=Xr>4||Xr===0?S.utcMonday.ceil(xr):S.utcMonday(xr),xr=S.utcDay.offset(xr,(dn.V-1)*7),dn.y=xr.getUTCFullYear(),dn.m=xr.getUTCMonth(),dn.d=xr.getUTCDate()+(dn.w+6)%7):(xr=M(t(dn.y,0,1)),Xr=xr.getDay(),xr=Xr>4||Xr===0?S.timeMonday.ceil(xr):S.timeMonday(xr),xr=S.timeDay.offset(xr,(dn.V-1)*7),dn.y=xr.getFullYear(),dn.m=xr.getMonth(),dn.d=xr.getDate()+(dn.w+6)%7)}else("W"in dn||"U"in dn)&&("w"in dn||(dn.w="u"in dn?dn.u%7:"W"in dn?1:0),Xr="Z"in dn?L(t(dn.y,0,1)).getUTCDay():M(t(dn.y,0,1)).getDay(),dn.m=0,dn.d="W"in dn?(dn.w+6)%7+dn.W*7-(Xr+5)%7:dn.w+dn.U*7-(Xr+6)%7);return"Z"in dn?(dn.H+=dn.Z/100|0,dn.M+=dn.Z%100,L(dn)):M(dn)}}function _r(Wr,tn,wn,dn){for(var Nt=0,xr=tn.length,Xr=wn.length,Tn,Xn;Nt=Xr)return-1;if(Tn=tn.charCodeAt(Nt++),Tn===37){if(Tn=tn.charAt(Nt++),Xn=ra[Tn in a?tn.charAt(Nt++):Tn],!Xn||(dn=Xn(Wr,wn,dn))<0)return-1}else if(Tn!=wn.charCodeAt(dn++))return-1}return dn}function rr(Wr,tn,wn){var dn=Vt.exec(tn.slice(wn));return dn?(Wr.p=Zt[dn[0].toLowerCase()],wn+dn[0].length):-1}function yr(Wr,tn,wn){var dn=kr.exec(tn.slice(wn));return dn?(Wr.w=Sr[dn[0].toLowerCase()],wn+dn[0].length):-1}function br(Wr,tn,wn){var dn=ur.exec(tn.slice(wn));return dn?(Wr.w=Dr[dn[0].toLowerCase()],wn+dn[0].length):-1}function an(Wr,tn,wn){var dn=ha.exec(tn.slice(wn));return dn?(Wr.m=oa[dn[0].toLowerCase()],wn+dn[0].length):-1}function bn(Wr,tn,wn){var dn=Jr.exec(tn.slice(wn));return dn?(Wr.m=jn[dn[0].toLowerCase()],wn+dn[0].length):-1}function In(Wr,tn,wn){return _r(Wr,ut,tn,wn)}function Fn(Wr,tn,wn){return _r(Wr,Be,tn,wn)}function va(Wr,tn,wn){return _r(Wr,Ie,tn,wn)}function Pa(Wr){return at[Wr.getDay()]}function La(Wr){return Fe[Wr.getDay()]}function Oa(Wr){return Gt[Wr.getMonth()]}function Wa(Wr){return ct[Wr.getMonth()]}function sa(Wr){return ke[+(Wr.getHours()>=12)]}function ji(Wr){return 1+~~(Wr.getMonth()/3)}function Qi(Wr){return at[Wr.getUTCDay()]}function Xt(Wr){return Fe[Wr.getUTCDay()]}function Lt(Wr){return Gt[Wr.getUTCMonth()]}function $r(Wr){return ct[Wr.getUTCMonth()]}function en(Wr){return ke[+(Wr.getUTCHours()>=12)]}function rn(Wr){return 1+~~(Wr.getUTCMonth()/3)}return{format:function(Wr){var tn=Ha(Wr+="",_a);return tn.toString=function(){return Wr},tn},parse:function(Wr){var tn=ci(Wr+="",!1);return tn.toString=function(){return Wr},tn},utcFormat:function(Wr){var tn=Ha(Wr+="",xa);return tn.toString=function(){return Wr},tn},utcParse:function(Wr){var tn=ci(Wr+="",!0);return tn.toString=function(){return Wr},tn}}}var a={"-":"",_:" ",0:"0"},l=/^\s*\d+/,i=/^%/,s=/[\\^$*+?|[\]().{}]/g;function o(et,ut,Be){var Ie=et<0?"-":"",ke=(Ie?-et:et)+"",Fe=ke.length;return Ie+(Fe68?1900:2e3),Be+Ie[0].length):-1}function I(et,ut,Be){var Ie=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(ut.slice(Be,Be+6));return Ie?(et.Z=Ie[1]?0:-(Ie[2]+(Ie[3]||"00")),Be+Ie[0].length):-1}function T(et,ut,Be){var Ie=l.exec(ut.slice(Be,Be+1));return Ie?(et.q=Ie[0]*3-3,Be+Ie[0].length):-1}function E(et,ut,Be){var Ie=l.exec(ut.slice(Be,Be+2));return Ie?(et.m=Ie[0]-1,Be+Ie[0].length):-1}function _(et,ut,Be){var Ie=l.exec(ut.slice(Be,Be+2));return Ie?(et.d=+Ie[0],Be+Ie[0].length):-1}function h(et,ut,Be){var Ie=l.exec(ut.slice(Be,Be+3));return Ie?(et.m=0,et.d=+Ie[0],Be+Ie[0].length):-1}function m(et,ut,Be){var Ie=l.exec(ut.slice(Be,Be+2));return Ie?(et.H=+Ie[0],Be+Ie[0].length):-1}function w(et,ut,Be){var Ie=l.exec(ut.slice(Be,Be+2));return Ie?(et.M=+Ie[0],Be+Ie[0].length):-1}function F(et,ut,Be){var Ie=l.exec(ut.slice(Be,Be+2));return Ie?(et.S=+Ie[0],Be+Ie[0].length):-1}function z(et,ut,Be){var Ie=l.exec(ut.slice(Be,Be+3));return Ie?(et.L=+Ie[0],Be+Ie[0].length):-1}function U(et,ut,Be){var Ie=l.exec(ut.slice(Be,Be+6));return Ie?(et.L=Math.floor(Ie[0]/1e3),Be+Ie[0].length):-1}function V(et,ut,Be){var Ie=i.exec(ut.slice(Be,Be+1));return Ie?Be+Ie[0].length:-1}function G(et,ut,Be){var Ie=l.exec(ut.slice(Be));return Ie?(et.Q=+Ie[0],Be+Ie[0].length):-1}function j(et,ut,Be){var Ie=l.exec(ut.slice(Be));return Ie?(et.s=+Ie[0],Be+Ie[0].length):-1}function O(et,ut){return o(et.getDate(),ut,2)}function H(et,ut){return o(et.getHours(),ut,2)}function W(et,ut){return o(et.getHours()%12||12,ut,2)}function ee(et,ut){return o(1+S.timeDay.count(S.timeYear(et),et),ut,3)}function ue(et,ut){return o(et.getMilliseconds(),ut,3)}function xe(et,ut){return ue(et,ut)+"000"}function ge(et,ut){return o(et.getMonth()+1,ut,2)}function _e(et,ut){return o(et.getMinutes(),ut,2)}function Y(et,ut){return o(et.getSeconds(),ut,2)}function se(et){var ut=et.getDay();return ut===0?7:ut}function ce(et,ut){return o(S.timeSunday.count(S.timeYear(et)-1,et),ut,2)}function ne(et,ut){var Be=et.getDay();return et=Be>=4||Be===0?S.timeThursday(et):S.timeThursday.ceil(et),o(S.timeThursday.count(S.timeYear(et),et)+(S.timeYear(et).getDay()===4),ut,2)}function ye(et){return et.getDay()}function le(et,ut){return o(S.timeMonday.count(S.timeYear(et)-1,et),ut,2)}function Z(et,ut){return o(et.getFullYear()%100,ut,2)}function de(et,ut){return o(et.getFullYear()%1e4,ut,4)}function pe(et){var ut=et.getTimezoneOffset();return(ut>0?"-":(ut*=-1,"+"))+o(ut/60|0,"0",2)+o(ut%60,"0",2)}function Te(et,ut){return o(et.getUTCDate(),ut,2)}function Ne(et,ut){return o(et.getUTCHours(),ut,2)}function $e(et,ut){return o(et.getUTCHours()%12||12,ut,2)}function Ze(et,ut){return o(1+S.utcDay.count(S.utcYear(et),et),ut,3)}function Xe(et,ut){return o(et.getUTCMilliseconds(),ut,3)}function it(et,ut){return Xe(et,ut)+"000"}function yt(et,ut){return o(et.getUTCMonth()+1,ut,2)}function bt(et,ut){return o(et.getUTCMinutes(),ut,2)}function mt(et,ut){return o(et.getUTCSeconds(),ut,2)}function ht(et){var ut=et.getUTCDay();return ut===0?7:ut}function Ve(et,ut){return o(S.utcSunday.count(S.utcYear(et)-1,et),ut,2)}function ze(et,ut){var Be=et.getUTCDay();return et=Be>=4||Be===0?S.utcThursday(et):S.utcThursday.ceil(et),o(S.utcThursday.count(S.utcYear(et),et)+(S.utcYear(et).getUTCDay()===4),ut,2)}function Se(et){return et.getUTCDay()}function Je(et,ut){return o(S.utcMonday.count(S.utcYear(et)-1,et),ut,2)}function _t(et,ut){return o(et.getUTCFullYear()%100,ut,2)}function At(et,ut){return o(et.getUTCFullYear()%1e4,ut,4)}function vt(){return"+0000"}function Kt(){return"%"}function Qt(et){return+et}function fr(et){return Math.floor(+et/1e3)}var mr;Ur({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"]});function Ur(et){return mr=r(et),v.timeFormat=mr.format,v.timeParse=mr.parse,v.utcFormat=mr.utcFormat,v.utcParse=mr.utcParse,mr}var Br="%Y-%m-%dT%H:%M:%S.%LZ";function fn(et){return et.toISOString()}var Fr=Date.prototype.toISOString?fn:v.utcFormat(Br);function Qr(et){var ut=new Date(et);return isNaN(ut)?null:ut}var Bt=+new Date("2000-01-01T00:00:00.000Z")?Qr:v.utcParse(Br);v.isoFormat=Fr,v.isoParse=Bt,v.timeFormatDefaultLocale=Ur,v.timeFormatLocale=r,Object.defineProperty(v,"__esModule",{value:!0})})}}),Ma=Re({"node_modules/d3-format/dist/d3-format.js"(ae,K){(function(v,S){typeof ae=="object"&&typeof K<"u"?S(ae):(v=typeof globalThis<"u"?globalThis:v||self,S(v.d3=v.d3||{}))})(ae,function(v){function S(E){return Math.abs(E=Math.round(E))>=1e21?E.toLocaleString("en").replace(/,/g,""):E.toString(10)}function M(E,_){if((h=(E=_?E.toExponential(_-1):E.toExponential()).indexOf("e"))<0)return null;var h,m=E.slice(0,h);return[m.length>1?m[0]+m.slice(2):m,+E.slice(h+1)]}function L(E){return E=M(Math.abs(E)),E?E[1]:NaN}function t(E,_){return function(h,m){for(var w=h.length,F=[],z=0,U=E[0],V=0;w>0&&U>0&&(V+U+1>m&&(U=Math.max(1,m-V)),F.push(h.substring(w-=U,w+U)),!((V+=U+1)>m));)U=E[z=(z+1)%E.length];return F.reverse().join(_)}}function r(E){return function(_){return _.replace(/[0-9]/g,function(h){return E[+h]})}}var a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function l(E){if(!(_=a.exec(E)))throw new Error("invalid format: "+E);var _;return new i({fill:_[1],align:_[2],sign:_[3],symbol:_[4],zero:_[5],width:_[6],comma:_[7],precision:_[8]&&_[8].slice(1),trim:_[9],type:_[10]})}l.prototype=i.prototype;function i(E){this.fill=E.fill===void 0?" ":E.fill+"",this.align=E.align===void 0?">":E.align+"",this.sign=E.sign===void 0?"-":E.sign+"",this.symbol=E.symbol===void 0?"":E.symbol+"",this.zero=!!E.zero,this.width=E.width===void 0?void 0:+E.width,this.comma=!!E.comma,this.precision=E.precision===void 0?void 0:+E.precision,this.trim=!!E.trim,this.type=E.type===void 0?"":E.type+""}i.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function s(E){e:for(var _=E.length,h=1,m=-1,w;h<_;++h)switch(E[h]){case".":m=w=h;break;case"0":m===0&&(m=h),w=h;break;default:if(!+E[h])break e;m>0&&(m=0);break}return m>0?E.slice(0,m)+E.slice(w+1):E}var o;function c(E,_){var h=M(E,_);if(!h)return E+"";var m=h[0],w=h[1],F=w-(o=Math.max(-8,Math.min(8,Math.floor(w/3)))*3)+1,z=m.length;return F===z?m:F>z?m+new Array(F-z+1).join("0"):F>0?m.slice(0,F)+"."+m.slice(F):"0."+new Array(1-F).join("0")+M(E,Math.max(0,_+F-1))[0]}function p(E,_){var h=M(E,_);if(!h)return E+"";var m=h[0],w=h[1];return w<0?"0."+new Array(-w).join("0")+m:m.length>w+1?m.slice(0,w+1)+"."+m.slice(w+1):m+new Array(w-m.length+2).join("0")}var d={"%":function(E,_){return(E*100).toFixed(_)},b:function(E){return Math.round(E).toString(2)},c:function(E){return E+""},d:S,e:function(E,_){return E.toExponential(_)},f:function(E,_){return E.toFixed(_)},g:function(E,_){return E.toPrecision(_)},o:function(E){return Math.round(E).toString(8)},p:function(E,_){return p(E*100,_)},r:p,s:c,X:function(E){return Math.round(E).toString(16).toUpperCase()},x:function(E){return Math.round(E).toString(16)}};function y(E){return E}var g=Array.prototype.map,C=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function f(E){var _=E.grouping===void 0||E.thousands===void 0?y:t(g.call(E.grouping,Number),E.thousands+""),h=E.currency===void 0?"":E.currency[0]+"",m=E.currency===void 0?"":E.currency[1]+"",w=E.decimal===void 0?".":E.decimal+"",F=E.numerals===void 0?y:r(g.call(E.numerals,String)),z=E.percent===void 0?"%":E.percent+"",U=E.minus===void 0?"-":E.minus+"",V=E.nan===void 0?"NaN":E.nan+"";function G(O){O=l(O);var H=O.fill,W=O.align,ee=O.sign,ue=O.symbol,xe=O.zero,ge=O.width,_e=O.comma,Y=O.precision,se=O.trim,ce=O.type;ce==="n"?(_e=!0,ce="g"):d[ce]||(Y===void 0&&(Y=12),se=!0,ce="g"),(xe||H==="0"&&W==="=")&&(xe=!0,H="0",W="=");var ne=ue==="$"?h:ue==="#"&&/[boxX]/.test(ce)?"0"+ce.toLowerCase():"",ye=ue==="$"?m:/[%p]/.test(ce)?z:"",le=d[ce],Z=/[defgprs%]/.test(ce);Y=Y===void 0?6:/[gprs]/.test(ce)?Math.max(1,Math.min(21,Y)):Math.max(0,Math.min(20,Y));function de(pe){var Te=ne,Ne=ye,$e,Ze,Xe;if(ce==="c")Ne=le(pe)+Ne,pe="";else{pe=+pe;var it=pe<0||1/pe<0;if(pe=isNaN(pe)?V:le(Math.abs(pe),Y),se&&(pe=s(pe)),it&&+pe==0&&ee!=="+"&&(it=!1),Te=(it?ee==="("?ee:U:ee==="-"||ee==="("?"":ee)+Te,Ne=(ce==="s"?C[8+o/3]:"")+Ne+(it&&ee==="("?")":""),Z){for($e=-1,Ze=pe.length;++$eXe||Xe>57){Ne=(Xe===46?w+pe.slice($e+1):pe.slice($e))+Ne,pe=pe.slice(0,$e);break}}}_e&&!xe&&(pe=_(pe,1/0));var yt=Te.length+pe.length+Ne.length,bt=yt>1)+Te+pe+Ne+bt.slice(yt);break;default:pe=bt+Te+pe+Ne;break}return F(pe)}return de.toString=function(){return O+""},de}function j(O,H){var W=G((O=l(O),O.type="f",O)),ee=Math.max(-8,Math.min(8,Math.floor(L(H)/3)))*3,ue=Math.pow(10,-ee),xe=C[8+ee/3];return function(ge){return W(ue*ge)+xe}}return{format:G,formatPrefix:j}}var x;A({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function A(E){return x=f(E),v.format=x.format,v.formatPrefix=x.formatPrefix,x}function k(E){return Math.max(0,-L(Math.abs(E)))}function I(E,_){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(L(_)/3)))*3-L(Math.abs(E)))}function T(E,_){return E=Math.abs(E),_=Math.abs(_)-E,Math.max(0,L(_)-L(E))+1}v.FormatSpecifier=i,v.formatDefaultLocale=A,v.formatLocale=f,v.formatSpecifier=l,v.precisionFixed=k,v.precisionPrefix=I,v.precisionRound=T,Object.defineProperty(v,"__esModule",{value:!0})})}}),ui=Re({"node_modules/is-string-blank/index.js"(ae,K){K.exports=function(v){for(var S=v.length,M,L=0;L13)&&M!==32&&M!==133&&M!==160&&M!==5760&&M!==6158&&(M<8192||M>8205)&&M!==8232&&M!==8233&&M!==8239&&M!==8287&&M!==8288&&M!==12288&&M!==65279)return!1;return!0}}}),da=Re({"node_modules/fast-isnumeric/index.js"(ae,K){var v=ui();K.exports=function(S){var M=typeof S;if(M==="string"){var L=S;if(S=+S,S===0&&v(L))return!1}else if(M!=="number")return!1;return S-S<1}}}),Ia=Re({"src/constants/numerical.js"(ae,K){K.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,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,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}}),aa=Re({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(ae,K){(function(v,S){typeof ae=="object"&&typeof K<"u"?S(ae):(v=typeof globalThis<"u"?globalThis:v||self,S(v["base64-arraybuffer"]={}))})(ae,function(v){for(var S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",M=typeof Uint8Array>"u"?[]:new Uint8Array(256),L=0;L>2],o+=S[(l[i]&3)<<4|l[i+1]>>4],o+=S[(l[i+1]&15)<<2|l[i+2]>>6],o+=S[l[i+2]&63];return s%3===2?o=o.substring(0,o.length-1)+"=":s%3===1&&(o=o.substring(0,o.length-2)+"=="),o},r=function(a){var l=a.length*.75,i=a.length,s,o=0,c,p,d,y;a[a.length-1]==="="&&(l--,a[a.length-2]==="="&&l--);var g=new ArrayBuffer(l),C=new Uint8Array(g);for(s=0;s>4,C[o++]=(p&15)<<4|d>>2,C[o++]=(d&3)<<6|y&63;return g};v.decode=r,v.encode=t,Object.defineProperty(v,"__esModule",{value:!0})})}}),Ka=Re({"src/lib/is_plain_object.js"(ae,K){K.exports=function(S){return window&&window.process&&window.process.versions?Object.prototype.toString.call(S)==="[object Object]":Object.prototype.toString.call(S)==="[object Object]"&&Object.getPrototypeOf(S).hasOwnProperty("hasOwnProperty")}}}),ai=Re({"src/lib/array.js"(ae){var K=aa().decode,v=Ka(),S=Array.isArray,M=ArrayBuffer,L=DataView;function t(c){return M.isView(c)&&!(c instanceof L)}ae.isTypedArray=t;function r(c){return S(c)||t(c)}ae.isArrayOrTypedArray=r;function a(c){return!r(c[0])}ae.isArray1D=a,ae.ensureArray=function(c,p){return S(c)||(c=[]),c.length=p,c};var l={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};l.uint8c=l.u1c,l.uint8=l.u1,l.int8=l.i1,l.uint16=l.u2,l.int16=l.i2,l.uint32=l.u4,l.int32=l.i4,l.float32=l.f4,l.float64=l.f8;function i(c){return c.constructor===ArrayBuffer}ae.isArrayBuffer=i,ae.decodeTypedArraySpec=function(c){var p=[],d=s(c),y=d.dtype,g=l[y];if(!g)throw new Error('Error in dtype: "'+y+'"');var C=g.BYTES_PER_ELEMENT,f=d.bdata;i(f)||(f=K(f));var x=d.shape===void 0?[f.byteLength/C]:(""+d.shape).split(",");x.reverse();var A=x.length,k,I,T=+x[0],E=C*T,_=0;if(A===1)p=new g(f);else if(A===2)for(k=+x[1],I=0;I2)return g[k]=g[k]|t,x.set(A,null);if(f){for(p=k;p0)return Math.log(M)/Math.LN10;var t=Math.log(Math.min(L[0],L[1]))/Math.LN10;return v(t)||(t=Math.log(Math.max(L[0],L[1]))/Math.LN10-6),t}}}),ki=Re({"src/lib/relink_private.js"(ae,K){var v=ai().isArrayOrTypedArray,S=Ka();K.exports=function M(L,t){for(var r in t){var a=t[r],l=L[r];if(l!==a)if(r.charAt(0)==="_"||typeof a=="function"){if(r in L)continue;L[r]=a}else if(v(a)&&v(l)&&S(a[0])){if(r==="customdata"||r==="ids")continue;for(var i=Math.min(a.length,l.length),s=0;sL/2?M-Math.round(M/L)*L:M}K.exports={mod:v,modHalf:S}}}),oo=Re({"node_modules/tinycolor2/tinycolor.js"(ae,K){(function(v){var S=/^\s+/,M=/\s+$/,L=0,t=v.round,r=v.min,a=v.max,l=v.random;function i(Z,de){if(Z=Z||"",de=de||{},Z instanceof i)return Z;if(!(this instanceof i))return new i(Z,de);var pe=s(Z);this._originalInput=Z,this._r=pe.r,this._g=pe.g,this._b=pe.b,this._a=pe.a,this._roundA=t(100*this._a)/100,this._format=de.format||pe.format,this._gradientType=de.gradientType,this._r<1&&(this._r=t(this._r)),this._g<1&&(this._g=t(this._g)),this._b<1&&(this._b=t(this._b)),this._ok=pe.ok,this._tc_id=L++}i.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 Z=this.toRgb();return(Z.r*299+Z.g*587+Z.b*114)/1e3},getLuminance:function(){var Z=this.toRgb(),de,pe,Te,Ne,$e,Ze;return de=Z.r/255,pe=Z.g/255,Te=Z.b/255,de<=.03928?Ne=de/12.92:Ne=v.pow((de+.055)/1.055,2.4),pe<=.03928?$e=pe/12.92:$e=v.pow((pe+.055)/1.055,2.4),Te<=.03928?Ze=Te/12.92:Ze=v.pow((Te+.055)/1.055,2.4),.2126*Ne+.7152*$e+.0722*Ze},setAlpha:function(Z){return this._a=O(Z),this._roundA=t(100*this._a)/100,this},toHsv:function(){var Z=d(this._r,this._g,this._b);return{h:Z.h*360,s:Z.s,v:Z.v,a:this._a}},toHsvString:function(){var Z=d(this._r,this._g,this._b),de=t(Z.h*360),pe=t(Z.s*100),Te=t(Z.v*100);return this._a==1?"hsv("+de+", "+pe+"%, "+Te+"%)":"hsva("+de+", "+pe+"%, "+Te+"%, "+this._roundA+")"},toHsl:function(){var Z=c(this._r,this._g,this._b);return{h:Z.h*360,s:Z.s,l:Z.l,a:this._a}},toHslString:function(){var Z=c(this._r,this._g,this._b),de=t(Z.h*360),pe=t(Z.s*100),Te=t(Z.l*100);return this._a==1?"hsl("+de+", "+pe+"%, "+Te+"%)":"hsla("+de+", "+pe+"%, "+Te+"%, "+this._roundA+")"},toHex:function(Z){return g(this._r,this._g,this._b,Z)},toHexString:function(Z){return"#"+this.toHex(Z)},toHex8:function(Z){return C(this._r,this._g,this._b,this._a,Z)},toHex8String:function(Z){return"#"+this.toHex8(Z)},toRgb:function(){return{r:t(this._r),g:t(this._g),b:t(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+t(this._r)+", "+t(this._g)+", "+t(this._b)+")":"rgba("+t(this._r)+", "+t(this._g)+", "+t(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:t(H(this._r,255)*100)+"%",g:t(H(this._g,255)*100)+"%",b:t(H(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+t(H(this._r,255)*100)+"%, "+t(H(this._g,255)*100)+"%, "+t(H(this._b,255)*100)+"%)":"rgba("+t(H(this._r,255)*100)+"%, "+t(H(this._g,255)*100)+"%, "+t(H(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:G[g(this._r,this._g,this._b,!0)]||!1},toFilter:function(Z){var de="#"+f(this._r,this._g,this._b,this._a),pe=de,Te=this._gradientType?"GradientType = 1, ":"";if(Z){var Ne=i(Z);pe="#"+f(Ne._r,Ne._g,Ne._b,Ne._a)}return"progid:DXImageTransform.Microsoft.gradient("+Te+"startColorstr="+de+",endColorstr="+pe+")"},toString:function(Z){var de=!!Z;Z=Z||this._format;var pe=!1,Te=this._a<1&&this._a>=0,Ne=!de&&Te&&(Z==="hex"||Z==="hex6"||Z==="hex3"||Z==="hex4"||Z==="hex8"||Z==="name");return Ne?Z==="name"&&this._a===0?this.toName():this.toRgbString():(Z==="rgb"&&(pe=this.toRgbString()),Z==="prgb"&&(pe=this.toPercentageRgbString()),(Z==="hex"||Z==="hex6")&&(pe=this.toHexString()),Z==="hex3"&&(pe=this.toHexString(!0)),Z==="hex4"&&(pe=this.toHex8String(!0)),Z==="hex8"&&(pe=this.toHex8String()),Z==="name"&&(pe=this.toName()),Z==="hsl"&&(pe=this.toHslString()),Z==="hsv"&&(pe=this.toHsvString()),pe||this.toHexString())},clone:function(){return i(this.toString())},_applyModification:function(Z,de){var pe=Z.apply(null,[this].concat([].slice.call(de)));return this._r=pe._r,this._g=pe._g,this._b=pe._b,this.setAlpha(pe._a),this},lighten:function(){return this._applyModification(I,arguments)},brighten:function(){return this._applyModification(T,arguments)},darken:function(){return this._applyModification(E,arguments)},desaturate:function(){return this._applyModification(x,arguments)},saturate:function(){return this._applyModification(A,arguments)},greyscale:function(){return this._applyModification(k,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(Z,de){return Z.apply(null,[this].concat([].slice.call(de)))},analogous:function(){return this._applyCombination(z,arguments)},complement:function(){return this._applyCombination(h,arguments)},monochromatic:function(){return this._applyCombination(U,arguments)},splitcomplement:function(){return this._applyCombination(F,arguments)},triad:function(){return this._applyCombination(m,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},i.fromRatio=function(Z,de){if(typeof Z=="object"){var pe={};for(var Te in Z)Z.hasOwnProperty(Te)&&(Te==="a"?pe[Te]=Z[Te]:pe[Te]=_e(Z[Te]));Z=pe}return i(Z,de)};function s(Z){var de={r:0,g:0,b:0},pe=1,Te=null,Ne=null,$e=null,Ze=!1,Xe=!1;return typeof Z=="string"&&(Z=ye(Z)),typeof Z=="object"&&(ne(Z.r)&&ne(Z.g)&&ne(Z.b)?(de=o(Z.r,Z.g,Z.b),Ze=!0,Xe=String(Z.r).substr(-1)==="%"?"prgb":"rgb"):ne(Z.h)&&ne(Z.s)&&ne(Z.v)?(Te=_e(Z.s),Ne=_e(Z.v),de=y(Z.h,Te,Ne),Ze=!0,Xe="hsv"):ne(Z.h)&&ne(Z.s)&&ne(Z.l)&&(Te=_e(Z.s),$e=_e(Z.l),de=p(Z.h,Te,$e),Ze=!0,Xe="hsl"),Z.hasOwnProperty("a")&&(pe=Z.a)),pe=O(pe),{ok:Ze,format:Z.format||Xe,r:r(255,a(de.r,0)),g:r(255,a(de.g,0)),b:r(255,a(de.b,0)),a:pe}}function o(Z,de,pe){return{r:H(Z,255)*255,g:H(de,255)*255,b:H(pe,255)*255}}function c(Z,de,pe){Z=H(Z,255),de=H(de,255),pe=H(pe,255);var Te=a(Z,de,pe),Ne=r(Z,de,pe),$e,Ze,Xe=(Te+Ne)/2;if(Te==Ne)$e=Ze=0;else{var it=Te-Ne;switch(Ze=Xe>.5?it/(2-Te-Ne):it/(Te+Ne),Te){case Z:$e=(de-pe)/it+(de1&&(mt-=1),mt<1/6?yt+(bt-yt)*6*mt:mt<1/2?bt:mt<2/3?yt+(bt-yt)*(2/3-mt)*6:yt}if(de===0)Te=Ne=$e=pe;else{var Xe=pe<.5?pe*(1+de):pe+de-pe*de,it=2*pe-Xe;Te=Ze(it,Xe,Z+1/3),Ne=Ze(it,Xe,Z),$e=Ze(it,Xe,Z-1/3)}return{r:Te*255,g:Ne*255,b:$e*255}}function d(Z,de,pe){Z=H(Z,255),de=H(de,255),pe=H(pe,255);var Te=a(Z,de,pe),Ne=r(Z,de,pe),$e,Ze,Xe=Te,it=Te-Ne;if(Ze=Te===0?0:it/Te,Te==Ne)$e=0;else{switch(Te){case Z:$e=(de-pe)/it+(de>1)+720)%360;--de;)Te.h=(Te.h+Ne)%360,$e.push(i(Te));return $e}function U(Z,de){de=de||6;for(var pe=i(Z).toHsv(),Te=pe.h,Ne=pe.s,$e=pe.v,Ze=[],Xe=1/de;de--;)Ze.push(i({h:Te,s:Ne,v:$e})),$e=($e+Xe)%1;return Ze}i.mix=function(Z,de,pe){pe=pe===0?0:pe||50;var Te=i(Z).toRgb(),Ne=i(de).toRgb(),$e=pe/100,Ze={r:(Ne.r-Te.r)*$e+Te.r,g:(Ne.g-Te.g)*$e+Te.g,b:(Ne.b-Te.b)*$e+Te.b,a:(Ne.a-Te.a)*$e+Te.a};return i(Ze)},i.readability=function(Z,de){var pe=i(Z),Te=i(de);return(v.max(pe.getLuminance(),Te.getLuminance())+.05)/(v.min(pe.getLuminance(),Te.getLuminance())+.05)},i.isReadable=function(Z,de,pe){var Te=i.readability(Z,de),Ne,$e;switch($e=!1,Ne=le(pe),Ne.level+Ne.size){case"AAsmall":case"AAAlarge":$e=Te>=4.5;break;case"AAlarge":$e=Te>=3;break;case"AAAsmall":$e=Te>=7;break}return $e},i.mostReadable=function(Z,de,pe){var Te=null,Ne=0,$e,Ze,Xe,it;pe=pe||{},Ze=pe.includeFallbackColors,Xe=pe.level,it=pe.size;for(var yt=0;ytNe&&(Ne=$e,Te=i(de[yt]));return i.isReadable(Z,Te,{level:Xe,size:it})||!Ze?Te:(pe.includeFallbackColors=!1,i.mostReadable(Z,["#fff","#000"],pe))};var V=i.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"},G=i.hexNames=j(V);function j(Z){var de={};for(var pe in Z)Z.hasOwnProperty(pe)&&(de[Z[pe]]=pe);return de}function O(Z){return Z=parseFloat(Z),(isNaN(Z)||Z<0||Z>1)&&(Z=1),Z}function H(Z,de){ue(Z)&&(Z="100%");var pe=xe(Z);return Z=r(de,a(0,parseFloat(Z))),pe&&(Z=parseInt(Z*de,10)/100),v.abs(Z-de)<1e-6?1:Z%de/parseFloat(de)}function W(Z){return r(1,a(0,Z))}function ee(Z){return parseInt(Z,16)}function ue(Z){return typeof Z=="string"&&Z.indexOf(".")!=-1&&parseFloat(Z)===1}function xe(Z){return typeof Z=="string"&&Z.indexOf("%")!=-1}function ge(Z){return Z.length==1?"0"+Z:""+Z}function _e(Z){return Z<=1&&(Z=Z*100+"%"),Z}function Y(Z){return v.round(parseFloat(Z)*255).toString(16)}function se(Z){return ee(Z)/255}var ce=(function(){var Z="[-\\+]?\\d+%?",de="[-\\+]?\\d*\\.\\d+%?",pe="(?:"+de+")|(?:"+Z+")",Te="[\\s|\\(]+("+pe+")[,|\\s]+("+pe+")[,|\\s]+("+pe+")\\s*\\)?",Ne="[\\s|\\(]+("+pe+")[,|\\s]+("+pe+")[,|\\s]+("+pe+")[,|\\s]+("+pe+")\\s*\\)?";return{CSS_UNIT:new RegExp(pe),rgb:new RegExp("rgb"+Te),rgba:new RegExp("rgba"+Ne),hsl:new RegExp("hsl"+Te),hsla:new RegExp("hsla"+Ne),hsv:new RegExp("hsv"+Te),hsva:new RegExp("hsva"+Ne),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 ne(Z){return!!ce.CSS_UNIT.exec(Z)}function ye(Z){Z=Z.replace(S,"").replace(M,"").toLowerCase();var de=!1;if(V[Z])Z=V[Z],de=!0;else if(Z=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var pe;return(pe=ce.rgb.exec(Z))?{r:pe[1],g:pe[2],b:pe[3]}:(pe=ce.rgba.exec(Z))?{r:pe[1],g:pe[2],b:pe[3],a:pe[4]}:(pe=ce.hsl.exec(Z))?{h:pe[1],s:pe[2],l:pe[3]}:(pe=ce.hsla.exec(Z))?{h:pe[1],s:pe[2],l:pe[3],a:pe[4]}:(pe=ce.hsv.exec(Z))?{h:pe[1],s:pe[2],v:pe[3]}:(pe=ce.hsva.exec(Z))?{h:pe[1],s:pe[2],v:pe[3],a:pe[4]}:(pe=ce.hex8.exec(Z))?{r:ee(pe[1]),g:ee(pe[2]),b:ee(pe[3]),a:se(pe[4]),format:de?"name":"hex8"}:(pe=ce.hex6.exec(Z))?{r:ee(pe[1]),g:ee(pe[2]),b:ee(pe[3]),format:de?"name":"hex"}:(pe=ce.hex4.exec(Z))?{r:ee(pe[1]+""+pe[1]),g:ee(pe[2]+""+pe[2]),b:ee(pe[3]+""+pe[3]),a:se(pe[4]+""+pe[4]),format:de?"name":"hex8"}:(pe=ce.hex3.exec(Z))?{r:ee(pe[1]+""+pe[1]),g:ee(pe[2]+""+pe[2]),b:ee(pe[3]+""+pe[3]),format:de?"name":"hex"}:!1}function le(Z){var de,pe;return Z=Z||{level:"AA",size:"small"},de=(Z.level||"AA").toUpperCase(),pe=(Z.size||"small").toLowerCase(),de!=="AA"&&de!=="AAA"&&(de="AA"),pe!=="small"&&pe!=="large"&&(pe="small"),{level:de,size:pe}}typeof K<"u"&&K.exports?K.exports=i:window.tinycolor=i})(Math)}}),Li=Re({"src/lib/extend.js"(ae){var K=Ka(),v=Array.isArray;function S(L,t){var r,a;for(r=0;r=0)))return i;if(d===3)c[d]>1&&(c[d]=1);else if(c[d]>=1)return i}var y=Math.round(c[0]*255)+", "+Math.round(c[1]*255)+", "+Math.round(c[2]*255);return p?"rgba("+y+", "+c[3]+")":"rgb("+y+")"}}}),Ec=Re({"src/constants/interactions.js"(ae,K){K.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),Cc=Re({"src/lib/regex.js"(ae){ae.counter=function(K,v,S,M){var L=(v||"")+(S?"":"$"),t=M===!1?"":"^";return K==="xy"?new RegExp(t+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+L):new RegExp(t+K+"([2-9]|[1-9][0-9]+)?"+L)}}}),Ah=Re({"src/lib/coerce.js"(ae){var K=da(),v=oo(),S=Li().extendFlat,M=As(),L=nc(),t=ko(),r=Ec().DESELECTDIM,a=Ui(),l=Cc().counter,i=no().modHalf,s=ai().isArrayOrTypedArray,o=ai().isTypedArraySpec,c=ai().decodeTypedArraySpec;ae.valObjectMeta={data_array:{coerceFunction:function(d,y,g){y.set(s(d)?d:o(d)?c(d):g)}},enumerated:{coerceFunction:function(d,y,g,C){C.coerceNumber&&(d=+d),C.values.indexOf(d)===-1?y.set(g):y.set(d)},validateFunction:function(d,y){y.coerceNumber&&(d=+d);for(var g=y.values,C=0;Cx===!0||x===!1;f(d)||C.arrayOk&&Array.isArray(d)&&d.length>0&&d.every(f)?y.set(d):y.set(g)}},number:{coerceFunction:function(d,y,g,C){o(d)&&(d=c(d)),!K(d)||C.min!==void 0&&dC.max?y.set(g):y.set(+d)}},integer:{coerceFunction:function(d,y,g,C){if((C.extras||[]).indexOf(d)!==-1){y.set(d);return}o(d)&&(d=c(d)),d%1||!K(d)||C.min!==void 0&&dC.max?y.set(g):y.set(+d)}},string:{coerceFunction:function(d,y,g,C){if(typeof d!="string"){var f=typeof d=="number";C.strict===!0||!f?y.set(g):y.set(String(d))}else C.noBlank&&!d?y.set(g):y.set(d)}},color:{coerceFunction:function(d,y,g){o(d)&&(d=c(d)),v(d).isValid()?y.set(d):y.set(g)}},colorlist:{coerceFunction:function(d,y,g){function C(f){return v(f).isValid()}!Array.isArray(d)||!d.length?y.set(g):d.every(C)?y.set(d):y.set(g)}},colorscale:{coerceFunction:function(d,y,g){y.set(L.get(d,g))}},angle:{coerceFunction:function(d,y,g){o(d)&&(d=c(d)),d==="auto"?y.set("auto"):K(d)?y.set(i(+d,360)):y.set(g)}},subplotid:{coerceFunction:function(d,y,g,C){var f=C.regex||l(g);const x=A=>typeof A=="string"&&f.test(A);x(d)||C.arrayOk&&s(d)&&d.length>0&&d.every(x)?y.set(d):y.set(g)},validateFunction:function(d,y){var g=y.dflt;return d===g?!0:typeof d!="string"?!1:!!l(g).test(d)}},flaglist:{coerceFunction:function(d,y,g,C){if((C.extras||[]).indexOf(d)!==-1){y.set(d);return}if(typeof d!="string"){y.set(g);return}for(var f=d.split("+"),x=0;x/g),d=0;d1){var t=["LOG:"];for(L=0;L1){var r=[];for(L=0;L"),"long")}},M.warn=function(){var L;if(v.logging>0){var t=["WARN:"];for(L=0;L0){var r=[];for(L=0;L"),"stick")}},M.error=function(){var L;if(v.logging>0){var t=["ERROR:"];for(L=0;L0){var r=[];for(L=0;L"),"stick")}}}}),Vv=Re({"src/lib/noop.js"(ae,K){K.exports=function(){}}}),uv=Re({"src/lib/push_unique.js"(ae,K){K.exports=function(S,M){if(M instanceof RegExp){for(var L=M.toString(),t=0;txt({valType:"string",dflt:"",editType:L},t!==!1?{arrayOk:!0}:{}),ae.texttemplateAttrs=({editType:L="calc",arrayOk:t}={},r={})=>xt({valType:"string",dflt:"",editType:L},t!==!1?{arrayOk:!0}:{}),ae.shapeTexttemplateAttrs=({editType:L="arraydraw",newshape:t}={},r={})=>({valType:"string",dflt:"",editType:L}),ae.templatefallbackAttrs=({editType:L="none"}={})=>({valType:"any",dflt:"-",editType:L})}}),cv=Re({"src/components/shapes/label_texttemplate.js"(ae,K){function v(x,A){return A?A.d2l(x):x}function S(x,A){return A?A.l2d(x):x}function M(x){return x.x0}function L(x){return x.x1}function t(x){return x.y0}function r(x){return x.y1}function a(x){return x.x0shift||0}function l(x){return x.x1shift||0}function i(x){return x.y0shift||0}function s(x){return x.y1shift||0}function o(x,A){return v(x.x1,A)+l(x)-v(x.x0,A)-a(x)}function c(x,A,k){return v(x.y1,k)+s(x)-v(x.y0,k)-i(x)}function p(x,A){return Math.abs(o(x,A))}function d(x,A,k){return Math.abs(c(x,A,k))}function y(x,A,k){return x.type!=="line"?void 0:Math.sqrt(Math.pow(o(x,A),2)+Math.pow(c(x,A,k),2))}function g(x,A){return S((v(x.x1,A)+l(x)+v(x.x0,A)+a(x))/2,A)}function C(x,A,k){return S((v(x.y1,k)+s(x)+v(x.y0,k)+i(x))/2,k)}function f(x,A,k){return x.type!=="line"?void 0:c(x,A,k)/o(x,A)}K.exports={x0:M,x1:L,y0:t,y1:r,slope:f,dx:o,dy:c,width:p,height:d,length:y,xcenter:g,ycenter:C}}}),P_=Re({"src/components/shapes/draw_newshape/attributes.js"(ae,K){var v=bf().overrideAll,S=As(),M=Do(),L=up().dash,t=Li().extendFlat,{shapeTexttemplateAttrs:r,templatefallbackAttrs:a}=Wl(),l=cv();K.exports=v({newshape:{visible:t({},S.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:t({},S.legend,{}),legendgroup:t({},S.legendgroup,{}),legendgrouptitle:{text:t({},S.legendgrouptitle.text,{}),font:M({})},legendrank:t({},S.legendrank,{}),legendwidth:t({},S.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:t({},L,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:t({},S.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:r({newshape:!0},{keys:Object.keys(l)}),texttemplatefallback:a({editType:"arraydraw"}),font:M({}),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"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),aS=Re({"src/components/selections/draw_newselection/attributes.js"(ae,K){var v=up().dash,S=Li().extendFlat;K.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:S({},v,{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"}}}}),iS=Re({"src/plots/pad_attributes.js"(ae,K){K.exports=function(v){var S=v.editType;return{t:{valType:"number",dflt:0,editType:S},r:{valType:"number",dflt:0,editType:S},b:{valType:"number",dflt:0,editType:S},l:{valType:"number",dflt:0,editType:S},editType:S}}}}),kb=Re({"src/plots/layout_attributes.js"(ae,K){var v=Do(),S=D_(),M=du(),L=P_(),t=aS(),r=iS(),a=Li().extendFlat,l=v({editType:"calc"});l.family.dflt='"Open Sans", verdana, arial, sans-serif',l.size.dflt=12,l.color.dflt=M.defaultLine,K.exports={font:l,title:{text:{valType:"string",editType:"layoutstyle"},font:v({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:v({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:a(r({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:M.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:M.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:M.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:L.newshape,activeshape:L.activeshape,newselection:t.newselection,activeselection:t.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:a({},S.transition,{editType:"none"})}}}),Lk=Re({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){(function(){if(!document.getElementById("696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97")){var ae=document.createElement("style");ae.id="696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97",ae.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(ae)}})()}}),es=Re({"src/registry.js"(ae){var K=eh(),v=Vv(),S=uv(),M=Ka(),L=R_().addStyleRule,t=Li(),r=As(),a=kb(),l=t.extendFlat,i=t.extendDeepAll;ae.modules={},ae.allCategories={},ae.allTypes=[],ae.subplotsRegistry={},ae.componentsRegistry={},ae.layoutArrayContainers=[],ae.layoutArrayRegexes=[],ae.traceLayoutAttributes={},ae.localeRegistry={},ae.apiMethodRegistry={},ae.collectableSubplotTypes=null,ae.register=function(A){if(ae.collectableSubplotTypes=null,A)A&&!Array.isArray(A)&&(A=[A]);else throw new Error("No argument passed to Plotly.register.");for(var k=0;k=f&&V<=x?V:t}if(typeof V!="string"&&typeof V!="number")return t;V=String(V);var W=g(G),ee=V.charAt(0);W&&(ee==="G"||ee==="g")&&(V=V.slice(1),G="");var ue=W&&G.slice(0,7)==="chinese",xe=V.match(ue?d:p);if(!xe)return t;var ge=xe[1],_e=xe[3]||"1",Y=Number(xe[5]||1),se=Number(xe[7]||0),ce=Number(xe[9]||0),ne=Number(xe[11]||0);if(W){if(ge.length===2)return t;ge=Number(ge);var ye;try{var le=o.getComponentMethod("calendars","getCal")(G);if(ue){var Z=_e.charAt(_e.length-1)==="i";_e=parseInt(_e,10),ye=le.newDate(ge,le.toMonthIndex(ge,_e,Z),Y)}else ye=le.newDate(ge,Number(_e),Y)}catch{return t}return ye?(ye.toJD()-s)*r+se*a+ce*l+ne*i:t}ge.length===2?ge=(Number(ge)+2e3-y)%100+y:ge=Number(ge),_e-=1;var de=new Date(Date.UTC(2e3,_e,Y,se,ce));return de.setUTCFullYear(ge),de.getUTCMonth()!==_e||de.getUTCDate()!==Y?t:de.getTime()+ne*i},f=ae.MIN_MS=ae.dateTime2ms("-9999"),x=ae.MAX_MS=ae.dateTime2ms("9999-12-31 23:59:59.9999"),ae.isDateTime=function(V,G){return ae.dateTime2ms(V,G)!==t};function A(V,G){return String(V+Math.pow(10,G)).slice(1)}var k=90*r,I=3*a,T=5*l;ae.ms2DateTime=function(V,G,j){if(typeof V!="number"||!(V>=f&&V<=x))return t;G||(G=0);var O=Math.floor(M(V+.05,1)*10),H=Math.round(V-O/10),W,ee,ue,xe,ge,_e;if(g(j)){var Y=Math.floor(H/r)+s,se=Math.floor(M(V,r));try{W=o.getComponentMethod("calendars","getCal")(j).fromJD(Y).formatDate("yyyy-mm-dd")}catch{W=c("G%Y-%m-%d")(new Date(H))}if(W.charAt(0)==="-")for(;W.length<11;)W="-0"+W.slice(1);else for(;W.length<10;)W="0"+W;ee=G=f+r&&V<=x-r))return t;var G=Math.floor(M(V+.05,1)*10),j=new Date(Math.round(V-G/10)),O=K("%Y-%m-%d")(j),H=j.getHours(),W=j.getMinutes(),ee=j.getSeconds(),ue=j.getUTCMilliseconds()*10+G;return E(O,H,W,ee,ue)};function E(V,G,j,O,H){if((G||j||O||H)&&(V+=" "+A(G,2)+":"+A(j,2),(O||H)&&(V+=":"+A(O,2),H))){for(var W=4;H%10===0;)W-=1,H/=10;V+="."+A(H,W)}return V}ae.cleanDate=function(V,G,j){if(V===t)return G;if(ae.isJSDate(V)||typeof V=="number"&&isFinite(V)){if(g(j))return S.error("JS Dates and milliseconds are incompatible with world calendars",V),G;if(V=ae.ms2DateTimeLocal(+V),!V&&G!==void 0)return G}else if(!ae.isDateTime(V,j))return S.error("unrecognized date",V),G;return V};var _=/%\d?f/g,h=/%h/g,m={1:"1",2:"1",3:"2",4:"2"};function w(V,G,j,O){V=V.replace(_,function(W){var ee=Math.min(+W.charAt(1)||6,6),ue=(G/1e3%1+2).toFixed(ee).slice(2).replace(/0+$/,"")||"0";return ue});var H=new Date(Math.floor(G+.05));if(V=V.replace(h,function(){return m[j("%q")(H)]}),g(O))try{V=o.getComponentMethod("calendars","worldCalFmt")(V,G,O)}catch{return"Invalid"}return j(V)(H)}var F=[59,59.9,59.99,59.999,59.9999];function z(V,G){var j=M(V+.05,r),O=A(Math.floor(j/a),2)+":"+A(M(Math.floor(j/l),60),2);if(G!=="M"){v(G)||(G=0);var H=Math.min(M(V/i,60),F[G]),W=(100+H).toFixed(G).slice(1);G>0&&(W=W.replace(/0+$/,"").replace(/[\.]$/,"")),O+=":"+W}return O}ae.formatDate=function(V,G,j,O,H,W){if(H=g(H)&&H,!G)if(j==="y")G=W.year;else if(j==="m")G=W.month;else if(j==="d")G=W.dayMonth+` +`+W.year;else return z(V,j)+` +`+w(W.dayMonthYear,V,O,H);return w(G,V,O,H)};var U=3*r;ae.incrementMonth=function(V,G,j){j=g(j)&&j;var O=M(V,r);if(V=Math.round(V-O),j)try{var H=Math.round(V/r)+s,W=o.getComponentMethod("calendars","getCal")(j),ee=W.fromJD(H);return G%12?W.add(ee,G,"m"):W.add(ee,G/12,"y"),(ee.toJD()-s)*r+O}catch{S.error("invalid ms "+V+" in calendar "+j)}var ue=new Date(V+U);return ue.setUTCMonth(ue.getUTCMonth()+G)+O-U},ae.findExactDates=function(V,G){for(var j=0,O=0,H=0,W=0,ee,ue,xe=g(G)&&o.getComponentMethod("calendars","getCal")(G),ge=0;ge1?(s[p-1]-s[0])/(p-1):1,g,C;for(y>=0?C=o?t:r:C=o?l:a,i+=y*L*(o?-1:1)*(y>=0?1:-1);c90&&v.log("Long binary search..."),c-1};function t(i,s){return is}function l(i,s){return i>=s}ae.sorterAsc=function(i,s){return i-s},ae.sorterDes=function(i,s){return s-i},ae.distinctVals=function(i){var s=i.slice();s.sort(ae.sorterAsc);var o;for(o=s.length-1;o>-1&&s[o]===M;o--);for(var c=s[o]-s[0]||1,p=c/(o||1)/1e4,d=[],y,g=0;g<=o;g++){var C=s[g],f=C-y;y===void 0?(d.push(C),y=C):f>p&&(c=Math.min(c,f),d.push(C),y=C)}return{vals:d,minDiff:c}},ae.roundUp=function(i,s,o){for(var c=0,p=s.length-1,d,y=0,g=o?0:1,C=o?1:0,f=o?Math.ceil:Math.floor;c0&&(c=1),o&&c)return i.sort(s)}return c?i:i.reverse()},ae.findIndexOfMin=function(i,s){s=s||S;for(var o=1/0,c,p=0;pL.length)&&(t=L.length),K(M)||(M=!1),v(L[0])){for(a=new Array(t),r=0;rS.length-1)return S[S.length-1];var L=M%1;return L*S[Math.ceil(M)]+(1-L)*S[Math.floor(M)]}}}),Ip=Re({"src/lib/angles.js"(ae,K){var v=no(),S=v.mod,M=v.modHalf,L=Math.PI,t=2*L;function r(C){return C/180*L}function a(C){return C/L*180}function l(C){return Math.abs(C[1]-C[0])>t-1e-14}function i(C,f){return M(f-C,t)}function s(C,f){return Math.abs(i(C,f))}function o(C,f){if(l(f))return!0;var x,A;f[0]A&&(A+=t);var k=S(C,t),I=k+t;return k>=x&&k<=A||I>=x&&I<=A}function c(C,f,x,A){if(!o(f,A))return!1;var k,I;return x[0]=k&&C<=I}function p(C,f,x,A,k,I,T){k=k||0,I=I||0;var E=l([x,A]),_,h,m,w,F;E?(_=0,h=L,m=t):x1/3&&v.x<2/3},ae.isRightAnchor=function(v){return v.xanchor==="right"||v.xanchor==="auto"&&v.x>=2/3},ae.isTopAnchor=function(v){return v.yanchor==="top"||v.yanchor==="auto"&&v.y>=2/3},ae.isMiddleAnchor=function(v){return v.yanchor==="middle"||v.yanchor==="auto"&&v.y>1/3&&v.y<2/3},ae.isBottomAnchor=function(v){return v.yanchor==="bottom"||v.yanchor==="auto"&&v.y<=1/3}}}),Dk=Re({"src/lib/geometry2d.js"(ae){var K=no().mod;ae.segmentsIntersect=v;function v(r,a,l,i,s,o,c,p){var d=l-r,y=s-r,g=c-s,C=i-a,f=o-a,x=p-o,A=d*x-g*C;if(A===0)return null;var k=(y*x-g*f)/A,I=(y*C-d*f)/A;return I<0||I>1||k<0||k>1?null:{x:r+d*k,y:a+C*k}}ae.segmentDistance=function(a,l,i,s,o,c,p,d){if(v(a,l,i,s,o,c,p,d))return 0;var y=i-a,g=s-l,C=p-o,f=d-c,x=y*y+g*g,A=C*C+f*f,k=Math.min(S(y,g,x,o-a,c-l),S(y,g,x,p-a,d-l),S(C,f,A,a-o,l-c),S(C,f,A,i-o,s-c));return Math.sqrt(k)};function S(r,a,l,i,s){var o=i*r+s*a;if(o<0)return i*i+s*s;if(o>l){var c=i-r,p=s-a;return c*c+p*p}else{var d=i*a-s*r;return d*d/l}}var M,L,t;ae.getTextLocation=function(a,l,i,s){if((a!==L||s!==t)&&(M={},L=a,t=s),M[i])return M[i];var o=a.getPointAtLength(K(i-s/2,l)),c=a.getPointAtLength(K(i+s/2,l)),p=Math.atan((c.y-o.y)/(c.x-o.x)),d=a.getPointAtLength(K(i,l)),y=(d.x*4+o.x+c.x)/6,g=(d.y*4+o.y+c.y)/6,C={x:y,y:g,theta:p};return M[i]=C,C},ae.clearLocationCache=function(){L=null},ae.getVisibleSegment=function(a,l,i){var s=l.left,o=l.right,c=l.top,p=l.bottom,d=0,y=a.getTotalLength(),g=y,C,f;function x(k){var I=a.getPointAtLength(k);k===0?C=I:k===y&&(f=I);var T=I.xo?I.x-o:0,E=I.yp?I.y-p:0;return Math.sqrt(T*T+E*E)}for(var A=x(d);A;){if(d+=A+i,d>g)return;A=x(d)}for(A=x(g);A;){if(g-=A+i,d>g)return;A=x(g)}return{min:d,max:g,len:g-d,total:y,isClosed:d===0&&g===y&&Math.abs(C.x-f.x)<.1&&Math.abs(C.y-f.y)<.1}},ae.findPointOnPath=function(a,l,i,s){s=s||{};for(var o=s.pathLength||a.getTotalLength(),c=s.tolerance||.001,p=s.iterationLimit||30,d=a.getPointAtLength(0)[i]>a.getPointAtLength(o)[i]?-1:1,y=0,g=0,C=o,f,x,A;y0?C=f:g=f,y++}return x}}}),k0=Re({"src/lib/throttle.js"(ae){var K={};ae.throttle=function(M,L,t){var r=K[M],a=Date.now();if(!r){for(var l in K)K[l].tsr.ts+L){i();return}r.timer=setTimeout(function(){i(),r.timer=null},L)},ae.done=function(S){var M=K[S];return!M||!M.timer?Promise.resolve():new Promise(function(L){var t=M.onDone;M.onDone=function(){t&&t(),L(),M.onDone=null}})},ae.clear=function(S){if(S)v(K[S]),delete K[S];else for(var M in K)ae.clear(M)};function v(S){S&&S.timer!==null&&(clearTimeout(S.timer),S.timer=null)}}}),N_=Re({"src/lib/clear_responsive.js"(ae,K){K.exports=function(S){S._responsiveChartHandler&&(window.removeEventListener("resize",S._responsiveChartHandler),delete S._responsiveChartHandler)}}}),CD=Re({"node_modules/is-mobile/index.js"(ae,K){K.exports=L,K.exports.isMobile=L,K.exports.default=L;var v=/(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,S=/CrOS/,M=/android|ipad|playbook|silk/i;function L(t){t||(t={});let r=t.ua;if(!r&&typeof navigator<"u"&&(r=navigator.userAgent),r&&r.headers&&typeof r.headers["user-agent"]=="string"&&(r=r.headers["user-agent"]),typeof r!="string")return!1;let a=v.test(r)&&!S.test(r)||!!t.tablet&&M.test(r);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&r.indexOf("Macintosh")!==-1&&r.indexOf("Safari")!==-1&&(a=!0),a}}}),Pk=Re({"src/lib/preserve_drawing_buffer.js"(ae,K){var v=da(),S=CD();K.exports=function(t){var r;if(t&&t.hasOwnProperty("userAgent")?r=t.userAgent:r=M(),typeof r!="string")return!0;var a=S({ua:{headers:{"user-agent":r}},tablet:!0,featureDetect:!1});if(!a)for(var l=r.split(" "),i=1;i-1;o--){var c=l[o];if(c.slice(0,8)==="Version/"){var p=c.slice(8).split(".")[0];if(v(p)&&(p=+p),p>=13)return!0}}}return a};function M(){var L;return typeof navigator<"u"&&(L=navigator.userAgent),L&&L.headers&&typeof L.headers["user-agent"]=="string"&&(L=L.headers["user-agent"]),L}}}),zk=Re({"src/lib/make_trace_groups.js"(ae,K){var v=un();K.exports=function(M,L,t){var r=M.selectAll("g."+t.replace(/\s/g,".")).data(L,function(l){return l[0].trace.uid});r.exit().remove(),r.enter().append("g").attr("class",t),r.order();var a=M.classed("rangeplot")?"nodeRangePlot3":"node3";return r.each(function(l){l[0][a]=v.select(this)}),r}}}),kD=Re({"src/lib/localize.js"(ae,K){var v=es();K.exports=function(M,L){for(var t=M._context.locale,r=0;r<2;r++){for(var a=M._context.locales,l=0;l<2;l++){var i=(a[t]||{}).dictionary;if(i){var s=i[L];if(s)return s}a=v.localeRegistry}var o=t.split("-")[0];if(o===t)break;t=o}return L}}}),Mb=Re({"src/lib/filter_unique.js"(ae,K){K.exports=function(S){for(var M={},L=[],t=0,r=0;r1?(L*S+L*M)/L:S+M,r=String(t).length;if(r>16){var a=String(M).length,l=String(S).length;if(r>=l+a){var i=parseFloat(t).toPrecision(12);i.indexOf("e+")===-1&&(t=+i)}}return t}}}),jm=Re({"src/lib/clean_number.js"(ae,K){var v=da(),S=Ia().BADNUM,M=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;K.exports=function(t){return typeof t=="string"&&(t=t.replace(M,"")),v(t)?Number(t):S}}}),Rn=Re({"src/lib/index.js"(ae,K){var v=un(),S=Kr().utcFormat,M=Ma().format,L=da(),t=Ia(),r=t.FP_SAFE,a=-r,l=t.BADNUM,i=K.exports={};i.adjustFormat=function(Z){return!Z||/^\d[.]\df/.test(Z)||/[.]\d%/.test(Z)?Z:Z==="0.f"?"~f":/^\d%/.test(Z)?"~%":/^\ds/.test(Z)?"~s":!/^[~,.0$]/.test(Z)&&/[&fps]/.test(Z)?"~"+Z:Z};var s={};i.warnBadFormat=function(le){var Z=String(le);s[Z]||(s[Z]=1,i.warn('encountered bad format: "'+Z+'"'))},i.noFormat=function(le){return String(le)},i.numberFormat=function(le){var Z;try{Z=M(i.adjustFormat(le))}catch{return i.warnBadFormat(le),i.noFormat}return Z},i.nestedProperty=Ui(),i.keyedContainer=$i(),i.relativeAttr=Hn(),i.isPlainObject=Ka(),i.toLogRange=qa(),i.relinkPrivateKeys=ki();var o=ai();i.isArrayBuffer=o.isArrayBuffer,i.isTypedArray=o.isTypedArray,i.isArrayOrTypedArray=o.isArrayOrTypedArray,i.isArray1D=o.isArray1D,i.ensureArray=o.ensureArray,i.concat=o.concat,i.maxRowLength=o.maxRowLength,i.minRowLength=o.minRowLength;var c=no();i.mod=c.mod,i.modHalf=c.modHalf;var p=Ah();i.valObjectMeta=p.valObjectMeta,i.coerce=p.coerce,i.coerce2=p.coerce2,i.coerceFont=p.coerceFont,i.coercePattern=p.coercePattern,i.coerceHoverinfo=p.coerceHoverinfo,i.coerceSelectionMarkerOpacity=p.coerceSelectionMarkerOpacity,i.validate=p.validate;var d=oS();i.dateTime2ms=d.dateTime2ms,i.isDateTime=d.isDateTime,i.ms2DateTime=d.ms2DateTime,i.ms2DateTimeLocal=d.ms2DateTimeLocal,i.cleanDate=d.cleanDate,i.isJSDate=d.isJSDate,i.formatDate=d.formatDate,i.incrementMonth=d.incrementMonth,i.dateTick0=d.dateTick0,i.dfltRange=d.dfltRange,i.findExactDates=d.findExactDates,i.MIN_MS=d.MIN_MS,i.MAX_MS=d.MAX_MS;var y=fy();i.findBin=y.findBin,i.sorterAsc=y.sorterAsc,i.sorterDes=y.sorterDes,i.distinctVals=y.distinctVals,i.roundUp=y.roundUp,i.sort=y.sort,i.findIndexOfMin=y.findIndexOfMin,i.sortObjectKeys=hg();var g=z_();i.aggNums=g.aggNums,i.len=g.len,i.mean=g.mean,i.geometricMean=g.geometricMean,i.median=g.median,i.midRange=g.midRange,i.variance=g.variance,i.stdev=g.stdev,i.interp=g.interp;var C=H2();i.init2dArray=C.init2dArray,i.transposeRagged=C.transposeRagged,i.dot=C.dot,i.translationMatrix=C.translationMatrix,i.rotationMatrix=C.rotationMatrix,i.rotationXYMatrix=C.rotationXYMatrix,i.apply3DTransform=C.apply3DTransform,i.apply2DTransform=C.apply2DTransform,i.apply2DTransform2=C.apply2DTransform2,i.convertCssMatrix=C.convertCssMatrix,i.inverseTransformMatrix=C.inverseTransformMatrix;var f=Ip();i.deg2rad=f.deg2rad,i.rad2deg=f.rad2deg,i.angleDelta=f.angleDelta,i.angleDist=f.angleDist,i.isFullCircle=f.isFullCircle,i.isAngleInsideSector=f.isAngleInsideSector,i.isPtInsideSector=f.isPtInsideSector,i.pathArc=f.pathArc,i.pathSector=f.pathSector,i.pathAnnulus=f.pathAnnulus;var x=Rk();i.isLeftAnchor=x.isLeftAnchor,i.isCenterAnchor=x.isCenterAnchor,i.isRightAnchor=x.isRightAnchor,i.isTopAnchor=x.isTopAnchor,i.isMiddleAnchor=x.isMiddleAnchor,i.isBottomAnchor=x.isBottomAnchor;var A=Dk();i.segmentsIntersect=A.segmentsIntersect,i.segmentDistance=A.segmentDistance,i.getTextLocation=A.getTextLocation,i.clearLocationCache=A.clearLocationCache,i.getVisibleSegment=A.getVisibleSegment,i.findPointOnPath=A.findPointOnPath;var k=Li();i.extendFlat=k.extendFlat,i.extendDeep=k.extendDeep,i.extendDeepAll=k.extendDeepAll,i.extendDeepNoArrays=k.extendDeepNoArrays;var I=eh();i.log=I.log,i.warn=I.warn,i.error=I.error;var T=Cc();i.counterRegex=T.counter;var E=k0();i.throttle=E.throttle,i.throttleDone=E.done,i.clearThrottle=E.clear;var _=R_();i.getGraphDiv=_.getGraphDiv,i.isPlotDiv=_.isPlotDiv,i.removeElement=_.removeElement,i.addStyleRule=_.addStyleRule,i.addRelatedStyleRule=_.addRelatedStyleRule,i.deleteRelatedStyleRule=_.deleteRelatedStyleRule,i.setStyleOnHover=_.setStyleOnHover,i.getFullTransformMatrix=_.getFullTransformMatrix,i.getElementTransformMatrix=_.getElementTransformMatrix,i.getElementAndAncestors=_.getElementAndAncestors,i.equalDomRects=_.equalDomRects,i.clearResponsive=N_(),i.preserveDrawingBuffer=Pk(),i.makeTraceGroups=zk(),i._=kD(),i.notifier=$v(),i.filterUnique=Mb(),i.filterVisible=W2(),i.pushUnique=uv(),i.increment=M0(),i.cleanNumber=jm(),i.ensureNumber=function(Z){return L(Z)?(Z=Number(Z),Z>r||Z=Z?!1:L(le)&&le>=0&&le%1===0},i.noop=Vv(),i.identity=C0(),i.repeat=function(le,Z){for(var de=new Array(Z),pe=0;pede?Math.max(de,Math.min(Z,le)):Math.max(Z,Math.min(de,le))},i.bBoxIntersect=function(le,Z,de){return de=de||0,le.left<=Z.right+de&&Z.left<=le.right+de&&le.top<=Z.bottom+de&&Z.top<=le.bottom+de},i.simpleMap=function(le,Z,de,pe,Te){for(var Ne=le.length,$e=new Array(Ne),Ze=0;Ze=Math.pow(2,de)?Te>10?(i.warn("randstr failed uniqueness"),$e):le(Z,de,pe,(Te||0)+1):$e},i.OptionControl=function(le,Z){le||(le={}),Z||(Z="opt");var de={};return de.optionList=[],de._newoption=function(pe){pe[Z]=le,de[pe.name]=pe,de.optionList.push(pe)},de["_"+Z]=le,de},i.smooth=function(le,Z){if(Z=Math.round(Z)||0,Z<2)return le;var de=le.length,pe=2*de,Te=2*Z-1,Ne=new Array(Te),$e=new Array(de),Ze,Xe,it,yt;for(Ze=0;Ze=pe&&(it-=pe*Math.floor(it/pe)),it<0?it=-1-it:it>=de&&(it=pe-1-it),yt+=le[it]*Ne[Xe];$e[Ze]=yt}return $e},i.syncOrAsync=function(le,Z,de){var pe,Te;function Ne(){return i.syncOrAsync(le,Z,de)}for(;le.length;)if(Te=le.splice(0,1)[0],pe=Te(Z),pe&&pe.then)return pe.then(Ne);return de&&de(Z)},i.stripTrailingSlash=function(le){return le.slice(-1)==="/"?le.slice(0,-1):le},i.noneOrAll=function(le,Z,de){if(le){var pe=!1,Te=!0,Ne,$e;for(Ne=0;Ne0?Te:0})},i.fillArray=function(le,Z,de,pe){if(pe=pe||i.identity,i.isArrayOrTypedArray(le))for(var Te=0;Tez.test(window.navigator.userAgent);var U=/Firefox\/(\d+)\.\d+/;i.getFirefoxVersion=function(){var le=U.exec(window.navigator.userAgent);if(le&&le.length===2){var Z=parseInt(le[1]);if(!isNaN(Z))return Z}return null},i.isD3Selection=function(le){return le instanceof v.selection},i.ensureSingle=function(le,Z,de,pe){var Te=le.select(Z+(de?"."+de:""));if(Te.size())return Te;var Ne=le.append(Z);return de&&Ne.classed(de,!0),pe&&Ne.call(pe),Ne},i.ensureSingleById=function(le,Z,de,pe){var Te=le.select(Z+"#"+de);if(Te.size())return Te;var Ne=le.append(Z).attr("id",de);return pe&&Ne.call(pe),Ne},i.objectFromPath=function(le,Z){for(var de=le.split("."),pe,Te=pe={},Ne=0;Ne1?Te+$e[1]:"";if(Ne&&($e.length>1||Ze.length>4||de))for(;pe.test(Ze);)Ze=Ze.replace(pe,"$1"+Ne+"$2");return Ze+Xe},i.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var O=/^\w*$/;i.templateString=function(le,Z){var de={};return le.replace(i.TEMPLATE_STRING_REGEX,function(pe,Te){var Ne;return O.test(Te)?Ne=Z[Te]:(de[Te]=de[Te]||i.nestedProperty(Z,Te).get,Ne=de[Te](!0)),Ne!==void 0?Ne:""})};var H={max:10,count:0,name:"hovertemplate"};i.hovertemplateString=le=>_e(zt(xt({},le),{opts:H}));var W={max:10,count:0,name:"texttemplate"};i.texttemplateString=le=>_e(zt(xt({},le),{opts:W}));var ee=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function ue(le){var Z=le.match(ee);return Z?{key:Z[1],op:Z[2],number:Number(Z[3])}:{key:le,op:null,number:null}}var xe={max:10,count:0,name:"texttemplate",parseMultDiv:!0};i.texttemplateStringForShapes=le=>_e(zt(xt({},le),{opts:xe}));var ge=/^[:|\|]/;function _e({data:le=[],locale:Z,fallback:de,labels:pe={},opts:Te,template:Ne}){return Ne.replace(i.TEMPLATE_STRING_REGEX,($e,Ze,Xe)=>{const it=["xother","yother"].includes(Ze),yt=["_xother","_yother"].includes(Ze),bt=["_xother_","_yother_"].includes(Ze),mt=["xother_","yother_"].includes(Ze),ht=it||yt||mt||bt;(yt||bt)&&(Ze=Ze.substring(1)),(mt||bt)&&(Ze=Ze.substring(0,Ze.length-1));let Ve=null,ze=null;if(Te.parseMultDiv){var Se=ue(Ze);Ze=Se.key,Ve=Se.op,ze=Se.number}let Je;if(ht){if(pe[Ze]===void 0)return"";Je=pe[Ze]}else for(const Kt of le)if(Kt){if(Kt.hasOwnProperty(Ze)){Je=Kt[Ze];break}if(O.test(Ze)||(Je=i.nestedProperty(Kt,Ze).get(!0)),Je!==void 0)break}if(Je===void 0){const{count:Kt,max:Qt,name:fr}=Te,mr=de===!1?$e:de;return Kt=Y&&$e<=se,it=Ze>=Y&&Ze<=se;if(Xe&&(pe=10*pe+$e-Y),it&&(Te=10*Te+Ze-Y),!Xe||!it){if(pe!==Te)return pe-Te;if($e!==Ze)return $e-Ze}}return Te-pe};var ce=2e9;i.seedPseudoRandom=function(){ce=2e9},i.pseudoRandom=function(){var le=ce;return ce=(69069*ce+1)%4294967296,Math.abs(ce-le)<429496729?i.pseudoRandom():ce/4294967296},i.fillText=function(le,Z,de){var pe=Array.isArray(de)?function($e){de.push($e)}:function($e){de.text=$e},Te=i.extractOption(le,Z,"htx","hovertext");if(i.isValidTextValue(Te))return pe(Te);var Ne=i.extractOption(le,Z,"tx","text");if(i.isValidTextValue(Ne))return pe(Ne)},i.isValidTextValue=function(le){return le||le===0},i.formatPercent=function(le,Z){Z=Z||0;for(var de=(Math.round(100*le*Math.pow(10,Z))*Math.pow(.1,Z)).toFixed(Z)+"%",pe=0;pe1&&(it=1):it=0,i.strTranslate(Te-it*(de+$e),Ne-it*(pe+Ze))+i.strScale(it)+(Xe?"rotate("+Xe+(Z?"":" "+de+" "+pe)+")":"")},i.setTransormAndDisplay=function(le,Z){le.attr("transform",i.getTextTransform(Z)),le.style("display",Z.scale?null:"none")},i.ensureUniformFontSize=function(le,Z){var de=i.extendFlat({},Z);return de.size=Math.max(Z.size,le._fullLayout.uniformtext.minsize||0),de},i.join2=function(le,Z,de){var pe=le.length;return pe>1?le.slice(0,-1).join(Z)+de+le[pe-1]:le.join(Z)},i.bigFont=function(le){return Math.round(1.2*le)};var ne=i.getFirefoxVersion(),ye=ne!==null&&ne<86;i.getPositionFromD3Event=function(){return ye?[v.event.layerX,v.event.layerY]:[v.event.offsetX,v.event.offsetY]}}}),MD=Re({"build/plotcss.js"(){var ae=Rn(),K={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>: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:focus-within .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-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","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(S in K)v=S.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),ae.addStyleRule(v,K[S]);var v,S}}),X2=Re({"node_modules/is-browser/client.js"(ae,K){K.exports=!0}}),sS=Re({"node_modules/has-hover/index.js"(ae,K){var v=X2(),S;typeof window.matchMedia=="function"?S=!window.matchMedia("(hover: none)").matches:S=v,K.exports=S}}),I0=Re({"node_modules/events/events.js"(ae,K){var v=typeof Reflect=="object"?Reflect:null,S=v&&typeof v.apply=="function"?v.apply:function(I,T,E){return Function.prototype.apply.call(I,T,E)},M;v&&typeof v.ownKeys=="function"?M=v.ownKeys:Object.getOwnPropertySymbols?M=function(I){return Object.getOwnPropertyNames(I).concat(Object.getOwnPropertySymbols(I))}:M=function(I){return Object.getOwnPropertyNames(I)};function L(k){console&&console.warn&&console.warn(k)}var t=Number.isNaN||function(I){return I!==I};function r(){r.init.call(this)}K.exports=r,K.exports.once=f,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var a=10;function l(k){if(typeof k!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof k)}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(k){if(typeof k!="number"||k<0||t(k))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+k+".");a=k}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(I){if(typeof I!="number"||I<0||t(I))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+I+".");return this._maxListeners=I,this};function i(k){return k._maxListeners===void 0?r.defaultMaxListeners:k._maxListeners}r.prototype.getMaxListeners=function(){return i(this)},r.prototype.emit=function(I){for(var T=[],E=1;E0&&(m=T[0]),m instanceof Error)throw m;var w=new Error("Unhandled error."+(m?" ("+m.message+")":""));throw w.context=m,w}var F=h[I];if(F===void 0)return!1;if(typeof F=="function")S(F,this,T);else for(var z=F.length,U=y(F,z),E=0;E0&&m.length>_&&!m.warned){m.warned=!0;var w=new Error("Possible EventEmitter memory leak detected. "+m.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");w.name="MaxListenersExceededWarning",w.emitter=k,w.type=I,w.count=m.length,L(w)}return k}r.prototype.addListener=function(I,T){return s(this,I,T,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(I,T){return s(this,I,T,!0)};function o(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(k,I,T){var E={fired:!1,wrapFn:void 0,target:k,type:I,listener:T},_=o.bind(E);return _.listener=T,E.wrapFn=_,_}r.prototype.once=function(I,T){return l(T),this.on(I,c(this,I,T)),this},r.prototype.prependOnceListener=function(I,T){return l(T),this.prependListener(I,c(this,I,T)),this},r.prototype.removeListener=function(I,T){var E,_,h,m,w;if(l(T),_=this._events,_===void 0)return this;if(E=_[I],E===void 0)return this;if(E===T||E.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete _[I],_.removeListener&&this.emit("removeListener",I,E.listener||T));else if(typeof E!="function"){for(h=-1,m=E.length-1;m>=0;m--)if(E[m]===T||E[m].listener===T){w=E[m].listener,h=m;break}if(h<0)return this;h===0?E.shift():g(E,h),E.length===1&&(_[I]=E[0]),_.removeListener!==void 0&&this.emit("removeListener",I,w||T)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(I){var T,E,_;if(E=this._events,E===void 0)return this;if(E.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):E[I]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete E[I]),this;if(arguments.length===0){var h=Object.keys(E),m;for(_=0;_=0;_--)this.removeListener(I,T[_]);return this};function p(k,I,T){var E=k._events;if(E===void 0)return[];var _=E[I];return _===void 0?[]:typeof _=="function"?T?[_.listener||_]:[_]:T?C(_):y(_,_.length)}r.prototype.listeners=function(I){return p(this,I,!0)},r.prototype.rawListeners=function(I){return p(this,I,!1)},r.listenerCount=function(k,I){return typeof k.listenerCount=="function"?k.listenerCount(I):d.call(k,I)},r.prototype.listenerCount=d;function d(k){var I=this._events;if(I!==void 0){var T=I[k];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}r.prototype.eventNames=function(){return this._eventsCount>0?M(this._events):[]};function y(k,I){for(var T=new Array(I),E=0;E{},{passive:!0}),M},triggerHandler:function(M,L,t){var r,a=M._ev;if(!a)return;var l=a._events[L];if(!l)return;function i(o){if(o.listener){if(a.removeListener(L,o.listener),!o.fired)return o.fired=!0,o.listener.apply(a,[t])}else return o.apply(a,[t])}l=Array.isArray(l)?l:[l];var s;for(s=0;sS.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},L.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},L.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},L.undo=function(r){var a,l;if(!(r.undoQueue===void 0||isNaN(r.undoQueue.index)||r.undoQueue.index<=0)){for(r.undoQueue.index--,a=r.undoQueue.queue[r.undoQueue.index],r.undoQueue.inSequence=!0,l=0;l=r.undoQueue.queue.length)){for(a=r.undoQueue.queue[r.undoQueue.index],r.undoQueue.inSequence=!0,l=0;l=O.length)return!1;if(z.dimensions===2){if(V++,U.length===V)return z;var H=U[V];if(!A(H))return!1;z=O[j][H]}else z=O[j]}else z=O}}return z}function A(z){return z===Math.round(z)&&z>=0}function k(z){var U,V;U=K.modules[z]._module,V=U.basePlotModule;var G={};G.type=null;var j=l({},S),O=l({},U.attributes);ae.crawl(O,function(ee,ue,xe,ge,_e){o(j,_e).set(void 0),ee===void 0&&o(O,_e).set(void 0)}),l(G,j),K.traceIs(z,"noOpacity")&&delete G.opacity,K.traceIs(z,"showLegend")||(delete G.showlegend,delete G.legendgroup),K.traceIs(z,"noHover")&&(delete G.hoverinfo,delete G.hoverlabel),U.selectPoints||delete G.selectedpoints,l(G,O),V.attributes&&l(G,V.attributes),G.type=z;var H={meta:U.meta||{},categories:U.categories||{},animatable:!!U.animatable,type:z,attributes:E(G)};if(U.layoutAttributes){var W={};l(W,U.layoutAttributes),H.layoutAttributes=E(W)}return U.animatable||ae.crawl(H,function(ee){ae.isValObject(ee)&&"anim"in ee&&delete ee.anim}),H}function I(){var z={},U,V;l(z,M);for(U in K.subplotsRegistry)if(V=K.subplotsRegistry[U],!!V.layoutAttributes)if(Array.isArray(V.attr))for(var G=0;G=i&&(l._input||{})._templateitemname;o&&(s=i);var c=a+"["+s+"]",p;function d(){p={},o&&(p[c]={},p[c][S]=o)}d();function y(x,A){p[x]=A}function g(x,A){o?K.nestedProperty(p[c],x).set(A):p[c+"."+x]=A}function C(){var x=p;return d(),x}function f(x,A){x&&g(x,A);var k=C();for(var I in k)K.nestedProperty(r,I).set(k[I])}return{modifyBase:y,modifyItem:g,getUpdateObj:C,applyUpdate:f}}}}),qh=Re({"src/plots/cartesian/constants.js"(ae,K){var v=Cc().counter;K.exports={idRegex:{x:v("x","( domain)?"),y:v("y","( domain)?")},attrRegex:v("[xy]axis"),xAxisMatch:v("xaxis"),yAxisMatch:v("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),fh=Re({"src/plots/cartesian/axis_ids.js"(ae){var K=es(),v=qh();ae.id2name=function(L){if(!(typeof L!="string"||!L.match(v.AX_ID_PATTERN))){var t=L.split(" ")[0].slice(1);return t==="1"&&(t=""),L.charAt(0)+"axis"+t}},ae.name2id=function(L){if(L.match(v.AX_NAME_PATTERN)){var t=L.slice(5);return t==="1"&&(t=""),L.charAt(0)+t}},ae.cleanId=function(L,t,r){var a=/( domain)$/.test(L);if(!(typeof L!="string"||!L.match(v.AX_ID_PATTERN))&&!(t&&L.charAt(0)!==t)&&!(a&&!r)){var l=L.split(" ")[0].slice(1).replace(/^0+/,"");return l==="1"&&(l=""),L.charAt(0)+l+(a&&r?" domain":"")}},ae.list=function(M,L,t){var r=M._fullLayout;if(!r)return[];var a=ae.listIds(M,L),l=new Array(a.length),i;for(i=0;ir?1:-1:+(M.slice(1)||1)-+(L.slice(1)||1)},ae.ref2id=function(M){return/^[xyz]/.test(M)?M.split(" ")[0]:!1};function S(M,L){if(L&&L.length){for(var t=0;t0?".":"")+o;v.isPlainObject(c)?r(c,l,p,s+1):l(p,o,c)}})}}}),If=Re({"src/plots/plots.js"(ae,K){var v=un(),S=Kr().timeFormatLocale,M=Ma().formatLocale,L=da(),t=aa(),r=es(),a=O_(),l=Bu(),i=Rn(),s=ko(),o=Ia().BADNUM,c=fh(),p=hy().clearOutline,d=dy(),y=D_(),g=Y2(),C=Lp().getModuleCalcData,f=i.relinkPrivateKeys,x=i._,A=K.exports={};i.extendFlat(A,r),A.attributes=As(),A.attributes.type.values=A.allTypes,A.fontAttrs=Do(),A.layoutAttributes=kb();var k=Nk();A.executeAPICommand=k.executeAPICommand,A.computeAPICommandBindings=k.computeAPICommandBindings,A.manageCommandObserver=k.manageCommandObserver,A.hasSimpleAPICommandBindings=k.hasSimpleAPICommandBindings,A.redrawText=function(Y){return Y=i.getGraphDiv(Y),new Promise(function(se){setTimeout(function(){Y._fullLayout&&(r.getComponentMethod("annotations","draw")(Y),r.getComponentMethod("legend","draw")(Y),r.getComponentMethod("colorbar","draw")(Y),se(A.previousPromises(Y)))},300)})},A.resize=function(Y){Y=i.getGraphDiv(Y);var se,ce=new Promise(function(ne,ye){(!Y||i.isHidden(Y))&&ye(new Error("Resize must be passed a displayed plot div element.")),Y._redrawTimer&&clearTimeout(Y._redrawTimer),Y._resolveResize&&(se=Y._resolveResize),Y._resolveResize=ne,Y._redrawTimer=setTimeout(function(){if(!Y.layout||Y.layout.width&&Y.layout.height||i.isHidden(Y)){ne(Y);return}delete Y.layout.width,delete Y.layout.height;var le=Y.changed;Y.autoplay=!0,r.call("relayout",Y,{autosize:!0}).then(function(){Y.changed=le,Y._resolveResize===ne&&(delete Y._resolveResize,ne(Y))})},100)});return se&&se(ce),ce},A.previousPromises=function(Y){if((Y._promises||[]).length)return Promise.all(Y._promises).then(function(){Y._promises=[]})},A.addLinks=function(Y){if(!(!Y._context.showLink&&!Y._context.showSources)){var se=Y._fullLayout,ce=i.ensureSingle(se._paper,"text","js-plot-link-container",function(pe){pe.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:s.defaultLine,"pointer-events":"all"}).each(function(){var Te=v.select(this);Te.append("tspan").classed("js-link-to-tool",!0),Te.append("tspan").classed("js-link-spacer",!0),Te.append("tspan").classed("js-sourcelinks",!0)})}),ne=ce.node(),ye={y:se._paper.attr("height")-9};document.body.contains(ne)&&ne.getComputedTextLength()>=se.width-20?(ye["text-anchor"]="start",ye.x=5):(ye["text-anchor"]="end",ye.x=se._paper.attr("width")-7),ce.attr(ye);var le=ce.select(".js-link-to-tool"),Z=ce.select(".js-link-spacer"),de=ce.select(".js-sourcelinks");Y._context.showSources&&Y._context.showSources(Y),Y._context.showLink&&I(Y,le),Z.text(le.text()&&de.text()?" - ":"")}};function I(Y,se){se.text("");var ce=se.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(Y._context.linkText+" »");if(Y._context.sendData)ce.on("click",function(){A.sendDataToCloud(Y)});else{var ne=window.location.pathname.split("/"),ye=window.location.search;ce.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+ne[2].split(".")[0]+"/"+ne[1]+ye})}}A.sendDataToCloud=function(Y){var se=(window.PLOTLYENV||{}).BASE_URL||Y._context.plotlyServerURL;if(se){Y.emit("plotly_beforeexport");var ce=v.select(Y).append("div").attr("id","hiddenform").style("display","none"),ne=ce.append("form").attr({action:se+"/external",method:"post",target:"_blank"}),ye=ne.append("input").attr({type:"text",name:"data"});return ye.node().value=A.graphJson(Y,!1,"keepdata"),ne.node().submit(),ce.remove(),Y.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],E=["year","month","dayMonth","dayMonthYear"];A.supplyDefaults=function(Y,se){var ce=se&&se.skipUpdateCalc,ne=Y._fullLayout||{};if(ne._skipDefaults){delete ne._skipDefaults;return}var ye=Y._fullLayout={},le=Y.layout||{},Z=Y._fullData||[],de=Y._fullData=[],pe=Y.data||[],Te=Y.calcdata||[],Ne=Y._context||{},$e;Y._transitionData||A.createTransitionData(Y),ye._dfltTitle={plot:x(Y,"Click to enter Plot title"),subtitle:x(Y,"Click to enter Plot subtitle"),x:x(Y,"Click to enter X axis title"),y:x(Y,"Click to enter Y axis title"),colorbar:x(Y,"Click to enter Colorscale title"),annotation:x(Y,"new text")},ye._traceWord=x(Y,"trace");var Ze=m(Y,T);if(ye._mapboxAccessToken=Ne.mapboxAccessToken,ne._initialAutoSizeIsDone){var Xe=ne.width,it=ne.height;A.supplyLayoutGlobalDefaults(le,ye,Ze),le.width||(ye.width=Xe),le.height||(ye.height=it),A.sanitizeMargins(ye)}else{A.supplyLayoutGlobalDefaults(le,ye,Ze);var yt=!le.width||!le.height,bt=ye.autosize,mt=Ne.autosizable,ht=yt&&(bt||mt);ht?A.plotAutoSize(Y,le,ye):yt&&A.sanitizeMargins(ye),!bt&&yt&&(le.width=ye.width,le.height=ye.height)}ye._d3locale=w(Ze,ye.separators),ye._extraFormat=m(Y,E),ye._initialAutoSizeIsDone=!0,ye._dataLength=pe.length,ye._modules=[],ye._visibleModules=[],ye._basePlotModules=[];var Ve=ye._subplots=h(),ze=ye._splomAxes={x:{},y:{}},Se=ye._splomSubplots={};ye._splomGridDflt={},ye._scatterStackOpts={},ye._firstScatter={},ye._alignmentOpts={},ye._colorAxes={},ye._requestRangeslider={},ye._traceUids=_(Z,pe),A.supplyDataDefaults(pe,de,le,ye);var Je=Object.keys(ze.x),_t=Object.keys(ze.y);if(Je.length>1&&_t.length>1){for(r.getComponentMethod("grid","sizeDefaults")(le,ye),$e=0;$e15&&_t.length>15&&ye.shapes.length===0&&ye.images.length===0,A.linkSubplots(de,ye,Z,ne),A.cleanPlot(de,ye,Z,ne);var fr=!!(ne._has&&ne._has("cartesian")),mr=!!(ye._has&&ye._has("cartesian")),Ur=fr,Br=mr;Ur&&!Br?ne._bgLayer.remove():Br&&!Ur&&(ye._shouldCreateBgLayer=!0),ne._zoomlayer&&!Y._dragging&&p({_fullLayout:ne}),F(de,ye),f(ye,ne),r.getComponentMethod("colorscale","crossTraceDefaults")(de,ye),ye._preGUI||(ye._preGUI={}),ye._tracePreGUI||(ye._tracePreGUI={});var fn=ye._tracePreGUI,Fr={},Qr;for(Qr in fn)Fr[Qr]="old";for($e=0;$e0){var Ne=1-2*le;Z=Math.round(Ne*Z),de=Math.round(Ne*de)}}var $e=A.layoutAttributes.width.min,Ze=A.layoutAttributes.height.min;Z<$e&&(Z=$e),de1,it=!ce.height&&Math.abs(ne.height-de)>1;(it||Xe)&&(Xe&&(ne.width=Z),it&&(ne.height=de)),se._initialAutoSize||(se._initialAutoSize={width:Z,height:de}),A.sanitizeMargins(ne)},A.supplyLayoutModuleDefaults=function(Y,se,ce,ne){var ye=r.componentsRegistry,le=se._basePlotModules,Z,de,pe,Te=r.subplotsRegistry.cartesian;for(Z in ye)pe=ye[Z],pe.includeBasePlot&&pe.includeBasePlot(Y,se);le.length||le.push(Te),se._has("cartesian")&&(r.getComponentMethod("grid","contentDefaults")(Y,se),Te.finalizeSubplots(Y,se));for(var Ne in se._subplots)se._subplots[Ne].sort(i.subplotSort);for(de=0;de1&&(ce.l/=bt,ce.r/=bt)}if(Ze){var mt=(ce.t+ce.b)/Ze;mt>1&&(ce.t/=mt,ce.b/=mt)}var ht=ce.xl!==void 0?ce.xl:ce.x,Ve=ce.xr!==void 0?ce.xr:ce.x,ze=ce.yt!==void 0?ce.yt:ce.y,Se=ce.yb!==void 0?ce.yb:ce.y;Xe[se]={l:{val:ht,size:ce.l+yt},r:{val:Ve,size:ce.r+yt},b:{val:Se,size:ce.b+yt},t:{val:ze,size:ce.t+yt}},it[se]=1}if(!ne._replotting)return A.doAutoMargin(Y)}};function O(Y){if("_redrawFromAutoMarginCount"in Y._fullLayout)return!1;var se=c.list(Y,"",!0);for(var ce in se)if(se[ce].autoshift||se[ce].shift)return!0;return!1}A.doAutoMargin=function(Y){var se=Y._fullLayout,ce=se.width,ne=se.height;se._size||(se._size={}),V(se);var ye=se._size,le=se.margin,Z={t:0,b:0,l:0,r:0},de=i.extendFlat({},ye),pe=le.l,Te=le.r,Ne=le.t,$e=le.b,Ze=se._pushmargin,Xe=se._pushmarginIds,it=se.minreducedwidth,yt=se.minreducedheight;if(le.autoexpand!==!1){for(var bt in Ze)Xe[bt]||delete Ze[bt];var mt=Y._fullLayout._reservedMargin;for(var ht in mt)for(var Ve in mt[ht]){var ze=mt[ht][Ve];Z[Ve]=Math.max(Z[Ve],ze)}Ze.base={l:{val:0,size:pe},r:{val:1,size:Te},t:{val:1,size:Ne},b:{val:0,size:$e}};for(var Se in Z){var Je=0;for(var _t in Ze)_t!=="base"&&L(Ze[_t][Se].size)&&(Je=Ze[_t][Se].size>Je?Ze[_t][Se].size:Je);var At=Math.max(0,le[Se]-Je);Z[Se]=Math.max(0,Z[Se]-At)}for(var vt in Ze){var Kt=Ze[vt].l||{},Qt=Ze[vt].b||{},fr=Kt.val,mr=Kt.size,Ur=Qt.val,Br=Qt.size,fn=ce-Z.r-Z.l,Fr=ne-Z.t-Z.b;for(var Qr in Ze){if(L(mr)&&Ze[Qr].r){var Bt=Ze[Qr].r.val,et=Ze[Qr].r.size;if(Bt>fr){var ut=(mr*Bt+(et-fn)*fr)/(Bt-fr),Be=(et*(1-fr)+(mr-fn)*(1-Bt))/(Bt-fr);ut+Be>pe+Te&&(pe=ut,Te=Be)}}if(L(Br)&&Ze[Qr].t){var Ie=Ze[Qr].t.val,ke=Ze[Qr].t.size;if(Ie>Ur){var Fe=(Br*Ie+(ke-Fr)*Ur)/(Ie-Ur),at=(ke*(1-Ur)+(Br-Fr)*(1-Ie))/(Ie-Ur);Fe+at>$e+Ne&&($e=Fe,Ne=at)}}}}}var ct=i.constrain(ce-le.l-le.r,G,it),Gt=i.constrain(ne-le.t-le.b,j,yt),Vt=Math.max(0,ce-ct),Zt=Math.max(0,ne-Gt);if(Vt){var ur=(pe+Te)/Vt;ur>1&&(pe/=ur,Te/=ur)}if(Zt){var Dr=($e+Ne)/Zt;Dr>1&&($e/=Dr,Ne/=Dr)}if(ye.l=Math.round(pe)+Z.l,ye.r=Math.round(Te)+Z.r,ye.t=Math.round(Ne)+Z.t,ye.b=Math.round($e)+Z.b,ye.p=Math.round(le.pad),ye.w=Math.round(ce)-ye.l-ye.r,ye.h=Math.round(ne)-ye.t-ye.b,!se._replotting&&(A.didMarginChange(de,ye)||O(Y))){"_redrawFromAutoMarginCount"in se?se._redrawFromAutoMarginCount++:se._redrawFromAutoMarginCount=1;var kr=3*(1+Object.keys(Xe).length);if(se._redrawFromAutoMarginCount1)return!0}return!1},A.graphJson=function(Y,se,ce,ne,ye,le){(ye&&se&&!Y._fullData||ye&&!se&&!Y._fullLayout)&&A.supplyDefaults(Y);var Z=ye?Y._fullData:Y.data,de=ye?Y._fullLayout:Y.layout,pe=(Y._transitionData||{})._frames;function Te(Ze,Xe){if(typeof Ze=="function")return Xe?"_function_":null;if(i.isPlainObject(Ze)){var it={},yt;return Object.keys(Ze).sort().forEach(function(Ve){if(["_","["].indexOf(Ve.charAt(0))===-1){if(typeof Ze[Ve]=="function"){Xe&&(it[Ve]="_function");return}if(ce==="keepdata"){if(Ve.slice(-3)==="src")return}else if(ce==="keepstream"){if(yt=Ze[Ve+"src"],typeof yt=="string"&&yt.indexOf(":")>0&&!i.isPlainObject(Ze.stream))return}else if(ce!=="keepall"&&(yt=Ze[Ve+"src"],typeof yt=="string"&&yt.indexOf(":")>0))return;it[Ve]=Te(Ze[Ve],Xe)}}),it}var bt=Array.isArray(Ze),mt=i.isTypedArray(Ze);if((bt||mt)&&Ze.dtype&&Ze.shape){var ht=Ze.bdata;return Te({dtype:Ze.dtype,shape:Ze.shape,bdata:i.isArrayBuffer(ht)?t.encode(ht):ht},Xe)}return bt?Ze.map(function(Ve){return Te(Ve,Xe)}):mt?i.simpleMap(Ze,i.identity):i.isJSDate(Ze)?i.ms2DateTimeLocal(+Ze):Ze}var Ne={data:(Z||[]).map(function(Ze){var Xe=Te(Ze);return se&&delete Xe.fit,Xe})};if(!se&&(Ne.layout=Te(de),ye)){var $e=de._size;Ne.layout.computed={margin:{b:$e.b,l:$e.l,r:$e.r,t:$e.t}}}return pe&&(Ne.frames=Te(pe)),le&&(Ne.config=Te(Y._context,!0)),ne==="object"?Ne:JSON.stringify(Ne)},A.modifyFrames=function(Y,se){var ce,ne,ye,le=Y._transitionData._frames,Z=Y._transitionData._frameHash;for(ce=0;ce0&&(Y._transitioningWithDuration=!0),Y._transitionData._interruptCallbacks.push(function(){ne=!0}),ce.redraw&&Y._transitionData._interruptCallbacks.push(function(){return r.call("redraw",Y)}),Y._transitionData._interruptCallbacks.push(function(){Y.emit("plotly_transitioninterrupted",[])});var Ze=0,Xe=0;function it(){return Ze++,function(){Xe++,!ne&&Xe===Ze&&de($e)}}ce.runFn(it),setTimeout(it())})}function de($e){if(Y._transitionData)return le(Y._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(ce.redraw)return r.call("redraw",Y)}).then(function(){Y._transitioning=!1,Y._transitioningWithDuration=!1,Y.emit("plotly_transitioned",[])}).then($e)}function pe(){if(Y._transitionData)return Y._transitioning=!1,ye(Y._transitionData._interruptCallbacks)}var Te=[A.previousPromises,pe,ce.prepareFn,A.rehover,A.reselect,Z],Ne=i.syncOrAsync(Te,Y);return(!Ne||!Ne.then)&&(Ne=Promise.resolve()),Ne.then(function(){return Y})}A.doCalcdata=function(Y,se){var ce=c.list(Y),ne=Y._fullData,ye=Y._fullLayout,le,Z,de,pe,Te=new Array(ne.length),Ne=(Y.calcdata||[]).slice();for(Y.calcdata=Te,ye._numBoxes=0,ye._numViolins=0,ye._violinScaleGroupStats={},Y._hmpixcount=0,Y._hmlumcount=0,ye._piecolormap={},ye._sunburstcolormap={},ye._treemapcolormap={},ye._iciclecolormap={},ye._funnelareacolormap={},de=0;de=0;pe--)if(Se[pe].enabled){le._indexToPoints=Se[pe]._indexToPoints;break}Z&&Z.calc&&(ze=Z.calc(Y,le))}(!Array.isArray(ze)||!ze[0])&&(ze=[{x:o,y:o}]),ze[0].t||(ze[0].t={}),ze[0].trace=le,Te[ht]=ze}}for(ge(ce,ne,ye),de=0;dede||Xe>pe)&&(le.style("overflow","hidden"),$e=le.node().getBoundingClientRect(),Ze=$e.width,Xe=$e.height);var it=+j.attr("x"),yt=+j.attr("y"),bt=Y||j.node().getBoundingClientRect().height,mt=-bt/4;if(xe[0]==="y")Z.attr({transform:"rotate("+[-90,it,yt]+")"+S(-Ze/2,mt-Xe/2)});else if(xe[0]==="l")yt=mt-Xe/2;else if(xe[0]==="a"&&xe.indexOf("atitle")!==0)it=0,yt=mt;else{var ht=j.attr("text-anchor");it=it-Ze*(ht==="middle"?.5:ht==="end"?1:0),yt=yt+mt-Xe/2}le.attr({x:it,y:yt}),H&&H.call(j,Z),_e(Z)})})):ge(),j};var r=/(<|<|<)/g,a=/(>|>|>)/g;function l(j){return j.replace(r,"\\lt ").replace(a,"\\gt ")}var i=[["$","$"],["\\(","\\)"]];function s(j,O,H){var W=parseInt((MathJax.version||"").split(".")[0]);if(W!==2&&W!==3){v.warn("No MathJax version:",MathJax.version);return}var ee,ue,xe,ge,_e=function(){return ue=v.extendDeepAll({},MathJax.Hub.config),xe=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:i},displayAlign:"left"})},Y=function(){ue=v.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=i},se=function(){if(ee=MathJax.Hub.config.menuSettings.renderer,ee!=="SVG")return MathJax.Hub.setRenderer("SVG")},ce=function(){ee=MathJax.config.startup.output,ee!=="svg"&&(MathJax.config.startup.output="svg")},ne=function(){var Te="math-output-"+v.randstr({},64);ge=K.select("body").append("div").attr({id:Te}).style({visibility:"hidden",position:"absolute","font-size":O.fontSize+"px"}).text(l(j));var Ne=ge.node();return W===2?MathJax.Hub.Typeset(Ne):MathJax.typeset([Ne])},ye=function(){var Te=ge.select(W===2?".MathJax_SVG":".MathJax"),Ne=!Te.empty()&&ge.select("svg").node();if(!Ne)v.log("There was an error in the tex syntax.",j),H();else{var $e=Ne.getBoundingClientRect(),Ze;W===2?Ze=K.select("body").select("#MathJax_SVG_glyphs"):Ze=Te.select("defs"),H(Te,Ze,$e)}ge.remove()},le=function(){if(ee!=="SVG")return MathJax.Hub.setRenderer(ee)},Z=function(){ee!=="svg"&&(MathJax.config.startup.output=ee)},de=function(){return xe!==void 0&&(MathJax.Hub.processSectionDelay=xe),MathJax.Hub.Config(ue)},pe=function(){MathJax.config=ue};W===2?MathJax.Hub.Queue(_e,se,ne,ye,le,de):W===3&&(Y(),ce(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){ne(),ye(),Z(),pe()}))}var o={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},c={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},d="​",y=["http:","https:","mailto:","",void 0,":"],g=ae.NEWLINES=/(\r\n?|\n)/g,C=/(<[^<>]*>)/,f=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;ae.BR_TAG_ALL=//gi;var A=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,k=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,I=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function E(j,O){if(!j)return null;var H=j.match(O),W=H&&(H[3]||H[4]);return W&&w(W)}var _=/(^|;)\s*color:/;ae.plainText=function(j,O){O=O||{};for(var H=O.len!==void 0&&O.len!==-1?O.len:1/0,W=O.allowedTags!==void 0?O.allowedTags:["br"],ee="...",ue=ee.length,xe=j.split(C),ge=[],_e="",Y=0,se=0;seue?ge.push(ce.slice(0,Math.max(0,Z-ue))+ee):ge.push(ce.slice(0,Z));break}_e=""}}return ge.join("")};var h={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},m=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function w(j){return j.replace(m,function(O,H){var W;return H.charAt(0)==="#"?W=F(H.charAt(1)==="x"?parseInt(H.slice(2),16):parseInt(H.slice(1),10)):W=h[H],W||O})}ae.convertEntities=w;function F(j){if(!(j>1114111)){var O=String.fromCodePoint;if(O)return O(j);var H=String.fromCharCode;return j<=65535?H(j):H((j>>10)+55232,j%1024+56320)}}function z(j,O){O=O.replace(g," ");var H=!1,W=[],ee,ue=-1;function xe(){ue++;var Xe=document.createElementNS(M.svg,"tspan");K.select(Xe).attr({class:"line",dy:ue*L+"em"}),j.appendChild(Xe),ee=Xe;var it=W;if(W=[{node:Xe}],it.length>1)for(var yt=1;yt.",O);return}var it=W.pop();Xe!==it.type&&v.log("Start tag <"+it.type+"> doesnt match end tag <"+Xe+">. Pretending it did match.",O),ee=W[W.length-1].node}var se=x.test(O);se?xe():(ee=j,W=[{node:j}]);for(var ce=O.split(C),ne=0;ne=0;x--,A++){var k=g[x];f[A]=[1-k[0],k[1]]}return f}function p(g,C){C=C||{};for(var f=g.domain,x=g.range,A=x.length,k=new Array(A),I=0;Ig-d?d=g-(y-g):y-g=0?x=l.colorscale.sequential:x=l.colorscale.sequentialminus,c._sync("colorscale",x)}}}}),nf=Re({"src/components/colorscale/index.js"(ae,K){var v=nc(),S=cp();K.exports={moduleType:"component",name:"colorscale",attributes:ac(),layoutAttributes:b1(),supplyLayoutDefaults:Ok(),handleDefaults:ed(),crossTraceDefaults:J2(),calc:hp(),scales:v.scales,defaultScale:v.defaultScale,getScale:v.get,isValidScale:v.isValid,hasColorscale:S.hasColorscale,extractOpts:S.extractOpts,extractScale:S.extractScale,flipScale:S.flipScale,makeColorScaleFunc:S.makeColorScaleFunc,makeColorScaleFuncFromTrace:S.makeColorScaleFuncFromTrace}}}),Mu=Re({"src/traces/scatter/subtypes.js"(ae,K){var v=Rn(),S=ai().isTypedArraySpec;K.exports={hasLines:function(M){return M.visible&&M.mode&&M.mode.indexOf("lines")!==-1},hasMarkers:function(M){return M.visible&&(M.mode&&M.mode.indexOf("markers")!==-1||M.type==="splom")},hasText:function(M){return M.visible&&M.mode&&M.mode.indexOf("text")!==-1},isBubble:function(M){var L=M.marker;return v.isPlainObject(L)&&(v.isArrayOrTypedArray(L.size)||S(L.size))}}}}),pg=Re({"src/traces/scatter/make_bubble_size_func.js"(ae,K){var v=da();K.exports=function(M,L){L||(L=2);var t=M.marker,r=t.sizeref||1,a=t.sizemin||0,l=t.sizemode==="area"?function(i){return Math.sqrt(i/r)}:function(i){return i/r};return function(i){var s=l(i/L);return v(s)&&s>0?Math.max(s,a):0}}}}),Xp=Re({"src/components/fx/helpers.js"(ae){var K=Rn();ae.getSubplot=function(r){return r.subplot||r.xaxis+r.yaxis||r.geo},ae.isTraceInSubplots=function(r,a){if(r.type==="splom"){for(var l=r.xaxes||[],i=r.yaxes||[],s=0;s=0&&l.index2&&(a.push([i].concat(s.splice(0,2))),o="l",i=i=="m"?"l":"L");;){if(s.length==v[o])return s.unshift(i),a.push(s);if(s.length0&&(ze=100,Ve=Ve.replace("-open","")),Ve.indexOf("-dot")>0&&(ze+=200,Ve=Ve.replace("-dot","")),Ve=f.symbolNames.indexOf(Ve),Ve>=0&&(Ve+=ze)}return Ve%100>=_||Ve>=400?0:Math.floor(Math.max(Ve,0))};function m(Ve,ze,Se,Je){var _t=Ve%100;return f.symbolFuncs[_t](ze,Se,Je)+(Ve>=200?h:"")}var w=M("~f"),F={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};f.gradient=function(Ve,ze,Se,Je,_t,At){var vt=F[Je];return z(Ve,ze,Se,vt.type,_t,At,vt.start,vt.stop,!1,vt.reversed)};function z(Ve,ze,Se,Je,_t,At,vt,Kt,Qt,fr){var mr=_t.length,Ur;Je==="linear"?Ur={node:"linearGradient",attrs:{x1:vt.x,y1:vt.y,x2:Kt.x,y2:Kt.y,gradientUnits:Qt?"userSpaceOnUse":"objectBoundingBox"},reversed:fr}:Je==="radial"&&(Ur={node:"radialGradient",reversed:fr});for(var Br=new Array(mr),fn=0;fn=0&&Ve.i===void 0&&(Ve.i=At.i),ze.style("opacity",Je.selectedOpacityFn?Je.selectedOpacityFn(Ve):Ve.mo===void 0?vt.opacity:Ve.mo),Je.ms2mrc){var Qt;Ve.ms==="various"||vt.size==="various"?Qt=3:Qt=Je.ms2mrc(Ve.ms),Ve.mrc=Qt,Je.selectedSizeFn&&(Qt=Ve.mrc=Je.selectedSizeFn(Ve));var fr=f.symbolNumber(Ve.mx||vt.symbol)||0;Ve.om=fr%200>=100;var mr=ht(Ve,Se),Ur=de(Ve,Se);ze.attr("d",m(fr,Qt,mr,Ur))}var Br=!1,fn,Fr,Qr;if(Ve.so)Qr=Kt.outlierwidth,Fr=Kt.outliercolor,fn=vt.outliercolor;else{var Bt=(Kt||{}).width;Qr=(Ve.mlw+1||Bt+1||(Ve.trace?(Ve.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Ve?Fr=Ve.mlcc=Je.lineScale(Ve.mlc):S.isArrayOrTypedArray(Kt.color)?Fr=a.defaultLine:Fr=Kt.color,S.isArrayOrTypedArray(vt.color)&&(fn=a.defaultLine,Br=!0),"mc"in Ve?fn=Ve.mcc=Je.markerScale(Ve.mc):fn=vt.color||vt.colors||"rgba(0,0,0,0)",Je.selectedColorFn&&(fn=Je.selectedColorFn(Ve))}if(Ve.om)ze.call(a.stroke,fn).style({"stroke-width":(Qr||1)+"px",fill:"none"});else{ze.style("stroke-width",(Ve.isBlank?0:Qr)+"px");var et=vt.gradient,ut=Ve.mgt;ut?Br=!0:ut=et&&et.type,S.isArrayOrTypedArray(ut)&&(ut=ut[0],F[ut]||(ut=0));var Be=vt.pattern,Ie=f.getPatternAttr,ke=Be&&(Ie(Be.shape,Ve.i,"")||Ie(Be.path,Ve.i,""));if(ut&&ut!=="none"){var Fe=Ve.mgc;Fe?Br=!0:Fe=et.color;var at=Se.uid;Br&&(at+="-"+Ve.i),f.gradient(ze,_t,at,ut,[[0,Fe],[1,fn]],"fill")}else if(ke){var ct=!1,Gt=Be.fgcolor;!Gt&&At&&At.color&&(Gt=At.color,ct=!0);var Vt=Ie(Gt,Ve.i,At&&At.color||null),Zt=Ie(Be.bgcolor,Ve.i,null),ur=Be.fgopacity,Dr=Ie(Be.size,Ve.i,8),kr=Ie(Be.solidity,Ve.i,.3);ct=ct||Ve.mcc||S.isArrayOrTypedArray(Be.shape)||S.isArrayOrTypedArray(Be.path)||S.isArrayOrTypedArray(Be.bgcolor)||S.isArrayOrTypedArray(Be.fgcolor)||S.isArrayOrTypedArray(Be.size)||S.isArrayOrTypedArray(Be.solidity);var Sr=Se.uid;ct&&(Sr+="-"+Ve.i),f.pattern(ze,"point",_t,Sr,ke,Dr,kr,Ve.mcc,Be.fillmode,Zt,Vt,ur)}else S.isArrayOrTypedArray(fn)?a.fill(ze,fn[Ve.i]):a.fill(ze,fn);Qr&&a.stroke(ze,Fr)}},f.makePointStyleFns=function(Ve){var ze={},Se=Ve.marker;return ze.markerScale=f.tryColorscale(Se,""),ze.lineScale=f.tryColorscale(Se,"line"),r.traceIs(Ve,"symbols")&&(ze.ms2mrc=y.isBubble(Ve)?g(Ve):function(){return(Se.size||6)/2}),Ve.selectedpoints&&S.extendFlat(ze,f.makeSelectedPointStyleFns(Ve)),ze},f.makeSelectedPointStyleFns=function(Ve){var ze={},Se=Ve.selected||{},Je=Ve.unselected||{},_t=Ve.marker||{},At=Se.marker||{},vt=Je.marker||{},Kt=_t.opacity,Qt=At.opacity,fr=vt.opacity,mr=Qt!==void 0,Ur=fr!==void 0;(S.isArrayOrTypedArray(Kt)||mr||Ur)&&(ze.selectedOpacityFn=function(Ie){var ke=Ie.mo===void 0?_t.opacity:Ie.mo;return Ie.selected?mr?Qt:ke:Ur?fr:d*ke});var Br=_t.color,fn=At.color,Fr=vt.color;(fn||Fr)&&(ze.selectedColorFn=function(Ie){var ke=Ie.mcc||Br;return Ie.selected?fn||ke:Fr||ke});var Qr=_t.size,Bt=At.size,et=vt.size,ut=Bt!==void 0,Be=et!==void 0;return r.traceIs(Ve,"symbols")&&(ut||Be)&&(ze.selectedSizeFn=function(Ie){var ke=Ie.mrc||Qr/2;return Ie.selected?ut?Bt/2:ke:Be?et/2:ke}),ze},f.makeSelectedTextStyleFns=function(Ve){var ze={},Se=Ve.selected||{},Je=Ve.unselected||{},_t=Ve.textfont||{},At=Se.textfont||{},vt=Je.textfont||{},Kt=_t.color,Qt=At.color,fr=vt.color;return ze.selectedTextColorFn=function(mr){var Ur=mr.tc||Kt;return mr.selected?Qt||Ur:fr||(Qt?Ur:a.addOpacity(Ur,d))},ze},f.selectedPointStyle=function(Ve,ze){if(!(!Ve.size()||!ze.selectedpoints)){var Se=f.makeSelectedPointStyleFns(ze),Je=ze.marker||{},_t=[];Se.selectedOpacityFn&&_t.push(function(At,vt){At.style("opacity",Se.selectedOpacityFn(vt))}),Se.selectedColorFn&&_t.push(function(At,vt){a.fill(At,Se.selectedColorFn(vt))}),Se.selectedSizeFn&&_t.push(function(At,vt){var Kt=vt.mx||Je.symbol||0,Qt=Se.selectedSizeFn(vt);At.attr("d",m(f.symbolNumber(Kt),Qt,ht(vt,ze),de(vt,ze))),vt.mrc2=Qt}),_t.length&&Ve.each(function(At){for(var vt=v.select(this),Kt=0;Kt<_t.length;Kt++)_t[Kt](vt,At)})}},f.tryColorscale=function(Ve,ze){var Se=ze?S.nestedProperty(Ve,ze).get():Ve;if(Se){var Je=Se.color;if((Se.colorscale||Se._colorAx)&&S.isArrayOrTypedArray(Je))return l.makeColorScaleFuncFromTrace(Se)}return S.identity};var U={start:1,end:-1,middle:0,bottom:1,top:-1};function V(Ve,ze,Se,Je,_t){var At=v.select(Ve.node().parentNode),vt=ze.indexOf("top")!==-1?"top":ze.indexOf("bottom")!==-1?"bottom":"middle",Kt=ze.indexOf("left")!==-1?"end":ze.indexOf("right")!==-1?"start":"middle",Qt=Je?Je/.8+1:0,fr=(s.lineCount(Ve)-1)*p+1,mr=U[Kt]*Qt,Ur=Se*.75+U[vt]*Qt+(U[vt]-1)*fr*Se/2;Ve.attr("text-anchor",Kt),_t||At.attr("transform",i(mr,Ur))}function G(Ve,ze){var Se=Ve.ts||ze.textfont.size;return L(Se)&&Se>0?Se:0}f.textPointStyle=function(Ve,ze,Se){if(Ve.size()){var Je;if(ze.selectedpoints){var _t=f.makeSelectedTextStyleFns(ze);Je=_t.selectedTextColorFn}var At=ze.texttemplate,vt=Se._fullLayout;Ve.each(function(Kt){var Qt=v.select(this),fr=At?S.extractOption(Kt,ze,"txt","texttemplate"):S.extractOption(Kt,ze,"tx","text");if(!fr&&fr!==0){Qt.remove();return}if(At){var mr=ze._module.formatLabels,Ur=mr?mr(Kt,ze,vt):{},Br={};C(Br,ze,Kt.i),fr=S.texttemplateString({data:[Br,Kt,ze._meta],fallback:ze.texttemplatefallback,labels:Ur,locale:vt._d3locale,template:fr})}var fn=Kt.tp||ze.textposition,Fr=G(Kt,ze),Qr=Je?Je(Kt):Kt.tc||ze.textfont.color;Qt.call(f.font,{family:Kt.tf||ze.textfont.family,weight:Kt.tw||ze.textfont.weight,style:Kt.ty||ze.textfont.style,variant:Kt.tv||ze.textfont.variant,textcase:Kt.tC||ze.textfont.textcase,lineposition:Kt.tE||ze.textfont.lineposition,shadow:Kt.tS||ze.textfont.shadow,size:Fr,color:Qr}).text(fr).call(s.convertToTspans,Se).call(V,fn,Fr,Kt.mrc)})}},f.selectedTextStyle=function(Ve,ze){if(!(!Ve.size()||!ze.selectedpoints)){var Se=f.makeSelectedTextStyleFns(ze);Ve.each(function(Je){var _t=v.select(this),At=Se.selectedTextColorFn(Je),vt=Je.tp||ze.textposition,Kt=G(Je,ze);a.fill(_t,At);var Qt=r.traceIs(ze,"bar-like");V(_t,vt,Kt,Je.mrc2||Je.mrc,Qt)})}};var j=.5;f.smoothopen=function(Ve,ze){if(Ve.length<3)return"M"+Ve.join("L");var Se="M"+Ve[0],Je=[],_t;for(_t=1;_t=Qt||Ie>=mr&&Ie<=Qt)&&(ke<=Ur&&ke>=fr||ke>=Ur&&ke<=fr)&&(Ve=[Ie,ke])}return Ve}f.applyBackoff=Y,f.makeTester=function(){var Ve=S.ensureSingleById(v.select("body"),"svg","js-plotly-tester",function(Se){Se.attr(o.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),ze=S.ensureSingle(Ve,"path","js-reference-point",function(Se){Se.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});f.tester=Ve,f.testref=ze},f.savedBBoxes={};var se=0,ce=1e4;f.bBox=function(Ve,ze,Se){Se||(Se=ne(Ve));var Je;if(Se){if(Je=f.savedBBoxes[Se],Je)return S.extendFlat({},Je)}else if(Ve.childNodes.length===1){var _t=Ve.childNodes[0];if(Se=ne(_t),Se){var At=+_t.getAttribute("x")||0,vt=+_t.getAttribute("y")||0,Kt=_t.getAttribute("transform");if(!Kt){var Qt=f.bBox(_t,!1,Se);return At&&(Qt.left+=At,Qt.right+=At),vt&&(Qt.top+=vt,Qt.bottom+=vt),Qt}if(Se+="~"+At+"~"+vt+"~"+Kt,Je=f.savedBBoxes[Se],Je)return S.extendFlat({},Je)}}var fr,mr;ze?fr=Ve:(mr=f.tester.node(),fr=Ve.cloneNode(!0),mr.appendChild(fr)),v.select(fr).attr("transform",null).call(s.positionText,0,0);var Ur=fr.getBoundingClientRect(),Br=f.testref.node().getBoundingClientRect();ze||mr.removeChild(fr);var fn={height:Ur.height,width:Ur.width,left:Ur.left-Br.left,top:Ur.top-Br.top,right:Ur.right-Br.left,bottom:Ur.bottom-Br.top};return se>=ce&&(f.savedBBoxes={},se=0),Se&&(f.savedBBoxes[Se]=fn),se++,S.extendFlat({},fn)};function ne(Ve){var ze=Ve.getAttribute("data-unformatted");if(ze!==null)return ze+Ve.getAttribute("data-math")+Ve.getAttribute("text-anchor")+Ve.getAttribute("style")}f.setClipUrl=function(Ve,ze,Se){Ve.attr("clip-path",ye(ze,Se))};function ye(Ve,ze){if(!Ve)return null;var Se=ze._context,Je=Se._exportedPlot?"":Se._baseUrl||"";return Je?"url('"+Je+"#"+Ve+"')":"url(#"+Ve+")"}f.getTranslate=function(Ve){var ze=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,Se=Ve.attr?"attr":"getAttribute",Je=Ve[Se]("transform")||"",_t=Je.replace(ze,function(At,vt,Kt){return[vt,Kt].join(" ")}).split(" ");return{x:+_t[0]||0,y:+_t[1]||0}},f.setTranslate=function(Ve,ze,Se){var Je=/(\btranslate\(.*?\);?)/,_t=Ve.attr?"attr":"getAttribute",At=Ve.attr?"attr":"setAttribute",vt=Ve[_t]("transform")||"";return ze=ze||0,Se=Se||0,vt=vt.replace(Je,"").trim(),vt+=i(ze,Se),vt=vt.trim(),Ve[At]("transform",vt),vt},f.getScale=function(Ve){var ze=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,Se=Ve.attr?"attr":"getAttribute",Je=Ve[Se]("transform")||"",_t=Je.replace(ze,function(At,vt,Kt){return[vt,Kt].join(" ")}).split(" ");return{x:+_t[0]||1,y:+_t[1]||1}},f.setScale=function(Ve,ze,Se){var Je=/(\bscale\(.*?\);?)/,_t=Ve.attr?"attr":"getAttribute",At=Ve.attr?"attr":"setAttribute",vt=Ve[_t]("transform")||"";return ze=ze||1,Se=Se||1,vt=vt.replace(Je,"").trim(),vt+="scale("+ze+","+Se+")",vt=vt.trim(),Ve[At]("transform",vt),vt};var le=/\s*sc.*/;f.setPointGroupScale=function(Ve,ze,Se){if(ze=ze||1,Se=Se||1,!!Ve){var Je=ze===1&&Se===1?"":"scale("+ze+","+Se+")";Ve.each(function(){var _t=(this.getAttribute("transform")||"").replace(le,"");_t+=Je,_t=_t.trim(),this.setAttribute("transform",_t)})}};var Z=/translate\([^)]*\)\s*$/;f.setTextPointsScale=function(Ve,ze,Se){Ve&&Ve.each(function(){var Je,_t=v.select(this),At=_t.select("text");if(At.node()){var vt=parseFloat(At.attr("x")||0),Kt=parseFloat(At.attr("y")||0),Qt=(_t.attr("transform")||"").match(Z);ze===1&&Se===1?Je=[]:Je=[i(vt,Kt),"scale("+ze+","+Se+")",i(-vt,-Kt)],Qt&&Je.push(Qt),_t.attr("transform",Je.join(""))}})};function de(Ve,ze){var Se;return Ve&&(Se=Ve.mf),Se===void 0&&(Se=ze.marker&&ze.marker.standoff||0),!ze._geo&&!ze._xA?-Se:Se}f.getMarkerStandoff=de;var pe=Math.atan2,Te=Math.cos,Ne=Math.sin;function $e(Ve,ze){var Se=ze[0],Je=ze[1];return[Se*Te(Ve)-Je*Ne(Ve),Se*Ne(Ve)+Je*Te(Ve)]}var Ze,Xe,it,yt,bt,mt;function ht(Ve,ze){var Se=Ve.ma;Se===void 0&&(Se=ze.marker.angle,(!Se||S.isArrayOrTypedArray(Se))&&(Se=0));var Je,_t,At=ze.marker.angleref;if(At==="previous"||At==="north"){if(ze._geo){var vt=ze._geo.project(Ve.lonlat);Je=vt[0],_t=vt[1]}else{var Kt=ze._xA,Qt=ze._yA;if(Kt&&Qt)Je=Kt.c2p(Ve.x),_t=Qt.c2p(Ve.y);else return 90}if(ze._geo){var fr=Ve.lonlat[0],mr=Ve.lonlat[1],Ur=ze._geo.project([fr,mr+1e-5]),Br=ze._geo.project([fr+1e-5,mr]),fn=pe(Br[1]-_t,Br[0]-Je),Fr=pe(Ur[1]-_t,Ur[0]-Je),Qr;if(At==="north")Qr=Se/180*Math.PI;else if(At==="previous"){var Bt=fr/180*Math.PI,et=mr/180*Math.PI,ut=Ze/180*Math.PI,Be=Xe/180*Math.PI,Ie=ut-Bt,ke=Te(Be)*Ne(Ie),Fe=Ne(Be)*Te(et)-Te(Be)*Ne(et)*Te(Ie);Qr=-pe(ke,Fe)-Math.PI,Ze=fr,Xe=mr}var at=$e(fn,[Te(Qr),0]),ct=$e(Fr,[Ne(Qr),0]);Se=pe(at[1]+ct[1],at[0]+ct[0])/Math.PI*180,At==="previous"&&!(mt===ze.uid&&Ve.i===bt+1)&&(Se=null)}if(At==="previous"&&!ze._geo)if(mt===ze.uid&&Ve.i===bt+1&&L(Je)&&L(_t)){var Gt=Je-it,Vt=_t-yt,Zt=ze.line&&ze.line.shape||"",ur=Zt.slice(Zt.length-1);ur==="h"&&(Vt=0),ur==="v"&&(Gt=0),Se+=pe(Vt,Gt)/Math.PI*180+90}else Se=null}return it=Je,yt=_t,bt=Ve.i,mt=ze.uid,Se}f.getMarkerAngle=ht}}),vy=Re({"src/components/titles/index.js"(ae,K){var v=un(),S=da(),M=If(),L=es(),t=Rn(),r=t.strTranslate,a=qs(),l=ko(),i=kc(),s=Ec(),o=qd().OPPOSITE_SIDE,c=/ [XY][0-9]* /,p=1.6,d=1.6;function y(g,C,f){var x=g._fullLayout,A=f.propContainer,k=f.propName,I=f.placeholder,T=f.traceIndex,E=f.avoid||{},_=f.attributes,h=f.transform,m=f.containerGroup,w=1,F=A.title,z=(F&&F.text?F.text:"").trim(),U=!1,V=F&&F.font?F.font:{},G=V.family,j=V.size,O=V.color,H=V.weight,W=V.style,ee=V.variant,ue=V.textcase,xe=V.lineposition,ge=V.shadow,_e=f.subtitlePropName,Y=!!_e,se=f.subtitlePlaceholder,ce=(A.title||{}).subtitle||{text:"",font:{}},ne=(ce.text||"").trim(),ye=!1,le=1,Z=ce.font,de=Z.family,pe=Z.size,Te=Z.color,Ne=Z.weight,$e=Z.style,Ze=Z.variant,Xe=Z.textcase,it=Z.lineposition,yt=Z.shadow,bt;k==="title.text"?bt="titleText":k.indexOf("axis")!==-1?bt="axisTitleText":k.indexOf("colorbar")!==-1&&(bt="colorbarTitleText");var mt=g._context.edits[bt];function ht(Br,fn){return Br===void 0||fn===void 0?!1:Br.replace(c," % ")===fn.replace(c," % ")}z===""?w=0:ht(z,I)&&(mt||(z=""),w=.2,U=!0),Y&&(ne===""?le=0:ht(ne,se)&&(mt||(ne=""),le=.2,ye=!0)),f._meta?z=t.templateString(z,f._meta):x._meta&&(z=t.templateString(z,x._meta));var Ve=z||ne||mt,ze;m||(m=t.ensureSingle(x._infolayer,"g","g-"+C),ze=x._hColorbarMoveTitle);var Se=m.selectAll("text."+C).data(Ve?[0]:[]);Se.enter().append("text"),Se.text(z).attr("class",C),Se.exit().remove();var Je=null,_t=C+"-subtitle",At=ne||mt;if(Y&&(Je=m.selectAll("text."+_t).data(At?[0]:[]),Je.enter().append("text"),Je.text(ne).attr("class",_t),Je.exit().remove()),!Ve)return m;function vt(Br,fn){t.syncOrAsync([Kt,Qt],{title:Br,subtitle:fn})}function Kt(Br){var fn=Br.title,Fr=Br.subtitle,Qr;!h&&ze&&(h={}),h?(Qr="",h.rotate&&(Qr+="rotate("+[h.rotate,_.x,_.y]+")"),(h.offset||ze)&&(Qr+=r(0,(h.offset||0)-(ze||0)))):Qr=null,fn.attr("transform",Qr);function Bt(Fe){if(Fe){var at=v.select(Fe.node().parentNode).select("."+_t);if(!at.empty()){var ct=Fe.node().getBBox();if(ct.height){var Gt=ct.y+ct.height+p*pe;at.attr("y",Gt)}}}}if(fn.style("opacity",w*l.opacity(O)).call(a.font,{color:l.rgb(O),size:v.round(j,2),family:G,weight:H,style:W,variant:ee,textcase:ue,shadow:ge,lineposition:xe}).attr(_).call(i.convertToTspans,g,Bt),Fr&&!Fr.empty()){var et=m.select("."+C+"-math-group"),ut=fn.node().getBBox(),Be=et.node()?et.node().getBBox():void 0,Ie=Be?Be.y+Be.height+p*pe:ut.y+ut.height+d*pe,ke=t.extendFlat({},_,{y:Ie});Fr.attr("transform",Qr),Fr.style("opacity",le*l.opacity(Te)).call(a.font,{color:l.rgb(Te),size:v.round(pe,2),family:de,weight:Ne,style:$e,variant:Ze,textcase:Xe,shadow:yt,lineposition:it}).attr(ke).call(i.convertToTspans,g)}return M.previousPromises(g)}function Qt(Br){var fn=Br.title,Fr=v.select(fn.node().parentNode);if(E&&E.selection&&E.side&&z){Fr.attr("transform",null);var Qr=o[E.side],Bt=E.side==="left"||E.side==="top"?-1:1,et=S(E.pad)?E.pad:2,ut=a.bBox(Fr.node()),Be={t:0,b:0,l:0,r:0},Ie=g._fullLayout._reservedMargin;for(var ke in Ie)for(var Fe in Ie[ke]){var at=Ie[ke][Fe];Be[Fe]=Math.max(Be[Fe],at)}var ct={left:Be.l,top:Be.t,right:x.width-Be.r,bottom:x.height-Be.b},Gt=E.maxShift||Bt*(ct[E.side]-ut[E.side]),Vt=0;if(Gt<0)Vt=Gt;else{var Zt=E.offsetLeft||0,ur=E.offsetTop||0;ut.left-=Zt,ut.right-=Zt,ut.top-=ur,ut.bottom-=ur,E.selection.each(function(){var kr=a.bBox(this);t.bBoxIntersect(ut,kr,et)&&(Vt=Math.max(Vt,Bt*(kr[E.side]-ut[Qr])+et))}),Vt=Math.min(Gt,Vt),A._titleScoot=Math.abs(Vt)}if(Vt>0||Gt<0){var Dr={left:[-Vt,0],right:[Vt,0],top:[0,-Vt],bottom:[0,Vt]}[E.side];Fr.attr("transform",r(Dr[0],Dr[1]))}}}Se.call(vt,Je);function fr(Br,fn){Br.text(fn).on("mouseover.opacity",function(){v.select(this).transition().duration(s.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){v.select(this).transition().duration(s.HIDE_PLACEHOLDER).style("opacity",0)})}if(mt&&(z?Se.on(".opacity",null):(fr(Se,I),U=!0),Se.call(i.makeEditable,{gd:g}).on("edit",function(Br){T!==void 0?L.call("_guiRestyle",g,k,Br,T):L.call("_guiRelayout",g,k,Br)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(vt)}).on("input",function(Br){this.text(Br||" ").call(i.positionText,_.x,_.y)}),Y)){if(Y&&!z){var mr=Se.node().getBBox(),Ur=mr.y+mr.height+d*pe;Je.attr("y",Ur)}ne?Je.on(".opacity",null):(fr(Je,se),ye=!0),Je.call(i.makeEditable,{gd:g}).on("edit",function(Br){L.call("_guiRelayout",g,"title.subtitle.text",Br)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(vt)}).on("input",function(Br){this.text(Br||" ").call(i.positionText,Je.attr("x"),Je.attr("y"))})}return Se.classed("js-placeholder",U),Je&&!Je.empty()&&Je.classed("js-placeholder",ye),m}K.exports={draw:y,SUBTITLE_PADDING_EM:d,SUBTITLE_PADDING_MATHJAX_EM:p}}}),bm=Re({"src/plots/cartesian/set_convert.js"(ae,K){var v=un(),S=Kr().utcFormat,M=Rn(),L=M.numberFormat,t=da(),r=M.cleanNumber,a=M.ms2DateTime,l=M.dateTime2ms,i=M.ensureNumber,s=M.isArrayOrTypedArray,o=Ia(),c=o.FP_SAFE,p=o.BADNUM,d=o.LOG_CLIP,y=o.ONEWEEK,g=o.ONEDAY,C=o.ONEHOUR,f=o.ONEMIN,x=o.ONESEC,A=fh(),k=qh(),I=k.HOUR_PATTERN,T=k.WEEKDAY_PATTERN;function E(h){return Math.pow(10,h)}function _(h){return h!=null}K.exports=function(m,w){w=w||{};var F=m._id||"x",z=F.charAt(0);function U(ne,ye){if(ne>0)return Math.log(ne)/Math.LN10;if(ne<=0&&ye&&m.range&&m.range.length===2){var le=m.range[0],Z=m.range[1];return .5*(le+Z-2*d*Math.abs(le-Z))}else return p}function V(ne,ye,le,Z){if((Z||{}).msUTC&&t(ne))return+ne;var de=l(ne,le||m.calendar);if(de===p)if(t(ne)){ne=+ne;var pe=Math.floor(M.mod(ne+.05,1)*10),Te=Math.round(ne-pe/10);de=l(new Date(Te))+pe/10}else return p;return de}function G(ne,ye,le){return a(ne,ye,le||m.calendar)}function j(ne){return m._categories[Math.round(ne)]}function O(ne){if(_(ne)){if(m._categoriesMap===void 0&&(m._categoriesMap={}),m._categoriesMap[ne]!==void 0)return m._categoriesMap[ne];m._categories.push(typeof ne=="number"?String(ne):ne);var ye=m._categories.length-1;return m._categoriesMap[ne]=ye,ye}return p}function H(ne,ye){for(var le=new Array(ye),Z=0;Zm.range[1]&&(le=!le);for(var Z=le?-1:1,de=Z*ne,pe=0,Te=0;Te$e)pe=Te+1;else{pe=de<(Ne+$e)/2?Te:Te+1;break}}var Ze=m._B[pe]||0;return isFinite(Ze)?xe(ne,m._m2,Ze):0},Y=function(ne){var ye=m._rangebreaks.length;if(!ye)return ge(ne,m._m,m._b);for(var le=0,Z=0;Zm._rangebreaks[Z].pmax&&(le=Z+1);return ge(ne,m._m2,m._B[le])}}m.c2l=m.type==="log"?U:i,m.l2c=m.type==="log"?E:i,m.l2p=_e,m.p2l=Y,m.c2p=m.type==="log"?function(ne,ye){return _e(U(ne,ye))}:_e,m.p2c=m.type==="log"?function(ne){return E(Y(ne))}:Y,["linear","-"].indexOf(m.type)!==-1?(m.d2r=m.r2d=m.d2c=m.r2c=m.d2l=m.r2l=r,m.c2d=m.c2r=m.l2d=m.l2r=i,m.d2p=m.r2p=function(ne){return m.l2p(r(ne))},m.p2d=m.p2r=Y,m.cleanPos=i):m.type==="log"?(m.d2r=m.d2l=function(ne,ye){return U(r(ne),ye)},m.r2d=m.r2c=function(ne){return E(r(ne))},m.d2c=m.r2l=r,m.c2d=m.l2r=i,m.c2r=U,m.l2d=E,m.d2p=function(ne,ye){return m.l2p(m.d2r(ne,ye))},m.p2d=function(ne){return E(Y(ne))},m.r2p=function(ne){return m.l2p(r(ne))},m.p2r=Y,m.cleanPos=i):m.type==="date"?(m.d2r=m.r2d=M.identity,m.d2c=m.r2c=m.d2l=m.r2l=V,m.c2d=m.c2r=m.l2d=m.l2r=G,m.d2p=m.r2p=function(ne,ye,le){return m.l2p(V(ne,0,le))},m.p2d=m.p2r=function(ne,ye,le){return G(Y(ne),ye,le)},m.cleanPos=function(ne){return M.cleanDate(ne,p,m.calendar)}):m.type==="category"?(m.d2c=m.d2l=O,m.r2d=m.c2d=m.l2d=j,m.d2r=m.d2l_noadd=ee,m.r2c=function(ne){var ye=ue(ne);return ye!==void 0?ye:m.fraction2r(.5)},m.l2r=m.c2r=i,m.r2l=ue,m.d2p=function(ne){return m.l2p(m.r2c(ne))},m.p2d=function(ne){return j(Y(ne))},m.r2p=m.d2p,m.p2r=Y,m.cleanPos=function(ne){return typeof ne=="string"&&ne!==""?ne:i(ne)}):m.type==="multicategory"&&(m.r2d=m.c2d=m.l2d=j,m.d2r=m.d2l_noadd=ee,m.r2c=function(ne){var ye=ee(ne);return ye!==void 0?ye:m.fraction2r(.5)},m.r2c_just_indices=W,m.l2r=m.c2r=i,m.r2l=ee,m.d2p=function(ne){return m.l2p(m.r2c(ne))},m.p2d=function(ne){return j(Y(ne))},m.r2p=m.d2p,m.p2r=Y,m.cleanPos=function(ne){return Array.isArray(ne)||typeof ne=="string"&&ne!==""?ne:i(ne)},m.setupMultiCategory=function(ne){var ye=m._traceIndices,le,Z,de=m._matchGroup;if(de&&m._categories.length===0){for(var pe in de)if(pe!==F){var Te=w[A.id2name(pe)];ye=ye.concat(Te._traceIndices)}}var Ne=[[0,{}],[0,{}]],$e=[];for(le=0;leTe[1]&&(Z[pe?0:1]=le),Z[0]===Z[1]){var Ne=m.l2r(ye),$e=m.l2r(le);if(ye!==void 0){var Ze=Ne+1;le!==void 0&&(Ze=Math.min(Ze,$e)),Z[pe?1:0]=Ze}if(le!==void 0){var Xe=$e+1;ye!==void 0&&(Xe=Math.max(Xe,Ne)),Z[pe?0:1]=Xe}}}},m.cleanRange=function(ne,ye){m._cleanRange(ne,ye),m.limitRange(ne)},m._cleanRange=function(ne,ye){ye||(ye={}),ne||(ne="range");var le=M.nestedProperty(m,ne).get(),Z,de;if(m.type==="date"?de=M.dfltRange(m.calendar):z==="y"?de=k.DFLTRANGEY:m._name==="realaxis"?de=[0,1]:de=ye.dfltRange||k.DFLTRANGEX,de=de.slice(),(m.rangemode==="tozero"||m.rangemode==="nonnegative")&&(de[0]=0),!le||le.length!==2){M.nestedProperty(m,ne).set(de);return}var pe=le[0]===null,Te=le[1]===null;for(m.type==="date"&&!m.autorange&&(le[0]=M.cleanDate(le[0],p,m.calendar),le[1]=M.cleanDate(le[1],p,m.calendar)),Z=0;Z<2;Z++)if(m.type==="date"){if(!M.isDateTime(le[Z],m.calendar)){m[ne]=de;break}if(m.r2l(le[0])===m.r2l(le[1])){var Ne=M.constrain(m.r2l(le[0]),M.MIN_MS+1e3,M.MAX_MS-1e3);le[0]=m.l2r(Ne-1e3),le[1]=m.l2r(Ne+1e3);break}}else{if(!t(le[Z]))if(!(pe||Te)&&t(le[1-Z]))le[Z]=le[1-Z]*(Z?10:.1);else{m[ne]=de;break}if(le[Z]<-c?le[Z]=-c:le[Z]>c&&(le[Z]=c),le[0]===le[1]){var $e=Math.max(1,Math.abs(le[0]*1e-6));le[0]-=$e,le[1]+=$e}}},m.setScale=function(ne){var ye=w._size;if(m.overlaying){var le=A.getFromId({_fullLayout:w},m.overlaying);m.domain=le.domain}var Z=ne&&m._r?"_r":"range",de=m.calendar;m.cleanRange(Z);var pe=m.r2l(m[Z][0],de),Te=m.r2l(m[Z][1],de),Ne=z==="y";if(Ne?(m._offset=ye.t+(1-m.domain[1])*ye.h,m._length=ye.h*(m.domain[1]-m.domain[0]),m._m=m._length/(pe-Te),m._b=-m._m*Te):(m._offset=ye.l+m.domain[0]*ye.w,m._length=ye.w*(m.domain[1]-m.domain[0]),m._m=m._length/(Te-pe),m._b=-m._m*pe),m._rangebreaks=[],m._lBreaks=0,m._m2=0,m._B=[],m.rangebreaks){var $e,Ze;if(m._rangebreaks=m.locateBreaks(Math.min(pe,Te),Math.max(pe,Te)),m._rangebreaks.length){for($e=0;$eTe&&(Xe=!Xe),Xe&&m._rangebreaks.reverse();var it=Xe?-1:1;for(m._m2=it*m._length/(Math.abs(Te-pe)-m._lBreaks),m._B.push(-m._m2*(Ne?Te:pe)),$e=0;$ede&&(de+=7,pede&&(de+=24,pe=Z&&pe=Z&&ne=vt.min&&(Sevt.max&&(vt.max=Je),_t=!1)}_t&&Te.push({min:Se,max:Je})}};for(le=0;lex*2}function o(d){return Math.max(1,(d-1)/1e3)}function c(d,y){for(var g=d.length,C=o(g),f=0,x=0,A={},k=0;kf*2}function p(d){return L(d[0])&&L(d[1])}}}),vg=Re({"src/plots/cartesian/autorange.js"(ae,K){var v=un(),S=da(),M=Rn(),L=Ia().FP_SAFE,t=es(),r=qs(),a=fh(),l=a.getFromId,i=a.isLinked;K.exports={applyAutorangeOptions:m,getAutoRange:s,makePadFn:c,doAutoRange:g,findExtremes:C,concatExtremes:y};function s(w,F){var z,U,V=[],G=w._fullLayout,j=c(G,F,0),O=c(G,F,1),H=y(w,F),W=H.min,ee=H.max;if(W.length===0||ee.length===0)return M.simpleMap(F.range,F.r2l);var ue=W[0].val,xe=ee[0].val;for(z=1;z0&&($e=ye-j(de)-O(pe),$e>le?Ze/$e>Z&&(Te=de,Ne=pe,Z=Ze/$e):Ze/ye>Z&&(Te={val:de.val,nopad:1},Ne={val:pe.val,nopad:1},Z=Ze/ye));function Xe(ht,Ve){return Math.max(ht,O(Ve))}if(ue===xe){var it=ue-1,yt=ue+1;if(ce)if(ue===0)V=[0,1];else{var bt=(ue>0?ee:W).reduce(Xe,0),mt=ue/(1-Math.min(.5,bt/ye));V=ue>0?[0,mt]:[mt,0]}else ne?V=[Math.max(0,it),Math.max(1,yt)]:V=[it,yt]}else ce?(Te.val>=0&&(Te={val:0,nopad:1}),Ne.val<=0&&(Ne={val:0,nopad:1})):ne&&(Te.val-Z*j(Te)<0&&(Te={val:0,nopad:1}),Ne.val<=0&&(Ne={val:1,nopad:1})),Z=(Ne.val-Te.val-o(F,de.val,pe.val))/(ye-j(Te)-O(Ne)),V=[Te.val-Z*j(Te),Ne.val+Z*O(Ne)];return V=m(V,F),F.limitRange&&F.limitRange(),_e&&V.reverse(),M.simpleMap(V,F.l2r||Number)}function o(w,F,z){var U=0;if(w.rangebreaks)for(var V=w.locateBreaks(F,z),G=0;G0?z.ppadplus:z.ppadminus)||z.ppad||0),de=le((w._m>0?z.ppadminus:z.ppadplus)||z.ppad||0),pe=le(z.vpadplus||z.vpad),Te=le(z.vpadminus||z.vpad);if(!W){if(ne=1/0,ye=-1/0,H)for(ue=0;ue0&&(ne=xe),xe>ye&&xe-L&&(ne=xe),xe>ye&&xe=Ze;ue--)$e(ue);return{min:U,max:V,opts:z}}function f(w,F,z,U){A(w,F,z,U,I)}function x(w,F,z,U){A(w,F,z,U,T)}function A(w,F,z,U,V){for(var G=U.tozero,j=U.extrapad,O=!0,H=0;H=z&&(W.extrapad||!j)){O=!1;break}else V(F,W.val)&&W.pad<=z&&(j||!W.extrapad)&&(w.splice(H,1),H--)}if(O){var ee=G&&F===0;w.push({val:F,pad:ee?0:z,extrapad:ee?!1:j})}}function k(w){return S(w)&&Math.abs(w)=F}function E(w,F){var z=F.autorangeoptions;return z&&z.minallowed!==void 0&&h(F,z.minallowed,z.maxallowed)?z.minallowed:z&&z.clipmin!==void 0&&h(F,z.clipmin,z.clipmax)?Math.max(w,F.d2l(z.clipmin)):w}function _(w,F){var z=F.autorangeoptions;return z&&z.maxallowed!==void 0&&h(F,z.minallowed,z.maxallowed)?z.maxallowed:z&&z.clipmax!==void 0&&h(F,z.clipmin,z.clipmax)?Math.min(w,F.d2l(z.clipmax)):w}function h(w,F,z){return F!==void 0&&z!==void 0?(F=w.d2l(F),z=w.d2l(z),F=H&&(G=H,z=H),j<=H&&(j=H,U=H)}}return z=E(z,F),U=_(U,F),[z,U]}}}),js=Re({"src/plots/cartesian/axes.js"(ae,K){var v=un(),S=da(),M=If(),L=es(),t=Rn(),r=t.strTranslate,a=kc(),l=vy(),i=ko(),s=qs(),o=Hd(),c=Z2(),p=Ia(),d=p.ONEMAXYEAR,y=p.ONEAVGYEAR,g=p.ONEMINYEAR,C=p.ONEMAXQUARTER,f=p.ONEAVGQUARTER,x=p.ONEMINQUARTER,A=p.ONEMAXMONTH,k=p.ONEAVGMONTH,I=p.ONEMINMONTH,T=p.ONEWEEK,E=p.ONEDAY,_=E/2,h=p.ONEHOUR,m=p.ONEMIN,w=p.ONESEC,F=p.ONEMILLI,z=p.ONEMICROSEC,U=p.MINUS_SIGN,V=p.BADNUM,G={K:"zeroline"},j={K:"gridline",L:"path"},O={K:"minor-gridline",L:"path"},H={K:"tick",L:"path"},W={K:"tick",L:"text"},ee={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},ue=qd(),xe=ue.MID_SHIFT,ge=ue.CAP_SHIFT,_e=ue.LINE_SPACING,Y=ue.OPPOSITE_SIDE,se=3,ce=K.exports={};ce.setConvert=bm();var ne=my(),ye=fh(),le=ye.idSort,Z=ye.isLinked;ce.id2name=ye.id2name,ce.name2id=ye.name2id,ce.cleanId=ye.cleanId,ce.list=ye.list,ce.listIds=ye.listIds,ce.getFromId=ye.getFromId,ce.getFromTrace=ye.getFromTrace;var de=vg();ce.getAutoRange=de.getAutoRange,ce.findExtremes=de.findExtremes;var pe=1e-4;function Te(Xt){var Lt=(Xt[1]-Xt[0])*pe;return[Xt[0]-Lt,Xt[1]+Lt]}ce.coerceRef=function(Xt,Lt,$r,en,rn,Wr){var tn=en.charAt(en.length-1),wn=$r._fullLayout._subplots[tn+"axis"],dn=en+"ref",Nt={};return rn||(rn=wn[0]||(typeof Wr=="string"?Wr:Wr[0])),Wr||(Wr=rn),wn=wn.concat(wn.map(function(xr){return xr+" domain"})),Nt[dn]={valType:"enumerated",values:wn.concat(Wr?typeof Wr=="string"?[Wr]:Wr:[]),dflt:rn},t.coerce(Xt,Lt,Nt,dn)},ce.getRefType=function(Xt){return Xt===void 0?Xt:Xt==="paper"?"paper":Xt==="pixel"?"pixel":/( domain)$/.test(Xt)?"domain":"range"},ce.coercePosition=function(Xt,Lt,$r,en,rn,Wr){var tn,wn,dn=ce.getRefType(en);if(dn!=="range")tn=t.ensureNumber,wn=$r(rn,Wr);else{var Nt=ce.getFromId(Lt,en);Wr=Nt.fraction2r(Wr),wn=$r(rn,Wr),tn=Nt.cleanPos}Xt[rn]=tn(wn)},ce.cleanPosition=function(Xt,Lt,$r){var en=$r==="paper"||$r==="pixel"?t.ensureNumber:ce.getFromId(Lt,$r).cleanPos;return en(Xt)},ce.redrawComponents=function(Xt,Lt){Lt=Lt||ce.listIds(Xt);var $r=Xt._fullLayout;function en(rn,Wr,tn,wn){for(var dn=L.getComponentMethod(rn,Wr),Nt={},xr=0;xr2e-6||(($r-Xt._forceTick0)/Xt._minDtick%1+1.000001)%1>2e-6)&&(Xt._minDtick=0))},ce.saveRangeInitial=function(Xt,Lt){for(var $r=ce.list(Xt,"",!0),en=!1,rn=0;rn<$r.length;rn++){var Wr=$r[rn],tn=Wr._rangeInitial0===void 0&&Wr._rangeInitial1===void 0,wn=tn||Wr.range[0]!==Wr._rangeInitial0||Wr.range[1]!==Wr._rangeInitial1,dn=Wr.autorange;(tn&&dn!==!0||Lt&&wn)&&(Wr._rangeInitial0=dn==="min"||dn==="max reversed"?void 0:Wr.range[0],Wr._rangeInitial1=dn==="max"||dn==="min reversed"?void 0:Wr.range[1],Wr._autorangeInitial=dn,en=!0)}return en},ce.saveShowSpikeInitial=function(Xt,Lt){for(var $r=ce.list(Xt,"",!0),en=!1,rn="on",Wr=0;Wr<$r.length;Wr++){var tn=$r[Wr],wn=tn._showSpikeInitial===void 0,dn=wn||tn.showspikes!==tn._showspikes;(wn||Lt&&dn)&&(tn._showSpikeInitial=tn.showspikes,en=!0),rn==="on"&&!tn.showspikes&&(rn="off")}return Xt._fullLayout._cartesianSpikesEnabled=rn,en},ce.autoBin=function(Xt,Lt,$r,en,rn,Wr){var tn=t.aggNums(Math.min,null,Xt),wn=t.aggNums(Math.max,null,Xt);if(Lt.type==="category"||Lt.type==="multicategory")return{start:tn-.5,end:wn+.5,size:Math.max(1,Math.round(Wr)||1),_dataSpan:wn-tn};rn||(rn=Lt.calendar);var dn;if(Lt.type==="log"?dn={type:"linear",range:[tn,wn]}:dn={type:Lt.type,range:t.simpleMap([tn,wn],Lt.c2r,0,rn),calendar:rn},ce.setConvert(dn),Wr=Wr&&c.dtick(Wr,dn.type),Wr)dn.dtick=Wr,dn.tick0=c.tick0(void 0,dn.type,rn);else{var Nt;if($r)Nt=(wn-tn)/$r;else{var xr=t.distinctVals(Xt),Xr=Math.pow(10,Math.floor(Math.log(xr.minDiff)/Math.LN10)),Tn=Xr*t.roundUp(xr.minDiff/Xr,[.9,1.9,4.9,9.9],!0);Nt=Math.max(Tn,2*t.stdev(Xt)/Math.pow(Xt.length,en?.25:.4)),S(Nt)||(Nt=1)}ce.autoTicks(dn,Nt)}var Xn=dn.dtick,ia=ce.tickIncrement(ce.tickFirst(dn),Xn,"reverse",rn),na,An;if(typeof Xn=="number")ia=Xe(ia,Xt,dn,tn,wn),An=1+Math.floor((wn-ia)/Xn),na=ia+An*Xn;else for(dn.dtick.charAt(0)==="M"&&(ia=it(ia,Xt,Xn,tn,rn)),na=ia,An=0;na<=wn;)na=ce.tickIncrement(na,Xn,!1,rn),An++;return{start:Lt.c2r(ia,0,rn),end:Lt.c2r(na,0,rn),size:Xn,_dataSpan:wn-tn}};function Xe(Xt,Lt,$r,en,rn){var Wr=0,tn=0,wn=0,dn=0;function Nt(Xn){return(1+(Xn-Xt)*100/$r.dtick)%100<2}for(var xr=0;xrXr*.3||Nt(en)||Nt(rn))){var Tn=$r.dtick/2;Xt+=Xt+Tntn){var wn=Number($r.slice(1));Wr.exactYears>tn&&wn%12===0?Xt=ce.tickIncrement(Xt,"M6","reverse")+E*1.5:Wr.exactMonths>tn?Xt=ce.tickIncrement(Xt,"M1","reverse")+E*15.5:Xt-=_;var dn=ce.tickIncrement(Xt,$r);if(dn<=en)return dn}return Xt}ce.prepMinorTicks=function(Xt,Lt,$r){if(!Lt.minor.dtick){delete Xt.dtick;var en=Lt.dtick&&S(Lt._tmin),rn;if(en){var Wr=ce.tickIncrement(Lt._tmin,Lt.dtick,!0);rn=[Lt._tmin,Wr*.99+Lt._tmin*.01]}else{var tn=t.simpleMap(Lt.range,Lt.r2l);rn=[tn[0],.8*tn[0]+.2*tn[1]]}if(Xt.range=t.simpleMap(rn,Lt.l2r),Xt._isMinor=!0,ce.prepTicks(Xt,$r),en){var wn=S(Lt.dtick),dn=S(Xt.dtick),Nt=wn?Lt.dtick:+Lt.dtick.substring(1),xr=dn?Xt.dtick:+Xt.dtick.substring(1);wn&&dn?yt(Nt,xr)?Nt===2*T&&xr===2*E&&(Xt.dtick=T):Nt===2*T&&xr===3*E?Xt.dtick=T:Nt===T&&!(Lt._input.minor||{}).nticks?Xt.dtick=E:bt(Nt/xr,2.5)?Xt.dtick=Nt/2:Xt.dtick=Nt:String(Lt.dtick).charAt(0)==="M"?dn?Xt.dtick="M1":yt(Nt,xr)?Nt>=12&&xr===2&&(Xt.dtick="M3"):Xt.dtick=Lt.dtick:String(Xt.dtick).charAt(0)==="L"?String(Lt.dtick).charAt(0)==="L"?yt(Nt,xr)||(Xt.dtick=bt(Nt/xr,2.5)?Lt.dtick/2:Lt.dtick):Xt.dtick="D1":Xt.dtick==="D2"&&+Lt.dtick>1&&(Xt.dtick=1)}Xt.range=Lt.range}Lt.minor._tick0Init===void 0&&(Xt.tick0=Lt.tick0)};function yt(Xt,Lt){return Math.abs((Xt/Lt+.5)%1-.5)<.001}function bt(Xt,Lt){return Math.abs(Xt/Lt-1)<.001}ce.prepTicks=function(Xt,Lt){var $r=t.simpleMap(Xt.range,Xt.r2l,void 0,void 0,Lt);if(Xt.tickmode==="auto"||!Xt.dtick){var en=Xt.nticks,rn;en||(Xt.type==="category"||Xt.type==="multicategory"?(rn=Xt.tickfont?t.bigFont(Xt.tickfont.size||12):15,en=Xt._length/rn):(rn=Xt._id.charAt(0)==="y"?40:80,en=t.constrain(Xt._length/rn,4,9)+1),Xt._name==="radialaxis"&&(en*=2)),Xt.minor&&Xt.minor.tickmode!=="array"||Xt.tickmode==="array"&&(en*=100),Xt._roughDTick=Math.abs($r[1]-$r[0])/en,ce.autoTicks(Xt,Xt._roughDTick),Xt._minDtick>0&&Xt.dtick0?(Wr=en-1,tn=en):(Wr=en,tn=en);var wn=Xt[Wr].value,dn=Xt[tn].value,Nt=Math.abs(dn-wn),xr=$r||Nt,Xr=0;xr>=g?Nt>=g&&Nt<=d?Xr=Nt:Xr=y:$r===f&&xr>=x?Nt>=x&&Nt<=C?Xr=Nt:Xr=f:xr>=I?Nt>=I&&Nt<=A?Xr=Nt:Xr=k:$r===T&&xr>=T?Xr=T:xr>=E?Xr=E:$r===_&&xr>=_?Xr=_:$r===h&&xr>=h&&(Xr=h);var Tn;Xr>=Nt&&(Xr=Nt,Tn=!0);var Xn=rn+Xr;if(Lt.rangebreaks&&Xr>0){for(var ia=84,na=0,An=0;AnT&&(Xr=Nt)}(Xr>0||en===0)&&(Xt[en].periodX=rn+Xr/2)}}ce.calcTicks=function(Lt,$r){for(var en=Lt.type,rn=Lt.calendar,Wr=Lt.ticklabelstep,tn=Lt.ticklabelmode==="period",wn=Lt.range[0]>Lt.range[1],dn=!Lt.ticklabelindex||t.isArrayOrTypedArray(Lt.ticklabelindex)?Lt.ticklabelindex:[Lt.ticklabelindex],Nt=t.simpleMap(Lt.range,Lt.r2l,void 0,void 0,$r),xr=Nt[1]=(Ga?0:1);to--){var _o=!to;to?(Lt._dtickInit=Lt.dtick,Lt._tick0Init=Lt.tick0):(Lt.minor._dtickInit=Lt.minor.dtick,Lt.minor._tick0Init=Lt.minor.tick0);var Po=to?Lt:t.extendFlat({},Lt,Lt.minor);if(_o?ce.prepMinorTicks(Po,Lt,$r):ce.prepTicks(Po,$r),Po.tickmode==="array"){to?(An=[],ia=Je(Lt,!_o)):(Yn=[],na=Je(Lt,!_o));continue}if(Po.tickmode==="sync"){An=[],ia=Se(Lt);continue}var Ro=Te(Nt),Xo=Ro[0],Oi=Ro[1],bs=S(Po.dtick),cs=en==="log"&&!(bs||Po.dtick.charAt(0)==="L"),fl=ce.tickFirst(Po,$r);if(to){if(Lt._tmin=fl,fl=Oi:ys<=Oi;ys=ce.tickIncrement(ys,ll,xr,rn)){if(to&&ss++,Po.rangebreaks&&!xr){if(ys=Tn)break}if(An.length>Xn||ys===Is)break;Is=ys;var Il={value:ys};to?(cs&&ys!==(ys|0)&&(Il.simpleLabel=!0),Wr>1&&ss%Wr&&(Il.skipLabel=!0),An.push(Il)):(Il.minor=!0,Yn.push(Il))}}if(!Yn||Yn.length<2)dn=!1;else{var Ls=(Yn[1].value-Yn[0].value)*(wn?-1:1);Qi(Ls,Lt.tickformat)||(dn=!1)}if(!dn)qi=An;else{var ps=An.concat(Yn);tn&&An.length&&(ps=ps.slice(1)),ps=ps.sort(function(ts,Iu){return ts.value-Iu.value}).filter(function(ts,Iu,zu){return Iu===0||ts.value!==zu[Iu-1].value});var Uo=ps.map(function(ts,Iu){return ts.minor===void 0&&!ts.skipLabel?Iu:null}).filter(function(ts){return ts!==null});Uo.forEach(function(ts){dn.map(function(Iu){var zu=ts+Iu;zu>=0&&zu-1;Qs--){if(An[Qs].drop){An.splice(Qs,1);continue}An[Qs].value=La(An[Qs].value,Lt);var Rl=Lt.c2p(An[Qs].value);(as?dl>Rl-tu:dlTn||nlTn&&(zu.periodX=Tn),nlrn&&Tny)Lt/=y,en=rn(10),Xt.dtick="M"+12*Ur(Lt,en,_t);else if(Wr>k)Lt/=k,Xt.dtick="M"+Ur(Lt,1,At);else if(Wr>E){if(Xt.dtick=Ur(Lt,E,Xt._hasDayOfWeekBreaks?[1,2,7,14]:Kt),!$r){var tn=ce.getTickFormat(Xt),wn=Xt.ticklabelmode==="period";wn&&(Xt._rawTick0=Xt.tick0),/%[uVW]/.test(tn)?Xt.tick0=t.dateTick0(Xt.calendar,2):Xt.tick0=t.dateTick0(Xt.calendar,1),wn&&(Xt._dowTick0=Xt.tick0)}}else Wr>h?Xt.dtick=Ur(Lt,h,At):Wr>m?Xt.dtick=Ur(Lt,m,vt):Wr>w?Xt.dtick=Ur(Lt,w,vt):(en=rn(10),Xt.dtick=Ur(Lt,en,_t))}else if(Xt.type==="log"){Xt.tick0=0;var dn=t.simpleMap(Xt.range,Xt.r2l);if(Xt._isMinor&&(Lt*=1.5),Lt>.7)Xt.dtick=Math.ceil(Lt);else if(Math.abs(dn[1]-dn[0])<1){var Nt=1.5*Math.abs((dn[1]-dn[0])/Lt);Lt=Math.abs(Math.pow(10,dn[1])-Math.pow(10,dn[0]))/Nt,en=rn(10),Xt.dtick="L"+Ur(Lt,en,_t)}else Xt.dtick=Lt>.3?"D2":"D1"}else Xt.type==="category"||Xt.type==="multicategory"?(Xt.tick0=0,Xt.dtick=Math.ceil(Math.max(Lt,1))):Pa(Xt)?(Xt.tick0=0,en=1,Xt.dtick=Ur(Lt,en,mr)):(Xt.tick0=0,en=rn(10),Xt.dtick=Ur(Lt,en,_t));if(Xt.dtick===0&&(Xt.dtick=1),!S(Xt.dtick)&&typeof Xt.dtick!="string"){var xr=Xt.dtick;throw Xt.dtick=1,"ax.dtick error: "+String(xr)}};function Br(Xt){var Lt=Xt.dtick;if(Xt._tickexponent=0,!S(Lt)&&typeof Lt!="string"&&(Lt=1),(Xt.type==="category"||Xt.type==="multicategory")&&(Xt._tickround=null),Xt.type==="date"){var $r=Xt.r2l(Xt.tick0),en=Xt.l2r($r).replace(/(^-|i)/g,""),rn=en.length;if(String(Lt).charAt(0)==="M")rn>10||en.slice(5)!=="01-01"?Xt._tickround="d":Xt._tickround=+Lt.slice(1)%12===0?"y":"m";else if(Lt>=E&&rn<=10||Lt>=E*15)Xt._tickround="d";else if(Lt>=m&&rn<=16||Lt>=h)Xt._tickround="M";else if(Lt>=w&&rn<=19||Lt>=m)Xt._tickround="S";else{var Wr=Xt.l2r($r+Lt).replace(/^-/,"").length;Xt._tickround=Math.max(rn,Wr)-20,Xt._tickround<0&&(Xt._tickround=4)}}else if(S(Lt)||Lt.charAt(0)==="L"){var tn=Xt.range.map(Xt.r2d||Number);S(Lt)||(Lt=Number(Lt.slice(1))),Xt._tickround=2-Math.floor(Math.log(Lt)/Math.LN10+.01);var wn=Math.max(Math.abs(tn[0]),Math.abs(tn[1])),dn=Math.floor(Math.log(wn)/Math.LN10+.01),Nt=Xt.minexponent===void 0?3:Xt.minexponent;Math.abs(dn)>Nt&&(at(Xt.exponentformat)&&Xt.exponentformat!=="SI extended"&&!ct(dn)||at(Xt.exponentformat)&&Xt.exponentformat==="SI extended"&&!Gt(dn)?Xt._tickexponent=3*Math.round((dn-1)/3):Xt._tickexponent=dn)}else Xt._tickround=null}ce.tickIncrement=function(Xt,Lt,$r,en){var rn=$r?-1:1;if(S(Lt))return t.increment(Xt,rn*Lt);var Wr=Lt.charAt(0),tn=rn*Number(Lt.slice(1));if(Wr==="M")return t.incrementMonth(Xt,tn,en);if(Wr==="L")return Math.log(Math.pow(10,Xt)+tn)/Math.LN10;if(Wr==="D"){var wn=Lt==="D2"?fr:Qt,dn=Xt+rn*.01,Nt=t.roundUp(t.mod(dn,1),wn,$r);return Math.floor(dn)+Math.log(v.round(Math.pow(10,Nt),1))/Math.LN10}throw"unrecognized dtick "+String(Lt)},ce.tickFirst=function(Xt,Lt){var $r=Xt.r2l||Number,en=t.simpleMap(Xt.range,$r,void 0,void 0,Lt),rn=en[1]=0&&Yn<=Xt._length?An:null};if(Wr&&t.isArrayOrTypedArray(Xt.ticktext)){var Xr=t.simpleMap(Xt.range,Xt.r2l),Tn=(Math.abs(Xr[1]-Xr[0])-(Xt._lBreaks||0))/1e4;for(Nt=0;Nt"+wn;else{var Nt=Oa(Xt),xr=Xt._trueSide||Xt.side;(!Nt&&xr==="top"||Nt&&xr==="bottom")&&(tn+="
")}Lt.text=tn}function Qr(Xt,Lt,$r,en,rn){var Wr=Xt.dtick,tn=Lt.x,wn=Xt.tickformat,dn=typeof Wr=="string"&&Wr.charAt(0);if(rn==="never"&&(rn=""),en&&dn!=="L"&&(Wr="L3",dn="L"),wn||dn==="L")Lt.text=Zt(Math.pow(10,tn),Xt,rn,en);else if(S(Wr)||dn==="D"&&(Xt.minorloglabels==="complete"||t.mod(tn+.01,1)<.1)){Xt.minorloglabels==="complete"&&!(t.mod(tn+.01,1)<.1)&&(Lt.fontSize*=.75);var Nt=Math.pow(10,tn).toExponential(0),xr=Nt.split("e"),Xr=+xr[1],Tn=Math.abs(Xr),Xn=Xt.exponentformat;Xn==="power"||at(Xn)&&Xn!=="SI extended"&&ct(Xr)||at(Xn)&&Xn==="SI extended"&&Gt(Xr)?(Lt.text=xr[0],Tn>0&&(Lt.text+="x10"),Lt.text==="1x10"&&(Lt.text="10"),Xr!==0&&Xr!==1&&(Lt.text+=""+(Xr>0?"":U)+Tn+""),Lt.fontSize*=1.25):(Xn==="e"||Xn==="E")&&Tn>2?Lt.text=xr[0]+Xn+(Xr>0?"+":U)+Tn:(Lt.text=Zt(Math.pow(10,tn),Xt,"","fakehover"),Wr==="D1"&&Xt._id.charAt(0)==="y"&&(Lt.dy-=Lt.fontSize/6))}else if(dn==="D")Lt.text=Xt.minorloglabels==="none"?"":String(Math.round(Math.pow(10,t.mod(tn,1)))),Lt.fontSize*=.75;else throw"unrecognized dtick "+String(Wr);if(Xt.dtick==="D1"){var ia=String(Lt.text).charAt(0);(ia==="0"||ia==="1")&&(Xt._id.charAt(0)==="y"?Lt.dx-=Lt.fontSize/4:(Lt.dy+=Lt.fontSize/2,Lt.dx+=(Xt.range[1]>Xt.range[0]?1:-1)*Lt.fontSize*(tn<0?.5:.25)))}}function Bt(Xt,Lt){var $r=Xt._categories[Math.round(Lt.x)];$r===void 0&&($r=""),Lt.text=String($r)}function et(Xt,Lt,$r){var en=Math.round(Lt.x),rn=Xt._categories[en]||[],Wr=rn[1]===void 0?"":String(rn[1]),tn=rn[0]===void 0?"":String(rn[0]);$r?Lt.text=tn+" - "+Wr:(Lt.text=Wr,Lt.text2=tn)}function ut(Xt,Lt,$r,en,rn){rn==="never"?rn="":Xt.showexponent==="all"&&Math.abs(Lt.x/Xt.dtick)<1e-6&&(rn="hide"),Lt.text=Zt(Lt.x,Xt,rn,en)}function Be(Xt,Lt,$r,en,rn){if(Xt.thetaunit==="radians"&&!$r){var Wr=Lt.x/180;if(Wr===0)Lt.text="0";else{var tn=Ie(Wr);if(tn[1]>=100)Lt.text=Zt(t.deg2rad(Lt.x),Xt,rn,en);else{var wn=Lt.x<0;tn[1]===1?tn[0]===1?Lt.text="π":Lt.text=tn[0]+"π":Lt.text=["",tn[0],"","⁄","",tn[1],"","π"].join(""),wn&&(Lt.text=U+Lt.text)}}}else Lt.text=Zt(Lt.x,Xt,rn,en)}function Ie(Xt){function Lt(wn,dn){return Math.abs(wn-dn)<=1e-6}function $r(wn,dn){return Lt(dn,0)?wn:$r(dn,wn%dn)}function en(wn){for(var dn=1;!Lt(Math.round(wn*dn)/dn,wn);)dn*=10;return dn}var rn=en(Xt),Wr=Xt*rn,tn=Math.abs($r(Wr,rn));return[Math.round(Wr/tn),Math.round(rn/tn)]}var ke=["f","p","n","μ","m","","k","M","G","T"],Fe=["q","r","y","z","a",...ke,"P","E","Z","Y","R","Q"],at=Xt=>["SI","SI extended","B"].includes(Xt);function ct(Xt){return Xt>14||Xt<-15}function Gt(Xt){return Xt>32||Xt<-30}function Vt(Xt,Lt){return at(Lt)?!!(Lt==="SI extended"&&Gt(Xt)||Lt!=="SI extended"&&ct(Xt)):!1}function Zt(Xt,Lt,$r,en){var rn=Xt<0,Wr=Lt._tickround,tn=$r||Lt.exponentformat||"B",wn=Lt._tickexponent,dn=ce.getTickFormat(Lt),Nt=Lt.separatethousands;if(en){var xr={exponentformat:tn,minexponent:Lt.minexponent,dtick:Lt.showexponent==="none"?Lt.dtick:S(Xt)&&Math.abs(Xt)||1,range:Lt.showexponent==="none"?Lt.range.map(Lt.r2d):[0,Xt||1]};Br(xr),Wr=(Number(xr._tickround)||0)+4,wn=xr._tickexponent,Lt.hoverformat&&(dn=Lt.hoverformat)}if(dn)return Lt._numFormat(dn)(Xt).replace(/-/g,U);var Xr=Math.pow(10,-Wr)/2;if(tn==="none"&&(wn=0),Xt=Math.abs(Xt),Xt"+ia+"":tn==="B"&&wn===9?Xt+="B":at(tn)&&(Xt+=tn==="SI extended"?Fe[wn/3+10]:ke[wn/3+5])}return rn?U+Xt:Xt}ce.getTickFormat=function(Xt){var Lt;function $r(dn){return typeof dn!="string"?dn:Number(dn.replace("M",""))*k}function en(dn,Nt){var xr=["L","D"];if(typeof dn==typeof Nt){if(typeof dn=="number")return dn-Nt;var Xr=xr.indexOf(dn.charAt(0)),Tn=xr.indexOf(Nt.charAt(0));return Xr===Tn?Number(dn.replace(/(L|D)/g,""))-Number(Nt.replace(/(L|D)/g,"")):Xr-Tn}else return typeof dn=="number"?1:-1}function rn(dn,Nt,xr){var Xr=xr||function(ia){return ia},Tn=Nt[0],Xn=Nt[1];return(!Tn&&typeof Tn!="number"||Xr(Tn)<=Xr(dn))&&(!Xn&&typeof Xn!="number"||Xr(Xn)>=Xr(dn))}function Wr(dn,Nt){var xr=Nt[0]===null,Xr=Nt[1]===null,Tn=en(dn,Nt[0])>=0,Xn=en(dn,Nt[1])<=0;return(xr||Tn)&&(Xr||Xn)}var tn,wn;if(Xt.tickformatstops&&Xt.tickformatstops.length>0)switch(Xt.type){case"date":case"linear":{for(Lt=0;Lt=0&&rn.unshift(rn.splice(xr,1).shift())}});var wn={false:{left:0,right:0}};return t.syncOrAsync(rn.map(function(dn){return function(){if(dn){var Nt=ce.getFromId(Xt,dn);$r||($r={}),$r.axShifts=wn,$r.overlayingShiftedAx=tn;var xr=ce.drawOne(Xt,Nt,$r);return Nt._shiftPusher&&sa(Nt,Nt._fullDepth||0,wn,!0),Nt._r=Nt.range.slice(),Nt._rl=t.simpleMap(Nt._r,Nt.r2l),xr}}}))},ce.drawOne=function(Xt,Lt,$r){$r=$r||{};var en=$r.axShifts||{},rn=$r.overlayingShiftedAx||[],Wr,tn,wn;Lt.setScale();var dn=Xt._fullLayout,Nt=Lt._id,xr=Nt.charAt(0),Xr=ce.counterLetter(Nt),Tn=dn._plots[Lt._mainSubplot],Xn=Lt.zerolinelayer==="above traces";if(!Tn)return;if(Lt._shiftPusher=Lt.autoshift||rn.indexOf(Lt._id)!==-1||rn.indexOf(Lt.overlaying)!==-1,Lt._shiftPusher&Lt.anchor==="free"){var ia=Lt.linewidth/2||0;Lt.ticks==="inside"&&(ia+=Lt.ticklen),sa(Lt,ia,en,!0),sa(Lt,Lt.shift||0,en,!1)}($r.skipTitle!==!0||Lt._shift===void 0)&&(Lt._shift=ji(Lt,en));var na=Tn[xr+"axislayer"],An=Lt._mainLinePosition,Yn=An+=Lt._shift,qi=Lt._mainMirrorPosition,Ga=Lt._vals=ce.calcTicks(Lt),to=[Lt.mirror,Yn,qi].join("_");for(Wr=0;Wr0?nl.bottom-Iu:0,zu))));var vc=0,jf=0;if(Lt._shiftPusher&&(vc=Math.max(zu,nl.height>0?vu==="l"?Iu-nl.left:nl.right-Iu:0),Lt.title.text!==dn._dfltTitle[xr]&&(jf=(Lt._titleStandoff||0)+(Lt._titleScoot||0),vu==="l"&&(jf+=xa(Lt))),Lt._fullDepth=Math.max(vc,jf)),Lt.automargin){Gl={x:0,y:0,r:0,l:0,t:0,b:0};var Tf=[0,1],Rf=typeof Lt._shift=="number"?Lt._shift:0;if(xr==="x"){if(vu==="b"?Gl[vu]=Lt._depth:(Gl[vu]=Lt._depth=Math.max(nl.width>0?Iu-nl.top:0,zu),Tf.reverse()),nl.width>0){var _d=nl.right-(Lt._offset+Lt._length);_d>0&&(Gl.xr=1,Gl.r=_d);var ad=Lt._offset-nl.left;ad>0&&(Gl.xl=0,Gl.l=ad)}}else if(vu==="l"?(Lt._depth=Math.max(nl.height>0?Iu-nl.left:0,zu),Gl[vu]=Lt._depth-Rf):(Lt._depth=Math.max(nl.height>0?nl.right-Iu:0,zu),Gl[vu]=Lt._depth+Rf,Tf.reverse()),nl.height>0){var ql=nl.bottom-(Lt._offset+Lt._length);ql>0&&(Gl.yb=0,Gl.b=ql);var cf=Lt._offset-nl.top;cf>0&&(Gl.yt=1,Gl.t=cf)}Gl[Xr]=Lt.anchor==="free"?Lt.position:Lt._anchorAxis.domain[Tf[0]],Lt.title.text!==dn._dfltTitle[xr]&&(Gl[vu]+=xa(Lt)+(Lt.title.standoff||0)),Lt.mirror&&Lt.anchor!=="free"&&(su={x:0,y:0,r:0,l:0,t:0,b:0},su[ts]=Lt.linewidth,Lt.mirror&&Lt.mirror!==!0&&(su[ts]+=zu),Lt.mirror===!0||Lt.mirror==="ticks"?su[Xr]=Lt._anchorAxis.domain[Tf[1]]:(Lt.mirror==="all"||Lt.mirror==="allticks")&&(su[Xr]=[Lt._counterDomainMin,Lt._counterDomainMax][Tf[1]]))}pu&&(cu=L.getComponentMethod("rangeslider","autoMarginOpts")(Xt,Lt)),typeof Lt.automargin=="string"&&(ur(Gl,Lt.automargin),ur(su,Lt.automargin)),M.autoMargin(Xt,yr(Lt),Gl),M.autoMargin(Xt,br(Lt),su),M.autoMargin(Xt,an(Lt),cu)}),t.syncOrAsync(Os)}};function ur(Xt,Lt){if(Xt){var $r=Object.keys(ee).reduce(function(en,rn){return Lt.indexOf(rn)!==-1&&ee[rn].forEach(function(Wr){en[Wr]=1}),en},{});Object.keys(Xt).forEach(function(en){$r[en]||(en.length===1?Xt[en]=0:delete Xt[en])})}}function Dr(Xt,Lt){var $r=[],en,rn=function(Wr,tn){var wn=Wr.xbnd[tn];wn!==null&&$r.push(t.extendFlat({},Wr,{x:wn}))};if(Lt.length){for(en=0;enXt.range[1],wn=Xt.ticklabelposition&&Xt.ticklabelposition.indexOf("inside")!==-1,dn=!wn;if($r){var Nt=tn?-1:1;$r=$r*Nt}if(en){var xr=Xt.side,Xr=wn&&(xr==="top"||xr==="left")||dn&&(xr==="bottom"||xr==="right")?1:-1;en=en*Xr}return Xt._id.charAt(0)==="x"?function(Tn){return r(rn+Xt._offset+Xt.l2p(jn(Tn))+$r,Wr+en)}:function(Tn){return r(Wr+en,rn+Xt._offset+Xt.l2p(jn(Tn))+$r)}};function jn(Xt){return Xt.periodX!==void 0?Xt.periodX:Xt.x}function ha(Xt){var Lt=Xt.ticklabelposition||"",$r=Xt.tickson||"",en=function(ia){return Lt.indexOf(ia)!==-1},rn=en("top"),Wr=en("left"),tn=en("right"),wn=en("bottom"),dn=en("inside"),Nt=$r!=="boundaries"&&(wn||Wr||rn||tn);if(!Nt&&!dn)return[0,0];var xr=Xt.side,Xr=Nt?(Xt.tickwidth||0)/2:0,Tn=se,Xn=Xt.tickfont?Xt.tickfont.size:12;return(wn||rn)&&(Xr+=Xn*ge,Tn+=(Xt.linewidth||0)/2),(Wr||tn)&&(Xr+=(Xt.linewidth||0)/2,Tn+=se),dn&&xr==="top"&&(Tn-=Xn*(1-ge)),(Wr||rn)&&(Xr=-Xr),(xr==="bottom"||xr==="right")&&(Tn=-Tn),[Nt?Xr:0,dn?Tn:0]}ce.makeTickPath=function(Xt,Lt,$r,en){en||(en={});var rn=en.minor;if(rn&&!Xt.minor)return"";var Wr=en.len!==void 0?en.len:rn?Xt.minor.ticklen:Xt.ticklen,tn=Xt._id.charAt(0),wn=(Xt.linewidth||1)/2;return tn==="x"?"M0,"+(Lt+wn*$r)+"v"+Wr*$r:"M"+(Lt+wn*$r)+",0h"+Wr*$r},ce.makeLabelFns=function(Xt,Lt,$r){var en=Xt.ticklabelposition||"",rn=Xt.tickson||"",Wr=function(Is){return en.indexOf(Is)!==-1},tn=Wr("top"),wn=Wr("left"),dn=Wr("right"),Nt=Wr("bottom"),xr=rn!=="boundaries"&&(Nt||wn||tn||dn),Xr=Wr("inside"),Tn=en==="inside"&&Xt.ticks==="inside"||!Xr&&Xt.ticks==="outside"&&rn!=="boundaries",Xn=0,ia=0,na=Tn?Xt.ticklen:0;if(Xr?na*=-1:xr&&(na=0),Tn&&(Xn+=na,$r)){var An=t.deg2rad($r);Xn=na*Math.cos(An)+1,ia=na*Math.sin(An)}Xt.showticklabels&&(Tn||Xt.showline)&&(Xn+=.2*Xt.tickfont.size),Xn+=(Xt.linewidth||1)/2*(Xr?-1:1);var Yn={labelStandoff:Xn,labelShift:ia},qi,Ga,to,_o,Po=0,Ro=Xt.side,Xo=Xt._id.charAt(0),Oi=Xt.tickangle,bs;if(Xo==="x")bs=!Xr&&Ro==="bottom"||Xr&&Ro==="top",_o=bs?1:-1,Xr&&(_o*=-1),qi=ia*_o,Ga=Lt+Xn*_o,to=bs?1:-.2,Math.abs(Oi)===90&&(Xr?to+=xe:Oi===-90&&Ro==="bottom"?to=ge:Oi===90&&Ro==="top"?to=xe:to=.5,Po=xe/2*(Oi/90)),Yn.xFn=function(Is){return Is.dx+qi+Po*Is.fontSize},Yn.yFn=function(Is){return Is.dy+Ga+Is.fontSize*to},Yn.anchorFn=function(Is,ys){if(xr){if(wn)return"end";if(dn)return"start"}return!S(ys)||ys===0||ys===180?"middle":ys*_o<0!==Xr?"end":"start"},Yn.heightFn=function(Is,ys,ss){return ys<-60||ys>60?-.5*ss:Xt.side==="top"!==Xr?-ss:0};else if(Xo==="y"){if(bs=!Xr&&Ro==="left"||Xr&&Ro==="right",_o=bs?1:-1,Xr&&(_o*=-1),qi=Xn,Ga=ia*_o,to=0,!Xr&&Math.abs(Oi)===90&&(Oi===-90&&Ro==="left"||Oi===90&&Ro==="right"?to=ge:to=.5),Xr){var cs=S(Oi)?+Oi:0;if(cs!==0){var fl=t.deg2rad(cs);Po=Math.abs(Math.sin(fl))*ge*_o,to=0}}Yn.xFn=function(Is){return Is.dx+Lt-(qi+Is.fontSize*to)*_o+Po*Is.fontSize},Yn.yFn=function(Is){return Is.dy+Ga+Is.fontSize*xe},Yn.anchorFn=function(Is,ys){return S(ys)&&Math.abs(ys)===90?"middle":bs?"end":"start"},Yn.heightFn=function(Is,ys,ss){return Xt.side==="right"&&(ys*=-1),ys<-30?-ss:ys<30?-.5*ss:0}}return Yn};function oa(Xt){return[Xt.text,Xt.x,Xt.axInfo,Xt.font,Xt.fontSize,Xt.fontColor].join("_")}ce.drawTicks=function(Xt,Lt,$r){$r=$r||{};var en=Lt._id+"tick",rn=[].concat(Lt.minor&&Lt.minor.ticks?$r.vals.filter(function(tn){return tn.minor&&!tn.noTick}):[]).concat(Lt.ticks?$r.vals.filter(function(tn){return!tn.minor&&!tn.noTick}):[]),Wr=$r.layer.selectAll("path."+en).data(rn,oa);Wr.exit().remove(),Wr.enter().append("path").classed(en,1).classed("ticks",1).classed("crisp",$r.crisp!==!1).each(function(tn){return i.stroke(v.select(this),tn.minor?Lt.minor.tickcolor:Lt.tickcolor)}).style("stroke-width",function(tn){return s.crispRound(Xt,tn.minor?Lt.minor.tickwidth:Lt.tickwidth,1)+"px"}).attr("d",$r.path).style("display",null),Wa(Lt,[H]),Wr.attr("transform",$r.transFn)},ce.drawGrid=function(Xt,Lt,$r){if($r=$r||{},Lt.tickmode!=="sync"){var en=Lt._id+"grid",rn=Lt.minor&&Lt.minor.showgrid,Wr=rn?$r.vals.filter(function(Yn){return Yn.minor}):[],tn=Lt.showgrid?$r.vals.filter(function(Yn){return!Yn.minor}):[],wn=$r.counterAxis;if(wn&&ce.shouldShowZeroLine(Xt,Lt,wn))for(var dn=Lt.tickmode==="array",Nt=0;Nt=0;ia--){var na=ia?Tn:Xn;if(na){var An=na.selectAll("path."+en).data(ia?tn:Wr,oa);An.exit().remove(),An.enter().append("path").classed(en,1).classed("crisp",$r.crisp!==!1),An.attr("transform",$r.transFn).attr("d",$r.path).each(function(Yn){return i.stroke(v.select(this),Yn.minor?Lt.minor.gridcolor:Lt.gridcolor||"#ddd")}).style("stroke-dasharray",function(Yn){return s.dashStyle(Yn.minor?Lt.minor.griddash:Lt.griddash,Yn.minor?Lt.minor.gridwidth:Lt.gridwidth)}).style("stroke-width",function(Yn){return(Yn.minor?Xr:Lt._gw)+"px"}).style("display",null),typeof $r.path=="function"&&An.attr("d",$r.path)}}Wa(Lt,[j,O])}},ce.drawZeroLine=function(Xt,Lt,$r){$r=$r||$r;var en=Lt._id+"zl",rn=ce.shouldShowZeroLine(Xt,Lt,$r.counterAxis),Wr=$r.layer.selectAll("path."+en).data(rn?[{x:0,id:Lt._id}]:[]);Wr.exit().remove(),Wr.enter().append("path").classed(en,1).classed("zl",1).classed("crisp",$r.crisp!==!1).each(function(){$r.layer.selectAll("path").sort(function(tn,wn){return le(tn.id,wn.id)})}),Wr.attr("transform",$r.transFn).attr("d",$r.path).call(i.stroke,Lt.zerolinecolor||i.defaultLine).style("stroke-width",s.crispRound(Xt,Lt.zerolinewidth,Lt._gw||1)+"px").style("display",null),Wa(Lt,[G])},ce.drawLabels=function(Xt,Lt,$r){$r=$r||{};var en=Xt._fullLayout,rn=Lt._id,Wr=Lt.zerolinelayer==="above traces",tn=$r.cls||rn+"tick",wn=$r.vals.filter(function(Ls){return Ls.text}),dn=$r.labelFns,Nt=$r.secondary?0:Lt.tickangle,xr=(Lt._prevTickAngles||{})[tn],Xr=$r.layer.selectAll("g."+tn).data(Lt.showticklabels?wn:[],oa),Tn=[];Xr.enter().append("g").classed(tn,1).append("text").attr("text-anchor","middle").each(function(Ls){var ps=v.select(this),Uo=Xt._promises.length;ps.call(a.positionText,dn.xFn(Ls),dn.yFn(Ls)).call(s.font,{family:Ls.font,size:Ls.fontSize,color:Ls.fontColor,weight:Ls.fontWeight,style:Ls.fontStyle,variant:Ls.fontVariant,textcase:Ls.fontTextcase,lineposition:Ls.fontLineposition,shadow:Ls.fontShadow}).text(Ls.text).call(a.convertToTspans,Xt),Xt._promises[Uo]?Tn.push(Xt._promises.pop().then(function(){Xn(ps,Nt)})):Xn(ps,Nt)}),Wa(Lt,[W]),Xr.exit().remove(),$r.repositionOnUpdate&&Xr.each(function(Ls){v.select(this).select("text").call(a.positionText,dn.xFn(Ls),dn.yFn(Ls))});function Xn(Ls,ps){Ls.each(function(Uo){var Rs=v.select(this),Ll=Rs.select(".text-math-group"),Kl=dn.anchorFn(Uo,ps),eu=$r.transFn.call(Rs.node(),Uo)+(S(ps)&&+ps!=0?" rotate("+ps+","+dn.xFn(Uo)+","+(dn.yFn(Uo)-Uo.fontSize/2)+")":""),Ws=a.lineCount(Rs),Bi=_e*Uo.fontSize,Mo=dn.heightFn(Uo,S(ps)?+ps:0,(Ws-1)*Bi);if(Mo&&(eu+=r(0,Mo)),Ll.empty()){var Jl=Rs.select("text");Jl.attr({transform:eu,"text-anchor":Kl}),Jl.style("display",null),Lt._adjustTickLabelsOverflow&&Lt._adjustTickLabelsOverflow()}else{var Qs=s.bBox(Ll.node()).width,as=Qs*{end:-.5,start:.5}[Kl];Ll.attr("transform",eu+r(as,0))}})}Lt._adjustTickLabelsOverflow=function(){var Ls=Lt.ticklabeloverflow;if(!(!Ls||Ls==="allow")){var ps=Ls.indexOf("hide")!==-1,Uo=Lt._id.charAt(0)==="x",Rs=0,Ll=Uo?Xt._fullLayout.width:Xt._fullLayout.height;if(Ls.indexOf("domain")!==-1){var Kl=t.simpleMap(Lt.range,Lt.r2l);Rs=Lt.l2p(Kl[0])+Lt._offset,Ll=Lt.l2p(Kl[1])+Lt._offset}var eu=Math.min(Rs,Ll),Ws=Math.max(Rs,Ll),Bi=Lt.side,Mo=1/0,Jl=-1/0;Xr.each(function(dl){var Rl=v.select(this),Gu=Rl.select(".text-math-group");if(Gu.empty()){var Eo=s.bBox(Rl.node()),Os=0;Uo?(Eo.right>Ws||Eo.leftWs||Eo.top+(Lt.tickangle?0:dl.fontSize/4)Lt["_visibleLabelMin_"+Kl._id]?Rl.style("display","none"):Ws.K==="tick"&&!eu&&Rl.node().style.display!=="none"&&Rl.style("display",null)})})})})},Xn(Xr,xr+1?xr:Nt);function ia(){return Tn.length&&Promise.all(Tn)}var na=null;function An(){if(Xn(Xr,Nt),wn.length&&Lt.autotickangles&&(Lt.type!=="log"||String(Lt.dtick).charAt(0)!=="D")){na=Lt.autotickangles[0];var Ls=0,ps=[],Uo,Rs=1;Xr.each(function(Gl){Ls=Math.max(Ls,Gl.fontSize);var su=Lt.l2p(Gl.x),cu=rr(this),vc=s.bBox(cu.node());Rs=Math.max(Rs,a.lineCount(cu)),ps.push({top:0,bottom:10,height:10,left:su-vc.width/2,right:su+vc.width/2+2,width:vc.width+2})});var Ll=(Lt.tickson==="boundaries"||Lt.showdividers)&&!$r.secondary,Kl=wn.length,eu=Math.abs((wn[Kl-1].x-wn[0].x)*Lt._m)/(Kl-1),Ws=Ll?eu/2:eu,Bi=Ll?Lt.ticklen:Ls*1.25*Rs,Mo=Math.sqrt(Math.pow(Ws,2)+Math.pow(Bi,2)),Jl=Ws/Mo,Qs=Lt.autotickangles.map(function(Gl){return Gl*Math.PI/180}),as=Qs.find(function(Gl){return Math.abs(Math.cos(Gl))<=Jl});as===void 0&&(as=Qs.reduce(function(Gl,su){return Math.abs(Math.cos(Gl))hl*ss&&(fl=ss,Oi[Xo]=bs[Xo]=Is[Xo])}var ll=Math.abs(fl-cs);ll-_o>0?(ll-=_o,_o*=1+_o/ll):_o=0,Lt._id.charAt(0)!=="y"&&(_o=-_o),Oi[Ro]=Ga.p2r(Ga.r2p(bs[Ro])+Po*_o),Ga.autorange==="min"||Ga.autorange==="max reversed"?(Oi[0]=null,Ga._rangeInitial0=void 0,Ga._rangeInitial1=void 0):(Ga.autorange==="max"||Ga.autorange==="min reversed")&&(Oi[1]=null,Ga._rangeInitial0=void 0,Ga._rangeInitial1=void 0),en._insideTickLabelsUpdaterange[Ga._name+".range"]=Oi}var Il=t.syncOrAsync(Yn);return Il&&Il.then&&Xt._promises.push(Il),Il};function _a(Xt,Lt,$r){var en=Lt._id+"divider",rn=$r.vals,Wr=$r.layer.selectAll("path."+en).data(rn,oa);Wr.exit().remove(),Wr.enter().insert("path",":first-child").classed(en,1).classed("crisp",1).call(i.stroke,Lt.dividercolor).style("stroke-width",s.crispRound(Xt,Lt.dividerwidth,1)+"px"),Wr.attr("transform",$r.transFn).attr("d",$r.path)}ce.getPxPosition=function(Xt,Lt){var $r=Xt._fullLayout._size,en=Lt._id.charAt(0),rn=Lt.side,Wr;if(Lt.anchor!=="free"?Wr=Lt._anchorAxis:en==="x"?Wr={_offset:$r.t+(1-(Lt.position||0))*$r.h,_length:0}:en==="y"&&(Wr={_offset:$r.l+(Lt.position||0)*$r.w+Lt._shift,_length:0}),rn==="top"||rn==="left")return Wr._offset;if(rn==="bottom"||rn==="right")return Wr._offset+Wr._length};function xa(Xt){var Lt=Xt.title.font.size,$r=(Xt.title.text.match(a.BR_TAG_ALL)||[]).length;return Xt.title.hasOwnProperty("standoff")?Lt*(ge+$r*_e):$r?Lt*($r+1)*_e:Lt}function ra(Xt,Lt){var $r=Xt._fullLayout,en=Lt._id,rn=en.charAt(0),Wr=Lt.title.font.size,tn,wn=(Lt.title.text.match(a.BR_TAG_ALL)||[]).length;if(Lt.title.hasOwnProperty("standoff"))Lt.side==="bottom"||Lt.side==="right"?tn=Lt._depth+Lt.title.standoff+Wr*ge:(Lt.side==="top"||Lt.side==="left")&&(tn=Lt._depth+Lt.title.standoff+Wr*(xe+wn*_e));else{var dn=Oa(Lt);if(Lt.type==="multicategory")tn=Lt._depth;else{var Nt=1.5*Wr;dn&&(Nt=.5*Wr,Lt.ticks==="outside"&&(Nt+=Lt.ticklen)),tn=10+Nt+(Lt.linewidth?Lt.linewidth-1:0)}dn||(rn==="x"?tn+=Lt.side==="top"?Wr*(Lt.showticklabels?1:0):Wr*(Lt.showticklabels?1.5:.5):tn+=Lt.side==="right"?Wr*(Lt.showticklabels?1:.5):Wr*(Lt.showticklabels?.5:0))}var xr=ce.getPxPosition(Xt,Lt),Xr,Tn,Xn;rn==="x"?(Tn=Lt._offset+Lt._length/2,Xn=Lt.side==="top"?xr-tn:xr+tn):(Xn=Lt._offset+Lt._length/2,Tn=Lt.side==="right"?xr+tn:xr-tn,Xr={rotate:"-90",offset:0});var ia;if(Lt.type!=="multicategory"){var na=Lt._selections[Lt._id+"tick"];if(ia={selection:na,side:Lt.side},na&&na.node()&&na.node().parentNode){var An=s.getTranslate(na.node().parentNode);ia.offsetLeft=An.x,ia.offsetTop=An.y}Lt.title.hasOwnProperty("standoff")&&(ia.pad=0)}return Lt._titleStandoff=tn,l.draw(Xt,en+"title",{propContainer:Lt,propName:Lt._name+".title.text",placeholder:$r._dfltTitle[rn],avoid:ia,transform:Xr,attributes:{x:Tn,y:Xn,"text-anchor":"middle"}})}ce.shouldShowZeroLine=function(Xt,Lt,$r){var en=t.simpleMap(Lt.range,Lt.r2l);return en[0]*en[1]<=0&&Lt.zeroline&&(Lt.type==="linear"||Lt.type==="-")&&!(Lt.rangebreaks&&Lt.maskBreaks(0)===V)&&(Ha(Lt,0)||!ci(Xt,Lt,$r,en)||_r(Xt,Lt))},ce.clipEnds=function(Xt,Lt){return Lt.filter(function($r){return Ha(Xt,$r.x)})};function Ha(Xt,Lt){var $r=Xt.l2p(Lt);return $r>1&&$r1)for(rn=1;rn=rn.min&&Xt=z:/%L/.test(Lt)?Xt>=F:/%[SX]/.test(Lt)?Xt>=w:/%M/.test(Lt)?Xt>=m:/%[HI]/.test(Lt)?Xt>=h:/%p/.test(Lt)?Xt>=_:/%[Aadejuwx]/.test(Lt)?Xt>=E:/%[UVW]/.test(Lt)?Xt>=T:/%[Bbm]/.test(Lt)?Xt>=I:/%[q]/.test(Lt)?Xt>=x:/%[Yy]/.test(Lt)?Xt>=g:!0}}}),Fk=Re({"src/plots/cartesian/autorange_options_defaults.js"(ae,K){K.exports=function(S,M,L){var t,r;if(L){var a=M==="reversed"||M==="min reversed"||M==="max reversed";t=L[a?1:0],r=L[a?0:1]}var l=S("autorangeoptions.minallowed",r===null?t:void 0),i=S("autorangeoptions.maxallowed",t===null?r:void 0);l===void 0&&S("autorangeoptions.clipmin"),i===void 0&&S("autorangeoptions.clipmax"),S("autorangeoptions.include")}}}),Bk=Re({"src/plots/cartesian/range_defaults.js"(ae,K){var v=Fk();K.exports=function(M,L,t,r){var a=L._template||{},l=L.type||a.type||"-";t("minallowed"),t("maxallowed");var i=t("range");if(!i){var s;!r.noInsiderange&&l!=="log"&&(s=t("insiderange"),s&&(s[0]===null||s[1]===null)&&(L.insiderange=!1,s=void 0),s&&(i=t("range",s)))}var o=L.getAutorangeDflt(i,r),c=t("autorange",o),p;i&&(i[0]===null&&i[1]===null||(i[0]===null||i[1]===null)&&(c==="reversed"||c===!0)||i[0]!==null&&(c==="min"||c==="max reversed")||i[1]!==null&&(c==="max"||c==="min reversed"))&&(i=void 0,delete L.range,L.autorange=!0,p=!0),p||(o=L.getAutorangeDflt(i,r),c=t("autorange",o)),c&&(v(t,c,i),(l==="linear"||l==="-")&&t("rangemode")),L.cleanRange()}}}),uS=Re({"node_modules/mouse-event-offset/index.js"(ae,K){var v={left:0,top:0};K.exports=S;function S(L,t,r){t=t||L.currentTarget||L.srcElement,Array.isArray(r)||(r=[0,0]);var a=L.clientX||0,l=L.clientY||0,i=M(t);return r[0]=a-i.left,r[1]=l-i.top,r}function M(L){return L===window||L===document||L===document.body?v:L.getBoundingClientRect()}}}),cS=Re({"node_modules/has-passive-events/index.js"(ae,K){var v=X2();function S(){var M=!1;try{var L=Object.defineProperty({},"passive",{get:function(){M=!0}});window.addEventListener("test",null,L),window.removeEventListener("test",null,L)}catch{M=!1}return M}K.exports=v&&S()}}),LD=Re({"src/components/dragelement/align.js"(ae,K){K.exports=function(S,M,L,t,r){var a=(S-L)/(t-L),l=a+M/(t-L),i=(a+l)/2;return r==="left"||r==="bottom"?a:r==="center"||r==="middle"?i:r==="right"||r==="top"?l:a<2/3-i?a:l>4/3-i?l:i}}}),RD=Re({"src/components/dragelement/cursor.js"(ae,K){var v=Rn(),S=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];K.exports=function(L,t,r,a){return r==="left"?L=0:r==="center"?L=1:r==="right"?L=2:L=v.constrain(Math.floor(L*3),0,2),a==="bottom"?t=0:a==="middle"?t=1:a==="top"?t=2:t=v.constrain(Math.floor(t*3),0,2),S[t][L]}}}),DD=Re({"src/components/dragelement/unhover.js"(ae,K){var v=Ib(),S=k0(),M=R_().getGraphDiv,L=el(),t=K.exports={};t.wrapped=function(r,a,l){r=M(r),r._fullLayout&&S.clear(r._fullLayout._uid+L.HOVERID),t.raw(r,a,l)},t.raw=function(a,l){var i=a._fullLayout,s=a._hoverdata;l||(l={}),!(l.target&&!a._dragged&&v.triggerHandler(a,"plotly_beforehover",l)===!1)&&(i._hoverlayer.selectAll("g").remove(),i._hoverlayer.selectAll("line").remove(),i._hoverlayer.selectAll("circle").remove(),a._hoverdata=void 0,l.target&&s&&a.emit("plotly_unhover",{event:l,points:s}))}}}),fv=Re({"src/components/dragelement/index.js"(ae,K){var v=uS(),S=sS(),M=cS(),L=Rn().removeElement,t=qh(),r=K.exports={};r.align=LD(),r.getCursor=RD();var a=DD();r.unhover=a.wrapped,r.unhoverRaw=a.raw,r.init=function(o){var c=o.gd,p=1,d=c._context.doubleClickDelay,y=o.element,g,C,f,x,A,k,I,T;c._mouseDownTime||(c._mouseDownTime=0),y.style.pointerEvents="all",y.onmousedown=h,M?(y._ontouchstart&&y.removeEventListener("touchstart",y._ontouchstart),y._ontouchstart=h,y.addEventListener("touchstart",h,{passive:!1})):y.ontouchstart=h;function E(F,z,U){return Math.abs(F)"u"&&typeof F.clientY>"u"&&(F.clientX=g,F.clientY=C),f=new Date().getTime(),f-c._mouseDownTimed&&(p=Math.max(p-1,1)),c._dragged)o.doneFn&&o.doneFn();else{var z;k.target===I?z=k:(z={target:I,srcElement:I,toElement:I},Object.keys(k).concat(Object.keys(k.__proto__)).forEach(U=>{var V=k[U];!z[U]&&typeof V!="function"&&(z[U]=V)})),o.clickFn&&o.clickFn(p,z),T||I.dispatchEvent(new MouseEvent("click",F))}c._dragging=!1,c._dragged=!1}};function l(){var s=document.createElement("div");s.className="dragcover";var o=s.style;return o.position="fixed",o.left=0,o.right=0,o.top=0,o.bottom=0,o.zIndex=999999999,o.background="none",document.body.appendChild(s),s}r.coverSlip=l;function i(s){return v(s.changedTouches?s.changedTouches[0]:s,document.body)}}}),mg=Re({"src/lib/setcursor.js"(ae,K){K.exports=function(S,M){(S.attr("class")||"").split(" ").forEach(function(L){L.indexOf("cursor-")===0&&S.classed(L,!1)}),M&&S.classed("cursor-"+M,!0)}}}),PD=Re({"src/lib/override_cursor.js"(ae,K){var v=mg(),S="data-savedcursor",M="!!";K.exports=function(t,r){var a=t.attr(S);if(r){if(!a){for(var l=(t.attr("class")||"").split(" "),i=0;iY.legend.length)for(var ne=Y.legend.length;ne(i==="legend"?1:0));if(z===!1&&(o[i]=void 0),!(z===!1&&!p.uirevision)&&(y("uirevision",o.uirevision),z!==!1)){y("borderwidth");var U=y("orientation"),V=y("yref"),G=y("xref"),j=U==="h",O=V==="paper",H=G==="paper",W,ee,ue,xe="left";j?(W=0,v.getComponentMethod("rangeslider","isVisible")(s.xaxis)?O?(ee=1.1,ue="bottom"):(ee=1,ue="top"):O?(ee=-.1,ue="top"):(ee=0,ue="bottom")):(ee=1,ue="auto",H?W=1.02:(W=1,xe="right")),S.coerce(p,d,{x:{valType:"number",editType:"legend",min:H?-2:0,max:H?3:1,dflt:W}},"x"),S.coerce(p,d,{y:{valType:"number",editType:"legend",min:O?-2:0,max:O?3:1,dflt:ee}},"y"),y("traceorder",E),a.isGrouped(o[i])&&y("tracegroupgap"),y("entrywidth"),y("entrywidthmode"),y("indentation"),y("itemsizing"),y("itemwidth"),y("itemclick"),y("itemdoubleclick"),y("groupclick"),y("xanchor",xe),y("yanchor",ue),y("maxheight"),y("valign"),S.noneOrAll(p,d,["x","y"]);var ge=y("title.text");if(ge){y("title.side",j?"left":"top");var _e=S.extendFlat({},g,{size:S.bigFont(g.size)});S.coerceFont(y,"title.font",_e)}}}K.exports=function(s,o,c){var p,d=c.slice(),y=o.shapes;if(y)for(p=0;pU&&(z=U)}w[g][0]._groupMinRank=z,w[g][0]._preGroupSort=g}var V=function(ee,ue){return ee[0]._groupMinRank-ue[0]._groupMinRank||ee[0]._preGroupSort-ue[0]._preGroupSort},G=function(ee,ue){return ee.trace.legendrank-ue.trace.legendrank||ee._preSort-ue._preSort};for(w.forEach(function(ee,ue){ee[0]._preGroupSort=ue}),w.sort(V),g=0;g0)ye=se.width;else return 0;return _?ne:Math.min(ye,ce)};k.each(function(Y){var se=v.select(this),ce=M.ensureSingle(se,"g","layers");ce.style("opacity",Y[0].trace.opacity);var ne=T.indentation,ye=T.valign,le=Y[0].lineHeight,Z=Y[0].height;if(ye==="middle"&&ne===0||!le||!Z)ce.attr("transform",null);else{var de={top:1,bottom:-1}[ye],pe=de*(.5*(le-Z+3))||0,Te=T.indentation;ce.attr("transform",L(Te,pe))}var Ne=ce.selectAll("g.legendfill").data([Y]);Ne.enter().append("g").classed("legendfill",!0);var $e=ce.selectAll("g.legendlines").data([Y]);$e.enter().append("g").classed("legendlines",!0);var Ze=ce.selectAll("g.legendsymbols").data([Y]);Ze.enter().append("g").classed("legendsymbols",!0),Ze.selectAll("g.legendpoints").data([Y]).enter().append("g").classed("legendpoints",!0)}).each(_e).each(V).each(j).each(G).each(H).each(xe).each(ue).each(z).each(U).each(W).each(ee);function z(Y){var se=f(Y),ce=se.showFill,ne=se.showLine,ye=se.showGradientLine,le=se.showGradientFill,Z=se.anyFill,de=se.anyLine,pe=Y[0],Te=pe.trace,Ne,$e,Ze=a(Te),Xe=Ze.colorscale,it=Ze.reversescale,yt=function(Je){if(Je.size())if(ce)t.fillGroupStyle(Je,I,!0);else{var _t="legendfill-"+Te.uid;t.gradient(Je,I,_t,C(it),Xe,"fill")}},bt=function(Je){if(Je.size()){var _t="legendline-"+Te.uid;t.lineGroupStyle(Je),t.gradient(Je,I,_t,C(it),Xe,"stroke")}},mt=l.hasMarkers(Te)||!Z?"M5,0":de?"M5,-2":"M5,-3",ht=v.select(this),Ve=ht.select(".legendfill").selectAll("path").data(ce||le?[Y]:[]);if(Ve.enter().append("path").classed("js-fill",!0),Ve.exit().remove(),Ve.attr("d",mt+"h"+h+"v6h-"+h+"z").call(yt),ne||ye){var ze=F(void 0,Te.line,y,p);$e=M.minExtend(Te,{line:{width:ze}}),Ne=[M.minExtend(pe,{trace:$e})]}var Se=ht.select(".legendlines").selectAll("path").data(ne||ye?[Ne]:[]);Se.enter().append("path").classed("js-line",!0),Se.exit().remove(),Se.attr("d",mt+(ye?"l"+h+",0.0001":"h"+h)).call(ne?t.lineGroupStyle:bt)}function U(Y){var se=f(Y),ce=se.anyFill,ne=se.anyLine,ye=se.showLine,le=se.showMarker,Z=Y[0],de=Z.trace,pe=!le&&!ne&&!ce&&l.hasText(de),Te,Ne;function $e(Ve,ze,Se,Je){var _t=M.nestedProperty(de,Ve).get(),At=M.isArrayOrTypedArray(_t)&&ze?ze(_t):_t;if(_&&At&&Je!==void 0&&(At=Je),Se){if(AtSe[1])return Se[1]}return At}function Ze(Ve){return Z._distinct&&Z.index&&Ve[Z.index]?Ve[Z.index]:Ve[0]}if(le||pe||ye){var Xe={},it={};if(le){Xe.mc=$e("marker.color",Ze),Xe.mx=$e("marker.symbol",Ze),Xe.mo=$e("marker.opacity",M.mean,[.2,1]),Xe.mlc=$e("marker.line.color",Ze),Xe.mlw=$e("marker.line.width",M.mean,[0,5],d),it.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var yt=$e("marker.size",M.mean,[2,16],c);Xe.ms=yt,it.marker.size=yt}ye&&(it.line={width:$e("line.width",Ze,[0,10],p)}),pe&&(Xe.tx="Aa",Xe.tp=$e("textposition",Ze),Xe.ts=10,Xe.tc=$e("textfont.color",Ze),Xe.tf=$e("textfont.family",Ze),Xe.tw=$e("textfont.weight",Ze),Xe.ty=$e("textfont.style",Ze),Xe.tv=$e("textfont.variant",Ze),Xe.tC=$e("textfont.textcase",Ze),Xe.tE=$e("textfont.lineposition",Ze),Xe.tS=$e("textfont.shadow",Ze)),Te=[M.minExtend(Z,Xe)],Ne=M.minExtend(de,it),Ne.selectedpoints=null,Ne.texttemplate=null}var bt=v.select(this).select("g.legendpoints"),mt=bt.selectAll("path.scatterpts").data(le?Te:[]);mt.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",w),mt.exit().remove(),mt.call(t.pointStyle,Ne,I),le&&(Te[0].mrc=3);var ht=bt.selectAll("g.pointtext").data(pe?Te:[]);ht.enter().append("g").classed("pointtext",!0).append("text").attr("transform",w),ht.exit().remove(),ht.selectAll("text").call(t.textPointStyle,Ne,I)}function V(Y){var se=Y[0].trace,ce=se.type==="waterfall";if(Y[0]._distinct&&ce){var ne=Y[0].trace[Y[0].dir].marker;return Y[0].mc=ne.color,Y[0].mlw=ne.line.width,Y[0].mlc=ne.line.color,O(Y,this,"waterfall")}var ye=[];se.visible&&ce&&(ye=Y[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 le=v.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(ye);le.enter().append("path").classed("legendwaterfall",!0).attr("transform",w).style("stroke-miterlimit",1),le.exit().remove(),le.each(function(Z){var de=v.select(this),pe=se[Z[0]].marker,Te=F(void 0,pe.line,g,d);de.attr("d",Z[1]).style("stroke-width",Te+"px").call(r.fill,pe.color),Te&&de.call(r.stroke,pe.line.color)})}function G(Y){O(Y,this)}function j(Y){O(Y,this,"funnel")}function O(Y,se,ce){var ne=Y[0].trace,ye=ne.marker||{},le=ye.line||{},Z=ye.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",de=ce?ne.visible&&ne.type===ce:S.traceIs(ne,"bar"),pe=v.select(se).select("g.legendpoints").selectAll("path.legend"+ce).data(de?[Y]:[]);pe.enter().append("path").classed("legend"+ce,!0).attr("d",Z).attr("transform",w),pe.exit().remove(),pe.each(function(Te){var Ne=v.select(this),$e=Te[0],Ze=F($e.mlw,ye.line,g,d);Ne.style("stroke-width",Ze+"px");var Xe=$e.mcc;if(!T._inHover&&"mc"in $e){var it=a(ye),yt=it.mid;yt===void 0&&(yt=(it.max+it.min)/2),Xe=t.tryColorscale(ye,"")(yt)}var bt=Xe||$e.mc||ye.color,mt=ye.pattern,ht=t.getPatternAttr,Ve=mt&&(ht(mt.shape,0,"")||ht(mt.path,0,""));if(Ve){var ze=ht(mt.bgcolor,0,null),Se=ht(mt.fgcolor,0,null),Je=mt.fgopacity,_t=x(mt.size,8,10),At=x(mt.solidity,.5,1),vt="legend-"+ne.uid;Ne.call(t.pattern,"legend",I,vt,Ve,_t,At,Xe,mt.fillmode,ze,Se,Je)}else Ne.call(r.fill,bt);Ze&&r.stroke(Ne,$e.mlc||le.color)})}function H(Y){var se=Y[0].trace,ce=v.select(this).select("g.legendpoints").selectAll("path.legendbox").data(se.visible&&S.traceIs(se,"box-violin")?[Y]:[]);ce.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",w),ce.exit().remove(),ce.each(function(){var ne=v.select(this);if((se.boxpoints==="all"||se.points==="all")&&r.opacity(se.fillcolor)===0&&r.opacity((se.line||{}).color)===0){var ye=M.minExtend(se,{marker:{size:_?c:M.constrain(se.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});ce.call(t.pointStyle,ye,I)}else{var le=F(void 0,se.line,g,d);ne.style("stroke-width",le+"px").call(r.fill,se.fillcolor),le&&r.stroke(ne,se.line.color)}})}function W(Y){var se=Y[0].trace,ce=v.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(se.visible&&se.type==="candlestick"?[Y,Y]:[]);ce.enter().append("path").classed("legendcandle",!0).attr("d",function(ne,ye){return ye?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",w).style("stroke-miterlimit",1),ce.exit().remove(),ce.each(function(ne,ye){var le=v.select(this),Z=se[ye?"increasing":"decreasing"],de=F(void 0,Z.line,g,d);le.style("stroke-width",de+"px").call(r.fill,Z.fillcolor),de&&r.stroke(le,Z.line.color)})}function ee(Y){var se=Y[0].trace,ce=v.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(se.visible&&se.type==="ohlc"?[Y,Y]:[]);ce.enter().append("path").classed("legendohlc",!0).attr("d",function(ne,ye){return ye?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",w).style("stroke-miterlimit",1),ce.exit().remove(),ce.each(function(ne,ye){var le=v.select(this),Z=se[ye?"increasing":"decreasing"],de=F(void 0,Z.line,g,d);le.style("fill","none").call(t.dashLine,Z.line.dash,de),de&&r.stroke(le,Z.line.color)})}function ue(Y){ge(Y,this,"pie")}function xe(Y){ge(Y,this,"funnelarea")}function ge(Y,se,ce){var ne=Y[0],ye=ne.trace,le=ce?ye.visible&&ye.type===ce:S.traceIs(ye,ce),Z=v.select(se).select("g.legendpoints").selectAll("path.legend"+ce).data(le?[Y]:[]);if(Z.enter().append("path").classed("legend"+ce,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",w),Z.exit().remove(),Z.size()){var de=ye.marker||{},pe=F(s(de.line.width,ne.pts),de.line,g,d),Te="pieLike",Ne=M.minExtend(ye,{marker:{line:{width:pe}}},Te),$e=M.minExtend(ne,{trace:Ne},Te);i(Z,$e,Ne,I)}}function _e(Y){var se=Y[0].trace,ce,ne=[];if(se.visible)switch(se.type){case"histogram2d":case"heatmap":ne=[["M-15,-2V4H15V-2Z"]],ce=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":ne=[["M-6,-6V6H6V-6Z"]],ce=!0;break;case"densitymapbox":case"densitymap":ne=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],ce="radial";break;case"cone":ne=[["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"]],ce=!1;break;case"streamtube":ne=[["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"]],ce=!1;break;case"surface":ne=[["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"]],ce=!0;break;case"mesh3d":ne=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ce=!1;break;case"volume":ne=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ce=!0;break;case"isosurface":ne=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],ce=!1;break}var ye=v.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(ne);ye.enter().append("path").classed("legend3dandfriends",!0).attr("transform",w).style("stroke-miterlimit",1),ye.exit().remove(),ye.each(function(le,Z){var de=v.select(this),pe=a(se),Te=pe.colorscale,Ne=pe.reversescale,$e=function(yt){if(yt.size()){var bt="legendfill-"+se.uid;t.gradient(yt,I,bt,C(Ne,ce==="radial"),Te,"fill")}},Ze;if(Te){if(!ce){var it=Te.length;Ze=Z===0?Te[Ne?it-1:0][1]:Z===1?Te[Ne?0:it-1][1]:Te[Math.floor((it-1)/2)][1]}}else{var Xe=se.vertexcolor||se.facecolor||se.color;Ze=M.isArrayOrTypedArray(Xe)?Xe[Z]||Xe[0]:Xe}de.attr("d",le[0]),Ze?de.call(r.fill,Ze):de.call($e)})}};function C(A,k){var I=k?"radial":"horizontal";return I+(A?"":"reversed")}function f(A){var k=A[0].trace,I=k.contours,T=l.hasLines(k),E=l.hasMarkers(k),_=k.visible&&k.fill&&k.fill!=="none",h=!1,m=!1;if(I){var w=I.coloring;w==="lines"?h=!0:T=w==="none"||w==="heatmap"||I.showlines,I.type==="constraint"?_=I._operation!=="=":(w==="fill"||w==="heatmap")&&(m=!0)}return{showMarker:E,showLine:T,showFill:_,showGradientLine:h,showGradientFill:m,anyLine:T||h,anyFill:_||m}}function x(A,k,I){return A&&M.isArrayOrTypedArray(A)?k:A>I?I:A}}}),qk=Re({"src/components/legend/draw.js"(ae,K){var v=un(),S=Rn(),M=If(),L=es(),t=Ib(),r=fv(),a=qs(),l=ko(),i=kc(),s=hS(),o=Vk(),c=qd(),p=c.LINE_SPACING,d=c.FROM_TL,y=c.FROM_BR,g=zD(),C=Gk(),f=fS(),x=1,A=/^legend[0-9]*$/;K.exports=function(W,ee){if(ee)I(W,ee);else{var ue=W._fullLayout,xe=ue._legends,ge=ue._infolayer.selectAll('[class^="legend"]');ge.each(function(){var ce=v.select(this),ne=ce.attr("class"),ye=ne.split(" ")[0];ye.match(A)&&xe.indexOf(ye)===-1&&ce.remove()});for(var _e=0;_e1)}var de=ue.hiddenlabels||[];if(!Y&&(!ue.showlegend||!se.length))return _e.selectAll("."+xe).remove(),ue._topdefs.select("#"+ge).remove(),M.autoMargin(H,xe);var pe=S.ensureSingle(_e,"g",xe,function(mt){Y||mt.attr("pointer-events","all")}),Te=S.ensureSingleById(ue._topdefs,"clipPath",ge,function(mt){mt.append("rect")}),Ne=S.ensureSingle(pe,"rect","bg",function(mt){mt.attr("shape-rendering","crispEdges")});Ne.call(l.stroke,ee.bordercolor).call(l.fill,ee.bgcolor).style("stroke-width",ee.borderwidth+"px");var $e=S.ensureSingle(pe,"g","scrollbox"),Ze=ee.title;ee._titleWidth=0,ee._titleHeight=0;var Xe;Ze.text?(Xe=S.ensureSingle($e,"text",xe+"titletext"),Xe.attr("text-anchor","start").call(a.font,Ze.font).text(Ze.text),w(Xe,$e,H,ee,x)):$e.selectAll("."+xe+"titletext").remove();var it=S.ensureSingle(pe,"rect","scrollbar",function(mt){mt.attr(o.scrollBarEnterAttrs).call(l.fill,o.scrollBarColor)}),yt=$e.selectAll("g.groups").data(se);yt.enter().append("g").attr("class","groups"),yt.exit().remove();var bt=yt.selectAll("g.traces").data(S.identity);bt.enter().append("g").attr("class","traces"),bt.exit().remove(),bt.style("opacity",function(mt){var ht=mt[0].trace;return L.traceIs(ht,"pie-like")?de.indexOf(mt[0].label)!==-1?.5:1:ht.visible==="legendonly"?.5:1}).each(function(){v.select(this).call(_,H,ee)}).call(C,H,ee).each(function(){Y||v.select(this).call(m,H,xe)}),S.syncOrAsync([M.previousPromises,function(){return U(H,yt,bt,ee)},function(){var mt=ue._size,ht=ee.borderwidth,Ve=ee.xref==="paper",ze=ee.yref==="paper";if(Ze.text&&k(Xe,ee,ht),!Y){var Se,Je;Ve?Se=mt.l+mt.w*ee.x-d[G(ee)]*ee._width:Se=ue.width*ee.x-d[G(ee)]*ee._width,ze?Je=mt.t+mt.h*(1-ee.y)-d[j(ee)]*ee._effHeight:Je=ue.height*(1-ee.y)-d[j(ee)]*ee._effHeight;var _t=V(H,xe,Se,Je);if(_t)return;if(ue.margin.autoexpand){var At=Se,vt=Je;Se=Ve?S.constrain(Se,0,ue.width-ee._width):At,Je=ze?S.constrain(Je,0,ue.height-ee._effHeight):vt,Se!==At&&S.log("Constrain "+xe+".x to make legend fit inside graph"),Je!==vt&&S.log("Constrain "+xe+".y to make legend fit inside graph")}a.setTranslate(pe,Se,Je)}if(it.on(".drag",null),pe.on("wheel",null),Y||ee._height<=ee._maxHeight||H._context.staticPlot){var Kt=ee._effHeight;Y&&(Kt=ee._height),Ne.attr({width:ee._width-ht,height:Kt-ht,x:ht/2,y:ht/2}),a.setTranslate($e,0,0),Te.select("rect").attr({width:ee._width-2*ht,height:Kt-2*ht,x:ht,y:ht}),a.setClipUrl($e,ge,H),a.setRect(it,0,0,0,0),delete ee._scrollY}else{var Qt=Math.max(o.scrollBarMinHeight,ee._effHeight*ee._effHeight/ee._height),fr=ee._effHeight-Qt-2*o.scrollBarMargin,mr=ee._height-ee._effHeight,Ur=fr/mr,Br=Math.min(ee._scrollY||0,mr);Ne.attr({width:ee._width-2*ht+o.scrollBarWidth+o.scrollBarMargin,height:ee._effHeight-ht,x:ht/2,y:ht/2}),Te.select("rect").attr({width:ee._width-2*ht+o.scrollBarWidth+o.scrollBarMargin,height:ee._effHeight-2*ht,x:ht,y:ht+Br}),a.setClipUrl($e,ge,H),Ie(Br,Qt,Ur),pe.on("wheel",function(){Br=S.constrain(ee._scrollY+v.event.deltaY/mr*fr,0,mr),Ie(Br,Qt,Ur),Br!==0&&Br!==mr&&v.event.preventDefault()});var fn,Fr,Qr,Bt=function(Gt,Vt,Zt){var ur=(Zt-Vt)/Ur+Gt;return S.constrain(ur,0,mr)},et=function(Gt,Vt,Zt){var ur=(Vt-Zt)/Ur+Gt;return S.constrain(ur,0,mr)},ut=v.behavior.drag().on("dragstart",function(){var Gt=v.event.sourceEvent;Gt.type==="touchstart"?fn=Gt.changedTouches[0].clientY:fn=Gt.clientY,Qr=Br}).on("drag",function(){var Gt=v.event.sourceEvent;Gt.buttons===2||Gt.ctrlKey||(Gt.type==="touchmove"?Fr=Gt.changedTouches[0].clientY:Fr=Gt.clientY,Br=Bt(Qr,fn,Fr),Ie(Br,Qt,Ur))});it.call(ut);var Be=v.behavior.drag().on("dragstart",function(){var Gt=v.event.sourceEvent;Gt.type==="touchstart"&&(fn=Gt.changedTouches[0].clientY,Qr=Br)}).on("drag",function(){var Gt=v.event.sourceEvent;Gt.type==="touchmove"&&(Fr=Gt.changedTouches[0].clientY,Br=et(Qr,fn,Fr),Ie(Br,Qt,Ur))});$e.call(Be)}function Ie(Gt,Vt,Zt){ee._scrollY=H._fullLayout[xe]._scrollY=Gt,a.setTranslate($e,0,-Gt),a.setRect(it,ee._width,o.scrollBarMargin+Gt*Zt,o.scrollBarWidth,Vt),Te.select("rect").attr("y",ht+Gt)}if(H._context.edits.legendPosition){var ke,Fe,at,ct;pe.classed("cursor-move",!0),r.init({element:pe.node(),gd:H,prepFn:function(Gt){if(Gt.target!==it.node()){var Vt=a.getTranslate(pe);at=Vt.x,ct=Vt.y}},moveFn:function(Gt,Vt){if(at!==void 0&&ct!==void 0){var Zt=at+Gt,ur=ct+Vt;a.setTranslate(pe,Zt,ur),ke=r.align(Zt,ee._width,mt.l,mt.l+mt.w,ee.xanchor),Fe=r.align(ur+ee._height,-ee._height,mt.t+mt.h,mt.t,ee.yanchor)}},doneFn:function(){if(ke!==void 0&&Fe!==void 0){var Gt={};Gt[xe+".x"]=ke,Gt[xe+".y"]=Fe,L.call("_guiRelayout",H,Gt)}},clickFn:function(Gt,Vt){var Zt=_e.selectAll("g.traces").filter(function(){var ur=this.getBoundingClientRect();return Vt.clientX>=ur.left&&Vt.clientX<=ur.right&&Vt.clientY>=ur.top&&Vt.clientY<=ur.bottom});Zt.size()>0&&E(H,pe,Zt,Gt,Vt)}})}}],H)}}function T(H,W,ee){var ue=H[0],xe=ue.width,ge=W.entrywidthmode,_e=ue.trace.legendwidth||W.entrywidth;return ge==="fraction"?W._maxWidth*_e:ee+(_e||xe)}function E(H,W,ee,ue,xe){var ge=ee.data()[0][0].trace,_e={event:xe,node:ee.node(),curveNumber:ge.index,expandedIndex:ge.index,data:H.data,layout:H.layout,frames:H._transitionData._frames,config:H._context,fullData:H._fullData,fullLayout:H._fullLayout};ge._group&&(_e.group=ge._group),L.traceIs(ge,"pie-like")&&(_e.label=ee.datum()[0].label);var Y=t.triggerHandler(H,"plotly_legendclick",_e);if(ue===1){if(Y===!1)return;W._clickTimeout=setTimeout(function(){H._fullLayout&&s(ee,H,ue)},H._context.doubleClickDelay)}else if(ue===2){W._clickTimeout&&clearTimeout(W._clickTimeout),H._legendMouseDownTime=0;var se=t.triggerHandler(H,"plotly_legenddoubleclick",_e);se!==!1&&Y!==!1&&s(ee,H,ue)}}function _(H,W,ee){var ue=O(ee),xe=H.data()[0][0],ge=xe.trace,_e=L.traceIs(ge,"pie-like"),Y=!ee._inHover&&W._context.edits.legendText&&!_e,se=ee._maxNameLength,ce,ne;xe.groupTitle?(ce=xe.groupTitle.text,ne=xe.groupTitle.font):(ne=ee.font,ee.entries?ce=xe.text:(ce=_e?xe.label:ge.name,ge._meta&&(ce=S.templateString(ce,ge._meta))));var ye=S.ensureSingle(H,"text",ue+"text");ye.attr("text-anchor","start").call(a.font,ne).text(Y?h(ce,se):ce);var le=ee.indentation+ee.itemwidth+o.itemGap*2;i.positionText(ye,le,0),Y?ye.call(i.makeEditable,{gd:W,text:ce}).call(w,H,W,ee).on("edit",function(Z){this.text(h(Z,se)).call(w,H,W,ee);var de=xe.trace._fullInput||{},pe={};return pe.name=Z,de._isShape?L.call("_guiRelayout",W,"shapes["+ge.index+"].name",pe.name):L.call("_guiRestyle",W,pe,ge.index)}):w(ye,H,W,ee)}function h(H,W){var ee=Math.max(4,W);if(H&&H.trim().length>=ee/2)return H;H=H||"";for(var ue=ee-H.length;ue>0;ue--)H+=" ";return H}function m(H,W,ee){var ue=W._context.doubleClickDelay,xe,ge=1,_e=S.ensureSingle(H,"rect",ee+"toggle",function(Y){W._context.staticPlot||Y.style("cursor","pointer").attr("pointer-events","all"),Y.call(l.fill,"rgba(0,0,0,0)")});W._context.staticPlot||(_e.on("mousedown",function(){xe=new Date().getTime(),xe-W._legendMouseDownTimeue&&(ge=Math.max(ge-1,1)),E(W,Y,H,ge,v.event)}}))}function w(H,W,ee,ue,xe){ue._inHover&&H.attr("data-notex",!0),i.convertToTspans(H,ee,function(){F(W,ee,ue,xe)})}function F(H,W,ee,ue){var xe=H.data()[0][0],ge=xe&&xe.trace.showlegend;if(Array.isArray(ge)&&(ge=ge[xe.i]!==!1),!ee._inHover&&xe&&!ge){H.remove();return}var _e=H.select("g[class*=math-group]"),Y=_e.node(),se=O(ee);ee||(ee=W._fullLayout[se]);var ce=ee.borderwidth,ne;ue===x?ne=ee.title.font:xe.groupTitle?ne=xe.groupTitle.font:ne=ee.font;var ye=ne.size*p,le,Z;if(Y){var de=a.bBox(Y);le=de.height,Z=de.width,ue===x?a.setTranslate(_e,ce,ce+le*.75):a.setTranslate(_e,0,le*.25)}else{var pe="."+se+(ue===x?"title":"")+"text",Te=H.select(pe),Ne=i.lineCount(Te),$e=Te.node();if(le=ye*Ne,Z=$e?a.bBox($e).width:0,ue===x)ee.title.side==="left"&&(Z+=o.itemGap*2),i.positionText(Te,ce+o.titlePad,ce+ye);else{var Ze=o.itemGap*2+ee.indentation+ee.itemwidth;xe.groupTitle&&(Ze=o.itemGap,Z-=ee.indentation+ee.itemwidth),i.positionText(Te,Ze,-ye*((Ne-1)/2-.3))}}ue===x?(ee._titleWidth=Z,ee._titleHeight=le):(xe.lineHeight=ye,xe.height=Math.max(le,16)+3,xe.width=Z)}function z(H){var W=0,ee=0,ue=H.title.side;return ue&&(ue.indexOf("left")!==-1&&(W=H._titleWidth),ue.indexOf("top")!==-1&&(ee=H._titleHeight)),[W,ee]}function U(H,W,ee,ue){var xe=H._fullLayout,ge=O(ue);ue||(ue=xe[ge]);var _e=xe._size,Y=f.isVertical(ue),se=f.isGrouped(ue),ce=ue.entrywidthmode==="fraction",ne=ue.borderwidth,ye=2*ne,le=o.itemGap,Z=ue.indentation+ue.itemwidth+le*2,de=2*(ne+le),pe=j(ue),Te=ue.y<0||ue.y===0&&pe==="top",Ne=ue.y>1||ue.y===1&&pe==="bottom",$e=ue.tracegroupgap,Ze={};const{orientation:Xe,yref:it}=ue;let{maxheight:yt}=ue;const bt=Te||Ne||Xe!=="v"||it!=="paper";yt||(yt=bt?.5:1);const mt=bt?xe.height:_e.h;ue._maxHeight=Math.max(yt>1?yt:yt*mt,30);var ht=0;ue._width=0,ue._height=0;var Ve=z(ue);if(Y)ee.each(function(Ie){var ke=Ie[0].height;a.setTranslate(this,ne+Ve[0],ne+Ve[1]+ue._height+ke/2+le),ue._height+=ke,ue._width=Math.max(ue._width,Ie[0].width)}),ht=Z+ue._width,ue._width+=le+Z+ye,ue._height+=de,se&&(W.each(function(Ie,ke){a.setTranslate(this,0,ke*ue.tracegroupgap)}),ue._height+=(ue._lgroupsLength-1)*ue.tracegroupgap);else{var ze=G(ue),Se=ue.x<0||ue.x===0&&ze==="right",Je=ue.x>1||ue.x===1&&ze==="left",_t=Ne||Te,At=xe.width/2;ue._maxWidth=Math.max(Se?_t&&ze==="left"?_e.l+_e.w:At:Je?_t&&ze==="right"?_e.r+_e.w:At:_e.w,2*Z);var vt=0,Kt=0;ee.each(function(Ie){var ke=T(Ie,ue,Z);vt=Math.max(vt,ke),Kt+=ke}),ht=null;var Qt=0;if(se){var fr=0,mr=0,Ur=0;W.each(function(){var Ie=0,ke=0;v.select(this).selectAll("g.traces").each(function(at){var ct=T(at,ue,Z),Gt=at[0].height;a.setTranslate(this,Ve[0],Ve[1]+ne+le+Gt/2+ke),ke+=Gt,Ie=Math.max(Ie,ct),Ze[at[0].trace.legendgroup]=Ie});var Fe=Ie+le;mr>0&&Fe+ne+mr>ue._maxWidth?(Qt=Math.max(Qt,mr),mr=0,Ur+=fr+$e,fr=ke):fr=Math.max(fr,ke),a.setTranslate(this,mr,Ur),mr+=Fe}),ue._width=Math.max(Qt,mr)+ne,ue._height=Ur+fr+de}else{var Br=ee.size(),fn=Kt+ye+(Br-1)*le=ue._maxWidth&&(Qt=Math.max(Qt,et),Qr=0,Bt+=Fr,ue._height+=Fr,Fr=0),a.setTranslate(this,Ve[0]+ne+Qr,Ve[1]+ne+Bt+ke/2+le),et=Qr+Fe+le,Qr+=at,Fr=Math.max(Fr,ke)}),fn?(ue._width=Qr+ye,ue._height=Fr+de):(ue._width=Math.max(Qt,et)+ye,ue._height+=Fr+de)}}ue._width=Math.ceil(Math.max(ue._width+Ve[0],ue._titleWidth+2*(ne+o.titlePad))),ue._height=Math.ceil(Math.max(ue._height+Ve[1],ue._titleHeight+2*(ne+o.itemGap))),ue._effHeight=Math.min(ue._height,ue._maxHeight);var ut=H._context.edits,Be=ut.legendText||ut.legendPosition;ee.each(function(Ie){var ke=v.select(this).select("."+ge+"toggle"),Fe=Ie[0].height,at=Ie[0].trace.legendgroup,ct=T(Ie,ue,Z);se&&at!==""&&(ct=Ze[at]);var Gt=Be?Z:ht||ct;!Y&&!ce&&(Gt+=le/2),a.setRect(ke,0,-Fe/2,Gt,Fe)})}function V(H,W,ee,ue){var xe=H._fullLayout,ge=xe[W],_e=G(ge),Y=j(ge),se=ge.xref==="paper",ce=ge.yref==="paper";H._fullLayout._reservedMargin[W]={};var ne=ge.y<.5?"b":"t",ye=ge.x<.5?"l":"r",le={r:xe.width-ee,l:ee+ge._width,b:xe.height-ue,t:ue+ge._effHeight};if(se&&ce)return M.autoMargin(H,W,{x:ge.x,y:ge.y,l:ge._width*d[_e],r:ge._width*y[_e],b:ge._effHeight*y[Y],t:ge._effHeight*d[Y]});se?H._fullLayout._reservedMargin[W][ne]=le[ne]:ce||ge.orientation==="v"?H._fullLayout._reservedMargin[W][ye]=le[ye]:H._fullLayout._reservedMargin[W][ne]=le[ne]}function G(H){return S.isRightAnchor(H)?"right":S.isCenterAnchor(H)?"center":"left"}function j(H){return S.isBottomAnchor(H)?"bottom":S.isMiddleAnchor(H)?"middle":"top"}function O(H){return H._id||"legend"}}}),Hk=Re({"src/components/fx/hover.js"(ae){var K=un(),v=da(),S=oo(),M=Rn(),L=M.pushUnique,t=M.strTranslate,r=M.strRotate,a=Ib(),l=kc(),i=PD(),s=qs(),o=ko(),c=fv(),p=js(),d=qh().zindexSeparator,y=es(),g=Xp(),C=el(),f=$k(),x=qk(),A=C.YANGLE,k=Math.PI*A/180,I=1/Math.sin(k),T=Math.cos(k),E=Math.sin(k),_=C.HOVERARROWSIZE,h=C.HOVERTEXTPAD,m={box:!0,ohlc:!0,violin:!0,candlestick:!0},w={scatter:!0,scattergl:!0,splom:!0};function F(Z,de){return Z.distance-de.distance}ae.hover=function(de,pe,Te,Ne){de=M.getGraphDiv(de);var $e=pe.target;M.throttle(de._fullLayout._uid+C.HOVERID,C.HOVERMINTIME,function(){z(de,pe,Te,Ne,$e)})},ae.loneHover=function(de,pe){var Te=!0;Array.isArray(de)||(Te=!1,de=[de]);var Ne=pe.gd,$e=ne(Ne),Ze=ye(Ne),Xe=de.map(function(Je){var _t=Je._x0||Je.x0||Je.x||0,At=Je._x1||Je.x1||Je.x||0,vt=Je._y0||Je.y0||Je.y||0,Kt=Je._y1||Je.y1||Je.y||0,Qt=Je.eventData;if(Qt){var fr=Math.min(_t,At),mr=Math.max(_t,At),Ur=Math.min(vt,Kt),Br=Math.max(vt,Kt),fn=Je.trace;if(y.traceIs(fn,"gl3d")){var Fr=Ne._fullLayout[fn.scene]._scene.container,Qr=Fr.offsetLeft,Bt=Fr.offsetTop;fr+=Qr,mr+=Qr,Ur+=Bt,Br+=Bt}Qt.bbox={x0:fr+Ze,x1:mr+Ze,y0:Ur+$e,y1:Br+$e},pe.inOut_bbox&&pe.inOut_bbox.push(Qt.bbox)}else Qt=!1;return{color:Je.color||o.defaultLine,x0:Je.x0||Je.x||0,x1:Je.x1||Je.x||0,y0:Je.y0||Je.y||0,y1:Je.y1||Je.y||0,xLabel:Je.xLabel,yLabel:Je.yLabel,zLabel:Je.zLabel,text:Je.text,name:Je.name,idealAlign:Je.idealAlign,borderColor:Je.borderColor,fontFamily:Je.fontFamily,fontSize:Je.fontSize,fontColor:Je.fontColor,fontWeight:Je.fontWeight,fontStyle:Je.fontStyle,fontVariant:Je.fontVariant,nameLength:Je.nameLength,textAlign:Je.textAlign,trace:Je.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Je.hovertemplate||!1,hovertemplateLabels:Je.hovertemplateLabels||!1,eventData:Qt}}),it=!1,yt=G(Xe,{gd:Ne,hovermode:"closest",rotateLabels:it,bgColor:pe.bgColor||o.background,container:K.select(pe.container),outerContainer:pe.outerContainer||pe.container}),bt=yt.hoverLabels,mt=5,ht=0,Ve=0;bt.sort(function(Je,_t){return Je.y0-_t.y0}).each(function(Je,_t){var At=Je.y0-Je.by/2;At-mtmr[0]._length||xa<0||xa>Ur[0]._length)return c.unhoverRaw(Z,de)}if(de.pointerX=_a+mr[0]._offset,de.pointerY=xa+Ur[0]._offset,"xval"in de?Be=g.flat($e,de.xval):Be=g.p2c(mr,_a),"yval"in de?Ie=g.flat($e,de.yval):Ie=g.p2c(Ur,xa),!v(Be[0])||!v(Ie[0]))return M.warn("Fx.hover failed",de,Z),c.unhoverRaw(Z,de)}var ci=1/0;function _r(Oi,bs){for(Fe=0;FeSr&&(et.splice(0,Sr),ci=et[0].distance),mt&&Bt!==0&&et.length===0){kr.distance=Bt,kr.index=!1;var ss=ct._module.hoverPoints(kr,ur,Dr,"closest",{hoverLayer:Xe._hoverlayer});if(ss&&(ss=ss.filter(function(Uo){return Uo.spikeDistance<=Bt})),ss&&ss.length){var hl,ll=ss.filter(function(Uo){return Uo.xa.showspikes&&Uo.xa.spikesnap!=="hovered data"});if(ll.length){var Il=ll[0];v(Il.x0)&&v(Il.y0)&&(hl=yr(Il),(!Jr.vLinePoint||Jr.vLinePoint.spikeDistance>hl.spikeDistance)&&(Jr.vLinePoint=hl))}var Ls=ss.filter(function(Uo){return Uo.ya.showspikes&&Uo.ya.spikesnap!=="hovered data"});if(Ls.length){var ps=Ls[0];v(ps.x0)&&v(ps.y0)&&(hl=yr(ps),(!Jr.hLinePoint||Jr.hLinePoint.spikeDistance>hl.spikeDistance)&&(Jr.hLinePoint=hl))}}}}}_r();function rr(Oi,bs,cs){for(var fl=null,Is=1/0,ys,ss=0;ssOi.trace.index===sa.trace.index):et=[sa];var ji=et.length,Qi=ce("x",sa,Xe),Xt=ce("y",sa,Xe);_r(Qi,Xt);var Lt=[],$r={},en=0,rn=function(Oi){var bs=m[Oi.trace.type]?U(Oi):Oi.trace.index;if(!$r[bs])en++,$r[bs]=en,Lt.push(Oi);else{var cs=$r[bs]-1,fl=Lt[cs];cs>0&&Math.abs(Oi.distance)ji-1;Wr--)rn(et[Wr]);et=Lt,bn()}var tn=Z._hoverdata,wn=[],dn=ne(Z),Nt=ye(Z);for(const Oi of et){var xr=g.makeEventData(Oi,Oi.trace,Oi.cd);if(Oi.hovertemplate!==!1){var Xr=!1;Oi.cd[Oi.index]&&Oi.cd[Oi.index].ht&&(Xr=Oi.cd[Oi.index].ht),Oi.hovertemplate=Xr||Oi.trace.hovertemplate||!1}if(Oi.xa&&Oi.ya){var Tn=Oi.x0+Oi.xa._offset,Xn=Oi.x1+Oi.xa._offset,ia=Oi.y0+Oi.ya._offset,na=Oi.y1+Oi.ya._offset,An=Math.min(Tn,Xn),Yn=Math.max(Tn,Xn),qi=Math.min(ia,na),Ga=Math.max(ia,na);xr.bbox={x0:An+Nt,x1:Yn+Nt,y0:qi+dn,y1:Ga+dn}}Oi.eventData=[xr],wn.push(xr)}Z._hoverdata=wn;var to=ht==="y"&&(ut.length>1||et.length>1)||ht==="closest"&&jn&&et.length>1,_o=o.combine(Xe.plot_bgcolor||o.background,Xe.paper_bgcolor),Po=G(et,{gd:Z,hovermode:ht,rotateLabels:to,bgColor:_o,container:Xe._hoverlayer,outerContainer:Xe._paper.node(),commonLabelOpts:Xe.hoverlabel,hoverdistance:Xe.hoverdistance}),Ro=Po.hoverLabels;if(g.isUnifiedHover(ht)||(O(Ro,to,Xe,Po.commonLabelBoundingBox),ee(Ro,to,Xe._invScaleX,Xe._invScaleY)),Ne&&Ne.tagName){var Xo=y.getComponentMethod("annotations","hasClickToShow")(Z,wn);i(K.select(Ne),Xo?"pointer":"")}!Ne||Te||!ge(Z,de,tn)||(tn&&Z.emit("plotly_unhover",{event:de,points:tn}),Z.emit("plotly_hover",{event:de,points:Z._hoverdata,xaxes:mr,yaxes:Ur,xvals:Be,yvals:Ie}))}function U(Z){return[Z.trace.index,Z.index,Z.x0,Z.y0,Z.name,Z.attr,Z.xa?Z.xa._id:"",Z.ya?Z.ya._id:""].join(",")}var V=/([\s\S]*)<\/extra>/;function G(Z,de){var pe=de.gd,Te=pe._fullLayout,Ne=de.hovermode,$e=de.rotateLabels,Ze=de.bgColor,Xe=de.container,it=de.outerContainer,yt=de.commonLabelOpts||{};if(Z.length===0)return[[]];var bt=de.fontFamily||C.HOVERFONT,mt=de.fontSize||C.HOVERFONTSIZE,ht=de.fontWeight||Te.font.weight,Ve=de.fontStyle||Te.font.style,ze=de.fontVariant||Te.font.variant,Se=de.fontTextcase||Te.font.textcase,Je=de.fontLineposition||Te.font.lineposition,_t=de.fontShadow||Te.font.shadow,At=Z[0],vt=At.xa,Kt=At.ya,Qt=Ne.charAt(0),fr=Qt+"Label",mr=At[fr];if(mr===void 0&&vt.type==="multicategory")for(var Ur=0;UrTe.width-Nt&&(xr=Te.width-Nt),ji.attr("d","M"+(tn-xr)+",0L"+(tn-xr+_)+","+dn+_+"H"+Nt+"v"+dn+(h*2+Wr.height)+"H"+-Nt+"V"+dn+_+"H"+(tn-xr-_)+"Z"),tn=xr,Fe.minX=tn-Nt,Fe.maxX=tn+Nt,vt.side==="top"?(Fe.minY=wn-(h*2+Wr.height),Fe.maxY=wn-h):(Fe.minY=wn+h,Fe.maxY=wn+(h*2+Wr.height))}else{var Xr,Tn,Xn;Kt.side==="right"?(Xr="start",Tn=1,Xn="",tn=vt._offset+vt._length):(Xr="end",Tn=-1,Xn="-",tn=vt._offset),wn=Kt._offset+(At.y0+At.y1)/2,Qi.attr("text-anchor",Xr),ji.attr("d","M0,0L"+Xn+_+","+_+"V"+(h+Wr.height/2)+"h"+Xn+(h*2+Wr.width)+"V-"+(h+Wr.height/2)+"H"+Xn+_+"V-"+_+"Z"),Fe.minY=wn-(h+Wr.height/2),Fe.maxY=wn+(h+Wr.height/2),Kt.side==="right"?(Fe.minX=tn+_,Fe.maxX=tn+_+(h*2+Wr.width)):(Fe.minX=tn-_-(h*2+Wr.width),Fe.maxX=tn-_);var ia=Wr.height/2,na=fn-Wr.top-ia,An="clip"+Te._uid+"commonlabel"+Kt._id,Yn;if(tnji.hoverinfo!=="none");if(sa.length===0)return[];var at=Te.hoverlabel,ct=at.font,Gt=sa[0],Vt=((Ne==="x unified"?Gt.xa:Gt.ya).unifiedhovertitle||{}).text,Zt=Vt?M.hovertemplateString({data:Ne==="x unified"?[{xa:Gt.xa,x:Gt.xVal}]:[{ya:Gt.ya,y:Gt.yVal}],fallback:Gt.trace.hovertemplatefallback,locale:Te._d3locale,template:Vt}):mr,ur={showlegend:!0,legend:{title:{text:Zt,font:ct},font:ct,bgcolor:at.bgcolor,bordercolor:at.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:Te.legend?Te.legend.traceorder:void 0,orientation:"v"}},Dr={font:ct};f(ur,Dr,pe._fullData);var kr=Dr.legend;kr.entries=[];for(var Sr=0;Sr=0?La=In:Fn+Ha=0?La=Fn:va+Ha=0?Oa=an:bn+ci=0?Oa=bn:Pa+ci=0,(sa.idealAlign==="top"||!to)&&_o?(Xn-=na/2,sa.anchor="end"):to?(Xn+=na/2,sa.anchor="start"):sa.anchor="middle",sa.crossPos=Xn;else{if(sa.pos=Xn,to=Tn+ia/2+Ga<=Fr,_o=Tn-ia/2-Ga>=0,(sa.idealAlign==="left"||!to)&&_o)Tn-=ia/2,sa.anchor="end";else if(to)Tn+=ia/2,sa.anchor="start";else{sa.anchor="middle";var Po=Ga/2,Ro=Tn+Po-Fr,Xo=Tn-Po;Ro>0&&(Tn-=Ro),Xo<0&&(Tn+=-Xo)}sa.crossPos=Tn}wn.attr("text-anchor",sa.anchor),Nt&&dn.attr("text-anchor",sa.anchor),ji.attr("transform",t(Tn,Xn)+($e?r(A):""))}),{hoverLabels:Wa,commonLabelBoundingBox:Fe}}function j(Z,de,pe,Te,Ne,$e){var Ze,Xe,it="",yt="";Z.nameOverride!==void 0&&(Z.name=Z.nameOverride),Z.name&&(Z.trace._meta&&(Z.name=M.templateString(Z.name,Z.trace._meta)),it=Y(Z.name,Z.nameLength));var bt=pe.charAt(0),mt=bt==="x"?"y":"x";Z.zLabel!==void 0?(Z.xLabel!==void 0&&(yt+="x: "+Z.xLabel+"
"),Z.yLabel!==void 0&&(yt+="y: "+Z.yLabel+"
"),Z.trace.type!=="choropleth"&&Z.trace.type!=="choroplethmapbox"&&Z.trace.type!=="choroplethmap"&&(yt+=(yt?"z: ":"")+Z.zLabel)):de&&Z[bt+"Label"]===Ne?yt=Z[mt+"Label"]||"":Z.xLabel===void 0?Z.yLabel!==void 0&&Z.trace.type!=="scattercarpet"&&(yt=Z.yLabel):Z.yLabel===void 0?yt=Z.xLabel:yt="("+Z.xLabel+", "+Z.yLabel+")",(Z.text||Z.text===0)&&!Array.isArray(Z.text)&&(yt+=(yt?"
":"")+Z.text),Z.extraText!==void 0&&(yt+=(yt?"
":"")+Z.extraText),$e&&yt===""&&!Z.hovertemplate&&(it===""&&$e.remove(),yt=it),(Xe=(Ze=Z.trace)==null?void 0:Ze.hoverlabel)!=null&&Xe.split&&(Z.hovertemplate="");const{hovertemplate:ht=!1}=Z;if(ht){const Ve=Z.hovertemplateLabels||Z;Z[bt+"Label"]!==Ne&&(Ve[bt+"other"]=Ve[bt+"Val"],Ve[bt+"otherLabel"]=Ve[bt+"Label"]),yt=M.hovertemplateString({data:[Z.eventData[0]||{},Z.trace._meta],fallback:Z.trace.hovertemplatefallback,labels:Ve,locale:Te._d3locale,template:ht}),yt=yt.replace(V,(ze,Se)=>(it=Y(Se,Z.nameLength),""))}return[yt,it]}function O(Z,de,pe,Te){var Ne=de?"xa":"ya",$e=de?"ya":"xa",Ze=0,Xe=1,it=Z.size(),yt=new Array(it),bt=0,mt=Te.minX,ht=Te.maxX,Ve=Te.minY,ze=Te.maxY,Se=function(Be){return Be*pe._invScaleX},Je=function(Be){return Be*pe._invScaleY};Z.each(function(Be){var Ie=Be[Ne],ke=Be[$e],Fe=Ie._id.charAt(0)==="x",at=Ie.range;bt===0&&at&&at[0]>at[1]!==Fe&&(Xe=-1);var ct=0,Gt=Fe?pe.width:pe.height;if(pe.hovermode==="x"||pe.hovermode==="y"){var Vt=H(Be,de),Zt=Be.anchor,ur=Zt==="end"?-1:1,Dr,kr;if(Zt==="middle")Dr=Be.crossPos+(Fe?Je(Vt.y-Be.by/2):Se(Be.bx/2+Be.tx2width/2)),kr=Dr+(Fe?Je(Be.by):Se(Be.bx));else if(Fe)Dr=Be.crossPos+Je(_+Vt.y)-Je(Be.by/2-_),kr=Dr+Je(Be.by);else{var Sr=Se(ur*_+Vt.x),Jr=Sr+Se(ur*Be.bx);Dr=Be.crossPos+Math.min(Sr,Jr),kr=Be.crossPos+Math.max(Sr,Jr)}Fe?Ve!==void 0&&ze!==void 0&&Math.min(kr,ze)-Math.max(Dr,Ve)>1&&(ke.side==="left"?(ct=ke._mainLinePosition,Gt=pe.width):Gt=ke._mainLinePosition):mt!==void 0&&ht!==void 0&&Math.min(kr,ht)-Math.max(Dr,mt)>1&&(ke.side==="top"?(ct=ke._mainLinePosition,Gt=pe.height):Gt=ke._mainLinePosition)}yt[bt++]=[{datum:Be,traceIndex:Be.trace.index,dp:0,pos:Be.pos,posref:Be.posref,size:Be.by*(Fe?I:1)/2,pmin:ct,pmax:Gt}]}),yt.sort(function(Be,Ie){return Be[0].posref-Ie[0].posref||Xe*(Ie[0].traceIndex-Be[0].traceIndex)});var _t,At,vt,Kt,Qt,fr,mr;function Ur(Be){var Ie=Be[0],ke=Be[Be.length-1];if(At=Ie.pmin-Ie.pos-Ie.dp+Ie.size,vt=ke.pos+ke.dp+ke.size-Ie.pmax,At>.01){for(Qt=Be.length-1;Qt>=0;Qt--)Be[Qt].dp+=At;_t=!1}if(!(vt<.01)){if(At<-.01){for(Qt=Be.length-1;Qt>=0;Qt--)Be[Qt].dp-=vt;_t=!1}if(_t){var Fe=0;for(Kt=0;KtIe.pmax&&Fe++;for(Kt=Be.length-1;Kt>=0&&!(Fe<=0);Kt--)fr=Be[Kt],fr.pos>Ie.pmax-1&&(fr.del=!0,Fe--);for(Kt=0;Kt=0;Qt--)Be[Qt].dp-=vt;for(Kt=Be.length-1;Kt>=0&&!(Fe<=0);Kt--)fr=Be[Kt],fr.pos+fr.dp+fr.size>Ie.pmax&&(fr.del=!0,Fe--)}}}for(;!_t&&Ze<=it;){for(Ze++,_t=!0,Kt=0;Kt.01){for(Qt=fn.length-1;Qt>=0;Qt--)fn[Qt].dp+=At;for(Br.push.apply(Br,fn),yt.splice(Kt+1,1),mr=0,Qt=Br.length-1;Qt>=0;Qt--)mr+=Br[Qt].dp;for(vt=mr/Br.length,Qt=Br.length-1;Qt>=0;Qt--)Br[Qt].dp-=vt;_t=!1}else Kt++}yt.forEach(Ur)}for(Kt=yt.length-1;Kt>=0;Kt--){var Bt=yt[Kt];for(Qt=Bt.length-1;Qt>=0;Qt--){var et=Bt[Qt],ut=et.datum;ut.offset=et.dp,ut.del=et.del}}}function H(Z,de){var pe=0,Te=Z.offset;return de&&(Te*=-E,pe=Z.offset*T),{x:pe,y:Te}}function W(Z){var de={start:1,end:-1,middle:0}[Z.anchor],pe=de*(_+h),Te=pe+de*(Z.txwidth+h),Ne=Z.anchor==="middle";return Ne&&(pe-=Z.tx2width/2,Te+=Z.txwidth/2+h),{alignShift:de,textShiftX:pe,text2ShiftX:Te}}function ee(Z,de,pe,Te){var Ne=function(Ze){return Ze*pe},$e=function(Ze){return Ze*Te};Z.each(function(Ze){var Xe=K.select(this);if(Ze.del)return Xe.remove();var it=Xe.select("text.nums"),yt=Ze.anchor,bt=yt==="end"?-1:1,mt=W(Ze),ht=H(Ze,de),Ve=ht.x,ze=ht.y,Se=yt==="middle",Je="hoverlabel"in Ze.trace?Ze.trace.hoverlabel.showarrow:!0,_t;Se?_t="M-"+Ne(Ze.bx/2+Ze.tx2width/2)+","+$e(ze-Ze.by/2)+"h"+Ne(Ze.bx)+"v"+$e(Ze.by)+"h-"+Ne(Ze.bx)+"Z":Je?_t="M0,0L"+Ne(bt*_+Ve)+","+$e(_+ze)+"v"+$e(Ze.by/2-_)+"h"+Ne(bt*Ze.bx)+"v-"+$e(Ze.by)+"H"+Ne(bt*_+Ve)+"V"+$e(ze-_)+"Z":_t="M"+Ne(bt*_+Ve)+","+$e(ze-Ze.by/2)+"h"+Ne(bt*Ze.bx)+"v"+$e(Ze.by)+"h"+Ne(-bt*Ze.bx)+"Z",Xe.select("path").attr("d",_t);var At=Ve+mt.textShiftX,vt=ze+Ze.ty0-Ze.by/2+h,Kt=Ze.textAlign||"auto";Kt!=="auto"&&(Kt==="left"&&yt!=="start"?(it.attr("text-anchor","start"),At=Se?-Ze.bx/2-Ze.tx2width/2+h:-Ze.bx-h):Kt==="right"&&yt!=="end"&&(it.attr("text-anchor","end"),At=Se?Ze.bx/2-Ze.tx2width/2-h:Ze.bx+h)),it.call(l.positionText,Ne(At),$e(vt)),Ze.tx2width&&(Xe.select("text.name").call(l.positionText,Ne(mt.text2ShiftX+mt.alignShift*h+Ve),$e(ze+Ze.ty0-Ze.by/2+h)),Xe.select("rect").call(s.setRect,Ne(mt.text2ShiftX+(mt.alignShift-1)*Ze.tx2width/2+Ve),$e(ze-Ze.by/2-1),Ne(Ze.tx2width),$e(Ze.by+2)))})}function ue(Z,de){var pe=Z.index,Te=Z.trace||{},Ne=Z.cd[0],$e=Z.cd[pe]||{};function Ze(ht){return ht||v(ht)&&ht===0}var Xe=Array.isArray(pe)?function(ht,Ve){var ze=M.castOption(Ne,pe,ht);return Ze(ze)?ze:M.extractOption({},Te,"",Ve)}:function(ht,Ve){return M.extractOption($e,Te,ht,Ve)};function it(ht,Ve,ze){var Se=Xe(Ve,ze);Ze(Se)&&(Z[ht]=Se)}if(it("hoverinfo","hi","hoverinfo"),it("bgcolor","hbg","hoverlabel.bgcolor"),it("borderColor","hbc","hoverlabel.bordercolor"),it("fontFamily","htf","hoverlabel.font.family"),it("fontSize","hts","hoverlabel.font.size"),it("fontColor","htc","hoverlabel.font.color"),it("fontWeight","htw","hoverlabel.font.weight"),it("fontStyle","hty","hoverlabel.font.style"),it("fontVariant","htv","hoverlabel.font.variant"),it("nameLength","hnl","hoverlabel.namelength"),it("textAlign","hta","hoverlabel.align"),Z.posref=de==="y"||de==="closest"&&Te.orientation==="h"?Z.xa._offset+(Z.x0+Z.x1)/2:Z.ya._offset+(Z.y0+Z.y1)/2,Z.x0=M.constrain(Z.x0,0,Z.xa._length),Z.x1=M.constrain(Z.x1,0,Z.xa._length),Z.y0=M.constrain(Z.y0,0,Z.ya._length),Z.y1=M.constrain(Z.y1,0,Z.ya._length),Z.xLabelVal!==void 0&&(Z.xLabel="xLabel"in Z?Z.xLabel:p.hoverLabelText(Z.xa,Z.xLabelVal,Te.xhoverformat),Z.xVal=Z.xa.c2d(Z.xLabelVal)),Z.yLabelVal!==void 0&&(Z.yLabel="yLabel"in Z?Z.yLabel:p.hoverLabelText(Z.ya,Z.yLabelVal,Te.yhoverformat),Z.yVal=Z.ya.c2d(Z.yLabelVal)),Z.zLabelVal!==void 0&&Z.zLabel===void 0&&(Z.zLabel=String(Z.zLabelVal)),!isNaN(Z.xerr)&&!(Z.xa.type==="log"&&Z.xerr<=0)){var yt=p.tickText(Z.xa,Z.xa.c2l(Z.xerr),"hover").text;Z.xerrneg!==void 0?Z.xLabel+=" +"+yt+" / -"+p.tickText(Z.xa,Z.xa.c2l(Z.xerrneg),"hover").text:Z.xLabel+=" ± "+yt,de==="x"&&(Z.distance+=1)}if(!isNaN(Z.yerr)&&!(Z.ya.type==="log"&&Z.yerr<=0)){var bt=p.tickText(Z.ya,Z.ya.c2l(Z.yerr),"hover").text;Z.yerrneg!==void 0?Z.yLabel+=" +"+bt+" / -"+p.tickText(Z.ya,Z.ya.c2l(Z.yerrneg),"hover").text:Z.yLabel+=" ± "+bt,de==="y"&&(Z.distance+=1)}var mt=Z.hoverinfo||Z.trace.hoverinfo;return mt&&mt!=="all"&&(mt=Array.isArray(mt)?mt:mt.split("+"),mt.indexOf("x")===-1&&(Z.xLabel=void 0),mt.indexOf("y")===-1&&(Z.yLabel=void 0),mt.indexOf("z")===-1&&(Z.zLabel=void 0),mt.indexOf("text")===-1&&(Z.text=void 0),mt.indexOf("name")===-1&&(Z.name=void 0)),Z}function xe(Z,de,pe){var Te=pe.container,Ne=pe.fullLayout,$e=Ne._size,Ze=pe.event,Xe=!!de.hLinePoint,it=!!de.vLinePoint,yt,bt;if(Te.selectAll(".spikeline").remove(),!!(it||Xe)){var mt=o.combine(Ne.plot_bgcolor,Ne.paper_bgcolor);if(Xe){var ht=de.hLinePoint,Ve,ze;yt=ht&&ht.xa,bt=ht&&ht.ya;var Se=bt.spikesnap;Se==="cursor"?(Ve=Ze.pointerX,ze=Ze.pointerY):(Ve=yt._offset+ht.x,ze=bt._offset+ht.y);var Je=S.readability(ht.color,mt)<1.5?o.contrast(mt):ht.color,_t=bt.spikemode,At=bt.spikethickness,vt=bt.spikecolor||Je,Kt=p.getPxPosition(Z,bt),Qt,fr;if(_t.indexOf("toaxis")!==-1||_t.indexOf("across")!==-1){if(_t.indexOf("toaxis")!==-1&&(Qt=Kt,fr=Ve),_t.indexOf("across")!==-1){var mr=bt._counterDomainMin,Ur=bt._counterDomainMax;bt.anchor==="free"&&(mr=Math.min(mr,bt.position),Ur=Math.max(Ur,bt.position)),Qt=$e.l+mr*$e.w,fr=$e.l+Ur*$e.w}Te.insert("line",":first-child").attr({x1:Qt,x2:fr,y1:ze,y2:ze,"stroke-width":At,stroke:vt,"stroke-dasharray":s.dashStyle(bt.spikedash,At)}).classed("spikeline",!0).classed("crisp",!0),Te.insert("line",":first-child").attr({x1:Qt,x2:fr,y1:ze,y2:ze,"stroke-width":At+2,stroke:mt}).classed("spikeline",!0).classed("crisp",!0)}_t.indexOf("marker")!==-1&&Te.insert("circle",":first-child").attr({cx:Kt+(bt.side!=="right"?At:-At),cy:ze,r:At,fill:vt}).classed("spikeline",!0)}if(it){var Br=de.vLinePoint,fn,Fr;yt=Br&&Br.xa,bt=Br&&Br.ya;var Qr=yt.spikesnap;Qr==="cursor"?(fn=Ze.pointerX,Fr=Ze.pointerY):(fn=yt._offset+Br.x,Fr=bt._offset+Br.y);var Bt=S.readability(Br.color,mt)<1.5?o.contrast(mt):Br.color,et=yt.spikemode,ut=yt.spikethickness,Be=yt.spikecolor||Bt,Ie=p.getPxPosition(Z,yt),ke,Fe;if(et.indexOf("toaxis")!==-1||et.indexOf("across")!==-1){if(et.indexOf("toaxis")!==-1&&(ke=Ie,Fe=Fr),et.indexOf("across")!==-1){var at=yt._counterDomainMin,ct=yt._counterDomainMax;yt.anchor==="free"&&(at=Math.min(at,yt.position),ct=Math.max(ct,yt.position)),ke=$e.t+(1-ct)*$e.h,Fe=$e.t+(1-at)*$e.h}Te.insert("line",":first-child").attr({x1:fn,x2:fn,y1:ke,y2:Fe,"stroke-width":ut,stroke:Be,"stroke-dasharray":s.dashStyle(yt.spikedash,ut)}).classed("spikeline",!0).classed("crisp",!0),Te.insert("line",":first-child").attr({x1:fn,x2:fn,y1:ke,y2:Fe,"stroke-width":ut+2,stroke:mt}).classed("spikeline",!0).classed("crisp",!0)}et.indexOf("marker")!==-1&&Te.insert("circle",":first-child").attr({cx:fn,cy:Ie-(yt.side!=="top"?ut:-ut),r:ut,fill:Be}).classed("spikeline",!0)}}}function ge(Z,de,pe){if(!pe||pe.length!==Z._hoverdata.length)return!0;for(var Te=pe.length-1;Te>=0;Te--){var Ne=pe[Te],$e=Z._hoverdata[Te];if(Ne.curveNumber!==$e.curveNumber||String(Ne.pointNumber)!==String($e.pointNumber)||String(Ne.pointNumbers)!==String($e.pointNumbers)||Ne.binNumber!==$e.binNumber)return!0}return!1}function _e(Z,de){return!0}function Y(Z,de){return l.plainText(Z||"",{len:de,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function se(Z,de){for(var pe=de.charAt(0),Te=[],Ne=[],$e=[],Ze=0;ZeZ.offsetTop+Z.clientTop,ye=Z=>Z.offsetLeft+Z.clientLeft;function le(Z,de){var pe=Z._fullLayout,Te=de.getBoundingClientRect(),Ne=Te.left,$e=Te.top,Ze=Ne+Te.width,Xe=$e+Te.height,it=M.apply3DTransform(pe._invTransform)(Ne,$e),yt=M.apply3DTransform(pe._invTransform)(Ze,Xe),bt=it[0],mt=it[1],ht=yt[0],Ve=yt[1];return{x:bt,y:mt,width:ht-bt,height:Ve-mt,top:Math.min(mt,Ve),left:Math.min(bt,ht),right:Math.max(bt,ht),bottom:Math.max(mt,Ve)}}}}),Q2=Re({"src/components/fx/hoverlabel_defaults.js"(ae,K){var v=Rn(),S=ko(),M=Xp().isUnifiedHover;K.exports=function(t,r,a,l){l=l||{};var i=r.legend;function s(o){l.font[o]||(l.font[o]=i?r.legend.font[o]:r.font[o])}r&&M(r.hovermode)&&(l.font||(l.font={}),s("size"),s("family"),s("color"),s("weight"),s("style"),s("variant"),i?(l.bgcolor||(l.bgcolor=S.combine(r.legend.bgcolor,r.paper_bgcolor)),l.bordercolor||(l.bordercolor=r.legend.bordercolor)):l.bgcolor||(l.bgcolor=r.paper_bgcolor)),a("hoverlabel.bgcolor",l.bgcolor),a("hoverlabel.bordercolor",l.bordercolor),a("hoverlabel.namelength",l.namelength),a("hoverlabel.showarrow",l.showarrow),v.coerceFont(a,"hoverlabel.font",l.font),a("hoverlabel.align",l.align)}}}),ND=Re({"src/components/fx/layout_global_defaults.js"(ae,K){var v=Rn(),S=Q2(),M=Ps();K.exports=function(t,r){function a(l,i){return v.coerce(t,r,M,l,i)}S(t,r,a)}}}),OD=Re({"src/components/fx/defaults.js"(ae,K){var v=Rn(),S=ou(),M=Q2();K.exports=function(t,r,a,l){function i(o,c){return v.coerce(t,r,S,o,c)}var s=v.extendFlat({},l.hoverlabel);r.hovertemplate&&(s.namelength=-1),M(t,r,i,s)}}}),Wk=Re({"src/components/fx/hovermode_defaults.js"(ae,K){var v=Rn(),S=Ps();K.exports=function(L,t){function r(a,l){return t[a]!==void 0?t[a]:v.coerce(L,t,S,a,l)}return r("clickmode"),r("hoversubplots"),r("hovermode")}}}),FD=Re({"src/components/fx/layout_defaults.js"(ae,K){var v=Rn(),S=Ps(),M=Wk(),L=Q2();K.exports=function(r,a){function l(y,g){return v.coerce(r,a,S,y,g)}var i=M(r,a);i&&(l("hoverdistance"),l("spikedistance"));var s=l("dragmode");s==="select"&&l("selectdirection");var o=a._has("mapbox"),c=a._has("map"),p=a._has("geo"),d=a._basePlotModules.length;a.dragmode==="zoom"&&((o||c||p)&&d===1||(o||c)&&p&&d===2)&&(a.dragmode="pan"),L(r,a,l),v.coerceFont(l,"hoverlabel.grouptitlefont",a.hoverlabel.font)}}}),dS=Re({"src/components/fx/calc.js"(ae,K){var v=Rn(),S=es();K.exports=function(t){var r=t.calcdata,a=t._fullLayout;function l(p){return function(d){return v.coerceHoverinfo({hoverinfo:d},{_module:p._module},a)}}for(var i=0;i"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),t3=Re({"src/components/shapes/draw_newshape/constants.js"(ae,K){var v=32;K.exports={CIRCLE_SIDES:v,i000:0,i090:v/4,i180:v/2,i270:v/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),r3=Re({"src/components/selections/helpers.js"(ae,K){var v=Rn().strTranslate;function S(r,a){switch(r.type){case"log":return r.p2d(a);case"date":return r.p2r(a,0,r.calendar);default:return r.p2r(a)}}function M(r,a){switch(r.type){case"log":return r.d2p(a);case"date":return r.r2p(a,0,r.calendar);default:return r.r2p(a)}}function L(r){var a=r._id.charAt(0)==="y"?1:0;return function(l){return S(r,l[a])}}function t(r){return v(r.xaxis._offset,r.yaxis._offset)}K.exports={p2r:S,r2p:M,axValue:L,getTransform:t}}}),qm=Re({"src/components/shapes/draw_newshape/helpers.js"(ae){var K=py(),v=t3(),S=v.CIRCLE_SIDES,M=v.SQRT2,L=r3(),t=L.p2r,r=L.r2p,a=[0,3,4,5,6,1,2],l=[0,3,4,1,2];ae.writePaths=function(o){var c=o.length;if(!c)return"M0,0Z";for(var p="",d=0;d0&&xf&&(A="X"),A});return d>f&&(x=x.replace(/[\s,]*X.*/,""),v.log("Ignoring extra params in segment "+p)),y+x})}function L(t,r){r=r||0;var a=0;return r&&t&&(t.type==="category"||t.type==="multicategory")&&(a=(t.r2p(1)-t.r2p(0))*r),a}}}),vS=Re({"src/components/shapes/display_labels.js"(ae,K){var v=Rn(),S=js(),M=kc(),L=qs(),t=qm().readPaths,r=gy(),a=r.getPathString,l=cv(),i=qd().FROM_TL;K.exports=function(p,d,y,g){if(g.selectAll(".shape-label").remove(),!!(y.label.text||y.label.texttemplate)){var C;if(y.label.texttemplate){var f={};if(y.type!=="path"){var x=S.getFromId(p,y.xref),A=S.getFromId(p,y.yref);for(var k in l){var I=l[k](y,x,A);I!==void 0&&(f[k]=I)}}C=v.texttemplateStringForShapes({data:[f],fallback:y.label.texttemplatefallback,locale:p._fullLayout._d3locale,template:y.label.texttemplate})}else C=y.label.text;var T={"data-index":d},E=y.label.font,_={"data-notex":1},h=g.append("g").attr(T).classed("shape-label",!0),m=h.append("text").attr(_).classed("shape-label-text",!0).text(C),w,F,z,U;if(y.path){var V=a(p,y),G=t(V,p);w=1/0,z=1/0,F=-1/0,U=-1/0;for(var j=0;j=c?g=p-y:g=y-p,-180/Math.PI*Math.atan2(g,C)}function o(c,p,d,y,g,C,f){var x=g.label.textposition,A=g.label.textangle,k=g.label.padding,I=g.type,T=Math.PI/180*C,E=Math.sin(T),_=Math.cos(T),h=g.label.xanchor,m=g.label.yanchor,w,F,z,U;if(I==="line"){x==="start"?(w=c,F=p):x==="end"?(w=d,F=y):(w=(c+d)/2,F=(p+y)/2),h==="auto"&&(x==="start"?A==="auto"?d>c?h="left":dc?h="right":dc?h="right":dc?h="left":d1&&!(mt.length===2&&mt[1][0]==="Z")&&(Y===0&&(mt[0][0]="M"),w[_e]=mt,G(),j())}}function Te(mt,ht){if(mt===2){_e=+ht.srcElement.getAttribute("data-i"),Y=+ht.srcElement.getAttribute("data-j");var Ve=w[_e];!C(Ve)&&!f(Ve)&&pe()}}function Ne(mt){xe=[];for(var ht=0;htG&&at>j&&!Ie.shiftKey?c.getCursor(ct/Fe,1-Gt/at):"move";p(w,Vt),Qt=Vt.split("-")[0]}}function Br(Ie){f(m)||(O&&(se=Se(F.xanchor)),H&&(ce=Je(F.yanchor)),F.type==="path"?$e=F.path:(xe=O?F.x0:Se(F.x0),ge=H?F.y0:Je(F.y0),_e=O?F.x1:Se(F.x1),Y=H?F.y1:Je(F.y1)),xe<_e?(le=xe,Te="x0",Z=_e,Ne="x1"):(le=_e,Te="x1",Z=xe,Ne="x0"),!H&&geY?(ne=ge,de="y0",ye=Y,pe="y1"):(ne=Y,de="y1",ye=ge,pe="y0"),Ur(Ie),et(U,F),Be(w,F,m),Kt.moveFn=Qt==="move"?Qr:Bt,Kt.altKey=Ie.altKey)}function fn(){f(m)||(p(w),ut(U),k(w,m,F),S.call("_guiRelayout",m,V.getUpdateObj()))}function Fr(){f(m)||ut(U)}function Qr(Ie,ke){if(F.type==="path"){var Fe=function(Gt){return Gt},at=Fe,ct=Fe;O?ue("xanchor",F.xanchor=_t(se+Ie)):(at=function(Vt){return _t(Se(Vt)+Ie)},Xe&&Xe.type==="date"&&(at=y.encodeDate(at))),H?ue("yanchor",F.yanchor=At(ce+ke)):(ct=function(Vt){return At(Je(Vt)+ke)},yt&&yt.type==="date"&&(ct=y.encodeDate(ct))),ue("path",F.path=T($e,at,ct))}else O?ue("xanchor",F.xanchor=_t(se+Ie)):(ue("x0",F.x0=_t(xe+Ie)),ue("x1",F.x1=_t(_e+Ie))),H?ue("yanchor",F.yanchor=At(ce+ke)):(ue("y0",F.y0=At(ge+ke)),ue("y1",F.y1=At(Y+ke)));w.attr("d",g(m,F)),et(U,F),a(m,z,F,Ze)}function Bt(Ie,ke){if(ee){var Fe=function(ra){return ra},at=Fe,ct=Fe;O?ue("xanchor",F.xanchor=_t(se+Ie)):(at=function(Ha){return _t(Se(Ha)+Ie)},Xe&&Xe.type==="date"&&(at=y.encodeDate(at))),H?ue("yanchor",F.yanchor=At(ce+ke)):(ct=function(Ha){return At(Je(Ha)+ke)},yt&&yt.type==="date"&&(ct=y.encodeDate(ct))),ue("path",F.path=T($e,at,ct))}else if(W){if(Qt==="resize-over-start-point"){var Gt=xe+Ie,Vt=H?ge-ke:ge+ke;ue("x0",F.x0=O?Gt:_t(Gt)),ue("y0",F.y0=H?Vt:At(Vt))}else if(Qt==="resize-over-end-point"){var Zt=_e+Ie,ur=H?Y-ke:Y+ke;ue("x1",F.x1=O?Zt:_t(Zt)),ue("y1",F.y1=H?ur:At(ur))}}else{var Dr=function(ra){return Qt.indexOf(ra)!==-1},kr=Dr("n"),Sr=Dr("s"),Jr=Dr("w"),jn=Dr("e"),ha=kr?ne+ke:ne,oa=Sr?ye+ke:ye,_a=Jr?le+Ie:le,xa=jn?Z+Ie:Z;H&&(kr&&(ha=ne-ke),Sr&&(oa=ye-ke)),(!H&&oa-ha>j||H&&ha-oa>j)&&(ue(de,F[de]=H?ha:At(ha)),ue(pe,F[pe]=H?oa:At(oa))),xa-_a>G&&(ue(Te,F[Te]=O?_a:_t(_a)),ue(Ne,F[Ne]=O?xa:_t(xa)))}w.attr("d",g(m,F)),et(U,F),a(m,z,F,Ze)}function et(Ie,ke){(O||H)&&Fe();function Fe(){var at=ke.type!=="path",ct=Ie.selectAll(".visual-cue").data([0]),Gt=1;ct.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":Gt}).classed("visual-cue",!0);var Vt=Se(O?ke.xanchor:M.midRange(at?[ke.x0,ke.x1]:y.extractPathCoords(ke.path,d.paramIsX))),Zt=Je(H?ke.yanchor:M.midRange(at?[ke.y0,ke.y1]:y.extractPathCoords(ke.path,d.paramIsY)));if(Vt=y.roundPositionForSharpStrokeRendering(Vt,Gt),Zt=y.roundPositionForSharpStrokeRendering(Zt,Gt),O&&H){var ur="M"+(Vt-1-Gt)+","+(Zt-1-Gt)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";ct.attr("d",ur)}else if(O){var Dr="M"+(Vt-1-Gt)+","+(Zt-9-Gt)+"v18 h2 v-18 Z";ct.attr("d",Dr)}else{var kr="M"+(Vt-9-Gt)+","+(Zt-1-Gt)+"h18 v2 h-18 Z";ct.attr("d",kr)}}}function ut(Ie){Ie.selectAll(".visual-cue").remove()}function Be(Ie,ke,Fe){var at=ke.xref,ct=ke.yref,Gt=L.getFromId(Fe,at),Vt=L.getFromId(Fe,ct),Zt="";at!=="paper"&&!Gt.autorange&&(Zt+=at),ct!=="paper"&&!Vt.autorange&&(Zt+=ct),s.setClipUrl(Ie,Zt?"clip"+Fe._fullLayout._uid+Zt:null,Fe)}}function T(m,w,F){return m.replace(d.segmentRE,function(z){var U=0,V=z.charAt(0),G=d.paramIsX[V],j=d.paramIsY[V],O=d.numParams[V],H=z.slice(1).replace(d.paramRE,function(W){return U>=O||(G[U]?W=w(W):j[U]&&(W=F(W)),U++),W});return V+H})}function E(m,w){if(x(m)){var F=w.node(),z=+F.getAttribute("data-index");if(z>=0){if(z===m._fullLayout._activeShapeIndex){_(m);return}m._fullLayout._activeShapeIndex=z,m._fullLayout._deactivateShape=_,C(m)}}}function _(m){if(x(m)){var w=m._fullLayout._activeShapeIndex;w>=0&&(l(m),delete m._fullLayout._activeShapeIndex,C(m))}}function h(m){if(x(m)){l(m);var w=m._fullLayout._activeShapeIndex,F=(m.layout||{}).shapes||[];if(w1?(ge=["toggleHover"],_e=["resetViews"]):h?(xe=["zoomInGeo","zoomOutGeo"],ge=["hoverClosestGeo"],_e=["resetGeo"]):_?(ge=["hoverClosest3d"],_e=["resetCameraDefault3d","resetCameraLastSave3d"]):z?(xe=["zoomInMapbox","zoomOutMapbox"],ge=["toggleHover"],_e=["resetViewMapbox"]):U?(xe=["zoomInMap","zoomOutMap"],ge=["toggleHover"],_e=["resetViewMap"]):m?ge=["hoverClosestPie"]:j?(ge=["hoverClosestCartesian","hoverCompareCartesian"],_e=["resetViewSankey"]):ge=["toggleHover"],E&&ge.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(c(C)||H)&&(ge=[]),E&&!O&&(xe=["zoomIn2d","zoomOut2d","autoScale2d"],_e[0]!=="resetViews"&&(_e=["resetScale2d"])),_?Y=["zoom3d","pan3d","orbitRotation","tableRotation"]:E&&!O||F?Y=["zoom2d","pan2d"]:z||U||h?Y=["pan2d"]:V&&(Y=["zoom2d"]),o(C)&&Y.push("select2d","lasso2d");var se=[],ce=function(Z){se.indexOf(Z)===-1&&ge.indexOf(Z)!==-1&&se.push(Z)};if(Array.isArray(I)){for(var ne=[],ye=0;yeA?C.slice(A):f.slice(x))+k}function p(y,g){for(var C=g._size,f=C.h/C.w,x={},A=Object.keys(y),k=0;kr*F&&!G)){for(A=0;AY&&pege&&(ge=pe);var Ne=(ge-xe)/(2*_e);h/=Ne,xe=T.l2r(xe),ge=T.l2r(ge),T.range=T._input.range=W=j[1]||ee[1]<=j[0])&&ue[0]O[0])return!0}return!1}function k(j){var O=j._fullLayout,H=O._size,W=H.p,ee=s.list(j,"",!0),ue,xe,ge,_e,Y,se;if(O._paperdiv.style({width:j._context.responsive&&O.autosize&&!j._context._hasZeroWidth&&!j.layout.width?"100%":O.width+"px",height:j._context.responsive&&O.autosize&&!j._context._hasZeroHeight&&!j.layout.height?"100%":O.height+"px"}).selectAll(".main-svg").call(a.setSize,O.width,O.height),j._context.setBackground(j,O.paper_bgcolor),ae.drawMainTitle(j),i.manage(j),!O._has("cartesian"))return S.previousPromises(j);function ce(Be,Ie,ke){var Fe=Be._lw/2;if(Be._id.charAt(0)==="x"){if(Ie){if(ke==="top")return Ie._offset-W-Fe}else return H.t+H.h*(1-(Be.position||0))+Fe%1;return Ie._offset+Ie._length+W+Fe}if(Ie){if(ke==="right")return Ie._offset+Ie._length+W+Fe}else return H.l+H.w*(Be.position||0)+Fe%1;return Ie._offset-W-Fe}for(ue=0;ue0){w(j,ue,Y,_e),ge.attr({x:xe,y:ue,"text-anchor":W,dy:U(O.yanchor)}).call(L.positionText,xe,ue);var se=(O.text.match(L.BR_TAG_ALL)||[]).length;if(se){var ce=o.LINE_SPACING*se+o.MID_SHIFT;O.y===0&&(ce=-ce),ge.selectAll(".line").each(function(){var de=+this.getAttribute("dy").slice(0,-2)-ce+"em";this.setAttribute("dy",de)})}var ne=K.select(j).selectAll(".gtitle-subtitle");if(ne.node()){var ye=ge.node().getBBox(),le=ye.y+ye.height,Z=le+l.SUBTITLE_PADDING_EM*O.subtitle.font.size;ne.attr({x:xe,y:Z,"text-anchor":W,dy:U(O.yanchor)}).call(L.positionText,xe,Z)}}}};function _(j,O,H,W,ee){var ue=O.yref==="paper"?j._fullLayout._size.h:j._fullLayout.height,xe=M.isTopAnchor(O)?W:W-ee,ge=H==="b"?ue-xe:xe;return M.isTopAnchor(O)&&H==="t"||M.isBottomAnchor(O)&&H==="b"?!1:ge.5?"t":"b",xe=j._fullLayout.margin[ue],ge=0;return O.yref==="paper"?ge=H+O.pad.t+O.pad.b:O.yref==="container"&&(ge=h(ue,W,ee,j._fullLayout.height,H)+O.pad.t+O.pad.b),ge>xe?ge:0}function w(j,O,H,W){var ee="title.automargin",ue=j._fullLayout.title,xe=ue.y>.5?"t":"b",ge={x:ue.x,y:ue.y,t:0,b:0},_e={};ue.yref==="paper"&&_(j,ue,xe,O,W)?ge[xe]=H:ue.yref==="container"&&(_e[xe]=H,j._fullLayout._reservedMargin[ee]=_e),S.allowAutoMargin(j,ee),S.autoMargin(j,ee,ge)}function F(j,O){var H=j.title,W=j._size,ee=0;return O===g?ee=H.pad.l:O===f&&(ee=-H.pad.r),H.xref==="paper"?W.l+W.w*H.x+ee:j.width*H.x+ee}function z(j,O){var H=j.title,W=j._size,ee=0;return O==="0em"||!O?ee=-H.pad.b:O===o.CAP_SHIFT+"em"&&(ee=H.pad.t),H.y==="auto"?W.t/2:H.yref==="paper"?W.t+W.h-W.h*H.y+ee:j.height-j.height*H.y+ee}function U(j){return j==="top"?o.CAP_SHIFT+.3+"em":j==="bottom"?"-0.3em":o.MID_SHIFT+"em"}function V(j){var O=j.title,H=C;return M.isRightAnchor(O)?H=f:M.isLeftAnchor(O)&&(H=g),H}function G(j){var O=j.title,H="0em";return M.isTopAnchor(O)?H=o.CAP_SHIFT+"em":M.isMiddleAnchor(O)&&(H=o.MID_SHIFT+"em"),H}ae.doTraceStyle=function(j){var O=j.calcdata,H=[],W;for(W=0;W=0;V--){var G=I.append("path").attr(E).style("opacity",V?.1:_).call(L.stroke,m).call(L.fill,h).call(t.dashLine,V?"solid":F,V?4+w:w);if(c(G,g,x),z){var j=r(g.layout,"selections",x);G.style({cursor:"move"});var O={element:G.node(),plotinfo:A,gd:g,editHelpers:j,isActiveSelection:!0},H=v(T,g);S(H,G,O)}else G.style("pointer-events",V?"all":"none");U[V]=G}var W=U[0],ee=U[1];ee.node().addEventListener("click",function(){return p(g,W)})}}function c(g,C,f){var x=f.xref+f.yref;t.setClipUrl(g,"clip"+C._fullLayout._uid+x,C)}function p(g,C){if(s(g)){var f=C.node(),x=+f.getAttribute("data-index");if(x>=0){if(x===g._fullLayout._activeSelectionIndex){y(g);return}g._fullLayout._activeSelectionIndex=x,g._fullLayout._deactivateSelection=y,i(g)}}}function d(g){if(s(g)){var C=g._fullLayout.selections.length-1;g._fullLayout._activeSelectionIndex=C,g._fullLayout._deactivateSelection=y,i(g)}}function y(g){if(s(g)){var C=g._fullLayout._activeSelectionIndex;C>=0&&(M(g),delete g._fullLayout._activeSelectionIndex,i(g))}}}}),BD=Re({"node_modules/polybooljs/lib/build-log.js"(ae,K){function v(){var S,M=0,L=!1;function t(r,a){return S.list.push({type:r,data:a?JSON.parse(JSON.stringify(a)):void 0}),S}return S={list:[],segmentId:function(){return M++},checkIntersection:function(r,a){return t("check",{seg1:r,seg2:a})},segmentChop:function(r,a){return t("div_seg",{seg:r,pt:a}),t("chop",{seg:r,pt:a})},statusRemove:function(r){return t("pop_seg",{seg:r})},segmentUpdate:function(r){return t("seg_update",{seg:r})},segmentNew:function(r,a){return t("new_seg",{seg:r,primary:a})},segmentRemove:function(r){return t("rem_seg",{seg:r})},tempStatus:function(r,a,l){return t("temp_status",{seg:r,above:a,below:l})},rewind:function(r){return t("rewind",{seg:r})},status:function(r,a,l){return t("status",{seg:r,above:a,below:l})},vert:function(r){return r===L?S:(L=r,t("vert",{x:r}))},log:function(r){return typeof r!="string"&&(r=JSON.stringify(r,!1," ")),t("log",{txt:r})},reset:function(){return t("reset")},selected:function(r){return t("selected",{segs:r})},chainStart:function(r){return t("chain_start",{seg:r})},chainRemoveHead:function(r,a){return t("chain_rem_head",{index:r,pt:a})},chainRemoveTail:function(r,a){return t("chain_rem_tail",{index:r,pt:a})},chainNew:function(r,a){return t("chain_new",{pt1:r,pt2:a})},chainMatch:function(r){return t("chain_match",{index:r})},chainClose:function(r){return t("chain_close",{index:r})},chainAddHead:function(r,a){return t("chain_add_head",{index:r,pt:a})},chainAddTail:function(r,a){return t("chain_add_tail",{index:r,pt:a})},chainConnect:function(r,a){return t("chain_con",{index1:r,index2:a})},chainReverse:function(r){return t("chain_rev",{index:r})},chainJoin:function(r,a){return t("chain_join",{index1:r,index2:a})},done:function(){return t("done")}},S}K.exports=v}}),UD=Re({"node_modules/polybooljs/lib/epsilon.js"(ae,K){function v(S){typeof S!="number"&&(S=1e-10);var M={epsilon:function(L){return typeof L=="number"&&(S=L),S},pointAboveOrOnLine:function(L,t,r){var a=t[0],l=t[1],i=r[0],s=r[1],o=L[0],c=L[1];return(i-a)*(c-l)-(s-l)*(o-a)>=-S},pointBetween:function(L,t,r){var a=L[1]-t[1],l=r[0]-t[0],i=L[0]-t[0],s=r[1]-t[1],o=i*l+a*s;if(o-S)},pointsSameX:function(L,t){return Math.abs(L[0]-t[0])S!=i-a>S&&(l-c)*(a-p)/(i-p)+c-r>S&&(s=!s),l=c,i=p}return s}};return M}K.exports=v}}),$D=Re({"node_modules/polybooljs/lib/linked-list.js"(ae,K){var v={create:function(){var S={root:{root:!0,next:null},exists:function(M){return!(M===null||M===S.root)},isEmpty:function(){return S.root.next===null},getHead:function(){return S.root.next},insertBefore:function(M,L){for(var t=S.root,r=S.root.next;r!==null;){if(L(r)){M.prev=r.prev,M.next=r,r.prev.next=M,r.prev=M;return}t=r,r=r.next}t.next=M,M.prev=t,M.next=null},findTransition:function(M){for(var L=S.root,t=S.root.next;t!==null&&!M(t);)L=t,t=t.next;return{before:L===S.root?null:L,after:t,insert:function(r){return r.prev=L,r.next=t,L.next=r,t!==null&&(t.prev=r),r}}}};return S},node:function(S){return S.prev=null,S.next=null,S.remove=function(){S.prev.next=S.next,S.next&&(S.next.prev=S.prev),S.prev=null,S.next=null},S}};K.exports=v}}),wm=Re({"node_modules/polybooljs/lib/intersecter.js"(ae,K){var v=$D();function S(M,L,t){function r(C,f){return{id:t?t.segmentId():-1,start:C,end:f,myFill:{above:null,below:null},otherFill:null}}function a(C,f,x){return{id:t?t.segmentId():-1,start:C,end:f,myFill:{above:x.myFill.above,below:x.myFill.below},otherFill:null}}var l=v.create();function i(C,f,x,A,k,I){var T=L.pointsCompare(f,k);return T!==0?T:L.pointsSame(x,I)?0:C!==A?C?1:-1:L.pointAboveOrOnLine(x,A?k:I,A?I:k)?1:-1}function s(C,f){l.insertBefore(C,function(x){var A=i(C.isStart,C.pt,f,x.isStart,x.pt,x.other.pt);return A<0})}function o(C,f){var x=v.node({isStart:!0,pt:C.start,seg:C,primary:f,other:null,status:null});return s(x,C.end),x}function c(C,f,x){var A=v.node({isStart:!1,pt:f.end,seg:f,primary:x,other:C,status:null});C.other=A,s(A,C.pt)}function p(C,f){var x=o(C,f);return c(x,C,f),x}function d(C,f){t&&t.segmentChop(C.seg,f),C.other.remove(),C.seg.end=f,C.other.pt=f,s(C.other,C.pt)}function y(C,f){var x=a(f,C.seg.end,C.seg);return d(C,f),p(x,C.primary)}function g(C,f){var x=v.create();function A(G,j){var O=G.seg.start,H=G.seg.end,W=j.seg.start,ee=j.seg.end;return L.pointsCollinear(O,W,ee)?L.pointsCollinear(H,W,ee)||L.pointAboveOrOnLine(H,W,ee)?1:-1:L.pointAboveOrOnLine(O,W,ee)?1:-1}function k(G){return x.findTransition(function(j){var O=A(G,j.ev);return O>0})}function I(G,j){var O=G.seg,H=j.seg,W=O.start,ee=O.end,ue=H.start,xe=H.end;t&&t.checkIntersection(O,H);var ge=L.linesIntersect(W,ee,ue,xe);if(ge===!1){if(!L.pointsCollinear(W,ee,ue)||L.pointsSame(W,xe)||L.pointsSame(ee,ue))return!1;var _e=L.pointsSame(W,ue),Y=L.pointsSame(ee,xe);if(_e&&Y)return j;var se=!_e&&L.pointBetween(W,ue,xe),ce=!Y&&L.pointBetween(ee,ue,xe);if(_e)return ce?y(j,ee):y(G,xe),j;se&&(Y||(ce?y(j,ee):y(G,xe)),y(j,W))}else ge.alongA===0&&(ge.alongB===-1?y(G,ue):ge.alongB===0?y(G,ge.pt):ge.alongB===1&&y(G,xe)),ge.alongB===0&&(ge.alongA===-1?y(j,W):ge.alongA===0?y(j,ge.pt):ge.alongA===1&&y(j,ee));return!1}for(var T=[];!l.isEmpty();){var E=l.getHead();if(t&&t.vert(E.pt[0]),E.isStart){let G=function(){if(h){var j=I(E,h);if(j)return j}return m?I(E,m):!1};t&&t.segmentNew(E.seg,E.primary);var _=k(E),h=_.before?_.before.ev:null,m=_.after?_.after.ev:null;t&&t.tempStatus(E.seg,h?h.seg:!1,m?m.seg:!1);var w=G();if(w){if(M){var F;E.seg.myFill.below===null?F=!0:F=E.seg.myFill.above!==E.seg.myFill.below,F&&(w.seg.myFill.above=!w.seg.myFill.above)}else w.seg.otherFill=E.seg.myFill;t&&t.segmentUpdate(w.seg),E.other.remove(),E.remove()}if(l.getHead()!==E){t&&t.rewind(E.seg);continue}if(M){var F;E.seg.myFill.below===null?F=!0:F=E.seg.myFill.above!==E.seg.myFill.below,m?E.seg.myFill.below=m.seg.myFill.above:E.seg.myFill.below=C,F?E.seg.myFill.above=!E.seg.myFill.below:E.seg.myFill.above=E.seg.myFill.below}else if(E.seg.otherFill===null){var z;m?E.primary===m.primary?z=m.seg.otherFill.above:z=m.seg.myFill.above:z=E.primary?f:C,E.seg.otherFill={above:z,below:z}}t&&t.status(E.seg,h?h.seg:!1,m?m.seg:!1),E.other.status=_.insert(v.node({ev:E}))}else{var U=E.status;if(U===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(x.exists(U.prev)&&x.exists(U.next)&&I(U.prev.ev,U.next.ev),t&&t.statusRemove(U.ev.seg),U.remove(),!E.primary){var V=E.seg.myFill;E.seg.myFill=E.seg.otherFill,E.seg.otherFill=V}T.push(E.seg)}l.getHead().remove()}return t&&t.done(),T}return M?{addRegion:function(C){for(var f,x=C[C.length-1],A=0;Aa!=y>a&&r<(d-c)*(a-p)/(y-p)+c;g&&(l=!l)}return l}}}),F_=Re({"src/lib/polygon.js"(ae,K){var v=H2().dot,S=Ia().BADNUM,M=K.exports={};M.tester=function(t){var r=t.slice(),a=r[0][0],l=a,i=r[0][1],s=i,o;for((r[r.length-1][0]!==r[0][0]||r[r.length-1][1]!==r[0][1])&&r.push(r[0]),o=1;ol||k===S||ks||x&&p(f))}function y(f,x){var A=f[0],k=f[1];if(A===S||Al||k===S||ks)return!1;var I=r.length,T=r[0][0],E=r[0][1],_=0,h,m,w,F,z;for(h=1;hMath.max(m,T)||k>Math.max(w,E)))if(ko||Math.abs(v(y,p))>l)return!0;return!1},M.filter=function(t,r){var a=[t[0]],l=0,i=0;function s(c){t.push(c);var p=a.length,d=l;a.splice(i+1);for(var y=d+1;y1){var o=t.pop();s(o)}return{addPt:s,raw:t,filtered:a}}}}),VD=Re({"src/components/selections/constants.js"(ae,K){K.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),B_=Re({"src/components/selections/select.js"(ae,K){var v=eM(),S=tM(),M=es(),L=qs().dashStyle,t=ko(),r=Sh(),a=Xp().makeEventData,l=gg(),i=l.freeMode,s=l.rectMode,o=l.drawMode,c=l.openMode,p=l.selectMode,d=gy(),y=n3(),g=A1(),C=hy().clearOutline,f=qm(),x=f.handleEllipse,A=f.readPaths,k=pS().newShapes,I=Xk(),T=Kk().activateLastSelection,E=Rn(),_=E.sorterAsc,h=F_(),m=k0(),w=fh().getFromId,F=Pb(),z=a3().redrawReglTraces,U=VD(),V=U.MINSELECT,G=h.filter,j=h.tester,O=r3(),H=O.p2r,W=O.axValue,ee=O.getTransform;function ue(et){return et.subplot!==void 0}function xe(et,ut,Be,Ie,ke){var Fe=!ue(Ie),at=i(ke),ct=s(ke),Gt=c(ke),Vt=o(ke),Zt=p(ke),ur=ke==="drawline",Dr=ke==="drawcircle",kr=ur||Dr,Sr=Ie.gd,Jr=Sr._fullLayout,jn=Zt&&Jr.newselection.mode==="immediate"&&Fe,ha=Jr._zoomlayer,oa=Ie.element.getBoundingClientRect(),_a=Ie.plotinfo,xa=ee(_a),ra=ut-oa.left,Ha=Be-oa.top;Jr._calcInverseTransform(Sr);var ci=E.apply3DTransform(Jr._invTransform)(ra,Ha);ra=ci[0],Ha=ci[1];var _r=Jr._invScaleX,rr=Jr._invScaleY,yr=ra,br=Ha,an="M"+ra+","+Ha,bn=Ie.xaxes[0],In=Ie.yaxes[0],Fn=bn._length,va=In._length,Pa=et.altKey&&!(o(ke)&&Gt),La,Oa,Wa,sa,ji,Qi,Xt;ne(et,Sr,Ie),at&&(La=G([[ra,Ha]],U.BENDPX));var Lt=ha.selectAll("path.select-outline-"+_a.id).data([1]),$r=Vt?Jr.newshape:Jr.newselection;Vt&&(Ie.hasText=$r.label.text||$r.label.texttemplate);var en=Vt&&!Gt?$r.fillcolor:"rgba(0,0,0,0)",rn=$r.line.color||(Fe?t.contrast(Sr._fullLayout.plot_bgcolor):"#7f7f7f");Lt.enter().append("path").attr("class","select-outline select-outline-"+_a.id).style({opacity:Vt?$r.opacity/2:1,"stroke-dasharray":L($r.line.dash,$r.line.width),"stroke-width":$r.line.width+"px","shape-rendering":"crispEdges"}).call(t.stroke,rn).call(t.fill,en).attr("fill-rule","evenodd").classed("cursor-move",!!Vt).attr("transform",xa).attr("d",an+"Z");var Wr=ha.append("path").attr("class","zoombox-corners").style({fill:t.background,stroke:t.defaultLine,"stroke-width":1}).attr("transform",xa).attr("d","M0,0Z");if(Vt&&Ie.hasText){var tn=ha.select(".label-temp");tn.empty()&&(tn=ha.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var wn=Jr._uid+U.SELECTID,dn=[],Nt=pe(Sr,Ie.xaxes,Ie.yaxes,Ie.subplot);jn&&!et.shiftKey&&(Ie._clearSubplotSelections=function(){if(Fe){var Xr=bn._id,Tn=In._id;At(Sr,Xr,Tn,Nt);for(var Xn=(Sr.layout||{}).selections||[],ia=[],na=!1,An=0;An=0){Sr._fullLayout._deactivateShape(Sr);return}if(!Vt){var Xn=Jr.clickmode;m.done(wn).then(function(){if(m.clear(wn),Xr===2){for(Lt.remove(),ji=0;ji-1&&ge(Tn,Sr,Ie.xaxes,Ie.yaxes,Ie.subplot,Ie,Lt),Xn==="event"&&Qr(Sr,void 0);r.click(Sr,Tn,_a.id)}).catch(E.error)}},Ie.doneFn=function(){Wr.remove(),m.done(wn).then(function(){m.clear(wn),!jn&&sa&&Ie.selectionDefs&&(sa.subtract=Pa,Ie.selectionDefs.push(sa),Ie.mergedPolygons.length=0,[].push.apply(Ie.mergedPolygons,Wa)),(jn||Vt)&&Z(Ie,jn),Ie.doneFnCompleted&&Ie.doneFnCompleted(dn),Zt&&Qr(Sr,Xt)}).catch(E.error)}}function ge(et,ut,Be,Ie,ke,Fe,at){var ct=ut._hoverdata,Gt=ut._fullLayout,Vt=Gt.clickmode,Zt=Vt.indexOf("event")>-1,ur=[],Dr,kr,Sr,Jr,jn,ha,oa,_a,xa,ra;if(Ne(ct)){ne(et,ut,Fe),Dr=pe(ut,Be,Ie,ke);var Ha=$e(ct,Dr),ci=Ha.pointNumbers.length>0;if(ci?Xe(Dr,Ha):it(Dr)&&(oa=Ze(Ha))){for(at&&at.remove(),ra=0;ra=0}function le(et){return et._fullLayout._activeSelectionIndex>=0}function Z(et,ut){var Be=et.dragmode,Ie=et.plotinfo,ke=et.gd;ye(ke)&&ke._fullLayout._deactivateShape(ke),le(ke)&&ke._fullLayout._deactivateSelection(ke);var Fe=ke._fullLayout,at=Fe._zoomlayer,ct=o(Be),Gt=p(Be);if(ct||Gt){var Vt=at.selectAll(".select-outline-"+Ie.id);if(Vt&&ke._fullLayout._outlining){var Zt;ct&&(Zt=k(Vt,et)),Zt&&M.call("_guiRelayout",ke,{shapes:Zt});var ur;Gt&&!ue(et)&&(ur=I(Vt,et)),ur&&(ke._fullLayout._noEmitSelectedAtStart=!0,M.call("_guiRelayout",ke,{selections:ur}).then(function(){ut&&T(ke)})),ke._fullLayout._outlining=!1}}Ie.selection={},Ie.selection.selectionDefs=et.selectionDefs=[],Ie.selection.mergedPolygons=et.mergedPolygons=[]}function de(et){return et._id}function pe(et,ut,Be,Ie){if(!et.calcdata)return[];var ke=[],Fe=ut.map(de),at=Be.map(de),ct,Gt,Vt;for(Vt=0;Vt0,Fe=ke?Ie[0]:Be;return ut.selectedpoints?ut.selectedpoints.indexOf(Fe)>-1:!1}function Xe(et,ut){var Be=[],Ie,ke,Fe,at;for(at=0;at0&&Be.push(Ie);if(Be.length===1&&(Fe=Be[0]===ut.searchInfo,Fe&&(ke=ut.searchInfo.cd[0].trace,ke.selectedpoints.length===ut.pointNumbers.length))){for(at=0;at1||(ut+=Ie.selectedpoints.length,ut>1)))return!1;return ut===1}function yt(et,ut,Be){var Ie;for(Ie=0;Ie-1&&ut;if(!at&&ut){var Xr=Kt(et,!0);if(Xr.length){var Tn=Xr[0].xref,Xn=Xr[0].yref;if(Tn&&Xn){var ia=mr(Xr),na=Br([w(et,Tn,"x"),w(et,Xn,"y")]);na(dn,ia)}}et._fullLayout._noEmitSelectedAtStart?et._fullLayout._noEmitSelectedAtStart=!1:xr&&Qr(et,dn),Dr._reselect=!1}if(!at&&Dr._deselect){var An=Dr._deselect;ct=An.xref,Gt=An.yref,_t(ct,Gt,Zt)||At(et,ct,Gt,Ie),xr&&(dn.points.length?Qr(et,dn):Bt(et)),Dr._deselect=!1}return{eventData:dn,selectionTesters:Be}}function Je(et){var ut=et.calcdata;if(ut)for(var Be=0;Be=0){en._fullLayout._deactivateShape(en);return}var rn=en._fullLayout.clickmode;if(se(en),Lt===2&&!Ve&&Oa(),ht)rn.indexOf("select")>-1&&_($r,en,At,vt,Ne.id,Zt),rn.indexOf("event")>-1&&o.click(en,$r,Ne.id);else if(Lt===1&&Ve){var Wr=yt?Se:ze,tn=yt==="s"||bt==="w"?0:1,wn=Wr._name+".range["+tn+"]",dn=O(Wr,tn),Nt="left",xr="middle";if(Wr.fixedrange)return;yt?(xr=yt==="n"?"top":"bottom",Wr.side==="right"&&(Nt="right")):bt==="e"&&(Nt="right"),en._context.showAxisRangeEntryBoxes&&v.select(Vt).call(l.makeEditable,{gd:en,immediate:!0,background:en._fullLayout.paper_bgcolor,text:String(dn),fill:Wr.tickfont?Wr.tickfont.color:"#444",horizontalAlign:Nt,verticalAlign:xr}).on("edit",function(Xr){var Tn=Wr.d2r(Xr);Tn!==void 0&&r.call("_guiRelayout",en,wn,Tn)})}}d.init(Zt);var kr,Sr,Jr,jn,ha,oa,_a,xa,ra,Ha;function ci(Lt,$r,en){var rn=Vt.getBoundingClientRect();kr=$r-rn.left,Sr=en-rn.top,Te._fullLayout._calcInverseTransform(Te);var Wr=S.apply3DTransform(Te._fullLayout._invTransform)(kr,Sr);kr=Wr[0],Sr=Wr[1],Jr={l:kr,r:kr,w:0,t:Sr,b:Sr,h:0},jn=Te._hmpixcount?Te._hmlumcount/Te._hmpixcount:L(Te._fullLayout.plot_bgcolor).getLuminance(),ha="M0,0H"+fr+"V"+mr+"H0V0",oa=!1,_a="xy",Ha=!1,xa=xe(mt,jn,Kt,Qt,ha),ra=ge(mt,Kt,Qt)}function _r(Lt,$r){if(Te._transitioningWithDuration)return!1;var en=Math.max(0,Math.min(fr,Fe*Lt+kr)),rn=Math.max(0,Math.min(mr,at*$r+Sr)),Wr=Math.abs(en-kr),tn=Math.abs(rn-Sr);Jr.l=Math.min(kr,en),Jr.r=Math.max(kr,en),Jr.t=Math.min(Sr,rn),Jr.b=Math.max(Sr,rn);function wn(){_a="",Jr.r=Jr.l,Jr.t=Jr.b,ra.attr("d","M0,0Z")}if(Ur.isSubplotConstrained)Wr>F||tn>F?(_a="xy",Wr/fr>tn/mr?(tn=Wr*mr/fr,Sr>rn?Jr.t=Sr-tn:Jr.b=Sr+tn):(Wr=tn*fr/mr,kr>en?Jr.l=kr-Wr:Jr.r=kr+Wr),ra.attr("d",le(Jr))):wn();else if(Br.isSubplotConstrained)if(Wr>F||tn>F){_a="xy";var dn=Math.min(Jr.l/fr,(mr-Jr.b)/mr),Nt=Math.max(Jr.r/fr,(mr-Jr.t)/mr);Jr.l=dn*fr,Jr.r=Nt*fr,Jr.b=(1-dn)*mr,Jr.t=(1-Nt)*mr,ra.attr("d",le(Jr))}else wn();else!Fr||tn0){var Xr;if(Br.isSubplotConstrained||!fn&&Fr.length===1){for(Xr=0;Xr1&&(wn.maxallowed!==void 0&&Bt===(wn.range[0]1&&(dn.maxallowed!==void 0&&et===(dn.range[0]=0?Math.min(Te,.9):1/(1/Math.max(Te,-.3)+3.222))}function ue(Te,Ne,$e){return Te?Te==="nsew"?$e?"":Ne==="pan"?"move":"crosshair":Te.toLowerCase()+"-resize":"pointer"}function xe(Te,Ne,$e,Ze,Xe){return Te.append("path").attr("class","zoombox").style({fill:Ne>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",a($e,Ze)).attr("d",Xe+"Z")}function ge(Te,Ne,$e){return Te.append("path").attr("class","zoombox-corners").style({fill:i.background,stroke:i.defaultLine,"stroke-width":1,opacity:0}).attr("transform",a(Ne,$e)).attr("d","M0,0Z")}function _e(Te,Ne,$e,Ze,Xe,it){Te.attr("d",Ze+"M"+$e.l+","+$e.t+"v"+$e.h+"h"+$e.w+"v-"+$e.h+"h-"+$e.w+"Z"),Y(Te,Ne,Xe,it)}function Y(Te,Ne,$e,Ze){$e||(Te.transition().style("fill",Ze>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Ne.transition().style("opacity",1).duration(200))}function se(Te){v.select(Te).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function ce(Te){z&&Te.data&&Te._context.showTips&&(S.notifier(S._(Te,"Double-click to zoom back out"),"long"),z=!1)}function ne(Te,Ne){return"M"+(Te.l-.5)+","+(Ne-F-.5)+"h-3v"+(2*F+1)+"h3ZM"+(Te.r+.5)+","+(Ne-F-.5)+"h3v"+(2*F+1)+"h-3Z"}function ye(Te,Ne){return"M"+(Ne-F-.5)+","+(Te.t-.5)+"v-3h"+(2*F+1)+"v3ZM"+(Ne-F-.5)+","+(Te.b+.5)+"v3h"+(2*F+1)+"v-3Z"}function le(Te){var Ne=Math.floor(Math.min(Te.b-Te.t,Te.r-Te.l,F)/2);return"M"+(Te.l-3.5)+","+(Te.t-.5+Ne)+"h3v"+-Ne+"h"+Ne+"v-3h-"+(Ne+3)+"ZM"+(Te.r+3.5)+","+(Te.t-.5+Ne)+"h-3v"+-Ne+"h"+-Ne+"v-3h"+(Ne+3)+"ZM"+(Te.r+3.5)+","+(Te.b+.5-Ne)+"h-3v"+Ne+"h"+-Ne+"v3h"+(Ne+3)+"ZM"+(Te.l-3.5)+","+(Te.b+.5-Ne)+"h3v"+Ne+"h"+Ne+"v3h-"+(Ne+3)+"Z"}function Z(Te,Ne,$e,Ze,Xe){for(var it=!1,yt={},bt={},mt,ht,Ve,ze,Se=(Xe||{}).xaHash,Je=(Xe||{}).yaHash,_t=0;_t1&&S.warn("Full array edits are incompatible with other edits",p);var A=s[""][""];if(r(A))i.set(null);else if(Array.isArray(A))i.set(A);else return S.warn("Unrecognized full array edit value",p,A),!0;return C?!1:(d(f,x),y(l),!0)}var k=Object.keys(s).map(Number).sort(M),I=i.get(),T=I||[],E=c(x,p).get(),_=[],h=-1,m=T.length,w,F,z,U,V,G,j,O;for(w=0;wT.length-(j?0:1)){S.warn("index out of range",p,z);continue}if(G!==void 0)V.length>1&&S.warn("Insertion & removal are incompatible with edits to the same index.",p,z),r(G)?_.push(z):j?(G==="add"&&(G={}),T.splice(z,0,G),E&&E.splice(z,0,{})):S.warn("Unrecognized full object edit value",p,z,G),h===-1&&(h=z);else for(F=0;F=0;w--)T.splice(_[w],1),E&&E.splice(_[w],1);if(T.length?I||i.set(T):i.set(null),C)return!1;if(d(f,x),g!==v){var H;if(h===-1)H=k;else{for(m=Math.max(T.length,m),H=[],w=0;w=h));w++)H.push(z);for(w=h;w0&&S.log("Clearing previous rejected promises from queue."),f._promises=[]},ae.cleanLayout=function(f){var x;f||(f={}),f.xaxis1&&(f.xaxis||(f.xaxis=f.xaxis1),delete f.xaxis1),f.yaxis1&&(f.yaxis||(f.yaxis=f.yaxis1),delete f.yaxis1),f.scene1&&(f.scene||(f.scene=f.scene1),delete f.scene1);var A=(M.subplotsRegistry.cartesian||{}).attrRegex;(M.subplotsRegistry.polar||{}).attrRegex,(M.subplotsRegistry.ternary||{}).attrRegex,(M.subplotsRegistry.gl3d||{}).attrRegex;var k=Object.keys(f);for(x=0;x3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),f.dragmode==="rotate"&&(f.dragmode="orbit"),t.clean(f),f.template&&f.template.layout&&ae.cleanLayout(f.template.layout),f};function s(f,x){var A=f[x],k=x.charAt(0);A&&A!=="paper"&&(f[x]=r(A,k,!0))}ae.cleanData=function(f){for(var x=0;x0)return f.slice(0,x)}ae.hasParent=function(f,x){for(var A=g(x);A;){if(A in f)return!0;A=g(A)}return!1},ae.clearAxisTypes=function(f,x,A){for(var k=0;k{const A=(...k)=>k.every(I=>S.isPlainObject(I))||k.every(I=>Array.isArray(I));if([f,x].every(k=>Array.isArray(k))){if(f.length!==x.length)return!1;for(let k=0;kS.isPlainObject(k))){if(Object.keys(f).length!==Object.keys(x).length)return!1;for(const k in f){if(k.startsWith("_"))continue;const I=f[k],T=x[k];if(I!==T&&!(A(I,T)?C(I,T):!1))return!1}return!0}return!1};ae.collectionsAreEqual=C}}),s3=Re({"src/plot_api/plot_api.js"(ae){var K=un(),v=da(),S=sS(),M=Rn(),L=M.nestedProperty,t=Ib(),r=Gm(),a=es(),l=O_(),i=If(),s=js(),o=Bk(),c=Hd(),p=qs(),d=ko(),y=nM().initInteractions,g=jv(),C=Dh().clearOutline,f=Hc().dfltConfig,x=GD(),A=aM(),k=a3(),I=bf(),T=qh().AX_NAME_PATTERN,E=0,_=5;function h(Be,Ie,ke,Fe){var at;if(Be=M.getGraphDiv(Be),t.init(Be),M.isPlainObject(Ie)){var ct=Ie;Ie=ct.data,ke=ct.layout,Fe=ct.config,at=ct.frames}var Gt=t.triggerHandler(Be,"plotly_beforeplot",[Ie,ke,Fe]);if(Gt===!1)return Promise.reject();!Ie&&!ke&&!M.isPlotDiv(Be)&&M.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",Be);function Vt(){if(at)return ae.addFrames(Be,at)}U(Be,Fe),ke||(ke={}),K.select(Be).classed("js-plotly-plot",!0),p.makeTester(),Array.isArray(Be._promises)||(Be._promises=[]);var Zt=(Be.data||[]).length===0&&Array.isArray(Ie);Array.isArray(Ie)&&(A.cleanData(Ie),Zt?Be.data=Ie:Be.data.push.apply(Be.data,Ie),Be.empty=!1),(!Be.layout||Zt)&&(Be.layout=A.cleanLayout(ke)),i.supplyDefaults(Be);var ur=Be._fullLayout,Dr=ur._has("cartesian");ur._replotting=!0,(Zt||ur._shouldCreateBgLayer)&&(ut(Be),ur._shouldCreateBgLayer&&delete ur._shouldCreateBgLayer),p.initGradients(Be),p.initPatterns(Be),Zt&&s.saveShowSpikeInitial(Be);var kr=!Be.calcdata||Be.calcdata.length!==(Be._fullData||[]).length;kr&&i.doCalcdata(Be);for(var Sr=0;Sr=Be.data.length||at<-Be.data.length)throw new Error(ke+" must be valid indices for gd.data.");if(Ie.indexOf(at,Fe+1)>-1||at>=0&&Ie.indexOf(-Be.data.length+at)>-1||at<0&&Ie.indexOf(Be.data.length+at)>-1)throw new Error("each index in "+ke+" must be unique.")}}function H(Be,Ie,ke){if(!Array.isArray(Be.data))throw new Error("gd.data must be an array.");if(typeof Ie>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(Ie)||(Ie=[Ie]),O(Be,Ie,"currentIndices"),typeof ke<"u"&&!Array.isArray(ke)&&(ke=[ke]),typeof ke<"u"&&O(Be,ke,"newIndices"),typeof ke<"u"&&Ie.length!==ke.length)throw new Error("current and new indices must be of equal length.")}function W(Be,Ie,ke){var Fe,at;if(!Array.isArray(Be.data))throw new Error("gd.data must be an array.");if(typeof Ie>"u")throw new Error("traces must be defined.");for(Array.isArray(Ie)||(Ie=[Ie]),Fe=0;Fe"u")throw new Error("indices must be an integer or array of integers");O(Be,ke,"indices");for(var ct in Ie){if(!Array.isArray(Ie[ct])||Ie[ct].length!==ke.length)throw new Error("attribute "+ct+" must be an array of length equal to indices array length");if(at&&(!(ct in Fe)||!Array.isArray(Fe[ct])||Fe[ct].length!==Ie[ct].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function ue(Be,Ie,ke,Fe){var at=M.isPlainObject(Fe),ct=[],Gt,Vt,Zt,ur,Dr;Array.isArray(ke)||(ke=[ke]),ke=j(ke,Be.data.length-1);for(var kr in Ie)for(var Sr=0;Sr=0&&Dr=0&&Dr"u")return ur=ae.redraw(Be),r.add(Be,at,Gt,ct,Vt),ur;Array.isArray(ke)||(ke=[ke]);try{H(Be,Fe,ke)}catch(Dr){throw Be.data.splice(Be.data.length-Ie.length,Ie.length),Dr}return r.startSequence(Be),r.add(Be,at,Gt,ct,Vt),ur=ae.moveTraces(Be,Fe,ke),r.stopSequence(Be),ur}function ce(Be,Ie){Be=M.getGraphDiv(Be);var ke=[],Fe=ae.addTraces,at=ce,ct=[Be,ke,Ie],Gt=[Be,Ie],Vt,Zt;if(typeof Ie>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(Ie)||(Ie=[Ie]),O(Be,Ie,"indices"),Ie=j(Ie,Be.data.length-1),Ie.sort(M.sorterDes),Vt=0;Vt"u")for(ke=[],ur=0;ur0&&typeof yr.parts[bn]!="string";)bn--;var In=yr.parts[bn],Fn=yr.parts[bn-1]+"."+In,va=yr.parts.slice(0,bn).join("."),Pa=L(Be.layout,va).get(),La=L(Fe,va).get(),Oa=yr.get();if(br!==void 0){_a[rr]=br,xa[rr]=In==="reverse"?br:le(Oa);var Wa=l.getLayoutValObject(Fe,yr.parts);if(Wa&&Wa.impliedEdits&&br!==null)for(var sa in Wa.impliedEdits)ra(M.relativeAttr(rr,sa),Wa.impliedEdits[sa]);if(["width","height"].indexOf(rr)!==-1)if(br){ra("autosize",null);var ji=rr==="height"?"width":"height";ra(ji,Fe[ji])}else Fe[rr]=Be._initialAutoSize[rr];else if(rr==="autosize")ra("width",br?null:Fe.width),ra("height",br?null:Fe.height);else if(Fn.match(Xe))_r(Fn),L(Fe,va+"._inputRange").set(null);else if(Fn.match(it)){_r(Fn),L(Fe,va+"._inputRange").set(null);var Qi=L(Fe,va).get();Qi._inputDomain&&(Qi._input.domain=Qi._inputDomain.slice())}else Fn.match(yt)&&L(Fe,va+"._inputDomain").set(null);if(In==="type"){ci=Pa;var Xt=La.type==="linear"&&br==="log",Lt=La.type==="log"&&br==="linear";if(Xt||Lt){if(!ci||!ci.range)ra(va+".autorange",!0);else if(La.autorange)Xt&&(ci.range=ci.range[1]>ci.range[0]?[1,2]:[2,1]);else{var $r=ci.range[0],en=ci.range[1];Xt?($r<=0&&en<=0&&ra(va+".autorange",!0),$r<=0?$r=en/1e6:en<=0&&(en=$r/1e6),ra(va+".range[0]",Math.log($r)/Math.LN10),ra(va+".range[1]",Math.log(en)/Math.LN10)):(ra(va+".range[0]",Math.pow(10,$r)),ra(va+".range[1]",Math.pow(10,en)))}Array.isArray(Fe._subplots.polar)&&Fe._subplots.polar.length&&Fe[yr.parts[0]]&&yr.parts[1]==="radialaxis"&&delete Fe[yr.parts[0]]._subplot.viewInitial["radialaxis.range"],a.getComponentMethod("annotations","convertCoords")(Be,La,br,ra),a.getComponentMethod("images","convertCoords")(Be,La,br,ra)}else ra(va+".autorange",!0),ra(va+".range",null);L(Fe,va+"._inputRange").set(null)}else if(In.match(T)){var rn=L(Fe,rr).get(),Wr=(br||{}).type;(!Wr||Wr==="-")&&(Wr="linear"),a.getComponentMethod("annotations","convertCoords")(Be,rn,Wr,ra),a.getComponentMethod("images","convertCoords")(Be,rn,Wr,ra)}var tn=x.containerArrayMatch(rr);if(tn){Dr=tn.array,kr=tn.index;var wn=tn.property,dn=Wa||{editType:"calc"};kr!==""&&wn===""&&(x.isAddVal(br)?xa[rr]=null:x.isRemoveVal(br)?xa[rr]=(L(ke,Dr).get()||[])[kr]:M.warn("unrecognized full object value",Ie)),I.update(oa,dn),ur[Dr]||(ur[Dr]={});var Nt=ur[Dr][kr];Nt||(Nt=ur[Dr][kr]={}),Nt[wn]=br,delete Ie[rr]}else In==="reverse"?(Pa.range?Pa.range.reverse():(ra(va+".autorange",!0),Pa.range=[1,0]),La.autorange?oa.calc=!0:oa.plot=!0):(rr==="dragmode"&&(br===!1&&Oa!==!1||br!==!1&&Oa===!1)||Fe._has("scatter-like")&&Fe._has("regl")&&rr==="dragmode"&&(br==="lasso"||br==="select")&&!(Oa==="lasso"||Oa==="select")?oa.plot=!0:Wa?I.update(oa,Wa):oa.calc=!0,yr.set(br))}}for(Dr in ur){var xr=x.applyContainerArrayChanges(Be,ct(ke,Dr),ur[Dr],oa,ct);xr||(oa.plot=!0)}for(var Xr in Ha){ci=s.getFromId(Be,Xr);var Tn=ci&&ci._constraintGroup;if(Tn){oa.calc=!0;for(var Xn in Tn)Ha[Xn]||(s.getFromId(Be,Xn)._constraintShrinkable=!0)}}(mt(Be)||Ie.height||Ie.width)&&(oa.plot=!0);var ia=Fe.shapes;for(kr=0;kr1;)if(Fe.pop(),ke=L(Ie,Fe.join(".")+".uirevision").get(),ke!==void 0)return ke;return Ie.uirevision}function At(Be,Ie){for(var ke=0;ke[va,Be._ev.listeners(va)]);ct=ae.newPlot(Be,Ie,ke,Fe).then(()=>{for(const[va,Pa]of Fn)Pa.forEach(La=>Be.on(va,La));return ae.react(Be,Ie,ke,Fe)})}else{Be.data=Ie||[],A.cleanData(Be.data),Be.layout=ke||{},A.cleanLayout(Be.layout),Qt(Be.data,Be.layout,Vt,Zt),i.supplyDefaults(Be,{skipUpdateCalc:!0});var kr=Be._fullData,Sr=Be._fullLayout,Jr=Sr.datarevision===void 0,jn=Sr.transition,ha=Ur(Be,Zt,Sr,Jr,jn),oa=ha.newDataRevision,_a=mr(Be,Vt,kr,Jr,jn,oa);if(mt(Be)&&(ha.layoutReplot=!0),_a.calc||ha.calc){Be.calcdata=void 0;for(var xa=Object.getOwnPropertyNames(Sr),ra=0;ra(Dr||Be.emit("plotly_react",{config:Fe,data:Ie,layout:ke}),Be))}function mr(Be,Ie,ke,Fe,at,ct){var Gt=Ie.length===ke.length;if(!at&&!Gt)return{fullReplot:!0,calc:!0};var Vt=I.traceFlags();Vt.arrays={},Vt.nChanges=0,Vt.nChangesAnim=0;var Zt,ur;function Dr(Jr){var jn=l.getTraceValObject(ur,Jr);return!ur._module.animatable&&jn.anim&&(jn.anim=!1),jn}var kr={getValObject:Dr,flags:Vt,immutable:Fe,transition:at,newDataRevision:ct,gd:Be},Sr={};for(Zt=0;Zt=at.length?at[0]:at[ur]:at}function Vt(ur){return Array.isArray(ct)?ur>=ct.length?ct[0]:ct[ur]:ct}function Zt(ur,Dr){var kr=0;return function(){if(ur&&++kr===Dr)return ur()}}return new Promise(function(ur,Dr){function kr(){if(Fe._frameQueue.length!==0){for(;Fe._frameQueue.length;){var In=Fe._frameQueue.pop();In.onInterrupt&&In.onInterrupt()}Be.emit("plotly_animationinterrupted",[])}}function Sr(In){if(In.length!==0){for(var Fn=0;FnFe._timeToNext&&jn()};In()}var oa=0;function _a(In){return Array.isArray(at)?oa>=at.length?In.transitionOpts=at[oa]:In.transitionOpts=at[0]:In.transitionOpts=at,oa++,In}var xa,ra,Ha=[],ci=Ie==null,_r=Array.isArray(Ie),rr=!ci&&!_r&&M.isPlainObject(Ie);if(rr)Ha.push({type:"object",data:_a(M.extendFlat({},Ie))});else if(ci||["string","number"].indexOf(typeof Ie)!==-1)for(xa=0;xa0&&anan)&&bn.push(ra);Ha=bn}}Ha.length>0?Sr(Ha):(Be.emit("plotly_animated"),ur())})}function Fr(Be,Ie,ke){if(Be=M.getGraphDiv(Be),Ie==null)return Promise.resolve();if(!M.isPlotDiv(Be))throw new Error("This element is not a Plotly plot: "+Be+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Fe,at,ct,Gt,Vt=Be._transitionData._frames,Zt=Be._transitionData._frameHash;if(!Array.isArray(Ie))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+Ie);var ur=Vt.length+Ie.length*2,Dr=[],kr={};for(Fe=Ie.length-1;Fe>=0;Fe--)if(M.isPlainObject(Ie[Fe])){var Sr=Ie[Fe].name,Jr=(Zt[Sr]||kr[Sr]||{}).name,jn=Ie[Fe].name,ha=Zt[Jr]||kr[Jr];Jr&&jn&&typeof jn=="number"&&ha&&E<_&&(E++,M.warn('addFrames: overwriting frame "'+(Zt[Jr]||kr[Jr]).name+'" with a frame whose name of type "number" also equates to "'+Jr+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),E===_&&M.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.")),kr[Sr]={name:Sr},Dr.push({frame:i.supplyFrameDefaults(Ie[Fe]),index:ke&&ke[Fe]!==void 0&&ke[Fe]!==null?ke[Fe]:ur+Fe})}Dr.sort(function(rr,yr){return rr.index>yr.index?-1:rr.index=0;Fe--){if(at=Dr[Fe].frame,typeof at.name=="number"&&M.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!at.name)for(;Zt[at.name="frame "+Be._transitionData._counter++];);if(Zt[at.name]){for(ct=0;ct=0;ke--)Fe=Ie[ke],ct.push({type:"delete",index:Fe}),Gt.unshift({type:"insert",index:Fe,value:at[Fe]});var Vt=i.modifyFrames,Zt=i.modifyFrames,ur=[Be,Gt],Dr=[Be,ct];return r&&r.add(Be,Vt,ur,Zt,Dr),i.modifyFrames(Be,ct)}function Bt(Be){Be=M.getGraphDiv(Be);var Ie=Be._fullLayout||{},ke=Be._fullData||[];return i.cleanPlot([],{},ke,Ie),i.purge(Be),t.purge(Be),Ie._container&&Ie._container.remove(),delete Be._context,Be}function et(Be){var Ie=Be._fullLayout,ke=Be.getBoundingClientRect();if(!M.equalDomRects(ke,Ie._lastBBox)){var Fe=Ie._invTransform=M.inverseTransformMatrix(M.getFullTransformMatrix(Be));Ie._invScaleX=Math.sqrt(Fe[0][0]*Fe[0][0]+Fe[0][1]*Fe[0][1]+Fe[0][2]*Fe[0][2]),Ie._invScaleY=Math.sqrt(Fe[1][0]*Fe[1][0]+Fe[1][1]*Fe[1][1]+Fe[1][2]*Fe[1][2]),Ie._lastBBox=ke}}function ut(Be){var Ie=K.select(Be),ke=Be._fullLayout;if(ke._calcInverseTransform=et,ke._calcInverseTransform(Be),ke._container=Ie.selectAll(".plot-container").data([0]),ke._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),ke._paperdiv=ke._container.selectAll(".svg-container").data([0]),ke._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),ke._glcontainer=ke._paperdiv.selectAll(".gl-container").data([{}]),ke._glcontainer.enter().append("div").classed("gl-container",!0),ke._paperdiv.selectAll(".main-svg").remove(),ke._paperdiv.select(".modebar-container").remove(),ke._paper=ke._paperdiv.insert("svg",":first-child").classed("main-svg",!0),ke._toppaper=ke._paperdiv.append("svg").classed("main-svg",!0),ke._modebardiv=ke._paperdiv.append("div"),delete ke._modeBar,ke._hoverpaper=ke._paperdiv.append("svg").classed("main-svg",!0),!ke._uid){var Fe={};K.selectAll("defs").each(function(){this.id&&(Fe[this.id.split("-")[1]]=1)}),ke._uid=M.randstr(Fe)}ke._paperdiv.selectAll(".main-svg").attr(g.svgAttrs),ke._defs=ke._paper.append("defs").attr("id","defs-"+ke._uid),ke._clips=ke._defs.append("g").classed("clips",!0),ke._topdefs=ke._toppaper.append("defs").attr("id","topdefs-"+ke._uid),ke._topclips=ke._topdefs.append("g").classed("clips",!0),ke._bgLayer=ke._paper.append("g").classed("bglayer",!0),ke._draggers=ke._paper.append("g").classed("draglayer",!0);var at=ke._paper.append("g").classed("layer-below",!0);ke._imageLowerLayer=at.append("g").classed("imagelayer",!0),ke._shapeLowerLayer=at.append("g").classed("shapelayer",!0),ke._cartesianlayer=ke._paper.append("g").classed("cartesianlayer",!0),ke._polarlayer=ke._paper.append("g").classed("polarlayer",!0),ke._smithlayer=ke._paper.append("g").classed("smithlayer",!0),ke._ternarylayer=ke._paper.append("g").classed("ternarylayer",!0),ke._geolayer=ke._paper.append("g").classed("geolayer",!0),ke._funnelarealayer=ke._paper.append("g").classed("funnelarealayer",!0),ke._pielayer=ke._paper.append("g").classed("pielayer",!0),ke._iciclelayer=ke._paper.append("g").classed("iciclelayer",!0),ke._treemaplayer=ke._paper.append("g").classed("treemaplayer",!0),ke._sunburstlayer=ke._paper.append("g").classed("sunburstlayer",!0),ke._indicatorlayer=ke._toppaper.append("g").classed("indicatorlayer",!0),ke._glimages=ke._paper.append("g").classed("glimages",!0);var ct=ke._toppaper.append("g").classed("layer-above",!0);ke._imageUpperLayer=ct.append("g").classed("imagelayer",!0),ke._shapeUpperLayer=ct.append("g").classed("shapelayer",!0),ke._selectionLayer=ke._toppaper.append("g").classed("selectionlayer",!0),ke._infolayer=ke._toppaper.append("g").classed("infolayer",!0),ke._menulayer=ke._toppaper.append("g").classed("menulayer",!0),ke._zoomlayer=ke._toppaper.append("g").classed("zoomlayer",!0),ke._hoverlayer=ke._hoverpaper.append("g").classed("hoverlayer",!0),ke._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),Be.emit("plotly_framework")}ae.animate=fn,ae.addFrames=Fr,ae.deleteFrames=Qr,ae.addTraces=se,ae.deleteTraces=ce,ae.extendTraces=_e,ae.moveTraces=ne,ae.prependTraces=Y,ae.newPlot=G,ae._doPlot=h,ae.purge=Bt,ae.react=fr,ae.redraw=V,ae.relayout=Ne,ae.restyle=ye,ae.setPlotConfig=w,ae.update=ht,ae._guiRelayout=Ve(Ne),ae._guiRestyle=Ve(ye),ae._guiUpdate=Ve(ht),ae._storeDirectGUIEdit=pe}}),Xg=Re({"src/snapshot/helpers.js"(ae){var K=es();ae.getDelay=function(M){return M._has&&(M._has("gl3d")||M._has("mapbox")||M._has("map"))?500:0},ae.getRedrawFunc=function(M){return function(){K.getComponentMethod("colorbar","draw")(M)}},ae.encodeSVG=function(M){return"data:image/svg+xml,"+encodeURIComponent(M)},ae.encodeJSON=function(M){return"data:application/json,"+encodeURIComponent(M)};var v=window.URL||window.webkitURL;ae.createObjectURL=function(M){return v.createObjectURL(M)},ae.revokeObjectURL=function(M){return v.revokeObjectURL(M)},ae.createBlob=function(M,L){if(L==="svg")return new window.Blob([M],{type:"image/svg+xml;charset=utf-8"});if(L==="full-json")return new window.Blob([M],{type:"application/json;charset=utf-8"});var t=S(window.atob(M));return new window.Blob([t],{type:"image/"+L})},ae.octetStream=function(M){document.location.href="data:application/octet-stream"+M};function S(M){for(var L=M.length,t=new ArrayBuffer(L),r=new Uint8Array(t),a=0;a")!==-1?"":s.html(c).text()});return s.remove(),o}function l(i){return i.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}K.exports=function(s,o,c){var p=s._fullLayout,d=p._paper,y=p._toppaper,g=p.width,C=p.height,f;d.insert("rect",":first-child").call(S.setRect,0,0,g,C).call(M.fill,p.paper_bgcolor);var x=p._basePlotModules||[];for(f=0;f1&&I.push(c("object","layout"))),S.supplyDefaults(T);for(var h=T._fullData,m=E.length,w=0;wF.length&&k.push(c("unused",I,m.concat(F.length)));var O=F.length,H=Array.isArray(j);H&&(O=Math.min(O,j.length));var W,ee,ue,xe,ge;if(z.dimensions===2)for(ee=0;eeF[ee].length&&k.push(c("unused",I,m.concat(ee,F[ee].length)));var _e=F[ee].length;for(W=0;W<(H?Math.min(_e,j[ee].length):_e);W++)ue=H?j[ee][W]:j,xe=w[ee][W],ge=F[ee][W],v.validate(xe,ue)?ge!==xe&&ge!==+xe&&k.push(c("dynamic",I,m.concat(ee,W),xe,ge)):k.push(c("value",I,m.concat(ee,W),xe))}else k.push(c("array",I,m.concat(ee),w[ee]));else for(ee=0;eeV?k.push({code:"unused",traceType:w,templateCount:U,dataCount:V}):V>U&&k.push({code:"reused",traceType:w,templateCount:U,dataCount:V})}}function G(j,O){for(var H in j)if(H.charAt(0)!=="_"){var W=j[H],ee=c(j,H,O);v(W)?(Array.isArray(j)&&W._template===!1&&W.templateitemname&&k.push({code:"missing",path:ee,templateitemname:W.templateitemname}),G(W,ee)):Array.isArray(W)&&p(W)&&G(W,ee)}}if(G({data:T,layout:I},""),k.length)return k.map(d)};function p(y){for(var g=0;g=0;d--){var y=t[d];if(y.type==="scatter"&&y.xaxis===c.xaxis&&y.yaxis===c.yaxis){y.opacity=void 0;break}}}}}}}),AS=Re({"src/traces/scatter/layout_defaults.js"(ae,K){var v=Rn(),S=dy();K.exports=function(M,L){function t(a,l){return v.coerce(M,L,S,a,l)}var r=L.barmode==="group";L.scattermode==="group"&&t("scattergap",r?L.bargap:.2)}}}),bg=Re({"src/plots/cartesian/align_period.js"(ae,K){var v=da(),S=Rn(),M=S.dateTime2ms,L=S.incrementMonth,t=Ia(),r=t.ONEAVGMONTH;K.exports=function(l,i,s,o){if(i.type!=="date")return{vals:o};var c=l[s+"periodalignment"];if(!c)return{vals:o};var p=l[s+"period"],d;if(v(p)){if(p=+p,p<=0)return{vals:o}}else if(typeof p=="string"&&p.charAt(0)==="M"){var y=+p.substring(1);if(y>0&&Math.round(y)===y)d=y;else return{vals:o}}for(var g=i.calendar,C=c==="start",f=c==="end",x=l[s+"period0"],A=M(x,g)||0,k=[],I=[],T=[],E=o.length,_=0;_h;)F=L(F,-d,g);for(;F<=h;)F=L(F,d,g);w=L(F,-d,g)}else{for(m=Math.round((h-A)/p),F=A+m*p;F>h;)F-=p;for(;F<=h;)F+=p;w=F-p}k[_]=C?w:f?F:(w+F)/2,I[_]=w,T[_]=F}return{vals:k,starts:I,ends:T}}}}),Em=Re({"src/traces/scatter/colorscale_calc.js"(ae,K){var v=cp().hasColorscale,S=hp(),M=Mu();K.exports=function(t,r){M.hasLines(r)&&v(r,"line")&&S(t,r,{vals:r.line.color,containerStr:"line",cLetter:"c"}),M.hasMarkers(r)&&(v(r,"marker")&&S(t,r,{vals:r.marker.color,containerStr:"marker",cLetter:"c"}),v(r,"marker.line")&&S(t,r,{vals:r.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),Yg=Re({"src/traces/scatter/arrays_to_calcdata.js"(ae,K){var v=Rn();K.exports=function(M,L){for(var t=0;tG&&w[O].gap;)O--;for(W=w[O].s,j=w.length-1;j>O;j--)w[j].s=W;for(;GH+j||!v(O))}for(var ee=0;eeU[g]&&g0?t:r)/(g._m*x*(g._m>0?t:r)))),ur*=1e3}if(Dr===M){if(f&&(Dr=g.c2p(Zt.y,!0)),Dr===M)return!1;Dr*=1e3}return[ur,Dr]}function de(Vt,Zt,ur,Dr){var kr=ur-Vt,Sr=Dr-Zt,Jr=.5-Vt,jn=.5-Zt,ha=kr*kr+Sr*Sr,oa=kr*Jr+Sr*jn;if(oa>0&&oa1||Math.abs(Jr.y-ur[0][1])>1)&&(Jr=[Jr.x,Jr.y],Dr&&$e(Jr,Vt)<$e(ur[0],Vt)?ur.unshift(Jr):ur.push(Jr),Dr++)}return ur}function vt(Vt){if(Vt[0]it||Vt[1]bt)return[i(Vt[0],Xe,it),i(Vt[1],yt,bt)]}function Kt(Vt,Zt){if(Vt[0]===Zt[0]&&(Vt[0]===Xe||Vt[0]===it)||Vt[1]===Zt[1]&&(Vt[1]===yt||Vt[1]===bt))return!0}function Qt(Vt,Zt){var ur=[],Dr=vt(Vt),kr=vt(Zt);return Dr&&kr&&Kt(Dr,kr)||(Dr&&ur.push(Dr),kr&&ur.push(kr)),ur}function fr(Vt,Zt,ur){return function(Dr,kr){var Sr=vt(Dr),Jr=vt(kr),jn=[];if(Sr&&Jr&&Kt(Sr,Jr))return jn;Sr&&jn.push(Sr),Jr&&jn.push(Jr);var ha=2*a.constrain((Dr[Vt]+kr[Vt])/2,Zt,ur)-((Sr||Dr)[Vt]+(Jr||kr)[Vt]);if(ha){var oa;Sr&&Jr?oa=ha>0==Sr[Vt]>Jr[Vt]?Sr:Jr:oa=Sr||Jr,oa[Vt]+=ha}return jn}}var mr;_==="linear"||_==="spline"?mr=At:_==="hv"||_==="vh"?mr=Qt:_==="hvh"?mr=fr(0,Xe,it):_==="vhv"&&(mr=fr(1,yt,bt));function Ur(Vt,Zt){var ur=Zt[0]-Vt[0],Dr=(Zt[1]-Vt[1])/ur,kr=(Vt[1]*Zt[0]-Zt[1]*Vt[0])/ur;return kr>0?[Dr>0?Xe:it,bt]:[Dr>0?it:Xe,yt]}function Br(Vt){var Zt=Vt[0],ur=Vt[1],Dr=Zt===U[V-1][0],kr=ur===U[V-1][1];if(!(Dr&&kr))if(V>1){var Sr=Zt===U[V-2][0],Jr=ur===U[V-2][1];Dr&&(Zt===Xe||Zt===it)&&Sr?Jr?V--:U[V-1]=Vt:kr&&(ur===yt||ur===bt)&&Jr?Sr?V--:U[V-1]=Vt:U[V++]=Vt}else U[V++]=Vt}function fn(Vt){U[V-1][0]!==Vt[0]&&U[V-1][1]!==Vt[1]&&Br([ze,Se]),Br(Vt),Je=null,ze=Se=0}var Fr=a.isArrayOrTypedArray(I);function Qr(Vt){if(Vt&&k&&(Vt.i=G,Vt.d=c,Vt.trace=d,Vt.marker=Fr?I[Vt.i]:I,Vt.backoff=k),pe=Vt[0]/x,Te=Vt[1]/A,ht=Vt[0]it?it:0,Ve=Vt[1]bt?bt:0,ht||Ve){if(!V)U[V++]=[ht||Vt[0],Ve||Vt[1]];else if(Je){var Zt=mr(Je,Vt);Zt.length>1&&(fn(Zt[0]),U[V++]=Zt[1])}else _t=mr(U[V-1],Vt)[0],U[V++]=_t;var ur=U[V-1];ht&&Ve&&(ur[0]!==ht||ur[1]!==Ve)?(Je&&(ze!==ht&&Se!==Ve?Br(ze&&Se?Ur(Je,Vt):[ze||ht,Se||Ve]):ze&&Se&&Br([ze,Se])),Br([ht,Ve])):ze-ht&&Se-Ve&&Br([ht||ze,Ve||Se]),Je=Vt,ze=ht,Se=Ve}else Je&&fn(mr(Je,Vt)[0]),U[V++]=Vt}for(G=0;GNe(ee,Bt))break;O=ee,ce=ge[0]*xe[0]+ge[1]*xe[1],ce>Y?(Y=ce,H=ee,ue=!1):ce=c.length||!ee)break;Qr(ee),j=ee}}Je&&Br([ze||Je[0],Se||Je[1]]),w.push(U.slice(0,V))}var et=_.slice(_.length-1);if(k&&et!=="h"&&et!=="v"){for(var ut=!1,Be=-1,Ie=[],ke=0;ke=0?s=y:(s=y=d,d++),s0,_=i(y,g,C);if(k=f.selectAll("g.trace").data(_,function(m){return m[0].trace.uid}),k.enter().append("g").attr("class",function(m){return"trace scatter trace"+m[0].trace.uid}).style("stroke-miterlimit",2),k.order(),o(y,k,g),E){A&&(I=A());var h=v.transition().duration(x.duration).ease(x.easing).each("end",function(){I&&I()}).each("interrupt",function(){I&&I()});h.each(function(){f.selectAll("g.trace").each(function(m,w){c(y,w,g,m,_,this,x)})})}else k.each(function(m,w){c(y,w,g,m,_,this,x)});T&&k.exit().remove(),f.selectAll("path:not([d])").remove()};function o(d,y,g){y.each(function(C){var f=L(v.select(this),"g","fills");r.setClipUrl(f,g.layerClipId,d);var x=C[0].trace,A=[];x._ownfill&&A.push("_ownFill"),x._nexttrace&&A.push("_nextFill");var k=f.selectAll("g").data(A,t);k.enter().append("g"),k.exit().each(function(I){x[I]=null}).remove(),k.order().each(function(I){x[I]=L(v.select(this),"path","js-fill")})})}function c(d,y,g,C,f,x,A){var k=d._context.staticPlot,I;p(d,y,g,C,f);var T=!!A&&A.duration>0;function E(Br){return T?Br.transition():Br}var _=g.xaxis,h=g.yaxis,m=C[0].trace,w=m.line,F=v.select(x),z=L(F,"g","errorbars"),U=L(F,"g","lines"),V=L(F,"g","points"),G=L(F,"g","text");if(S.getComponentMethod("errorbars","plot")(d,z,g,A),m.visible!==!0)return;E(F).style("opacity",m.opacity);var j,O,H=m.fill.charAt(m.fill.length-1);H!=="x"&&H!=="y"&&(H="");var W,ee;H==="y"?(W=1,ee=h.c2p(0,!0)):H==="x"&&(W=0,ee=_.c2p(0,!0)),C[0][g.isRangePlot?"nodeRangePlot3":"node3"]=F;var ue="",xe=[],ge=m._prevtrace,_e=null,Y=null;ge&&(ue=ge._prevRevpath||"",O=ge._nextFill,xe=ge._ownPolygons,_e=ge._fillsegments,Y=ge._fillElement);var se,ce,ne="",ye="",le,Z,de,pe,Te,Ne,$e=[];m._polygons=[];var Ze=[],Xe=[],it=M.noop;if(j=m._ownFill,a.hasLines(m)||m.fill!=="none"){O&&O.datum(C),["hv","vh","hvh","vhv"].indexOf(w.shape)!==-1?(le=r.steps(w.shape),Z=r.steps(w.shape.split("").reverse().join(""))):w.shape==="spline"?le=Z=function(Br){var fn=Br[Br.length-1];return Br.length>1&&Br[0][0]===fn[0]&&Br[0][1]===fn[1]?r.smoothclosed(Br.slice(1),w.smoothing):r.smoothopen(Br,w.smoothing)}:le=Z=function(Br){return"M"+Br.join("L")},de=function(Br){return Z(Br.reverse())},Xe=l(C,{xaxis:_,yaxis:h,trace:m,connectGaps:m.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:m.fill}),Ze=new Array(Xe.length);var yt=0;for(I=0;I=k[0]&&F.x<=k[1]&&F.y>=I[0]&&F.y<=I[1]}),h=Math.ceil(_.length/E),m=0;f.forEach(function(F,z){var U=F[0].trace;a.hasMarkers(U)&&U.marker.maxdisplayed>0&&z=Math.min(ge,_e)&&g<=Math.max(ge,_e)?0:1/0}var Y=Math.max(3,xe.mrc||0),se=1-1/Y,ce=Math.abs(d.c2p(xe.x)-g);return ce=Math.min(ge,_e)&&C<=Math.max(ge,_e)?0:1/0}var Y=Math.max(3,xe.mrc||0),se=1-1/Y,ce=Math.abs(y.c2p(xe.y)-C);return ceye!=Ze>=ye&&(Te=de[Z-1][0],Ne=de[Z][0],Ze-$e&&(pe=Te+(Ne-Te)*(ye-$e)/(Ze-$e),Y=Math.min(Y,pe),se=Math.max(se,pe)));return Y=Math.max(Y,0),se=Math.min(se,d._length),{x0:Y,x1:se,y0:ye,y1:ye}}if(x.indexOf("fills")!==-1&&p._fillElement){var W=O(p._fillElement)&&!O(p._fillExclusionElement);if(W){var ee=H(p._polygons);ee===null&&(ee={x0:f[0],x1:f[0],y0:f[1],y1:f[1]});var ue=t.defaultLine;return t.opacity(p.fillcolor)?ue=p.fillcolor:t.opacity((p.line||{}).color)&&(ue=p.line.color),v.extendFlat(l,{distance:l.maxHoverDistance,x0:ee.x0,x1:ee.x1,y0:ee.y0,y1:ee.y1,color:ue,hovertemplate:!1}),delete l.index,p.text&&!v.isArrayOrTypedArray(p.text)?l.text=String(p.text):l.text=p.name,[l]}}}}}),M1=Re({"src/traces/scatter/select.js"(ae,K){var v=Mu();K.exports=function(M,L){var t=M.cd,r=M.xaxis,a=M.yaxis,l=[],i=t[0].trace,s,o,c,p,d=!v.hasMarkers(i)&&!v.hasText(i);if(d)return[];if(L===!1)for(s=0;s0&&(o["_"+i+"axes"]||{})[l])return o;if((o[i+"axis"]||i)===l){if(r(o,i))return o;if((o[i]||[]).length||o[i+"0"])return o}}}function t(a){return{v:"x",h:"y"}[a.orientation||"v"]}function r(a,l){var i=t(a),s=v(a,"box-violin"),o=v(a._fullInput||{},"candlestick");return s&&!o&&l===i&&a[i]===void 0&&a[i+"0"]===void 0}}}),hh=Re({"src/plots/cartesian/category_order_defaults.js"(ae,K){var v=ai().isTypedArraySpec;function S(M,L){var t=L.dataAttr||M._id.charAt(0),r={},a,l,i;if(L.axData)a=L.axData;else for(a=[],l=0;l0||v(l),s;i&&(s="array");var o=r("categoryorder",s),c;o==="array"&&(c=r("categoryarray")),!i&&o==="array"&&(o=t.categoryorder="trace"),o==="trace"?t._initialCategories=[]:o==="array"?t._initialCategories=c.slice():(c=S(t,a).sort(),o==="category ascending"?t._initialCategories=c:o==="category descending"&&(t._initialCategories=c.reverse()))}}}}),fc=Re({"src/plots/cartesian/line_grid_defaults.js"(ae,K){var v=oo().mix,S=du(),M=Rn();K.exports=function(t,r,a,l){l=l||{};var i=l.dfltColor;function s(m,w){return M.coerce2(t,r,l.attributes,m,w)}var o=s("linecolor",i),c=s("linewidth"),p=a("showline",l.showLine||!!o||!!c);p||(delete r.linecolor,delete r.linewidth);var d=v(i,l.bgColor,l.blend||S.lightFraction).toRgbString(),y=s("gridcolor",d),g=s("gridwidth"),C=s("griddash"),f=a("showgrid",l.showGrid||!!y||!!g||!!C);if(f||(delete r.gridcolor,delete r.gridwidth,delete r.griddash),l.hasMinor){var x=v(r.gridcolor,l.bgColor,67).toRgbString(),A=s("minor.gridcolor",x),k=s("minor.gridwidth",r.gridwidth||1),I=s("minor.griddash",r.griddash||"solid"),T=a("minor.showgrid",!!A||!!k||!!I);T||(delete r.minor.gridcolor,delete r.minor.gridwidth,delete r.minor.griddash)}if(!l.noZeroLine){s("zerolinelayer");var E=s("zerolinecolor",i),_=s("zerolinewidth"),h=a("zeroline",l.showGrid||!!E||!!_);h||(delete r.zerolinelayer,delete r.zerolinecolor,delete r.zerolinewidth)}}}}),wg=Re({"src/plots/cartesian/axis_defaults.js"(ae,K){var v=da(),S=es(),M=Rn(),L=Bu(),t=fp(),r=Hd(),a=w1(),l=L0(),i=dg(),s=Gv(),o=hh(),c=fc(),p=Bk(),d=bm(),y=qh().WEEKDAY_PATTERN,g=qh().HOUR_PATTERN;K.exports=function(k,I,T,E,_){var h=E.letter,m=E.font||{},w=E.splomStash||{},F=T("visible",!E.visibleDflt),z=I._template||{},U=I.type||z.type||"-",V;if(U==="date"){var G=S.getComponentMethod("calendars","handleDefaults");G(k,I,"calendar",E.calendar),E.noTicklabelmode||(V=T("ticklabelmode"))}!E.noTicklabelindex&&(U==="date"||U==="linear")&&T("ticklabelindex");var j="";(!E.noTicklabelposition||U==="multicategory")&&(j=M.coerce(k,I,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:V==="period"?["outside","inside"]:h==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),E.noTicklabeloverflow||T("ticklabeloverflow",j.indexOf("inside")!==-1?"hide past domain":U==="category"||U==="multicategory"?"allow":"hide past div"),d(I,_),p(k,I,T,E),o(k,I,T,E),E.noHover||(U!=="category"&&T("hoverformat"),E.noUnifiedhovertitle||T("unifiedhovertitle.text"));var O=T("color"),H=O!==r.color.dflt?O:m.color,W=w.label||_._dfltTitle[h];if(s(k,I,T,U,E),!F)return I;T("title.text",W),M.coerceFont(T,"title.font",m,{overrideDflt:{size:M.bigFont(m.size),color:H}}),a(k,I,T,U);var ee=E.hasMinor;if(ee&&(L.newContainer(I,"minor"),a(k,I,T,U,{isMinor:!0})),i(k,I,T,U,E),l(k,I,T,E),ee){var ue=E.isMinor;E.isMinor=!0,l(k,I,T,E),E.isMinor=ue}c(k,I,T,{dfltColor:O,bgColor:E.bgColor,showGrid:E.showGrid,hasMinor:ee,attributes:r}),ee&&!I.minor.ticks&&!I.minor.showgrid&&delete I.minor,(I.showline||I.ticks)&&T("mirror");var xe=U==="multicategory";if(!E.noTickson&&(U==="category"||xe)&&(I.ticks||I.showgrid)&&(xe?(T("tickson","boundaries"),delete I.ticklabelposition):T("tickson")),xe){var ge=T("showdividers");ge&&(T("dividercolor"),T("dividerwidth"))}if(U==="date")if(t(k,I,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:C}),!I.rangebreaks.length)delete I.rangebreaks;else{for(var _e=0;_e=2){var h="",m,w;if(_.length===2){for(m=0;m<2;m++)if(w=x(_[m]),w){h=y;break}}var F=T("pattern",h);if(F===y)for(m=0;m<2;m++)w=x(_[m]),w&&(k.bounds[m]=_[m]=w-1);if(F)for(m=0;m<2;m++)switch(w=_[m],F){case y:if(!v(w)){k.enabled=!1;return}if(w=+w,w!==Math.floor(w)||w<0||w>=7){k.enabled=!1;return}k.bounds[m]=_[m]=w;break;case g:if(!v(w)){k.enabled=!1;return}if(w=+w,w<0||w>24){k.enabled=!1;return}k.bounds[m]=_[m]=w;break}if(I.autorange===!1){var z=I.range;if(z[0]z[1]){k.enabled=!1;return}}else if(_[0]>z[0]&&_[1]T[1]-1/4096&&(t.domain=d),S.noneOrAll(L.domain,t.domain,d),t.tickmode==="sync"&&(t.tickmode="auto")}return r("layer"),t}}}),SS=Re({"src/plots/cartesian/layout_defaults.js"(ae,K){var v=Rn(),S=ko(),M=Xp().isUnifiedHover,L=Wk(),t=Bu(),r=kb(),a=Hd(),l=Dp(),i=wg(),s=E1(),o=qv(),c=fh(),p=c.id2name,d=c.name2id,y=qh().AX_ID_PATTERN,g=es(),C=g.traceIs,f=g.getComponentMethod;function x(A,k,I){Array.isArray(A[k])?A[k].push(I):A[k]=[I]}K.exports=function(k,I,T){var E=I.autotypenumbers,_={},h={},m={},w={},F={},z={},U={},V={},G={},j={},O,H;for(O=0;O rect").call(L.setTranslate,0,0).call(L.setScale,1,1),I.plot.call(L.setTranslate,T._offset,E._offset).call(L.setScale,1,1);var _=I.plot.selectAll(".scatterlayer .trace");_.selectAll(".point").call(L.setPointGroupScale,1,1),_.selectAll(".textpoint").call(L.setTextPointsScale,1,1),_.call(L.hideOutsideRangePoints,I)}function p(I,T){var E=I.plotinfo,_=E.xaxis,h=E.yaxis,m=_._length,w=h._length,F=!!I.xr1,z=!!I.yr1,U=[];if(F){var V=M.simpleMap(I.xr0,_.r2l),G=M.simpleMap(I.xr1,_.r2l),j=V[1]-V[0],O=G[1]-G[0];U[0]=(V[0]*(1-T)+T*G[0]-V[0])/(V[1]-V[0])*m,U[2]=m*(1-T+T*O/j),_.range[0]=_.l2r(V[0]*(1-T)+T*G[0]),_.range[1]=_.l2r(V[1]*(1-T)+T*G[1])}else U[0]=0,U[2]=m;if(z){var H=M.simpleMap(I.yr0,h.r2l),W=M.simpleMap(I.yr1,h.r2l),ee=H[1]-H[0],ue=W[1]-W[0];U[1]=(H[1]*(1-T)+T*W[1]-H[1])/(H[0]-H[1])*w,U[3]=w*(1-T+T*ue/ee),h.range[0]=_.l2r(H[0]*(1-T)+T*W[0]),h.range[1]=h.l2r(H[1]*(1-T)+T*W[1])}else U[1]=0,U[3]=w;t.drawOne(a,_,{skipTitle:!0}),t.drawOne(a,h,{skipTitle:!0}),t.redrawComponents(a,[_._id,h._id]);var xe=F?m/U[2]:1,ge=z?w/U[3]:1,_e=F?U[0]:0,Y=z?U[1]:0,se=F?U[0]/U[2]*m:0,ce=z?U[1]/U[3]*w:0,ne=_._offset-se,ye=h._offset-ce;E.clipRect.call(L.setTranslate,_e,Y).call(L.setScale,1/xe,1/ge),E.plot.call(L.setTranslate,ne,ye).call(L.setScale,xe,ge),L.setPointGroupScale(E.zoomScalePts,1/xe,1/ge),L.setTextPointsScale(E.zoomScaleTxt,1/xe,1/ge)}var d;s&&(d=s());function y(){for(var I={},T=0;Ti.duration?(y(),x=window.cancelAnimationFrame(k)):x=window.requestAnimationFrame(k)}return C=Date.now(),x=window.requestAnimationFrame(k),Promise.resolve()}}}),td=Re({"src/plots/cartesian/index.js"(ae){var K=un(),v=es(),S=Rn(),M=If(),L=qs(),t=Lp().getModuleCalcData,r=fh(),a=qh(),l=jv(),i=S.ensureSingle;function s(C,f,x){return S.ensureSingle(C,f,x,function(A){A.datum(x)})}var o=a.zindexSeparator;ae.name="cartesian",ae.attr=["xaxis","yaxis"],ae.idRoot=["x","y"],ae.idRegex=a.idRegex,ae.attrRegex=a.attrRegex,ae.attributes=oM(),ae.layoutAttributes=Hd(),ae.supplyLayoutDefaults=SS(),ae.transitionAxes=by(),ae.finalizeSubplots=function(C,f){var x=f._subplots,A=x.xaxis,k=x.yaxis,I=x.cartesian,T=I,E={},_={},h,m,w;for(h=0;h0){var z=F.id;if(z.indexOf(o)!==-1)continue;z+=o+(h+1),F=S.extendFlat({},F,{id:z,plot:k._cartesianlayer.selectAll(".subplot").select("."+z)})}for(var U=[],V,G=0;G1&&(ee+=o+W),H.push(E+ee),T=0;T<_.overlays.length;T++)H.push(_.overlays[T].id+ee)}H=H.concat([h.layer,m.layer,h.overlaying||"",m.overlaying||""]),O.push(H)}return O}function d(C,f){var x=C._fullLayout,A=f.plotgroup,k=f.id,I=k.indexOf(o),T=I!==-1,E=a.layerValue2layerClass[f.xaxis.layer],_=a.layerValue2layerClass[f.yaxis.layer],h=x._hasOnlyLargeSploms,m=x._zindices.length>1,w=f.mainplotinfo;if(!f.mainplot||m)if(h)f.xlines=i(A,"path","xlines-above"),f.ylines=i(A,"path","ylines-above"),f.xaxislayer=i(A,"g","xaxislayer-above"),f.yaxislayer=i(A,"g","yaxislayer-above");else{if(!T){var F=i(A,"g","layer-subplot");f.shapelayer=i(F,"g","shapelayer"),f.imagelayer=i(F,"g","imagelayer"),w&&m?(f.minorGridlayer=w.minorGridlayer,f.gridlayer=w.gridlayer,f.zerolinelayer=w.zerolinelayer):(f.minorGridlayer=i(A,"g","minor-gridlayer"),f.gridlayer=i(A,"g","gridlayer"),f.zerolinelayer=i(A,"g","zerolinelayer"));var z=i(A,"g","layer-between");f.shapelayerBetween=i(z,"g","shapelayer"),f.imagelayerBetween=i(z,"g","imagelayer"),i(A,"path","xlines-below"),i(A,"path","ylines-below"),f.overlinesBelow=i(A,"g","overlines-below"),i(A,"g","xaxislayer-below"),i(A,"g","yaxislayer-below"),f.overaxesBelow=i(A,"g","overaxes-below")}f.overplot=i(A,"g","overplot"),f.plot=i(f.overplot,"g",k),w&&m?f.zerolinelayerAbove=w.zerolinelayerAbove:f.zerolinelayerAbove=i(A,"g","zerolinelayer-above"),T||(f.xlines=i(A,"path","xlines-above"),f.ylines=i(A,"path","ylines-above"),f.overlinesAbove=i(A,"g","overlines-above"),i(A,"g","xaxislayer-above"),i(A,"g","yaxislayer-above"),f.overaxesAbove=i(A,"g","overaxes-above"),f.xlines=A.select(".xlines-"+E),f.ylines=A.select(".ylines-"+_),f.xaxislayer=A.select(".xaxislayer-"+E),f.yaxislayer=A.select(".yaxislayer-"+_))}else{var U=w.plotgroup,V=k+"-x",G=k+"-y";f.minorGridlayer=w.minorGridlayer,f.gridlayer=w.gridlayer,f.zerolinelayer=w.zerolinelayer,f.zerolinelayerAbove=w.zerolinelayerAbove,i(w.overlinesBelow,"path",V),i(w.overlinesBelow,"path",G),i(w.overaxesBelow,"g",V),i(w.overaxesBelow,"g",G),f.plot=i(w.overplot,"g",k),i(w.overlinesAbove,"path",V),i(w.overlinesAbove,"path",G),i(w.overaxesAbove,"g",V),i(w.overaxesAbove,"g",G),f.xlines=U.select(".overlines-"+E).select("."+V),f.ylines=U.select(".overlines-"+_).select("."+G),f.xaxislayer=U.select(".overaxes-"+E).select("."+V),f.yaxislayer=U.select(".overaxes-"+_).select("."+G)}T||(h||(s(f.minorGridlayer,"g",f.xaxis._id),s(f.minorGridlayer,"g",f.yaxis._id),f.minorGridlayer.selectAll("g").map(function(j){return j[0]}).sort(r.idSort),s(f.gridlayer,"g",f.xaxis._id),s(f.gridlayer,"g",f.yaxis._id),f.gridlayer.selectAll("g").map(function(j){return j[0]}).sort(r.idSort)),f.xlines.style("fill","none").classed("crisp",!0),f.ylines.style("fill","none").classed("crisp",!0))}function y(C,f){if(C){var x={};C.each(function(_){var h=_[0],m=K.select(this);m.remove(),g(h,f),x[h]=!0});for(var A in f._plots)for(var k=f._plots[A],I=k.overlays||[],T=0;T=0,f=s.indexOf("end")>=0,x=p.backoff*y+o.standoff,A=d.backoff*g+o.startstandoff,k,I,T,E;if(c.nodeName==="line"){k={x:+i.attr("x1"),y:+i.attr("y1")},I={x:+i.attr("x2"),y:+i.attr("y2")};var _=k.x-I.x,h=k.y-I.y;if(T=Math.atan2(h,_),E=T+Math.PI,x&&A&&x+A>Math.sqrt(_*_+h*h)){ee();return}if(x){if(x*x>_*_+h*h){ee();return}var m=x*Math.cos(T),w=x*Math.sin(T);I.x+=m,I.y+=w,i.attr({x2:I.x,y2:I.y})}if(A){if(A*A>_*_+h*h){ee();return}var F=A*Math.cos(T),z=A*Math.sin(T);k.x-=F,k.y-=z,i.attr({x1:k.x,y1:k.y})}}else if(c.nodeName==="path"){var U=c.getTotalLength(),V="";if(U2/3?ra="right":ra="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[ra]}for(var _t=!1,At=["x","y"],vt=0;vt1)&&(fr===Qt?(ct=mr.r2fraction(A["a"+Kt]),(ct<0||ct>1)&&(_t=!0)):_t=!0),ut=mr._offset+mr.r2p(A[Kt]),ke=.5}else{var Gt=at==="domain";Kt==="x"?(Ie=A[Kt],ut=Gt?mr._offset+mr._length*Ie:ut=h.l+h.w*Ie):(Ie=1-A[Kt],ut=Gt?mr._offset+mr._length*Ie:ut=h.t+h.h*Ie),ke=A.showarrow?.5:Ie}if(A.showarrow){et.head=ut;var Vt=A["a"+Kt];if(Fe=Br*Je(.5,A.xanchor)-fn*Je(.5,A.yanchor),fr===Qt){var Zt=r.getRefType(fr);Zt==="domain"?(Kt==="y"&&(Vt=1-Vt),et.tail=mr._offset+mr._length*Vt):Zt==="paper"?Kt==="y"?(Vt=1-Vt,et.tail=h.t+h.h*Vt):et.tail=h.l+h.w*Vt:et.tail=mr._offset+mr.r2p(Vt),Be=Fe}else et.tail=ut+Vt,Be=Fe+Vt;et.text=et.tail+Fe;var ur=_[Kt==="x"?"width":"height"];if(Qt==="paper"&&(et.head=L.constrain(et.head,1,ur-1)),fr==="pixel"){var Dr=-Math.max(et.tail-3,et.text),kr=Math.min(et.tail+3,et.text)-ur;Dr>0?(et.tail+=Dr,et.text+=Dr):kr>0&&(et.tail-=kr,et.text-=kr)}et.tail+=Bt,et.head+=Bt}else Fe=Fr*Je(ke,Qr),Be=Fe,et.text=ut+Fe;et.text+=Bt,Fe+=Bt,Be+=Bt,A["_"+Kt+"padplus"]=Fr/2+Be,A["_"+Kt+"padminus"]=Fr/2-Be,A["_"+Kt+"size"]=Fr,A["_"+Kt+"shift"]=Fe}if(_t){_e.remove();return}var Sr=0,Jr=0;if(A.align!=="left"&&(Sr=(ht-bt)*(A.align==="center"?.5:1)),A.valign!=="top"&&(Jr=(Ve-mt)*(A.valign==="middle"?.5:1)),it)Xe.select("svg").attr({x:ce+Sr-1,y:ce+Jr}).call(l.setClipUrl,ye?j:null,x);else{var jn=ce+Jr-yt.top,ha=ce+Sr-yt.left;pe.call(s.positionText,ha,jn).call(l.setClipUrl,ye?j:null,x)}le.select("rect").call(l.setRect,ce,ce,ht,Ve),ne.call(l.setRect,Y/2,Y/2,ze-Y,Se-Y),_e.call(l.setTranslate,Math.round(O.x.text-ze/2),Math.round(O.y.text-Se/2)),ee.attr({transform:"rotate("+H+","+O.x.text+","+O.y.text+")"});var oa=function(xa,ra){W.selectAll(".annotation-arrow-g").remove();var Ha=O.x.head,ci=O.y.head,_r=O.x.tail+xa,rr=O.y.tail+ra,yr=O.x.text+xa,br=O.y.text+ra,an=L.rotationXYMatrix(H,yr,br),bn=L.apply2DTransform(an),In=L.apply2DTransform2(an),Fn=+ne.attr("width"),va=+ne.attr("height"),Pa=yr-.5*Fn,La=Pa+Fn,Oa=br-.5*va,Wa=Oa+va,sa=[[Pa,Oa,Pa,Wa],[Pa,Wa,La,Wa],[La,Wa,La,Oa],[La,Oa,Pa,Oa]].map(In);if(!sa.reduce(function(Nt,xr){return Nt^!!L.segmentsIntersect(Ha,ci,Ha+1e6,ci+1e6,xr[0],xr[1],xr[2],xr[3])},!1)){sa.forEach(function(Nt){var xr=L.segmentsIntersect(_r,rr,Ha,ci,Nt[0],Nt[1],Nt[2],Nt[3]);xr&&(_r=xr.x,rr=xr.y)});var ji=A.arrowwidth,Qi=A.arrowcolor,Xt=A.arrowside,Lt=W.append("g").style({opacity:a.opacity(Qi)}).classed("annotation-arrow-g",!0),$r=Lt.append("path").attr("d","M"+_r+","+rr+"L"+Ha+","+ci).style("stroke-width",ji+"px").call(a.stroke,a.rgb(Qi));if(d($r,Xt,A),m.annotationPosition&&$r.node().parentNode&&!I){var en=Ha,rn=ci;if(A.standoff){var Wr=Math.sqrt(Math.pow(Ha-_r,2)+Math.pow(ci-rr,2));en+=A.standoff*(_r-Ha)/Wr,rn+=A.standoff*(rr-ci)/Wr}var tn=Lt.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(_r-en)+","+(rr-rn),transform:t(en,rn)}).style("stroke-width",ji+6+"px").call(a.stroke,"rgba(0,0,0,0)").call(a.fill,"rgba(0,0,0,0)"),wn,dn;c.init({element:tn.node(),gd:x,prepFn:function(){var Nt=l.getTranslate(_e);wn=Nt.x,dn=Nt.y,T&&T.autorange&&U(T._name+".autorange",!0),E&&E.autorange&&U(E._name+".autorange",!0)},moveFn:function(Nt,xr){var Xr=bn(wn,dn),Tn=Xr[0]+Nt,Xn=Xr[1]+xr;_e.call(l.setTranslate,Tn,Xn),V("x",C(T,Nt,"x",h,A)),V("y",C(E,xr,"y",h,A)),A.axref===A.xref&&V("ax",C(T,Nt,"ax",h,A)),A.ayref===A.yref&&V("ay",C(E,xr,"ay",h,A)),Lt.attr("transform",t(Nt,xr)),ee.attr({transform:"rotate("+H+","+Tn+","+Xn+")"})},doneFn:function(){S.call("_guiRelayout",x,G());var Nt=document.querySelector(".js-notes-box-panel");Nt&&Nt.redraw(Nt.selectedObj)}})}}};if(A.showarrow&&oa(0,0),ue){var _a;c.init({element:_e.node(),gd:x,prepFn:function(){_a=ee.attr("transform")},moveFn:function(xa,ra){var Ha="pointer";if(A.showarrow)A.axref===A.xref?V("ax",C(T,xa,"ax",h,A)):V("ax",A.ax+xa),A.ayref===A.yref?V("ay",C(E,ra,"ay",h.w,A)):V("ay",A.ay+ra),oa(xa,ra);else{if(I)return;var ci,_r;if(T)ci=C(T,xa,"x",h,A);else{var rr=A._xsize/h.w,yr=A.x+(A._xshift-A.xshift)/h.w-rr/2;ci=c.align(yr+xa/h.w,rr,0,1,A.xanchor)}if(E)_r=C(E,ra,"y",h,A);else{var br=A._ysize/h.h,an=A.y-(A._yshift+A.yshift)/h.h-br/2;_r=c.align(an-ra/h.h,br,0,1,A.yanchor)}V("x",ci),V("y",_r),(!T||!E)&&(Ha=c.getCursor(T?.5:ci,E?.5:_r,A.xanchor,A.yanchor))}ee.attr({transform:t(xa,ra)+_a}),o(_e,Ha)},clickFn:function(xa,ra){A.captureevents&&x.emit("plotly_clickannotation",ge(ra))},doneFn:function(){o(_e),S.call("_guiRelayout",x,G());var xa=document.querySelector(".js-notes-box-panel");xa&&xa.redraw(xa.selectedObj)}})}}m.annotationText?pe.call(s.makeEditable,{delegate:_e,gd:x}).call(Te).on("edit",function($e){A.text=$e,this.call(Te),V("text",$e),T&&T.autorange&&U(T._name+".autorange",!0),E&&E.autorange&&U(E._name+".autorange",!0),S.call("_guiRelayout",x,G())}):pe.call(Te)}}}),ES=Re({"src/components/annotations/click.js"(ae,K){var v=Rn(),S=es(),M=Bu().arrayEditor;K.exports={hasClickToShow:L,onClick:t};function L(l,i){var s=r(l,i);return s.on.length>0||s.explicitOff.length>0}function t(l,i){var s=r(l,i),o=s.on,c=s.off.concat(s.explicitOff),p={},d=l._fullLayout.annotations,y,g;if(o.length||c.length){for(y=0;y1){o=!0;break}}o?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+i+'"]').remove():(s._pdata=S(t.glplot.cameraParams,[r.xaxis.r2l(s.x)*a[0],r.yaxis.r2l(s.y)*a[1],r.zaxis.r2l(s.z)*a[2]]),v(t.graphDiv,s,i,t.id,s._xa,s._ya))}}}}),R1=Re({"src/components/annotations3d/index.js"(ae,K){var v=es(),S=Rn();K.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Tg()}}},layoutAttributes:Tg(),handleDefaults:kS(),includeBasePlot:M,convert:MS(),draw:c3()};function M(L,t){var r=v.subplotsRegistry.gl3d;if(r)for(var a=r.attrRegex,l=Object.keys(L),i=0;i0?f+y:y;return{ppad:y,ppadplus:g?A:k,ppadminus:g?k:A}}else return{ppad:y}}function l(i,s,o){var c=i._id.charAt(0)==="x"?"x":"y",p=i.type==="category"||i.type==="multicategory",d,y,g=0,C=0,f=p?i.r2c:i.d2c,x=s[c+"sizemode"]==="scaled";if(x?(d=s[c+"0"],y=s[c+"1"],p&&(g=s[c+"0shift"],C=s[c+"1shift"])):(d=s[c+"anchor"],y=s[c+"anchor"]),d!==void 0)return[f(d)+g,f(y)+C];if(s.path){var A=1/0,k=-1/0,I=s.path.match(M.segmentRE),T,E,_,h,m;for(i.type==="date"&&(f=L.decodeDate(f)),T=0;Tk&&(k=m)));if(k>=A)return[A,k]}}}}),HD=Re({"src/components/shapes/index.js"(ae,K){var v=S1();K.exports={moduleType:"component",name:"shapes",layoutAttributes:Pp(),supplyLayoutDefaults:f3(),supplyDrawNewShapeDefaults:lM(),includeBasePlot:Ob()("shapes"),calcAutorange:qD(),draw:v.draw,drawOne:v.drawOne}}}),uM=Re({"src/components/images/attributes.js"(ae,K){var v=qh(),S=Bu().templatedArray;yy(),K.exports=S("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",v.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",v.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),Wd=Re({"src/components/images/defaults.js"(ae,K){var v=Rn(),S=js(),M=fp(),L=uM(),t="images";K.exports=function(l,i){var s={name:t,handleItemDefaults:r};M(l,i,s)};function r(a,l,i){function s(x,A){return v.coerce(a,l,L,x,A)}var o=s("source"),c=s("visible",!!o);if(!c)return l;s("layer"),s("xanchor"),s("yanchor"),s("sizex"),s("sizey"),s("sizing"),s("opacity");for(var p={_fullLayout:i},d=["x","y"],y=0;y<2;y++){var g=d[y],C=S.coerceRef(a,l,p,g,"paper",void 0);if(C!=="paper"){var f=S.getFromId(p,C);f._imgIndices.push(l._index)}S.coercePosition(l,p,s,C,g,0)}return l}}}),IS=Re({"src/components/images/draw.js"(ae,K){var v=un(),S=qs(),M=js(),L=fh(),t=jv();K.exports=function(a){var l=a._fullLayout,i=[],s={},o=[],c,p;for(p=0;p0);d&&(c("active"),c("direction"),c("type"),c("showactive"),c("x"),c("y"),v.noneOrAll(i,s,["x","y"]),c("xanchor"),c("yanchor"),c("pad.t"),c("pad.r"),c("pad.b"),c("pad.l"),v.coerceFont(c,"font",o.font),c("bgcolor",o.paper_bgcolor),c("bordercolor"),c("borderwidth"))}function l(i,s){function o(p,d){return v.coerce(i,s,r,p,d)}var c=o("visible",i.method==="skip"||Array.isArray(i.args));c&&(o("method"),o("args"),o("args2"),o("label"),o("execute"))}}}),WD=Re({"src/components/updatemenus/scrollbox.js"(ae,K){K.exports=t;var v=un(),S=ko(),M=qs(),L=Rn();function t(r,a,l){this.gd=r,this.container=a,this.id=l,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}t.barWidth=2,t.barLength=20,t.barRadius=2,t.barPad=1,t.barColor="#808BA4",t.prototype.enable=function(a,l,i){var s=this.gd._fullLayout,o=s.width,c=s.height;this.position=a;var p=this.position.l,d=this.position.w,y=this.position.t,g=this.position.h,C=this.position.direction,f=C==="down",x=C==="left",A=C==="right",k=C==="up",I=d,T=g,E,_,h,m;!f&&!x&&!A&&!k&&(this.position.direction="down",f=!0);var w=f||k;w?(E=p,_=E+I,f?(h=y,m=Math.min(h+T,c),T=m-h):(m=y+T,h=Math.max(m-T,0),T=m-h)):(h=y,m=h+T,x?(_=p+I,E=Math.max(_-I,0),I=_-E):(E=p,_=Math.min(E+I,o),I=_-E)),this._box={l:E,t:h,w:I,h:T};var F=d>I,z=t.barLength+2*t.barPad,U=t.barWidth+2*t.barPad,V=p,G=y+g;G+U>c&&(G=c-U);var j=this.container.selectAll("rect.scrollbar-horizontal").data(F?[0]:[]);j.exit().on(".drag",null).remove(),j.enter().append("rect").classed("scrollbar-horizontal",!0).call(S.fill,t.barColor),F?(this.hbar=j.attr({rx:t.barRadius,ry:t.barRadius,x:V,y:G,width:z,height:U}),this._hbarXMin=V+z/2,this._hbarTranslateMax=I-z):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=g>T,H=t.barWidth+2*t.barPad,W=t.barLength+2*t.barPad,ee=p+d,ue=y;ee+H>o&&(ee=o-H);var xe=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);xe.exit().on(".drag",null).remove(),xe.enter().append("rect").classed("scrollbar-vertical",!0).call(S.fill,t.barColor),O?(this.vbar=xe.attr({rx:t.barRadius,ry:t.barRadius,x:ee,y:ue,width:H,height:W}),this._vbarYMin=ue+W/2,this._vbarTranslateMax=T-W):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var ge=this.id,_e=E-.5,Y=O?_+H+.5:_+.5,se=h-.5,ce=F?m+U+.5:m+.5,ne=s._topdefs.selectAll("#"+ge).data(F||O?[0]:[]);if(ne.exit().remove(),ne.enter().append("clipPath").attr("id",ge).append("rect"),F||O?(this._clipRect=ne.select("rect").attr({x:Math.floor(_e),y:Math.floor(se),width:Math.ceil(Y)-Math.floor(_e),height:Math.ceil(ce)-Math.floor(se)}),this.container.call(M.setClipUrl,ge,this.gd),this.bg.attr({x:p,y,width:d,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(M.setClipUrl,null),delete this._clipRect),F||O){var ye=v.behavior.drag().on("dragstart",function(){v.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(ye);var le=v.behavior.drag().on("dragstart",function(){v.event.sourceEvent.preventDefault(),v.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));F&&this.hbar.on(".drag",null).call(le),O&&this.vbar.on(".drag",null).call(le)}this.setTranslate(l,i)},t.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(M.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)},t.prototype._onBoxDrag=function(){var a=this.translateX,l=this.translateY;this.hbar&&(a-=v.event.dx),this.vbar&&(l-=v.event.dy),this.setTranslate(a,l)},t.prototype._onBoxWheel=function(){var a=this.translateX,l=this.translateY;this.hbar&&(a+=v.event.deltaY),this.vbar&&(l+=v.event.deltaY),this.setTranslate(a,l)},t.prototype._onBarDrag=function(){var a=this.translateX,l=this.translateY;if(this.hbar){var i=a+this._hbarXMin,s=i+this._hbarTranslateMax,o=L.constrain(v.event.x,i,s),c=(o-i)/(s-i),p=this.position.w-this._box.w;a=c*p}if(this.vbar){var d=l+this._vbarYMin,y=d+this._vbarTranslateMax,g=L.constrain(v.event.y,d,y),C=(g-d)/(y-d),f=this.position.h-this._box.h;l=C*f}this.setTranslate(a,l)},t.prototype.setTranslate=function(a,l){var i=this.position.w-this._box.w,s=this.position.h-this._box.h;if(a=L.constrain(a||0,0,i),l=L.constrain(l||0,0,s),this.translateX=a,this.translateY=l,this.container.call(M.setTranslate,this._box.l-this.position.l-a,this._box.t-this.position.t-l),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+a-.5),y:Math.floor(this.position.t+l-.5)}),this.hbar){var o=a/i;this.hbar.call(M.setTranslate,a+o*this._hbarTranslateMax,l)}if(this.vbar){var c=l/s;this.vbar.call(M.setTranslate,a,l+c*this._vbarTranslateMax)}}}}),cM=Re({"src/components/updatemenus/draw.js"(ae,K){var v=un(),S=If(),M=ko(),L=qs(),t=Rn(),r=kc(),a=Bu().arrayEditor,l=qd().LINE_SPACING,i=Vb(),s=WD();K.exports=function(z){var U=z._fullLayout,V=t.filterVisible(U[i.name]);function G(ge){S.autoMargin(z,h(ge))}var j=U._menulayer.selectAll("g."+i.containerClassName).data(V.length>0?[0]:[]);if(j.enter().append("g").classed(i.containerClassName,!0).style("cursor","pointer"),j.exit().each(function(){v.select(this).selectAll("g."+i.headerGroupClassName).each(G)}).remove(),V.length!==0){var O=j.selectAll("g."+i.headerGroupClassName).data(V,o);O.enter().append("g").classed(i.headerGroupClassName,!0);for(var H=t.ensureSingle(j,"g",i.dropdownButtonGroupClassName,function(ge){ge.style("pointer-events","all")}),W=0;W0?[0]:[]);ee.enter().append("g").classed(i.containerClassName,!0).style("cursor",O?null:"ew-resize");function ue(Y){Y._commandObserver&&(Y._commandObserver.remove(),delete Y._commandObserver),S.autoMargin(j,d(Y))}if(ee.exit().each(function(){v.select(this).selectAll("g."+i.groupClassName).each(ue)}).remove(),W.length!==0){var xe=ee.selectAll("g."+i.groupClassName).data(W,g);xe.enter().append("g").classed(i.groupClassName,!0),xe.exit().each(ue).remove();for(var ge=0;ge0&&(xe=xe.transition().duration(j.transition.duration).ease(j.transition.easing)),xe.attr("transform",r(ue-i.gripWidth*.5,j._dims.currentValueTotalHeight))}}function F(G,j){var O=G._dims;return O.inputAreaStart+i.stepInset+(O.inputAreaLength-2*i.stepInset)*Math.min(1,Math.max(0,j))}function z(G,j){var O=G._dims;return Math.min(1,Math.max(0,(j-i.stepInset-O.inputAreaStart)/(O.inputAreaLength-2*i.stepInset-2*O.inputAreaStart)))}function U(G,j,O){var H=O._dims,W=t.ensureSingle(G,"rect",i.railTouchRectClass,function(ee){ee.call(_,j,G,O).style("pointer-events","all")});W.attr({width:H.inputAreaLength,height:Math.max(H.inputAreaWidth,i.tickOffset+O.ticklen+H.labelHeight)}).call(M.fill,O.bgcolor).attr("opacity",0),L.setTranslate(W,0,H.currentValueTotalHeight)}function V(G,j){var O=j._dims,H=O.inputAreaLength-i.railInset*2,W=t.ensureSingle(G,"rect",i.railRectClass);W.attr({width:H,height:i.railWidth,rx:i.railRadius,ry:i.railRadius,"shape-rendering":"crispEdges"}).call(M.stroke,j.bordercolor).call(M.fill,j.bgcolor).style("stroke-width",j.borderwidth+"px"),L.setTranslate(W,i.railInset,(O.inputAreaWidth-i.railWidth)*.5+O.currentValueTotalHeight)}}}),fM=Re({"src/components/sliders/index.js"(ae,K){var v=jb();K.exports={moduleType:"component",name:v.name,layoutAttributes:Ty(),supplyLayoutDefaults:LS(),draw:h3()}}}),Ay=Re({"src/components/rangeslider/attributes.js"(ae,K){var v=du();K.exports={bgcolor:{valType:"color",dflt:v.background,editType:"plot"},bordercolor:{valType:"color",dflt:v.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),d3=Re({"src/components/rangeslider/oppaxis_attributes.js"(ae,K){K.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),W_=Re({"src/components/rangeslider/constants.js"(ae,K){K.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),p3=Re({"src/components/rangeslider/helpers.js"(ae){var K=fh(),v=kc(),S=W_(),M=qd().LINE_SPACING,L=S.name;function t(r){var a=r&&r[L];return a&&a.visible}ae.isVisible=t,ae.makeData=function(r){for(var a=K.list({_fullLayout:r},"x",!0),l=r.margin,i=[],s=0;s=bt.max)it=Te[yt+1];else if(Xe=bt.pmax)it=Te[yt+1];else if(Xe0?_.touches[0].clientX:0}function y(_,h,m,w){if(h._context.staticPlot)return;var F=_.select("rect."+p.slideBoxClassName).node(),z=_.select("rect."+p.grabAreaMinClassName).node(),U=_.select("rect."+p.grabAreaMaxClassName).node();function V(){var G=v.event,j=G.target,O=d(G),H=O-_.node().getBoundingClientRect().left,W=w.d2p(m._rl[0]),ee=w.d2p(m._rl[1]),ue=o.coverSlip();this.addEventListener("touchmove",xe),this.addEventListener("touchend",ge),ue.addEventListener("mousemove",xe),ue.addEventListener("mouseup",ge);function xe(_e){var Y=d(_e),se=+Y-O,ce,ne,ye;switch(j){case F:if(ye="ew-resize",W+se>m._length||ee+se<0)return;ce=W+se,ne=ee+se;break;case z:if(ye="col-resize",W+se>m._length)return;ce=W+se,ne=ee;break;case U:if(ye="col-resize",ee+se<0)return;ce=W,ne=ee+se;break;default:ye="ew-resize",ce=H,ne=H+se;break}if(ne0);if(x){var A=l(o,c,p);C("x",A[0]),C("y",A[1]),v.noneOrAll(s,o,["x","y"]),C("xanchor"),C("yanchor"),v.coerceFont(C,"font",c.font);var k=C("bgcolor");C("activecolor",S.contrast(k,r.lightAmount,r.darkAmount)),C("bordercolor"),C("borderwidth")}};function a(i,s,o,c){var p=c.calendar;function d(C,f){return v.coerce(i,s,t.buttons,C,f)}var y=d("visible");if(y){var g=d("step");g!=="all"&&(p&&p!=="gregorian"&&(g==="month"||g==="year")?s.stepmode="backward":d("stepmode"),d("count")),d("label")}}function l(i,s,o){for(var c=o.filter(function(g){return s[g].anchor===i._id}),p=0,d=0;d1)){delete p.grid;return}if(!C&&!f&&!x){var m=E("pattern")==="independent";m&&(C=!0)}T._hasSubplotGrid=C;var w=E("roworder"),F=w==="top to bottom",z=C?.2:.1,U=C?.3:.1,V,G;A&&p._splomGridDflt&&(V=p._splomGridDflt.xside,G=p._splomGridDflt.yside),T._domains={x:i("x",E,z,V,h),y:i("y",E,U,G,_,F)}}function i(c,p,d,y,g,C){var f=p(c+"gap",d),x=p("domain."+c);p(c+"side",y);for(var A=new Array(g),k=x[0],I=(x[1]-k)/(g-f),T=I*(1-f),E=0;E0,y=a._context.staticPlot;l.each(function(g){var C=g[0].trace,f=C.error_x||{},x=C.error_y||{},A;C.ids&&(A=function(E){return E.id});var k=L.hasMarkers(C)&&C.marker.maxdisplayed>0;!x.visible&&!f.visible&&(g=[]);var I=v.select(this).selectAll("g.errorbar").data(g,A);if(I.exit().remove(),!!g.length){f.visible||I.selectAll("path.xerror").remove(),x.visible||I.selectAll("path.yerror").remove(),I.style("opacity",1);var T=I.enter().append("g").classed("errorbar",!0);d&&T.style("opacity",0).transition().duration(s.duration).style("opacity",1),M.setClipUrl(I,i.layerClipId,a),I.each(function(E){var _=v.select(this),h=t(E,c,p);if(!(k&&!E.vis)){var m,w=_.select("path.yerror");if(x.visible&&S(h.x)&&S(h.yh)&&S(h.ys)){var F=x.width;m="M"+(h.x-F)+","+h.yh+"h"+2*F+"m-"+F+",0V"+h.ys,h.noYS||(m+="m-"+F+",0h"+2*F),o=!w.size(),o?w=_.append("path").style("vector-effect",y?"none":"non-scaling-stroke").classed("yerror",!0):d&&(w=w.transition().duration(s.duration).ease(s.easing)),w.attr("d",m)}else w.remove();var z=_.select("path.xerror");if(f.visible&&S(h.y)&&S(h.xh)&&S(h.xs)){var U=(f.copy_ystyle?x:f).width;m="M"+h.xh+","+(h.y-U)+"v"+2*U+"m0,-"+U+"H"+h.xs,h.noXS||(m+="m0,-"+U+"v"+2*U),o=!z.size(),o?z=_.append("path").style("vector-effect",y?"none":"non-scaling-stroke").classed("xerror",!0):d&&(z=z.transition().duration(s.duration).ease(s.easing)),z.attr("d",m)}else z.remove()}})}})};function t(r,a,l){var i={x:a.c2p(r.x),y:l.c2p(r.y)};return r.yh!==void 0&&(i.yh=l.c2p(r.yh),i.ys=l.c2p(r.ys),S(i.ys)||(i.noYS=!0,i.ys=l.c2p(r.ys,!0))),r.xh!==void 0&&(i.xh=a.c2p(r.xh),i.xs=a.c2p(r.xs),S(i.xs)||(i.noXS=!0,i.xs=a.c2p(r.xs,!0))),i}}}),Ey=Re({"src/components/errorbars/style.js"(ae,K){var v=un(),S=ko();K.exports=function(L){L.each(function(t){var r=t[0].trace,a=r.error_y||{},l=r.error_x||{},i=v.select(this);i.selectAll("path.yerror").style("stroke-width",a.thickness+"px").call(S.stroke,a.color),l.copy_ystyle&&(l=a),i.selectAll("path.xerror").style("stroke-width",l.thickness+"px").call(S.stroke,l.color)})}}}),Cy=Re({"src/components/errorbars/index.js"(ae,K){var v=Rn(),S=bf().overrideAll,M=Sy(),L={error_x:v.extendFlat({},M),error_y:v.extendFlat({},M)};delete L.error_x.copy_zstyle,delete L.error_y.copy_zstyle,delete L.error_y.copy_ystyle;var t={error_x:v.extendFlat({},M),error_y:v.extendFlat({},M),error_z:v.extendFlat({},M)};delete t.error_x.copy_ystyle,delete t.error_y.copy_ystyle,delete t.error_z.copy_ystyle,delete t.error_z.copy_zstyle,K.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:L,bar:L,histogram:L,scatter3d:S(t,"calc","nested"),scattergl:S(L,"calc","nested")}},supplyDefaults:pM(),calc:PS(),makeComputeError:N0(),plot:zS(),style:Ey(),hoverInfo:r};function r(a,l,i){(l.error_y||{}).visible&&(i.yerr=a.yh-a.y,l.error_y.symmetric||(i.yerrneg=a.y-a.ys)),(l.error_x||{}).visible&&(i.xerr=a.xh-a.x,l.error_x.symmetric||(i.xerrneg=a.x-a.xs))}}}),Hb=Re({"src/components/colorbar/constants.js"(ae,K){K.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),NS=Re({"src/components/colorbar/draw.js"(ae,K){var v=un(),S=oo(),M=If(),L=es(),t=js(),r=fv(),a=Rn(),l=a.strTranslate,i=Li().extendFlat,s=mg(),o=qs(),c=ko(),p=vy(),d=kc(),y=cp().flipScale,g=wg(),C=qv(),f=Hd(),x=qd(),A=x.LINE_SPACING,k=x.FROM_TL,I=x.FROM_BR,T=Hb().cn;function E(z){var U=z._fullLayout,V=U._infolayer.selectAll("g."+T.colorbar).data(_(z),function(G){return G._id});V.enter().append("g").attr("class",function(G){return G._id}).classed(T.colorbar,!0),V.each(function(G){var j=v.select(this);a.ensureSingle(j,"rect",T.cbbg),a.ensureSingle(j,"g",T.cbfills),a.ensureSingle(j,"g",T.cblines),a.ensureSingle(j,"g",T.cbaxis,function(H){H.classed(T.crisp,!0)}),a.ensureSingle(j,"g",T.cbtitleunshift,function(H){H.append("g").classed(T.cbtitle,!0)}),a.ensureSingle(j,"rect",T.cboutline);var O=h(j,G,z);O&&O.then&&(z._promises||[]).push(O),z._context.edits.colorbarPosition&&m(j,G,z)}),V.exit().each(function(G){M.autoMargin(z,G._id)}).remove(),V.order()}function _(z){var U=z._fullLayout,V=z.calcdata,G=[],j,O,H,W;function ee(Z){return i(Z,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function ue(){typeof W.calc=="function"?W.calc(z,H,j):(j._fillgradient=O.reversescale?y(O.colorscale):O.colorscale,j._zrange=[O[W.min],O[W.max]])}for(var xe=0;xe1){var et=Math.pow(10,Math.floor(Math.log(Bt)/Math.LN10));Fr*=et*a.roundUp(Bt/et,[2,5,10]),(Math.abs(yt.start)/yt.size+1e-6)%1<2e-6&&(Br.tick0=0)}Br.dtick=Fr}Br.domain=G?[mr+se/de.h,mr+Je-se/de.h]:[mr+Y/de.w,mr+Je-Y/de.w],Br.setScale(),z.attr("transform",l(Math.round(de.l),Math.round(de.t)));var ut=z.select("."+T.cbtitleunshift).attr("transform",l(-Math.round(de.l),-Math.round(de.t))),Be=Br.ticklabelposition,Ie=Br.title.font.size,ke=z.select("."+T.cbaxis),Fe,at=0,ct=0;function Gt(kr,Sr){var Jr={propContainer:Br,propName:U._propPrefix+"title.text",traceIndex:U._traceIndex,_meta:U._meta,placeholder:Z._dfltTitle.colorbar,containerGroup:z.select("."+T.cbtitle)},jn=kr.charAt(0)==="h"?kr.slice(1):"h"+kr;z.selectAll("."+jn+",."+jn+"-math-group").remove(),p.draw(V,kr,i(Jr,Sr||{}))}function Vt(){if(G&&fn||!G&&!fn){var kr,Sr;$e==="top"&&(kr=Y+de.l+_t*ce,Sr=se+de.t+At*(1-mr-Je)+3+Ie*.75),$e==="bottom"&&(kr=Y+de.l+_t*ce,Sr=se+de.t+At*(1-mr)-3-Ie*.25),$e==="right"&&(Sr=se+de.t+At*ne+3+Ie*.75,kr=Y+de.l+_t*mr),Gt(Br._id+"title",{attributes:{x:kr,y:Sr,"text-anchor":G?"start":"middle"}})}}function Zt(){if(G&&!fn||!G&&fn){var kr=Br.position||0,Sr=Br._offset+Br._length/2,Jr,jn;if($e==="right")jn=Sr,Jr=de.l+_t*kr+10+Ie*(Br.showticklabels?1:.5);else if(Jr=Sr,$e==="bottom"&&(jn=de.t+At*kr+10+(Be.indexOf("inside")===-1?Br.tickfont.size:0)+(Br.ticks!=="inside"&&U.ticklen||0)),$e==="top"){var ha=Ne.text.split("
").length;jn=de.t+At*kr+10-Ve-A*Ie*ha}Gt((G?"h":"v")+Br._id+"title",{avoid:{selection:v.select(V).selectAll("g."+Br._id+"tick"),side:$e,offsetTop:G?0:de.t,offsetLeft:G?de.l:0,maxShift:G?Z.width:Z.height},attributes:{x:Jr,y:jn,"text-anchor":"middle"},transform:{rotate:G?-90:0,offset:0}})}}function ur(){if(!G&&!fn||G&&fn){var kr=z.select("."+T.cbtitle),Sr=kr.select("text"),Jr=[-ee/2,ee/2],jn=kr.select(".h"+Br._id+"title-math-group").node(),ha=15.6;Sr.node()&&(ha=parseInt(Sr.node().style.fontSize,10)*A);var oa;if(jn?(oa=o.bBox(jn),ct=oa.width,at=oa.height,at>ha&&(Jr[1]-=(at-ha)/2)):Sr.node()&&!Sr.classed(T.jsPlaceholder)&&(oa=o.bBox(Sr.node()),ct=oa.width,at=oa.height),G){if(at){if(at+=5,$e==="top")Br.domain[1]-=at/de.h,Jr[1]*=-1;else{Br.domain[0]+=at/de.h;var _a=d.lineCount(Sr);Jr[1]+=(1-_a)*ha}kr.attr("transform",l(Jr[0],Jr[1])),Br.setScale()}}else ct&&($e==="right"&&(Br.domain[0]+=(ct+Ie/2)/de.w),kr.attr("transform",l(Jr[0],Jr[1])),Br.setScale())}z.selectAll("."+T.cbfills+",."+T.cblines).attr("transform",G?l(0,Math.round(de.h*(1-Br.domain[1]))):l(Math.round(de.w*Br.domain[0]),0)),ke.attr("transform",G?l(0,Math.round(-de.t)):l(Math.round(-de.l),0));var xa=z.select("."+T.cbfills).selectAll("rect."+T.cbfill).attr("style","").data(mt);xa.enter().append("rect").classed(T.cbfill,!0).attr("style",""),xa.exit().remove();var ra=Ze.map(Br.c2p).map(Math.round).sort(function(yr,br){return yr-br});xa.each(function(yr,br){var an=[br===0?Ze[0]:(mt[br]+mt[br-1])/2,br===mt.length-1?Ze[1]:(mt[br]+mt[br+1])/2].map(Br.c2p).map(Math.round);G&&(an[1]=a.constrain(an[1]+(an[1]>an[0])?1:-1,ra[0],ra[1]));var bn=v.select(this).attr(G?"x":"y",vt).attr(G?"y":"x",v.min(an)).attr(G?"width":"height",Math.max(Ve,2)).attr(G?"height":"width",Math.max(v.max(an)-v.min(an),2));if(U._fillgradient)o.gradient(bn,V,U._id,G?"vertical":"horizontalreversed",U._fillgradient,"fill");else{var In=it(yr).replace("e-","");bn.attr("fill",S(In).toHexString())}});var Ha=z.select("."+T.cblines).selectAll("path."+T.cbline).data(Te.color&&Te.width?ht:[]);Ha.enter().append("path").classed(T.cbline,!0),Ha.exit().remove(),Ha.each(function(yr){var br=vt,an=Math.round(Br.c2p(yr))+Te.width/2%1;v.select(this).attr("d","M"+(G?br+","+an:an+","+br)+(G?"h":"v")+Ve).call(o.lineGroupStyle,Te.width,Xe(yr),Te.dash)}),ke.selectAll("g."+Br._id+"tick,path").remove();var ci=vt+Ve+(ee||0)/2-(U.ticks==="outside"?1:0),_r=t.calcTicks(Br),rr=t.getTickSigns(Br)[2];return t.drawTicks(V,Br,{vals:Br.ticks==="inside"?t.clipEnds(Br,_r):_r,layer:ke,path:t.makeTickPath(Br,ci,rr),transFn:t.makeTransTickFn(Br)}),t.drawLabels(V,Br,{vals:_r,layer:ke,transFn:t.makeTransTickLabelFn(Br),labelFns:t.makeLabelFns(Br,ci)})}function Dr(){var kr,Sr=Ve+ee/2;Be.indexOf("inside")===-1&&(kr=o.bBox(ke.node()),Sr+=G?kr.width:kr.height),Fe=ut.select("text");var Jr=0,jn=G&&$e==="top",ha=!G&&$e==="right",oa=0;if(Fe.node()&&!Fe.classed(T.jsPlaceholder)){var _a,xa=ut.select(".h"+Br._id+"title-math-group").node();xa&&(G&&fn||!G&&!fn)?(kr=o.bBox(xa),Jr=kr.width,_a=kr.height):(kr=o.bBox(ut.node()),Jr=kr.right-de.l-(G?vt:Ur),_a=kr.bottom-de.t-(G?Ur:vt),!G&&$e==="top"&&(Sr+=kr.height,oa=kr.height)),ha&&(Fe.attr("transform",l(Jr/2+Ie/2,0)),Jr*=2),Sr=Math.max(Sr,G?Jr:_a)}var ra=(G?Y:se)*2+Sr+ue+ee/2,Ha=0;!G&&Ne.text&&_e==="bottom"&&ne<=0&&(Ha=ra/2,ra+=Ha,oa+=Ha),Z._hColorbarMoveTitle=Ha,Z._hColorbarMoveCBTitle=oa;var ci=ue+ee,_r=(G?vt:Ur)-ci/2-(G?Y:0),rr=(G?Ur:vt)-(G?Se:se+oa-Ha);z.select("."+T.cbbg).attr("x",_r).attr("y",rr).attr(G?"width":"height",Math.max(ra-Ha,2)).attr(G?"height":"width",Math.max(Se+ci,2)).call(c.fill,xe).call(c.stroke,U.bordercolor).style("stroke-width",ue);var yr=ha?Math.max(Jr-10,0):0;z.selectAll("."+T.cboutline).attr("x",(G?vt:Ur+Y)+yr).attr("y",(G?Ur+se-Se:vt)+(jn?at:0)).attr(G?"width":"height",Math.max(Ve,2)).attr(G?"height":"width",Math.max(Se-(G?2*se+at:2*Y+yr),2)).call(c.stroke,U.outlinecolor).style({fill:"none","stroke-width":ee});var br=G?Kt*ra:0,an=G?0:(1-Qt)*ra-oa;if(br=le?de.l-br:-br,an=ye?de.t-an:-an,z.attr("transform",l(br,an)),!G&&(ue||S(xe).getAlpha()&&!S.equals(Z.paper_bgcolor,xe))){var bn=ke.selectAll("text"),In=bn[0].length,Fn=z.select("."+T.cbbg).node(),va=o.bBox(Fn),Pa=o.getTranslate(z),La=2;bn.each(function(rn,Wr){var tn=0,wn=In-1;if(Wr===tn||Wr===wn){var dn=o.bBox(this),Nt=o.getTranslate(this),xr;if(Wr===wn){var Xr=dn.right+Nt.x,Tn=va.right+Pa.x+Ur-ue-La+ce;xr=Tn-Xr,xr>0&&(xr=0)}else if(Wr===tn){var Xn=dn.left+Nt.x,ia=va.left+Pa.x+Ur+ue+La;xr=ia-Xn,xr<0&&(xr=0)}xr&&(In<3?this.setAttribute("transform","translate("+xr+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var Oa={},Wa=k[ge],sa=I[ge],ji=k[_e],Qi=I[_e],Xt=ra-Ve;G?(O==="pixels"?(Oa.y=ne,Oa.t=Se*ji,Oa.b=Se*Qi):(Oa.t=Oa.b=0,Oa.yt=ne+j*ji,Oa.yb=ne-j*Qi),W==="pixels"?(Oa.x=ce,Oa.l=ra*Wa,Oa.r=ra*sa):(Oa.l=Xt*Wa,Oa.r=Xt*sa,Oa.xl=ce-H*Wa,Oa.xr=ce+H*sa)):(O==="pixels"?(Oa.x=ce,Oa.l=Se*Wa,Oa.r=Se*sa):(Oa.l=Oa.r=0,Oa.xl=ce+j*Wa,Oa.xr=ce-j*sa),W==="pixels"?(Oa.y=1-ne,Oa.t=ra*ji,Oa.b=ra*Qi):(Oa.t=Xt*ji,Oa.b=Xt*Qi,Oa.yt=ne-H*ji,Oa.yb=ne+H*Qi));var Lt=U.y<.5?"b":"t",$r=U.x<.5?"l":"r";V._fullLayout._reservedMargin[U._id]={};var en={r:Z.width-_r-br,l:_r+Oa.r,b:Z.height-rr-an,t:rr+Oa.b};le&&ye?M.autoMargin(V,U._id,Oa):le?V._fullLayout._reservedMargin[U._id][Lt]=en[Lt]:ye||G?V._fullLayout._reservedMargin[U._id][$r]=en[$r]:V._fullLayout._reservedMargin[U._id][Lt]=en[Lt]}return a.syncOrAsync([M.previousPromises,Vt,ur,Zt,M.previousPromises,Dr],V)}function m(z,U,V){var G=U.orientation==="v",j=V._fullLayout,O=j._size,H,W,ee;r.init({element:z.node(),gd:V,prepFn:function(){H=z.attr("transform"),s(z)},moveFn:function(ue,xe){z.attr("transform",H+l(ue,xe)),W=r.align((G?U._uFrac:U._vFrac)+ue/O.w,G?U._thickFrac:U._lenFrac,0,1,U.xanchor),ee=r.align((G?U._vFrac:1-U._uFrac)-xe/O.h,G?U._lenFrac:U._thickFrac,0,1,U.yanchor);var ge=r.getCursor(W,ee,U.xanchor,U.yanchor);s(z,ge)},doneFn:function(){if(s(z),W!==void 0&&ee!==void 0){var ue={};ue[U._propPrefix+"x"]=W,ue[U._propPrefix+"y"]=ee,U._traceIndex!==void 0?L.call("_guiRestyle",V,ue,U._traceIndex):L.call("_guiRelayout",V,ue)}}})}function w(z,U,V){var G=U._levels,j=[],O=[],H,W,ee=G.end+G.size/100,ue=G.size,xe=1.001*V[0]-.001*V[1],ge=1.001*V[1]-.001*V[0];for(W=0;W<1e5&&(H=G.start+W*ue,!(ue>0?H>=ee:H<=ee));W++)H>xe&&H0?H>=ee:H<=ee));W++)H>V[0]&&H-1}K.exports=function(l,i){var s,o=l.data,c=l.layout,p=L([],o),d=L({},c,t(i.tileClass)),y=l._context||{};if(i.width&&(d.width=i.width),i.height&&(d.height=i.height),i.tileClass==="thumbnail"||i.tileClass==="themes__thumb"){d.annotations=[];var g=Object.keys(d);for(s=0;s=0)return y}else if(typeof y=="string"&&(y=y.trim(),y.slice(-1)==="%"&&v(y.slice(0,-1))&&(y=+y.slice(0,-1),y>=0)))return y+"%"}function d(y,g,C,f,x,A){A=A||{};var k=A.moduleHasSelected!==!1,I=A.moduleHasUnselected!==!1,T=A.moduleHasConstrain!==!1,E=A.moduleHasCliponaxis!==!1,_=A.moduleHasTextangle!==!1,h=A.moduleHasInsideanchor!==!1,m=!!A.hasPathbar,w=Array.isArray(x)||x==="auto",F=w||x==="inside",z=w||x==="outside";if(F||z){var U=s(f,"textfont",C.font),V=S.extendFlat({},U),G=y.textfont&&y.textfont.color,j=!G;if(j&&delete V.color,s(f,"insidetextfont",V),m){var O=S.extendFlat({},U);j&&delete O.color,s(f,"pathbar.textfont",O)}z&&s(f,"outsidetextfont",U),k&&f("selected.textfont.color"),I&&f("unselected.textfont.color"),T&&f("constraintext"),E&&f("cliponaxis"),_&&f("textangle"),f("texttemplate"),f("texttemplatefallback")}F&&h&&f("insidetextanchor")}K.exports={supplyDefaults:o,crossTraceDefaults:c,handleText:d,validateCornerradius:p}}}),US=Re({"src/traces/bar/layout_defaults.js"(ae,K){var v=es(),S=js(),M=Rn(),L=Hv(),t=Wv().validateCornerradius;K.exports=function(r,a,l){function i(k,I){return M.coerce(r,a,L,k,I)}for(var s=!1,o=!1,c=!1,p={},d=i("barmode"),y=d==="group",g=0;g0&&!p[f]&&(c=!0),p[f]=!0),C.visible&&C.type==="histogram"){var x=S.getFromId({_fullLayout:a},C[C.orientation==="v"?"xaxis":"yaxis"]);x.type!=="category"&&(o=!0)}}if(!s){delete a.barmode;return}d!=="overlay"&&i("barnorm"),i("bargap",o&&!c?0:.2),i("bargroupgap");var A=i("barcornerradius");a.barcornerradius=t(A)}}}),Ag=Re({"src/traces/bar/arrays_to_calcdata.js"(ae,K){var v=Rn();K.exports=function(M,L){for(var t=0;ta;if(!l)return L}return t!==void 0?t:M.dflt},ae.coerceColor=function(M,L,t){return v(L).isValid()?L:t!==void 0?t:M.dflt},ae.coerceEnumerated=function(M,L,t){return M.coerceNumber&&(L=+L),M.values.indexOf(L)!==-1?L:t!==void 0?t:M.dflt},ae.getValue=function(M,L){var t;return S(M)?L1||m.bargap===0&&m.bargroupgap===0&&!w[0].trace.marker.line.width)&&v.select(this).attr("shape-rendering","crispEdges")}),_.selectAll("g.points").each(function(w){var F=v.select(this),z=w[0].trace;p(F,z,E)}),t.getComponentMethod("errorbars","style")(_)}function p(E,_,h){M.pointStyle(E.selectAll("path"),_,h),d(E,_,h)}function d(E,_,h){E.selectAll("text").each(function(m){var w=v.select(this),F=L.ensureUniformFontSize(h,f(w,m,_,h));M.font(w,F)})}function y(E,_,h){var m=_[0].trace;m.selectedpoints?g(h,m,E):(p(h,m,E),t.getComponentMethod("errorbars","style")(h))}function g(E,_,h){M.selectedPointStyle(E.selectAll("path"),_),C(E.selectAll("text"),_,h)}function C(E,_,h){E.each(function(m){var w=v.select(this),F;if(m.selected){F=L.ensureUniformFontSize(h,f(w,m,_,h));var z=_.selected.textfont&&_.selected.textfont.color;z&&(F.color=z),M.font(w,F)}else M.selectedTextStyle(w,_)})}function f(E,_,h,m){var w=m._fullLayout.font,F=h.textfont;if(E.classed("bartext-inside")){var z=T(_,h);F=A(h,_.i,w,z)}else E.classed("bartext-outside")&&(F=k(h,_.i,w));return F}function x(E,_,h){return I(l,E.textfont,_,h)}function A(E,_,h,m){var w=x(E,_,h),F=E._input.textfont===void 0||E._input.textfont.color===void 0||Array.isArray(E.textfont.color)&&E.textfont.color[_]===void 0;return F&&(w={color:S.contrast(m),family:w.family,size:w.size,weight:w.weight,style:w.style,variant:w.variant,textcase:w.textcase,lineposition:w.lineposition,shadow:w.shadow}),I(i,E.insidetextfont,_,w)}function k(E,_,h){var m=x(E,_,h);return I(s,E.outsidetextfont,_,m)}function I(E,_,h,m){_=_||{};var w=o.getValue(_.family,h),F=o.getValue(_.size,h),z=o.getValue(_.color,h),U=o.getValue(_.weight,h),V=o.getValue(_.style,h),G=o.getValue(_.variant,h),j=o.getValue(_.textcase,h),O=o.getValue(_.lineposition,h),H=o.getValue(_.shadow,h);return{family:o.coerceString(E.family,w,m.family),size:o.coerceNumber(E.size,F,m.size),color:o.coerceColor(E.color,z,m.color),weight:o.coerceString(E.weight,U,m.weight),style:o.coerceString(E.style,V,m.style),variant:o.coerceString(E.variant,G,m.variant),textcase:o.coerceString(E.variant,j,m.textcase),lineposition:o.coerceString(E.variant,O,m.lineposition),shadow:o.coerceString(E.variant,H,m.shadow)}}function T(E,_){return _.type==="waterfall"?_[E.dir].marker.color:E.mcc||E.mc||_.marker.color}K.exports={style:c,styleTextPoints:d,styleOnSelect:y,getInsideTextFont:A,getOutsideTextFont:k,getBarColor:T,resizeText:r}}}),Cu=Re({"src/traces/bar/plot.js"(ae,K){var v=un(),S=da(),M=Rn(),L=kc(),t=ko(),r=qs(),a=es(),l=js().tickText,i=Nc(),s=i.recordMinTextSize,o=i.clearMinTextSize,c=dp(),p=Z_(),d=ky(),y=Md(),g=y.text,C=y.textposition,f=Xp().appendArrayPointValue,x=d.TEXTPAD;function A(ue){return ue.id}function k(ue){if(ue.ids)return A}function I(ue){return(ue>0)-(ue<0)}function T(ue,xe){return ue0}function m(ue,xe,ge,_e,Y,se){var ce=xe.xaxis,ne=xe.yaxis,ye=ue._fullLayout,le=ue._context.staticPlot;Y||(Y={mode:ye.barmode,norm:ye.barmode,gap:ye.bargap,groupgap:ye.bargroupgap},o("bar",ye));var Z=M.makeTraceGroups(_e,ge,"trace bars").each(function(de){var pe=v.select(this),Te=de[0].trace,Ne=de[0].t,$e=Te.type==="waterfall",Ze=Te.type==="funnel",Xe=Te.type==="histogram",it=Te.type==="bar",yt=it||Ze,bt=0;$e&&Te.connector.visible&&Te.connector.mode==="between"&&(bt=Te.connector.line.width/2);var mt=Te.orientation==="h",ht=h(Y),Ve=M.ensureSingle(pe,"g","points"),ze=k(Te),Se=Ve.selectAll("g.point").data(M.identity,ze);Se.enter().append("g").classed("point",!0),Se.exit().remove(),Se.each(function(_t,At){var vt=v.select(this),Kt=E(_t,ce,ne,mt),Qt=Kt[0][0],fr=Kt[0][1],mr=Kt[1][0],Ur=Kt[1][1],Br=(mt?fr-Qt:Ur-mr)===0;Br&&yt&&p.getLineWidth(Te,_t)&&(Br=!1),Br||(Br=!S(Qt)||!S(fr)||!S(mr)||!S(Ur)),_t.isBlank=Br,Br&&(mt?fr=Qt:Ur=mr),bt&&!Br&&(mt?(Qt-=T(Qt,fr)*bt,fr+=T(Qt,fr)*bt):(mr-=T(mr,Ur)*bt,Ur+=T(mr,Ur)*bt));var fn,Fr;if(Te.type==="waterfall"){if(!Br){var Qr=Te[_t.dir].marker;fn=Qr.line.width,Fr=Qr.color}}else fn=p.getLineWidth(Te,_t),Fr=_t.mc||Te.marker.color;function Bt(ci){var _r=v.round(fn/2%1,2);return Y.gap===0&&Y.groupgap===0?v.round(Math.round(ci)-_r,2):ci}function et(ci,_r,rr){return rr&&ci===_r?ci:Math.abs(ci-_r)>=2?Bt(ci):ci>_r?Math.ceil(ci):Math.floor(ci)}var ut=t.opacity(Fr),Be=ut<1||fn>.01?Bt:et;ue._context.staticPlot||(Qt=Be(Qt,fr,mt),fr=Be(fr,Qt,mt),mr=Be(mr,Ur,!mt),Ur=Be(Ur,mr,!mt));var Ie=mt?ce.c2p:ne.c2p,ke;_t.s0>0?ke=_t._sMax:_t.s0<0?ke=_t._sMin:ke=_t.s1>0?_t._sMax:_t._sMin;function Fe(ci,_r){if(!ci)return 0;var rr=Math.abs(mt?Ur-mr:fr-Qt),yr=Math.abs(mt?fr-Qt:Ur-mr),br=Be(Math.abs(Ie(ke,!0)-Ie(0,!0))),an=_t.hasB?Math.min(rr/2,yr/2):Math.min(rr/2,br),bn;if(_r==="%"){var In=Math.min(50,ci);bn=rr*(In/100)}else bn=ci;return Be(Math.max(Math.min(bn,an),0))}var at=it||Xe?Fe(Ne.cornerradiusvalue,Ne.cornerradiusform):0,ct,Gt,Vt="M"+Qt+","+mr+"V"+Ur+"H"+fr+"V"+mr+"Z",Zt=0;if(at&&_t.s){var ur=I(_t.s0)===0||I(_t.s)===I(_t.s0)?_t.s1:_t.s0;if(Zt=Be(_t.hasB?0:Math.abs(Ie(ke,!0)-Ie(ur,!0))),Zt0?Math.sqrt(Zt*(2*at-Zt)):0,ha=Dr>0?Math.max:Math.min;ct="M"+Qt+","+mr+"V"+(Ur-Jr*kr)+"H"+ha(fr-(at-Zt)*Dr,Qt)+"A "+at+","+at+" 0 0 "+Sr+" "+fr+","+(Ur-at*kr-jn)+"V"+(mr+at*kr+jn)+"A "+at+","+at+" 0 0 "+Sr+" "+ha(fr-(at-Zt)*Dr,Qt)+","+(mr+Jr*kr)+"Z"}else if(_t.hasB)ct="M"+(Qt+at*Dr)+","+mr+"A "+at+","+at+" 0 0 "+Sr+" "+Qt+","+(mr+at*kr)+"V"+(Ur-at*kr)+"A "+at+","+at+" 0 0 "+Sr+" "+(Qt+at*Dr)+","+Ur+"H"+(fr-at*Dr)+"A "+at+","+at+" 0 0 "+Sr+" "+fr+","+(Ur-at*kr)+"V"+(mr+at*kr)+"A "+at+","+at+" 0 0 "+Sr+" "+(fr-at*Dr)+","+mr+"Z";else{Gt=Math.abs(Ur-mr)+Zt;var oa=Gt0?Math.sqrt(Zt*(2*at-Zt)):0,xa=kr>0?Math.max:Math.min;ct="M"+(Qt+oa*Dr)+","+mr+"V"+xa(Ur-(at-Zt)*kr,mr)+"A "+at+","+at+" 0 0 "+Sr+" "+(Qt+at*Dr-_a)+","+Ur+"H"+(fr-at*Dr+_a)+"A "+at+","+at+" 0 0 "+Sr+" "+(fr-oa*Dr)+","+xa(Ur-(at-Zt)*kr,mr)+"V"+mr+"Z"}}else ct=Vt}else ct=Vt;var ra=_(M.ensureSingle(vt,"path"),ye,Y,se);if(ra.style("vector-effect",le?"none":"non-scaling-stroke").attr("d",isNaN((fr-Qt)*(Ur-mr))||Br&&ue._context.staticPlot?"M0,0Z":ct).call(r.setClipUrl,xe.layerClipId,ue),!ye.uniformtext.mode&&ht){var Ha=r.makePointStyleFns(Te);r.singlePointStyle(_t,ra,Te,Ha,ue)}w(ue,xe,vt,de,At,Qt,fr,mr,Ur,at,Zt,Y,se),xe.layerClipId&&r.hideOutsideRangePoint(_t,vt.select("text"),ce,ne,Te.xcalendar,Te.ycalendar)});var Je=Te.cliponaxis===!1;r.setClipUrl(pe,Je?null:xe.layerClipId,ue)});a.getComponentMethod("errorbars","plot")(ue,Z,xe,Y)}function w(ue,xe,ge,_e,Y,se,ce,ne,ye,le,Z,de,pe){var Te=xe.xaxis,Ne=xe.yaxis,$e=ue._fullLayout,Ze;function Xe(Gt,Vt,Zt){var ur=M.ensureSingle(Gt,"text").text(Vt).attr({class:"bartext bartext-"+Ze,"text-anchor":"middle","data-notex":1}).call(r.font,Zt).call(L.convertToTspans,ue);return ur}var it=_e[0].trace,yt=it.orientation==="h",bt=O($e,_e,Y,Te,Ne);Ze=H(it,Y);var mt=de.mode==="stack"||de.mode==="relative",ht=_e[Y],Ve=!mt||ht._outmost,ze=ht.hasB,Se=le&&le-Z>x;if(!bt||Ze==="none"||(ht.isBlank||se===ce||ne===ye)&&(Ze==="auto"||Ze==="inside")){ge.select("text").remove();return}var Je=$e.font,_t=c.getBarColor(_e[Y],it),At=c.getInsideTextFont(it,Y,Je,_t),vt=c.getOutsideTextFont(it,Y,Je),Kt=it.insidetextanchor||"end",Qt=ge.datum();yt?Te.type==="log"&&Qt.s0<=0&&(Te.range[0]0&&Bt>0,Be;Se?ze?Be=F(Ur-2*le,Br,Qr,Bt,yt)||F(Ur,Br-2*le,Qr,Bt,yt):yt?Be=F(Ur-(le-Z),Br,Qr,Bt,yt)||F(Ur,Br-2*(le-Z),Qr,Bt,yt):Be=F(Ur,Br-(le-Z),Qr,Bt,yt)||F(Ur-2*(le-Z),Br,Qr,Bt,yt):Be=F(Ur,Br,Qr,Bt,yt),ut&&Be?Ze="inside":(Ze="outside",fn.remove(),fn=null)}else Ze="inside";if(!fn){et=M.ensureUniformFontSize(ue,Ze==="outside"?vt:At),fn=Xe(ge,bt,et);var Ie=fn.attr("transform");if(fn.attr("transform",""),Fr=r.bBox(fn.node()),Qr=Fr.width,Bt=Fr.height,fn.attr("transform",Ie),Qr<=0||Bt<=0){fn.remove();return}}var ke=it.textangle,Fe,at;Ze==="outside"?(at=it.constraintext==="both"||it.constraintext==="outside",Fe=j(se,ce,ne,ye,Fr,{isHorizontal:yt,constrained:at,angle:ke})):(at=it.constraintext==="both"||it.constraintext==="inside",Fe=V(se,ce,ne,ye,Fr,{isHorizontal:yt,constrained:at,angle:ke,anchor:Kt,hasB:ze,r:le,overhead:Z})),Fe.fontSize=et.size,s(it.type==="histogram"?"bar":it.type,Fe,$e),ht.transform=Fe;var ct=_(fn,$e,de,pe);M.setTransormAndDisplay(ct,Fe)}function F(ue,xe,ge,_e,Y){if(ue<0||xe<0)return!1;var se=ge<=ue&&_e<=xe,ce=ge<=xe&&_e<=ue,ne=Y?ue>=ge*(xe/_e):xe>=_e*(ue/ge);return se||ce||ne}function z(ue){return ue==="auto"?0:ue}function U(ue,xe){var ge=Math.PI/180*xe,_e=Math.abs(Math.sin(ge)),Y=Math.abs(Math.cos(ge));return{x:ue.width*Y+ue.height*_e,y:ue.width*_e+ue.height*Y}}function V(ue,xe,ge,_e,Y,se){var ce=!!se.isHorizontal,ne=!!se.constrained,ye=se.angle||0,le=se.anchor,Z=le==="end",de=le==="start",pe=se.leftToRight||0,Te=(pe+1)/2,Ne=1-Te,$e=se.hasB,Ze=se.r,Xe=se.overhead,it=Y.width,yt=Y.height,bt=Math.abs(xe-ue),mt=Math.abs(_e-ge),ht=bt>2*x&&mt>2*x?x:0;bt-=2*ht,mt-=2*ht;var Ve=z(ye);ye==="auto"&&!(it<=bt&&yt<=mt)&&(it>bt||yt>mt)&&(!(it>mt||yt>bt)||itx){var _t=G(ue,xe,ge,_e,ze,Ze,Xe,ce,$e);Se=_t.scale,Je=_t.pad}else Se=1,ne&&(Se=Math.min(1,bt/ze.x,mt/ze.y)),Je=0;var At=Y.left*Ne+Y.right*Te,vt=(Y.top+Y.bottom)/2,Kt=(ue+x)*Ne+(xe-x)*Te,Qt=(ge+_e)/2,fr=0,mr=0;if(de||Z){var Ur=(ce?ze.x:ze.y)/2;Ze&&(Z||$e)&&(ht+=Je);var Br=ce?T(ue,xe):T(ge,_e);ce?de?(Kt=ue+Br*ht,fr=-Br*Ur):(Kt=xe-Br*ht,fr=Br*Ur):de?(Qt=ge+Br*ht,mr=-Br*Ur):(Qt=_e-Br*ht,mr=Br*Ur)}return{textX:At,textY:vt,targetX:Kt,targetY:Qt,anchorX:fr,anchorY:mr,scale:Se,rotate:Ve}}function G(ue,xe,ge,_e,Y,se,ce,ne,ye){var le=Math.max(0,Math.abs(xe-ue)-2*x),Z=Math.max(0,Math.abs(_e-ge)-2*x),de=se-x,pe=ce?de-Math.sqrt(de*de-(de-ce)*(de-ce)):de,Te=ye?de*2:ne?de-ce:2*pe,Ne=ye?de*2:ne?2*pe:de-ce,$e,Ze,Xe,it,yt;return Y.y/Y.x>=Z/(le-Te)?it=Z/Y.y:Y.y/Y.x<=(Z-Ne)/le?it=le/Y.x:!ye&&ne?($e=Y.x*Y.x+Y.y*Y.y/4,Ze=-2*Y.x*(le-de)-Y.y*(Z/2-de),Xe=(le-de)*(le-de)+(Z/2-de)*(Z/2-de)-de*de,it=(-Ze+Math.sqrt(Ze*Ze-4*$e*Xe))/(2*$e)):ye?($e=(Y.x*Y.x+Y.y*Y.y)/4,Ze=-Y.x*(le/2-de)-Y.y*(Z/2-de),Xe=(le/2-de)*(le/2-de)+(Z/2-de)*(Z/2-de)-de*de,it=(-Ze+Math.sqrt(Ze*Ze-4*$e*Xe))/(2*$e)):($e=Y.x*Y.x/4+Y.y*Y.y,Ze=-Y.x*(le/2-de)-2*Y.y*(Z-de),Xe=(le/2-de)*(le/2-de)+(Z-de)*(Z-de)-de*de,it=(-Ze+Math.sqrt(Ze*Ze-4*$e*Xe))/(2*$e)),it=Math.min(1,it),ne?yt=Math.max(0,de-Math.sqrt(Math.max(0,de*de-(de-(Z-Y.y*it)/2)*(de-(Z-Y.y*it)/2)))-ce):yt=Math.max(0,de-Math.sqrt(Math.max(0,de*de-(de-(le-Y.x*it)/2)*(de-(le-Y.x*it)/2)))-ce),{scale:it,pad:yt}}function j(ue,xe,ge,_e,Y,se){var ce=!!se.isHorizontal,ne=!!se.constrained,ye=se.angle||0,le=Y.width,Z=Y.height,de=Math.abs(xe-ue),pe=Math.abs(_e-ge),Te;ce?Te=pe>2*x?x:0:Te=de>2*x?x:0;var Ne=1;ne&&(Ne=ce?Math.min(1,pe/Z):Math.min(1,de/le));var $e=z(ye),Ze=U(Y,$e),Xe=(ce?Ze.x:Ze.y)/2,it=(Y.left+Y.right)/2,yt=(Y.top+Y.bottom)/2,bt=(ue+xe)/2,mt=(ge+_e)/2,ht=0,Ve=0,ze=ce?T(xe,ue):T(ge,_e);return ce?(bt=xe-ze*Te,ht=ze*Xe):(mt=_e+ze*Te,Ve=-ze*Xe),{textX:it,textY:yt,targetX:bt,targetY:mt,anchorX:ht,anchorY:Ve,scale:Ne,rotate:$e}}function O(ue,xe,ge,_e,Y){var se=xe[0].trace,ce=se.texttemplate,ne;return ce?ne=W(ue,xe,ge,_e,Y):se.textinfo?ne=ee(xe,ge,_e,Y):ne=p.getValue(se.text,ge),p.coerceString(g,ne)}function H(ue,xe){var ge=p.getValue(ue.textposition,xe);return p.coerceEnumerated(C,ge)}function W(ue,xe,ge,_e,Y){var se=xe[0].trace,ce=M.castOption(se,ge,"texttemplate");if(!ce)return"";var ne=se.type==="histogram",ye=se.type==="waterfall",le=se.type==="funnel",Z=se.orientation==="h",de,pe,Te,Ne;Z?(de="y",pe=Y,Te="x",Ne=_e):(de="x",pe=_e,Te="y",Ne=Y);function $e(ht){return l(pe,pe.c2l(ht),!0).text}function Ze(ht){return l(Ne,Ne.c2l(ht),!0).text}var Xe=xe[ge],it={};it.label=Xe.p,it.labelLabel=it[de+"Label"]=$e(Xe.p);var yt=M.castOption(se,Xe.i,"text");(yt===0||yt)&&(it.text=yt),it.value=Xe.s,it.valueLabel=it[Te+"Label"]=Ze(Xe.s);var bt={};f(bt,se,Xe.i),(ne||bt.x===void 0)&&(bt.x=Z?it.value:it.label),(ne||bt.y===void 0)&&(bt.y=Z?it.label:it.value),(ne||bt.xLabel===void 0)&&(bt.xLabel=Z?it.valueLabel:it.labelLabel),(ne||bt.yLabel===void 0)&&(bt.yLabel=Z?it.labelLabel:it.valueLabel),ye&&(it.delta=+Xe.rawS||Xe.s,it.deltaLabel=Ze(it.delta),it.final=Xe.v,it.finalLabel=Ze(it.final),it.initial=it.final-it.delta,it.initialLabel=Ze(it.initial)),le&&(it.value=Xe.s,it.valueLabel=Ze(it.value),it.percentInitial=Xe.begR,it.percentInitialLabel=M.formatPercent(Xe.begR),it.percentPrevious=Xe.difR,it.percentPreviousLabel=M.formatPercent(Xe.difR),it.percentTotal=Xe.sumR,it.percenTotalLabel=M.formatPercent(Xe.sumR));var mt=M.castOption(se,Xe.i,"customdata");return mt&&(it.customdata=mt),M.texttemplateString({data:[bt,it,se._meta],fallback:se.texttemplatefallback,labels:it,locale:ue._d3locale,template:ce})}function ee(ue,xe,ge,_e){var Y=ue[0].trace,se=Y.orientation==="h",ce=Y.type==="waterfall",ne=Y.type==="funnel";function ye(mt){var ht=se?_e:ge;return l(ht,mt,!0).text}function le(mt){var ht=se?ge:_e;return l(ht,+mt,!0).text}var Z=Y.textinfo,de=ue[xe],pe=Z.split("+"),Te=[],Ne,$e=function(mt){return pe.indexOf(mt)!==-1};if($e("label")&&Te.push(ye(ue[xe].p)),$e("text")&&(Ne=M.castOption(Y,de.i,"text"),(Ne===0||Ne)&&Te.push(Ne)),ce){var Ze=+de.rawS||de.s,Xe=de.v,it=Xe-Ze;$e("initial")&&Te.push(le(it)),$e("delta")&&Te.push(le(Ze)),$e("final")&&Te.push(le(Xe))}if(ne){$e("value")&&Te.push(le(de.s));var yt=0;$e("percent initial")&&yt++,$e("percent previous")&&yt++,$e("percent total")&&yt++;var bt=yt>1;$e("percent initial")&&(Ne=M.formatPercent(de.begR),bt&&(Ne+=" of initial"),Te.push(Ne)),$e("percent previous")&&(Ne=M.formatPercent(de.difR),bt&&(Ne+=" of previous"),Te.push(Ne)),$e("percent total")&&(Ne=M.formatPercent(de.sumR),bt&&(Ne+=" of total"),Te.push(Ne))}return Te.join("
")}K.exports={plot:m,toMoveInsideBar:V}}}),of=Re({"src/traces/bar/hover.js"(ae,K){var v=Sh(),S=es(),M=ko(),L=Rn().fillText,t=Z_().getLineWidth,r=js().hoverLabelText,a=Ia().BADNUM;function l(o,c,p,d,y){var g=i(o,c,p,d,y);if(g){var C=g.cd,f=C[0].trace,x=C[g.index];return g.color=s(f,x),S.getComponentMethod("errorbars","hoverInfo")(x,f,g),[g]}}function i(o,c,p,d,y){var g=o.cd,C=g[0].trace,f=g[0].t,x=d==="closest",A=C.type==="waterfall",k=o.maxHoverDistance,I=o.maxSpikeDistance,T,E,_,h,m,w,F;C.orientation==="h"?(T=p,E=c,_="y",h="x",m=_e,w=ue):(T=c,E=p,_="x",h="y",w=_e,m=ue);var z=C[_+"period"],U=x||z;function V(Ne){return j(Ne,-1)}function G(Ne){return j(Ne,1)}function j(Ne,$e){var Ze=Ne.w;return Ne[_]+$e*Ze/2}function O(Ne){return Ne[_+"End"]-Ne[_+"Start"]}var H=x?V:z?function(Ne){return Ne.p-O(Ne)/2}:function(Ne){return Math.min(V(Ne),Ne.p-f.bardelta/2)},W=x?G:z?function(Ne){return Ne.p+O(Ne)/2}:function(Ne){return Math.max(G(Ne),Ne.p+f.bardelta/2)};function ee(Ne,$e,Ze){return y.finiteRange&&(Ze=0),v.inbox(Ne-T,$e-T,Ze+Math.min(1,Math.abs($e-Ne)/F)-1)}function ue(Ne){return ee(H(Ne),W(Ne),k)}function xe(Ne){return ee(V(Ne),G(Ne),I)}function ge(Ne){var $e=Ne[h];if(A){var Ze=Math.abs(Ne.rawS)||0;E>0?$e+=Ze:E<0&&($e-=Ze)}return $e}function _e(Ne){var $e=E,Ze=Ne.b,Xe=ge(Ne);return v.inbox(Ze-$e,Xe-$e,k+(Xe-$e)/(Xe-Ze)-1)}function Y(Ne){var $e=E,Ze=Ne.b,Xe=ge(Ne);return v.inbox(Ze-$e,Xe-$e,I+(Xe-$e)/(Xe-Ze)-1)}var se=o[_+"a"],ce=o[h+"a"];F=Math.abs(se.r2c(se.range[1])-se.r2c(se.range[0]));function ne(Ne){return(m(Ne)+w(Ne))/2}var ye=v.getDistanceFunction(d,m,w,ne);if(v.getClosest(g,ye,o),o.index!==!1&&g[o.index].p!==a){U||(H=function(Ne){return Math.min(V(Ne),Ne.p-f.bargroupwidth/2)},W=function(Ne){return Math.max(G(Ne),Ne.p+f.bargroupwidth/2)});var le=o.index,Z=g[le],de=C.base?Z.b+Z.s:Z.s;o[h+"0"]=o[h+"1"]=ce.c2p(Z[h],!0),o[h+"LabelVal"]=de;var pe=f.extents[f.extents.round(Z.p)];o[_+"0"]=se.c2p(x?H(Z):pe[0],!0),o[_+"1"]=se.c2p(x?W(Z):pe[1],!0);var Te=Z.orig_p!==void 0;return o[_+"LabelVal"]=Te?Z.orig_p:Z.p,o.labelLabel=r(se,o[_+"LabelVal"],C[_+"hoverformat"]),o.valueLabel=r(ce,o[h+"LabelVal"],C[h+"hoverformat"]),o.baseLabel=r(ce,Z.b,C[h+"hoverformat"]),o.spikeDistance=(Y(Z)+xe(Z))/2,o[_+"Spike"]=se.c2p(Z.p,!0),L(Z,C,o),o.hovertemplate=C.hovertemplate,o}}function s(o,c){var p=c.mcc||o.marker.color,d=c.mlcc||o.marker.line.color,y=t(o,c);if(M.opacity(p))return p;if(M.opacity(d)&&y)return d}K.exports={hoverPoints:l,hoverOnBars:i,getTraceColor:s}}}),Xd=Re({"src/traces/bar/event_data.js"(ae,K){K.exports=function(S,M,L){return S.x="xVal"in M?M.xVal:M.x,S.y="yVal"in M?M.yVal:M.y,M.xa&&(S.xaxis=M.xa),M.ya&&(S.yaxis=M.ya),L.orientation==="h"?(S.label=S.y,S.value=S.x):(S.label=S.x,S.value=S.y),S}}}),My=Re({"src/traces/bar/select.js"(ae,K){K.exports=function(M,L){var t=M.cd,r=M.xaxis,a=M.yaxis,l=t[0].trace,i=l.type==="funnel",s=l.orientation==="h",o=[],c;if(L===!1)for(c=0;c0?(z="v",_>0?U=Math.min(m,h):U=Math.min(h)):_>0?(z="h",U=Math.min(m)):U=0;if(!U){p.visible=!1;return}p._length=U;var H=d("orientation",z);p._hasPreCompStats?H==="v"&&_===0?(d("x0",0),d("dx",1)):H==="h"&&E===0&&(d("y0",0),d("dy",1)):H==="v"&&_===0?d("x0"):H==="h"&&E===0&&d("y0");var W=S.getComponentMethod("calendars","handleTraceDefaults");W(c,p,["x","y"],y)}function s(c,p,d,y){var g=y.prefix,C=v.coerce2(c,p,a,"marker.outliercolor"),f=d("marker.line.outliercolor"),x="outliers";p._hasPreCompStats?x="all":(C||f)&&(x="suspectedoutliers");var A=d(g+"points",x);A?(d("jitter",A==="all"?.3:0),d("pointpos",A==="all"?-1.5:0),d("marker.symbol"),d("marker.opacity"),d("marker.size"),d("marker.angle"),d("marker.color",p.line.color),d("marker.line.color"),d("marker.line.width"),A==="suspectedoutliers"&&(d("marker.line.outliercolor",p.marker.color),d("marker.line.outlierwidth")),d("selected.marker.color"),d("unselected.marker.color"),d("selected.marker.size"),d("unselected.marker.size"),d("text"),d("hovertext")):delete p.marker;var k=d("hoveron");(k==="all"||k.indexOf("points")!==-1)&&(d("hovertemplate"),d("hovertemplatefallback")),v.coerceSelectionMarkerOpacity(p,d)}function o(c,p){var d,y;function g(A){return v.coerce(y._input,y,a,A)}for(var C=0;Cge.uf};if(I._hasPreCompStats){var le=I[U],Z=function(Br){return z.d2c((I[Br]||[])[w])},de=1/0,pe=-1/0;for(w=0;w=ge.q1&&ge.q3>=ge.med){var Ne=Z("lowerfence");ge.lf=Ne!==t&&Ne<=ge.q1?Ne:y(ge,Y,se);var $e=Z("upperfence");ge.uf=$e!==t&&$e>=ge.q3?$e:g(ge,Y,se);var Ze=Z("mean");ge.mean=Ze!==t?Ze:se?L.mean(Y,se):(ge.q1+ge.q3)/2;var Xe=Z("sd");ge.sd=Ze!==t&&Xe>=0?Xe:se?L.stdev(Y,se,ge.mean):ge.q3-ge.q1,ge.lo=C(ge),ge.uo=f(ge);var it=Z("notchspan");it=it!==t&&it>0?it:x(ge,se),ge.ln=ge.med-it,ge.un=ge.med+it;var yt=ge.lf,bt=ge.uf;I.boxpoints&&Y.length&&(yt=Math.min(yt,Y[0]),bt=Math.max(bt,Y[se-1])),I.notched&&(yt=Math.min(yt,ge.ln),bt=Math.max(bt,ge.un)),ge.min=yt,ge.max=bt}else{L.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+ge.q1,"median = "+ge.med,"q3 = "+ge.q3].join(` +`));var mt;ge.med!==t?mt=ge.med:ge.q1!==t?ge.q3!==t?mt=(ge.q1+ge.q3)/2:mt=ge.q1:ge.q3!==t?mt=ge.q3:mt=0,ge.med=mt,ge.q1=ge.q3=mt,ge.lf=ge.uf=mt,ge.mean=ge.sd=mt,ge.ln=ge.un=mt,ge.min=ge.max=mt}de=Math.min(de,ge.min),pe=Math.max(pe,ge.max),ge.pts2=_e.filter(ye),h.push(ge)}}I._extremes[z._id]=S.findExtremes(z,[de,pe],{padded:!0})}else{var ht=z.makeCalcdata(I,U),Ve=l(ue,xe),ze=ue.length,Se=i(ze);for(w=0;w=0&&Je0){if(ge={},ge.pos=ge[G]=ue[w],_e=ge.pts=Se[w].sort(p),Y=ge[U]=_e.map(d),se=Y.length,ge.min=Y[0],ge.max=Y[se-1],ge.mean=L.mean(Y,se),ge.sd=L.stdev(Y,se,ge.mean)*I.sdmultiple,ge.med=L.interp(Y,.5),se%2&&(Kt||Qt)){var fr,mr;Kt?(fr=Y.slice(0,se/2),mr=Y.slice(se/2+1)):Qt&&(fr=Y.slice(0,se/2+1),mr=Y.slice(se/2)),ge.q1=L.interp(fr,.5),ge.q3=L.interp(mr,.5)}else ge.q1=L.interp(Y,.25),ge.q3=L.interp(Y,.75);ge.lf=y(ge,Y,se),ge.uf=g(ge,Y,se),ge.lo=C(ge),ge.uo=f(ge);var Ur=x(ge,se);ge.ln=ge.med-Ur,ge.un=ge.med+Ur,_t=Math.min(_t,ge.ln),At=Math.max(At,ge.un),ge.pts2=_e.filter(ye),h.push(ge)}I.notched&&L.isTypedArray(ht)&&(ht=Array.from(ht)),I._extremes[z._id]=S.findExtremes(z,I.notched?ht.concat([_t,At]):ht,{padded:!0})}return c(h,I),h.length>0?(h[0].t={num:T[m],dPos:xe,posLetter:G,valLetter:U,labels:{med:r(k,"median:"),min:r(k,"min:"),q1:r(k,"q1:"),q3:r(k,"q3:"),max:r(k,"max:"),mean:I.boxmean==="sd"||I.sizemode==="sd"?r(k,"mean ± σ:").replace("σ",I.sdmultiple===1?"σ":I.sdmultiple+"σ"):r(k,"mean:"),lf:r(k,"lower fence:"),uf:r(k,"upper fence:")}},T[m]++,h):[{t:{empty:!0}}]};function a(A,k,I,T){var E=k in A,_=k+"0"in A,h="d"+k in A;if(E||_&&h){var m=I.makeCalcdata(A,k),w=M(A,I,k,m).vals;return[w,m]}var F;_?F=A[k+"0"]:"name"in A&&(I.type==="category"||v(A.name)&&["linear","log"].indexOf(I.type)!==-1||L.isDateTime(A.name)&&I.type==="date")?F=A.name:F=T;for(var z=I.type==="multicategory"?I.r2c_just_indices(F):I.d2c(F,0,A[k+"calendar"]),U=A._length,V=new Array(U),G=0;G1,_=1-c[a+"gap"],h=1-c[a+"groupgap"];for(y=0;y0;if(z==="positive"?(ge=U*(F?1:.5),se=Y,_e=se=G):z==="negative"?(ge=se=G,_e=U*(F?1:.5),ce=Y):(ge=_e=U,se=ce=Y),pe){var Te=m.pointpos,Ne=m.jitter,$e=m.marker.size/2,Ze=0;Te+Ne>=0&&(Ze=Y*(Te+Ne),Ze>ge?(de=!0,le=$e,ne=Ze):Ze>se&&(le=$e,ne=ge)),Ze<=ge&&(ne=ge);var Xe=0;Te-Ne<=0&&(Xe=-Y*(Te-Ne),Xe>_e?(de=!0,Z=$e,ye=Xe):Xe>ce&&(Z=$e,ye=_e)),Xe<=_e&&(ye=_e)}else ne=ge,ye=_e;var it=new Array(C.length);for(g=0;gI.lo&&(H.so=!0)}return E});k.enter().append("path").classed("point",!0),k.exit().remove(),k.call(M.translatePoints,d,y)}function i(s,o,c,p){var d=o.val,y=o.pos,g=!!y.rangebreaks,C=p.bPos,f=p.bPosPxOffset||0,x=c.boxmean||(c.meanline||{}).visible,A,k;Array.isArray(p.bdPos)?(A=p.bdPos[0],k=p.bdPos[1]):(A=p.bdPos,k=p.bdPos);var I=s.selectAll("path.mean").data(c.type==="box"&&c.boxmean||c.type==="violin"&&c.box.visible&&c.meanline.visible?S.identity:[]);I.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),I.exit().remove(),I.each(function(T){var E=y.c2l(T.pos+C,!0),_=y.l2p(E-A)+f,h=y.l2p(E+k)+f,m=g?(_+h)/2:y.l2p(E)+f,w=d.c2p(T.mean,!0),F=d.c2p(T.mean-T.sd,!0),z=d.c2p(T.mean+T.sd,!0);c.orientation==="h"?v.select(this).attr("d","M"+w+","+_+"V"+h+(x==="sd"?"m0,0L"+F+","+m+"L"+w+","+_+"L"+z+","+m+"Z":"")):v.select(this).attr("d","M"+_+","+w+"H"+h+(x==="sd"?"m0,0L"+m+","+F+"L"+_+","+w+"L"+m+","+z+"Z":""))})}K.exports={plot:r,plotBoxAndWhiskers:a,plotPoints:l,plotBoxMean:i}}}),y3=Re({"src/traces/box/style.js"(ae,K){var v=un(),S=ko(),M=qs();function L(r,a,l){var i=l||v.select(r).selectAll("g.trace.boxes");i.style("opacity",function(s){return s[0].trace.opacity}),i.each(function(s){var o=v.select(this),c=s[0].trace,p=c.line.width;function d(C,f,x,A){C.style("stroke-width",f+"px").call(S.stroke,x).call(S.fill,A)}var y=o.selectAll("path.box");if(c.type==="candlestick")y.each(function(C){if(!C.empty){var f=v.select(this),x=c[C.dir];d(f,x.line.width,x.line.color,x.fillcolor),f.style("opacity",c.selectedpoints&&!C.selected?.3:1)}});else{d(y,p,c.line.color,c.fillcolor),o.selectAll("path.mean").style({"stroke-width":p,"stroke-dasharray":2*p+"px,"+p+"px"}).call(S.stroke,c.line.color);var g=o.selectAll("path.point");M.pointStyle(g,c,r)}})}function t(r,a,l){var i=a[0].trace,s=l.selectAll("path.point");i.selectedpoints?M.selectedPointStyle(s,i):M.pointStyle(s,i,r)}K.exports={style:L,styleOnSelect:t}}}),VS=Re({"src/traces/box/hover.js"(ae,K){var v=js(),S=Rn(),M=Sh(),L=ko(),t=S.fillText;function r(i,s,o,c){var p=i.cd,d=p[0].trace,y=d.hoveron,g=[],C;return y.indexOf("boxes")!==-1&&(g=g.concat(a(i,s,o,c))),y.indexOf("points")!==-1&&(C=l(i,s,o)),c==="closest"?C?[C]:g:(C&&g.push(C),g)}function a(i,s,o,c){var p=i.cd,d=i.xa,y=i.ya,g=p[0].trace,C=p[0].t,f=g.type==="violin",x,A,k,I,T,E,_,h,m,w,F,z=C.bdPos,U,V,G=C.wHover,j=function(Xe){return k.c2l(Xe.pos)+C.bPos-k.c2l(E)};f&&g.side!=="both"?(g.side==="positive"&&(m=function(Xe){var it=j(Xe);return M.inbox(it,it+G,w)},U=z,V=0),g.side==="negative"&&(m=function(Xe){var it=j(Xe);return M.inbox(it-G,it,w)},U=0,V=z)):(m=function(Xe){var it=j(Xe);return M.inbox(it-G,it+G,w)},U=V=z);var O;f?O=function(Xe){return M.inbox(Xe.span[0]-T,Xe.span[1]-T,w)}:O=function(Xe){return M.inbox(Xe.min-T,Xe.max-T,w)},g.orientation==="h"?(T=s,E=o,_=O,h=m,x="y",k=y,A="x",I=d):(T=o,E=s,_=m,h=O,x="x",k=d,A="y",I=y);var H=Math.min(1,z/Math.abs(k.r2c(k.range[1])-k.r2c(k.range[0])));w=i.maxHoverDistance-H,F=i.maxSpikeDistance-H;function W(Xe){return(_(Xe)+h(Xe))/2}var ee=M.getDistanceFunction(c,_,h,W);if(M.getClosest(p,ee,i),i.index===!1)return[];var ue=p[i.index],xe=g.line.color,ge=(g.marker||{}).color;L.opacity(xe)&&g.line.width?i.color=xe:L.opacity(ge)&&g.boxpoints?i.color=ge:i.color=g.fillcolor,i[x+"0"]=k.c2p(ue.pos+C.bPos-V,!0),i[x+"1"]=k.c2p(ue.pos+C.bPos+U,!0),i[x+"LabelVal"]=ue.orig_p!==void 0?ue.orig_p:ue.pos;var _e=x+"Spike";i.spikeDistance=W(ue)*F/w,i[_e]=k.c2p(ue.pos,!0);var Y=g.boxmean||g.sizemode==="sd"||(g.meanline||{}).visible,se=g.boxpoints||g.points,ce=se&&Y?["max","uf","q3","med","mean","q1","lf","min"]:se&&!Y?["max","uf","q3","med","q1","lf","min"]:!se&&Y?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],ne=I.range[1]0&&(l=!0);for(var c=0;cr){var a=r-L[S];return L[S]=r,a}}else return L[S]=r,r;return 0},max:function(S,M,L,t){var r=t[M];if(v(r))if(r=Number(r),v(L[S])){if(L[S]_&&_L){var w=h===S?1:6,F=h===S?"M12":"M1";return function(z,U){var V=C.c2d(z,S,f),G=V.indexOf("-",w);G>0&&(V=V.slice(0,G));var j=C.d2c(V,0,f);if(ja?p>L?p>S*1.1?S:p>M*1.1?M:L:p>t?t:p>r?r:a:Math.pow(10,Math.floor(Math.log(p)/Math.LN10))}function o(p,d,y,g,C,f){if(g&&p>L){var x=c(d,C,f),A=c(y,C,f),k=p===S?0:1;return x[k]!==A[k]}return Math.floor(y/p)-Math.floor(d/p)>.1}function c(p,d,y){var g=d.c2d(p,S,y).split("-");return g[0]===""&&(g.unshift(),g[0]="-"+g[0]),g}}}),T3=Re({"src/traces/histogram/calc.js"(ae,K){var v=da(),S=Rn(),M=es(),L=js(),{hasColorscale:t}=cp(),r=hp(),a=Ag(),l=b3(),i=Kg(),s=Kb(),o=w3();function c(C,f){var x=[],A=[],k=f.orientation==="h",I=L.getFromId(C,k?f.yaxis:f.xaxis),T=k?"y":"x",E={x:"y",y:"x"}[T],_=f[T+"calendar"],h=f.cumulative,m,w=p(C,f,I,T),F=w[0],z=w[1],U=typeof F.size=="string",V=[],G=U?V:F,j=[],O=[],H=[],W=0,ee=f.histnorm,ue=f.histfunc,xe=ee.indexOf("density")!==-1,ge,_e,Y;h.enabled&&xe&&(ee=ee.replace(/ ?density$/,""),xe=!1);var se=ue==="max"||ue==="min",ce=se?null:0,ne=l.count,ye=i[ee],le=!1,Z=function(Je){return I.r2c(Je,0,_)},de;for(S.isArrayOrTypedArray(f[E])&&ue!=="count"&&(de=f[E],le=ue==="avg",ne=l[ue]),m=Z(F.start),_e=Z(F.end)+(m-L.tickIncrement(m,F.size,!1,_))/1e6;m<_e&&x.length<1e6&&(ge=L.tickIncrement(m,F.size,!1,_),x.push((m+ge)/2),A.push(ce),H.push([]),V.push(m),xe&&j.push(1/(ge-m)),le&&O.push(0),!(ge<=m));)m=ge;V.push(m),!U&&I.type==="date"&&(G={start:Z(G.start),end:Z(G.end),size:G.size}),C._fullLayout._roundFnOpts||(C._fullLayout._roundFnOpts={});var pe=f["_"+T+"bingroup"],Te={leftGap:1/0,rightGap:1/0};pe&&(C._fullLayout._roundFnOpts[pe]||(C._fullLayout._roundFnOpts[pe]=Te),Te=C._fullLayout._roundFnOpts[pe]);var Ne=A.length,$e=!0,Ze=Te.leftGap,Xe=Te.rightGap,it={};for(m=0;m=0&&Y=Ve;m--)if(A[m]){ze=m;break}for(m=Ve;m<=ze;m++)if(v(x[m])&&v(A[m])){var Se={p:x[m],s:A[m],b:0};h.enabled||(Se.pts=H[m],$e?Se.ph0=Se.ph1=H[m].length?z[H[m][0]]:x[m]:(f._computePh=!0,Se.ph0=bt(V[m]),Se.ph1=bt(V[m+1],!0))),ht.push(Se)}return ht.length===1&&(ht[0].width1=L.tickIncrement(ht[0].p,F.size,!1,_)-ht[0].p),t(f,"marker")&&r(C,f,{vals:f.marker.color,containerStr:"marker",cLetter:"c"}),t(f,"marker.line")&&r(C,f,{vals:f.marker.line.color,containerStr:"marker.line",cLetter:"c"}),a(ht,f),S.isArrayOrTypedArray(f.selectedpoints)&&S.tagSelected(ht,f,it),ht}function p(C,f,x,A,k){var I=A+"bins",T=C._fullLayout,E=f["_"+A+"bingroup"],_=T._histogramBinOpts[E],h=T.barmode==="overlay",m,w,F,z,U,V,G,j=function(yt){return x.r2c(yt,0,z)},O=function(yt){return x.c2r(yt,0,z)},H=x.type==="date"?function(yt){return yt||yt===0?S.cleanDate(yt,null,z):null}:function(yt){return v(yt)?Number(yt):null};function W(yt,bt,mt){bt[yt+"Found"]?(bt[yt]=H(bt[yt]),bt[yt]===null&&(bt[yt]=mt[yt])):(V[yt]=bt[yt]=mt[yt],S.nestedProperty(w[0],I+"."+yt).set(mt[yt]))}if(f["_"+A+"autoBinFinished"])delete f["_"+A+"autoBinFinished"];else{w=_.traces;var ee=[],ue=!0,xe=!1,ge=!1;for(m=0;m"u"){if(k)return[Y,U,!0];Y=d(C,f,x,A,I)}G=F.cumulative||{},G.enabled&&G.currentbin!=="include"&&(G.direction==="decreasing"?Y.start=O(L.tickIncrement(j(Y.start),Y.size,!0,z)):Y.end=O(L.tickIncrement(j(Y.end),Y.size,!1,z))),_.size=Y.size,_.sizeFound||(V.size=Y.size,S.nestedProperty(w[0],I+".size").set(Y.size)),W("start",_,Y),W("end",_,Y)}U=f["_"+A+"pos0"],delete f["_"+A+"pos0"];var ce=f._input[I]||{},ne=S.extendFlat({},_),ye=_.start,le=x.r2l(ce.start),Z=le!==void 0;if((_.startFound||Z)&&le!==x.r2l(ye)){var de=Z?le:S.aggNums(Math.min,null,U),pe={type:x.type==="category"||x.type==="multicategory"?"linear":x.type,r2l:x.r2l,dtick:_.size,tick0:ye,calendar:z,range:[de,L.tickIncrement(de,_.size,!1,z)].map(x.l2r)},Te=L.tickFirst(pe);Te>x.r2l(de)&&(Te=L.tickIncrement(Te,_.size,!0,z)),ne.start=x.l2r(Te),Z||S.nestedProperty(f,I+".start").set(ne.start)}var Ne=_.end,$e=x.r2l(ce.end),Ze=$e!==void 0;if((_.endFound||Ze)&&$e!==x.r2l(Ne)){var Xe=Ze?$e:S.aggNums(Math.max,null,U);ne.end=x.l2r(Xe),Ze||S.nestedProperty(f,I+".start").set(ne.end)}var it="autobin"+A;return f._input[it]===!1&&(f._input[I]=S.extendFlat({},f[I]||{}),delete f._input[it],delete f[it]),[ne,U]}function d(C,f,x,A,k){var I=C._fullLayout,T=y(C,f),E=!1,_=1/0,h=[f],m,w,F;for(m=0;m=0;A--)E(A);else if(f==="increasing"){for(A=1;A=0;A--)C[A]+=C[A+1];x==="exclude"&&(C.push(0),C.shift())}}K.exports={calc:c,calcAllAutoBins:p}}}),gM=Re({"src/traces/histogram2d/calc.js"(ae,K){var v=Rn(),S=js(),M=b3(),L=Kg(),t=Kb(),r=w3(),a=T3().calcAllAutoBins;K.exports=function(c,p){var d=S.getFromId(c,p.xaxis),y=S.getFromId(c,p.yaxis),g=p.xcalendar,C=p.ycalendar,f=function(et){return d.r2c(et,0,g)},x=function(et){return y.r2c(et,0,C)},A=function(et){return d.c2r(et,0,g)},k=function(et){return y.c2r(et,0,C)},I,T,E,_,h=a(c,p,d,"x"),m=h[0],w=h[1],F=a(c,p,y,"y"),z=F[0],U=F[1],V=p._length;w.length>V&&w.splice(V,w.length-V),U.length>V&&U.splice(V,U.length-V);var G=[],j=[],O=[],H=typeof m.size=="string",W=typeof z.size=="string",ee=[],ue=[],xe=H?ee:m,ge=W?ue:z,_e=0,Y=[],se=[],ce=p.histnorm,ne=p.histfunc,ye=ce.indexOf("density")!==-1,le=ne==="max"||ne==="min",Z=le?null:0,de=M.count,pe=L[ce],Te=!1,Ne=[],$e=[],Ze="z"in p?p.z:"marker"in p&&Array.isArray(p.marker.color)?p.marker.color:"";Ze&&ne!=="count"&&(Te=ne==="avg",de=M[ne]);var Xe=m.size,it=f(m.start),yt=f(m.end)+(it-S.tickIncrement(it,Xe,!1,g))/1e6;for(I=it;I=0&&E=0&&_<_t&&(_e+=de(E,I,G[_],Ze,Y[_]),se[_][E].push(I),Kt&&(fr[E]===void 0?fr[E]=Qr:fr[E]!==Qr&&(Kt=!1)),Qt&&(mr[_]===void 0?mr[_]=Bt:mr[_]!==Bt&&(Qt=!1)),Ur=Math.min(Ur,Qr-ee[E]),Br=Math.min(Br,ee[E+1]-Qr),fn=Math.min(fn,Bt-ue[_]),Fr=Math.min(Fr,ue[_+1]-Bt))}if(Te)for(_=0;_<_t;_++)_e+=t(G[_],Y[_]);if(pe)for(_=0;_<_t;_++)pe(G[_],_e,Ne,$e[_]);return{x:w,xRanges:s(ee,Kt&&fr,Ur,Br,d,g),x0:ht,dx:mt,y:U,yRanges:s(ue,Qt&&mr,fn,Fr,y,C),y0:vt,dy:At,z:G,pts:se}};function l(o,c,p,d){var y=new Array(o),g;if(d)for(g=0;gS;s++)i=t(a,l,L(i));return i>S&&v.log("interp2d didn't converge quickly",i),a};function t(r,a,l){var i=0,s,o,c,p,d,y,g,C,f,x,A,k,I;for(p=0;pk&&(i=Math.max(i,Math.abs(r[o][c]-A)/(I-k))))}return i}}}),C3=Re({"src/traces/heatmap/find_empties.js"(ae,K){var v=Rn().maxRowLength;K.exports=function(M){var L=[],t={},r=[],a=M[0],l=[],i=[0,0,0],s=v(M),o,c,p,d,y,g,C,f;for(c=0;c=0;y--)d=r[y],c=d[0],p=d[1],g=((t[[c-1,p]]||i)[2]+(t[[c+1,p]]||i)[2]+(t[[c,p-1]]||i)[2]+(t[[c,p+1]]||i)[2])/20,g&&(C[d]=[c,p,g],r.splice(y,1),f=!0);if(!f)throw"findEmpties iterated with no new neighbors";for(d in C)t[d]=C[d],L.push(C[d])}return L.sort(function(x,A){return A[2]-x[2]})}}}),qS=Re({"src/traces/heatmap/make_bound_array.js"(ae,K){var v=es(),S=Rn().isArrayOrTypedArray;K.exports=function(L,t,r,a,l,i){var s=[],o=v.traceIs(L,"contour"),c=v.traceIs(L,"histogram"),p,d,y,g=S(t)&&t.length>1;if(g&&!c&&i.type!=="category"){var C=t.length;if(C<=l){if(o)s=Array.from(t).slice(0,l);else if(l===1)i.type==="log"?s=[.5*t[0],2*t[0]]:s=[t[0]-.5,t[0]+.5];else if(i.type==="log"){for(s=[Math.pow(t[0],1.5)/Math.pow(t[1],.5)],y=1;y1){var ce=(se[se.length-1]-se[0])/(se.length-1),ne=Math.abs(ce/100);for(V=0;Vne)return!1}return!0}C._islinear=!1,f.type==="log"||x.type==="log"?I==="fast"&&O("log axis found"):H(T)?H(m)?C._islinear=!0:I==="fast"&&O("y scale is not linear"):I==="fast"&&O("x scale is not linear");var W=S.maxRowLength(U),ee=C.xtype==="scaled"?"":T,ue=o(C,ee,E,_,W,f),xe=C.ytype==="scaled"?"":m,ge=o(C,xe,w,F,U.length,x);C._extremes[f._id]=M.findExtremes(f,ue),C._extremes[x._id]=M.findExtremes(x,ge);var _e={x:ue,y:ge,z:U,text:C._text||C.text,hovertext:C._hovertext||C.hovertext};if(C.xperiodalignment&&h&&(_e.orig_x=h),C.yperiodalignment&&z&&(_e.orig_y=z),ee&&ee.length===ue.length-1&&(_e.xCenter=ee),xe&&xe.length===ge.length-1&&(_e.yCenter=xe),k&&(_e.xRanges=G.xRanges,_e.yRanges=G.yRanges,_e.pts=G.pts),A||r(g,C,{vals:U,cLetter:"z"}),A&&C.contours&&C.contours.coloring==="heatmap"){var Y={type:C.type==="contour"?"heatmap":"histogram2d",xcalendar:C.xcalendar,ycalendar:C.ycalendar};_e.xfill=o(Y,ee,E,_,W,f),_e.yfill=o(Y,xe,w,F,U.length,x)}return[_e]};function p(y){for(var g=[],C=y.length,f=0;f0;)ye=m.c2p(H[pe]),pe--;for(ye0;)de=w.c2p(W[pe]),pe--;de=m._length||ye<=0||Z>=w._length||de<=0;if(yt){var bt=z.selectAll("image").data([]);bt.exit().remove(),x(z);return}var mt,ht;$e==="fast"?(mt=Y,ht=_e):(mt=Xe,ht=it);var Ve=document.createElement("canvas");Ve.width=mt,Ve.height=ht;var ze=Ve.getContext("2d",{willReadFrequently:!0}),Se=o(V,{noNumericCheck:!0,returnArray:!0}),Je,_t;$e==="fast"?(Je=se?function(Yn){return Y-1-Yn}:r.identity,_t=ce?function(Yn){return _e-1-Yn}:r.identity):(Je=function(Yn){return r.constrain(Math.round(m.c2p(H[Yn])-ne),0,Xe)},_t=function(Yn){return r.constrain(Math.round(w.c2p(W[Yn])-Z),0,it)});var At=_t(0),vt=[At,At],Kt=se?0:1,Qt=ce?0:1,fr=0,mr=0,Ur=0,Br=0,fn,Fr,Qr,Bt,et;function ut(Yn,qi){if(Yn!==void 0){var Ga=Se(Yn);return Ga[0]=Math.round(Ga[0]),Ga[1]=Math.round(Ga[1]),Ga[2]=Math.round(Ga[2]),fr+=qi,mr+=Ga[0]*qi,Ur+=Ga[1]*qi,Br+=Ga[2]*qi,Ga}return[0,0,0,0]}function Be(Yn,qi,Ga,to){var _o=Yn[Ga.bin0];if(_o===void 0)return ut(void 0,1);var Po=Yn[Ga.bin1],Ro=qi[Ga.bin0],Xo=qi[Ga.bin1],Oi=Po-_o||0,bs=Ro-_o||0,cs;return Po===void 0?Xo===void 0?cs=0:Ro===void 0?cs=2*(Xo-_o):cs=(2*Xo-Ro-_o)*2/3:Xo===void 0?Ro===void 0?cs=0:cs=(2*_o-Po-Ro)*2/3:Ro===void 0?cs=(2*Xo-Po-_o)*2/3:cs=Xo+_o-Po-Ro,ut(_o+Ga.frac*Oi+to.frac*(bs+Ga.frac*cs))}if($e!=="default"){var Ie=0,ke;try{ke=new Uint8Array(mt*ht*4)}catch{ke=new Array(mt*ht*4)}if($e==="smooth"){var Fe=ee||H,at=ue||W,ct=new Array(Fe.length),Gt=new Array(at.length),Vt=new Array(Xe),Zt=ee?k:A,ur=ue?k:A,Dr,kr,Sr;for(pe=0;pePa||Pa>w._length))for(Te=bn;TeOa||Oa>m._length)){var Wa=l({x:La,y:va},V,T._fullLayout);Wa.x=La,Wa.y=va;var sa=U.z[pe][Te];sa===void 0?(Wa.z="",Wa.zLabel=""):(Wa.z=sa,Wa.zLabel=t.tickText(_r,sa,"hover").text);var ji=U.text&&U.text[pe]&&U.text[pe][Te];(ji===void 0||ji===!1)&&(ji=""),Wa.text=ji;var Qi=r.texttemplateString({data:[Wa,V._meta],fallback:V.texttemplatefallback,labels:Wa,locale:T._fullLayout._d3locale,template:Ha});if(Qi){var Xt=Qi.split("
"),Lt=Xt.length,$r=0;for(Ne=0;Ne=x[0].length||F<0||F>x.length)return}else{if(v.inbox(l-C[0],l-C[C.length-1],0)>0||v.inbox(i-f[0],i-f[f.length-1],0)>0)return;if(c){var z;for(E=[2*C[0]-C[1]],z=1;z=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),ew=Re({"src/traces/contour/attributes.js"(ae,K){var v=pp(),S=wf(),M=$c(),L=M.axisHoverFormat,t=M.descriptionOnlyNumbers,r=ac(),a=up().dash,l=Do(),i=Li().extendFlat,s=O3(),o=s.COMPARISON_OPS2,c=s.INTERVAL_OPS,p=S.line;K.exports=i({z:v.z,x:v.x,x0:v.x0,dx:v.dx,y:v.y,y0:v.y0,dy:v.dy,xperiod:v.xperiod,yperiod:v.yperiod,xperiod0:S.xperiod0,yperiod0:S.yperiod0,xperiodalignment:v.xperiodalignment,yperiodalignment:v.yperiodalignment,text:v.text,hovertext:v.hovertext,transpose:v.transpose,xtype:v.xtype,ytype:v.ytype,xhoverformat:L("x"),yhoverformat:L("y"),zhoverformat:L("z",1),hovertemplate:v.hovertemplate,hovertemplatefallback:v.hovertemplatefallback,texttemplate:i({},v.texttemplate,{}),texttemplatefallback:v.texttemplatefallback,textfont:i({},v.textfont,{}),hoverongaps:v.hoverongaps,connectgaps:i({},v.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:l({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:t("contour label")},operation:{valType:"enumerated",values:[].concat(o).concat(c),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i({},p.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:a,smoothing:i({},p.smoothing,{}),editType:"plot"},zorder:S.zorder},r("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),F3=Re({"src/traces/histogram2dcontour/attributes.js"(ae,K){var v=z3(),S=ew(),M=ac(),L=$c().axisHoverFormat,t=Li().extendFlat;K.exports=t({x:v.x,y:v.y,z:v.z,marker:v.marker,histnorm:v.histnorm,histfunc:v.histfunc,nbinsx:v.nbinsx,xbins:v.xbins,nbinsy:v.nbinsy,ybins:v.ybins,autobinx:v.autobinx,autobiny:v.autobiny,bingroup:v.bingroup,xbingroup:v.xbingroup,ybingroup:v.ybingroup,autocontour:S.autocontour,ncontours:S.ncontours,contours:S.contours,line:{color:S.line.color,width:t({},S.line.width,{dflt:.5}),dash:S.line.dash,smoothing:S.line.smoothing,editType:"plot"},xhoverformat:L("x"),yhoverformat:L("y"),zhoverformat:L("z",1),hovertemplate:v.hovertemplate,hovertemplatefallback:v.hovertemplatefallback,texttemplate:S.texttemplate,texttemplatefallback:S.texttemplatefallback,textfont:S.textfont},M("",{cLetter:"z",editTypeOverride:"calc"}))}}),B3=Re({"src/traces/contour/contours_defaults.js"(ae,K){K.exports=function(S,M,L,t){var r=t("contours.start"),a=t("contours.end"),l=r===!1||a===!1,i=L("contours.size"),s;l?s=M.autocontour=!0:s=L("autocontour",!1),(s||!i)&&L("ncontours")}}}),XS=Re({"src/traces/contour/label_defaults.js"(ae,K){var v=Rn();K.exports=function(M,L,t,r){r||(r={});var a=M("contours.showlabels");if(a){var l=L.font;v.coerceFont(M,"contours.labelfont",l,{overrideDflt:{color:t}}),M("contours.labelformat")}r.hasHover!==!1&&M("zhoverformat")}}}),tw=Re({"src/traces/contour/style_defaults.js"(ae,K){var v=ed(),S=XS();K.exports=function(L,t,r,a,l){var i=r("contours.coloring"),s,o="";i==="fill"&&(s=r("contours.showlines")),s!==!1&&(i!=="lines"&&(o=r("line.color","#000")),r("line.width",.5),r("line.dash")),i!=="none"&&(L.showlegend!==!0&&(t.showlegend=!1),t._dfltShowLegend=!1,v(L,t,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),S(r,a,o,l)}}}),SM=Re({"src/traces/histogram2dcontour/defaults.js"(ae,K){var v=Rn(),S=N3(),M=B3(),L=tw(),t=F1(),r=F3();K.exports=function(l,i,s,o){function c(d,y){return v.coerce(l,i,r,d,y)}function p(d){return v.coerce2(l,i,r,d)}S(l,i,c,o),i.visible!==!1&&(M(l,i,c,p),L(l,i,c,o),c("xhoverformat"),c("yhoverformat"),c("hovertemplate"),c("hovertemplatefallback"),i.contours&&i.contours.coloring==="heatmap"&&t(c,o))}}}),YS=Re({"src/traces/contour/set_contours.js"(ae,K){var v=js(),S=Rn();K.exports=function(t,r){var a=t.contours;if(t.autocontour){var l=t.zmin,i=t.zmax;(t.zauto||l===void 0)&&(l=S.aggNums(Math.min,null,r)),(t.zauto||i===void 0)&&(i=S.aggNums(Math.max,null,r));var s=M(l,i,t.ncontours);a.size=s.dtick,a.start=v.tickFirst(s),s.range.reverse(),a.end=v.tickFirst(s),a.start===l&&(a.start+=a.size),a.end===i&&(a.end-=a.size),a.start>a.end&&(a.start=a.end=(a.start+a.end)/2),t._input.contours||(t._input.contours={}),S.extendFlat(t._input.contours,{start:a.start,end:a.end,size:a.size}),t._input.autocontour=!0}else if(a.type!=="constraint"){var o=a.start,c=a.end,p=t._input.contours;if(o>c&&(a.start=p.start=c,c=a.end=p.end=o,o=a.start),!(a.size>0)){var d;o===c?d=1:d=M(o,c,t.ncontours).dtick,p.size=a.size=d}}};function M(L,t,r){var a={type:"linear",range:[L,t]};return v.autoTicks(a,(t-L)/(r||15)),a}}}),U3=Re({"src/traces/contour/end_plus.js"(ae,K){K.exports=function(S){return S.end+S.size/1e6}}}),$3=Re({"src/traces/contour/calc.js"(ae,K){var v=nf(),S=Jb(),M=YS(),L=U3();K.exports=function(r,a){var l=S(r,a),i=l[0].z;M(a,i);var s=a.contours,o=v.extractOpts(a),c;if(s.coloring==="heatmap"&&o.auto&&a.autocontour===!1){var p=s.start,d=L(s),y=s.size||1,g=Math.floor((d-p)/y)+1;isFinite(y)||(y=1,g=1);var C=p-y/2,f=C+g*y;c=[C,f]}else c=i;return v.calc(r,a,{vals:c,cLetter:"z"}),l}}}),rw=Re({"src/traces/contour/constants.js"(ae,K){K.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}}}}),ZS=Re({"src/traces/contour/make_crossings.js"(ae,K){var v=rw();K.exports=function(L){var t=L[0].z,r=t.length,a=t[0].length,l=r===2||a===2,i,s,o,c,p,d,y,g,C;for(s=0;sM?0:1)+(L[0][1]>M?0:2)+(L[1][1]>M?0:4)+(L[1][0]>M?0:8);if(t===5||t===10){var r=(L[0][0]+L[0][1]+L[1][0]+L[1][1])/4;return M>r?t===5?713:1114:t===5?104:208}return t===15?0:t}}}),V3=Re({"src/traces/contour/find_all_paths.js"(ae,K){var v=Rn(),S=rw();K.exports=function(i,s,o){var c,p,d,y,g;for(s=s||.01,o=o||.01,d=0;d20?(d=S.CHOOSESADDLE[d][(y[0]||y[1])<0?0:1],l.crossings[p]=S.SADDLEREMAINDER[d]):delete l.crossings[p],y=S.NEWDELTA[d],!y){v.log("Found bad marching index:",d,i,l.level);break}g.push(a(l,i,y)),i[0]+=y[0],i[1]+=y[1],p=i.join(","),M(g[g.length-1],g[g.length-2],o,c)&&g.pop();var I=y[0]&&(i[0]<0||i[0]>f-2)||y[1]&&(i[1]<0||i[1]>C-2),T=i[0]===x[0]&&i[1]===x[1]&&y[0]===A[0]&&y[1]===A[1];if(T||s&&I)break;d=l.crossings[p]}k===1e4&&v.log("Infinite loop in contour?");var E=M(g[0],g[g.length-1],o,c),_=0,h=.2*l.smoothing,m=[],w=0,F,z,U,V,G,j,O,H,W,ee,ue;for(k=1;k=w;k--)if(F=m[k],F=w&&F+m[z]H&&W--,l.edgepaths[W]=ue.concat(g,ee));break}Y||(l.edgepaths[H]=g.concat(ee))}for(H=0;H20&&i?l===208||l===1114?o=s[0]===0?1:-1:c=s[1]===0?1:-1:S.BOTTOMSTART.indexOf(l)!==-1?c=1:S.LEFTSTART.indexOf(l)!==-1?o=1:S.TOPSTART.indexOf(l)!==-1?c=-1:o=-1,[o,c]}function a(l,i,s){var o=i[0]+Math.max(s[0],0),c=i[1]+Math.max(s[1],0),p=l.z[c][o],d=l.xaxis,y=l.yaxis;if(s[1]){var g=(l.level-p)/(l.z[c][o+1]-p),C=(g!==1?(1-g)*d.c2l(l.x[o]):0)+(g!==0?g*d.c2l(l.x[o+1]):0);return[d.c2p(d.l2c(C),!0),y.c2p(l.y[c],!0),o+g,c]}else{var f=(l.level-p)/(l.z[c+1][o]-p),x=(f!==1?(1-f)*y.c2l(l.y[c]):0)+(f!==0?f*y.c2l(l.y[c+1]):0);return[d.c2p(l.x[o],!0),y.c2p(y.l2c(x),!0),o,c+f]}}}}),EM=Re({"src/traces/contour/constraint_mapping.js"(ae,K){var v=O3(),S=da();K.exports={"[]":L("[]"),"][":L("]["),">":t(">"),"<":t("<"),"=":t("=")};function M(r,a){var l=Array.isArray(a),i;function s(o){return S(o)?+o:null}return v.COMPARISON_OPS2.indexOf(r)!==-1?i=s(l?a[0]:a):v.INTERVAL_OPS.indexOf(r)!==-1?i=l?[s(a[0]),s(a[1])]:[s(a),s(a)]:v.SET_OPS.indexOf(r)!==-1&&(i=l?a.map(s):[s(a)]),i}function L(r){return function(a){a=M(r,a);var l=Math.min(a[0],a[1]),i=Math.max(a[0],a[1]);return{start:l,end:i,size:i-l}}}function t(r){return function(a){return a=M(r,a),{start:a,end:1/0,size:1/0}}}}}),KS=Re({"src/traces/contour/empty_pathinfo.js"(ae,K){var v=Rn(),S=EM(),M=U3();K.exports=function(t,r,a){for(var l=t.type==="constraint"?S[t._operation](t.value):t,i=l.size,s=[],o=M(l),c=a.trace._carpetTrace,p=c?{xaxis:c.aaxis,yaxis:c.baxis,x:a.a,y:a.b}:{xaxis:r.xaxis,yaxis:r.yaxis,x:a.x,y:a.y},d=l.start;d1e3){v.warn("Too many contours, clipping at 1000",t);break}return s}}}),CM=Re({"src/traces/contour/convert_to_constraints.js"(ae,K){var v=Rn();K.exports=function(M,L){var t,r,a,l=function(o){return o.reverse()},i=function(o){return o};switch(L){case"=":case"<":return M;case">":for(M.length!==1&&v.warn("Contour data invalid for the specified inequality operation."),r=M[0],t=0;ta.level||a.starts.length&&r===a.level)}break;case"constraint":if(M.prefixBoundary=!1,M.edgepaths.length)return;var l=M.x.length,i=M.y.length,s=-1/0,o=1/0;for(t=0;t":c>s&&(M.prefixBoundary=!0);break;case"<":(cs||M.starts.length&&d===o)&&(M.prefixBoundary=!0);break;case"][":p=Math.min(c[0],c[1]),d=Math.max(c[0],c[1]),ps&&(M.prefixBoundary=!0);break}break}}}}),j3=Re({"src/traces/contour/plot.js"(ae){var K=un(),v=Rn(),S=qs(),M=nf(),L=kc(),t=js(),r=bm(),a=M3(),l=ZS(),i=V3(),s=KS(),o=CM(),c=kM(),p=rw(),d=p.LABELOPTIMIZER;ae.plot=function(T,E,_,h){var m=E.xaxis,w=E.yaxis;v.makeTraceGroups(h,_,"contour").each(function(F){var z=K.select(this),U=F[0],V=U.trace,G=U.x,j=U.y,O=V.contours,H=s(O,E,U),W=v.ensureSingle(z,"g","heatmapcoloring"),ee=[];O.coloring==="heatmap"&&(ee=[F]),a(T,E,ee,W),l(H),i(H);var ue=m.c2p(G[0],!0),xe=m.c2p(G[G.length-1],!0),ge=w.c2p(j[0],!0),_e=w.c2p(j[j.length-1],!0),Y=[[ue,_e],[xe,_e],[xe,ge],[ue,ge]],se=H;O.type==="constraint"&&(se=o(H,O._operation)),y(z,Y,O),g(z,se,Y,O),f(z,H,T,U,O),A(z,E,T,U,Y)})};function y(I,T,E){var _=v.ensureSingle(I,"g","contourbg"),h=_.selectAll("path").data(E.coloring==="fill"?[0]:[]);h.enter().append("path"),h.exit().remove(),h.attr("d","M"+T.join("L")+"Z").style("stroke","none")}function g(I,T,E,_){var h=_.coloring==="fill"||_.type==="constraint"&&_._operation!=="=",m="M"+E.join("L")+"Z";h&&c(T,_);var w=v.ensureSingle(I,"g","contourfill"),F=w.selectAll("path").data(h?T:[]);F.enter().append("path"),F.exit().remove(),F.each(function(z){var U=(z.prefixBoundary?m:"")+C(z,E);U?K.select(this).attr("d",U).style("stroke","none"):K.select(this).remove()})}function C(I,T){var E="",_=0,h=I.edgepaths.map(function(ue,xe){return xe}),m=!0,w,F,z,U,V,G;function j(ue){return Math.abs(ue[1]-T[0][1])<.01}function O(ue){return Math.abs(ue[1]-T[2][1])<.01}function H(ue){return Math.abs(ue[0]-T[0][0])<.01}function W(ue){return Math.abs(ue[0]-T[2][0])<.01}for(;h.length;){for(G=S.smoothopen(I.edgepaths[_],I.smoothing),E+=m?G:G.replace(/^M/,"L"),h.splice(h.indexOf(_),1),w=I.edgepaths[_][I.edgepaths[_].length-1],U=-1,z=0;z<4;z++){if(!w){v.log("Missing end?",_,I);break}for(j(w)&&!W(w)?F=T[1]:H(w)?F=T[0]:O(w)?F=T[3]:W(w)&&(F=T[2]),V=0;V=0&&(F=ee,U=V):Math.abs(w[1]-F[1])<.01?Math.abs(w[1]-ee[1])<.01&&(ee[0]-w[0])*(F[0]-ee[0])>=0&&(F=ee,U=V):v.log("endpt to newendpt is not vert. or horz.",w,F,ee)}if(w=F,U>=0)break;E+="L"+F}if(U===I.edgepaths.length){v.log("unclosed perimeter path");break}_=U,m=h.indexOf(_)===-1,m&&(_=h[0],E+="Z")}for(_=0;_d.MAXCOST*2)break;j&&(F/=2),w=U-F/2,z=w+F*1.5}if(G<=d.MAXCOST)return V};function x(I,T,E,_){var h=T.width/2,m=T.height/2,w=I.x,F=I.y,z=I.theta,U=Math.cos(z)*h,V=Math.sin(z)*h,G=(w>_.center?_.right-w:w-_.left)/(U+Math.abs(Math.sin(z)*m)),j=(F>_.middle?_.bottom-F:F-_.top)/(Math.abs(V)+Math.cos(z)*m);if(G<1||j<1)return 1/0;var O=d.EDGECOST*(1/(G-1)+1/(j-1));O+=d.ANGLECOST*z*z;for(var H=w-U,W=F-V,ee=w+U,ue=F+V,xe=0;xe=A)&&(a<=x&&(a=x),l>=A&&(l=A),s=Math.floor((l-a)/i)+1,o=0),f=0;fx&&(y.unshift(x),g.unshift(g[0])),y[y.length-1]2?c.value=c.value.slice(2):c.length===0?c.value=[0,1]:c.length<2?(p=parseFloat(c.value[0]),c.value=[p,p+1]):c.value=[parseFloat(c.value[0]),parseFloat(c.value[1])]:v(c.value)&&(p=parseFloat(c.value),c.value=[p,p+1])):(o("contours.value",0),v(c.value)||(a(c.value)?c.value=parseFloat(c.value[0]):c.value=0))}}}),e5=Re({"src/traces/contour/defaults.js"(ae,K){var v=Rn(),S=nd(),M=_g(),L=QS(),t=B3(),r=tw(),a=F1(),l=ew();K.exports=function(s,o,c,p){function d(f,x){return v.coerce(s,o,l,f,x)}function y(f){return v.coerce2(s,o,l,f)}var g=S(s,o,d,p);if(!g){o.visible=!1;return}M(s,o,p,d),d("xhoverformat"),d("yhoverformat"),d("text"),d("hovertext"),d("hoverongaps"),d("hovertemplate"),d("hovertemplatefallback");var C=d("contours.type")==="constraint";d("connectgaps",v.isArray1D(o.z)),C?L(s,o,d,p,c):(t(s,o,d,y),r(s,o,d,p)),o.contours&&o.contours.coloring==="heatmap"&&a(d,p),d("zorder")}}}),IM=Re({"src/traces/contour/index.js"(ae,K){K.exports={attributes:ew(),supplyDefaults:e5(),calc:$3(),plot:j3().plot,style:nw(),colorbar:tx(),hoverPoints:JS(),moduleType:"trace",name:"contour",basePlotModule:td(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),t5=Re({"lib/contour.js"(ae,K){K.exports=IM()}}),G3=Re({"src/traces/scatterternary/attributes.js"(ae,K){var{hovertemplateAttrs:v,texttemplateAttrs:S,templatefallbackAttrs:M}=Wl(),L=hv(),t=wf(),r=As(),a=ac(),l=up().dash,i=Li().extendFlat,s=t.marker,o=t.line,c=s.line;K.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:i({},t.mode,{dflt:"markers"}),text:i({},t.text,{}),texttemplate:S({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:M({editType:"plot"}),hovertext:i({},t.hovertext,{}),line:{color:o.color,width:o.width,dash:l,backoff:o.backoff,shape:i({},o.shape,{values:["linear","spline"]}),smoothing:o.smoothing,editType:"calc"},connectgaps:t.connectgaps,cliponaxis:t.cliponaxis,fill:i({},t.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:L(),marker:i({symbol:s.symbol,opacity:s.opacity,angle:s.angle,angleref:s.angleref,standoff:s.standoff,maxdisplayed:s.maxdisplayed,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,line:i({width:c.width,editType:"calc"},a("marker.line")),gradient:s.gradient,editType:"calc"},a("marker")),textfont:t.textfont,textposition:t.textposition,selected:t.selected,unselected:t.unselected,hoverinfo:i({},r.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:t.hoveron,hovertemplate:v(),hovertemplatefallback:M()}}}),LM=Re({"src/traces/scatterternary/defaults.js"(ae,K){var v=Rn(),S=Wg(),M=Mu(),L=Yp(),t=xg(),r=Zp(),a=Sm(),l=Rp(),i=G3();K.exports=function(o,c,p,d){function y(I,T){return v.coerce(o,c,i,I,T)}var g=y("a"),C=y("b"),f=y("c"),x;if(g?(x=g.length,C?(x=Math.min(x,C.length),f&&(x=Math.min(x,f.length))):f?x=Math.min(x,f.length):x=0):C&&f&&(x=Math.min(C.length,f.length)),!x){c.visible=!1;return}c._length=x,y("sum"),y("text"),y("hovertext"),c.hoveron!=="fills"&&(y("hovertemplate"),y("hovertemplatefallback"));var A=x"),l.hovertemplate=d.hovertemplate,a}}}),zM=Re({"src/traces/scatterternary/event_data.js"(ae,K){K.exports=function(S,M,L,t,r){if(M.xa&&(S.xaxis=M.xa),M.ya&&(S.yaxis=M.ya),t[r]){var a=t[r];S.a=a.a,S.b=a.b,S.c=a.c}else S.a=M.a,S.b=M.b,S.c=M.c;return S}}}),q3=Re({"src/plots/ternary/ternary.js"(ae,K){var v=un(),S=oo(),M=es(),L=Rn(),t=L.strTranslate,r=L._,a=ko(),l=qs(),i=bm(),s=Li().extendFlat,o=If(),c=js(),p=fv(),d=Sh(),y=gg(),g=y.freeMode,C=y.rectMode,f=vy(),x=Dh().prepSelect,A=Dh().selectOnClick,k=Dh().clearOutline,I=Dh().clearSelectionsCache,T=qh();function E(O,H){this.id=O.id,this.graphDiv=O.graphDiv,this.init(H),this.makeFramework(H),this.updateFx(H),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}K.exports=E;var _=E.prototype;_.init=function(O){this.container=O._ternarylayer,this.defs=O._defs,this.layoutId=O._uid,this.traceHash={},this.layers={}},_.plot=function(O,H){var W=this,ee=H[W.id],ue=H._size;W._hasClipOnAxisFalse=!1;for(var xe=0;xeh*se?(Te=se,pe=Te*h):(pe=Y,Te=pe/h),Ne=ge*pe/Y,$e=_e*Te/se,Z=H.l+H.w*ue-pe/2,de=H.t+H.h*(1-xe)-Te/2,W.x0=Z,W.y0=de,W.w=pe,W.h=Te,W.sum=ce,W.xaxis={type:"linear",range:[ne+2*le-ce,ce-ne-2*ye],domain:[ue-Ne/2,ue+Ne/2],_id:"x"},i(W.xaxis,W.graphDiv._fullLayout),W.xaxis.setScale(),W.xaxis.isPtWithinRange=function(Je){return Je.a>=W.aaxis.range[0]&&Je.a<=W.aaxis.range[1]&&Je.b>=W.baxis.range[1]&&Je.b<=W.baxis.range[0]&&Je.c>=W.caxis.range[1]&&Je.c<=W.caxis.range[0]},W.yaxis={type:"linear",range:[ne,ce-ye-le],domain:[xe-$e/2,xe+$e/2],_id:"y"},i(W.yaxis,W.graphDiv._fullLayout),W.yaxis.setScale(),W.yaxis.isPtWithinRange=function(){return!0};var Ze=W.yaxis.domain[0],Xe=W.aaxis=s({},O.aaxis,{range:[ne,ce-ye-le],side:"left",tickangle:(+O.aaxis.tickangle||0)-30,domain:[Ze,Ze+$e*h],anchor:"free",position:0,_id:"y",_length:pe});i(Xe,W.graphDiv._fullLayout),Xe.setScale();var it=W.baxis=s({},O.baxis,{range:[ce-ne-le,ye],side:"bottom",domain:W.xaxis.domain,anchor:"free",position:0,_id:"x",_length:pe});i(it,W.graphDiv._fullLayout),it.setScale();var yt=W.caxis=s({},O.caxis,{range:[ce-ne-ye,le],side:"right",tickangle:(+O.caxis.tickangle||0)+30,domain:[Ze,Ze+$e*h],anchor:"free",position:0,_id:"y",_length:pe});i(yt,W.graphDiv._fullLayout),yt.setScale();var bt="M"+Z+","+(de+Te)+"h"+pe+"l-"+pe/2+",-"+Te+"Z";W.clipDef.select("path").attr("d",bt),W.layers.plotbg.select("path").attr("d",bt);var mt="M0,"+Te+"h"+pe+"l-"+pe/2+",-"+Te+"Z";W.clipDefRelative.select("path").attr("d",mt);var ht=t(Z,de);W.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",ht),W.clipDefRelative.select("path").attr("transform",null);var Ve=t(Z-it._offset,de+Te);W.layers.baxis.attr("transform",Ve),W.layers.bgrid.attr("transform",Ve);var ze=t(Z+pe/2,de)+"rotate(30)"+t(0,-Xe._offset);W.layers.aaxis.attr("transform",ze),W.layers.agrid.attr("transform",ze);var Se=t(Z+pe/2,de)+"rotate(-30)"+t(0,-yt._offset);W.layers.caxis.attr("transform",Se),W.layers.cgrid.attr("transform",Se),W.drawAxes(!0),W.layers.aline.select("path").attr("d",Xe.showline?"M"+Z+","+(de+Te)+"l"+pe/2+",-"+Te:"M0,0").call(a.stroke,Xe.linecolor||"#000").style("stroke-width",(Xe.linewidth||0)+"px"),W.layers.bline.select("path").attr("d",it.showline?"M"+Z+","+(de+Te)+"h"+pe:"M0,0").call(a.stroke,it.linecolor||"#000").style("stroke-width",(it.linewidth||0)+"px"),W.layers.cline.select("path").attr("d",yt.showline?"M"+(Z+pe/2)+","+de+"l"+pe/2+","+Te:"M0,0").call(a.stroke,yt.linecolor||"#000").style("stroke-width",(yt.linewidth||0)+"px"),W.graphDiv._context.staticPlot||W.initInteractions(),l.setClipUrl(W.layers.frontplot,W._hasClipOnAxisFalse?null:W.clipId,W.graphDiv)},_.drawAxes=function(O){var H=this,W=H.graphDiv,ee=H.id.slice(7)+"title",ue=H.layers,xe=H.aaxis,ge=H.baxis,_e=H.caxis;if(H.drawAx(xe),H.drawAx(ge),H.drawAx(_e),O){var Y=Math.max(xe.showticklabels?xe.tickfont.size/2:0,(_e.showticklabels?_e.tickfont.size*.75:0)+(_e.ticks==="outside"?_e.ticklen*.87:0)),se=(ge.showticklabels?ge.tickfont.size:0)+(ge.ticks==="outside"?ge.ticklen:0)+3;ue["a-title"]=f.draw(W,"a"+ee,{propContainer:xe,propName:H.id+".aaxis.title.text",placeholder:r(W,"Click to enter Component A title"),attributes:{x:H.x0+H.w/2,y:H.y0-xe.title.font.size/3-Y,"text-anchor":"middle"}}),ue["b-title"]=f.draw(W,"b"+ee,{propContainer:ge,propName:H.id+".baxis.title.text",placeholder:r(W,"Click to enter Component B title"),attributes:{x:H.x0-se,y:H.y0+H.h+ge.title.font.size*.83+se,"text-anchor":"middle"}}),ue["c-title"]=f.draw(W,"c"+ee,{propContainer:_e,propName:H.id+".caxis.title.text",placeholder:r(W,"Click to enter Component C title"),attributes:{x:H.x0+H.w+se,y:H.y0+H.h+_e.title.font.size*.83+se,"text-anchor":"middle"}})}},_.drawAx=function(O){var H=this,W=H.graphDiv,ee=O._name,ue=ee.charAt(0),xe=O._id,ge=H.layers[ee],_e=30,Y=ue+"tickLayout",se=m(O);H[Y]!==se&&(ge.selectAll("."+xe+"tick").remove(),H[Y]=se),O.setScale();var ce=c.calcTicks(O),ne=c.clipEnds(O,ce),ye=c.makeTransTickFn(O),le=c.getTickSigns(O)[2],Z=L.deg2rad(_e),de=le*(O.linewidth||1)/2,pe=le*O.ticklen,Te=H.w,Ne=H.h,$e=ue==="b"?"M0,"+de+"l"+Math.sin(Z)*pe+","+Math.cos(Z)*pe:"M"+de+",0l"+Math.cos(Z)*pe+","+-Math.sin(Z)*pe,Ze={a:"M0,0l"+Ne+",-"+Te/2,b:"M0,0l-"+Te/2+",-"+Ne,c:"M0,0l-"+Ne+","+Te/2}[ue];c.drawTicks(W,O,{vals:O.ticks==="inside"?ne:ce,layer:ge,path:$e,transFn:ye,crisp:!1}),c.drawGrid(W,O,{vals:ne,layer:H.layers[ue+"grid"],path:Ze,transFn:ye,crisp:!1}),c.drawLabels(W,O,{vals:ce,layer:ge,transFn:ye,labelFns:c.makeLabelFns(O,0,_e)})};function m(O){return O.ticks+String(O.ticklen)+String(O.showticklabels)}var w=T.MINZOOM/2+.87,F="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(w*.87+4.5)+"l2.6,1.5l-"+w/2+","+w*.87+"Z",z="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(w*.87+4.5)+"l-2.6,1.5l"+w/2+","+w*.87+"Z",U="m0,1l"+w/2+","+w*.87+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(w*.87+4.5)+"l-"+(w/2+2.6)+","+(w*.87+4.5)+"l2.6,1.5l"+w/2+",-"+w*.87+"Z",V="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",G=!0;_.clearOutline=function(){I(this.dragOptions),k(this.dragOptions.gd)},_.initInteractions=function(){var O=this,H=O.layers.plotbg.select("path").node(),W=O.graphDiv,ee=W._fullLayout._zoomlayer,ue,xe;this.dragOptions={element:H,gd:W,plotinfo:{id:O.id,domain:W._fullLayout[O.id].domain,xaxis:O.xaxis,yaxis:O.yaxis},subplot:O.id,prepFn:function(Ve,ze,Se){O.dragOptions.xaxes=[O.xaxis],O.dragOptions.yaxes=[O.yaxis],ue=W._fullLayout._invScaleX,xe=W._fullLayout._invScaleY;var Je=O.dragOptions.dragmode=W._fullLayout.dragmode;g(Je)?O.dragOptions.minDrag=1:O.dragOptions.minDrag=void 0,Je==="zoom"?(O.dragOptions.moveFn=it,O.dragOptions.clickFn=Te,O.dragOptions.doneFn=yt,Ne(Ve,ze,Se)):Je==="pan"?(O.dragOptions.moveFn=mt,O.dragOptions.clickFn=Te,O.dragOptions.doneFn=ht,bt(),O.clearOutline(W)):(C(Je)||g(Je))&&x(Ve,ze,Se,O.dragOptions,Je)}};var ge,_e,Y,se,ce,ne,ye,le,Z,de;function pe(Ve){var ze={};return ze[O.id+".aaxis.min"]=Ve.a,ze[O.id+".baxis.min"]=Ve.b,ze[O.id+".caxis.min"]=Ve.c,ze}function Te(Ve,ze){var Se=W._fullLayout.clickmode;j(W),Ve===2&&(W.emit("plotly_doubleclick",null),M.call("_guiRelayout",W,pe({a:0,b:0,c:0}))),Se.indexOf("select")>-1&&Ve===1&&A(ze,W,[O.xaxis],[O.yaxis],O.id,O.dragOptions),Se.indexOf("event")>-1&&d.click(W,ze,O.id)}function Ne(Ve,ze,Se){var Je=H.getBoundingClientRect();ge=ze-Je.left,_e=Se-Je.top,W._fullLayout._calcInverseTransform(W);var _t=W._fullLayout._invTransform,At=L.apply3DTransform(_t)(ge,_e);ge=At[0],_e=At[1],Y={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},ce=Y,se=O.aaxis.range[1]-Y.a,ne=S(O.graphDiv._fullLayout[O.id].bgcolor).getLuminance(),ye="M0,"+O.h+"L"+O.w/2+", 0L"+O.w+","+O.h+"Z",le=!1,Z=ee.append("path").attr("class","zoombox").attr("transform",t(O.x0,O.y0)).style({fill:ne>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",ye),de=ee.append("path").attr("class","zoombox-corners").attr("transform",t(O.x0,O.y0)).style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),O.clearOutline(W)}function $e(Ve,ze){return 1-ze/O.h}function Ze(Ve,ze){return 1-(Ve+(O.h-ze)/Math.sqrt(3))/O.w}function Xe(Ve,ze){return(Ve-(O.h-ze)/Math.sqrt(3))/O.w}function it(Ve,ze){var Se=ge+Ve*ue,Je=_e+ze*xe,_t=Math.max(0,Math.min(1,$e(ge,_e),$e(Se,Je))),At=Math.max(0,Math.min(1,Ze(ge,_e),Ze(Se,Je))),vt=Math.max(0,Math.min(1,Xe(ge,_e),Xe(Se,Je))),Kt=(_t/2+vt)*O.w,Qt=(1-_t/2-At)*O.w,fr=(Kt+Qt)/2,mr=Qt-Kt,Ur=(1-_t)*O.h,Br=Ur-mr/h;mr.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),de.transition().style("opacity",1).duration(200),le=!0),W.emit("plotly_relayouting",pe(ce))}function yt(){j(W),ce!==Y&&(M.call("_guiRelayout",W,pe(ce)),G&&W.data&&W._context.showTips&&(L.notifier(r(W,"Double-click to zoom back out"),"long"),G=!1))}function bt(){Y={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},ce=Y}function mt(Ve,ze){var Se=Ve/O.xaxis._m,Je=ze/O.yaxis._m;ce={a:Y.a-Je,b:Y.b+(Se+Je)/2,c:Y.c-(Se-Je)/2};var _t=[ce.a,ce.b,ce.c].sort(L.sorterAsc),At={a:_t.indexOf(ce.a),b:_t.indexOf(ce.b),c:_t.indexOf(ce.c)};_t[0]<0&&(_t[1]+_t[0]/2<0?(_t[2]+=_t[0]+_t[1],_t[0]=_t[1]=0):(_t[2]+=_t[0]/2,_t[1]+=_t[0]/2,_t[0]=0),ce={a:_t[At.a],b:_t[At.b],c:_t[At.c]},ze=(Y.a-ce.a)*O.yaxis._m,Ve=(Y.c-ce.c-Y.b+ce.b)*O.xaxis._m);var vt=t(O.x0+Ve,O.y0+ze);O.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",vt);var Kt=t(-Ve,-ze);O.clipDefRelative.select("path").attr("transform",Kt),O.aaxis.range=[ce.a,O.sum-ce.b-ce.c],O.baxis.range=[O.sum-ce.a-ce.c,ce.b],O.caxis.range=[O.sum-ce.a-ce.b,ce.c],O.drawAxes(!1),O._hasClipOnAxisFalse&&O.plotContainer.select(".scatterlayer").selectAll(".trace").call(l.hideOutsideRangePoints,O),W.emit("plotly_relayouting",pe(ce))}function ht(){M.call("_guiRelayout",W,pe(ce))}H.onmousemove=function(Ve){d.hover(W,Ve,O.id),W._fullLayout._lasthover=H,W._fullLayout._hoversubplot=O.id},H.onmouseout=function(Ve){W._dragging||p.unhover(W,Ve)},p.init(this.dragOptions)};function j(O){v.select(O).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),r5=Re({"src/plots/ternary/layout_attributes.js"(ae,K){var v=du(),S=af().attributes,M=Hd(),L=bf().overrideAll,t=Li().extendFlat,r={title:{text:M.title.text,font:M.title.font},color:M.color,tickmode:M.minor.tickmode,nticks:t({},M.nticks,{dflt:6,min:1}),tick0:M.tick0,dtick:M.dtick,tickvals:M.tickvals,ticktext:M.ticktext,ticks:M.ticks,ticklen:M.ticklen,tickwidth:M.tickwidth,tickcolor:M.tickcolor,ticklabelstep:M.ticklabelstep,showticklabels:M.showticklabels,labelalias:M.labelalias,showtickprefix:M.showtickprefix,tickprefix:M.tickprefix,showticksuffix:M.showticksuffix,ticksuffix:M.ticksuffix,showexponent:M.showexponent,exponentformat:M.exponentformat,minexponent:M.minexponent,separatethousands:M.separatethousands,tickfont:M.tickfont,tickangle:M.tickangle,tickformat:M.tickformat,tickformatstops:M.tickformatstops,hoverformat:M.hoverformat,showline:t({},M.showline,{dflt:!0}),linecolor:M.linecolor,linewidth:M.linewidth,showgrid:t({},M.showgrid,{dflt:!0}),gridcolor:M.gridcolor,gridwidth:M.gridwidth,griddash:M.griddash,layer:M.layer,min:{valType:"number",dflt:0,min:0}},a=K.exports=L({domain:S({name:"ternary"}),bgcolor:{valType:"color",dflt:v.background},sum:{valType:"number",dflt:1,min:0},aaxis:r,baxis:r,caxis:r},"plot","from-root");a.uirevision={valType:"any",editType:"none"},a.aaxis.uirevision=a.baxis.uirevision=a.caxis.uirevision={valType:"any",editType:"none"}}}),F0=Re({"src/plots/subplot_defaults.js"(ae,K){var v=Rn(),S=Bu(),M=af().defaults;K.exports=function(t,r,a,l){var i=l.type,s=l.attributes,o=l.handleDefaults,c=l.partition||"x",p=r._subplots[i],d=p.length,y=d&&p[0].replace(/\d+$/,""),g,C;function f(I,T){return v.coerce(g,C,s,I,T)}for(var x=0;x=x&&(E.min=0,_.min=0,h.min=0,d.aaxis&&delete d.aaxis.min,d.baxis&&delete d.baxis.min,d.caxis&&delete d.caxis.min)}function p(d,y,g,C){var f=s[y._name];function x(m,w){return M.coerce(d,y,f,m,w)}x("uirevision",C.uirevision),y.type="linear";var A=x("color"),k=A!==f.color.dflt?A:g.font.color,I=y._name,T=I.charAt(0).toUpperCase(),E="Component "+T,_=x("title.text",E);y._hovertitle=_===E?_:T,M.coerceFont(x,"title.font",g.font,{overrideDflt:{size:M.bigFont(g.font.size),color:k}}),x("min"),l(d,y,x,"linear"),r(d,y,x,"linear"),t(d,y,x,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),a(d,y,x,{outerTicks:!0});var h=x("showticklabels");h&&(M.coerceFont(x,"tickfont",g.font,{overrideDflt:{color:k}}),x("tickangle"),x("tickformat")),i(d,y,x,{dfltColor:A,bgColor:g.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:f}),x("hoverformat"),x("layer")}}}),OM=Re({"src/plots/ternary/index.js"(ae){var K=q3(),v=Lp().getSubplotCalcData,S=Rn().counterRegex,M="ternary";ae.name=M;var L=ae.attr="subplot";ae.idRoot=M,ae.idRegex=ae.attrRegex=S(M);var t=ae.attributes={};t[L]={valType:"subplotid",dflt:"ternary",editType:"calc"},ae.layoutAttributes=r5(),ae.supplyLayoutDefaults=NM(),ae.plot=function(a){for(var l=a._fullLayout,i=a.calcdata,s=l._subplots[M],o=0;o0){var I=a.xa,T=a.ya,E,_,h,m,w;d.orientation==="h"?(w=l,E="y",h=T,_="x",m=I):(w=i,E="x",h=I,_="y",m=T);var F=p[a.index];if(w>=F.span[0]&&w<=F.span[1]){var z=S.extendFlat({},a),U=m.c2p(w,!0),V=t.getKdeValue(F,d,w),G=t.getPositionOnKdePath(F,d,U),j=h._offset,O=h._length;z[E+"0"]=G[0],z[E+"1"]=G[1],z[_+"0"]=z[_+"1"]=U,z[_+"Label"]=_+": "+M.hoverLabelText(m,w,d[_+"hoverformat"])+", "+p[0].t.labels.kde+" "+V.toFixed(3);for(var H=0,W=0;W path").each(function(g){if(!g.isBlank){var C=y.marker;v.select(this).call(M.fill,g.mc||C.color).call(M.stroke,g.mlc||C.line.color).call(S.dashLine,C.line.dash,g.mlw||C.line.width).style("opacity",y.selectedpoints&&!g.selected?L:1)}}),a(d,y,i),d.selectAll(".regions").each(function(){v.select(this).selectAll("path").style("stroke-width",0).call(M.fill,y.connector.fillcolor)}),d.selectAll(".lines").each(function(){var g=y.connector.line;S.lineGroupStyle(v.select(this).selectAll("path"),g.width,g.color,g.dash)})})}K.exports={style:l}}}),h5=Re({"src/traces/funnel/hover.js"(ae,K){var v=ko().opacity,S=of().hoverOnBars,M=Rn().formatPercent;K.exports=function(r,a,l,i,s){var o=S(r,a,l,i,s);if(o){var c=o.cd,p=c[0].trace,d=p.orientation==="h",y=o.index,g=c[y],C=d?"x":"y";o[C+"LabelVal"]=g.s,o.percentInitial=g.begR,o.percentInitialLabel=M(g.begR,1),o.percentPrevious=g.difR,o.percentPreviousLabel=M(g.difR,1),o.percentTotal=g.sumR,o.percentTotalLabel=M(g.sumR,1);var f=g.hi||p.hoverinfo,x=[];if(f&&f!=="none"&&f!=="skip"){var A=f==="all",k=f.split("+"),I=function(T){return A||k.indexOf(T)!==-1};I("percent initial")&&x.push(o.percentInitialLabel+" of initial"),I("percent previous")&&x.push(o.percentPreviousLabel+" of previous"),I("percent total")&&x.push(o.percentTotalLabel+" of total")}return o.extraText=x.join("
"),o.color=L(p,g),[o]}};function L(t,r){var a=t.marker,l=r.mc||a.color,i=r.mlc||a.line.color,s=r.mlw||a.line.width;if(v(l))return l;if(v(i)&&s)return i}}}),GM=Re({"src/traces/funnel/event_data.js"(ae,K){K.exports=function(S,M){return S.x="xVal"in M?M.xVal:M.x,S.y="yVal"in M?M.yVal:M.y,"percentInitial"in M&&(S.percentInitial=M.percentInitial),"percentPrevious"in M&&(S.percentPrevious=M.percentPrevious),"percentTotal"in M&&(S.percentTotal=M.percentTotal),M.xa&&(S.xaxis=M.xa),M.ya&&(S.yaxis=M.ya),S}}}),d5=Re({"src/traces/funnel/index.js"(ae,K){K.exports={attributes:i5(),layoutAttributes:o5(),supplyDefaults:s5().supplyDefaults,crossTraceDefaults:s5().crossTraceDefaults,supplyLayoutDefaults:l5(),calc:c5(),crossTraceCalc:jM(),plot:f5(),style:Y3().style,hoverPoints:h5(),eventData:GM(),selectPoints:My(),moduleType:"trace",name:"funnel",basePlotModule:td(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),qM=Re({"lib/funnel.js"(ae,K){K.exports=d5()}}),B0=Re({"src/traces/waterfall/constants.js"(ae,K){K.exports={eventDataKeys:["initial","delta","final"]}}}),Z3=Re({"src/traces/waterfall/attributes.js"(ae,K){var v=Md(),S=wf().line,M=As(),L=$c().axisHoverFormat,{hovertemplateAttrs:t,texttemplateAttrs:r,templatefallbackAttrs:a}=Wl(),l=B0(),i=Li().extendFlat,s=ko();function o(c){return{marker:{color:i({},v.marker.color,{arrayOk:!1,editType:"style"}),line:{color:i({},v.marker.line.color,{arrayOk:!1,editType:"style"}),width:i({},v.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}K.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:v.x,x0:v.x0,dx:v.dx,y:v.y,y0:v.y0,dy:v.dy,xperiod:v.xperiod,yperiod:v.yperiod,xperiod0:v.xperiod0,yperiod0:v.yperiod0,xperiodalignment:v.xperiodalignment,yperiodalignment:v.yperiodalignment,xhoverformat:L("x"),yhoverformat:L("y"),hovertext:v.hovertext,hovertemplate:t({},{keys:l.eventDataKeys}),hovertemplatefallback:a(),hoverinfo:i({},M.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:r({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),texttemplatefallback:a({editType:"plot"}),text:v.text,textposition:v.textposition,insidetextanchor:v.insidetextanchor,textangle:v.textangle,textfont:v.textfont,insidetextfont:v.insidetextfont,outsidetextfont:v.outsidetextfont,constraintext:v.constraintext,cliponaxis:v.cliponaxis,orientation:v.orientation,offset:v.offset,width:v.width,increasing:o(),decreasing:o(),totals:o(),connector:{line:{color:i({},S.color,{dflt:s.defaultLine}),width:i({},S.width,{editType:"plot"}),dash:S.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:v.offsetgroup,alignmentgroup:v.alignmentgroup,zorder:v.zorder}}}),HM=Re({"src/traces/waterfall/layout_attributes.js"(ae,K){K.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"}}}}),rx=Re({"src/constants/delta.js"(ae,K){K.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),Jg=Re({"src/traces/waterfall/defaults.js"(ae,K){var v=Rn(),S=R0(),M=Wv().handleText,L=yg(),t=_g(),r=Z3(),a=ko(),l=rx(),i=l.INCREASING.COLOR,s=l.DECREASING.COLOR,o="#4499FF";function c(y,g,C){y(g+".marker.color",C),y(g+".marker.line.color",a.defaultLine),y(g+".marker.line.width")}function p(y,g,C,f){function x(E,_){return v.coerce(y,g,r,E,_)}var A=L(y,g,f,x);if(!A){g.visible=!1;return}t(y,g,f,x),x("xhoverformat"),x("yhoverformat"),x("measure"),x("orientation",g.x&&!g.y?"h":"v"),x("base"),x("offset"),x("width"),x("text"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var k=x("textposition");M(y,g,f,x,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),g.textposition!=="none"&&(x("texttemplate"),x("texttemplatefallback"),g.texttemplate||x("textinfo")),c(x,"increasing",i),c(x,"decreasing",s),c(x,"totals",o);var I=x("connector.visible");if(I){x("connector.mode");var T=x("connector.line.width");T&&(x("connector.line.color"),x("connector.line.dash"))}x("zorder")}function d(y,g){var C,f;function x(k){return v.coerce(f._input,f,r,k)}if(g.waterfallmode==="group")for(var A=0;A0&&(x?w+="M"+h[0]+","+m[1]+"V"+m[0]:w+="M"+h[1]+","+m[0]+"H"+h[0]),A!=="between"&&(T.isSum||E path").each(function(g){if(!g.isBlank){var C=y[g.dir].marker;v.select(this).call(M.fill,C.color).call(M.stroke,C.line.color).call(S.dashLine,C.line.dash,C.line.width).style("opacity",y.selectedpoints&&!g.selected?L:1)}}),a(d,y,i),d.selectAll(".lines").each(function(){var g=y.connector.line;S.lineGroupStyle(v.select(this).selectAll("path"),g.width,g.color,g.dash)})})}K.exports={style:l}}}),eP=Re({"src/traces/waterfall/hover.js"(ae,K){var v=js().hoverLabelText,S=ko().opacity,M=of().hoverOnBars,L=rx(),t={increasing:L.INCREASING.SYMBOL,decreasing:L.DECREASING.SYMBOL};K.exports=function(l,i,s,o,c){var p=M(l,i,s,o,c);if(!p)return;var d=p.cd,y=d[0].trace,g=y.orientation==="h",C=g?"x":"y",f=g?l.xa:l.ya;function x(F){return v(f,F,y[C+"hoverformat"])}var A=p.index,k=d[A],I=k.isSum?k.b+k.s:k.rawS;p.initial=k.b+k.s-I,p.delta=I,p.final=p.initial+p.delta;var T=x(Math.abs(p.delta));p.deltaLabel=I<0?"("+T+")":T,p.finalLabel=x(p.final),p.initialLabel=x(p.initial);var E=k.hi||y.hoverinfo,_=[];if(E&&E!=="none"&&E!=="skip"){var h=E==="all",m=E.split("+"),w=function(F){return h||m.indexOf(F)!==-1};k.isSum||(w("final")&&(g?!w("x"):!w("y"))&&_.push(p.finalLabel),w("delta")&&(I<0?_.push(p.deltaLabel+" "+t.decreasing):_.push(p.deltaLabel+" "+t.increasing)),w("initial")&&_.push("Initial: "+p.initialLabel))}return _.length&&(p.extraText=_.join("
")),p.color=r(y,k),[p]};function r(a,l){var i=a[l.dir].marker,s=i.color,o=i.line.color,c=i.line.width;if(S(s))return s;if(S(o)&&c)return o}}}),tP=Re({"src/traces/waterfall/event_data.js"(ae,K){K.exports=function(S,M){return S.x="xVal"in M?M.xVal:M.x,S.y="yVal"in M?M.yVal:M.y,"initial"in M&&(S.initial=M.initial),"delta"in M&&(S.delta=M.delta),"final"in M&&(S.final=M.final),M.xa&&(S.xaxis=M.xa),M.ya&&(S.yaxis=M.ya),S}}}),XM=Re({"src/traces/waterfall/index.js"(ae,K){K.exports={attributes:Z3(),layoutAttributes:HM(),supplyDefaults:Jg().supplyDefaults,crossTraceDefaults:Jg().crossTraceDefaults,supplyLayoutDefaults:p5(),calc:WM(),crossTraceCalc:K3(),plot:ow(),style:Ph().style,hoverPoints:eP(),eventData:tP(),selectPoints:My(),moduleType:"trace",name:"waterfall",basePlotModule:td(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),sw=Re({"lib/waterfall.js"(ae,K){K.exports=XM()}}),Xm=Re({"src/traces/image/constants.js"(ae,K){K.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(v){return v.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(v){return v.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(v){return v.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(v){var S=v.slice(0,3);return S[1]=S[1]+"%",S[2]=S[2]+"%",S},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(v){var S=v.slice(0,4);return S[1]=S[1]+"%",S[2]=S[2]+"%",S},suffix:["°","%","%",""]}}}}}),v5=Re({"src/traces/image/attributes.js"(ae,K){var v=As(),S=wf().zorder,{hovertemplateAttrs:M,templatefallbackAttrs:L}=Wl(),t=Li().extendFlat,r=Xm().colormodel,a=["rgb","rgba","rgba256","hsl","hsla"],l=[],i=[];for(o=0;o0)throw new Error("Invalid string. Length must be a multiple of 4");var y=p.indexOf("=");y===-1&&(y=d);var g=y===d?0:4-y%4;return[y,g]}function a(p){var d=r(p),y=d[0],g=d[1];return(y+g)*3/4-g}function l(p,d,y){return(d+y)*3/4-y}function i(p){var d,y=r(p),g=y[0],C=y[1],f=new S(l(p,g,C)),x=0,A=C>0?g-4:g,k;for(k=0;k>16&255,f[x++]=d>>8&255,f[x++]=d&255;return C===2&&(d=v[p.charCodeAt(k)]<<2|v[p.charCodeAt(k+1)]>>4,f[x++]=d&255),C===1&&(d=v[p.charCodeAt(k)]<<10|v[p.charCodeAt(k+1)]<<4|v[p.charCodeAt(k+2)]>>2,f[x++]=d>>8&255,f[x++]=d&255),f}function s(p){return K[p>>18&63]+K[p>>12&63]+K[p>>6&63]+K[p&63]}function o(p,d,y){for(var g,C=[],f=d;fA?A:x+f));return g===1?(d=p[y-1],C.push(K[d>>2]+K[d<<4&63]+"==")):g===2&&(d=(p[y-2]<<8)+p[y-1],C.push(K[d>>10]+K[d>>4&63]+K[d<<2&63]+"=")),C.join("")}}}),m5=Re({"node_modules/ieee754/index.js"(ae){ae.read=function(K,v,S,M,L){var t,r,a=L*8-M-1,l=(1<>1,s=-7,o=S?L-1:0,c=S?-1:1,p=K[v+o];for(o+=c,t=p&(1<<-s)-1,p>>=-s,s+=a;s>0;t=t*256+K[v+o],o+=c,s-=8);for(r=t&(1<<-s)-1,t>>=-s,s+=M;s>0;r=r*256+K[v+o],o+=c,s-=8);if(t===0)t=1-i;else{if(t===l)return r?NaN:(p?-1:1)*(1/0);r=r+Math.pow(2,M),t=t-i}return(p?-1:1)*r*Math.pow(2,t-M)},ae.write=function(K,v,S,M,L,t){var r,a,l,i=t*8-L-1,s=(1<>1,c=L===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=M?0:t-1,d=M?1:-1,y=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===1/0?(a=isNaN(v)?1:0,r=s):(r=Math.floor(Math.log(v)/Math.LN2),v*(l=Math.pow(2,-r))<1&&(r--,l*=2),r+o>=1?v+=c/l:v+=c*Math.pow(2,1-o),v*l>=2&&(r++,l/=2),r+o>=s?(a=0,r=s):r+o>=1?(a=(v*l-1)*Math.pow(2,L),r=r+o):(a=v*Math.pow(2,o-1)*Math.pow(2,L),r=0));L>=8;K[S+p]=a&255,p+=d,a/=256,L-=8);for(r=r<0;K[S+p]=r&255,p+=d,r/=256,i-=8);K[S+p-d]|=y*128}}}),U1=Re({"node_modules/buffer/index.js"(ae){var K=ZM(),v=m5(),S=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ae.Buffer=r,ae.SlowBuffer=C,ae.INSPECT_MAX_BYTES=50;var M=2147483647;ae.kMaxLength=M,r.TYPED_ARRAY_SUPPORT=L(),!r.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function L(){try{const Ve=new Uint8Array(1),ze={foo:function(){return 42}};return Object.setPrototypeOf(ze,Uint8Array.prototype),Object.setPrototypeOf(Ve,ze),Ve.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function t(Ve){if(Ve>M)throw new RangeError('The value "'+Ve+'" is invalid for option "size"');const ze=new Uint8Array(Ve);return Object.setPrototypeOf(ze,r.prototype),ze}function r(Ve,ze,Se){if(typeof Ve=="number"){if(typeof ze=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return s(Ve)}return a(Ve,ze,Se)}r.poolSize=8192;function a(Ve,ze,Se){if(typeof Ve=="string")return o(Ve,ze);if(ArrayBuffer.isView(Ve))return p(Ve);if(Ve==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ve);if(it(Ve,ArrayBuffer)||Ve&&it(Ve.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(it(Ve,SharedArrayBuffer)||Ve&&it(Ve.buffer,SharedArrayBuffer)))return d(Ve,ze,Se);if(typeof Ve=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Je=Ve.valueOf&&Ve.valueOf();if(Je!=null&&Je!==Ve)return r.from(Je,ze,Se);const _t=y(Ve);if(_t)return _t;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ve[Symbol.toPrimitive]=="function")return r.from(Ve[Symbol.toPrimitive]("string"),ze,Se);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ve)}r.from=function(Ve,ze,Se){return a(Ve,ze,Se)},Object.setPrototypeOf(r.prototype,Uint8Array.prototype),Object.setPrototypeOf(r,Uint8Array);function l(Ve){if(typeof Ve!="number")throw new TypeError('"size" argument must be of type number');if(Ve<0)throw new RangeError('The value "'+Ve+'" is invalid for option "size"')}function i(Ve,ze,Se){return l(Ve),Ve<=0?t(Ve):ze!==void 0?typeof Se=="string"?t(Ve).fill(ze,Se):t(Ve).fill(ze):t(Ve)}r.alloc=function(Ve,ze,Se){return i(Ve,ze,Se)};function s(Ve){return l(Ve),t(Ve<0?0:g(Ve)|0)}r.allocUnsafe=function(Ve){return s(Ve)},r.allocUnsafeSlow=function(Ve){return s(Ve)};function o(Ve,ze){if((typeof ze!="string"||ze==="")&&(ze="utf8"),!r.isEncoding(ze))throw new TypeError("Unknown encoding: "+ze);const Se=f(Ve,ze)|0;let Je=t(Se);const _t=Je.write(Ve,ze);return _t!==Se&&(Je=Je.slice(0,_t)),Je}function c(Ve){const ze=Ve.length<0?0:g(Ve.length)|0,Se=t(ze);for(let Je=0;Je=M)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M.toString(16)+" bytes");return Ve|0}function C(Ve){return+Ve!=Ve&&(Ve=0),r.alloc(+Ve)}r.isBuffer=function(ze){return ze!=null&&ze._isBuffer===!0&&ze!==r.prototype},r.compare=function(ze,Se){if(it(ze,Uint8Array)&&(ze=r.from(ze,ze.offset,ze.byteLength)),it(Se,Uint8Array)&&(Se=r.from(Se,Se.offset,Se.byteLength)),!r.isBuffer(ze)||!r.isBuffer(Se))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ze===Se)return 0;let Je=ze.length,_t=Se.length;for(let At=0,vt=Math.min(Je,_t);At_t.length?(r.isBuffer(vt)||(vt=r.from(vt)),vt.copy(_t,At)):Uint8Array.prototype.set.call(_t,vt,At);else if(r.isBuffer(vt))vt.copy(_t,At);else throw new TypeError('"list" argument must be an Array of Buffers');At+=vt.length}return _t};function f(Ve,ze){if(r.isBuffer(Ve))return Ve.length;if(ArrayBuffer.isView(Ve)||it(Ve,ArrayBuffer))return Ve.byteLength;if(typeof Ve!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Ve);const Se=Ve.length,Je=arguments.length>2&&arguments[2]===!0;if(!Je&&Se===0)return 0;let _t=!1;for(;;)switch(ze){case"ascii":case"latin1":case"binary":return Se;case"utf8":case"utf-8":return Te(Ve).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Se*2;case"hex":return Se>>>1;case"base64":return Ze(Ve).length;default:if(_t)return Je?-1:Te(Ve).length;ze=(""+ze).toLowerCase(),_t=!0}}r.byteLength=f;function x(Ve,ze,Se){let Je=!1;if((ze===void 0||ze<0)&&(ze=0),ze>this.length||((Se===void 0||Se>this.length)&&(Se=this.length),Se<=0)||(Se>>>=0,ze>>>=0,Se<=ze))return"";for(Ve||(Ve="utf8");;)switch(Ve){case"hex":return j(this,ze,Se);case"utf8":case"utf-8":return F(this,ze,Se);case"ascii":return V(this,ze,Se);case"latin1":case"binary":return G(this,ze,Se);case"base64":return w(this,ze,Se);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,ze,Se);default:if(Je)throw new TypeError("Unknown encoding: "+Ve);Ve=(Ve+"").toLowerCase(),Je=!0}}r.prototype._isBuffer=!0;function A(Ve,ze,Se){const Je=Ve[ze];Ve[ze]=Ve[Se],Ve[Se]=Je}r.prototype.swap16=function(){const ze=this.length;if(ze%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Se=0;SeSe&&(ze+=" ... "),""},S&&(r.prototype[S]=r.prototype.inspect),r.prototype.compare=function(ze,Se,Je,_t,At){if(it(ze,Uint8Array)&&(ze=r.from(ze,ze.offset,ze.byteLength)),!r.isBuffer(ze))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ze);if(Se===void 0&&(Se=0),Je===void 0&&(Je=ze?ze.length:0),_t===void 0&&(_t=0),At===void 0&&(At=this.length),Se<0||Je>ze.length||_t<0||At>this.length)throw new RangeError("out of range index");if(_t>=At&&Se>=Je)return 0;if(_t>=At)return-1;if(Se>=Je)return 1;if(Se>>>=0,Je>>>=0,_t>>>=0,At>>>=0,this===ze)return 0;let vt=At-_t,Kt=Je-Se;const Qt=Math.min(vt,Kt),fr=this.slice(_t,At),mr=ze.slice(Se,Je);for(let Ur=0;Ur2147483647?Se=2147483647:Se<-2147483648&&(Se=-2147483648),Se=+Se,yt(Se)&&(Se=_t?0:Ve.length-1),Se<0&&(Se=Ve.length+Se),Se>=Ve.length){if(_t)return-1;Se=Ve.length-1}else if(Se<0)if(_t)Se=0;else return-1;if(typeof ze=="string"&&(ze=r.from(ze,Je)),r.isBuffer(ze))return ze.length===0?-1:I(Ve,ze,Se,Je,_t);if(typeof ze=="number")return ze=ze&255,typeof Uint8Array.prototype.indexOf=="function"?_t?Uint8Array.prototype.indexOf.call(Ve,ze,Se):Uint8Array.prototype.lastIndexOf.call(Ve,ze,Se):I(Ve,[ze],Se,Je,_t);throw new TypeError("val must be string, number or Buffer")}function I(Ve,ze,Se,Je,_t){let At=1,vt=Ve.length,Kt=ze.length;if(Je!==void 0&&(Je=String(Je).toLowerCase(),Je==="ucs2"||Je==="ucs-2"||Je==="utf16le"||Je==="utf-16le")){if(Ve.length<2||ze.length<2)return-1;At=2,vt/=2,Kt/=2,Se/=2}function Qt(mr,Ur){return At===1?mr[Ur]:mr.readUInt16BE(Ur*At)}let fr;if(_t){let mr=-1;for(fr=Se;frvt&&(Se=vt-Kt),fr=Se;fr>=0;fr--){let mr=!0;for(let Ur=0;Ur_t&&(Je=_t)):Je=_t;const At=ze.length;Je>At/2&&(Je=At/2);let vt;for(vt=0;vt>>0,isFinite(Je)?(Je=Je>>>0,_t===void 0&&(_t="utf8")):(_t=Je,Je=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const At=this.length-Se;if((Je===void 0||Je>At)&&(Je=At),ze.length>0&&(Je<0||Se<0)||Se>this.length)throw new RangeError("Attempt to write outside buffer bounds");_t||(_t="utf8");let vt=!1;for(;;)switch(_t){case"hex":return T(this,ze,Se,Je);case"utf8":case"utf-8":return E(this,ze,Se,Je);case"ascii":case"latin1":case"binary":return _(this,ze,Se,Je);case"base64":return h(this,ze,Se,Je);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,ze,Se,Je);default:if(vt)throw new TypeError("Unknown encoding: "+_t);_t=(""+_t).toLowerCase(),vt=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function w(Ve,ze,Se){return ze===0&&Se===Ve.length?K.fromByteArray(Ve):K.fromByteArray(Ve.slice(ze,Se))}function F(Ve,ze,Se){Se=Math.min(Ve.length,Se);const Je=[];let _t=ze;for(;_t239?4:At>223?3:At>191?2:1;if(_t+Kt<=Se){let Qt,fr,mr,Ur;switch(Kt){case 1:At<128&&(vt=At);break;case 2:Qt=Ve[_t+1],(Qt&192)===128&&(Ur=(At&31)<<6|Qt&63,Ur>127&&(vt=Ur));break;case 3:Qt=Ve[_t+1],fr=Ve[_t+2],(Qt&192)===128&&(fr&192)===128&&(Ur=(At&15)<<12|(Qt&63)<<6|fr&63,Ur>2047&&(Ur<55296||Ur>57343)&&(vt=Ur));break;case 4:Qt=Ve[_t+1],fr=Ve[_t+2],mr=Ve[_t+3],(Qt&192)===128&&(fr&192)===128&&(mr&192)===128&&(Ur=(At&15)<<18|(Qt&63)<<12|(fr&63)<<6|mr&63,Ur>65535&&Ur<1114112&&(vt=Ur))}}vt===null?(vt=65533,Kt=1):vt>65535&&(vt-=65536,Je.push(vt>>>10&1023|55296),vt=56320|vt&1023),Je.push(vt),_t+=Kt}return U(Je)}var z=4096;function U(Ve){const ze=Ve.length;if(ze<=z)return String.fromCharCode.apply(String,Ve);let Se="",Je=0;for(;JeJe)&&(Se=Je);let _t="";for(let At=ze;AtJe&&(ze=Je),Se<0?(Se+=Je,Se<0&&(Se=0)):Se>Je&&(Se=Je),SeSe)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUintLE=r.prototype.readUIntLE=function(ze,Se,Je){ze=ze>>>0,Se=Se>>>0,Je||H(ze,Se,this.length);let _t=this[ze],At=1,vt=0;for(;++vt>>0,Se=Se>>>0,Je||H(ze,Se,this.length);let _t=this[ze+--Se],At=1;for(;Se>0&&(At*=256);)_t+=this[ze+--Se]*At;return _t},r.prototype.readUint8=r.prototype.readUInt8=function(ze,Se){return ze=ze>>>0,Se||H(ze,1,this.length),this[ze]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(ze,Se){return ze=ze>>>0,Se||H(ze,2,this.length),this[ze]|this[ze+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(ze,Se){return ze=ze>>>0,Se||H(ze,2,this.length),this[ze]<<8|this[ze+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(ze,Se){return ze=ze>>>0,Se||H(ze,4,this.length),(this[ze]|this[ze+1]<<8|this[ze+2]<<16)+this[ze+3]*16777216},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(ze,Se){return ze=ze>>>0,Se||H(ze,4,this.length),this[ze]*16777216+(this[ze+1]<<16|this[ze+2]<<8|this[ze+3])},r.prototype.readBigUInt64LE=mt(function(ze){ze=ze>>>0,le(ze,"offset");const Se=this[ze],Je=this[ze+7];(Se===void 0||Je===void 0)&&Z(ze,this.length-8);const _t=Se+this[++ze]*2**8+this[++ze]*2**16+this[++ze]*2**24,At=this[++ze]+this[++ze]*2**8+this[++ze]*2**16+Je*2**24;return BigInt(_t)+(BigInt(At)<>>0,le(ze,"offset");const Se=this[ze],Je=this[ze+7];(Se===void 0||Je===void 0)&&Z(ze,this.length-8);const _t=Se*2**24+this[++ze]*2**16+this[++ze]*2**8+this[++ze],At=this[++ze]*2**24+this[++ze]*2**16+this[++ze]*2**8+Je;return(BigInt(_t)<>>0,Se=Se>>>0,Je||H(ze,Se,this.length);let _t=this[ze],At=1,vt=0;for(;++vt=At&&(_t-=Math.pow(2,8*Se)),_t},r.prototype.readIntBE=function(ze,Se,Je){ze=ze>>>0,Se=Se>>>0,Je||H(ze,Se,this.length);let _t=Se,At=1,vt=this[ze+--_t];for(;_t>0&&(At*=256);)vt+=this[ze+--_t]*At;return At*=128,vt>=At&&(vt-=Math.pow(2,8*Se)),vt},r.prototype.readInt8=function(ze,Se){return ze=ze>>>0,Se||H(ze,1,this.length),this[ze]&128?(255-this[ze]+1)*-1:this[ze]},r.prototype.readInt16LE=function(ze,Se){ze=ze>>>0,Se||H(ze,2,this.length);const Je=this[ze]|this[ze+1]<<8;return Je&32768?Je|4294901760:Je},r.prototype.readInt16BE=function(ze,Se){ze=ze>>>0,Se||H(ze,2,this.length);const Je=this[ze+1]|this[ze]<<8;return Je&32768?Je|4294901760:Je},r.prototype.readInt32LE=function(ze,Se){return ze=ze>>>0,Se||H(ze,4,this.length),this[ze]|this[ze+1]<<8|this[ze+2]<<16|this[ze+3]<<24},r.prototype.readInt32BE=function(ze,Se){return ze=ze>>>0,Se||H(ze,4,this.length),this[ze]<<24|this[ze+1]<<16|this[ze+2]<<8|this[ze+3]},r.prototype.readBigInt64LE=mt(function(ze){ze=ze>>>0,le(ze,"offset");const Se=this[ze],Je=this[ze+7];(Se===void 0||Je===void 0)&&Z(ze,this.length-8);const _t=this[ze+4]+this[ze+5]*2**8+this[ze+6]*2**16+(Je<<24);return(BigInt(_t)<>>0,le(ze,"offset");const Se=this[ze],Je=this[ze+7];(Se===void 0||Je===void 0)&&Z(ze,this.length-8);const _t=(Se<<24)+this[++ze]*2**16+this[++ze]*2**8+this[++ze];return(BigInt(_t)<>>0,Se||H(ze,4,this.length),v.read(this,ze,!0,23,4)},r.prototype.readFloatBE=function(ze,Se){return ze=ze>>>0,Se||H(ze,4,this.length),v.read(this,ze,!1,23,4)},r.prototype.readDoubleLE=function(ze,Se){return ze=ze>>>0,Se||H(ze,8,this.length),v.read(this,ze,!0,52,8)},r.prototype.readDoubleBE=function(ze,Se){return ze=ze>>>0,Se||H(ze,8,this.length),v.read(this,ze,!1,52,8)};function W(Ve,ze,Se,Je,_t,At){if(!r.isBuffer(Ve))throw new TypeError('"buffer" argument must be a Buffer instance');if(ze>_t||zeVe.length)throw new RangeError("Index out of range")}r.prototype.writeUintLE=r.prototype.writeUIntLE=function(ze,Se,Je,_t){if(ze=+ze,Se=Se>>>0,Je=Je>>>0,!_t){const Kt=Math.pow(2,8*Je)-1;W(this,ze,Se,Je,Kt,0)}let At=1,vt=0;for(this[Se]=ze&255;++vt>>0,Je=Je>>>0,!_t){const Kt=Math.pow(2,8*Je)-1;W(this,ze,Se,Je,Kt,0)}let At=Je-1,vt=1;for(this[Se+At]=ze&255;--At>=0&&(vt*=256);)this[Se+At]=ze/vt&255;return Se+Je},r.prototype.writeUint8=r.prototype.writeUInt8=function(ze,Se,Je){return ze=+ze,Se=Se>>>0,Je||W(this,ze,Se,1,255,0),this[Se]=ze&255,Se+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(ze,Se,Je){return ze=+ze,Se=Se>>>0,Je||W(this,ze,Se,2,65535,0),this[Se]=ze&255,this[Se+1]=ze>>>8,Se+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(ze,Se,Je){return ze=+ze,Se=Se>>>0,Je||W(this,ze,Se,2,65535,0),this[Se]=ze>>>8,this[Se+1]=ze&255,Se+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(ze,Se,Je){return ze=+ze,Se=Se>>>0,Je||W(this,ze,Se,4,4294967295,0),this[Se+3]=ze>>>24,this[Se+2]=ze>>>16,this[Se+1]=ze>>>8,this[Se]=ze&255,Se+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(ze,Se,Je){return ze=+ze,Se=Se>>>0,Je||W(this,ze,Se,4,4294967295,0),this[Se]=ze>>>24,this[Se+1]=ze>>>16,this[Se+2]=ze>>>8,this[Se+3]=ze&255,Se+4};function ee(Ve,ze,Se,Je,_t){ye(ze,Je,_t,Ve,Se,7);let At=Number(ze&BigInt(4294967295));Ve[Se++]=At,At=At>>8,Ve[Se++]=At,At=At>>8,Ve[Se++]=At,At=At>>8,Ve[Se++]=At;let vt=Number(ze>>BigInt(32)&BigInt(4294967295));return Ve[Se++]=vt,vt=vt>>8,Ve[Se++]=vt,vt=vt>>8,Ve[Se++]=vt,vt=vt>>8,Ve[Se++]=vt,Se}function ue(Ve,ze,Se,Je,_t){ye(ze,Je,_t,Ve,Se,7);let At=Number(ze&BigInt(4294967295));Ve[Se+7]=At,At=At>>8,Ve[Se+6]=At,At=At>>8,Ve[Se+5]=At,At=At>>8,Ve[Se+4]=At;let vt=Number(ze>>BigInt(32)&BigInt(4294967295));return Ve[Se+3]=vt,vt=vt>>8,Ve[Se+2]=vt,vt=vt>>8,Ve[Se+1]=vt,vt=vt>>8,Ve[Se]=vt,Se+8}r.prototype.writeBigUInt64LE=mt(function(ze,Se=0){return ee(this,ze,Se,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeBigUInt64BE=mt(function(ze,Se=0){return ue(this,ze,Se,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeIntLE=function(ze,Se,Je,_t){if(ze=+ze,Se=Se>>>0,!_t){const Qt=Math.pow(2,8*Je-1);W(this,ze,Se,Je,Qt-1,-Qt)}let At=0,vt=1,Kt=0;for(this[Se]=ze&255;++At>0)-Kt&255;return Se+Je},r.prototype.writeIntBE=function(ze,Se,Je,_t){if(ze=+ze,Se=Se>>>0,!_t){const Qt=Math.pow(2,8*Je-1);W(this,ze,Se,Je,Qt-1,-Qt)}let At=Je-1,vt=1,Kt=0;for(this[Se+At]=ze&255;--At>=0&&(vt*=256);)ze<0&&Kt===0&&this[Se+At+1]!==0&&(Kt=1),this[Se+At]=(ze/vt>>0)-Kt&255;return Se+Je},r.prototype.writeInt8=function(ze,Se,Je){return ze=+ze,Se=Se>>>0,Je||W(this,ze,Se,1,127,-128),ze<0&&(ze=255+ze+1),this[Se]=ze&255,Se+1},r.prototype.writeInt16LE=function(ze,Se,Je){return ze=+ze,Se=Se>>>0,Je||W(this,ze,Se,2,32767,-32768),this[Se]=ze&255,this[Se+1]=ze>>>8,Se+2},r.prototype.writeInt16BE=function(ze,Se,Je){return ze=+ze,Se=Se>>>0,Je||W(this,ze,Se,2,32767,-32768),this[Se]=ze>>>8,this[Se+1]=ze&255,Se+2},r.prototype.writeInt32LE=function(ze,Se,Je){return ze=+ze,Se=Se>>>0,Je||W(this,ze,Se,4,2147483647,-2147483648),this[Se]=ze&255,this[Se+1]=ze>>>8,this[Se+2]=ze>>>16,this[Se+3]=ze>>>24,Se+4},r.prototype.writeInt32BE=function(ze,Se,Je){return ze=+ze,Se=Se>>>0,Je||W(this,ze,Se,4,2147483647,-2147483648),ze<0&&(ze=4294967295+ze+1),this[Se]=ze>>>24,this[Se+1]=ze>>>16,this[Se+2]=ze>>>8,this[Se+3]=ze&255,Se+4},r.prototype.writeBigInt64LE=mt(function(ze,Se=0){return ee(this,ze,Se,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),r.prototype.writeBigInt64BE=mt(function(ze,Se=0){return ue(this,ze,Se,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function xe(Ve,ze,Se,Je,_t,At){if(Se+Je>Ve.length)throw new RangeError("Index out of range");if(Se<0)throw new RangeError("Index out of range")}function ge(Ve,ze,Se,Je,_t){return ze=+ze,Se=Se>>>0,_t||xe(Ve,ze,Se,4),v.write(Ve,ze,Se,Je,23,4),Se+4}r.prototype.writeFloatLE=function(ze,Se,Je){return ge(this,ze,Se,!0,Je)},r.prototype.writeFloatBE=function(ze,Se,Je){return ge(this,ze,Se,!1,Je)};function _e(Ve,ze,Se,Je,_t){return ze=+ze,Se=Se>>>0,_t||xe(Ve,ze,Se,8),v.write(Ve,ze,Se,Je,52,8),Se+8}r.prototype.writeDoubleLE=function(ze,Se,Je){return _e(this,ze,Se,!0,Je)},r.prototype.writeDoubleBE=function(ze,Se,Je){return _e(this,ze,Se,!1,Je)},r.prototype.copy=function(ze,Se,Je,_t){if(!r.isBuffer(ze))throw new TypeError("argument should be a Buffer");if(Je||(Je=0),!_t&&_t!==0&&(_t=this.length),Se>=ze.length&&(Se=ze.length),Se||(Se=0),_t>0&&_t=this.length)throw new RangeError("Index out of range");if(_t<0)throw new RangeError("sourceEnd out of bounds");_t>this.length&&(_t=this.length),ze.length-Se<_t-Je&&(_t=ze.length-Se+Je);const At=_t-Je;return this===ze&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Se,Je,_t):Uint8Array.prototype.set.call(ze,this.subarray(Je,_t),Se),At},r.prototype.fill=function(ze,Se,Je,_t){if(typeof ze=="string"){if(typeof Se=="string"?(_t=Se,Se=0,Je=this.length):typeof Je=="string"&&(_t=Je,Je=this.length),_t!==void 0&&typeof _t!="string")throw new TypeError("encoding must be a string");if(typeof _t=="string"&&!r.isEncoding(_t))throw new TypeError("Unknown encoding: "+_t);if(ze.length===1){const vt=ze.charCodeAt(0);(_t==="utf8"&&vt<128||_t==="latin1")&&(ze=vt)}}else typeof ze=="number"?ze=ze&255:typeof ze=="boolean"&&(ze=Number(ze));if(Se<0||this.length>>0,Je=Je===void 0?this.length:Je>>>0,ze||(ze=0);let At;if(typeof ze=="number")for(At=Se;At2**32?_t=ce(String(Se)):typeof Se=="bigint"&&(_t=String(Se),(Se>BigInt(2)**BigInt(32)||Se<-(BigInt(2)**BigInt(32)))&&(_t=ce(_t)),_t+="n"),Je+=` It must be ${ze}. Received ${_t}`,Je},RangeError);function ce(Ve){let ze="",Se=Ve.length;const Je=Ve[0]==="-"?1:0;for(;Se>=Je+4;Se-=3)ze=`_${Ve.slice(Se-3,Se)}${ze}`;return`${Ve.slice(0,Se)}${ze}`}function ne(Ve,ze,Se){le(ze,"offset"),(Ve[ze]===void 0||Ve[ze+Se]===void 0)&&Z(ze,Ve.length-(Se+1))}function ye(Ve,ze,Se,Je,_t,At){if(Ve>Se||Ve= 0${vt} and < 2${vt} ** ${(At+1)*8}${vt}`:Kt=`>= -(2${vt} ** ${(At+1)*8-1}${vt}) and < 2 ** ${(At+1)*8-1}${vt}`,new Y.ERR_OUT_OF_RANGE("value",Kt,Ve)}ne(Je,_t,At)}function le(Ve,ze){if(typeof Ve!="number")throw new Y.ERR_INVALID_ARG_TYPE(ze,"number",Ve)}function Z(Ve,ze,Se){throw Math.floor(Ve)!==Ve?(le(Ve,Se),new Y.ERR_OUT_OF_RANGE("offset","an integer",Ve)):ze<0?new Y.ERR_BUFFER_OUT_OF_BOUNDS:new Y.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${ze}`,Ve)}var de=/[^+/0-9A-Za-z-_]/g;function pe(Ve){if(Ve=Ve.split("=")[0],Ve=Ve.trim().replace(de,""),Ve.length<2)return"";for(;Ve.length%4!==0;)Ve=Ve+"=";return Ve}function Te(Ve,ze){ze=ze||1/0;let Se;const Je=Ve.length;let _t=null;const At=[];for(let vt=0;vt55295&&Se<57344){if(!_t){if(Se>56319){(ze-=3)>-1&&At.push(239,191,189);continue}else if(vt+1===Je){(ze-=3)>-1&&At.push(239,191,189);continue}_t=Se;continue}if(Se<56320){(ze-=3)>-1&&At.push(239,191,189),_t=Se;continue}Se=(_t-55296<<10|Se-56320)+65536}else _t&&(ze-=3)>-1&&At.push(239,191,189);if(_t=null,Se<128){if((ze-=1)<0)break;At.push(Se)}else if(Se<2048){if((ze-=2)<0)break;At.push(Se>>6|192,Se&63|128)}else if(Se<65536){if((ze-=3)<0)break;At.push(Se>>12|224,Se>>6&63|128,Se&63|128)}else if(Se<1114112){if((ze-=4)<0)break;At.push(Se>>18|240,Se>>12&63|128,Se>>6&63|128,Se&63|128)}else throw new Error("Invalid code point")}return At}function Ne(Ve){const ze=[];for(let Se=0;Se>8,_t=Se%256,At.push(_t),At.push(Je);return At}function Ze(Ve){return K.toByteArray(pe(Ve))}function Xe(Ve,ze,Se,Je){let _t;for(_t=0;_t=ze.length||_t>=Ve.length);++_t)ze[_t+Se]=Ve[_t];return _t}function it(Ve,ze){return Ve instanceof ze||Ve!=null&&Ve.constructor!=null&&Ve.constructor.name!=null&&Ve.constructor.name===ze.name}function yt(Ve){return Ve!==Ve}var bt=(function(){const Ve="0123456789abcdef",ze=new Array(256);for(let Se=0;Se<16;++Se){const Je=Se*16;for(let _t=0;_t<16;++_t)ze[Je+_t]=Ve[Se]+Ve[_t]}return ze})();function mt(Ve){return typeof BigInt>"u"?ht:Ve}function ht(){throw new Error("BigInt not supported")}}}),lw=Re({"node_modules/has-symbols/shams.js"(ae,K){K.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var S={},M=Symbol("test"),L=Object(M);if(typeof M=="string"||Object.prototype.toString.call(M)!=="[object Symbol]"||Object.prototype.toString.call(L)!=="[object Symbol]")return!1;var t=42;S[M]=t;for(var r in S)return!1;if(typeof Object.keys=="function"&&Object.keys(S).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(S).length!==0)return!1;var a=Object.getOwnPropertySymbols(S);if(a.length!==1||a[0]!==M||!Object.prototype.propertyIsEnumerable.call(S,M))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(S,M);if(l.value!==t||l.enumerable!==!0)return!1}return!0}}}),nx=Re({"node_modules/has-tostringtag/shams.js"(ae,K){var v=lw();K.exports=function(){return v()&&!!Symbol.toStringTag}}}),uw=Re({"node_modules/es-object-atoms/index.js"(ae,K){K.exports=Object}}),KM=Re({"node_modules/es-errors/index.js"(ae,K){K.exports=Error}}),U0=Re({"node_modules/es-errors/eval.js"(ae,K){K.exports=EvalError}}),Yd=Re({"node_modules/es-errors/range.js"(ae,K){K.exports=RangeError}}),g5=Re({"node_modules/es-errors/ref.js"(ae,K){K.exports=ReferenceError}}),y5=Re({"node_modules/es-errors/syntax.js"(ae,K){K.exports=SyntaxError}}),gd=Re({"node_modules/es-errors/type.js"(ae,K){K.exports=TypeError}}),rP=Re({"node_modules/es-errors/uri.js"(ae,K){K.exports=URIError}}),JM=Re({"node_modules/math-intrinsics/abs.js"(ae,K){K.exports=Math.abs}}),QM=Re({"node_modules/math-intrinsics/floor.js"(ae,K){K.exports=Math.floor}}),Hh=Re({"node_modules/math-intrinsics/max.js"(ae,K){K.exports=Math.max}}),Xv=Re({"node_modules/math-intrinsics/min.js"(ae,K){K.exports=Math.min}}),$0=Re({"node_modules/math-intrinsics/pow.js"(ae,K){K.exports=Math.pow}}),eI=Re({"node_modules/math-intrinsics/round.js"(ae,K){K.exports=Math.round}}),tI=Re({"node_modules/math-intrinsics/isNaN.js"(ae,K){K.exports=Number.isNaN||function(S){return S!==S}}}),rI=Re({"node_modules/math-intrinsics/sign.js"(ae,K){var v=tI();K.exports=function(M){return v(M)||M===0?M:M<0?-1:1}}}),nP=Re({"node_modules/gopd/gOPD.js"(ae,K){K.exports=Object.getOwnPropertyDescriptor}}),V0=Re({"node_modules/gopd/index.js"(ae,K){var v=nP();if(v)try{v([],"length")}catch{v=null}K.exports=v}}),Kp=Re({"node_modules/es-define-property/index.js"(ae,K){var v=Object.defineProperty||!1;if(v)try{v({},"a",{value:1})}catch{v=!1}K.exports=v}}),Eg=Re({"node_modules/has-symbols/index.js"(ae,K){var v=typeof Symbol<"u"&&Symbol,S=lw();K.exports=function(){return typeof v!="function"||typeof Symbol!="function"||typeof v("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:S()}}}),_5=Re({"node_modules/get-proto/Reflect.getPrototypeOf.js"(ae,K){K.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),Iv=Re({"node_modules/get-proto/Object.getPrototypeOf.js"(ae,K){var v=uw();K.exports=v.getPrototypeOf||null}}),nI=Re({"node_modules/function-bind/implementation.js"(ae,K){var v="Function.prototype.bind called on incompatible ",S=Object.prototype.toString,M=Math.max,L="[object Function]",t=function(i,s){for(var o=[],c=0;c"u"||!E?v:E(Uint8Array),U={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?v:ArrayBuffer,"%ArrayIteratorPrototype%":T&&E?E([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":F,"%AsyncGenerator%":F,"%AsyncGeneratorFunction%":F,"%AsyncIteratorPrototype%":F,"%Atomics%":typeof Atomics>"u"?v:Atomics,"%BigInt%":typeof BigInt>"u"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":M,"%eval%":eval,"%EvalError%":L,"%Float16Array%":typeof Float16Array>"u"?v:Float16Array,"%Float32Array%":typeof Float32Array>"u"?v:Float32Array,"%Float64Array%":typeof Float64Array>"u"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?v:FinalizationRegistry,"%Function%":C,"%GeneratorFunction%":F,"%Int8Array%":typeof Int8Array>"u"?v:Int8Array,"%Int16Array%":typeof Int16Array>"u"?v:Int16Array,"%Int32Array%":typeof Int32Array>"u"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&E?E(E([][Symbol.iterator]())):v,"%JSON%":typeof JSON=="object"?JSON:v,"%Map%":typeof Map>"u"?v:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!E?v:E(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":S,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?v:Promise,"%Proxy%":typeof Proxy>"u"?v:Proxy,"%RangeError%":t,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?v:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T||!E?v:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&E?E(""[Symbol.iterator]()):v,"%Symbol%":T?Symbol:v,"%SyntaxError%":a,"%ThrowTypeError%":I,"%TypedArray%":z,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?v:Uint32Array,"%URIError%":i,"%WeakMap%":typeof WeakMap>"u"?v:WeakMap,"%WeakRef%":typeof WeakRef>"u"?v:WeakRef,"%WeakSet%":typeof WeakSet>"u"?v:WeakSet,"%Function.prototype.call%":w,"%Function.prototype.apply%":m,"%Object.defineProperty%":A,"%Object.getPrototypeOf%":_,"%Math.abs%":s,"%Math.floor%":o,"%Math.max%":c,"%Math.min%":p,"%Math.pow%":d,"%Math.round%":y,"%Math.sign%":g,"%Reflect.getPrototypeOf%":h};if(E)try{null.error}catch(ne){V=E(E(ne)),U["%Error.prototype%"]=V}var V,G=function ne(ye){var le;if(ye==="%AsyncFunction%")le=f("async function () {}");else if(ye==="%GeneratorFunction%")le=f("function* () {}");else if(ye==="%AsyncGeneratorFunction%")le=f("async function* () {}");else if(ye==="%AsyncGenerator%"){var Z=ne("%AsyncGeneratorFunction%");Z&&(le=Z.prototype)}else if(ye==="%AsyncIteratorPrototype%"){var de=ne("%AsyncGenerator%");de&&E&&(le=E(de.prototype))}return U[ye]=le,le},j={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=Im(),H=cw(),W=O.call(w,Array.prototype.concat),ee=O.call(m,Array.prototype.splice),ue=O.call(w,String.prototype.replace),xe=O.call(w,String.prototype.slice),ge=O.call(w,RegExp.prototype.exec),_e=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,se=function(ye){var le=xe(ye,0,1),Z=xe(ye,-1);if(le==="%"&&Z!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(Z==="%"&&le!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var de=[];return ue(ye,_e,function(pe,Te,Ne,$e){de[de.length]=Ne?ue($e,Y,"$1"):Te||pe}),de},ce=function(ye,le){var Z=ye,de;if(H(j,Z)&&(de=j[Z],Z="%"+de[0]+"%"),H(U,Z)){var pe=U[Z];if(pe===F&&(pe=G(Z)),typeof pe>"u"&&!le)throw new l("intrinsic "+ye+" exists, but is not available. Please file an issue!");return{alias:de,name:Z,value:pe}}throw new a("intrinsic "+ye+" does not exist!")};K.exports=function(ye,le){if(typeof ye!="string"||ye.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof le!="boolean")throw new l('"allowMissing" argument must be a boolean');if(ge(/^%?[^%]*%?$/,ye)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Z=se(ye),de=Z.length>0?Z[0]:"",pe=ce("%"+de+"%",le),Te=pe.name,Ne=pe.value,$e=!1,Ze=pe.alias;Ze&&(de=Ze[0],ee(Z,W([0,1],Ze)));for(var Xe=1,it=!0;Xe=Z.length){var ht=x(Ne,yt);it=!!ht,it&&"get"in ht&&!("originalValue"in ht.get)?Ne=ht.get:Ne=Ne[yt]}else it=H(Ne,yt),Ne=Ne[yt];it&&!$e&&(U[Te]=Ne)}}return Ne}}}),ix=Re({"node_modules/define-data-property/index.js"(ae,K){var v=Kp(),S=y5(),M=gd(),L=V0();K.exports=function(r,a,l){if(!r||typeof r!="object"&&typeof r!="function")throw new M("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new M("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new M("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new M("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new M("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new M("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,p=!!L&&L(r,a);if(v)v(r,a,{configurable:o===null&&p?p.configurable:!o,enumerable:i===null&&p?p.enumerable:!i,value:l,writable:s===null&&p?p.writable:!s});else if(c||!i&&!s&&!o)r[a]=l;else throw new S("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),w5=Re({"node_modules/has-property-descriptors/index.js"(ae,K){var v=Kp(),S=function(){return!!v};S.hasArrayLengthDefineBug=function(){if(!v)return null;try{return v([],"length",{value:1}).length!==1}catch{return!0}},K.exports=S}}),iI=Re({"node_modules/set-function-length/index.js"(ae,K){var v=$1(),S=ix(),M=w5()(),L=V0(),t=gd(),r=v("%Math.floor%");K.exports=function(l,i){if(typeof l!="function")throw new t("`fn` is not a function");if(typeof i!="number"||i<0||i>4294967295||r(i)!==i)throw new t("`length` must be a positive 32-bit integer");var s=arguments.length>2&&!!arguments[2],o=!0,c=!0;if("length"in l&&L){var p=L(l,"length");p&&!p.configurable&&(o=!1),p&&!p.writable&&(c=!1)}return(o||c||!s)&&(M?S(l,"length",i,!0,!0):S(l,"length",i)),l}}}),Ry=Re({"node_modules/call-bind/index.js"(ae,K){var v=Im(),S=$1(),M=iI(),L=gd(),t=S("%Function.prototype.apply%"),r=S("%Function.prototype.call%"),a=S("%Reflect.apply%",!0)||v.call(r,t),l=Kp(),i=S("%Math.max%");K.exports=function(c){if(typeof c!="function")throw new L("a function is required");var p=a(v,r,arguments);return M(p,1+i(0,c.length-(arguments.length-1)),!0)};var s=function(){return a(v,t,arguments)};l?l(K.exports,"apply",{value:s}):K.exports.apply=s}}),ox=Re({"node_modules/call-bind/callBound.js"(ae,K){var v=$1(),S=Ry(),M=S(v("String.prototype.indexOf"));K.exports=function(t,r){var a=v(t,!!r);return typeof a=="function"&&M(t,".prototype.")>-1?S(a):a}}}),J3=Re({"node_modules/is-arguments/index.js"(ae,K){var v=nx()(),S=ox(),M=S("Object.prototype.toString"),L=function(l){return v&&l&&typeof l=="object"&&Symbol.toStringTag in l?!1:M(l)==="[object Arguments]"},t=function(l){return L(l)?!0:l!==null&&typeof l=="object"&&typeof l.length=="number"&&l.length>=0&&M(l)!=="[object Array]"&&M(l.callee)==="[object Function]"},r=(function(){return L(arguments)})();L.isLegacyArguments=t,K.exports=r?L:t}}),oI=Re({"node_modules/is-generator-function/index.js"(ae,K){var v=Object.prototype.toString,S=Function.prototype.toString,M=/^\s*(?:function)?\*/,L=nx()(),t=Object.getPrototypeOf,r=function(){if(!L)return!1;try{return Function("return function*() {}")()}catch{}},a;K.exports=function(i){if(typeof i!="function")return!1;if(M.test(S.call(i)))return!0;if(!L){var s=v.call(i);return s==="[object GeneratorFunction]"}if(!t)return!1;if(typeof a>"u"){var o=r();a=o?t(o):!1}return t(i)===a}}}),aP=Re({"node_modules/is-callable/index.js"(ae,K){var v=Function.prototype.toString,S=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,M,L;if(typeof S=="function"&&typeof Object.defineProperty=="function")try{M=Object.defineProperty({},"length",{get:function(){throw L}}),L={},S(function(){throw 42},null,M)}catch(x){x!==L&&(S=null)}else S=null;var t=/^\s*class\b/,r=function(A){try{var k=v.call(A);return t.test(k)}catch{return!1}},a=function(A){try{return r(A)?!1:(v.call(A),!0)}catch{return!1}},l=Object.prototype.toString,i="[object Object]",s="[object Function]",o="[object GeneratorFunction]",c="[object HTMLAllCollection]",p="[object HTML document.all class]",d="[object HTMLCollection]",y=typeof Symbol=="function"&&!!Symbol.toStringTag,g=!(0 in[,]),C=function(){return!1};typeof document=="object"&&(f=document.all,l.call(f)===l.call(document.all)&&(C=function(A){if((g||!A)&&(typeof A>"u"||typeof A=="object"))try{var k=l.call(A);return(k===c||k===p||k===d||k===i)&&A("")==null}catch{}return!1}));var f;K.exports=S?function(A){if(C(A))return!0;if(!A||typeof A!="function"&&typeof A!="object")return!1;try{S(A,null,M)}catch(k){if(k!==L)return!1}return!r(A)&&a(A)}:function(A){if(C(A))return!0;if(!A||typeof A!="function"&&typeof A!="object")return!1;if(y)return a(A);if(r(A))return!1;var k=l.call(A);return k!==s&&k!==o&&!/^\[object HTML/.test(k)?!1:a(A)}}}),sI=Re({"node_modules/for-each/index.js"(ae,K){var v=aP(),S=Object.prototype.toString,M=Object.prototype.hasOwnProperty,L=function(i,s,o){for(var c=0,p=i.length;c=3&&(c=o),S.call(i)==="[object Array]"?L(i,s,c):typeof i=="string"?t(i,s,c):r(i,s,c)};K.exports=a}}),sf=Re({"node_modules/available-typed-arrays/index.js"(ae,K){var v=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],S=typeof globalThis>"u"?window:globalThis;K.exports=function(){for(var L=[],t=0;t"u"?window:globalThis,i=S(),s=L("String.prototype.slice"),o=Object.getPrototypeOf,c=L("Array.prototype.indexOf",!0)||function(C,f){for(var x=0;x-1?f:f!=="Object"?!1:y(C)}return t?d(C):null}}}),Mc=Re({"node_modules/is-typed-array/index.js"(ae,K){var v=sI(),S=sf(),M=ox(),L=M("Object.prototype.toString"),t=nx()(),r=V0(),a=typeof globalThis>"u"?window:globalThis,l=S(),i=M("Array.prototype.indexOf",!0)||function(y,g){for(var C=0;C-1}return r?p(y):!1}}}),Ic=Re({"node_modules/util/support/types.js"(ae){var K=J3(),v=oI(),S=dh(),M=Mc();function L($e){return $e.call.bind($e)}var t=typeof BigInt<"u",r=typeof Symbol<"u",a=L(Object.prototype.toString),l=L(Number.prototype.valueOf),i=L(String.prototype.valueOf),s=L(Boolean.prototype.valueOf);t&&(o=L(BigInt.prototype.valueOf));var o;r&&(c=L(Symbol.prototype.valueOf));var c;function p($e,Ze){if(typeof $e!="object")return!1;try{return Ze($e),!0}catch{return!1}}ae.isArgumentsObject=K,ae.isGeneratorFunction=v,ae.isTypedArray=M;function d($e){return typeof Promise<"u"&&$e instanceof Promise||$e!==null&&typeof $e=="object"&&typeof $e.then=="function"&&typeof $e.catch=="function"}ae.isPromise=d;function y($e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView($e):M($e)||ee($e)}ae.isArrayBufferView=y;function g($e){return S($e)==="Uint8Array"}ae.isUint8Array=g;function C($e){return S($e)==="Uint8ClampedArray"}ae.isUint8ClampedArray=C;function f($e){return S($e)==="Uint16Array"}ae.isUint16Array=f;function x($e){return S($e)==="Uint32Array"}ae.isUint32Array=x;function A($e){return S($e)==="Int8Array"}ae.isInt8Array=A;function k($e){return S($e)==="Int16Array"}ae.isInt16Array=k;function I($e){return S($e)==="Int32Array"}ae.isInt32Array=I;function T($e){return S($e)==="Float32Array"}ae.isFloat32Array=T;function E($e){return S($e)==="Float64Array"}ae.isFloat64Array=E;function _($e){return S($e)==="BigInt64Array"}ae.isBigInt64Array=_;function h($e){return S($e)==="BigUint64Array"}ae.isBigUint64Array=h;function m($e){return a($e)==="[object Map]"}m.working=typeof Map<"u"&&m(new Map);function w($e){return typeof Map>"u"?!1:m.working?m($e):$e instanceof Map}ae.isMap=w;function F($e){return a($e)==="[object Set]"}F.working=typeof Set<"u"&&F(new Set);function z($e){return typeof Set>"u"?!1:F.working?F($e):$e instanceof Set}ae.isSet=z;function U($e){return a($e)==="[object WeakMap]"}U.working=typeof WeakMap<"u"&&U(new WeakMap);function V($e){return typeof WeakMap>"u"?!1:U.working?U($e):$e instanceof WeakMap}ae.isWeakMap=V;function G($e){return a($e)==="[object WeakSet]"}G.working=typeof WeakSet<"u"&&G(new WeakSet);function j($e){return G($e)}ae.isWeakSet=j;function O($e){return a($e)==="[object ArrayBuffer]"}O.working=typeof ArrayBuffer<"u"&&O(new ArrayBuffer);function H($e){return typeof ArrayBuffer>"u"?!1:O.working?O($e):$e instanceof ArrayBuffer}ae.isArrayBuffer=H;function W($e){return a($e)==="[object DataView]"}W.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&W(new DataView(new ArrayBuffer(1),0,1));function ee($e){return typeof DataView>"u"?!1:W.working?W($e):$e instanceof DataView}ae.isDataView=ee;var ue=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function xe($e){return a($e)==="[object SharedArrayBuffer]"}function ge($e){return typeof ue>"u"?!1:(typeof xe.working>"u"&&(xe.working=xe(new ue)),xe.working?xe($e):$e instanceof ue)}ae.isSharedArrayBuffer=ge;function _e($e){return a($e)==="[object AsyncFunction]"}ae.isAsyncFunction=_e;function Y($e){return a($e)==="[object Map Iterator]"}ae.isMapIterator=Y;function se($e){return a($e)==="[object Set Iterator]"}ae.isSetIterator=se;function ce($e){return a($e)==="[object Generator]"}ae.isGeneratorObject=ce;function ne($e){return a($e)==="[object WebAssembly.Module]"}ae.isWebAssemblyCompiledModule=ne;function ye($e){return p($e,l)}ae.isNumberObject=ye;function le($e){return p($e,i)}ae.isStringObject=le;function Z($e){return p($e,s)}ae.isBooleanObject=Z;function de($e){return t&&p($e,o)}ae.isBigIntObject=de;function pe($e){return r&&p($e,c)}ae.isSymbolObject=pe;function Te($e){return ye($e)||le($e)||Z($e)||de($e)||pe($e)}ae.isBoxedPrimitive=Te;function Ne($e){return typeof Uint8Array<"u"&&(H($e)||ge($e))}ae.isAnyArrayBuffer=Ne,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function($e){Object.defineProperty(ae,$e,{enumerable:!1,value:function(){throw new Error($e+" is not supported in userland")}})})}}),Lf=Re({"node_modules/util/support/isBufferBrowser.js"(ae,K){K.exports=function(S){return S&&typeof S=="object"&&typeof S.copy=="function"&&typeof S.fill=="function"&&typeof S.readUInt8=="function"}}}),Yv=Re({"(disabled):node_modules/util/util.js"(ae){var K=Object.getOwnPropertyDescriptors||function(ee){for(var ue=Object.keys(ee),xe={},ge=0;ge=ge)return se;switch(se){case"%s":return String(xe[ue++]);case"%d":return Number(xe[ue++]);case"%j":try{return JSON.stringify(xe[ue++])}catch{return"[Circular]"}default:return se}}),Y=xe[ue];ue"u")return function(){return ae.deprecate(W,ee).apply(this,arguments)};var ue=!1;function xe(){if(!ue){if(process.throwDeprecation)throw new Error(ee);process.traceDeprecation?console.trace(ee):console.error(ee),ue=!0}return W.apply(this,arguments)}return xe};var S={},M=/^$/;L="false",L=L.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),M=new RegExp("^"+L+"$","i");var L;ae.debuglog=function(W){if(W=W.toUpperCase(),!S[W])if(M.test(W)){var ee=process.pid;S[W]=function(){var ue=ae.format.apply(ae,arguments);console.error("%s %d: %s",W,ee,ue)}}else S[W]=function(){};return S[W]};function t(W,ee){var ue={seen:[],stylize:a};return arguments.length>=3&&(ue.depth=arguments[2]),arguments.length>=4&&(ue.colors=arguments[3]),g(ee)?ue.showHidden=ee:ee&&ae._extend(ue,ee),I(ue.showHidden)&&(ue.showHidden=!1),I(ue.depth)&&(ue.depth=2),I(ue.colors)&&(ue.colors=!1),I(ue.customInspect)&&(ue.customInspect=!0),ue.colors&&(ue.stylize=r),i(ue,W,ue.depth)}ae.inspect=t,t.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]},t.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function r(W,ee){var ue=t.styles[ee];return ue?"\x1B["+t.colors[ue][0]+"m"+W+"\x1B["+t.colors[ue][1]+"m":W}function a(W,ee){return W}function l(W){var ee={};return W.forEach(function(ue,xe){ee[ue]=!0}),ee}function i(W,ee,ue){if(W.customInspect&&ee&&m(ee.inspect)&&ee.inspect!==ae.inspect&&!(ee.constructor&&ee.constructor.prototype===ee)){var xe=ee.inspect(ue,W);return A(xe)||(xe=i(W,xe,ue)),xe}var ge=s(W,ee);if(ge)return ge;var _e=Object.keys(ee),Y=l(_e);if(W.showHidden&&(_e=Object.getOwnPropertyNames(ee)),h(ee)&&(_e.indexOf("message")>=0||_e.indexOf("description")>=0))return o(ee);if(_e.length===0){if(m(ee)){var se=ee.name?": "+ee.name:"";return W.stylize("[Function"+se+"]","special")}if(T(ee))return W.stylize(RegExp.prototype.toString.call(ee),"regexp");if(_(ee))return W.stylize(Date.prototype.toString.call(ee),"date");if(h(ee))return o(ee)}var ce="",ne=!1,ye=["{","}"];if(y(ee)&&(ne=!0,ye=["[","]"]),m(ee)){var le=ee.name?": "+ee.name:"";ce=" [Function"+le+"]"}if(T(ee)&&(ce=" "+RegExp.prototype.toString.call(ee)),_(ee)&&(ce=" "+Date.prototype.toUTCString.call(ee)),h(ee)&&(ce=" "+o(ee)),_e.length===0&&(!ne||ee.length==0))return ye[0]+ce+ye[1];if(ue<0)return T(ee)?W.stylize(RegExp.prototype.toString.call(ee),"regexp"):W.stylize("[Object]","special");W.seen.push(ee);var Z;return ne?Z=c(W,ee,ue,Y,_e):Z=_e.map(function(de){return p(W,ee,ue,Y,de,ne)}),W.seen.pop(),d(Z,ce,ye)}function s(W,ee){if(I(ee))return W.stylize("undefined","undefined");if(A(ee)){var ue="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return W.stylize(ue,"string")}if(x(ee))return W.stylize(""+ee,"number");if(g(ee))return W.stylize(""+ee,"boolean");if(C(ee))return W.stylize("null","null")}function o(W){return"["+Error.prototype.toString.call(W)+"]"}function c(W,ee,ue,xe,ge){for(var _e=[],Y=0,se=ee.length;Y-1&&(_e?se=se.split(` +`).map(function(ne){return" "+ne}).join(` +`).slice(2):se=` +`+se.split(` +`).map(function(ne){return" "+ne}).join(` +`))):se=W.stylize("[Circular]","special")),I(Y)){if(_e&&ge.match(/^\d+$/))return se;Y=JSON.stringify(""+ge),Y.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Y=Y.slice(1,-1),Y=W.stylize(Y,"name")):(Y=Y.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Y=W.stylize(Y,"string"))}return Y+": "+se}function d(W,ee,ue){var xe=W.reduce(function(ge,_e){return _e.indexOf(` +`)>=0,ge+_e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return xe>60?ue[0]+(ee===""?"":ee+` + `)+" "+W.join(`, + `)+" "+ue[1]:ue[0]+ee+" "+W.join(", ")+" "+ue[1]}ae.types=Ic();function y(W){return Array.isArray(W)}ae.isArray=y;function g(W){return typeof W=="boolean"}ae.isBoolean=g;function C(W){return W===null}ae.isNull=C;function f(W){return W==null}ae.isNullOrUndefined=f;function x(W){return typeof W=="number"}ae.isNumber=x;function A(W){return typeof W=="string"}ae.isString=A;function k(W){return typeof W=="symbol"}ae.isSymbol=k;function I(W){return W===void 0}ae.isUndefined=I;function T(W){return E(W)&&F(W)==="[object RegExp]"}ae.isRegExp=T,ae.types.isRegExp=T;function E(W){return typeof W=="object"&&W!==null}ae.isObject=E;function _(W){return E(W)&&F(W)==="[object Date]"}ae.isDate=_,ae.types.isDate=_;function h(W){return E(W)&&(F(W)==="[object Error]"||W instanceof Error)}ae.isError=h,ae.types.isNativeError=h;function m(W){return typeof W=="function"}ae.isFunction=m;function w(W){return W===null||typeof W=="boolean"||typeof W=="number"||typeof W=="string"||typeof W=="symbol"||typeof W>"u"}ae.isPrimitive=w,ae.isBuffer=Lf();function F(W){return Object.prototype.toString.call(W)}function z(W){return W<10?"0"+W.toString(10):W.toString(10)}var U=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var W=new Date,ee=[z(W.getHours()),z(W.getMinutes()),z(W.getSeconds())].join(":");return[W.getDate(),U[W.getMonth()],ee].join(" ")}ae.log=function(){console.log("%s - %s",V(),ae.format.apply(ae,arguments))},ae.inherits=Ym(),ae._extend=function(W,ee){if(!ee||!E(ee))return W;for(var ue=Object.keys(ee),xe=ue.length;xe--;)W[ue[xe]]=ee[ue[xe]];return W};function G(W,ee){return Object.prototype.hasOwnProperty.call(W,ee)}var j=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;ae.promisify=function(ee){if(typeof ee!="function")throw new TypeError('The "original" argument must be of type Function');if(j&&ee[j]){var ue=ee[j];if(typeof ue!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ue,j,{value:ue,enumerable:!1,writable:!1,configurable:!0}),ue}function ue(){for(var xe,ge,_e=new Promise(function(ce,ne){xe=ce,ge=ne}),Y=[],se=0;se0?this.tail.next=g:this.head=g,this.tail=g,++this.length}},{key:"unshift",value:function(y){var g={data:y,next:this.head};this.length===0&&(this.tail=g),this.head=g,++this.length}},{key:"shift",value:function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(y){if(this.length===0)return"";for(var g=this.head,C=""+g.data;g=g.next;)C+=y+g.data;return C}},{key:"concat",value:function(y){if(this.length===0)return l.alloc(0);for(var g=l.allocUnsafe(y>>>0),C=this.head,f=0;C;)c(C.data,g,f),f+=C.data.length,C=C.next;return g}},{key:"consume",value:function(y,g){var C;return yx.length?x.length:y;if(A===x.length?f+=x:f+=x.slice(0,y),y-=A,y===0){A===x.length?(++C,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=x.slice(A));break}++C}return this.length-=C,f}},{key:"_getBuffer",value:function(y){var g=l.allocUnsafe(y),C=this.head,f=1;for(C.data.copy(g),y-=C.data.length;C=C.next;){var x=C.data,A=y>x.length?x.length:y;if(x.copy(g,g.length-y,0,A),y-=A,y===0){A===x.length?(++f,C.next?this.head=C.next:this.head=this.tail=null):(this.head=C,C.data=x.slice(A));break}++f}return this.length-=f,g}},{key:o,value:function(y,g){return s(this,S({},g,{depth:0,customInspect:!1}))}}]),p})()}}),V1=Re({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(ae,K){function v(a,l){var i=this,s=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return s||o?(l?l(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(t,this,a)):process.nextTick(t,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(c){!l&&c?i._writableState?i._writableState.errorEmitted?process.nextTick(M,i):(i._writableState.errorEmitted=!0,process.nextTick(S,i,c)):process.nextTick(S,i,c):l?(process.nextTick(M,i),l(c)):process.nextTick(M,i)}),this)}function S(a,l){t(a,l),M(a)}function M(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function L(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function t(a,l){a.emit("error",l)}function r(a,l){var i=a._readableState,s=a._writableState;i&&i.autoDestroy||s&&s.autoDestroy?a.destroy(l):a.emit("error",l)}K.exports={destroy:v,undestroy:L,errorOrDestroy:r}}}),Py=Re({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(ae,K){function v(l,i){l.prototype=Object.create(i.prototype),l.prototype.constructor=l,l.__proto__=i}var S={};function M(l,i,s){s||(s=Error);function o(p,d,y){return typeof i=="string"?i:i(p,d,y)}var c=(function(p){v(d,p);function d(y,g,C){return p.call(this,o(y,g,C))||this}return d})(s);c.prototype.name=s.name,c.prototype.code=l,S[l]=c}function L(l,i){if(Array.isArray(l)){var s=l.length;return l=l.map(function(o){return String(o)}),s>2?"one of ".concat(i," ").concat(l.slice(0,s-1).join(", "),", or ")+l[s-1]:s===2?"one of ".concat(i," ").concat(l[0]," or ").concat(l[1]):"of ".concat(i," ").concat(l[0])}else return"of ".concat(i," ").concat(String(l))}function t(l,i,s){return l.substr(0,i.length)===i}function r(l,i,s){return(s===void 0||s>l.length)&&(s=l.length),l.substring(s-i.length,s)===i}function a(l,i,s){return typeof s!="number"&&(s=0),s+i.length>l.length?!1:l.indexOf(i,s)!==-1}M("ERR_INVALID_OPT_VALUE",function(l,i){return'The value "'+i+'" is invalid for option "'+l+'"'},TypeError),M("ERR_INVALID_ARG_TYPE",function(l,i,s){var o;typeof i=="string"&&t(i,"not ")?(o="must not be",i=i.replace(/^not /,"")):o="must be";var c;if(r(l," argument"))c="The ".concat(l," ").concat(o," ").concat(L(i,"type"));else{var p=a(l,".")?"property":"argument";c='The "'.concat(l,'" ').concat(p," ").concat(o," ").concat(L(i,"type"))}return c+=". Received type ".concat(typeof s),c},TypeError),M("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),M("ERR_METHOD_NOT_IMPLEMENTED",function(l){return"The "+l+" method is not implemented"}),M("ERR_STREAM_PREMATURE_CLOSE","Premature close"),M("ERR_STREAM_DESTROYED",function(l){return"Cannot call "+l+" after a stream was destroyed"}),M("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),M("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),M("ERR_STREAM_WRITE_AFTER_END","write after end"),M("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),M("ERR_UNKNOWN_ENCODING",function(l){return"Unknown encoding: "+l},TypeError),M("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),K.exports.codes=S}}),e0=Re({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(ae,K){var v=Py().codes.ERR_INVALID_OPT_VALUE;function S(L,t,r){return L.highWaterMark!=null?L.highWaterMark:t?L[r]:null}function M(L,t,r,a){var l=S(t,a,r);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var i=a?r:"highWaterMark";throw new v(i,l)}return Math.floor(l)}return L.objectMode?16:16*1024}K.exports={getHighWaterMark:M}}}),yd=Re({"node_modules/util-deprecate/browser.js"(ae,K){K.exports=v;function v(M,L){if(S("noDeprecation"))return M;var t=!1;function r(){if(!t){if(S("throwDeprecation"))throw new Error(L);S("traceDeprecation")?console.trace(L):console.warn(L),t=!0}return M.apply(this,arguments)}return r}function S(M){try{if(!window.localStorage)return!1}catch{return!1}var L=window.localStorage[M];return L==null?!1:String(L).toLowerCase()==="true"}}}),G0=Re({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(ae,K){K.exports=_;function v(Y){var se=this;this.next=null,this.entry=null,this.finish=function(){_e(se,Y)}}var S;_.WritableState=T;var M={deprecate:yd()},L=Sg(),t=U1().Buffer,r=window.Uint8Array||function(){};function a(Y){return t.from(Y)}function l(Y){return t.isBuffer(Y)||Y instanceof r}var i=V1(),s=e0(),o=s.getHighWaterMark,c=Py().codes,p=c.ERR_INVALID_ARG_TYPE,d=c.ERR_METHOD_NOT_IMPLEMENTED,y=c.ERR_MULTIPLE_CALLBACK,g=c.ERR_STREAM_CANNOT_PIPE,C=c.ERR_STREAM_DESTROYED,f=c.ERR_STREAM_NULL_VALUES,x=c.ERR_STREAM_WRITE_AFTER_END,A=c.ERR_UNKNOWN_ENCODING,k=i.errorOrDestroy;Ym()(_,L);function I(){}function T(Y,se,ce){S=S||Zm(),Y=Y||{},typeof ce!="boolean"&&(ce=se instanceof S),this.objectMode=!!Y.objectMode,ce&&(this.objectMode=this.objectMode||!!Y.writableObjectMode),this.highWaterMark=o(this,Y,"writableHighWaterMark",ce),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var ne=Y.decodeStrings===!1;this.decodeStrings=!ne,this.defaultEncoding=Y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ye){G(se,ye)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Y.emitClose!==!1,this.autoDestroy=!!Y.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new v(this)}T.prototype.getBuffer=function(){for(var se=this.bufferedRequest,ce=[];se;)ce.push(se),se=se.next;return ce},(function(){try{Object.defineProperty(T.prototype,"buffer",{get:M.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var E;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(E=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(se){return E.call(this,se)?!0:this!==_?!1:se&&se._writableState instanceof T}})):E=function(se){return se instanceof this};function _(Y){S=S||Zm();var se=this instanceof S;if(!se&&!E.call(_,this))return new _(Y);this._writableState=new T(Y,this,se),this.writable=!0,Y&&(typeof Y.write=="function"&&(this._write=Y.write),typeof Y.writev=="function"&&(this._writev=Y.writev),typeof Y.destroy=="function"&&(this._destroy=Y.destroy),typeof Y.final=="function"&&(this._final=Y.final)),L.call(this)}_.prototype.pipe=function(){k(this,new g)};function h(Y,se){var ce=new x;k(Y,ce),process.nextTick(se,ce)}function m(Y,se,ce,ne){var ye;return ce===null?ye=new f:typeof ce!="string"&&!se.objectMode&&(ye=new p("chunk",["string","Buffer"],ce)),ye?(k(Y,ye),process.nextTick(ne,ye),!1):!0}_.prototype.write=function(Y,se,ce){var ne=this._writableState,ye=!1,le=!ne.objectMode&&l(Y);return le&&!t.isBuffer(Y)&&(Y=a(Y)),typeof se=="function"&&(ce=se,se=null),le?se="buffer":se||(se=ne.defaultEncoding),typeof ce!="function"&&(ce=I),ne.ending?h(this,ce):(le||m(this,ne,Y,ce))&&(ne.pendingcb++,ye=F(this,ne,le,Y,se,ce)),ye},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var Y=this._writableState;Y.corked&&(Y.corked--,!Y.writing&&!Y.corked&&!Y.bufferProcessing&&Y.bufferedRequest&&H(this,Y))},_.prototype.setDefaultEncoding=function(se){if(typeof se=="string"&&(se=se.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((se+"").toLowerCase())>-1))throw new A(se);return this._writableState.defaultEncoding=se,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function w(Y,se,ce){return!Y.objectMode&&Y.decodeStrings!==!1&&typeof se=="string"&&(se=t.from(se,ce)),se}Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function F(Y,se,ce,ne,ye,le){if(!ce){var Z=w(se,ne,ye);ne!==Z&&(ce=!0,ye="buffer",ne=Z)}var de=se.objectMode?1:ne.length;se.length+=de;var pe=se.length>5===6?2:C>>4===14?3:C>>3===30?4:C>>6===2?-1:-2}function r(C,f,x){var A=f.length-1;if(A=0?(k>0&&(C.lastNeed=k-1),k):--A=0?(k>0&&(C.lastNeed=k-2),k):--A=0?(k>0&&(k===2?k=0:C.lastNeed=k-3),k):0))}function a(C,f,x){if((f[0]&192)!==128)return C.lastNeed=0,"�";if(C.lastNeed>1&&f.length>1){if((f[1]&192)!==128)return C.lastNeed=1,"�";if(C.lastNeed>2&&f.length>2&&(f[2]&192)!==128)return C.lastNeed=2,"�"}}function l(C){var f=this.lastTotal-this.lastNeed,x=a(this,C);if(x!==void 0)return x;if(this.lastNeed<=C.length)return C.copy(this.lastChar,f,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);C.copy(this.lastChar,f,0,C.length),this.lastNeed-=C.length}function i(C,f){var x=r(this,C,f);if(!this.lastNeed)return C.toString("utf8",f);this.lastTotal=x;var A=C.length-(x-this.lastNeed);return C.copy(this.lastChar,0,A),C.toString("utf8",f,A)}function s(C){var f=C&&C.length?this.write(C):"";return this.lastNeed?f+"�":f}function o(C,f){if((C.length-f)%2===0){var x=C.toString("utf16le",f);if(x){var A=x.charCodeAt(x.length-1);if(A>=55296&&A<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=C[C.length-2],this.lastChar[1]=C[C.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=C[C.length-1],C.toString("utf16le",f,C.length-1)}function c(C){var f=C&&C.length?this.write(C):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return f+this.lastChar.toString("utf16le",0,x)}return f}function p(C,f){var x=(C.length-f)%3;return x===0?C.toString("base64",f):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=C[C.length-1]:(this.lastChar[0]=C[C.length-2],this.lastChar[1]=C[C.length-1]),C.toString("base64",f,C.length-x))}function d(C){var f=C&&C.length?this.write(C):"";return this.lastNeed?f+this.lastChar.toString("base64",0,3-this.lastNeed):f}function y(C){return C.toString(this.encoding)}function g(C){return C&&C.length?this.write(C):""}}}),zy=Re({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(ae,K){var v=Py().codes.ERR_STREAM_PREMATURE_CLOSE;function S(r){var a=!1;return function(){if(!a){a=!0;for(var l=arguments.length,i=new Array(l),s=0;s0)if(typeof Z!="string"&&!Ne.objectMode&&Object.getPrototypeOf(Z)!==L.prototype&&(Z=r(Z)),pe)Ne.endEmitted?I(le,new f):w(le,Ne,Z,!0);else if(Ne.ended)I(le,new g);else{if(Ne.destroyed)return!1;Ne.reading=!1,Ne.decoder&&!de?(Z=Ne.decoder.write(Z),Ne.objectMode||Z.length!==0?w(le,Ne,Z,!1):H(le,Ne)):w(le,Ne,Z,!1)}else pe||(Ne.reading=!1,H(le,Ne))}return!Ne.ended&&(Ne.length=z?le=z:(le--,le|=le>>>1,le|=le>>>2,le|=le>>>4,le|=le>>>8,le|=le>>>16,le++),le}function V(le,Z){return le<=0||Z.length===0&&Z.ended?0:Z.objectMode?1:le!==le?Z.flowing&&Z.length?Z.buffer.head.data.length:Z.length:(le>Z.highWaterMark&&(Z.highWaterMark=U(le)),le<=Z.length?le:Z.ended?Z.length:(Z.needReadable=!0,0))}h.prototype.read=function(le){i("read",le),le=parseInt(le,10);var Z=this._readableState,de=le;if(le!==0&&(Z.emittedReadable=!1),le===0&&Z.needReadable&&((Z.highWaterMark!==0?Z.length>=Z.highWaterMark:Z.length>0)||Z.ended))return i("read: emitReadable",Z.length,Z.ended),Z.length===0&&Z.ended?ce(this):j(this),null;if(le=V(le,Z),le===0&&Z.ended)return Z.length===0&&ce(this),null;var pe=Z.needReadable;i("need readable",pe),(Z.length===0||Z.length-le0?Te=se(le,Z):Te=null,Te===null?(Z.needReadable=Z.length<=Z.highWaterMark,le=0):(Z.length-=le,Z.awaitDrain=0),Z.length===0&&(Z.ended||(Z.needReadable=!0),de!==le&&Z.ended&&ce(this)),Te!==null&&this.emit("data",Te),Te};function G(le,Z){if(i("onEofChunk"),!Z.ended){if(Z.decoder){var de=Z.decoder.end();de&&de.length&&(Z.buffer.push(de),Z.length+=Z.objectMode?1:de.length)}Z.ended=!0,Z.sync?j(le):(Z.needReadable=!1,Z.emittedReadable||(Z.emittedReadable=!0,O(le)))}}function j(le){var Z=le._readableState;i("emitReadable",Z.needReadable,Z.emittedReadable),Z.needReadable=!1,Z.emittedReadable||(i("emitReadable",Z.flowing),Z.emittedReadable=!0,process.nextTick(O,le))}function O(le){var Z=le._readableState;i("emitReadable_",Z.destroyed,Z.length,Z.ended),!Z.destroyed&&(Z.length||Z.ended)&&(le.emit("readable"),Z.emittedReadable=!1),Z.needReadable=!Z.flowing&&!Z.ended&&Z.length<=Z.highWaterMark,Y(le)}function H(le,Z){Z.readingMore||(Z.readingMore=!0,process.nextTick(W,le,Z))}function W(le,Z){for(;!Z.reading&&!Z.ended&&(Z.length1&&ye(pe.pipes,le)!==-1)&&!it&&(i("false write response, pause",pe.awaitDrain),pe.awaitDrain++),de.pause())}function mt(Se){i("onerror",Se),ze(),le.removeListener("error",mt),S(le,"error")===0&&I(le,Se)}E(le,"error",mt);function ht(){le.removeListener("finish",Ve),ze()}le.once("close",ht);function Ve(){i("onfinish"),le.removeListener("close",ht),ze()}le.once("finish",Ve);function ze(){i("unpipe"),de.unpipe(le)}return le.emit("pipe",de),pe.flowing||(i("pipe resume"),de.resume()),le};function ee(le){return function(){var de=le._readableState;i("pipeOnDrain",de.awaitDrain),de.awaitDrain&&de.awaitDrain--,de.awaitDrain===0&&S(le,"data")&&(de.flowing=!0,Y(le))}}h.prototype.unpipe=function(le){var Z=this._readableState,de={hasUnpiped:!1};if(Z.pipesCount===0)return this;if(Z.pipesCount===1)return le&&le!==Z.pipes?this:(le||(le=Z.pipes),Z.pipes=null,Z.pipesCount=0,Z.flowing=!1,le&&le.emit("unpipe",this,de),this);if(!le){var pe=Z.pipes,Te=Z.pipesCount;Z.pipes=null,Z.pipesCount=0,Z.flowing=!1;for(var Ne=0;Ne0,pe.flowing!==!1&&this.resume()):le==="readable"&&!pe.endEmitted&&!pe.readableListening&&(pe.readableListening=pe.needReadable=!0,pe.flowing=!1,pe.emittedReadable=!1,i("on readable",pe.length,pe.reading),pe.length?j(this):pe.reading||process.nextTick(xe,this)),de},h.prototype.addListener=h.prototype.on,h.prototype.removeListener=function(le,Z){var de=M.prototype.removeListener.call(this,le,Z);return le==="readable"&&process.nextTick(ue,this),de},h.prototype.removeAllListeners=function(le){var Z=M.prototype.removeAllListeners.apply(this,arguments);return(le==="readable"||le===void 0)&&process.nextTick(ue,this),Z};function ue(le){var Z=le._readableState;Z.readableListening=le.listenerCount("readable")>0,Z.resumeScheduled&&!Z.paused?Z.flowing=!0:le.listenerCount("data")>0&&le.resume()}function xe(le){i("readable nexttick read 0"),le.read(0)}h.prototype.resume=function(){var le=this._readableState;return le.flowing||(i("resume"),le.flowing=!le.readableListening,ge(this,le)),le.paused=!1,this};function ge(le,Z){Z.resumeScheduled||(Z.resumeScheduled=!0,process.nextTick(_e,le,Z))}function _e(le,Z){i("resume",Z.reading),Z.reading||le.read(0),Z.resumeScheduled=!1,le.emit("resume"),Y(le),Z.flowing&&!Z.reading&&le.read(0)}h.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Y(le){var Z=le._readableState;for(i("flow",Z.flowing);Z.flowing&&le.read()!==null;);}h.prototype.wrap=function(le){var Z=this,de=this._readableState,pe=!1;le.on("end",function(){if(i("wrapped end"),de.decoder&&!de.ended){var $e=de.decoder.end();$e&&$e.length&&Z.push($e)}Z.push(null)}),le.on("data",function($e){if(i("wrapped data"),de.decoder&&($e=de.decoder.write($e)),!(de.objectMode&&$e==null)&&!(!de.objectMode&&(!$e||!$e.length))){var Ze=Z.push($e);Ze||(pe=!0,le.pause())}});for(var Te in le)this[Te]===void 0&&typeof le[Te]=="function"&&(this[Te]=(function(Ze){return function(){return le[Ze].apply(le,arguments)}})(Te));for(var Ne=0;Ne=Z.length?(Z.decoder?de=Z.buffer.join(""):Z.buffer.length===1?de=Z.buffer.first():de=Z.buffer.concat(Z.length),Z.buffer.clear()):de=Z.buffer.consume(le,Z.decoder),de}function ce(le){var Z=le._readableState;i("endReadable",Z.endEmitted),Z.endEmitted||(Z.ended=!0,process.nextTick(ne,Z,le))}function ne(le,Z){if(i("endReadableNT",le.endEmitted,le.length),!le.endEmitted&&le.length===0&&(le.endEmitted=!0,Z.readable=!1,Z.emit("end"),le.autoDestroy)){var de=Z._writableState;(!de||de.autoDestroy&&de.finished)&&Z.destroy()}}typeof Symbol=="function"&&(h.from=function(le,Z){return k===void 0&&(k=Kv()),k(h,le,Z)});function ye(le,Z){for(var de=0,pe=le.length;de0;return l(x,k,I,function(T){C||(C=T),T&&f.forEach(i),!k&&(f.forEach(i),g(C))})});return d.reduce(s)}K.exports=c}}),tT=Re({"node_modules/stream-browserify/index.js"(ae,K){K.exports=M;var v=I0().EventEmitter,S=Ym();S(M,v),M.Readable=Q3(),M.Writable=G0(),M.Duplex=Zm(),M.Transform=hw(),M.PassThrough=lI(),M.finished=zy(),M.pipeline=eT(),M.Stream=M;function M(){v.call(this)}M.prototype.pipe=function(L,t){var r=this;function a(d){L.writable&&L.write(d)===!1&&r.pause&&r.pause()}r.on("data",a);function l(){r.readable&&r.resume&&r.resume()}L.on("drain",l),!L._isStdio&&(!t||t.end!==!1)&&(r.on("end",s),r.on("close",o));var i=!1;function s(){i||(i=!0,L.end())}function o(){i||(i=!0,typeof L.destroy=="function"&&L.destroy())}function c(d){if(p(),v.listenerCount(this,"error")===0)throw d}r.on("error",c),L.on("error",c);function p(){r.removeListener("data",a),L.removeListener("drain",l),r.removeListener("end",s),r.removeListener("close",o),r.removeListener("error",c),L.removeListener("error",c),r.removeListener("end",p),r.removeListener("close",p),L.removeListener("close",p)}return r.on("end",p),r.on("close",p),L.on("close",p),L.emit("pipe",r),L}}}),Km=Re({"node_modules/util/util.js"(ae){var K=Object.getOwnPropertyDescriptors||function(ee){for(var ue=Object.keys(ee),xe={},ge=0;ge=ge)return se;switch(se){case"%s":return String(xe[ue++]);case"%d":return Number(xe[ue++]);case"%j":try{return JSON.stringify(xe[ue++])}catch{return"[Circular]"}default:return se}}),Y=xe[ue];ue"u")return function(){return ae.deprecate(W,ee).apply(this,arguments)};var ue=!1;function xe(){if(!ue){if(process.throwDeprecation)throw new Error(ee);process.traceDeprecation?console.trace(ee):console.error(ee),ue=!0}return W.apply(this,arguments)}return xe};var S={},M=/^$/;L="false",L=L.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),M=new RegExp("^"+L+"$","i");var L;ae.debuglog=function(W){if(W=W.toUpperCase(),!S[W])if(M.test(W)){var ee=process.pid;S[W]=function(){var ue=ae.format.apply(ae,arguments);console.error("%s %d: %s",W,ee,ue)}}else S[W]=function(){};return S[W]};function t(W,ee){var ue={seen:[],stylize:a};return arguments.length>=3&&(ue.depth=arguments[2]),arguments.length>=4&&(ue.colors=arguments[3]),g(ee)?ue.showHidden=ee:ee&&ae._extend(ue,ee),I(ue.showHidden)&&(ue.showHidden=!1),I(ue.depth)&&(ue.depth=2),I(ue.colors)&&(ue.colors=!1),I(ue.customInspect)&&(ue.customInspect=!0),ue.colors&&(ue.stylize=r),i(ue,W,ue.depth)}ae.inspect=t,t.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]},t.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function r(W,ee){var ue=t.styles[ee];return ue?"\x1B["+t.colors[ue][0]+"m"+W+"\x1B["+t.colors[ue][1]+"m":W}function a(W,ee){return W}function l(W){var ee={};return W.forEach(function(ue,xe){ee[ue]=!0}),ee}function i(W,ee,ue){if(W.customInspect&&ee&&m(ee.inspect)&&ee.inspect!==ae.inspect&&!(ee.constructor&&ee.constructor.prototype===ee)){var xe=ee.inspect(ue,W);return A(xe)||(xe=i(W,xe,ue)),xe}var ge=s(W,ee);if(ge)return ge;var _e=Object.keys(ee),Y=l(_e);if(W.showHidden&&(_e=Object.getOwnPropertyNames(ee)),h(ee)&&(_e.indexOf("message")>=0||_e.indexOf("description")>=0))return o(ee);if(_e.length===0){if(m(ee)){var se=ee.name?": "+ee.name:"";return W.stylize("[Function"+se+"]","special")}if(T(ee))return W.stylize(RegExp.prototype.toString.call(ee),"regexp");if(_(ee))return W.stylize(Date.prototype.toString.call(ee),"date");if(h(ee))return o(ee)}var ce="",ne=!1,ye=["{","}"];if(y(ee)&&(ne=!0,ye=["[","]"]),m(ee)){var le=ee.name?": "+ee.name:"";ce=" [Function"+le+"]"}if(T(ee)&&(ce=" "+RegExp.prototype.toString.call(ee)),_(ee)&&(ce=" "+Date.prototype.toUTCString.call(ee)),h(ee)&&(ce=" "+o(ee)),_e.length===0&&(!ne||ee.length==0))return ye[0]+ce+ye[1];if(ue<0)return T(ee)?W.stylize(RegExp.prototype.toString.call(ee),"regexp"):W.stylize("[Object]","special");W.seen.push(ee);var Z;return ne?Z=c(W,ee,ue,Y,_e):Z=_e.map(function(de){return p(W,ee,ue,Y,de,ne)}),W.seen.pop(),d(Z,ce,ye)}function s(W,ee){if(I(ee))return W.stylize("undefined","undefined");if(A(ee)){var ue="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return W.stylize(ue,"string")}if(x(ee))return W.stylize(""+ee,"number");if(g(ee))return W.stylize(""+ee,"boolean");if(C(ee))return W.stylize("null","null")}function o(W){return"["+Error.prototype.toString.call(W)+"]"}function c(W,ee,ue,xe,ge){for(var _e=[],Y=0,se=ee.length;Y-1&&(_e?se=se.split(` +`).map(function(ne){return" "+ne}).join(` +`).slice(2):se=` +`+se.split(` +`).map(function(ne){return" "+ne}).join(` +`))):se=W.stylize("[Circular]","special")),I(Y)){if(_e&&ge.match(/^\d+$/))return se;Y=JSON.stringify(""+ge),Y.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Y=Y.slice(1,-1),Y=W.stylize(Y,"name")):(Y=Y.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Y=W.stylize(Y,"string"))}return Y+": "+se}function d(W,ee,ue){var xe=W.reduce(function(ge,_e){return _e.indexOf(` +`)>=0,ge+_e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return xe>60?ue[0]+(ee===""?"":ee+` + `)+" "+W.join(`, + `)+" "+ue[1]:ue[0]+ee+" "+W.join(", ")+" "+ue[1]}ae.types=Ic();function y(W){return Array.isArray(W)}ae.isArray=y;function g(W){return typeof W=="boolean"}ae.isBoolean=g;function C(W){return W===null}ae.isNull=C;function f(W){return W==null}ae.isNullOrUndefined=f;function x(W){return typeof W=="number"}ae.isNumber=x;function A(W){return typeof W=="string"}ae.isString=A;function k(W){return typeof W=="symbol"}ae.isSymbol=k;function I(W){return W===void 0}ae.isUndefined=I;function T(W){return E(W)&&F(W)==="[object RegExp]"}ae.isRegExp=T,ae.types.isRegExp=T;function E(W){return typeof W=="object"&&W!==null}ae.isObject=E;function _(W){return E(W)&&F(W)==="[object Date]"}ae.isDate=_,ae.types.isDate=_;function h(W){return E(W)&&(F(W)==="[object Error]"||W instanceof Error)}ae.isError=h,ae.types.isNativeError=h;function m(W){return typeof W=="function"}ae.isFunction=m;function w(W){return W===null||typeof W=="boolean"||typeof W=="number"||typeof W=="string"||typeof W=="symbol"||typeof W>"u"}ae.isPrimitive=w,ae.isBuffer=Lf();function F(W){return Object.prototype.toString.call(W)}function z(W){return W<10?"0"+W.toString(10):W.toString(10)}var U=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var W=new Date,ee=[z(W.getHours()),z(W.getMinutes()),z(W.getSeconds())].join(":");return[W.getDate(),U[W.getMonth()],ee].join(" ")}ae.log=function(){console.log("%s - %s",V(),ae.format.apply(ae,arguments))},ae.inherits=Ym(),ae._extend=function(W,ee){if(!ee||!E(ee))return W;for(var ue=Object.keys(ee),xe=ue.length;xe--;)W[ue[xe]]=ee[ue[xe]];return W};function G(W,ee){return Object.prototype.hasOwnProperty.call(W,ee)}var j=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;ae.promisify=function(ee){if(typeof ee!="function")throw new TypeError('The "original" argument must be of type Function');if(j&&ee[j]){var ue=ee[j];if(typeof ue!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ue,j,{value:ue,enumerable:!1,writable:!1,configurable:!0}),ue}function ue(){for(var xe,ge,_e=new Promise(function(ce,ne){xe=ce,ge=ne}),Y=[],se=0;se"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function s(x){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(k){return k.__proto__||Object.getPrototypeOf(k)},s(x)}var o={},c,p;function d(x,A,k){k||(k=Error);function I(E,_,h){return typeof A=="string"?A:A(E,_,h)}var T=(function(E){L(h,E);var _=r(h);function h(m,w,F){var z;return M(this,h),z=_.call(this,I(m,w,F)),z.code=x,z}return S(h)})(k);o[x]=T}function y(x,A){if(Array.isArray(x)){var k=x.length;return x=x.map(function(I){return String(I)}),k>2?"one of ".concat(A," ").concat(x.slice(0,k-1).join(", "),", or ")+x[k-1]:k===2?"one of ".concat(A," ").concat(x[0]," or ").concat(x[1]):"of ".concat(A," ").concat(x[0])}else return"of ".concat(A," ").concat(String(x))}function g(x,A,k){return x.substr(0,A.length)===A}function C(x,A,k){return(k===void 0||k>x.length)&&(k=x.length),x.substring(k-A.length,k)===A}function f(x,A,k){return typeof k!="number"&&(k=0),k+A.length>x.length?!1:x.indexOf(A,k)!==-1}d("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),d("ERR_INVALID_ARG_TYPE",function(x,A,k){c===void 0&&(c=lx()),c(typeof x=="string","'name' must be a string");var I;typeof A=="string"&&g(A,"not ")?(I="must not be",A=A.replace(/^not /,"")):I="must be";var T;if(C(x," argument"))T="The ".concat(x," ").concat(I," ").concat(y(A,"type"));else{var E=f(x,".")?"property":"argument";T='The "'.concat(x,'" ').concat(E," ").concat(I," ").concat(y(A,"type"))}return T+=". Received type ".concat(v(k)),T},TypeError),d("ERR_INVALID_ARG_VALUE",function(x,A){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=Km());var I=p.inspect(A);return I.length>128&&(I="".concat(I.slice(0,128),"...")),"The argument '".concat(x,"' ").concat(k,". Received ").concat(I)},TypeError),d("ERR_INVALID_RETURN_VALUE",function(x,A,k){var I;return k&&k.constructor&&k.constructor.name?I="instance of ".concat(k.constructor.name):I="type ".concat(v(k)),"Expected ".concat(x,' to be returned from the "').concat(A,'"')+" function but got ".concat(I,".")},TypeError),d("ERR_MISSING_ARGS",function(){for(var x=arguments.length,A=new Array(x),k=0;k0,"At least one arg needs to be specified");var I="The ",T=A.length;switch(A=A.map(function(E){return'"'.concat(E,'"')}),T){case 1:I+="".concat(A[0]," argument");break;case 2:I+="".concat(A[0]," and ").concat(A[1]," arguments");break;default:I+=A.slice(0,T-1).join(", "),I+=", and ".concat(A[T-1]," arguments");break}return"".concat(I," must be specified")},TypeError),K.exports.codes=o}}),Ny=Re({"node_modules/assert/build/internal/assert/assertion_error.js"(ae,K){function v(H,W){var ee=Object.keys(H);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(H);W&&(ue=ue.filter(function(xe){return Object.getOwnPropertyDescriptor(H,xe).enumerable})),ee.push.apply(ee,ue)}return ee}function S(H){for(var W=1;W"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function g(H){return Function.toString.call(H).indexOf("[native code]")!==-1}function C(H,W){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(ue,xe){return ue.__proto__=xe,ue},C(H,W)}function f(H){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(ee){return ee.__proto__||Object.getPrototypeOf(ee)},f(H)}function x(H){"@babel/helpers - typeof";return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},x(H)}var A=Km(),k=A.inspect,I=Zd(),T=I.codes.ERR_INVALID_ARG_TYPE;function E(H,W,ee){return(ee===void 0||ee>H.length)&&(ee=H.length),H.substring(ee-W.length,ee)===W}function _(H,W){if(W=Math.floor(W),H.length==0||W==0)return"";var ee=H.length*W;for(W=Math.floor(Math.log(W)/Math.log(2));W;)H+=H,W--;return H+=H.substring(0,ee-H.length),H}var h="",m="",w="",F="",z={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:"},U=10;function V(H){var W=Object.keys(H),ee=Object.create(Object.getPrototypeOf(H));return W.forEach(function(ue){ee[ue]=H[ue]}),Object.defineProperty(ee,"message",{value:H.message}),ee}function G(H){return k(H,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function j(H,W,ee){var ue="",xe="",ge=0,_e="",Y=!1,se=G(H),ce=se.split(` +`),ne=G(W).split(` +`),ye=0,le="";if(ee==="strictEqual"&&x(H)==="object"&&x(W)==="object"&&H!==null&&W!==null&&(ee="strictEqualObject"),ce.length===1&&ne.length===1&&ce[0]!==ne[0]){var Z=ce[0].length+ne[0].length;if(Z<=U){if((x(H)!=="object"||H===null)&&(x(W)!=="object"||W===null)&&(H!==0||W!==0))return"".concat(z[ee],` + +`)+"".concat(ce[0]," !== ").concat(ne[0],` +`)}else if(ee!=="strictEqualObject"){var de=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(Z2&&(le=` + `.concat(_(" ",ye),"^"),ye=0)}}}for(var pe=ce[ce.length-1],Te=ne[ne.length-1];pe===Te&&(ye++<2?_e=` + `.concat(pe).concat(_e):ue=pe,ce.pop(),ne.pop(),!(ce.length===0||ne.length===0));)pe=ce[ce.length-1],Te=ne[ne.length-1];var Ne=Math.max(ce.length,ne.length);if(Ne===0){var $e=se.split(` +`);if($e.length>30)for($e[26]="".concat(h,"...").concat(F);$e.length>27;)$e.pop();return"".concat(z.notIdentical,` + +`).concat($e.join(` +`),` +`)}ye>3&&(_e=` +`.concat(h,"...").concat(F).concat(_e),Y=!0),ue!==""&&(_e=` + `.concat(ue).concat(_e),ue="");var Ze=0,Xe=z[ee]+` +`.concat(m,"+ actual").concat(F," ").concat(w,"- expected").concat(F),it=" ".concat(h,"...").concat(F," Lines skipped");for(ye=0;ye1&&ye>2&&(yt>4?(xe+=` +`.concat(h,"...").concat(F),Y=!0):yt>3&&(xe+=` + `.concat(ne[ye-2]),Ze++),xe+=` + `.concat(ne[ye-1]),Ze++),ge=ye,ue+=` +`.concat(w,"-").concat(F," ").concat(ne[ye]),Ze++;else if(ne.length1&&ye>2&&(yt>4?(xe+=` +`.concat(h,"...").concat(F),Y=!0):yt>3&&(xe+=` + `.concat(ce[ye-2]),Ze++),xe+=` + `.concat(ce[ye-1]),Ze++),ge=ye,xe+=` +`.concat(m,"+").concat(F," ").concat(ce[ye]),Ze++;else{var bt=ne[ye],mt=ce[ye],ht=mt!==bt&&(!E(mt,",")||mt.slice(0,-1)!==bt);ht&&E(bt,",")&&bt.slice(0,-1)===mt&&(ht=!1,mt+=","),ht?(yt>1&&ye>2&&(yt>4?(xe+=` +`.concat(h,"...").concat(F),Y=!0):yt>3&&(xe+=` + `.concat(ce[ye-2]),Ze++),xe+=` + `.concat(ce[ye-1]),Ze++),ge=ye,xe+=` +`.concat(m,"+").concat(F," ").concat(mt),ue+=` +`.concat(w,"-").concat(F," ").concat(bt),Ze+=2):(xe+=ue,ue="",(yt===1||ye===0)&&(xe+=` + `.concat(mt),Ze++))}if(Ze>20&&ye30)for(Z[26]="".concat(h,"...").concat(F);Z.length>27;)Z.pop();Z.length===1?ge=ee.call(this,"".concat(le," ").concat(Z[0])):ge=ee.call(this,"".concat(le,` + +`).concat(Z.join(` +`),` +`))}else{var de=G(ce),pe="",Te=z[Y];Y==="notDeepEqual"||Y==="notEqual"?(de="".concat(z[Y],` + +`).concat(de),de.length>1024&&(de="".concat(de.slice(0,1021),"..."))):(pe="".concat(G(ne)),de.length>512&&(de="".concat(de.slice(0,509),"...")),pe.length>512&&(pe="".concat(pe.slice(0,509),"...")),Y==="deepEqual"||Y==="equal"?de="".concat(Te,` + +`).concat(de,` + +should equal + +`):pe=" ".concat(Y," ").concat(pe)),ge=ee.call(this,"".concat(de).concat(pe))}return Error.stackTraceLimit=ye,ge.generatedMessage=!_e,Object.defineProperty(c(ge),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),ge.code="ERR_ASSERTION",ge.actual=ce,ge.expected=ne,ge.operator=Y,Error.captureStackTrace&&Error.captureStackTrace(c(ge),se),ge.stack,ge.name="AssertionError",o(ge)}return r(ue,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:W,value:function(ge,_e){return k(this,S(S({},_e),{},{customInspect:!1,depth:0}))}}]),ue})(p(Error),k.custom);K.exports=O}}),j1=Re({"node_modules/object-keys/isArguments.js"(ae,K){var v=Object.prototype.toString;K.exports=function(M){var L=v.call(M),t=L==="[object Arguments]";return t||(t=L!=="[object Array]"&&M!==null&&typeof M=="object"&&typeof M.length=="number"&&M.length>=0&&v.call(M.callee)==="[object Function]"),t}}}),q0=Re({"node_modules/object-keys/implementation.js"(ae,K){var v;Object.keys||(S=Object.prototype.hasOwnProperty,M=Object.prototype.toString,L=j1(),t=Object.prototype.propertyIsEnumerable,r=!t.call({toString:null},"toString"),a=t.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=function(p){var d=p.constructor;return d&&d.prototype===p},s={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},o=(function(){if(typeof window>"u")return!1;for(var p in window)try{if(!s["$"+p]&&S.call(window,p)&&window[p]!==null&&typeof window[p]=="object")try{i(window[p])}catch{return!0}}catch{return!0}return!1})(),c=function(p){if(typeof window>"u"||!o)return i(p);try{return i(p)}catch{return!1}},v=function(d){var y=d!==null&&typeof d=="object",g=M.call(d)==="[object Function]",C=L(d),f=y&&M.call(d)==="[object String]",x=[];if(!y&&!g&&!C)throw new TypeError("Object.keys called on a non-object");var A=a&&g;if(f&&d.length>0&&!S.call(d,0))for(var k=0;k0)for(var I=0;I2?arguments[2]:{},d=v(c);S&&(d=L.call(d,Object.getOwnPropertySymbols(c)));for(var y=0;yht.length)&&(Ve=ht.length);for(var ze=0,Se=new Array(Ve);ze10)return!0;for(var Ve=0;Ve57)return!0}return ht.length===10&&ht>=Math.pow(2,32)}function O(ht){return Object.keys(ht).filter(j).concat(c(ht).filter(Object.prototype.propertyIsEnumerable.bind(ht)))}function H(ht,Ve){if(ht===Ve)return 0;for(var ze=ht.length,Se=Ve.length,Je=0,_t=Math.min(ze,Se);Je<_t;++Je)if(ht[Je]!==Ve[Je]){ze=ht[Je],Se=Ve[Je];break}return ze1?Y-1:0),ce=1;ce1?Y-1:0),ce=1;ce1?Y-1:0),ce=1;ce1?Y-1:0),ce=1;ce0)return r(s);if(c==="number"&&isNaN(s)===!1)return o.long?l(s):a(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))};function r(s){if(s=String(s),!(s.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(s);if(o){var c=parseFloat(o[1]),p=(o[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return c*t;case"days":case"day":case"d":return c*L;case"hours":case"hour":case"hrs":case"hr":case"h":return c*M;case"minutes":case"minute":case"mins":case"min":case"m":return c*S;case"seconds":case"second":case"secs":case"sec":case"s":return c*v;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function a(s){return s>=L?Math.round(s/L)+"d":s>=M?Math.round(s/M)+"h":s>=S?Math.round(s/S)+"m":s>=v?Math.round(s/v)+"s":s+"ms"}function l(s){return i(s,L,"day")||i(s,M,"hour")||i(s,S,"minute")||i(s,v,"second")||s+" ms"}function i(s,o,c){if(!(s=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}ae.formatters.j=function(a){try{return JSON.stringify(a)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}};function S(a){var l=this.useColors;if(a[0]=(l?"%c":"")+this.namespace+(l?" %c":" ")+a[0]+(l?"%c ":" ")+"+"+ae.humanize(this.diff),!!l){var i="color: "+this.color;a.splice(1,0,i,"color: inherit");var s=0,o=0;a[0].replace(/%[a-zA-Z%]/g,function(c){c!=="%%"&&(s++,c==="%c"&&(o=s))}),a.splice(o,0,i)}}function M(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function L(a){try{a==null?ae.storage.removeItem("debug"):ae.storage.debug=a}catch{}}function t(){var a;try{a=ae.storage.debug}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=e.DEBUG),a}ae.enable(t());function r(){try{return window.localStorage}catch{}}}}),dI=Re({"node_modules/stream-parser/index.js"(ae,K){var v=lx(),S=hI()("stream-parser");K.exports=a;var M=-1,L=0,t=1,r=2;function a(f){var x=f&&typeof f._transform=="function",A=f&&typeof f._write=="function";if(!x&&!A)throw new Error("must pass a Writable or Transform stream in");S("extending Parser into stream"),f._bytes=i,f._skipBytes=s,x&&(f._passthrough=o),x?f._transform=p:f._write=c}function l(f){S("initializing parser stream"),f._parserBytesLeft=0,f._parserBuffers=[],f._parserBuffered=0,f._parserState=M,f._parserCallback=null,typeof f.push=="function"&&(f._parserOutput=f.push.bind(f)),f._parserInit=!0}function i(f,x){v(!this._parserCallback,'there is already a "callback" set!'),v(isFinite(f)&&f>0,'can only buffer a finite number of bytes > 0, got "'+f+'"'),this._parserInit||l(this),S("buffering %o bytes",f),this._parserBytesLeft=f,this._parserCallback=x,this._parserState=L}function s(f,x){v(!this._parserCallback,'there is already a "callback" set!'),v(f>0,'can only skip > 0 bytes, got "'+f+'"'),this._parserInit||l(this),S("skipping %o bytes",f),this._parserBytesLeft=f,this._parserCallback=x,this._parserState=t}function o(f,x){v(!this._parserCallback,'There is already a "callback" set!'),v(f>0,'can only pass through > 0 bytes, got "'+f+'"'),this._parserInit||l(this),S("passing through %o bytes",f),this._parserBytesLeft=f,this._parserCallback=x,this._parserState=r}function c(f,x,A){this._parserInit||l(this),S("write(%o bytes)",f.length),typeof x=="function"&&(A=x),g(this,f,null,A)}function p(f,x,A){this._parserInit||l(this),S("transform(%o bytes)",f.length),typeof x!="function"&&(x=this._parserOutput),g(this,f,x,A)}function d(f,x,A,k){return f._parserBytesLeft<=0?k(new Error("got data but not currently parsing anything")):x.length<=f._parserBytesLeft?function(){return y(f,x,A,k)}:function(){var I=x.slice(0,f._parserBytesLeft);return y(f,I,A,function(T){if(T)return k(T);if(x.length>I.length)return function(){return d(f,x.slice(I.length),A,k)}})}}function y(f,x,A,k){if(f._parserBytesLeft-=x.length,S("%o bytes left for stream piece",f._parserBytesLeft),f._parserState===L?(f._parserBuffers.push(x),f._parserBuffered+=x.length):f._parserState===r&&A(x),f._parserBytesLeft===0){var I=f._parserCallback;if(I&&f._parserState===L&&f._parserBuffers.length>1&&(x=Buffer.concat(f._parserBuffers,f._parserBuffered)),f._parserState!==L&&(x=null),f._parserCallback=null,f._parserBuffered=0,f._parserState=M,f._parserBuffers.splice(0),I){var T=[];x&&T.push(x),A&&T.push(A);var E=I.length>T.length;E&&T.push(C(k));var _=I.apply(f,T);if(!E||k===_)return k}}else return k}var g=C(d);function C(f){return function(){for(var x=f.apply(this,arguments);typeof x=="function";)x=x();return x}}}}),lf=Re({"node_modules/probe-image-size/lib/common.js"(ae){var K=tT().Transform,v=dI();function S(){K.call(this,{readableObjectMode:!0})}S.prototype=Object.create(K.prototype),S.prototype.constructor=S,v(S.prototype),ae.ParserStream=S,ae.sliceEq=function(L,t,r){for(var a=t,l=0;l>4&15,d=o[4]&15,y=o[5]>>4&15,g=v(o,6),C=8,f=0;fg.width||y.width===g.width&&y.height>g.height?y:g}),p=o.reduce(function(y,g){return y.height>g.height||y.height===g.height&&y.width>g.width?y:g}),d;return c.width>p.height||c.width===p.height&&c.height>p.width?d=c:d=p,d}K.exports.readSizeFromMeta=function(o){var c={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(i(o,c),!!c.sizes.length){var p=s(c.sizes),d=1;c.transforms.forEach(function(g){var C={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},f={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(g.type==="imir"&&(g.value===0?d=f[d]:(d=f[d],d=C[d],d=C[d])),g.type==="irot")for(var x=0;x0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,L)}},M.prototype.read_uint16=function(L){var t=this.input;if(L+2>t.length)throw v("unexpected EOF","EBADDATA");return this.big_endian?t[L]*256+t[L+1]:t[L]+t[L+1]*256},M.prototype.read_uint32=function(L){var t=this.input;if(L+4>t.length)throw v("unexpected EOF","EBADDATA");return this.big_endian?t[L]*16777216+t[L+1]*65536+t[L+2]*256+t[L+3]:t[L]+t[L+1]*256+t[L+2]*65536+t[L+3]*16777216},M.prototype.is_subifd_link=function(L,t){return L===0&&t===34665||L===0&&t===34853||L===34665&&t===40965},M.prototype.exif_format_length=function(L){switch(L){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}},M.prototype.exif_format_read=function(L,t){var r;switch(L){case 1:case 2:return r=this.input[t],r;case 6:return r=this.input[t],r|(r&128)*33554430;case 3:return r=this.read_uint16(t),r;case 8:return r=this.read_uint16(t),r|(r&32768)*131070;case 4:return r=this.read_uint32(t),r;case 9:return r=this.read_uint32(t),r|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},M.prototype.scan_ifd=function(L,t,r){var a=this.read_uint16(t);t+=2;for(var l=0;lthis.input.length)throw v("unexpected EOF","EBADDATA");for(var g=[],C=d,f=0;f0&&(this.ifds_to_read.push({id:i,offset:g[0]}),y=!0);var A={is_big_endian:this.big_endian,ifd:L,tag:i,format:s,count:o,entry_offset:t+this.start,data_length:p,data_offset:d+this.start,value:g,is_subifd_link:y};if(r(A)===!1){this.aborted=!0;return}t+=12}L===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},K.exports.ExifParser=M,K.exports.get_orientation=function(L){var t=0;try{return new M(L,0,L.length).each(function(r){if(r.ifd===0&&r.tag===274&&Array.isArray(r.value))return t=r.value[0],!1}),t}catch{return-1}}}}),oP=Re({"node_modules/probe-image-size/lib/parse_sync/avif.js"(ae,K){var v=lf().str2arr,S=lf().sliceEq,M=lf().readUInt32BE,L=aT(),t=pw(),r=v("ftyp");K.exports=function(a){if(S(a,4,r)){var l=L.unbox(a,0);if(l){var i=L.getMimeType(l.data);if(i){for(var s,o=l.end;;){var c=L.unbox(a,o);if(!c)break;if(o=c.end,c.boxtype==="mdat")return;if(c.boxtype==="meta"){s=c.data;break}}if(s){var p=L.readSizeFromMeta(s);if(p){var d={width:p.width,height:p.height,type:i.type,mime:i.mime,wUnits:"px",hUnits:"px"};if(p.variants.length>1&&(d.variants=p.variants),p.orientation&&(d.orientation=p.orientation),p.exif_location&&p.exif_location.offset+p.exif_location.length<=a.length){var y=M(a,p.exif_location.offset),g=a.slice(p.exif_location.offset+y+4,p.exif_location.offset+p.exif_location.length),C=t.get_orientation(g);C>0&&(d.orientation=C)}return d}}}}}}}}),sP=Re({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(ae,K){var v=lf().str2arr,S=lf().sliceEq,M=lf().readUInt16LE,L=v("BM");K.exports=function(t){if(!(t.length<26)&&S(t,0,L))return{width:M(t,18),height:M(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),lP=Re({"node_modules/probe-image-size/lib/parse_sync/gif.js"(ae,K){var v=lf().str2arr,S=lf().sliceEq,M=lf().readUInt16LE,L=v("GIF87a"),t=v("GIF89a");K.exports=function(r){if(!(r.length<10)&&!(!S(r,0,L)&&!S(r,0,t)))return{width:M(r,6),height:M(r,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),pI=Re({"node_modules/probe-image-size/lib/parse_sync/ico.js"(ae,K){var v=lf().readUInt16LE,S=0,M=1,L=16;K.exports=function(t){var r=v(t,0),a=v(t,2),l=v(t,4);if(!(r!==S||a!==M||!l)){for(var i=[],s={width:0,height:0},o=0;os.width||p>s.height)&&(s=d)}return{width:s.width,height:s.height,variants:i,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),vI=Re({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(ae,K){var v=lf().readUInt16BE,S=lf().str2arr,M=lf().sliceEq,L=pw(),t=S("Exif\0\0");K.exports=function(r){if(!(r.length<2)&&!(r[0]!==255||r[1]!==216||r[2]!==255))for(var a=2;;){for(;;){if(r.length-a<2)return;if(r[a++]===255)break}for(var l=r[a++],i;l===255;)l=r[a++];if(208<=l&&l<=217||l===1)i=0;else if(192<=l&&l<=254){if(r.length-a<2)return;i=v(r,a)-2,a+=2}else return;if(l===217||l===218)return;var s;if(l===225&&i>=10&&M(r,a,t)&&(s=L.get_orientation(r.slice(a+6,a+i))),i>=5&&192<=l&&l<=207&&l!==196&&l!==200&&l!==204){if(r.length-a0&&(o.orientation=s),o}a+=i}}}}),cx=Re({"node_modules/probe-image-size/lib/parse_sync/png.js"(ae,K){var v=lf().str2arr,S=lf().sliceEq,M=lf().readUInt32BE,L=v(`‰PNG\r + +`),t=v("IHDR");K.exports=function(r){if(!(r.length<24)&&S(r,0,L)&&S(r,12,t))return{width:M(r,16),height:M(r,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),iT=Re({"node_modules/probe-image-size/lib/parse_sync/psd.js"(ae,K){var v=lf().str2arr,S=lf().sliceEq,M=lf().readUInt32BE,L=v("8BPS\0");K.exports=function(t){if(!(t.length<22)&&S(t,0,L))return{width:M(t,18),height:M(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),mI=Re({"node_modules/probe-image-size/lib/parse_sync/svg.js"(ae,K){function v(c){return c===32||c===9||c===13||c===10}function S(c){return typeof c=="number"&&isFinite(c)&&c>0}function M(c){var p=0,d=c.length;for(c[0]===239&&c[1]===187&&c[2]===191&&(p=3);p]*>/,t=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,r=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,a=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,i=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function s(c){var p=c.match(r),d=c.match(a),y=c.match(l);return{width:p&&(p[1]||p[2]),height:d&&(d[1]||d[2]),viewbox:y&&(y[1]||y[2])}}function o(c){return i.test(c)?c.match(i)[0]:"px"}K.exports=function(c){if(M(c)){for(var p="",d=0;d>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function s(o,c){return{width:(o[c+6]<<16|o[c+5]<<8|o[c+4])+1,height:(o[c+9]<o.length)){for(;c+8=10?p=p||l(o,c+8):g==="VP8L"&&C>=9?p=p||i(o,c+8):g==="VP8X"&&C>=10?p=p||s(o,c+8):g==="EXIF"&&(d=t.get_orientation(o.slice(c+8,c+8+C)),c=1/0),c+=8+C}if(p)return d>0&&(p.orientation=d),p}}}}}),_I=Re({"node_modules/probe-image-size/lib/parsers_sync.js"(ae,K){K.exports={avif:oP(),bmp:sP(),gif:lP(),ico:pI(),jpeg:vI(),png:cx(),psd:iT(),svg:mI(),tiff:gI(),webp:yI()}}}),xI=Re({"node_modules/probe-image-size/sync.js"(ae,K){var v=_I();function S(M){for(var L=Object.keys(v),t=0;t0;)F=p.c2p(I+G*h),G--;for(G=0;U===void 0&&G<_;)U=d.c2p(T+G*m),G++;for(G=_;V===void 0&&G>0;)V=d.c2p(T+G*m),G--;if(FY[0];if(se||ce){var ne=w+O/2,ye=U+H/2;ge+="transform:"+M(ne+"px",ye+"px")+"scale("+(se?-1:1)+","+(ce?-1:1)+")"+M(-ne+"px",-ye+"px")+";"}}xe.attr("style",ge);var le=new Promise(function(Z){if(x._hasZ)Z();else if(x._hasSource)if(x._canvas&&x._canvas.el.width===E&&x._canvas.el.height===_&&x._canvas.source===x.source)Z();else{var de=document.createElement("canvas");de.width=E,de.height=_;var pe=de.getContext("2d",{willReadFrequently:!0});x._image=x._image||new Image;var Te=x._image;Te.onload=function(){pe.drawImage(Te,0,0),x._canvas={el:de,source:x.source},Z()},Te.setAttribute("src",x.source)}}).then(function(){var Z,de;if(x._hasZ)de=ue(function(Ne,$e){var Ze=k[$e][Ne];return S.isTypedArray(Ze)&&(Ze=Array.from(Ze)),Ze}),Z=de.toDataURL("image/png");else if(x._hasSource)if(A)Z=x.source;else{var pe=x._canvas.el.getContext("2d",{willReadFrequently:!0}),Te=pe.getImageData(0,0,E,_).data;de=ue(function(Ne,$e){var Ze=4*($e*E+Ne);return[Te[Ze],Te[Ze+1],Te[Ze+2],Te[Ze+3]]}),Z=de.toDataURL("image/png")}xe.attr({"xlink:href":Z,height:H,width:O,x:w,y:U})});i._promises.push(le)})}}}),TI=Re({"src/traces/image/style.js"(ae,K){var v=un();K.exports=function(M){v.select(M).selectAll(".im image").style("opacity",function(L){return L[0].trace.opacity})}}}),Vf=Re({"src/traces/image/hover.js"(ae,K){var v=Sh(),S=Rn(),M=S.isArrayOrTypedArray,L=Xm();K.exports=function(r,a,l){var i=r.cd[0],s=i.trace,o=r.xa,c=r.ya;if(!(v.inbox(a-i.x0,a-(i.x0+i.w*s.dx),0)>0||v.inbox(l-i.y0,l-(i.y0+i.h*s.dy),0)>0)){var p=Math.floor((a-i.x0)/s.dx),d=Math.floor(Math.abs(l-i.y0)/s.dy),y;if(s._hasZ?y=i.z[d][p]:s._hasSource&&(y=s._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(p,d,1,1).data),!!y){var g=i.hi||s.hoverinfo,C;if(g){var f=g.split("+");f.indexOf("all")!==-1&&(f=["color"]),f.indexOf("color")!==-1&&(C=!0)}var x=L.colormodel[s.colormodel],A=x.colormodel||s.colormodel,k=A.length,I=s._scaler(y),T=x.suffix,E=[];(s.hovertemplate||C)&&(E.push("["+[I[0]+T[0],I[1]+T[1],I[2]+T[2]].join(", ")),k===4&&E.push(", "+I[3]+T[3]),E.push("]"),E=E.join(""),r.extraText=A.toUpperCase()+": "+E);var _;M(s.hovertext)&&M(s.hovertext[d])?_=s.hovertext[d][p]:M(s.text)&&M(s.text[d])&&(_=s.text[d][p]);var h=c.c2p(i.y0+(d+.5)*s.dy),m=i.x0+(p+.5)*s.dx,w=i.y0+(d+.5)*s.dy,F="["+y.slice(0,s.colormodel.length).join(", ")+"]";return[S.extendFlat(r,{index:[d,p],x0:o.c2p(i.x0+p*s.dx),x1:o.c2p(i.x0+(p+1)*s.dx),y0:h,y1:h,color:I,xVal:m,xLabelVal:m,yVal:w,yLabelVal:w,zLabelVal:F,text:_,hovertemplateLabels:{zLabel:F,colorLabel:E,"color[0]Label":I[0]+T[0],"color[1]Label":I[1]+T[1],"color[2]Label":I[2]+T[2],"color[3]Label":I[3]+T[3]}})]}}}}}),C5=Re({"src/traces/image/event_data.js"(ae,K){K.exports=function(S,M){return"xVal"in M&&(S.x=M.xVal),"yVal"in M&&(S.y=M.yVal),M.xa&&(S.xaxis=M.xa),M.ya&&(S.yaxis=M.ya),S.color=M.color,S.colormodel=M.trace.colormodel,S.z||(S.z=M.color),S}}}),uP=Re({"src/traces/image/index.js"(ae,K){K.exports={attributes:v5(),supplyDefaults:YM(),calc:oT(),plot:wI(),style:TI(),hoverPoints:Vf(),eventData:C5(),moduleType:"trace",name:"image",basePlotModule:td(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),AI=Re({"lib/image.js"(ae,K){K.exports=uP()}}),fx=Re({"src/traces/pie/attributes.js"(ae,K){var v=As(),S=af().attributes,M=Do(),L=du(),{hovertemplateAttrs:t,texttemplateAttrs:r,templatefallbackAttrs:a}=Wl(),l=Li().extendFlat,i=up().pattern,s=M({editType:"plot",arrayOk:!0,colorEditType:"plot"});K.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:L.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:i,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:l({},v.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:t({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:a(),texttemplate:r({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:a({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},s,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},s,{}),outsidetextfont:l({},s,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:l({},v.showlegend,{arrayOk:!0}),legend:l({},v.legend,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},s,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:S({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"}}}}),hx=Re({"src/traces/pie/defaults.js"(ae,K){var v=da(),S=Rn(),M=fx(),L=af().defaults,t=Wv().handleText,r=Rn().coercePattern;function a(s,o){var c=S.isArrayOrTypedArray(s),p=S.isArrayOrTypedArray(o),d=Math.min(c?s.length:1/0,p?o.length:1/0);if(isFinite(d)||(d=0),d&&p){for(var y,g=0;g0){y=!0;break}}y||(d=0)}return{hasLabels:c,hasValues:p,len:d}}function l(s,o,c,p,d){var y=p("marker.line.width");y&&p("marker.line.color",d?void 0:c.paper_bgcolor);var g=p("marker.colors");r(p,"marker.pattern",g),s.marker&&!o.marker.pattern.fgcolor&&(o.marker.pattern.fgcolor=s.marker.colors),o.marker.pattern.bgcolor||(o.marker.pattern.bgcolor=c.paper_bgcolor)}function i(s,o,c,p){function d(w,F){return S.coerce(s,o,M,w,F)}var y=d("labels"),g=d("values"),C=a(y,g),f=C.len;if(o._hasLabels=C.hasLabels,o._hasValues=C.hasValues,!o._hasLabels&&o._hasValues&&(d("label0"),d("dlabel")),!f){o.visible=!1;return}o._length=f,l(s,o,p,d,!0),d("scalegroup");var x=d("text"),A=d("texttemplate");d("texttemplatefallback");var k;if(A||(k=d("textinfo",S.isArrayOrTypedArray(x)?"text+percent":"percent")),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback"),A||k&&k!=="none"){var I=d("textposition");t(s,o,p,d,I,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var T=Array.isArray(I)||I==="auto",E=T||I==="outside";E&&d("automargin"),(I==="inside"||I==="auto"||Array.isArray(I))&&d("insidetextorientation")}else k==="none"&&d("textposition","none");L(o,p,d);var _=d("hole"),h=d("title.text");if(h){var m=d("title.position",_?"middle center":"top center");!_&&m==="middle center"&&(o.title.position="top center"),S.coerceFont(d,"title.font",p.font)}d("sort"),d("direction"),d("rotation"),d("pull")}K.exports={handleLabelsAndValues:a,handleMarkerDefaults:l,supplyDefaults:i}}}),k5=Re({"src/traces/pie/layout_attributes.js"(ae,K){K.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),sT=Re({"src/traces/pie/layout_defaults.js"(ae,K){var v=Rn(),S=k5();K.exports=function(L,t){function r(a,l){return v.coerce(L,t,S,a,l)}r("hiddenlabels"),r("piecolorway",t.colorway),r("extendpiecolors")}}}),t0=Re({"src/traces/pie/calc.js"(ae,K){var v=da(),S=oo(),M=ko(),L={};function t(i,s){var o=[],c=i._fullLayout,p=c.hiddenlabels||[],d=s.labels,y=s.marker.colors||[],g=s.values,C=s._length,f=s._hasValues&&C,x,A;if(s.dlabel)for(d=new Array(C),x=0;x=0});var F=s.type==="funnelarea"?E:s.sort;return F&&o.sort(function(z,U){return U.v-z.v}),o[0]&&(o[0].vTotal=T),o}function r(i){return function(o,c){return!o||(o=S(o),!o.isValid())?!1:(o=M.addOpacity(o,o.getAlpha()),i[c]||(i[c]=o),o)}}function a(i,s){var o=(s||{}).type;o||(o="pie");var c=i._fullLayout,p=i.calcdata,d=c[o+"colorway"],y=c["_"+o+"colormap"];c["extend"+o+"colors"]&&(d=l(d,L));for(var g=0,C=0;C0&&(_t+=Qt*Se.pxmid[0],At+=Qt*Se.pxmid[1])}Se.cxFinal=_t,Se.cyFinal=At;function fr(Bt,et,ut,Be){var Ie=Be*(et[0]-Bt[0]),ke=Be*(et[1]-Bt[1]);return"a"+Be*Te.r+","+Be*Te.r+" 0 "+Se.largeArc+(ut?" 1 ":" 0 ")+Ie+","+ke}var mr=Ne.hole;if(Se.v===Te.vTotal){var Ur="M"+(_t+Se.px0[0])+","+(At+Se.px0[1])+fr(Se.px0,Se.pxmid,!0,1)+fr(Se.pxmid,Se.px0,!0,1)+"Z";mr?Kt.attr("d","M"+(_t+mr*Se.px0[0])+","+(At+mr*Se.px0[1])+fr(Se.px0,Se.pxmid,!1,mr)+fr(Se.pxmid,Se.px0,!1,mr)+"Z"+Ur):Kt.attr("d",Ur)}else{var Br=fr(Se.px0,Se.px1,!0,1);if(mr){var fn=1-mr;Kt.attr("d","M"+(_t+mr*Se.px1[0])+","+(At+mr*Se.px1[1])+fr(Se.px1,Se.px0,!1,mr)+"l"+fn*Se.px0[0]+","+fn*Se.px0[1]+Br+"Z")}else Kt.attr("d","M"+_t+","+At+"l"+Se.px0[0]+","+Se.px0[1]+Br+"Z")}_e(se,Se,Te);var Fr=d.castOption(Ne.textposition,Se.pts),Qr=vt.selectAll("g.slicetext").data(Se.text&&Fr!=="none"?[0]:[]);Qr.enter().append("g").classed("slicetext",!0),Qr.exit().remove(),Qr.each(function(){var Bt=r.ensureSingle(v.select(this),"text","",function(ct){ct.attr("data-notex",1)}),et=r.ensureUniformFontSize(se,Fr==="outside"?A(Ne,Se,ye.font):k(Ne,Se,ye.font));Bt.text(Se.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(t.font,et).call(i.convertToTspans,se);var ut=t.bBox(Bt.node()),Be;if(Fr==="outside")Be=U(ut,Se);else if(Be=T(ut,Se,Te),Fr==="auto"&&Be.scale<1){var Ie=r.ensureUniformFontSize(se,Ne.outsidetextfont);Bt.call(t.font,Ie),ut=t.bBox(Bt.node()),Be=U(ut,Se)}var ke=Be.textPosAngle,Fe=ke===void 0?Se.pxmid:ge(Te.r,ke);if(Be.targetX=_t+Fe[0]*Be.rCenter+(Be.x||0),Be.targetY=At+Fe[1]*Be.rCenter+(Be.y||0),Y(Be,ut),Be.outside){var at=Be.targetY;Se.yLabelMin=at-ut.height/2,Se.yLabelMid=at,Se.yLabelMax=at+ut.height/2,Se.labelExtraX=0,Se.labelExtraY=0,Xe=!0}Be.fontSize=et.size,o(Ne.type,Be,ye),de[Je].transform=Be,r.setTransormAndDisplay(Bt,Be)})});var it=v.select(this).selectAll("g.titletext").data(Ne.title.text?[0]:[]);if(it.enter().append("g").classed("titletext",!0),it.exit().remove(),it.each(function(){var Se=r.ensureSingle(v.select(this),"text","",function(At){At.attr("data-notex",1)}),Je=Ne.title.text;Ne._meta&&(Je=r.templateString(Je,Ne._meta)),Se.text(Je).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(t.font,Ne.title.font).call(i.convertToTspans,se);var _t;Ne.title.position==="middle center"?_t=V(Te):_t=G(Te,le),Se.attr("transform",l(_t.x,_t.y)+a(Math.min(1,_t.scale))+l(_t.tx,_t.ty))}),Xe&&W(Ze,Ne),f($e,Ne),Xe&&Ne.automargin){var yt=t.bBox(pe.node()),bt=Ne.domain,mt=le.w*(bt.x[1]-bt.x[0]),ht=le.h*(bt.y[1]-bt.y[0]),Ve=(.5*mt-Te.r)/le.w,ze=(.5*ht-Te.r)/le.h;S.autoMargin(se,"pie."+Ne.uid+".automargin",{xl:bt.x[0]-Ve,xr:bt.x[1]+Ve,yb:bt.y[0]-ze,yt:bt.y[1]+ze,l:Math.max(Te.cx-Te.r-yt.left,0),r:Math.max(yt.right-(Te.cx+Te.r),0),b:Math.max(yt.bottom-(Te.cy+Te.r),0),t:Math.max(Te.cy-Te.r-yt.top,0),pad:5})}})});setTimeout(function(){Z.selectAll("tspan").each(function(){var de=v.select(this);de.attr("dy")&&de.attr("dy",de.attr("dy"))})},0)}function f(se,ce){se.each(function(ne){var ye=v.select(this);if(!ne.labelExtraX&&!ne.labelExtraY){ye.select("path.textline").remove();return}var le=ye.select("g.slicetext text");ne.transform.targetX+=ne.labelExtraX,ne.transform.targetY+=ne.labelExtraY,r.setTransormAndDisplay(le,ne.transform);var Z=ne.cxFinal+ne.pxmid[0],de=ne.cyFinal+ne.pxmid[1],pe="M"+Z+","+de,Te=(ne.yLabelMax-ne.yLabelMin)*(ne.pxmid[0]<0?-1:1)/4;if(ne.labelExtraX){var Ne=ne.labelExtraX*ne.pxmid[1]/ne.pxmid[0],$e=ne.yLabelMid+ne.labelExtraY-(ne.cyFinal+ne.pxmid[1]);Math.abs(Ne)>Math.abs($e)?pe+="l"+$e*ne.pxmid[0]/ne.pxmid[1]+","+$e+"H"+(Z+ne.labelExtraX+Te):pe+="l"+ne.labelExtraX+","+Ne+"v"+($e-Ne)+"h"+Te}else pe+="V"+(ne.yLabelMid+ne.labelExtraY)+"h"+Te;r.ensureSingle(ye,"path","textline").call(L.stroke,ce.outsidetextfont.color).attr({"stroke-width":Math.min(2,ce.outsidetextfont.size/8),d:pe,fill:"none"})})}function x(se,ce,ne){var ye=ne[0],le=ye.cx,Z=ye.cy,de=ye.trace,pe=de.type==="funnelarea";"_hasHoverLabel"in de||(de._hasHoverLabel=!1),"_hasHoverEvent"in de||(de._hasHoverEvent=!1),se.on("mouseover",function(Te){var Ne=ce._fullLayout,$e=ce._fullData[de.index];if(!(ce._dragging||Ne.hovermode===!1)){var Ze=$e.hoverinfo;if(Array.isArray(Ze)&&(Ze=M.castHoverinfo({hoverinfo:[d.castOption(Ze,Te.pts)],_module:de._module},Ne,0)),Ze==="all"&&(Ze="label+text+value+percent+name"),$e.hovertemplate||Ze!=="none"&&Ze!=="skip"&&Ze){var Xe=Te.rInscribed||0,it=le+Te.pxmid[0]*(1-Xe),yt=Z+Te.pxmid[1]*(1-Xe),bt=Ne.separators,mt=[];if(Ze&&Ze.indexOf("label")!==-1&&mt.push(Te.label),Te.text=d.castOption($e.hovertext||$e.text,Te.pts),Ze&&Ze.indexOf("text")!==-1){var ht=Te.text;r.isValidTextValue(ht)&&mt.push(ht)}Te.value=Te.v,Te.valueLabel=d.formatPieValue(Te.v,bt),Ze&&Ze.indexOf("value")!==-1&&mt.push(Te.valueLabel),Te.percent=Te.v/ye.vTotal,Te.percentLabel=d.formatPiePercent(Te.percent,bt),Ze&&Ze.indexOf("percent")!==-1&&mt.push(Te.percentLabel);var Ve=$e.hoverlabel,ze=Ve.font,Se=[];M.loneHover({trace:de,x0:it-Xe*ye.r,x1:it+Xe*ye.r,y:yt,_x0:pe?le+Te.TL[0]:it-Xe*ye.r,_x1:pe?le+Te.TR[0]:it+Xe*ye.r,_y0:pe?Z+Te.TL[1]:yt-Xe*ye.r,_y1:pe?Z+Te.BL[1]:yt+Xe*ye.r,text:mt.join("
"),name:$e.hovertemplate||Ze.indexOf("name")!==-1?$e.name:void 0,idealAlign:Te.pxmid[0]<0?"left":"right",color:d.castOption(Ve.bgcolor,Te.pts)||Te.color,borderColor:d.castOption(Ve.bordercolor,Te.pts),fontFamily:d.castOption(ze.family,Te.pts),fontSize:d.castOption(ze.size,Te.pts),fontColor:d.castOption(ze.color,Te.pts),nameLength:d.castOption(Ve.namelength,Te.pts),textAlign:d.castOption(Ve.align,Te.pts),hovertemplate:d.castOption($e.hovertemplate,Te.pts),hovertemplateLabels:Te,eventData:[y(Te,$e)]},{container:Ne._hoverlayer.node(),outerContainer:Ne._paper.node(),gd:ce,inOut_bbox:Se}),Te.bbox=Se[0],de._hasHoverLabel=!0}de._hasHoverEvent=!0,ce.emit("plotly_hover",{points:[y(Te,$e)],event:v.event})}}),se.on("mouseout",function(Te){var Ne=ce._fullLayout,$e=ce._fullData[de.index],Ze=v.select(this).datum();de._hasHoverEvent&&(Te.originalEvent=v.event,ce.emit("plotly_unhover",{points:[y(Ze,$e)],event:v.event}),de._hasHoverEvent=!1),de._hasHoverLabel&&(M.loneUnhover(Ne._hoverlayer.node()),de._hasHoverLabel=!1)}),se.on("click",function(Te){var Ne=ce._fullLayout,$e=ce._fullData[de.index];ce._dragging||Ne.hovermode===!1||(ce._hoverdata=[y(Te,$e)],M.click(ce,v.event))})}function A(se,ce,ne){var ye=d.castOption(se.outsidetextfont.color,ce.pts)||d.castOption(se.textfont.color,ce.pts)||ne.color,le=d.castOption(se.outsidetextfont.family,ce.pts)||d.castOption(se.textfont.family,ce.pts)||ne.family,Z=d.castOption(se.outsidetextfont.size,ce.pts)||d.castOption(se.textfont.size,ce.pts)||ne.size,de=d.castOption(se.outsidetextfont.weight,ce.pts)||d.castOption(se.textfont.weight,ce.pts)||ne.weight,pe=d.castOption(se.outsidetextfont.style,ce.pts)||d.castOption(se.textfont.style,ce.pts)||ne.style,Te=d.castOption(se.outsidetextfont.variant,ce.pts)||d.castOption(se.textfont.variant,ce.pts)||ne.variant,Ne=d.castOption(se.outsidetextfont.textcase,ce.pts)||d.castOption(se.textfont.textcase,ce.pts)||ne.textcase,$e=d.castOption(se.outsidetextfont.lineposition,ce.pts)||d.castOption(se.textfont.lineposition,ce.pts)||ne.lineposition,Ze=d.castOption(se.outsidetextfont.shadow,ce.pts)||d.castOption(se.textfont.shadow,ce.pts)||ne.shadow;return{color:ye,family:le,size:Z,weight:de,style:pe,variant:Te,textcase:Ne,lineposition:$e,shadow:Ze}}function k(se,ce,ne){var ye=d.castOption(se.insidetextfont.color,ce.pts);!ye&&se._input.textfont&&(ye=d.castOption(se._input.textfont.color,ce.pts));var le=d.castOption(se.insidetextfont.family,ce.pts)||d.castOption(se.textfont.family,ce.pts)||ne.family,Z=d.castOption(se.insidetextfont.size,ce.pts)||d.castOption(se.textfont.size,ce.pts)||ne.size,de=d.castOption(se.insidetextfont.weight,ce.pts)||d.castOption(se.textfont.weight,ce.pts)||ne.weight,pe=d.castOption(se.insidetextfont.style,ce.pts)||d.castOption(se.textfont.style,ce.pts)||ne.style,Te=d.castOption(se.insidetextfont.variant,ce.pts)||d.castOption(se.textfont.variant,ce.pts)||ne.variant,Ne=d.castOption(se.insidetextfont.textcase,ce.pts)||d.castOption(se.textfont.textcase,ce.pts)||ne.textcase,$e=d.castOption(se.insidetextfont.lineposition,ce.pts)||d.castOption(se.textfont.lineposition,ce.pts)||ne.lineposition,Ze=d.castOption(se.insidetextfont.shadow,ce.pts)||d.castOption(se.textfont.shadow,ce.pts)||ne.shadow;return{color:ye||L.contrast(ce.color),family:le,size:Z,weight:de,style:pe,variant:Te,textcase:Ne,lineposition:$e,shadow:Ze}}function I(se,ce){for(var ne,ye,le=0;le=-4;Ve-=2)ht(Math.PI*Ve,"tan");for(Ve=4;Ve>=-4;Ve-=2)ht(Math.PI*(Ve+1),"tan")}if(Ze||it){for(Ve=4;Ve>=-4;Ve-=2)ht(Math.PI*(Ve+1.5),"rad");for(Ve=4;Ve>=-4;Ve-=2)ht(Math.PI*(Ve+.5),"rad")}}if(pe||yt||Ze){var ze=Math.sqrt(se.width*se.width+se.height*se.height);if(mt={scale:le*ye*2/ze,rCenter:1-le,rotate:0},mt.textPosAngle=(ce.startangle+ce.stopangle)/2,mt.scale>=1)return mt;bt.push(mt)}(yt||it)&&(mt=_(se,ye,de,Te,Ne),mt.textPosAngle=(ce.startangle+ce.stopangle)/2,bt.push(mt)),(yt||Xe)&&(mt=h(se,ye,de,Te,Ne),mt.textPosAngle=(ce.startangle+ce.stopangle)/2,bt.push(mt));for(var Se=0,Je=0,_t=0;_t=1)break}return bt[Se]}function E(se,ce){var ne=se.startangle,ye=se.stopangle;return ne>ce&&ce>ye||ne0?1:-1)/2,y:Z/(1+ne*ne/(ye*ye)),outside:!0}}function V(se){var ce=Math.sqrt(se.titleBox.width*se.titleBox.width+se.titleBox.height*se.titleBox.height);return{x:se.cx,y:se.cy,scale:se.trace.hole*se.r*2/ce,tx:0,ty:-se.titleBox.height/2+se.trace.title.font.size}}function G(se,ce){var ne=1,ye=1,le,Z=se.trace,de={x:se.cx,y:se.cy},pe={tx:0,ty:0};pe.ty+=Z.title.font.size,le=H(Z),Z.title.position.indexOf("top")!==-1?(de.y-=(1+le)*se.r,pe.ty-=se.titleBox.height):Z.title.position.indexOf("bottom")!==-1&&(de.y+=(1+le)*se.r);var Te=j(se.r,se.trace.aspectratio),Ne=ce.w*(Z.domain.x[1]-Z.domain.x[0])/2;return Z.title.position.indexOf("left")!==-1?(Ne=Ne+Te,de.x-=(1+le)*Te,pe.tx+=se.titleBox.width/2):Z.title.position.indexOf("center")!==-1?Ne*=2:Z.title.position.indexOf("right")!==-1&&(Ne=Ne+Te,de.x+=(1+le)*Te,pe.tx-=se.titleBox.width/2),ne=Ne/se.titleBox.width,ye=O(se,ce)/se.titleBox.height,{x:de.x,y:de.y,scale:Math.min(ne,ye),tx:pe.tx,ty:pe.ty}}function j(se,ce){return se/(ce===void 0?1:ce)}function O(se,ce){var ne=se.trace,ye=ce.h*(ne.domain.y[1]-ne.domain.y[0]);return Math.min(se.titleBox.height,ye/2)}function H(se){var ce=se.pull;if(!ce)return 0;var ne;if(r.isArrayOrTypedArray(ce))for(ce=0,ne=0;nece&&(ce=se.pull[ne]);return ce}function W(se,ce){var ne,ye,le,Z,de,pe,Te,Ne,$e,Ze,Xe,it,yt;function bt(ze,Se){return ze.pxmid[1]-Se.pxmid[1]}function mt(ze,Se){return Se.pxmid[1]-ze.pxmid[1]}function ht(ze,Se){Se||(Se={});var Je=Se.labelExtraY+(ye?Se.yLabelMax:Se.yLabelMin),_t=ye?ze.yLabelMin:ze.yLabelMax,At=ye?ze.yLabelMax:ze.yLabelMin,vt=ze.cyFinal+de(ze.px0[1],ze.px1[1]),Kt=Je-_t,Qt,fr,mr,Ur,Br,fn;if(Kt*Te>0&&(ze.labelExtraY=Kt),!!r.isArrayOrTypedArray(ce.pull))for(fr=0;fr=(d.castOption(ce.pull,mr.pts)||0))&&((ze.pxmid[1]-mr.pxmid[1])*Te>0?(Ur=mr.cyFinal+de(mr.px0[1],mr.px1[1]),Kt=Ur-_t-ze.labelExtraY,Kt*Te>0&&(ze.labelExtraY+=Kt)):(At+ze.labelExtraY-vt)*Te>0&&(Qt=3*pe*Math.abs(fr-Ze.indexOf(ze)),Br=mr.cxFinal+Z(mr.px0[0],mr.px1[0]),fn=Br+Qt-(ze.cxFinal+ze.pxmid[0])-ze.labelExtraX,fn*pe>0&&(ze.labelExtraX+=fn)))}for(ye=0;ye<2;ye++)for(le=ye?bt:mt,de=ye?Math.max:Math.min,Te=ye?1:-1,ne=0;ne<2;ne++){for(Z=ne?Math.max:Math.min,pe=ne?1:-1,Ne=se[ye][ne],Ne.sort(le),$e=se[1-ye][ne],Ze=$e.concat(Ne),it=[],Xe=0;Xe1?(Ne=ne.r,$e=Ne/le.aspectratio):($e=ne.r,Ne=$e*le.aspectratio),Ne*=(1+le.baseratio)/2,Te=Ne*$e}de=Math.min(de,Te/ne.vTotal)}for(ye=0;yece.vTotal/2?1:0,Ne.halfangle=Math.PI*Math.min(Ne.v/ce.vTotal,.5),Ne.ring=1-ye.hole,Ne.rInscribed=z(Ne,ce))}function ge(se,ce){return[se*Math.sin(ce),-se*Math.cos(ce)]}function _e(se,ce,ne){var ye=se._fullLayout,le=ne.trace,Z=le.texttemplate,de=le.textinfo;if(!Z&&de&&de!=="none"){var pe=de.split("+"),Te=function(Se){return pe.indexOf(Se)!==-1},Ne=Te("label"),$e=Te("text"),Ze=Te("value"),Xe=Te("percent"),it=ye.separators,yt;if(yt=Ne?[ce.label]:[],$e){var bt=d.getFirstFilled(le.text,ce.pts);g(bt)&&yt.push(bt)}Ze&&yt.push(d.formatPieValue(ce.v,it)),Xe&&yt.push(d.formatPiePercent(ce.v/ne.vTotal,it)),ce.text=yt.join("
")}function mt(Se){return{label:Se.label,value:Se.v,valueLabel:d.formatPieValue(Se.v,ye.separators),percent:Se.v/ne.vTotal,percentLabel:d.formatPiePercent(Se.v/ne.vTotal,ye.separators),color:Se.color,text:Se.text,customdata:r.castOption(le,Se.i,"customdata")}}if(Z){var ht=r.castOption(le,ce.i,"texttemplate");if(!ht)ce.text="";else{var Ve=mt(ce),ze=d.getFirstFilled(le.text,ce.pts);(g(ze)||ze==="")&&(Ve.text=ze),ce.text=r.texttemplateString({data:[Ve,le._meta],fallback:le.texttemplatefallback,labels:Ve,locale:se._fullLayout._d3locale,template:ht})}}}function Y(se,ce){var ne=se.rotate*Math.PI/180,ye=Math.cos(ne),le=Math.sin(ne),Z=(ce.left+ce.right)/2,de=(ce.top+ce.bottom)/2;se.textX=Z*ye-de*le,se.textY=Z*le+de*ye,se.noCenter=!0}K.exports={plot:C,formatSliceLabel:_e,transformInsideText:T,determineInsideTextFont:k,positionTitleOutside:G,prerenderTitles:I,layoutAreas:ee,attachFxHandlers:x,computeTransform:Y}}}),I5=Re({"src/traces/pie/style.js"(ae,K){var v=un(),S=Rb(),M=Nc().resizeText;K.exports=function(t){var r=t._fullLayout._pielayer.selectAll(".trace");M(t,r,"pie"),r.each(function(a){var l=a[0],i=l.trace,s=v.select(this);s.style({opacity:i.opacity}),s.selectAll("path.surface").each(function(o){v.select(this).call(S,o,i,t)})})}}}),Fy=Re({"src/traces/pie/base_plot.js"(ae){var K=If();ae.name="pie",ae.plot=function(v,S,M,L){K.plotBasePlot(ae.name,v,S,M,L)},ae.clean=function(v,S,M,L){K.cleanBasePlot(ae.name,v,S,M,L)}}}),r0=Re({"src/traces/pie/index.js"(ae,K){K.exports={attributes:fx(),supplyDefaults:hx().supplyDefaults,supplyLayoutDefaults:sT(),layoutAttributes:k5(),calc:t0().calc,crossTraceCalc:t0().crossTraceCalc,plot:dx().plot,style:I5(),styleOne:Rb(),moduleType:"trace",name:"pie",basePlotModule:Fy(),categories:["pie-like","pie","showLegend"],meta:{}}}}),vw=Re({"lib/pie.js"(ae,K){K.exports=r0()}}),cP=Re({"src/traces/sunburst/base_plot.js"(ae){var K=If();ae.name="sunburst",ae.plot=function(v,S,M,L){K.plotBasePlot(ae.name,v,S,M,L)},ae.clean=function(v,S,M,L){K.cleanBasePlot(ae.name,v,S,M,L)}}}),L5=Re({"src/traces/sunburst/constants.js"(ae,K){K.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),mw=Re({"src/traces/sunburst/attributes.js"(ae,K){var v=As(),{hovertemplateAttrs:S,texttemplateAttrs:M,templatefallbackAttrs:L}=Wl(),t=ac(),r=af().attributes,a=fx(),l=L5(),i=Li().extendFlat,s=up().pattern;K.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:i({colors:{valType:"data_array",editType:"calc"},line:{color:i({},a.marker.line.color,{dflt:null}),width:i({},a.marker.line.width,{dflt:1}),editType:"calc"},pattern:s,editType:"calc"},t("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:a.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:M({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:L({editType:"plot"}),hovertext:a.hovertext,hoverinfo:i({},v.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:S({},{keys:l.eventDataKeys}),hovertemplatefallback:L(),textfont:a.textfont,insidetextorientation:a.insidetextorientation,insidetextfont:a.insidetextfont,outsidetextfont:i({},a.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:a.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:r({name:"sunburst",trace:!0,editType:"calc"})}}}),R5=Re({"src/traces/sunburst/layout_attributes.js"(ae,K){K.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),SI=Re({"src/traces/sunburst/defaults.js"(ae,K){var v=Rn(),S=mw(),M=af().defaults,L=Wv().handleText,t=hx().handleMarkerDefaults,r=nf(),a=r.hasColorscale,l=r.handleDefaults;K.exports=function(s,o,c,p){function d(k,I){return v.coerce(s,o,S,k,I)}var y=d("labels"),g=d("parents");if(!y||!y.length||!g||!g.length){o.visible=!1;return}var C=d("values");C&&C.length?d("branchvalues"):d("count"),d("level"),d("maxdepth"),t(s,o,p,d);var f=o._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;f&&l(s,o,p,d,{prefix:"marker.",cLetter:"c"}),d("leaf.opacity",f?1:.7);var x=d("text");d("texttemplate"),d("texttemplatefallback"),o.texttemplate||d("textinfo",v.isArrayOrTypedArray(x)?"text+label":"label"),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback");var A="auto";L(s,o,p,d,A,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("insidetextorientation"),d("sort"),d("rotation"),d("root.color"),M(o,p,d),o._length=null}}}),fP=Re({"src/traces/sunburst/layout_defaults.js"(ae,K){var v=Rn(),S=R5();K.exports=function(L,t){function r(a,l){return v.coerce(L,t,S,a,l)}r("sunburstcolorway",t.colorway),r("extendsunburstcolors")}}}),px=Re({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(ae,K){(function(v,S){typeof ae=="object"&&typeof K<"u"?S(ae):(v=v||self,S(v.d3=v.d3||{}))})(ae,function(v){function S(Be,Ie){return Be.parent===Ie.parent?1:2}function M(Be){return Be.reduce(L,0)/Be.length}function L(Be,Ie){return Be+Ie.x}function t(Be){return 1+Be.reduce(r,0)}function r(Be,Ie){return Math.max(Be,Ie.y)}function a(Be){for(var Ie;Ie=Be.children;)Be=Ie[0];return Be}function l(Be){for(var Ie;Ie=Be.children;)Be=Ie[Ie.length-1];return Be}function i(){var Be=S,Ie=1,ke=1,Fe=!1;function at(ct){var Gt,Vt=0;ct.eachAfter(function(Sr){var Jr=Sr.children;Jr?(Sr.x=M(Jr),Sr.y=t(Jr)):(Sr.x=Gt?Vt+=Be(Sr,Gt):0,Sr.y=0,Gt=Sr)});var Zt=a(ct),ur=l(ct),Dr=Zt.x-Be(Zt,ur)/2,kr=ur.x+Be(ur,Zt)/2;return ct.eachAfter(Fe?function(Sr){Sr.x=(Sr.x-ct.x)*Ie,Sr.y=(ct.y-Sr.y)*ke}:function(Sr){Sr.x=(Sr.x-Dr)/(kr-Dr)*Ie,Sr.y=(1-(ct.y?Sr.y/ct.y:1))*ke})}return at.separation=function(ct){return arguments.length?(Be=ct,at):Be},at.size=function(ct){return arguments.length?(Fe=!1,Ie=+ct[0],ke=+ct[1],at):Fe?null:[Ie,ke]},at.nodeSize=function(ct){return arguments.length?(Fe=!0,Ie=+ct[0],ke=+ct[1],at):Fe?[Ie,ke]:null},at}function s(Be){var Ie=0,ke=Be.children,Fe=ke&&ke.length;if(!Fe)Ie=1;else for(;--Fe>=0;)Ie+=ke[Fe].value;Be.value=Ie}function o(){return this.eachAfter(s)}function c(Be){var Ie=this,ke,Fe=[Ie],at,ct,Gt;do for(ke=Fe.reverse(),Fe=[];Ie=ke.pop();)if(Be(Ie),at=Ie.children,at)for(ct=0,Gt=at.length;ct=0;--at)ke.push(Fe[at]);return this}function d(Be){for(var Ie=this,ke=[Ie],Fe=[],at,ct,Gt;Ie=ke.pop();)if(Fe.push(Ie),at=Ie.children,at)for(ct=0,Gt=at.length;ct=0;)ke+=Fe[at].value;Ie.value=ke})}function g(Be){return this.eachBefore(function(Ie){Ie.children&&Ie.children.sort(Be)})}function C(Be){for(var Ie=this,ke=f(Ie,Be),Fe=[Ie];Ie!==ke;)Ie=Ie.parent,Fe.push(Ie);for(var at=Fe.length;Be!==ke;)Fe.splice(at,0,Be),Be=Be.parent;return Fe}function f(Be,Ie){if(Be===Ie)return Be;var ke=Be.ancestors(),Fe=Ie.ancestors(),at=null;for(Be=ke.pop(),Ie=Fe.pop();Be===Ie;)at=Be,Be=ke.pop(),Ie=Fe.pop();return at}function x(){for(var Be=this,Ie=[Be];Be=Be.parent;)Ie.push(Be);return Ie}function A(){var Be=[];return this.each(function(Ie){Be.push(Ie)}),Be}function k(){var Be=[];return this.eachBefore(function(Ie){Ie.children||Be.push(Ie)}),Be}function I(){var Be=this,Ie=[];return Be.each(function(ke){ke!==Be&&Ie.push({source:ke.parent,target:ke})}),Ie}function T(Be,Ie){var ke=new w(Be),Fe=+Be.value&&(ke.value=Be.value),at,ct=[ke],Gt,Vt,Zt,ur;for(Ie==null&&(Ie=_);at=ct.pop();)if(Fe&&(at.value=+at.data.value),(Vt=Ie(at.data))&&(ur=Vt.length))for(at.children=new Array(ur),Zt=ur-1;Zt>=0;--Zt)ct.push(Gt=at.children[Zt]=new w(Vt[Zt])),Gt.parent=at,Gt.depth=at.depth+1;return ke.eachBefore(m)}function E(){return T(this).eachBefore(h)}function _(Be){return Be.children}function h(Be){Be.data=Be.data.data}function m(Be){var Ie=0;do Be.height=Ie;while((Be=Be.parent)&&Be.height<++Ie)}function w(Be){this.data=Be,this.depth=this.height=0,this.parent=null}w.prototype=T.prototype={constructor:w,count:o,each:c,eachAfter:d,eachBefore:p,sum:y,sort:g,path:C,ancestors:x,descendants:A,leaves:k,links:I,copy:E};var F=Array.prototype.slice;function z(Be){for(var Ie=Be.length,ke,Fe;Ie;)Fe=Math.random()*Ie--|0,ke=Be[Ie],Be[Ie]=Be[Fe],Be[Fe]=ke;return Be}function U(Be){for(var Ie=0,ke=(Be=z(F.call(Be))).length,Fe=[],at,ct;Ie0&&ke*ke>Fe*Fe+at*at}function O(Be,Ie){for(var ke=0;keZt?(at=(ur+Zt-ct)/(2*ur),Vt=Math.sqrt(Math.max(0,Zt/ur-at*at)),ke.x=Be.x-at*Fe-Vt*Gt,ke.y=Be.y-at*Gt+Vt*Fe):(at=(ur+ct-Zt)/(2*ur),Vt=Math.sqrt(Math.max(0,ct/ur-at*at)),ke.x=Ie.x+at*Fe-Vt*Gt,ke.y=Ie.y+at*Gt+Vt*Fe)):(ke.x=Ie.x+ke.r,ke.y=Ie.y)}function ge(Be,Ie){var ke=Be.r+Ie.r-1e-6,Fe=Ie.x-Be.x,at=Ie.y-Be.y;return ke>0&&ke*ke>Fe*Fe+at*at}function _e(Be){var Ie=Be._,ke=Be.next._,Fe=Ie.r+ke.r,at=(Ie.x*ke.r+ke.x*Ie.r)/Fe,ct=(Ie.y*ke.r+ke.y*Ie.r)/Fe;return at*at+ct*ct}function Y(Be){this._=Be,this.next=null,this.previous=null}function se(Be){if(!(at=Be.length))return 0;var Ie,ke,Fe,at,ct,Gt,Vt,Zt,ur,Dr,kr;if(Ie=Be[0],Ie.x=0,Ie.y=0,!(at>1))return Ie.r;if(ke=Be[1],Ie.x=-ke.r,ke.x=Ie.r,ke.y=0,!(at>2))return Ie.r+ke.r;xe(ke,Ie,Fe=Be[2]),Ie=new Y(Ie),ke=new Y(ke),Fe=new Y(Fe),Ie.next=Fe.previous=ke,ke.next=Ie.previous=Fe,Fe.next=ke.previous=Ie;e:for(Vt=3;Vt0)throw new Error("cycle");return Vt}return ke.id=function(Fe){return arguments.length?(Be=ye(Fe),ke):Be},ke.parentId=function(Fe){return arguments.length?(Ie=ye(Fe),ke):Ie},ke}function Se(Be,Ie){return Be.parent===Ie.parent?1:2}function Je(Be){var Ie=Be.children;return Ie?Ie[0]:Be.t}function _t(Be){var Ie=Be.children;return Ie?Ie[Ie.length-1]:Be.t}function At(Be,Ie,ke){var Fe=ke/(Ie.i-Be.i);Ie.c-=Fe,Ie.s+=ke,Be.c+=Fe,Ie.z+=ke,Ie.m+=ke}function vt(Be){for(var Ie=0,ke=0,Fe=Be.children,at=Fe.length,ct;--at>=0;)ct=Fe[at],ct.z+=Ie,ct.m+=Ie,Ie+=ct.s+(ke+=ct.c)}function Kt(Be,Ie,ke){return Be.a.parent===Ie.parent?Be.a:ke}function Qt(Be,Ie){this._=Be,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=Ie}Qt.prototype=Object.create(w.prototype);function fr(Be){for(var Ie=new Qt(Be,0),ke,Fe=[Ie],at,ct,Gt,Vt;ke=Fe.pop();)if(ct=ke._.children)for(ke.children=new Array(Vt=ct.length),Gt=Vt-1;Gt>=0;--Gt)Fe.push(at=ke.children[Gt]=new Qt(ct[Gt],Gt)),at.parent=ke;return(Ie.parent=new Qt(null,0)).children=[Ie],Ie}function mr(){var Be=Se,Ie=1,ke=1,Fe=null;function at(ur){var Dr=fr(ur);if(Dr.eachAfter(ct),Dr.parent.m=-Dr.z,Dr.eachBefore(Gt),Fe)ur.eachBefore(Zt);else{var kr=ur,Sr=ur,Jr=ur;ur.eachBefore(function(xa){xa.xSr.x&&(Sr=xa),xa.depth>Jr.depth&&(Jr=xa)});var jn=kr===Sr?1:Be(kr,Sr)/2,ha=jn-kr.x,oa=Ie/(Sr.x+jn+ha),_a=ke/(Jr.depth||1);ur.eachBefore(function(xa){xa.x=(xa.x+ha)*oa,xa.y=xa.depth*_a})}return ur}function ct(ur){var Dr=ur.children,kr=ur.parent.children,Sr=ur.i?kr[ur.i-1]:null;if(Dr){vt(ur);var Jr=(Dr[0].z+Dr[Dr.length-1].z)/2;Sr?(ur.z=Sr.z+Be(ur._,Sr._),ur.m=ur.z-Jr):ur.z=Jr}else Sr&&(ur.z=Sr.z+Be(ur._,Sr._));ur.parent.A=Vt(ur,Sr,ur.parent.A||kr[0])}function Gt(ur){ur._.x=ur.z+ur.parent.m,ur.m+=ur.parent.m}function Vt(ur,Dr,kr){if(Dr){for(var Sr=ur,Jr=ur,jn=Dr,ha=Sr.parent.children[0],oa=Sr.m,_a=Jr.m,xa=jn.m,ra=ha.m,Ha;jn=_t(jn),Sr=Je(Sr),jn&&Sr;)ha=Je(ha),Jr=_t(Jr),Jr.a=ur,Ha=jn.z+xa-Sr.z-oa+Be(jn._,Sr._),Ha>0&&(At(Kt(jn,ur,kr),ur,Ha),oa+=Ha,_a+=Ha),xa+=jn.m,oa+=Sr.m,ra+=ha.m,_a+=Jr.m;jn&&!_t(Jr)&&(Jr.t=jn,Jr.m+=xa-_a),Sr&&!Je(ha)&&(ha.t=Sr,ha.m+=oa-ra,kr=ur)}return kr}function Zt(ur){ur.x*=Ie,ur.y=ur.depth*ke}return at.separation=function(ur){return arguments.length?(Be=ur,at):Be},at.size=function(ur){return arguments.length?(Fe=!1,Ie=+ur[0],ke=+ur[1],at):Fe?null:[Ie,ke]},at.nodeSize=function(ur){return arguments.length?(Fe=!0,Ie=+ur[0],ke=+ur[1],at):Fe?[Ie,ke]:null},at}function Ur(Be,Ie,ke,Fe,at){for(var ct=Be.children,Gt,Vt=-1,Zt=ct.length,ur=Be.value&&(at-ke)/Be.value;++Vtxa&&(xa=ur),_r=oa*oa*ci,ra=Math.max(xa/_r,_r/_a),ra>Ha){oa-=ur;break}Ha=ra}Gt.push(Zt={value:oa,dice:Jr1?Fe:1)},ke})(Br);function Qr(){var Be=Fr,Ie=!1,ke=1,Fe=1,at=[0],ct=le,Gt=le,Vt=le,Zt=le,ur=le;function Dr(Sr){return Sr.x0=Sr.y0=0,Sr.x1=ke,Sr.y1=Fe,Sr.eachBefore(kr),at=[0],Ie&&Sr.eachBefore(Ze),Sr}function kr(Sr){var Jr=at[Sr.depth],jn=Sr.x0+Jr,ha=Sr.y0+Jr,oa=Sr.x1-Jr,_a=Sr.y1-Jr;oa=Sr-1){var xa=ct[kr];xa.x0=jn,xa.y0=ha,xa.x1=oa,xa.y1=_a;return}for(var ra=ur[kr],Ha=Jr/2+ra,ci=kr+1,_r=Sr-1;ci<_r;){var rr=ci+_r>>>1;ur[rr]_a-ha){var an=(jn*br+oa*yr)/Jr;Dr(kr,ci,yr,jn,ha,an,_a),Dr(ci,Sr,br,an,ha,oa,_a)}else{var bn=(ha*br+_a*yr)/Jr;Dr(kr,ci,yr,jn,ha,oa,bn),Dr(ci,Sr,br,jn,bn,oa,_a)}}}function et(Be,Ie,ke,Fe,at){(Be.depth&1?Ur:Xe)(Be,Ie,ke,Fe,at)}var ut=(function Be(Ie){function ke(Fe,at,ct,Gt,Vt){if((Zt=Fe._squarify)&&Zt.ratio===Ie)for(var Zt,ur,Dr,kr,Sr=-1,Jr,jn=Zt.length,ha=Fe.value;++Sr1?Fe:1)},ke})(Br);v.cluster=i,v.hierarchy=T,v.pack=pe,v.packEnclose=U,v.packSiblings=ce,v.partition=it,v.stratify=ze,v.tree=mr,v.treemap=Qr,v.treemapBinary=Bt,v.treemapDice=Xe,v.treemapResquarify=ut,v.treemapSlice=Ur,v.treemapSliceDice=et,v.treemapSquarify=Fr,Object.defineProperty(v,"__esModule",{value:!0})})}}),gw=Re({"src/traces/sunburst/calc.js"(ae){var K=px(),v=da(),S=Rn(),M=nf().makeColorScaleFuncFromTrace,L=t0().makePullColorFn,t=t0().generateExtendedColors,r=nf().calc,a=Ia().ALMOST_EQUAL,l={},i={},s={};ae.calc=function(c,p){var d=c._fullLayout,y=p.ids,g=S.isArrayOrTypedArray(y),C=p.labels,f=p.parents,x=p.values,A=S.isArrayOrTypedArray(x),k=[],I={},T={},E=function(ce,ne){I[ce]?I[ce].push(ne):I[ce]=[ne],T[ne]=1},_=function(ce){return ce||typeof ce=="number"},h=function(ce){return!A||v(x[ce])&&x[ce]>=0},m,w,F;g?(m=Math.min(y.length,f.length),w=function(ce){return _(y[ce])&&h(ce)},F=function(ce){return String(y[ce])}):(m=Math.min(C.length,f.length),w=function(ce){return _(C[ce])&&h(ce)},F=function(ce){return String(C[ce])}),A&&(m=Math.min(m,x.length));for(var z=0;z1){for(var H=S.randstr(),W=0;W>8&15|K>>4&240,K>>4&15|K&240,(K&15)<<4|K&15,1):v===8?mx(K>>24&255,K>>16&255,K>>8&255,(K&255)/255):v===4?mx(K>>12&15|K>>8&240,K>>8&15|K>>4&240,K>>4&15|K&240,((K&15)<<4|K&15)/255):null):(K=N5.exec(ae))?new vp(K[1],K[2],K[3],1):(K=hT.exec(ae))?new vp(K[1]*255/100,K[2]*255/100,K[3]*255/100,1):(K=dT.exec(ae))?mx(K[1],K[2],K[3],K[4]):(K=MI.exec(ae))?mx(K[1]*255/100,K[2]*255/100,K[3]*255/100,K[4]):(K=O5.exec(ae))?kI(K[1],K[2]/100,K[3]/100,1):(K=II.exec(ae))?kI(K[1],K[2]/100,K[3]/100,K[4]):pT.hasOwnProperty(ae)?hc(pT[ae]):ae==="transparent"?new vp(NaN,NaN,NaN,0):null}function hc(ae){return new vp(ae>>16&255,ae>>8&255,ae&255,1)}function mx(ae,K,v,S){return S<=0&&(ae=K=v=NaN),new vp(ae,K,v,S)}function gx(ae){return ae instanceof n0||(ae=vx(ae)),ae?(ae=ae.rgb(),new vp(ae.r,ae.g,ae.b,ae.opacity)):new vp}function yx(ae,K,v,S){return arguments.length===1?gx(ae):new vp(ae,K,v,S??1)}function vp(ae,K,v,S){this.r=+ae,this.g=+K,this.b=+v,this.opacity=+S}function lT(){return`#${q1(this.r)}${q1(this.g)}${q1(this.b)}`}function bw(){return`#${q1(this.r)}${q1(this.g)}${q1(this.b)}${q1((isNaN(this.opacity)?1:this.opacity)*255)}`}function ww(){const ae=uT(this.opacity);return`${ae===1?"rgb(":"rgba("}${By(this.r)}, ${By(this.g)}, ${By(this.b)}${ae===1?")":`, ${ae})`}`}function uT(ae){return isNaN(ae)?1:Math.max(0,Math.min(1,ae))}function By(ae){return Math.max(0,Math.min(255,Math.round(ae)||0))}function q1(ae){return ae=By(ae),(ae<16?"0":"")+ae.toString(16)}function kI(ae,K,v,S){return S<=0?ae=K=v=NaN:v<=0||v>=1?ae=K=NaN:K<=0&&(ae=NaN),new dc(ae,K,v,S)}function D5(ae){if(ae instanceof dc)return new dc(ae.h,ae.s,ae.l,ae.opacity);if(ae instanceof n0||(ae=vx(ae)),!ae)return new dc;if(ae instanceof dc)return ae;ae=ae.rgb();var K=ae.r/255,v=ae.g/255,S=ae.b/255,M=Math.min(K,v,S),L=Math.max(K,v,S),t=NaN,r=L-M,a=(L+M)/2;return r?(K===L?t=(v-S)/r+(v0&&a<1?0:t,new dc(t,r,a,ae.opacity)}function cT(ae,K,v,S){return arguments.length===1?D5(ae):new dc(ae,K,v,S??1)}function dc(ae,K,v,S){this.h=+ae,this.s=+K,this.l=+v,this.opacity=+S}function fT(ae){return ae=(ae||0)%360,ae<0?ae+360:ae}function Kd(ae){return Math.max(0,Math.min(1,ae||0))}function P5(ae,K,v){return(ae<60?K+(v-K)*ae/60:ae<180?v:ae<240?K+(v-K)*(240-ae)/60:K)*255}var H0,H1,W0,Uy,Qv,z5,N5,hT,dT,MI,O5,II,pT,F5=jt({"node_modules/d3-color/src/color.js"(){_w(),H0=.7,H1=1/H0,W0="\\s*([+-]?\\d+)\\s*",Uy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",z5=/^#([0-9a-f]{3,8})$/,N5=new RegExp(`^rgb\\(${W0},${W0},${W0}\\)$`),hT=new RegExp(`^rgb\\(${Qv},${Qv},${Qv}\\)$`),dT=new RegExp(`^rgba\\(${W0},${W0},${W0},${Uy}\\)$`),MI=new RegExp(`^rgba\\(${Qv},${Qv},${Qv},${Uy}\\)$`),O5=new RegExp(`^hsl\\(${Uy},${Qv},${Qv}\\)$`),II=new RegExp(`^hsla\\(${Uy},${Qv},${Qv},${Uy}\\)$`),pT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},G1(n0,vx,{copy(ae){return Object.assign(new this.constructor,this,ae)},displayable(){return this.rgb().displayable()},hex:EI,formatHex:EI,formatHex8:hP,formatHsl:xw,formatRgb:CI,toString:CI}),G1(vp,yx,yw(n0,{brighter(ae){return ae=ae==null?H1:Math.pow(H1,ae),new vp(this.r*ae,this.g*ae,this.b*ae,this.opacity)},darker(ae){return ae=ae==null?H0:Math.pow(H0,ae),new vp(this.r*ae,this.g*ae,this.b*ae,this.opacity)},rgb(){return this},clamp(){return new vp(By(this.r),By(this.g),By(this.b),uT(this.opacity))},displayable(){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:lT,formatHex:lT,formatHex8:bw,formatRgb:ww,toString:ww})),G1(dc,cT,yw(n0,{brighter(ae){return ae=ae==null?H1:Math.pow(H1,ae),new dc(this.h,this.s,this.l*ae,this.opacity)},darker(ae){return ae=ae==null?H0:Math.pow(H0,ae),new dc(this.h,this.s,this.l*ae,this.opacity)},rgb(){var ae=this.h%360+(this.h<0)*360,K=isNaN(ae)||isNaN(this.s)?0:this.s,v=this.l,S=v+(v<.5?v:1-v)*K,M=2*v-S;return new vp(P5(ae>=240?ae-240:ae+120,M,S),P5(ae,M,S),P5(ae<120?ae+240:ae-120,M,S),this.opacity)},clamp(){return new dc(fT(this.h),Kd(this.s),Kd(this.l),uT(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const ae=uT(this.opacity);return`${ae===1?"hsl(":"hsla("}${fT(this.h)}, ${Kd(this.s)*100}%, ${Kd(this.l)*100}%${ae===1?")":`, ${ae})`}`}}))}}),B5,a0,U5=jt({"node_modules/d3-color/src/math.js"(){B5=Math.PI/180,a0=180/Math.PI}});function $5(ae){if(ae instanceof i0)return new i0(ae.l,ae.a,ae.b,ae.opacity);if(ae instanceof kg)return j5(ae);ae instanceof vp||(ae=gx(ae));var K=Sw(ae.r),v=Sw(ae.g),S=Sw(ae.b),M=V5((.2225045*K+.7168786*v+.0606169*S)/W1),L,t;return K===v&&v===S?L=t=M:(L=V5((.4360747*K+.3850649*v+.1430804*S)/mT),t=V5((.0139322*K+.0971045*v+.7141733*S)/tm)),new i0(116*M-16,500*(L-M),200*(M-t),ae.opacity)}function Tw(ae,K,v,S){return arguments.length===1?$5(ae):new i0(ae,K,v,S??1)}function i0(ae,K,v,S){this.l=+ae,this.a=+K,this.b=+v,this.opacity=+S}function V5(ae){return ae>LI?Math.pow(ae,.3333333333333333):ae/Mg+gT}function vT(ae){return ae>o0?ae*ae*ae:Mg*(ae-gT)}function Aw(ae){return 255*(ae<=.0031308?12.92*ae:1.055*Math.pow(ae,.4166666666666667)-.055)}function Sw(ae){return(ae/=255)<=.04045?ae/12.92:Math.pow((ae+.055)/1.055,2.4)}function dP(ae){if(ae instanceof kg)return new kg(ae.h,ae.c,ae.l,ae.opacity);if(ae instanceof i0||(ae=$5(ae)),ae.a===0&&ae.b===0)return new kg(NaN,0=1?(v=1,K-1):Math.floor(v*K),M=ae[S],L=ae[S+1],t=S>0?ae[S-1]:2*M-L,r=S()=>ae}});function Mw(ae,K){return function(v){return ae+v*K}}function DI(ae,K,v){return ae=Math.pow(ae,v),K=Math.pow(K,v)-ae,v=1/v,function(S){return Math.pow(ae+S*K,v)}}function Iw(ae,K){var v=K-ae;return v?Mw(ae,v>180||v<-180?v-360*Math.round(v/360):v):J1(isNaN(ae)?K:ae)}function vP(ae){return(ae=+ae)==1?mp:function(K,v){return v-K?DI(K,v,ae):J1(isNaN(K)?v:K)}}function mp(ae,K){var v=K-ae;return v?Mw(ae,v):J1(isNaN(ae)?K:ae)}var wx=jt({"node_modules/d3-interpolate/src/color.js"(){wT()}});function TT(ae){return function(K){var v=K.length,S=new Array(v),M=new Array(v),L=new Array(v),t,r;for(t=0;tv&&(L=K.slice(v,L),r[t]?r[t]+=L:r[++t]=L),(S=S[0])===(M=M[0])?r[t]?r[t]+=M:r[++t]=M:(r[++t]=null,a.push({i:t,x:Ig(S,M)})),v=Ax.lastIndex;return v180?i+=360:i-l>180&&(l+=360),o.push({i:s.push(M(s)+"rotate(",null,S)-2,x:Ig(l,i)})):i&&s.push(M(s)+"rotate("+i+S)}function r(l,i,s,o){l!==i?o.push({i:s.push(M(s)+"skewX(",null,S)-2,x:Ig(l,i)}):i&&s.push(M(s)+"skewX("+i+S)}function a(l,i,s,o,c,p){if(l!==s||i!==o){var d=c.push(M(c)+"scale(",null,",",null,")");p.push({i:d-4,x:Ig(l,s)},{i:d-2,x:Ig(i,o)})}else(s!==1||o!==1)&&c.push(M(c)+"scale("+s+","+o+")")}return function(l,i){var s=[],o=[];return l=ae(l),i=ae(i),L(l.translateX,l.translateY,i.translateX,i.translateY,s,o),t(l.rotate,i.rotate,s,o),r(l.skewX,i.skewX,s,o),a(l.scaleX,l.scaleY,i.scaleX,i.scaleY,s,o),l=i=null,function(c){for(var p=-1,d=o.length,y;++pSx,interpolateArray:()=>PI,interpolateBasis:()=>Z1,interpolateBasisClosed:()=>H5,interpolateCubehelix:()=>ao,interpolateCubehelixLong:()=>po,interpolateDate:()=>K5,interpolateDiscrete:()=>Vy,interpolateHcl:()=>ja,interpolateHclLong:()=>Ji,interpolateHsl:()=>Ae,interpolateHslLong:()=>qe,interpolateHue:()=>Nw,interpolateLab:()=>qt,interpolateNumber:()=>Ig,interpolateNumberArray:()=>W5,interpolateObject:()=>zw,interpolateRgb:()=>AT,interpolateRgbBasis:()=>Lw,interpolateRgbBasisClosed:()=>Rw,interpolateRound:()=>Gy,interpolateString:()=>ET,interpolateTransformCss:()=>tE,interpolateTransformSvg:()=>t_,interpolateZoom:()=>Bw,piecewise:()=>uu,quantize:()=>zi});var Lo=jt({"node_modules/d3-interpolate/src/index.js"(){Lg(),Z5(),K1(),kw(),ST(),jy(),Ow(),Pw(),X5(),zI(),gP(),Q5(),FI(),$(),Dw(),Tt(),Hr(),Io(),vl(),th(),pi()}}),jl=Re({"src/traces/sunburst/fill_one.js"(ae,K){var v=qs(),S=ko();K.exports=function(L,t,r,a,l){var i=t.data.data,s=i.i,o=l||i.color;if(s>=0){t.i=i.i;var c=r.marker;c.pattern?(!c.colors||!c.pattern.shape)&&(c.color=o,t.color=o):(c.color=o,t.color=o),v.pointStyle(L,r,a,t)}else S.fill(L,o)}}}),Wc=Re({"src/traces/sunburst/style.js"(ae,K){var v=un(),S=ko(),M=Rn(),L=Nc().resizeText,t=jl();function r(l){var i=l._fullLayout._sunburstlayer.selectAll(".trace");L(l,i,"sunburst"),i.each(function(s){var o=v.select(this),c=s[0],p=c.trace;o.style("opacity",p.opacity),o.selectAll("path.surface").each(function(d){v.select(this).call(a,d,p,l)})})}function a(l,i,s,o){var c=i.data.data,p=!i.children,d=c.i,y=M.castOption(s,d,"marker.line.color")||S.defaultLine,g=M.castOption(s,d,"marker.line.width")||0;l.call(t,i,s,o).style("stroke-width",g).call(S.stroke,y).style("opacity",p?s.leaf.opacity:null)}K.exports={style:r,styleOne:a}}}),ol=Re({"src/traces/sunburst/helpers.js"(ae){var K=Rn(),v=ko(),S=mg(),M=T1();ae.findEntryWithLevel=function(a,l){var i;return l&&a.eachAfter(function(s){if(ae.getPtId(s)===l)return i=s.copy()}),i||a},ae.findEntryWithChild=function(a,l){var i;return a.eachAfter(function(s){for(var o=s.children||[],c=0;c0)},ae.getMaxDepth=function(a){return a.maxdepth>=0?a.maxdepth:1/0},ae.isHeader=function(a,l){return!(ae.isLeaf(a)||a.depth===l._maxDepth-1)};function r(a){return a.data.data.pid}ae.getParent=function(a,l){return ae.findEntryWithLevel(a,r(l))},ae.listPath=function(a,l){var i=a.parent;if(!i)return[];var s=l?[i.data[l]]:[i];return ae.listPath(i,l).concat(s)},ae.getPath=function(a){return ae.listPath(a,"label").join("/")+"/"},ae.formatValue=M.formatPieValue,ae.formatPercent=function(a,l){var i=K.formatPercent(a,0);return i==="0%"&&(i=M.formatPiePercent(a,l)),i}}}),Uu=Re({"src/traces/sunburst/fx.js"(ae,K){var v=un(),S=es(),M=Xp().appendArrayPointValue,L=Sh(),t=Rn(),r=Ib(),a=ol(),l=T1(),i=l.formatPieValue;K.exports=function(c,p,d,y,g){var C=y[0],f=C.trace,x=C.hierarchy,A=f.type==="sunburst",k=f.type==="treemap"||f.type==="icicle";"_hasHoverLabel"in f||(f._hasHoverLabel=!1),"_hasHoverEvent"in f||(f._hasHoverEvent=!1);var I=function(_){var h=d._fullLayout;if(!(d._dragging||h.hovermode===!1)){var m=d._fullData[f.index],w=_.data.data,F=w.i,z=a.isHierarchyRoot(_),U=a.getParent(x,_),V=a.getValue(_),G=function(de){return t.castOption(m,F,de)},j=G("hovertemplate"),O=L.castHoverinfo(m,h,F),H=h.separators,W;if(j||O&&O!=="none"&&O!=="skip"){var ee,ue;A&&(ee=C.cx+_.pxmid[0]*(1-_.rInscribed),ue=C.cy+_.pxmid[1]*(1-_.rInscribed)),k&&(ee=_._hoverX,ue=_._hoverY);var xe={},ge=[],_e=[],Y=function(de){return ge.indexOf(de)!==-1};O&&(ge=O==="all"?m._module.attributes.hoverinfo.flags:O.split("+")),xe.label=w.label,Y("label")&&xe.label&&_e.push(xe.label),w.hasOwnProperty("v")&&(xe.value=w.v,xe.valueLabel=i(xe.value,H),Y("value")&&_e.push(xe.valueLabel)),xe.currentPath=_.currentPath=a.getPath(_.data),Y("current path")&&!z&&_e.push(xe.currentPath);var se,ce=[],ne=function(){ce.indexOf(se)===-1&&(_e.push(se),ce.push(se))};xe.percentParent=_.percentParent=V/a.getValue(U),xe.parent=_.parentString=a.getPtLabel(U),Y("percent parent")&&(se=a.formatPercent(xe.percentParent,H)+" of "+xe.parent,ne()),xe.percentEntry=_.percentEntry=V/a.getValue(p),xe.entry=_.entry=a.getPtLabel(p),Y("percent entry")&&!z&&!_.onPathbar&&(se=a.formatPercent(xe.percentEntry,H)+" of "+xe.entry,ne()),xe.percentRoot=_.percentRoot=V/a.getValue(x),xe.root=_.root=a.getPtLabel(x),Y("percent root")&&!z&&(se=a.formatPercent(xe.percentRoot,H)+" of "+xe.root,ne()),xe.text=G("hovertext")||G("text"),Y("text")&&(se=xe.text,t.isValidTextValue(se)&&_e.push(se)),W=[s(_,m,g.eventDataKeys)];var ye={trace:m,y:ue,_x0:_._x0,_x1:_._x1,_y0:_._y0,_y1:_._y1,text:_e.join("
"),name:j||Y("name")?m.name:void 0,color:G("hoverlabel.bgcolor")||w.color,borderColor:G("hoverlabel.bordercolor"),fontFamily:G("hoverlabel.font.family"),fontSize:G("hoverlabel.font.size"),fontColor:G("hoverlabel.font.color"),fontWeight:G("hoverlabel.font.weight"),fontStyle:G("hoverlabel.font.style"),fontVariant:G("hoverlabel.font.variant"),nameLength:G("hoverlabel.namelength"),textAlign:G("hoverlabel.align"),hovertemplate:j,hovertemplateLabels:xe,eventData:W};A&&(ye.x0=ee-_.rInscribed*_.rpx1,ye.x1=ee+_.rInscribed*_.rpx1,ye.idealAlign=_.pxmid[0]<0?"left":"right"),k&&(ye.x=ee,ye.idealAlign=ee<0?"left":"right");var le=[];L.loneHover(ye,{container:h._hoverlayer.node(),outerContainer:h._paper.node(),gd:d,inOut_bbox:le}),W[0].bbox=le[0],f._hasHoverLabel=!0}if(k){var Z=c.select("path.surface");g.styleOne(Z,_,m,d,{hovered:!0})}f._hasHoverEvent=!0,d.emit("plotly_hover",{points:W||[s(_,m,g.eventDataKeys)],event:v.event})}},T=function(_){var h=d._fullLayout,m=d._fullData[f.index],w=v.select(this).datum();if(f._hasHoverEvent&&(_.originalEvent=v.event,d.emit("plotly_unhover",{points:[s(w,m,g.eventDataKeys)],event:v.event}),f._hasHoverEvent=!1),f._hasHoverLabel&&(L.loneUnhover(h._hoverlayer.node()),f._hasHoverLabel=!1),k){var F=c.select("path.surface");g.styleOne(F,w,m,d,{hovered:!1})}},E=function(_){var h=d._fullLayout,m=d._fullData[f.index],w=A&&(a.isHierarchyRoot(_)||a.isLeaf(_)),F=a.getPtId(_),z=a.isEntry(_)?a.findEntryWithChild(x,F):a.findEntryWithLevel(x,F),U=a.getPtId(z),V={points:[s(_,m,g.eventDataKeys)],event:v.event};w||(V.nextLevel=U);var G=r.triggerHandler(d,"plotly_"+f.type+"click",V);if(G!==!1&&h.hovermode&&(d._hoverdata=[s(_,m,g.eventDataKeys)],L.click(d,v.event)),!w&&G!==!1&&!d._dragging&&!d._transitioning){S.call("_storeDirectGUIEdit",m,h._tracePreGUI[m.uid],{level:m.level});var j={data:[{level:U}],traces:[f.index]},O={frame:{redraw:!1,duration:g.transitionTime},transition:{duration:g.transitionTime,easing:g.transitionEasing},mode:"immediate",fromcurrent:!0};L.loneUnhover(h._hoverlayer.node()),S.call("animate",d,j,O)}};c.on("mouseover",I),c.on("mouseout",T),c.on("click",E)};function s(o,c,p){for(var d=o.data.data,y={curveNumber:c.index,pointNumber:d.i,data:c._input,fullData:c},g=0;gAt.x1?2*Math.PI:0)+de;vt=Se.rpx1it?2*Math.PI:0)+de;_t={x0:vt,x1:vt}}else _t={rpx0:ge,rpx1:ge},L.extendFlat(_t,ze(Se));else _t={rpx0:0,rpx1:0};else _t={x0:de,x1:de};return S(_t,At)}function Ve(Se){var Je=ce[C.getPtId(Se)],_t,At=Se.transform;if(Je)_t=Je;else if(_t={rpx1:Se.rpx1,transform:{textPosAngle:At.textPosAngle,scale:0,rotate:At.rotate,rCenter:At.rCenter,x:At.x,y:At.y}},se)if(Se.parent)if(it){var vt=Se.x1>it?2*Math.PI:0;_t.x0=_t.x1=vt}else L.extendFlat(_t,ze(Se));else _t.x0=_t.x1=de;else _t.x0=_t.x1=de;var Kt=S(_t.transform.textPosAngle,Se.transform.textPosAngle),Qt=S(_t.rpx1,Se.rpx1),fr=S(_t.x0,Se.x0),mr=S(_t.x1,Se.x1),Ur=S(_t.transform.scale,At.scale),Br=S(_t.transform.rotate,At.rotate),fn=At.rCenter===0?3:_t.transform.rCenter===0?1/3:1,Fr=S(_t.transform.rCenter,At.rCenter),Qr=function(Bt){return Fr(Math.pow(Bt,fn))};return function(Bt){var et=Qt(Bt);fr(Bt),mr(Bt);var ut=Qr(Bt),Be=Kt(Bt),Ie={rpx1:et,transform:{textPosAngle:Be,rCenter:ut,x:At.x,y:At.y}};return a(G.type,At,w),{transform:{targetX:Ze(Ie),targetY:Xe(Ie),scale:Ur(Bt),rotate:Br(Bt),rCenter:ut}}}}function ze(Se){var Je=Se.parent,_t=ce[C.getPtId(Je)],At={};if(_t){var vt=Je.children,Kt=vt.indexOf(Se),Qt=vt.length,fr=S(_t.x0,_t.x1);At.x0=fr(Kt/Qt),At.x1=fr(Kt/Qt)}else At.x0=At.x1=0;return At}}function x(T){return v.partition().size([2*Math.PI,T.height+1])(T)}ae.formatSliceLabel=function(T,E,_,h,m){var w=_.texttemplate,F=_.textinfo;if(!w&&(!F||F==="none"))return"";var z=m.separators,U=h[0],V=T.data.data,G=U.hierarchy,j=C.isHierarchyRoot(T),O=C.getParent(G,T),H=C.getValue(T);if(!w){var W=F.split("+"),ee=function(le){return W.indexOf(le)!==-1},ue=[],xe;if(ee("label")&&V.label&&ue.push(V.label),V.hasOwnProperty("v")&&ee("value")&&ue.push(C.formatValue(V.v,z)),!j){ee("current path")&&ue.push(C.getPath(T.data));var ge=0;ee("percent parent")&&ge++,ee("percent entry")&&ge++,ee("percent root")&&ge++;var _e=ge>1;if(ge){var Y,se=function(le){xe=C.formatPercent(Y,z),_e&&(xe+=" of "+le),ue.push(xe)};ee("percent parent")&&!j&&(Y=H/C.getValue(O),se("parent")),ee("percent entry")&&(Y=H/C.getValue(E),se("entry")),ee("percent root")&&(Y=H/C.getValue(G),se("root"))}}return ee("text")&&(xe=L.castOption(_,V.i,"text"),L.isValidTextValue(xe)&&ue.push(xe)),ue.join("
")}var ce=L.castOption(_,V.i,"texttemplate");if(!ce)return"";var ne={};V.label&&(ne.label=V.label),V.hasOwnProperty("v")&&(ne.value=V.v,ne.valueLabel=C.formatValue(V.v,z)),ne.currentPath=C.getPath(T.data),j||(ne.percentParent=H/C.getValue(O),ne.percentParentLabel=C.formatPercent(ne.percentParent,z),ne.parent=C.getPtLabel(O)),ne.percentEntry=H/C.getValue(E),ne.percentEntryLabel=C.formatPercent(ne.percentEntry,z),ne.entry=C.getPtLabel(E),ne.percentRoot=H/C.getValue(G),ne.percentRootLabel=C.formatPercent(ne.percentRoot,z),ne.root=C.getPtLabel(G),V.hasOwnProperty("color")&&(ne.color=V.color);var ye=L.castOption(_,V.i,"text");return(L.isValidTextValue(ye)||ye==="")&&(ne.text=ye),ne.customdata=L.castOption(_,V.i,"customdata"),L.texttemplateString({data:[ne,_._meta],fallback:_.texttemplatefallback,labels:ne,locale:m._d3locale,template:ce})};function A(T){return T.rpx0===0&&L.isFullCircle([T.x0,T.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(T.halfangle)),T.ring/2))}function k(T){return I(T.rpx1,T.transform.textPosAngle)}function I(T,E){return[T*Math.sin(E),-T*Math.cos(E)]}}}),uf=Re({"src/traces/sunburst/index.js"(ae,K){K.exports={moduleType:"trace",name:"sunburst",basePlotModule:cP(),categories:[],animatable:!0,attributes:mw(),layoutAttributes:R5(),supplyDefaults:SI(),supplyLayoutDefaults:fP(),calc:gw().calc,crossTraceCalc:gw().crossTraceCalc,plot:pc().plot,style:Wc().style,colorbar:Eh(),meta:{}}}}),qy=Re({"lib/sunburst.js"(ae,K){K.exports=uf()}}),yP=Re({"src/traces/treemap/base_plot.js"(ae){var K=If();ae.name="treemap",ae.plot=function(v,S,M,L){K.plotBasePlot(ae.name,v,S,M,L)},ae.clean=function(v,S,M,L){K.cleanBasePlot(ae.name,v,S,M,L)}}}),DT=Re({"src/traces/treemap/constants.js"(ae,K){K.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),_P=Re({"src/traces/treemap/attributes.js"(ae,K){var{hovertemplateAttrs:v,texttemplateAttrs:S,templatefallbackAttrs:M}=Wl(),L=ac(),t=af().attributes,r=fx(),a=mw(),l=DT(),i=Li().extendFlat,s=up().pattern;K.exports={labels:a.labels,parents:a.parents,values:a.values,branchvalues:a.branchvalues,count:a.count,level:a.level,maxdepth:a.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:i({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:a.marker.colors,pattern:s,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:a.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},L("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:i({},r.textfont,{}),editType:"calc"},text:r.text,textinfo:a.textinfo,texttemplate:S({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:M({editType:"plot"}),hovertext:r.hovertext,hoverinfo:a.hoverinfo,hovertemplate:v({},{keys:l.eventDataKeys}),hovertemplatefallback:M(),textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:i({},r.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:r.sort,root:a.root,domain:t({name:"treemap",trace:!0,editType:"calc"})}}}),FO=Re({"src/traces/treemap/layout_attributes.js"(ae,K){K.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),ZH=Re({"src/traces/treemap/defaults.js"(ae,K){var v=Rn(),S=_P(),M=ko(),L=af().defaults,t=Wv().handleText,r=ky().TEXTPAD,a=hx().handleMarkerDefaults,l=nf(),i=l.hasColorscale,s=l.handleDefaults;K.exports=function(c,p,d,y){function g(m,w){return v.coerce(c,p,S,m,w)}var C=g("labels"),f=g("parents");if(!C||!C.length||!f||!f.length){p.visible=!1;return}var x=g("values");x&&x.length?g("branchvalues"):g("count"),g("level"),g("maxdepth");var A=g("tiling.packing");A==="squarify"&&g("tiling.squarifyratio"),g("tiling.flip"),g("tiling.pad");var k=g("text");g("texttemplate"),g("texttemplatefallback"),p.texttemplate||g("textinfo",v.isArrayOrTypedArray(k)?"text+label":"label"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var I=g("pathbar.visible"),T="auto";t(c,p,y,g,T,{hasPathbar:I,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),g("textposition");var E=p.textposition.indexOf("bottom")!==-1;a(c,p,y,g);var _=p._hasColorscale=i(c,"marker","colors")||(c.marker||{}).coloraxis;_?s(c,p,y,g,{prefix:"marker.",cLetter:"c"}):g("marker.depthfade",!(p.marker.colors||[]).length);var h=p.textfont.size*2;g("marker.pad.t",E?h/4:h),g("marker.pad.l",h/4),g("marker.pad.r",h/4),g("marker.pad.b",E?h:h/4),g("marker.cornerradius"),p._hovered={marker:{line:{width:2,color:M.contrast(y.paper_bgcolor)}}},I&&(g("pathbar.thickness",p.pathbar.textfont.size+2*r),g("pathbar.side"),g("pathbar.edgeshape")),g("sort"),g("root.color"),L(p,y,g),p._length=null}}}),KH=Re({"src/traces/treemap/layout_defaults.js"(ae,K){var v=Rn(),S=FO();K.exports=function(L,t){function r(a,l){return v.coerce(L,t,S,a,l)}r("treemapcolorway",t.colorway),r("extendtreemapcolors")}}}),BO=Re({"src/traces/treemap/calc.js"(ae){var K=gw();ae.calc=function(v,S){return K.calc(v,S)},ae.crossTraceCalc=function(v){return K._runCrossTraceCalc("treemap",v)}}}),UO=Re({"src/traces/treemap/flip_tree.js"(ae,K){K.exports=function v(S,M,L){var t;L.swapXY&&(t=S.x0,S.x0=S.y0,S.y0=t,t=S.x1,S.x1=S.y1,S.y1=t),L.flipX&&(t=S.x0,S.x0=M[0]-S.x1,S.x1=M[0]-t),L.flipY&&(t=S.y0,S.y0=M[1]-S.y1,S.y1=M[1]-t);var r=S.children;if(r)for(var a=0;a0)for(var h=0;h").join(" ")||"";var _e=S.ensureSingle(xe,"g","slicetext"),Y=S.ensureSingle(_e,"text","",function(ce){ce.attr("data-notex",1)}),se=S.ensureUniformFontSize(c,l.determineTextFont(G,ue,U.font,{onPathbar:!0}));Y.text(ue._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(M.font,se).call(L.convertToTspans,c),ue.textBB=M.bBox(Y.node()),ue.transform=T(ue,{fontSize:se.size,onPathbar:!0}),ue.transform.fontSize=se.size,_?Y.transition().attrTween("transform",function(ce){var ne=w(ce,s,F,[f,x]);return function(ye){return E(ne(ye))}}):Y.attr("transform",E(ue))})}}}),QH=Re({"src/traces/treemap/plot_one.js"(ae,K){var v=un(),S=(Lo(),yn(Xi)).interpolate,M=ol(),L=Rn(),t=ky().TEXTPAD,r=Cu(),a=r.toMoveInsideBar,l=Nc(),i=l.recordMinTextSize,s=DT(),o=JH();function c(p){return M.isHierarchyRoot(p)?"":M.getPtId(p)}K.exports=function(d,y,g,C,f){var x=d._fullLayout,A=y[0],k=A.trace,I=k.type,T=I==="icicle",E=A.hierarchy,_=M.findEntryWithLevel(E,k.level),h=v.select(g),m=h.selectAll("g.pathbar"),w=h.selectAll("g.slice");if(!_){m.remove(),w.remove();return}var F=M.isHierarchyRoot(_),z=!x.uniformtext.mode&&M.hasTransition(C),U=M.getMaxDepth(k),V=function(Fr){return Fr.data.depth-_.data.depth-1?H+ue:-(ee+ue):0,ge={x0:W,x1:W,y0:xe,y1:xe+ee},_e=function(Fr,Qr,Bt){var et=k.tiling.pad,ut=function(Fe){return Fe-et<=Qr.x0},Be=function(Fe){return Fe+et>=Qr.x1},Ie=function(Fe){return Fe-et<=Qr.y0},ke=function(Fe){return Fe+et>=Qr.y1};return Fr.x0===Qr.x0&&Fr.x1===Qr.x1&&Fr.y0===Qr.y0&&Fr.y1===Qr.y1?{x0:Fr.x0,x1:Fr.x1,y0:Fr.y0,y1:Fr.y1}:{x0:ut(Fr.x0-et)?0:Be(Fr.x0-et)?Bt[0]:Fr.x0,x1:ut(Fr.x1+et)?0:Be(Fr.x1+et)?Bt[0]:Fr.x1,y0:Ie(Fr.y0-et)?0:ke(Fr.y0-et)?Bt[1]:Fr.y0,y1:Ie(Fr.y1+et)?0:ke(Fr.y1+et)?Bt[1]:Fr.y1}},Y=null,se={},ce={},ne=null,ye=function(Fr,Qr){return Qr?se[c(Fr)]:ce[c(Fr)]},le=function(Fr,Qr,Bt,et){if(Qr)return se[c(E)]||ge;var ut=ce[k.level]||Bt;return V(Fr)?_e(Fr,ut,et):{}};A.hasMultipleRoots&&F&&U++,k._maxDepth=U,k._backgroundColor=x.paper_bgcolor,k._entryDepth=_.data.depth,k._atRootLevel=F;var Z=-O/2+G.l+G.w*(j.x[1]+j.x[0])/2,de=-H/2+G.t+G.h*(1-(j.y[1]+j.y[0])/2),pe=function(Fr){return Z+Fr},Te=function(Fr){return de+Fr},Ne=Te(0),$e=pe(0),Ze=function(Fr){return $e+Fr},Xe=function(Fr){return Ne+Fr};function it(Fr,Qr){return Fr+","+Qr}var yt=Ze(0),bt=function(Fr){Fr.x=Math.max(yt,Fr.x)},mt=k.pathbar.edgeshape,ht=function(Fr){var Qr=Ze(Math.max(Math.min(Fr.x0,Fr.x0),0)),Bt=Ze(Math.min(Math.max(Fr.x1,Fr.x1),W)),et=Xe(Fr.y0),ut=Xe(Fr.y1),Be=ee/2,Ie={},ke={};Ie.x=Qr,ke.x=Bt,Ie.y=ke.y=(et+ut)/2;var Fe={x:Qr,y:et},at={x:Bt,y:et},ct={x:Bt,y:ut},Gt={x:Qr,y:ut};return mt===">"?(Fe.x-=Be,at.x-=Be,ct.x-=Be,Gt.x-=Be):mt==="/"?(ct.x-=Be,Gt.x-=Be,Ie.x-=Be/2,ke.x-=Be/2):mt==="\\"?(Fe.x-=Be,at.x-=Be,Ie.x-=Be/2,ke.x-=Be/2):mt==="<"&&(Ie.x-=Be,ke.x-=Be),bt(Fe),bt(Gt),bt(Ie),bt(at),bt(ct),bt(ke),"M"+it(Fe.x,Fe.y)+"L"+it(at.x,at.y)+"L"+it(ke.x,ke.y)+"L"+it(ct.x,ct.y)+"L"+it(Gt.x,Gt.y)+"L"+it(Ie.x,Ie.y)+"Z"},Ve=k[T?"tiling":"marker"].pad,ze=function(Fr){return k.textposition.indexOf(Fr)!==-1},Se=ze("top"),Je=ze("left"),_t=ze("right"),At=ze("bottom"),vt=function(Fr){var Qr=pe(Fr.x0),Bt=pe(Fr.x1),et=Te(Fr.y0),ut=Te(Fr.y1),Be=Bt-Qr,Ie=ut-et;if(!Be||!Ie)return"";var ke=k.marker.cornerradius||0,Fe=Math.min(ke,Be/2,Ie/2);Fe&&Fr.data&&Fr.data.data&&Fr.data.data.label&&(Se&&(Fe=Math.min(Fe,Ve.t)),Je&&(Fe=Math.min(Fe,Ve.l)),_t&&(Fe=Math.min(Fe,Ve.r)),At&&(Fe=Math.min(Fe,Ve.b)));var at=function(ct,Gt){return Fe?"a"+it(Fe,Fe)+" 0 0 1 "+it(ct,Gt):""};return"M"+it(Qr,et+Fe)+at(Fe,-Fe)+"L"+it(Bt-Fe,et)+at(Fe,Fe)+"L"+it(Bt,ut-Fe)+at(-Fe,Fe)+"L"+it(Qr+Fe,ut)+at(-Fe,-Fe)+"Z"},Kt=function(Fr,Qr){var Bt=Fr.x0,et=Fr.x1,ut=Fr.y0,Be=Fr.y1,Ie=Fr.textBB,ke=Se||Qr.isHeader&&!At,Fe=ke?"start":At?"end":"middle",at=ze("right"),ct=ze("left")||Qr.onPathbar,Gt=ct?-1:at?1:0;if(Qr.isHeader){if(Bt+=(T?Ve:Ve.l)-t,et-=(T?Ve:Ve.r)-t,Bt>=et){var Vt=(Bt+et)/2;Bt=Vt,et=Vt}var Zt;At?(Zt=Be-(T?Ve:Ve.b),ut-1,flipY:j.tiling.flip.indexOf("y")>-1,pad:{inner:j.tiling.pad,top:j.marker.pad.t,left:j.marker.pad.l,right:j.marker.pad.r,bottom:j.marker.pad.b}}),xe=ue.descendants(),ge=1/0,_e=-1/0;xe.forEach(function(ye){var le=ye.depth;le>=j._maxDepth?(ye.x0=ye.x1=(ye.x0+ye.x1)/2,ye.y0=ye.y1=(ye.y0+ye.y1)/2):(ge=Math.min(ge,le),_e=Math.max(_e,le))}),g=g.data(xe,l.getPtId),j._maxVisibleLayers=isFinite(_e)?_e-ge+1:0,g.enter().append("g").classed("slice",!0),h(g,o,z,[f,x],I),g.order();var Y=null;if(_&&F){var se=l.getPtId(F);g.each(function(ye){Y===null&&l.getPtId(ye)===se&&(Y={x0:ye.x0,x1:ye.x1,y0:ye.y0,y1:ye.y1})})}var ce=function(){return Y||{x0:0,x1:f,y0:0,y1:x}},ne=g;return _&&(ne=ne.transition().each("end",function(){var ye=v.select(this);l.setSliceCursor(ye,p,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ne.each(function(ye){var le=l.isHeader(ye,j);ye._x0=A(ye.x0),ye._x1=A(ye.x1),ye._y0=k(ye.y0),ye._y1=k(ye.y1),ye._hoverX=A(ye.x1-j.marker.pad.r),ye._hoverY=k(W?ye.y1-j.marker.pad.b/2:ye.y0+j.marker.pad.t/2);var Z=v.select(this),de=S.ensureSingle(Z,"path","surface",function(Xe){Xe.style("pointer-events",U?"none":"all")});_?de.transition().attrTween("d",function(Xe){var it=m(Xe,o,ce(),[f,x]);return function(yt){return I(it(yt))}}):de.attr("d",I),Z.call(i,y,p,d,{styleOne:r,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,p,{isTransitioning:p._transitioning}),de.call(r,ye,j,p,{hovered:!1}),ye.x0===ye.x1||ye.y0===ye.y1?ye._text="":le?ye._text=ee?"":l.getPtLabel(ye)||"":ye._text=s(ye,y,j,d,V)||"";var pe=S.ensureSingle(Z,"g","slicetext"),Te=S.ensureSingle(pe,"text","",function(Xe){Xe.attr("data-notex",1)}),Ne=S.ensureUniformFontSize(p,l.determineTextFont(j,ye,V.font)),$e=ye._text||" ",Ze=le&&$e.indexOf("
")===-1;Te.text($e).classed("slicetext",!0).attr("text-anchor",H?"end":O||Ze?"start":"middle").call(M.font,Ne).call(L.convertToTspans,p),ye.textBB=M.bBox(Te.node()),ye.transform=T(ye,{fontSize:Ne.size,isHeader:le}),ye.transform.fontSize=Ne.size,_?Te.transition().attrTween("transform",function(Xe){var it=w(Xe,o,ce(),[f,x]);return function(yt){return E(it(yt))}}):Te.attr("transform",E(ye))}),Y}}}),tW=Re({"src/traces/treemap/plot.js"(ae,K){var v=VO(),S=eW();K.exports=function(L,t,r,a){return v(L,t,r,a,{type:"treemap",drawDescendants:S})}}}),rW=Re({"src/traces/treemap/index.js"(ae,K){K.exports={moduleType:"trace",name:"treemap",basePlotModule:yP(),categories:[],animatable:!0,attributes:_P(),layoutAttributes:FO(),supplyDefaults:ZH(),supplyLayoutDefaults:KH(),calc:BO().calc,crossTraceCalc:BO().crossTraceCalc,plot:tW(),style:xP().style,colorbar:Eh(),meta:{}}}}),nW=Re({"lib/treemap.js"(ae,K){K.exports=rW()}}),aW=Re({"src/traces/icicle/base_plot.js"(ae){var K=If();ae.name="icicle",ae.plot=function(v,S,M,L){K.plotBasePlot(ae.name,v,S,M,L)},ae.clean=function(v,S,M,L){K.cleanBasePlot(ae.name,v,S,M,L)}}}),jO=Re({"src/traces/icicle/attributes.js"(ae,K){var{hovertemplateAttrs:v,texttemplateAttrs:S,templatefallbackAttrs:M}=Wl(),L=ac(),t=af().attributes,r=fx(),a=mw(),l=_P(),i=DT(),s=Li().extendFlat,o=up().pattern;K.exports={labels:a.labels,parents:a.parents,values:a.values,branchvalues:a.branchvalues,count:a.count,level:a.level,maxdepth:a.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:l.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:s({colors:a.marker.colors,line:a.marker.line,pattern:o,editType:"calc"},L("marker",{colorAttr:"colors",anim:!1})),leaf:a.leaf,pathbar:l.pathbar,text:r.text,textinfo:a.textinfo,texttemplate:S({editType:"plot"},{keys:i.eventDataKeys.concat(["label","value"])}),texttemplatefallback:M({editType:"plot"}),hovertext:r.hovertext,hoverinfo:a.hoverinfo,hovertemplate:v({},{keys:i.eventDataKeys}),hovertemplatefallback:M(),textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:r.sort,root:a.root,domain:t({name:"icicle",trace:!0,editType:"calc"})}}}),GO=Re({"src/traces/icicle/layout_attributes.js"(ae,K){K.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),iW=Re({"src/traces/icicle/defaults.js"(ae,K){var v=Rn(),S=jO(),M=ko(),L=af().defaults,t=Wv().handleText,r=ky().TEXTPAD,a=hx().handleMarkerDefaults,l=nf(),i=l.hasColorscale,s=l.handleDefaults;K.exports=function(c,p,d,y){function g(E,_){return v.coerce(c,p,S,E,_)}var C=g("labels"),f=g("parents");if(!C||!C.length||!f||!f.length){p.visible=!1;return}var x=g("values");x&&x.length?g("branchvalues"):g("count"),g("level"),g("maxdepth"),g("tiling.orientation"),g("tiling.flip"),g("tiling.pad");var A=g("text");g("texttemplate"),g("texttemplatefallback"),p.texttemplate||g("textinfo",v.isArrayOrTypedArray(A)?"text+label":"label"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var k=g("pathbar.visible"),I="auto";t(c,p,y,g,I,{hasPathbar:k,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),g("textposition"),a(c,p,y,g);var T=p._hasColorscale=i(c,"marker","colors")||(c.marker||{}).coloraxis;T&&s(c,p,y,g,{prefix:"marker.",cLetter:"c"}),g("leaf.opacity",T?1:.7),p._hovered={marker:{line:{width:2,color:M.contrast(y.paper_bgcolor)}}},k&&(g("pathbar.thickness",p.pathbar.textfont.size+2*r),g("pathbar.side"),g("pathbar.edgeshape")),g("sort"),g("root.color"),L(p,y,g),p._length=null}}}),oW=Re({"src/traces/icicle/layout_defaults.js"(ae,K){var v=Rn(),S=GO();K.exports=function(L,t){function r(a,l){return v.coerce(L,t,S,a,l)}r("iciclecolorway",t.colorway),r("extendiciclecolors")}}}),qO=Re({"src/traces/icicle/calc.js"(ae){var K=gw();ae.calc=function(v,S){return K.calc(v,S)},ae.crossTraceCalc=function(v){return K._runCrossTraceCalc("icicle",v)}}}),sW=Re({"src/traces/icicle/partition.js"(ae,K){var v=px(),S=UO();K.exports=function(L,t,r){var a=r.flipX,l=r.flipY,i=r.orientation==="h",s=r.maxDepth,o=t[0],c=t[1];s&&(o=(L.height+1)*t[0]/Math.min(L.height+1,s),c=(L.height+1)*t[1]/Math.min(L.height+1,s));var p=v.partition().padding(r.pad.inner).size(i?[t[1],o]:[t[0],c])(L);return(i||a||l)&&S(p,t,{swapXY:i,flipX:a,flipY:l}),p}}}),HO=Re({"src/traces/icicle/style.js"(ae,K){var v=un(),S=ko(),M=Rn(),L=Nc().resizeText,t=jl();function r(l){var i=l._fullLayout._iciclelayer.selectAll(".trace");L(l,i,"icicle"),i.each(function(s){var o=v.select(this),c=s[0],p=c.trace;o.style("opacity",p.opacity),o.selectAll("path.surface").each(function(d){v.select(this).call(a,d,p,l)})})}function a(l,i,s,o){var c=i.data.data,p=!i.children,d=c.i,y=M.castOption(s,d,"marker.line.color")||S.defaultLine,g=M.castOption(s,d,"marker.line.width")||0;l.call(t,i,s,o).style("stroke-width",g).call(S.stroke,y).style("opacity",p?s.leaf.opacity:null)}K.exports={style:r,styleOne:a}}}),lW=Re({"src/traces/icicle/draw_descendants.js"(ae,K){var v=un(),S=Rn(),M=qs(),L=kc(),t=sW(),r=HO().styleOne,a=DT(),l=ol(),i=Uu(),s=pc().formatSliceLabel,o=!1;K.exports=function(p,d,y,g,C){var f=C.width,x=C.height,A=C.viewX,k=C.viewY,I=C.pathSlice,T=C.toMoveInsideSlice,E=C.strTransform,_=C.hasTransition,h=C.handleSlicesExit,m=C.makeUpdateSliceInterpolator,w=C.makeUpdateTextInterpolator,F=C.prevEntry,z={},U=p._context.staticPlot,V=p._fullLayout,G=d[0],j=G.trace,O=j.textposition.indexOf("left")!==-1,H=j.textposition.indexOf("right")!==-1,W=j.textposition.indexOf("bottom")!==-1,ee=t(y,[f,x],{flipX:j.tiling.flip.indexOf("x")>-1,flipY:j.tiling.flip.indexOf("y")>-1,orientation:j.tiling.orientation,pad:{inner:j.tiling.pad},maxDepth:j._maxDepth}),ue=ee.descendants(),xe=1/0,ge=-1/0;ue.forEach(function(ne){var ye=ne.depth;ye>=j._maxDepth?(ne.x0=ne.x1=(ne.x0+ne.x1)/2,ne.y0=ne.y1=(ne.y0+ne.y1)/2):(xe=Math.min(xe,ye),ge=Math.max(ge,ye))}),g=g.data(ue,l.getPtId),j._maxVisibleLayers=isFinite(ge)?ge-xe+1:0,g.enter().append("g").classed("slice",!0),h(g,o,z,[f,x],I),g.order();var _e=null;if(_&&F){var Y=l.getPtId(F);g.each(function(ne){_e===null&&l.getPtId(ne)===Y&&(_e={x0:ne.x0,x1:ne.x1,y0:ne.y0,y1:ne.y1})})}var se=function(){return _e||{x0:0,x1:f,y0:0,y1:x}},ce=g;return _&&(ce=ce.transition().each("end",function(){var ne=v.select(this);l.setSliceCursor(ne,p,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ce.each(function(ne){ne._x0=A(ne.x0),ne._x1=A(ne.x1),ne._y0=k(ne.y0),ne._y1=k(ne.y1),ne._hoverX=A(ne.x1-j.tiling.pad),ne._hoverY=k(W?ne.y1-j.tiling.pad/2:ne.y0+j.tiling.pad/2);var ye=v.select(this),le=S.ensureSingle(ye,"path","surface",function(Te){Te.style("pointer-events",U?"none":"all")});_?le.transition().attrTween("d",function(Te){var Ne=m(Te,o,se(),[f,x],{orientation:j.tiling.orientation,flipX:j.tiling.flip.indexOf("x")>-1,flipY:j.tiling.flip.indexOf("y")>-1});return function($e){return I(Ne($e))}}):le.attr("d",I),ye.call(i,y,p,d,{styleOne:r,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,p,{isTransitioning:p._transitioning}),le.call(r,ne,j,p,{hovered:!1}),ne.x0===ne.x1||ne.y0===ne.y1?ne._text="":ne._text=s(ne,y,j,d,V)||"";var Z=S.ensureSingle(ye,"g","slicetext"),de=S.ensureSingle(Z,"text","",function(Te){Te.attr("data-notex",1)}),pe=S.ensureUniformFontSize(p,l.determineTextFont(j,ne,V.font));de.text(ne._text||" ").classed("slicetext",!0).attr("text-anchor",H?"end":O?"start":"middle").call(M.font,pe).call(L.convertToTspans,p),ne.textBB=M.bBox(de.node()),ne.transform=T(ne,{fontSize:pe.size}),ne.transform.fontSize=pe.size,_?de.transition().attrTween("transform",function(Te){var Ne=w(Te,o,se(),[f,x]);return function($e){return E(Ne($e))}}):de.attr("transform",E(ne))}),_e}}}),uW=Re({"src/traces/icicle/plot.js"(ae,K){var v=VO(),S=lW();K.exports=function(L,t,r,a){return v(L,t,r,a,{type:"icicle",drawDescendants:S})}}}),cW=Re({"src/traces/icicle/index.js"(ae,K){K.exports={moduleType:"trace",name:"icicle",basePlotModule:aW(),categories:[],animatable:!0,attributes:jO(),layoutAttributes:GO(),supplyDefaults:iW(),supplyLayoutDefaults:oW(),calc:qO().calc,crossTraceCalc:qO().crossTraceCalc,plot:uW(),style:HO().style,colorbar:Eh(),meta:{}}}}),fW=Re({"lib/icicle.js"(ae,K){K.exports=cW()}}),hW=Re({"src/traces/funnelarea/base_plot.js"(ae){var K=If();ae.name="funnelarea",ae.plot=function(v,S,M,L){K.plotBasePlot(ae.name,v,S,M,L)},ae.clean=function(v,S,M,L){K.cleanBasePlot(ae.name,v,S,M,L)}}}),WO=Re({"src/traces/funnelarea/attributes.js"(ae,K){var v=fx(),S=As(),M=af().attributes,{hovertemplateAttrs:L,texttemplateAttrs:t,templatefallbackAttrs:r}=Wl(),a=Li().extendFlat;K.exports={labels:v.labels,label0:v.label0,dlabel:v.dlabel,values:v.values,marker:{colors:v.marker.colors,line:{color:a({},v.marker.line.color,{dflt:null}),width:a({},v.marker.line.width,{dflt:1}),editType:"calc"},pattern:v.marker.pattern,editType:"calc"},text:v.text,hovertext:v.hovertext,scalegroup:a({},v.scalegroup,{}),textinfo:a({},v.textinfo,{flags:["label","text","value","percent"]}),texttemplate:t({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:r({editType:"plot"}),hoverinfo:a({},S.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:L({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:r(),textposition:a({},v.textposition,{values:["inside","none"],dflt:"inside"}),textfont:v.textfont,insidetextfont:v.insidetextfont,title:{text:v.title.text,font:v.title.font,position:a({},v.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:M({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"}}}}),XO=Re({"src/traces/funnelarea/layout_attributes.js"(ae,K){var v=k5().hiddenlabels;K.exports={hiddenlabels:v,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),dW=Re({"src/traces/funnelarea/defaults.js"(ae,K){var v=Rn(),S=WO(),M=af().defaults,L=Wv().handleText,t=hx().handleLabelsAndValues,r=hx().handleMarkerDefaults;K.exports=function(l,i,s,o){function c(I,T){return v.coerce(l,i,S,I,T)}var p=c("labels"),d=c("values"),y=t(p,d),g=y.len;if(i._hasLabels=y.hasLabels,i._hasValues=y.hasValues,!i._hasLabels&&i._hasValues&&(c("label0"),c("dlabel")),!g){i.visible=!1;return}i._length=g,r(l,i,o,c),c("scalegroup");var C=c("text"),f=c("texttemplate");c("texttemplatefallback");var x;if(f||(x=c("textinfo",Array.isArray(C)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),f||x&&x!=="none"){var A=c("textposition");L(l,i,o,c,A,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else x==="none"&&c("textposition","none");M(i,o,c);var k=c("title.text");k&&(c("title.position"),v.coerceFont(c,"title.font",o.font)),c("aspectratio"),c("baseratio")}}}),pW=Re({"src/traces/funnelarea/layout_defaults.js"(ae,K){var v=Rn(),S=XO();K.exports=function(L,t){function r(a,l){return v.coerce(L,t,S,a,l)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}}}),YO=Re({"src/traces/funnelarea/calc.js"(ae,K){var v=t0();function S(L,t){return v.calc(L,t)}function M(L){v.crossTraceCalc(L,{type:"funnelarea"})}K.exports={calc:S,crossTraceCalc:M}}}),vW=Re({"src/traces/funnelarea/plot.js"(ae,K){var v=un(),S=qs(),M=Rn(),L=M.strScale,t=M.strTranslate,r=kc(),a=Cu(),l=a.toMoveInsideBar,i=Nc(),s=i.recordMinTextSize,o=i.clearMinTextSize,c=T1(),p=dx(),d=p.attachFxHandlers,y=p.determineInsideTextFont,g=p.layoutAreas,C=p.prerenderTitles,f=p.positionTitleOutside,x=p.formatSliceLabel;K.exports=function(E,_){var h=E._context.staticPlot,m=E._fullLayout;o("funnelarea",m),C(_,E),g(_,m._size),M.makeTraceGroups(m._funnelarealayer,_,"trace").each(function(w){var F=v.select(this),z=w[0],U=z.trace;I(w),F.each(function(){var V=v.select(this).selectAll("g.slice").data(w);V.enter().append("g").classed("slice",!0),V.exit().remove(),V.each(function(j,O){if(j.hidden){v.select(this).selectAll("path,g").remove();return}j.pointNumber=j.i,j.curveNumber=U.index;var H=z.cx,W=z.cy,ee=v.select(this),ue=ee.selectAll("path.surface").data([j]);ue.enter().append("path").classed("surface",!0).style({"pointer-events":h?"none":"all"}),ee.call(d,E,w);var xe="M"+(H+j.TR[0])+","+(W+j.TR[1])+A(j.TR,j.BR)+A(j.BR,j.BL)+A(j.BL,j.TL)+"Z";ue.attr("d",xe),x(E,j,z);var ge=c.castOption(U.textposition,j.pts),_e=ee.selectAll("g.slicetext").data(j.text&&ge!=="none"?[0]:[]);_e.enter().append("g").classed("slicetext",!0),_e.exit().remove(),_e.each(function(){var Y=M.ensureSingle(v.select(this),"text","",function(pe){pe.attr("data-notex",1)}),se=M.ensureUniformFontSize(E,y(U,j,m.font));Y.text(j.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(S.font,se).call(r.convertToTspans,E);var ce=S.bBox(Y.node()),ne,ye,le,Z=Math.min(j.BL[1],j.BR[1])+W,de=Math.max(j.TL[1],j.TR[1])+W;ye=Math.max(j.TL[0],j.BL[0])+H,le=Math.min(j.TR[0],j.BR[0])+H,ne=l(ye,le,Z,de,ce,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),ne.fontSize=se.size,s(U.type,ne,m),w[O].transform=ne,M.setTransormAndDisplay(Y,ne)})});var G=v.select(this).selectAll("g.titletext").data(U.title.text?[0]:[]);G.enter().append("g").classed("titletext",!0),G.exit().remove(),G.each(function(){var j=M.ensureSingle(v.select(this),"text","",function(W){W.attr("data-notex",1)}),O=U.title.text;U._meta&&(O=M.templateString(O,U._meta)),j.text(O).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(S.font,U.title.font).call(r.convertToTspans,E);var H=f(z,m._size);j.attr("transform",t(H.x,H.y)+L(Math.min(1,H.scale))+t(H.tx,H.ty))})})})};function A(T,E){var _=E[0]-T[0],h=E[1]-T[1];return"l"+_+","+h}function k(T,E){return[.5*(T[0]+E[0]),.5*(T[1]+E[1])]}function I(T){if(!T.length)return;var E=T[0],_=E.trace,h=_.aspectratio,m=_.baseratio;m>.999&&(m=.999);var w=Math.pow(m,2),F=E.vTotal,z=F*w/(1-w),U=F,V=z/F;function G(){var Te=Math.sqrt(V);return{x:Te,y:-Te}}function j(){var Te=G();return[Te.x,Te.y]}var O,H=[];H.push(j());var W,ee;for(W=T.length-1;W>-1;W--)if(ee=T[W],!ee.hidden){var ue=ee.v/U;V+=ue,H.push(j())}var xe=1/0,ge=-1/0;for(W=0;W-1;W--)if(ee=T[W],!ee.hidden){Z+=1;var de=H[Z][0],pe=H[Z][1];ee.TL=[-de,pe],ee.TR=[de,pe],ee.BL=ye,ee.BR=le,ee.pxmid=k(ee.TR,ee.BR),ye=ee.TL,le=ee.TR}}}}),mW=Re({"src/traces/funnelarea/style.js"(ae,K){var v=un(),S=Rb(),M=Nc().resizeText;K.exports=function(t){var r=t._fullLayout._funnelarealayer.selectAll(".trace");M(t,r,"funnelarea"),r.each(function(a){var l=a[0],i=l.trace,s=v.select(this);s.style({opacity:i.opacity}),s.selectAll("path.surface").each(function(o){v.select(this).call(S,o,i,t)})})}}}),gW=Re({"src/traces/funnelarea/index.js"(ae,K){K.exports={moduleType:"trace",name:"funnelarea",basePlotModule:hW(),categories:["pie-like","funnelarea","showLegend"],attributes:WO(),layoutAttributes:XO(),supplyDefaults:dW(),supplyLayoutDefaults:pW(),calc:YO().calc,crossTraceCalc:YO().crossTraceCalc,plot:vW(),style:mW(),styleOne:Rb(),meta:{}}}}),yW=Re({"lib/funnelarea.js"(ae,K){K.exports=gW()}}),vv=Re({"stackgl_modules/index.js"(ae,K){(function(){var v={24:(function(t){var r={left:0,top:0};t.exports=a;function a(i,s,o){s=s||i.currentTarget||i.srcElement,Array.isArray(o)||(o=[0,0]);var c=i.clientX||0,p=i.clientY||0,d=l(s);return o[0]=c-d.left,o[1]=p-d.top,o}function l(i){return i===window||i===document||i===document.body?r:i.getBoundingClientRect()}}),109:(function(t){t.exports=r;function r(a,l,i,s){var o=i[0],c=i[2],p=l[0]-o,d=l[2]-c,y=Math.sin(s),g=Math.cos(s);return a[0]=o+d*y+p*g,a[1]=l[1],a[2]=c+d*g-p*y,a}}),160:(function(t){t.exports=r;function r(a,l,i){return a[0]=Math.max(l[0],i[0]),a[1]=Math.max(l[1],i[1]),a[2]=Math.max(l[2],i[2]),a[3]=Math.max(l[3],i[3]),a}}),216:(function(t){t.exports=r;function r(a,l){for(var i={},s=0;s1){y[0]in p||(p[y[0]]=[]),p=p[y[0]];for(var g=1;g=0;--O){var se=G[O];H=se[0];var ce=U[H],ne=ce[0],ye=ce[1],le=z[ne],Z=z[ye];if((le[0]-Z[0]||le[1]-Z[1])<0){var de=ne;ne=ye,ye=de}ce[0]=ne;var pe=ce[1]=se[1],Te;for(j&&(Te=ce[2]);O>0&&G[O-1][0]===H;){var se=G[--O],Ne=se[1];j?U.push([pe,Ne,Te]):U.push([pe,Ne]),pe=Ne}j?U.push([pe,ye,Te]):U.push([pe,ye])}return W}function T(z,U,V){for(var G=U.length,j=new l(G),O=[],H=0;HU[2]?1:0)}function h(z,U,V){if(z.length!==0){if(U)for(var G=0;G0||H.length>0}function F(z,U,V){var G;if(V){G=U;for(var j=new Array(U.length),O=0;O 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec3 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, coneScale, coneOffset; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * conePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(conePosition, 1.0); + vec4 t_position = view * conePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = conePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),s=l([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),o=l([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // 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). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float vectorScale, coneScale, coneOffset; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + gl_Position = projection * (view * conePosition); + f_id = id; + f_position = position.xyz; +} +`]),c=l([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);r.meshShader={vertex:i,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:c,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}}),620:(function(t){t.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"]}),665:(function(t,r,a){var l=a(3202);t.exports=c;var i=96;function s(p,d){var y=l(getComputedStyle(p).getPropertyValue(d));return y[0]*c(y[1],p)}function o(p,d){var y=document.createElement("div");y.style["font-size"]="128"+p,d.appendChild(y);var g=s(y,"font-size")/128;return d.removeChild(y),g}function c(p,d){switch(d=d||document.body,p=(p||"px").trim().toLowerCase(),(d===window||d===document)&&(d=document.body),p){case"%":return d.clientHeight/100;case"ch":case"ex":return o(p,d);case"em":return s(d,"font-size");case"rem":return s(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}}),727:(function(t,r,a){var l=a(2962),i=6;function s(k){var I=k===2?p:k===3?d:k===4?y:k===5?g:C;return k<6?I(l[k]):I(l)}function o(){return[[0]]}function c(k,I){return[[I[0]],[k[0][0]]]}function p(k){return function(T,E){return[k([[+E[0],+T[0][1]],[+E[1],+T[1][1]]]),k([[+T[0][0],+E[0]],[+T[1][0],+E[1]]]),k(T)]}}function d(k){return function(T,E){return[k([[+E[0],+T[0][1],+T[0][2]],[+E[1],+T[1][1],+T[1][2]],[+E[2],+T[2][1],+T[2][2]]]),k([[+T[0][0],+E[0],+T[0][2]],[+T[1][0],+E[1],+T[1][2]],[+T[2][0],+E[2],+T[2][2]]]),k([[+T[0][0],+T[0][1],+E[0]],[+T[1][0],+T[1][1],+E[1]],[+T[2][0],+T[2][1],+E[2]]]),k(T)]}}function y(k){return function(T,E){return[k([[+E[0],+T[0][1],+T[0][2],+T[0][3]],[+E[1],+T[1][1],+T[1][2],+T[1][3]],[+E[2],+T[2][1],+T[2][2],+T[2][3]],[+E[3],+T[3][1],+T[3][2],+T[3][3]]]),k([[+T[0][0],+E[0],+T[0][2],+T[0][3]],[+T[1][0],+E[1],+T[1][2],+T[1][3]],[+T[2][0],+E[2],+T[2][2],+T[2][3]],[+T[3][0],+E[3],+T[3][2],+T[3][3]]]),k([[+T[0][0],+T[0][1],+E[0],+T[0][3]],[+T[1][0],+T[1][1],+E[1],+T[1][3]],[+T[2][0],+T[2][1],+E[2],+T[2][3]],[+T[3][0],+T[3][1],+E[3],+T[3][3]]]),k([[+T[0][0],+T[0][1],+T[0][2],+E[0]],[+T[1][0],+T[1][1],+T[1][2],+E[1]],[+T[2][0],+T[2][1],+T[2][2],+E[2]],[+T[3][0],+T[3][1],+T[3][2],+E[3]]]),k(T)]}}function g(k){return function(T,E){return[k([[+E[0],+T[0][1],+T[0][2],+T[0][3],+T[0][4]],[+E[1],+T[1][1],+T[1][2],+T[1][3],+T[1][4]],[+E[2],+T[2][1],+T[2][2],+T[2][3],+T[2][4]],[+E[3],+T[3][1],+T[3][2],+T[3][3],+T[3][4]],[+E[4],+T[4][1],+T[4][2],+T[4][3],+T[4][4]]]),k([[+T[0][0],+E[0],+T[0][2],+T[0][3],+T[0][4]],[+T[1][0],+E[1],+T[1][2],+T[1][3],+T[1][4]],[+T[2][0],+E[2],+T[2][2],+T[2][3],+T[2][4]],[+T[3][0],+E[3],+T[3][2],+T[3][3],+T[3][4]],[+T[4][0],+E[4],+T[4][2],+T[4][3],+T[4][4]]]),k([[+T[0][0],+T[0][1],+E[0],+T[0][3],+T[0][4]],[+T[1][0],+T[1][1],+E[1],+T[1][3],+T[1][4]],[+T[2][0],+T[2][1],+E[2],+T[2][3],+T[2][4]],[+T[3][0],+T[3][1],+E[3],+T[3][3],+T[3][4]],[+T[4][0],+T[4][1],+E[4],+T[4][3],+T[4][4]]]),k([[+T[0][0],+T[0][1],+T[0][2],+E[0],+T[0][4]],[+T[1][0],+T[1][1],+T[1][2],+E[1],+T[1][4]],[+T[2][0],+T[2][1],+T[2][2],+E[2],+T[2][4]],[+T[3][0],+T[3][1],+T[3][2],+E[3],+T[3][4]],[+T[4][0],+T[4][1],+T[4][2],+E[4],+T[4][4]]]),k([[+T[0][0],+T[0][1],+T[0][2],+T[0][3],+E[0]],[+T[1][0],+T[1][1],+T[1][2],+T[1][3],+E[1]],[+T[2][0],+T[2][1],+T[2][2],+T[2][3],+E[2]],[+T[3][0],+T[3][1],+T[3][2],+T[3][3],+E[3]],[+T[4][0],+T[4][1],+T[4][2],+T[4][3],+E[4]]]),k(T)]}}function C(k){return function(T,E){return[k([[+E[0],+T[0][1],+T[0][2],+T[0][3],+T[0][4],+T[0][5]],[+E[1],+T[1][1],+T[1][2],+T[1][3],+T[1][4],+T[1][5]],[+E[2],+T[2][1],+T[2][2],+T[2][3],+T[2][4],+T[2][5]],[+E[3],+T[3][1],+T[3][2],+T[3][3],+T[3][4],+T[3][5]],[+E[4],+T[4][1],+T[4][2],+T[4][3],+T[4][4],+T[4][5]],[+E[5],+T[5][1],+T[5][2],+T[5][3],+T[5][4],+T[5][5]]]),k([[+T[0][0],+E[0],+T[0][2],+T[0][3],+T[0][4],+T[0][5]],[+T[1][0],+E[1],+T[1][2],+T[1][3],+T[1][4],+T[1][5]],[+T[2][0],+E[2],+T[2][2],+T[2][3],+T[2][4],+T[2][5]],[+T[3][0],+E[3],+T[3][2],+T[3][3],+T[3][4],+T[3][5]],[+T[4][0],+E[4],+T[4][2],+T[4][3],+T[4][4],+T[4][5]],[+T[5][0],+E[5],+T[5][2],+T[5][3],+T[5][4],+T[5][5]]]),k([[+T[0][0],+T[0][1],+E[0],+T[0][3],+T[0][4],+T[0][5]],[+T[1][0],+T[1][1],+E[1],+T[1][3],+T[1][4],+T[1][5]],[+T[2][0],+T[2][1],+E[2],+T[2][3],+T[2][4],+T[2][5]],[+T[3][0],+T[3][1],+E[3],+T[3][3],+T[3][4],+T[3][5]],[+T[4][0],+T[4][1],+E[4],+T[4][3],+T[4][4],+T[4][5]],[+T[5][0],+T[5][1],+E[5],+T[5][3],+T[5][4],+T[5][5]]]),k([[+T[0][0],+T[0][1],+T[0][2],+E[0],+T[0][4],+T[0][5]],[+T[1][0],+T[1][1],+T[1][2],+E[1],+T[1][4],+T[1][5]],[+T[2][0],+T[2][1],+T[2][2],+E[2],+T[2][4],+T[2][5]],[+T[3][0],+T[3][1],+T[3][2],+E[3],+T[3][4],+T[3][5]],[+T[4][0],+T[4][1],+T[4][2],+E[4],+T[4][4],+T[4][5]],[+T[5][0],+T[5][1],+T[5][2],+E[5],+T[5][4],+T[5][5]]]),k([[+T[0][0],+T[0][1],+T[0][2],+T[0][3],+E[0],+T[0][5]],[+T[1][0],+T[1][1],+T[1][2],+T[1][3],+E[1],+T[1][5]],[+T[2][0],+T[2][1],+T[2][2],+T[2][3],+E[2],+T[2][5]],[+T[3][0],+T[3][1],+T[3][2],+T[3][3],+E[3],+T[3][5]],[+T[4][0],+T[4][1],+T[4][2],+T[4][3],+E[4],+T[4][5]],[+T[5][0],+T[5][1],+T[5][2],+T[5][3],+E[5],+T[5][5]]]),k([[+T[0][0],+T[0][1],+T[0][2],+T[0][3],+T[0][4],+E[0]],[+T[1][0],+T[1][1],+T[1][2],+T[1][3],+T[1][4],+E[1]],[+T[2][0],+T[2][1],+T[2][2],+T[2][3],+T[2][4],+E[2]],[+T[3][0],+T[3][1],+T[3][2],+T[3][3],+T[3][4],+E[3]],[+T[4][0],+T[4][1],+T[4][2],+T[4][3],+T[4][4],+E[4]],[+T[5][0],+T[5][1],+T[5][2],+T[5][3],+T[5][4],+E[5]]]),k(T)]}}var f=[o,c];function x(k,I,T,E,_,h,m,w){return function(z,U){switch(z.length){case 0:return k(z,U);case 1:return I(z,U);case 2:return T(z,U);case 3:return E(z,U);case 4:return _(z,U);case 5:return h(z,U)}var V=m[z.length];return V||(V=m[z.length]=w(z.length)),V(z,U)}}function A(){for(;f.length1e-6?(x=Math.acos(A),k=Math.sin(x),I=Math.sin((1-s)*x)/k,T=Math.sin(s*x)/k):(I=1-s,T=s),a[0]=I*o+T*y,a[1]=I*c+T*g,a[2]=I*p+T*C,a[3]=I*d+T*f,a}}),799:(function(t,r,a){var l=a(3236),i=a(9405),s=l([`precision mediump float; +#define GLSLIFY 1 +attribute vec2 position; +varying vec2 uv; +void main() { + uv = position; + gl_Position = vec4(position, 0, 1); +}`]),o=l([`precision mediump float; +#define GLSLIFY 1 + +uniform sampler2D accumBuffer; +varying vec2 uv; + +void main() { + vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); + gl_FragColor = min(vec4(1,1,1,1), accum); +}`]);t.exports=function(c){return i(c,s,o,null,[{name:"position",type:"vec2"}])}}),811:(function(t){t.exports=r;function r(a,l){return a[0]=1/l[0],a[1]=1/l[1],a[2]=1/l[2],a}}),840:(function(t,r,a){var l=a(3236),i=l([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position, normal; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model + , view + , projection + , inverseModel; +uniform vec3 eyePosition + , lightPosition; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; +varying vec4 f_color; +varying vec2 f_uv; + +vec4 project(vec3 p) { + return projection * (view * (model * vec4(p, 1.0))); +} + +void main() { + gl_Position = project(position); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * vec4(position , 1.0); + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + f_color = color; + f_data = position; + f_uv = uv; +} +`]),s=l([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness + , fresnel + , kambient + , kdiffuse + , kspecular; +uniform sampler2D texture; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (f_color.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], f_data) + ) discard; + + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d + + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * f_color.a; +} +`]),o=l([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model, view, projection; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + f_color = color; + f_data = position; + f_uv = uv; +}`]),c=l([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard; + + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),p=l([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; +attribute float pointSize; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0); + } else { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + } + gl_PointSize = pointSize; + f_color = color; + f_uv = uv; +}`]),d=l([`precision highp float; +#define GLSLIFY 1 + +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5); + if(dot(pointR, pointR) > 0.25) { + discard; + } + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),y=l([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 id; + +uniform mat4 model, view, projection; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + f_id = id; + f_position = position; +}`]),g=l([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]),C=l([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute float pointSize; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0, 0.0, 0.0); + } else { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + gl_PointSize = pointSize; + } + f_id = id; + f_position = position; +}`]),f=l([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; + +uniform mat4 model, view, projection; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); +}`]),x=l([`precision highp float; +#define GLSLIFY 1 + +uniform vec3 contourColor; + +void main() { + gl_FragColor = vec4(contourColor, 1.0); +} +`]);r.meshShader={vertex:i,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:y,fragment:g,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:C,fragment:g,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:f,fragment:x,attributes:[{name:"position",type:"vec3"}]}}),855:(function(t,r,a){t.exports={init:A,sweepBipartite:T,sweepComplete:E,scanBipartite:_,scanComplete:h};var l=a(1888),i=a(8828),s=a(4192),o=1<<28,c=1024,p=l.mallocInt32(c),d=l.mallocInt32(c),y=l.mallocInt32(c),g=l.mallocInt32(c),C=l.mallocInt32(c),f=l.mallocInt32(c),x=l.mallocDouble(c*8);function A(m){var w=i.nextPow2(m);p.length>>1;s(x,ce);for(var ne=0,ye=0,ge=0;ge=o)le=le-o|0,k(y,g,ye--,le);else if(le>=0)k(p,d,ne--,le);else if(le<=-o){le=-le-o|0;for(var Z=0;Z>>1;s(x,ce);for(var ne=0,ye=0,le=0,ge=0;ge>1===x[2*ge+3]>>1&&(de=2,ge+=1),Z<0){for(var pe=-(Z>>1)-1,Te=0;Te>1)-1;de===0?k(p,d,ne--,pe):de===1?k(y,g,ye--,pe):de===2&&k(C,f,le--,pe)}}}function _(m,w,F,z,U,V,G,j,O,H,W,ee){var ue=0,xe=2*m,ge=w,_e=w+m,Y=1,se=1;z?se=o:Y=o;for(var ce=U;ce>>1;s(x,Z);for(var de=0,ce=0;ce=o?(Te=!z,ne-=o):(Te=!!z,ne-=1),Te)I(p,d,de++,ne);else{var Ne=ee[ne],$e=xe*ne,Ze=W[$e+w+1],Xe=W[$e+w+1+m];e:for(var it=0;it>>1;s(x,ne);for(var ye=0,_e=0;_e=o)p[ye++]=Y-o;else{Y-=1;var Z=W[Y],de=ue*Y,pe=H[de+w+1],Te=H[de+w+1+m];e:for(var Ne=0;Ne=0;--Ne)if(p[Ne]===Y){for(var it=Ne+1;it max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 lowerBound, upperBound; +uniform float contourTint; +uniform vec4 contourColor; +uniform sampler2D colormap; +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform float vertexColor; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + if ( + kill > 0.0 || + vColor.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], worldCoordinate) + ) discard; + + vec3 N = normalize(surfaceNormal); + vec3 V = normalize(eyeDirection); + vec3 L = normalize(lightDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = max(beckmannSpecular(L, V, N, roughness), 0.); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + //decide how to interpolate color — in vertex or in fragment + vec4 surfaceColor = + step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + + step(.5, vertexColor) * vColor; + + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = mix(litColor, contourColor, contourTint) * opacity; +} +`]),c=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec4 uv; +attribute float f; + +uniform vec3 objectOffset; +uniform mat3 permutation; +uniform mat4 model, view, projection; +uniform float height, zOffset; +uniform sampler2D colormap; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + vec3 dataCoordinate = permutation * vec3(uv.xy, height); + worldCoordinate = objectOffset + dataCoordinate; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0); + + vec4 clipPosition = projection * (view * worldPosition); + clipPosition.z += zOffset; + + gl_Position = clipPosition; + value = f + objectOffset.z; + kill = -1.0; + planeCoordinate = uv.zw; + + vColor = texture2D(colormap, vec2(value, value)); + + //Don't do lighting for contours + surfaceNormal = vec3(1,0,0); + eyeDirection = vec3(0,1,0); + lightDirection = vec3(0,0,1); +} +`]),p=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec2 shape; +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 surfaceNormal; + +vec2 splitFloat(float v) { + float vh = 255.0 * v; + float upper = floor(vh); + float lower = fract(vh); + return vec2(upper / 255.0, floor(lower * 16.0) / 16.0); +} + +void main() { + if ((kill > 0.0) || + (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard; + + vec2 ux = splitFloat(planeCoordinate.x / shape.x); + vec2 uy = splitFloat(planeCoordinate.y / shape.y); + gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0)); +} +`]);r.createShader=function(d){var y=l(d,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return y.attributes.uv.location=0,y.attributes.f.location=1,y.attributes.normal.location=2,y},r.createPickShader=function(d){var y=l(d,s,p,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return y.attributes.uv.location=0,y.attributes.f.location=1,y.attributes.normal.location=2,y},r.createContourShader=function(d){var y=l(d,c,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return y.attributes.uv.location=0,y.attributes.f.location=1,y},r.createPickContourShader=function(d){var y=l(d,c,p,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return y.attributes.uv.location=0,y.attributes.f.location=1,y}}),1085:(function(t,r,a){var l=a(1371);t.exports=i;function i(s,o,c){o=typeof o=="number"?o:1,c=c||": ";var p=s.split(/\r?\n/),d=String(p.length+o-1).length;return p.map(function(y,g){var C=g+o,f=String(C).length,x=l(C,d-f);return x+c+y}).join(` +`)}}),1091:(function(t){t.exports=r;function r(){var a=new Float32Array(3);return a[0]=0,a[1]=0,a[2]=0,a}}),1125:(function(t,r,a){t.exports=s;var l=a(3250)[3];function i(o,c,p,d){for(var y=0;y<2;++y){var g=o[y],C=c[y],f=Math.min(g,C),x=Math.max(g,C),A=p[y],k=d[y],I=Math.min(A,k),T=Math.max(A,k);if(T0&&g>0||y<0&&g<0)return!1;var C=l(p,o,c),f=l(d,o,c);return C>0&&f>0||C<0&&f<0?!1:y===0&&g===0&&C===0&&f===0?i(o,c,p,d):!0}}),1278:(function(t,r,a){var l=a(2361),i=Math.pow(2,-1074),s=-1>>>0;t.exports=o;function o(c,p){if(isNaN(c)||isNaN(p))return NaN;if(c===p)return c;if(c===0)return p<0?-i:i;var d=l.hi(c),y=l.lo(c);return p>c==c>0?y===s?(d+=1,y=0):y+=1:y===0?(y=s,d-=1):y-=1,l.pack(y,d)}}),1283:(function(t,r,a){var l=a(9405),i=a(3236),s=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform vec4 highlightId; +uniform float highlightScale; +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float scale = 1.0; + if(distance(highlightId, id) < 0.0001) { + scale = highlightScale; + } + + vec4 worldPosition = model * vec4(position, 1); + vec4 viewPosition = view * worldPosition; + viewPosition = viewPosition / viewPosition.w; + vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0)); + + gl_Position = clipPosition; + interpColor = color; + pickId = id; + dataCoordinate = position; + } +}`]),o=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform vec2 screenSize; +uniform vec3 clipBounds[2]; +uniform float highlightScale, pixelRatio; +uniform vec4 highlightId; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float scale = pixelRatio; + if(distance(highlightId.bgr, id.bgr) < 0.001) { + scale *= highlightScale; + } + + vec4 worldPosition = model * vec4(position, 1.0); + vec4 viewPosition = view * worldPosition; + vec4 clipPosition = projection * viewPosition; + clipPosition /= clipPosition.w; + + gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0); + interpColor = color; + pickId = id; + dataCoordinate = position; + } +}`]),c=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform float highlightScale; +uniform vec4 highlightId; +uniform vec3 axes[2]; +uniform mat4 model, view, projection; +uniform vec2 screenSize; +uniform vec3 clipBounds[2]; +uniform float scale, pixelRatio; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float lscale = pixelRatio * scale; + if(distance(highlightId, id) < 0.0001) { + lscale *= highlightScale; + } + + vec4 clipCenter = projection * (view * (model * vec4(position, 1))); + vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y; + vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1))); + + gl_Position = clipPosition; + interpColor = color; + pickId = id; + dataCoordinate = dataPosition; + } +} +`]),p=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 fragClipBounds[2]; +uniform float opacity; + +varying vec4 interpColor; +varying vec3 dataCoordinate; + +void main() { + if ( + outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) || + interpColor.a * opacity == 0. + ) discard; + gl_FragColor = interpColor * opacity; +} +`]),d=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 fragClipBounds[2]; +uniform float pickGroup; + +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard; + + gl_FragColor = vec4(pickGroup, pickId.bgr); +}`]),y=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],g={vertex:s,fragment:p,attributes:y},C={vertex:o,fragment:p,attributes:y},f={vertex:c,fragment:p,attributes:y},x={vertex:s,fragment:d,attributes:y},A={vertex:o,fragment:d,attributes:y},k={vertex:c,fragment:d,attributes:y};function I(T,E){var _=l(T,E),h=_.attributes;return h.position.location=0,h.color.location=1,h.glyph.location=2,h.id.location=3,_}r.createPerspective=function(T){return I(T,g)},r.createOrtho=function(T){return I(T,C)},r.createProject=function(T){return I(T,f)},r.createPickPerspective=function(T){return I(T,x)},r.createPickOrtho=function(T){return I(T,A)},r.createPickProject=function(T){return I(T,k)}}),1303:(function(t,r,a){t.exports=s;var l=a(3250);function i(o,c){var p,d;if(c[0][0]c[1][0])p=c[1],d=c[0];else{var y=Math.min(o[0][1],o[1][1]),g=Math.max(o[0][1],o[1][1]),C=Math.min(c[0][1],c[1][1]),f=Math.max(c[0][1],c[1][1]);return gf?y-f:g-f}var x,A;o[0][1]c[1][0])p=c[1],d=c[0];else return i(c,o);var y,g;if(o[0][0]o[1][0])y=o[1],g=o[0];else return-i(o,c);var C=l(p,d,g),f=l(p,d,y);if(C<0){if(f<=0)return C}else if(C>0){if(f>=0)return C}else if(f)return f;if(C=l(g,y,d),f=l(g,y,p),C<0){if(f<=0)return C}else if(C>0){if(f>=0)return C}else if(f)return f;return d[0]-g[0]}}),1318:(function(t){t.exports=r;function r(a,l){return a[0].mul(l[1]).cmp(l[0].mul(a[1]))}}),1338:(function(t){function r(i,s,o){var c=i[o]|0;if(c<=0)return[];var p=new Array(c),d;if(o===i.length-1)for(d=0;d"u"&&(s=0),typeof i){case"number":if(i>0)return a(i|0,s);break;case"object":if(typeof i.length=="number")return r(i,s,0);break}return[]}t.exports=l}),1369:(function(t,r,a){var l=a(5716);t.exports=i;function i(s){var o=s.length,c=s.words,p=0;if(o===1)p=c[0];else if(o===2)p=c[0]+c[1]*67108864;else for(var d=0;ds)throw new Error("gl-vao: Too many vertex attributes");for(var o=0;o=0?w[H]:O)}function U(j){var O=k(j);return O?F in O:m.indexOf(j)>=0}function V(j,O){var H,W=k(j);return W?W[F]=O:(H=m.indexOf(j),H>=0?w[H]=O:(H=m.length,w[H]=O,m[H]=j)),this}function G(j){var O=k(j),H,W;return O?F in O&&delete O[F]:(H=m.indexOf(j),H<0?!1:(W=m.length-1,m[H]=void 0,w[H]=w[W],m[H]=m[W],m.length=W,w.length=W,!0))}return Object.create(h.prototype,{get___:{value:I(z)},has___:{value:I(U)},set___:{value:I(V)},delete___:{value:I(G)}})};h.prototype=Object.create(Object.prototype,{get:{value:function(w,F){return this.get___(w,F)},writable:!0,configurable:!0},has:{value:function(w){return this.has___(w)},writable:!0,configurable:!0},set:{value:function(w,F){return this.set___(w,F)},writable:!0,configurable:!0},delete:{value:function(w){return this.delete___(w)},writable:!0,configurable:!0}}),typeof i=="function"?(function(){l&&typeof Proxy<"u"&&(Proxy=void 0);function m(){this instanceof h||E();var w=new i,F=void 0,z=!1;function U(O,H){return F?w.has(O)?w.get(O):F.get___(O,H):w.get(O,H)}function V(O){return w.has(O)||(F?F.has___(O):!1)}var G;l?G=function(O,H){return w.set(O,H),w.has(O)||(F||(F=new h),F.set(O,H)),this}:G=function(O,H){if(z)try{w.set(O,H)}catch{F||(F=new h),F.set___(O,H)}else w.set(O,H);return this};function j(O){var H=!!w.delete(O);return F&&F.delete___(O)||H}return Object.create(h.prototype,{get___:{value:I(U)},has___:{value:I(V)},set___:{value:I(G)},delete___:{value:I(j)},permitHostObjects___:{value:I(function(O){if(O===a)z=!0;else throw new Error("bogus call to permitHostObjects___")})}})}m.prototype=h.prototype,t.exports=m,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})})():(typeof Proxy<"u"&&(Proxy=void 0),t.exports=h)})()}),1570:(function(t){t.exports=a;var r=[function(){function i(s,o,c,p){for(var d=s.length,y=[],g=0;g>1,A=c[2*x+1];if(A===g)return x;g>1,A=c[2*x+1];if(A===g)return x;g>1,A=c[2*x+1];if(A===g)return x;g HALF_PI) && (b <= ONE_AND_HALF_PI)) ? + b - PI : + b; +} + +float look_horizontal_or_vertical(float a, float ratio) { + // ratio controls the ratio between being horizontal to (vertical + horizontal) + // if ratio is set to 0.5 then it is 50%, 50%. + // when using a higher ratio e.g. 0.75 the result would + // likely be more horizontal than vertical. + + float b = positive_angle(a); + + return + (b < ( ratio) * HALF_PI) ? 0.0 : + (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI : + (b < (2.0 + ratio) * HALF_PI) ? 0.0 : + (b < (4.0 - ratio) * HALF_PI) ? HALF_PI : + 0.0; +} + +float roundTo(float a, float b) { + return float(b * floor((a + 0.5 * b) / b)); +} + +float look_round_n_directions(float a, int n) { + float b = positive_angle(a); + float div = TWO_PI / float(n); + float c = roundTo(b, div); + return look_upwards(c); +} + +float applyAlignOption(float rawAngle, float delta) { + return + (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions + (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical + (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis + (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards + (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal + rawAngle; // otherwise return back raw input angle +} + +bool isAxisTitle = (axis.x == 0.0) && + (axis.y == 0.0) && + (axis.z == 0.0); + +void main() { + //Compute world offset + float axisDistance = position.z; + vec3 dataPosition = axisDistance * axis + offset; + + float beta = angle; // i.e. user defined attributes for each tick + + float axisAngle; + float clipAngle; + float flip; + + if (enableAlign) { + axisAngle = (isAxisTitle) ? HALF_PI : + computeViewAngle(dataPosition, dataPosition + axis); + clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir); + + axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0; + clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0; + + flip = (dot(vec2(cos(axisAngle), sin(axisAngle)), + vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0; + + beta += applyAlignOption(clipAngle, flip * PI); + } + + //Compute plane offset + vec2 planeCoord = position.xy * pixelScale; + + mat2 planeXform = scale * mat2( + cos(beta), sin(beta), + -sin(beta), cos(beta) + ); + + vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution; + + //Compute clip position + vec3 clipPosition = project(dataPosition); + + //Apply text offset in clip coordinates + clipPosition += vec3(viewOffset, 0.0); + + //Done + gl_Position = vec4(clipPosition, 1.0); +} +`]),p=l([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 color; +void main() { + gl_FragColor = color; +}`]);r.Q=function(g){return i(g,c,p,null,[{name:"position",type:"vec3"}])};var d=l([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec3 normal; + +uniform mat4 model, view, projection; +uniform vec3 enable; +uniform vec3 bounds[2]; + +varying vec3 colorChannel; + +void main() { + + vec3 signAxis = sign(bounds[1] - bounds[0]); + + vec3 realNormal = signAxis * normal; + + if(dot(realNormal, enable) > 0.0) { + vec3 minRange = min(bounds[0], bounds[1]); + vec3 maxRange = max(bounds[0], bounds[1]); + vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0)); + gl_Position = projection * (view * (model * vec4(nPosition, 1.0))); + } else { + gl_Position = vec4(0,0,0,0); + } + + colorChannel = abs(realNormal); +} +`]),y=l([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 colors[3]; + +varying vec3 colorChannel; + +void main() { + gl_FragColor = colorChannel.x * colors[0] + + colorChannel.y * colors[1] + + colorChannel.z * colors[2]; +}`]);r.bg=function(g){return i(g,d,y,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}}),1888:(function(t,r,a){var l=a(8828),i=a(1338),s=a(4793).hp;a.g.__TYPEDARRAY_POOL||(a.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=typeof Uint8ClampedArray<"u",c=typeof BigUint64Array<"u",p=typeof BigInt64Array<"u",d=a.g.__TYPEDARRAY_POOL;d.UINT8C||(d.UINT8C=i([32,0])),d.BIGUINT64||(d.BIGUINT64=i([32,0])),d.BIGINT64||(d.BIGINT64=i([32,0])),d.BUFFER||(d.BUFFER=i([32,0]));var y=d.DATA,g=d.BUFFER;r.free=function(j){if(s.isBuffer(j))g[l.log2(j.length)].push(j);else{if(Object.prototype.toString.call(j)!=="[object ArrayBuffer]"&&(j=j.buffer),!j)return;var O=j.length||j.byteLength,H=l.log2(O)|0;y[H].push(j)}};function C(G){if(G){var j=G.length||G.byteLength,O=l.log2(j);y[O].push(G)}}function f(G){C(G.buffer)}r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=f,r.freeArrayBuffer=C,r.freeBuffer=function(j){g[l.log2(j.length)].push(j)},r.malloc=function(j,O){if(O===void 0||O==="arraybuffer")return x(j);switch(O){case"uint8":return A(j);case"uint16":return k(j);case"uint32":return I(j);case"int8":return T(j);case"int16":return E(j);case"int32":return _(j);case"float":case"float32":return h(j);case"double":case"float64":return m(j);case"uint8_clamped":return w(j);case"bigint64":return z(j);case"biguint64":return F(j);case"buffer":return V(j);case"data":case"dataview":return U(j);default:return null}return null};function x(j){var j=l.nextPow2(j),O=l.log2(j),H=y[O];return H.length>0?H.pop():new ArrayBuffer(j)}r.mallocArrayBuffer=x;function A(G){return new Uint8Array(x(G),0,G)}r.mallocUint8=A;function k(G){return new Uint16Array(x(2*G),0,G)}r.mallocUint16=k;function I(G){return new Uint32Array(x(4*G),0,G)}r.mallocUint32=I;function T(G){return new Int8Array(x(G),0,G)}r.mallocInt8=T;function E(G){return new Int16Array(x(2*G),0,G)}r.mallocInt16=E;function _(G){return new Int32Array(x(4*G),0,G)}r.mallocInt32=_;function h(G){return new Float32Array(x(4*G),0,G)}r.mallocFloat32=r.mallocFloat=h;function m(G){return new Float64Array(x(8*G),0,G)}r.mallocFloat64=r.mallocDouble=m;function w(G){return o?new Uint8ClampedArray(x(G),0,G):A(G)}r.mallocUint8Clamped=w;function F(G){return c?new BigUint64Array(x(8*G),0,G):null}r.mallocBigUint64=F;function z(G){return p?new BigInt64Array(x(8*G),0,G):null}r.mallocBigInt64=z;function U(G){return new DataView(x(G),0,G)}r.mallocDataView=U;function V(G){G=l.nextPow2(G);var j=l.log2(G),O=g[j];return O.length>0?O.pop():new s(G)}r.mallocBuffer=V,r.clearCache=function(){for(var j=0;j<32;++j)d.UINT8[j].length=0,d.UINT16[j].length=0,d.UINT32[j].length=0,d.INT8[j].length=0,d.INT16[j].length=0,d.INT32[j].length=0,d.FLOAT[j].length=0,d.DOUBLE[j].length=0,d.BIGUINT64[j].length=0,d.BIGINT64[j].length=0,d.UINT8C[j].length=0,y[j].length=0,g[j].length=0}}),1903:(function(t){t.exports=r;function r(a){var l=new Float32Array(16);return l[0]=a[0],l[1]=a[1],l[2]=a[2],l[3]=a[3],l[4]=a[4],l[5]=a[5],l[6]=a[6],l[7]=a[7],l[8]=a[8],l[9]=a[9],l[10]=a[10],l[11]=a[11],l[12]=a[12],l[13]=a[13],l[14]=a[14],l[15]=a[15],l}}),1944:(function(t,r,a){var l=a(5250),i=a(8210);t.exports=s;function s(o,c){for(var p=l(o[0],c[0]),d=1;d>1,V=p(h[U],m);V<=0?(V===0&&(z=U),w=U+1):V>0&&(F=U-1)}return z}r.findCell=C;function f(h,m){for(var w=new Array(h.length),F=0,z=w.length;F=h.length||p(h[ue],U)!==0););}return w}r.incidence=f;function x(h,m){if(!m)return f(g(k(h,0)),h);for(var w=new Array(m),F=0;F>>O&1&&j.push(z[O]);m.push(j)}return y(m)}r.explode=A;function k(h,m){if(m<0)return[];for(var w=[],F=(1<0}T=T.filter(E);for(var _=T.length,h=new Array(_),m=new Array(_),I=0;I<_;++I){h[I]=I;var w=new Array(_),F=T[I].map(function(it){return x[it]}),z=s([F]),U=0;e:for(var V=0;V<_;++V)if(w[V]=0,I!==V){for(var G=T[V],j=G.length,O=0;O0;){var de=ye.pop(),pe=ue[de];p(pe,function(Xe,it){return Xe-it});var Te=pe.length,Ne=le[de],$e;if(Ne===0){var G=T[de];$e=[G]}for(var I=0;I=0)&&(le[Ze]=Ne^1,ye.push(Ze),Ne===0)){var G=T[Ze];ne(G)||(G.reverse(),$e.push(G))}}Ne===0&&Z.push($e)}return Z}}),2145:(function(t,r){r.uniforms=s,r.attributes=o;var a={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},l=null;function i(c,p){if(!l){var d=Object.keys(a);l={};for(var y=0;y1)for(var x=0;x1&&V.drawBuffersWEBGL(i[U]);var W=m.getExtension("WEBGL_depth_texture");W?G?_.depth=f(m,F,z,W.UNSIGNED_INT_24_8_WEBGL,m.DEPTH_STENCIL,m.DEPTH_STENCIL_ATTACHMENT):j&&(_.depth=f(m,F,z,m.UNSIGNED_SHORT,m.DEPTH_COMPONENT,m.DEPTH_ATTACHMENT)):j&&G?_._depth_rb=x(m,F,z,m.DEPTH_STENCIL,m.DEPTH_STENCIL_ATTACHMENT):j?_._depth_rb=x(m,F,z,m.DEPTH_COMPONENT16,m.DEPTH_ATTACHMENT):G&&(_._depth_rb=x(m,F,z,m.STENCIL_INDEX,m.STENCIL_ATTACHMENT));var ee=m.checkFramebufferStatus(m.FRAMEBUFFER);if(ee!==m.FRAMEBUFFER_COMPLETE){_._destroyed=!0,m.bindFramebuffer(m.FRAMEBUFFER,null),m.deleteFramebuffer(_.handle),_.handle=null,_.depth&&(_.depth.dispose(),_.depth=null),_._depth_rb&&(m.deleteRenderbuffer(_._depth_rb),_._depth_rb=null);for(var H=0;H<_.color.length;++H)_.color[H].dispose(),_.color[H]=null;_._color_rb&&(m.deleteRenderbuffer(_._color_rb),_._color_rb=null),y(m,h),C(ee)}y(m,h)}function k(_,h,m,w,F,z,U,V){this.gl=_,this._shape=[h|0,m|0],this._destroyed=!1,this._ext=V,this.color=new Array(F);for(var G=0;GF||m<0||m>F)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");_._shape[0]=h,_._shape[1]=m;for(var z=d(w),U=0;U<_.color.length;++U)_.color[U].shape=_._shape;_._color_rb&&(w.bindRenderbuffer(w.RENDERBUFFER,_._color_rb),w.renderbufferStorage(w.RENDERBUFFER,w.RGBA4,_._shape[0],_._shape[1])),_.depth&&(_.depth.shape=_._shape),_._depth_rb&&(w.bindRenderbuffer(w.RENDERBUFFER,_._depth_rb),_._useDepth&&_._useStencil?w.renderbufferStorage(w.RENDERBUFFER,w.DEPTH_STENCIL,_._shape[0],_._shape[1]):_._useDepth?w.renderbufferStorage(w.RENDERBUFFER,w.DEPTH_COMPONENT16,_._shape[0],_._shape[1]):_._useStencil&&w.renderbufferStorage(w.RENDERBUFFER,w.STENCIL_INDEX,_._shape[0],_._shape[1])),w.bindFramebuffer(w.FRAMEBUFFER,_.handle);var V=w.checkFramebufferStatus(w.FRAMEBUFFER);V!==w.FRAMEBUFFER_COMPLETE&&(_.dispose(),y(w,z),C(V)),y(w,z)}}Object.defineProperties(I,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(_){if(Array.isArray(_)||(_=[_|0,_|0]),_.length!==2)throw new Error("gl-fbo: Shape vector must be length 2");var h=_[0]|0,m=_[1]|0;return T(this,h,m),[h,m]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(_){return _=_|0,T(this,_,this._shape[1]),_},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(_){return _=_|0,T(this,this._shape[0],_),_},enumerable:!1}}),I.bind=function(){if(!this._destroyed){var _=this.gl;_.bindFramebuffer(_.FRAMEBUFFER,this.handle),_.viewport(0,0,this._shape[0],this._shape[1])}},I.dispose=function(){if(!this._destroyed){this._destroyed=!0;var _=this.gl;_.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(_.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var h=0;hz||m<0||m>z)throw new Error("gl-fbo: Parameters are too large for FBO");w=w||{};var U=1;if("color"in w){if(U=Math.max(w.color|0,0),U<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(U>1)if(F){if(U>_.getParameter(F.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+U+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var V=_.UNSIGNED_BYTE,G=_.getExtension("OES_texture_float");if(w.float&&U>0){if(!G)throw new Error("gl-fbo: Context does not support floating point textures");V=_.FLOAT}else w.preferFloat&&U>0&&G&&(V=_.FLOAT);var j=!0;"depth"in w&&(j=!!w.depth);var O=!1;return"stencil"in w&&(O=!!w.stencil),new k(_,h,m,V,U,j,O,F)}}),2272:(function(t,r,a){var l=a(2646)[4];a(2478),t.exports=s;function i(o,c,p,d,y,g){var C=c.opposite(d,y);if(!(C<0)){if(y0;){for(var x=p.pop(),g=p.pop(),A=-1,k=-1,C=y[g],T=1;T=0||(c.flip(g,x),i(o,c,p,A,g,k),i(o,c,p,g,k,A),i(o,c,p,k,x,A),i(o,c,p,x,A,k))}}}),2334:(function(t){t.exports=r;function r(a,l,i){return a[0]=Math.min(l[0],i[0]),a[1]=Math.min(l[1],i[1]),a[2]=Math.min(l[2],i[2]),a[3]=Math.min(l[3],i[3]),a}}),2335:(function(t){t.exports=r;function r(a){var l=new Float32Array(4);return l[0]=a[0],l[1]=a[1],l[2]=a[2],l[3]=a[3],l}}),2361:(function(t){var r=!1;if(typeof Float64Array<"u"){var a=new Float64Array(1),l=new Uint32Array(a.buffer);if(a[0]=1,r=!0,l[1]===1072693248){let s=function(p,d){return l[0]=p,l[1]=d,a[0]},o=function(p){return a[0]=p,l[0]},c=function(p){return a[0]=p,l[1]};t.exports=function(d){return a[0]=d,[l[0],l[1]]},t.exports.pack=s,t.exports.lo=o,t.exports.hi=c}else if(l[0]===1072693248){let s=function(p,d){return l[1]=p,l[0]=d,a[0]},o=function(p){return a[0]=p,l[1]},c=function(p){return a[0]=p,l[0]};t.exports=function(d){return a[0]=d,[l[1],l[0]]},t.exports.pack=s,t.exports.lo=o,t.exports.hi=c}else r=!1}if(!r){let s=function(p,d){return i.writeUInt32LE(p,0,!0),i.writeUInt32LE(d,4,!0),i.readDoubleLE(0,!0)},o=function(p){return i.writeDoubleLE(p,0,!0),i.readUInt32LE(0,!0)},c=function(p){return i.writeDoubleLE(p,0,!0),i.readUInt32LE(4,!0)};var i=new Buffer(8);t.exports=function(d){return i.writeDoubleLE(d,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},t.exports.pack=s,t.exports.lo=o,t.exports.hi=c}t.exports.sign=function(s){return t.exports.hi(s)>>>31},t.exports.exponent=function(s){var o=t.exports.hi(s);return(o<<1>>>21)-1023},t.exports.fraction=function(s){var o=t.exports.lo(s),c=t.exports.hi(s),p=c&(1<<20)-1;return c&2146435072&&(p+=1048576),[o,p]},t.exports.denormalized=function(s){var o=t.exports.hi(s);return!(o&2146435072)}}),2408:(function(t){t.exports=r;function r(a,l,i){var s=Math.sin(i),o=Math.cos(i),c=l[0],p=l[1],d=l[2],y=l[3],g=l[8],C=l[9],f=l[10],x=l[11];return l!==a&&(a[4]=l[4],a[5]=l[5],a[6]=l[6],a[7]=l[7],a[12]=l[12],a[13]=l[13],a[14]=l[14],a[15]=l[15]),a[0]=c*o-g*s,a[1]=p*o-C*s,a[2]=d*o-f*s,a[3]=y*o-x*s,a[8]=c*s+g*o,a[9]=p*s+C*o,a[10]=d*s+f*o,a[11]=y*s+x*o,a}}),2419:(function(t){t.exports=r;function r(a){for(var l=1,i=1;ik-A?s(p,d,y,g,C,f,x,A,k,I,T):o(p,d,y,g,C,f,x,A,k,I,T)}return c}function l(){function s(y,g,C,f,x,A,k,I,T,E,_){for(var h=2*y,m=f,w=h*f;mE-T?f?s(y,g,C,x,A,k,I,T,E,_,h):o(y,g,C,x,A,k,I,T,E,_,h):f?c(y,g,C,x,A,k,I,T,E,_,h):p(y,g,C,x,A,k,I,T,E,_,h)}return d}function i(s){return s?a():l()}r.partial=i(!1),r.full=i(!0)}),2478:(function(t){function r(c,p,d,y,g){for(var C=g+1;y<=g;){var f=y+g>>>1,x=c[f],A=d!==void 0?d(x,p):x-p;A>=0?(C=f,g=f-1):y=f+1}return C}function a(c,p,d,y,g){for(var C=g+1;y<=g;){var f=y+g>>>1,x=c[f],A=d!==void 0?d(x,p):x-p;A>0?(C=f,g=f-1):y=f+1}return C}function l(c,p,d,y,g){for(var C=y-1;y<=g;){var f=y+g>>>1,x=c[f],A=d!==void 0?d(x,p):x-p;A<0?(C=f,y=f+1):g=f-1}return C}function i(c,p,d,y,g){for(var C=y-1;y<=g;){var f=y+g>>>1,x=c[f],A=d!==void 0?d(x,p):x-p;A<=0?(C=f,y=f+1):g=f-1}return C}function s(c,p,d,y,g){for(;y<=g;){var C=y+g>>>1,f=c[C],x=d!==void 0?d(f,p):f-p;if(x===0)return C;x<=0?y=C+1:g=C-1}return-1}function o(c,p,d,y,g,C){return typeof d=="function"?C(c,p,d,y===void 0?0:y|0,g===void 0?c.length-1:g|0):C(c,p,void 0,d===void 0?0:d|0,y===void 0?c.length-1:y|0)}t.exports={ge:function(c,p,d,y,g){return o(c,p,d,y,g,r)},gt:function(c,p,d,y,g){return o(c,p,d,y,g,a)},lt:function(c,p,d,y,g){return o(c,p,d,y,g,l)},le:function(c,p,d,y,g){return o(c,p,d,y,g,i)},eq:function(c,p,d,y,g){return o(c,p,d,y,g,s)}}}),2504:(function(t){t.exports=r;function r(a,l,i){var s=i[0],o=i[1],c=i[2];return a[0]=l[0]*s,a[1]=l[1]*s,a[2]=l[2]*s,a[3]=l[3]*s,a[4]=l[4]*o,a[5]=l[5]*o,a[6]=l[6]*o,a[7]=l[7]*o,a[8]=l[8]*c,a[9]=l[9]*c,a[10]=l[10]*c,a[11]=l[11]*c,a[12]=l[12],a[13]=l[13],a[14]=l[14],a[15]=l[15],a}}),2538:(function(t,r,a){var l=a(8902),i=a(5542),s=a(2272),o=a(5023);t.exports=g;function c(C){return[Math.min(C[0],C[1]),Math.max(C[0],C[1])]}function p(C,f){return C[0]-f[0]||C[1]-f[1]}function d(C){return C.map(c).sort(p)}function y(C,f,x){return f in C?C[f]:x}function g(C,f,x){Array.isArray(f)?(x=x||{},f=f||[]):(x=f||{},f=[]);var A=!!y(x,"delaunay",!0),k=!!y(x,"interior",!0),I=!!y(x,"exterior",!0),T=!!y(x,"infinity",!1);if(!k&&!I||C.length===0)return[];var E=l(C,f);if(A||k!==I||T){for(var _=i(C.length,d(f)),h=0;h0){if(xe=1,Y[ce++]=y(_[F],A,k,I),F+=W,T>0)for(ue=1,z=_[F],ne=Y[ce]=y(z,A,k,I),Z=Y[ce+ye],Te=Y[ce+de],Ze=Y[ce+Ne],(ne!==Z||ne!==Te||ne!==Ze)&&(V=_[F+U],j=_[F+G],H=_[F+O],p(ue,xe,z,V,j,H,ne,Z,Te,Ze,A,k,I),Xe=se[ce]=ge++),ce+=1,F+=W,ue=2;ue0)for(ue=1,z=_[F],ne=Y[ce]=y(z,A,k,I),Z=Y[ce+ye],Te=Y[ce+de],Ze=Y[ce+Ne],(ne!==Z||ne!==Te||ne!==Ze)&&(V=_[F+U],j=_[F+G],H=_[F+O],p(ue,xe,z,V,j,H,ne,Z,Te,Ze,A,k,I),Xe=se[ce]=ge++,Ze!==Te&&d(se[ce+de],Xe,j,H,Te,Ze,A,k,I)),ce+=1,F+=W,ue=2;ue0){if(ue=1,Y[ce++]=y(_[F],A,k,I),F+=W,E>0)for(xe=1,z=_[F],ne=Y[ce]=y(z,A,k,I),Te=Y[ce+de],Z=Y[ce+ye],Ze=Y[ce+Ne],(ne!==Te||ne!==Z||ne!==Ze)&&(V=_[F+U],j=_[F+G],H=_[F+O],p(ue,xe,z,V,j,H,ne,Te,Z,Ze,A,k,I),Xe=se[ce]=ge++),ce+=1,F+=W,xe=2;xe0)for(xe=1,z=_[F],ne=Y[ce]=y(z,A,k,I),Te=Y[ce+de],Z=Y[ce+ye],Ze=Y[ce+Ne],(ne!==Te||ne!==Z||ne!==Ze)&&(V=_[F+U],j=_[F+G],H=_[F+O],p(ue,xe,z,V,j,H,ne,Te,Z,Ze,A,k,I),Xe=se[ce]=ge++,Ze!==Te&&d(se[ce+de],Xe,H,V,Ze,Te,A,k,I)),ce+=1,F+=W,xe=2;xe 0"),typeof c.vertex!="function"&&p("Must specify vertex creation function"),typeof c.cell!="function"&&p("Must specify cell creation function"),typeof c.phase!="function"&&p("Must specify phase function");for(var C=c.getters||[],f=new Array(y),x=0;x=0?f[x]=!0:f[x]=!1;return s(c.vertex,c.cell,c.phase,g,d,f)}}),2642:(function(t,r,a){t.exports=s;var l=a(727);function i(o){for(var c=0,p=0;pf[1][2]&&(F[0]=-F[0]),f[0][2]>f[2][0]&&(F[1]=-F[1]),f[1][0]>f[0][1]&&(F[2]=-F[2]),!0};function A(T,E,_){var h=E[0],m=E[1],w=E[2],F=E[3];return T[0]=_[0]*h+_[4]*m+_[8]*w+_[12]*F,T[1]=_[1]*h+_[5]*m+_[9]*w+_[13]*F,T[2]=_[2]*h+_[6]*m+_[10]*w+_[14]*F,T[3]=_[3]*h+_[7]*m+_[11]*w+_[15]*F,T}function k(T,E){T[0][0]=E[0],T[0][1]=E[1],T[0][2]=E[2],T[1][0]=E[4],T[1][1]=E[5],T[1][2]=E[6],T[2][0]=E[8],T[2][1]=E[9],T[2][2]=E[10]}function I(T,E,_,h,m){T[0]=E[0]*h+_[0]*m,T[1]=E[1]*h+_[1]*m,T[2]=E[2]*h+_[2]*m}}),2653:(function(t,r,a){var l=a(3865);t.exports=i;function i(s,o){for(var c=s.length,p=new Array(c),d=0;d=d[k]&&(A+=1);f[x]=A}}return p}function c(p,d){try{return l(p,!0)}catch{var y=i(p);if(y.length<=d)return[];var g=s(p,y),C=l(g,!0);return o(C,y)}}}),2762:(function(t,r,a){var l=a(1888),i=a(5298),s=a(9618),o=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function c(f,x,A,k,I){this.gl=f,this.type=x,this.handle=A,this.length=k,this.usage=I}var p=c.prototype;p.bind=function(){this.gl.bindBuffer(this.type,this.handle)},p.unbind=function(){this.gl.bindBuffer(this.type,null)},p.dispose=function(){this.gl.deleteBuffer(this.handle)};function d(f,x,A,k,I,T){var E=I.length*I.BYTES_PER_ELEMENT;if(T<0)return f.bufferData(x,I,k),E;if(E+T>A)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return f.bufferSubData(x,T,I),A}function y(f,x){for(var A=l.malloc(f.length,x),k=f.length,I=0;I=0;--k){if(x[k]!==A)return!1;A*=f[k]}return!0}p.update=function(f,x){if(typeof x!="number"&&(x=-1),this.bind(),typeof f=="object"&&typeof f.shape<"u"){var A=f.dtype;if(o.indexOf(A)<0&&(A="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var k=gl.getExtension("OES_element_index_uint");k&&A!=="uint16"?A="uint32":A="uint16"}if(A===f.dtype&&g(f.shape,f.stride))f.offset===0&&f.data.length===f.shape[0]?this.length=d(this.gl,this.type,this.length,this.usage,f.data,x):this.length=d(this.gl,this.type,this.length,this.usage,f.data.subarray(f.offset,f.shape[0]),x);else{var I=l.malloc(f.size,A),T=s(I,f.shape);i.assign(T,f),x<0?this.length=d(this.gl,this.type,this.length,this.usage,I,x):this.length=d(this.gl,this.type,this.length,this.usage,I.subarray(0,f.size),x),l.free(I)}}else if(Array.isArray(f)){var E;this.type===this.gl.ELEMENT_ARRAY_BUFFER?E=y(f,"uint16"):E=y(f,"float32"),x<0?this.length=d(this.gl,this.type,this.length,this.usage,E,x):this.length=d(this.gl,this.type,this.length,this.usage,E.subarray(0,f.length),x),l.free(E)}else if(typeof f=="object"&&typeof f.length=="number")this.length=d(this.gl,this.type,this.length,this.usage,f,x);else if(typeof f=="number"||f===void 0){if(x>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");f=f|0,f<=0&&(f=1),this.gl.bufferData(this.type,f|0,this.usage),this.length=f}else throw new Error("gl-buffer: Invalid data type")};function C(f,x,A,k){if(A=A||f.ARRAY_BUFFER,k=k||f.DYNAMIC_DRAW,A!==f.ARRAY_BUFFER&&A!==f.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(k!==f.DYNAMIC_DRAW&&k!==f.STATIC_DRAW&&k!==f.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=f.createBuffer(),T=new c(f,A,I,0,k);return T.update(x),T}t.exports=C}),2825:(function(t){t.exports=r;function r(a,l,i){var s=new Float32Array(3);return s[0]=a,s[1]=l,s[2]=i,s}}),2931:(function(t,r,a){t.exports={EPSILON:a(2613),create:a(1091),clone:a(3126),angle:a(8192),fromValues:a(2825),copy:a(3990),set:a(1463),equals:a(9922),exactEquals:a(9265),add:a(5632),subtract:a(6843),sub:a(2229),multiply:a(5847),mul:a(4505),divide:a(6690),div:a(4008),min:a(8107),max:a(7417),floor:a(2681),ceil:a(9226),round:a(2447),scale:a(6621),scaleAndAdd:a(8489),distance:a(7056),dist:a(5455),squaredDistance:a(2953),sqrDist:a(6141),length:a(1387),len:a(868),squaredLength:a(3066),sqrLen:a(5486),negate:a(5093),inverse:a(811),normalize:a(3536),dot:a(244),cross:a(5911),lerp:a(6658),random:a(7636),transformMat4:a(5673),transformMat3:a(492),transformQuat:a(264),rotateX:a(6894),rotateY:a(109),rotateZ:a(8692),forEach:a(5137)}}),2933:(function(t){t.exports=r;function r(a,l){return a[0]=l[0],a[1]=l[1],a[2]=l[2],a[3]=l[3],a}}),2953:(function(t){t.exports=r;function r(a,l){var i=l[0]-a[0],s=l[1]-a[1],o=l[2]-a[2];return i*i+s*s+o*o}}),2962:(function(t,r,a){var l=a(5250),i=a(8210),s=a(3012),o=a(7004),c=6;function p(k,I,T,E){return function(h){return E(k(T(h[0][0],h[1][1]),T(-h[0][1],h[1][0])))}}function d(k,I,T,E){return function(h){return E(k(I(k(T(h[1][1],h[2][2]),T(-h[1][2],h[2][1])),h[0][0]),k(I(k(T(h[1][0],h[2][2]),T(-h[1][2],h[2][0])),-h[0][1]),I(k(T(h[1][0],h[2][1]),T(-h[1][1],h[2][0])),h[0][2]))))}}function y(k,I,T,E){return function(h){return E(k(k(I(k(I(k(T(h[2][2],h[3][3]),T(-h[2][3],h[3][2])),h[1][1]),k(I(k(T(h[2][1],h[3][3]),T(-h[2][3],h[3][1])),-h[1][2]),I(k(T(h[2][1],h[3][2]),T(-h[2][2],h[3][1])),h[1][3]))),h[0][0]),I(k(I(k(T(h[2][2],h[3][3]),T(-h[2][3],h[3][2])),h[1][0]),k(I(k(T(h[2][0],h[3][3]),T(-h[2][3],h[3][0])),-h[1][2]),I(k(T(h[2][0],h[3][2]),T(-h[2][2],h[3][0])),h[1][3]))),-h[0][1])),k(I(k(I(k(T(h[2][1],h[3][3]),T(-h[2][3],h[3][1])),h[1][0]),k(I(k(T(h[2][0],h[3][3]),T(-h[2][3],h[3][0])),-h[1][1]),I(k(T(h[2][0],h[3][1]),T(-h[2][1],h[3][0])),h[1][3]))),h[0][2]),I(k(I(k(T(h[2][1],h[3][2]),T(-h[2][2],h[3][1])),h[1][0]),k(I(k(T(h[2][0],h[3][2]),T(-h[2][2],h[3][0])),-h[1][1]),I(k(T(h[2][0],h[3][1]),T(-h[2][1],h[3][0])),h[1][2]))),-h[0][3]))))}}function g(k,I,T,E){return function(h){return E(k(k(I(k(k(I(k(I(k(T(h[3][3],h[4][4]),T(-h[3][4],h[4][3])),h[2][2]),k(I(k(T(h[3][2],h[4][4]),T(-h[3][4],h[4][2])),-h[2][3]),I(k(T(h[3][2],h[4][3]),T(-h[3][3],h[4][2])),h[2][4]))),h[1][1]),I(k(I(k(T(h[3][3],h[4][4]),T(-h[3][4],h[4][3])),h[2][1]),k(I(k(T(h[3][1],h[4][4]),T(-h[3][4],h[4][1])),-h[2][3]),I(k(T(h[3][1],h[4][3]),T(-h[3][3],h[4][1])),h[2][4]))),-h[1][2])),k(I(k(I(k(T(h[3][2],h[4][4]),T(-h[3][4],h[4][2])),h[2][1]),k(I(k(T(h[3][1],h[4][4]),T(-h[3][4],h[4][1])),-h[2][2]),I(k(T(h[3][1],h[4][2]),T(-h[3][2],h[4][1])),h[2][4]))),h[1][3]),I(k(I(k(T(h[3][2],h[4][3]),T(-h[3][3],h[4][2])),h[2][1]),k(I(k(T(h[3][1],h[4][3]),T(-h[3][3],h[4][1])),-h[2][2]),I(k(T(h[3][1],h[4][2]),T(-h[3][2],h[4][1])),h[2][3]))),-h[1][4]))),h[0][0]),I(k(k(I(k(I(k(T(h[3][3],h[4][4]),T(-h[3][4],h[4][3])),h[2][2]),k(I(k(T(h[3][2],h[4][4]),T(-h[3][4],h[4][2])),-h[2][3]),I(k(T(h[3][2],h[4][3]),T(-h[3][3],h[4][2])),h[2][4]))),h[1][0]),I(k(I(k(T(h[3][3],h[4][4]),T(-h[3][4],h[4][3])),h[2][0]),k(I(k(T(h[3][0],h[4][4]),T(-h[3][4],h[4][0])),-h[2][3]),I(k(T(h[3][0],h[4][3]),T(-h[3][3],h[4][0])),h[2][4]))),-h[1][2])),k(I(k(I(k(T(h[3][2],h[4][4]),T(-h[3][4],h[4][2])),h[2][0]),k(I(k(T(h[3][0],h[4][4]),T(-h[3][4],h[4][0])),-h[2][2]),I(k(T(h[3][0],h[4][2]),T(-h[3][2],h[4][0])),h[2][4]))),h[1][3]),I(k(I(k(T(h[3][2],h[4][3]),T(-h[3][3],h[4][2])),h[2][0]),k(I(k(T(h[3][0],h[4][3]),T(-h[3][3],h[4][0])),-h[2][2]),I(k(T(h[3][0],h[4][2]),T(-h[3][2],h[4][0])),h[2][3]))),-h[1][4]))),-h[0][1])),k(I(k(k(I(k(I(k(T(h[3][3],h[4][4]),T(-h[3][4],h[4][3])),h[2][1]),k(I(k(T(h[3][1],h[4][4]),T(-h[3][4],h[4][1])),-h[2][3]),I(k(T(h[3][1],h[4][3]),T(-h[3][3],h[4][1])),h[2][4]))),h[1][0]),I(k(I(k(T(h[3][3],h[4][4]),T(-h[3][4],h[4][3])),h[2][0]),k(I(k(T(h[3][0],h[4][4]),T(-h[3][4],h[4][0])),-h[2][3]),I(k(T(h[3][0],h[4][3]),T(-h[3][3],h[4][0])),h[2][4]))),-h[1][1])),k(I(k(I(k(T(h[3][1],h[4][4]),T(-h[3][4],h[4][1])),h[2][0]),k(I(k(T(h[3][0],h[4][4]),T(-h[3][4],h[4][0])),-h[2][1]),I(k(T(h[3][0],h[4][1]),T(-h[3][1],h[4][0])),h[2][4]))),h[1][3]),I(k(I(k(T(h[3][1],h[4][3]),T(-h[3][3],h[4][1])),h[2][0]),k(I(k(T(h[3][0],h[4][3]),T(-h[3][3],h[4][0])),-h[2][1]),I(k(T(h[3][0],h[4][1]),T(-h[3][1],h[4][0])),h[2][3]))),-h[1][4]))),h[0][2]),k(I(k(k(I(k(I(k(T(h[3][2],h[4][4]),T(-h[3][4],h[4][2])),h[2][1]),k(I(k(T(h[3][1],h[4][4]),T(-h[3][4],h[4][1])),-h[2][2]),I(k(T(h[3][1],h[4][2]),T(-h[3][2],h[4][1])),h[2][4]))),h[1][0]),I(k(I(k(T(h[3][2],h[4][4]),T(-h[3][4],h[4][2])),h[2][0]),k(I(k(T(h[3][0],h[4][4]),T(-h[3][4],h[4][0])),-h[2][2]),I(k(T(h[3][0],h[4][2]),T(-h[3][2],h[4][0])),h[2][4]))),-h[1][1])),k(I(k(I(k(T(h[3][1],h[4][4]),T(-h[3][4],h[4][1])),h[2][0]),k(I(k(T(h[3][0],h[4][4]),T(-h[3][4],h[4][0])),-h[2][1]),I(k(T(h[3][0],h[4][1]),T(-h[3][1],h[4][0])),h[2][4]))),h[1][2]),I(k(I(k(T(h[3][1],h[4][2]),T(-h[3][2],h[4][1])),h[2][0]),k(I(k(T(h[3][0],h[4][2]),T(-h[3][2],h[4][0])),-h[2][1]),I(k(T(h[3][0],h[4][1]),T(-h[3][1],h[4][0])),h[2][2]))),-h[1][4]))),-h[0][3]),I(k(k(I(k(I(k(T(h[3][2],h[4][3]),T(-h[3][3],h[4][2])),h[2][1]),k(I(k(T(h[3][1],h[4][3]),T(-h[3][3],h[4][1])),-h[2][2]),I(k(T(h[3][1],h[4][2]),T(-h[3][2],h[4][1])),h[2][3]))),h[1][0]),I(k(I(k(T(h[3][2],h[4][3]),T(-h[3][3],h[4][2])),h[2][0]),k(I(k(T(h[3][0],h[4][3]),T(-h[3][3],h[4][0])),-h[2][2]),I(k(T(h[3][0],h[4][2]),T(-h[3][2],h[4][0])),h[2][3]))),-h[1][1])),k(I(k(I(k(T(h[3][1],h[4][3]),T(-h[3][3],h[4][1])),h[2][0]),k(I(k(T(h[3][0],h[4][3]),T(-h[3][3],h[4][0])),-h[2][1]),I(k(T(h[3][0],h[4][1]),T(-h[3][1],h[4][0])),h[2][3]))),h[1][2]),I(k(I(k(T(h[3][1],h[4][2]),T(-h[3][2],h[4][1])),h[2][0]),k(I(k(T(h[3][0],h[4][2]),T(-h[3][2],h[4][0])),-h[2][1]),I(k(T(h[3][0],h[4][1]),T(-h[3][1],h[4][0])),h[2][2]))),-h[1][3]))),h[0][4])))))}}function C(k){var I=k===2?p:k===3?d:k===4?y:k===5?g:void 0;return I(i,s,l,o)}var f=[function(){return[0]},function(I){return[I[0][0]]}];function x(k,I,T,E,_,h,m,w){return function(z){switch(z.length){case 0:return k(z);case 1:return I(z);case 2:return T(z);case 3:return E(z);case 4:return _(z);case 5:return h(z)}var U=m[z.length];return U||(U=m[z.length]=w(z.length)),U(z)}}function A(){for(;f.length0){w=d[U][h][0],z=U;break}F=w[z^1];for(var V=0;V<2;++V)for(var G=d[V][h],j=0;j0&&(w=O,F=H,z=V)}return m||w&&f(w,z),F}function A(_,h){var m=d[h][_][0],w=[_];f(m,h);for(var F=m[h^1];;){for(;F!==_;)w.push(F),F=x(w[w.length-2],F,!1);if(d[0][_].length+d[1][_].length===0)break;var z=w[w.length-1],U=_,V=w[1],G=x(z,U,!0);if(l(o[z],o[U],o[V],o[G])<0)break;w.push(_),F=x(z,U)}return w}function k(_,h){return h[1]===h[h.length-1]}for(var y=0;y0;){d[0][y].length;var E=A(y,I);k(T,E)?T.push.apply(T,E):(T.length>0&&C.push(T),T=E)}T.length>0&&C.push(T)}return C}}),3090:(function(t,r,a){t.exports=i;var l=a(3250)[3];function i(s){var o=s.length;if(o<3){for(var x=new Array(o),c=0;c1&&l(s[d[f-2]],s[d[f-1]],C)<=0;)f-=1,d.pop();for(d.push(g),f=y.length;f>1&&l(s[y[f-2]],s[y[f-1]],C)>=0;)f-=1,y.pop();y.push(g)}for(var x=new Array(y.length+d.length-2),A=0,c=0,k=d.length;c0;--I)x[A++]=y[I];return x}}),3105:(function(t,r){"use restrict";var a=32;r.INT_BITS=a,r.INT_MAX=2147483647,r.INT_MIN=-1<0)-(s<0)},r.abs=function(s){var o=s>>a-1;return(s^o)-o},r.min=function(s,o){return o^(s^o)&-(s65535)<<4,s>>>=o,c=(s>255)<<3,s>>>=c,o|=c,c=(s>15)<<2,s>>>=c,o|=c,c=(s>3)<<1,s>>>=c,o|=c,o|s>>1},r.log10=function(s){return s>=1e9?9:s>=1e8?8:s>=1e7?7:s>=1e6?6:s>=1e5?5:s>=1e4?4:s>=1e3?3:s>=100?2:s>=10?1:0},r.popCount=function(s){return s=s-(s>>>1&1431655765),s=(s&858993459)+(s>>>2&858993459),(s+(s>>>4)&252645135)*16843009>>>24};function l(s){var o=32;return s&=-s,s&&o--,s&65535&&(o-=16),s&16711935&&(o-=8),s&252645135&&(o-=4),s&858993459&&(o-=2),s&1431655765&&(o-=1),o}r.countTrailingZeros=l,r.nextPow2=function(s){return s+=s===0,--s,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1},r.prevPow2=function(s){return s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s-(s>>>1)},r.parity=function(s){return s^=s>>>16,s^=s>>>8,s^=s>>>4,s&=15,27030>>>s&1};var i=new Array(256);(function(s){for(var o=0;o<256;++o){var c=o,p=o,d=7;for(c>>>=1;c;c>>>=1)p<<=1,p|=c&1,--d;s[o]=p<>>8&255]<<16|i[s>>>16&255]<<8|i[s>>>24&255]},r.interleave2=function(s,o){return s&=65535,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,s|o<<1},r.deinterleave2=function(s,o){return s=s>>>o&1431655765,s=(s|s>>>1)&858993459,s=(s|s>>>2)&252645135,s=(s|s>>>4)&16711935,s=(s|s>>>16)&65535,s<<16>>16},r.interleave3=function(s,o,c){return s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,s|=o<<1,c&=1023,c=(c|c<<16)&4278190335,c=(c|c<<8)&251719695,c=(c|c<<4)&3272356035,c=(c|c<<2)&1227133513,s|c<<2},r.deinterleave3=function(s,o){return s=s>>>o&1227133513,s=(s|s>>>2)&3272356035,s=(s|s>>>4)&251719695,s=(s|s>>>8)&4278190335,s=(s|s>>>16)&1023,s<<22>>22},r.nextCombination=function(s){var o=s|s-1;return o+1|(~o&-~o)-1>>>l(s)+1}}),3126:(function(t){t.exports=r;function r(a){var l=new Float32Array(3);return l[0]=a[0],l[1]=a[1],l[2]=a[2],l}}),3134:(function(t,r,a){t.exports=i;var l=a(1682);function i(s,o){var c=s.length;if(typeof o!="number"){o=0;for(var p=0;p=0}function d(y,g,C,f){var x=l(g,C,f);if(x===0){var A=i(l(y,g,C)),k=i(l(y,g,f));if(A===k){if(A===0){var I=p(y,g,C),T=p(y,g,f);return I===T?0:I?1:-1}return 0}else{if(k===0)return A>0||p(y,g,f)?-1:1;if(A===0)return k>0||p(y,g,C)?1:-1}return i(k-A)}var E=l(y,g,C);if(E>0)return x>0&&l(y,g,f)>0?1:-1;if(E<0)return x>0||l(y,g,f)>0?1:-1;var _=l(y,g,f);return _>0||p(y,g,C)?1:-1}}),3202:(function(t){t.exports=function(a,l){l||(l=[0,""]),a=String(a);var i=parseFloat(a,10);return l[0]=i,l[1]=a.match(/[\d.\-\+]*\s*(.*)/)[1]||"",l}}),3233:(function(t){var r="",a;t.exports=l;function l(i,s){if(typeof i!="string")throw new TypeError("expected a string");if(s===1)return i;if(s===2)return i+i;var o=i.length*s;if(a!==i||typeof a>"u")a=i,r="";else if(r.length>=o)return r.substr(0,o);for(;o>r.length&&s>1;)s&1&&(r+=i),s>>=1,i+=i;return r+=i,r=r.substr(0,o),r}}),3236:(function(t){t.exports=function(r){typeof r=="string"&&(r=[r]);for(var a=[].slice.call(arguments,1),l=[],i=0;i0){if(U<=0)return V;G=z+U}else if(z<0){if(U>=0)return V;G=-(z+U)}else return V;var j=d*G;return V>=j||V<=-j?V:A(m,w,F)},function(m,w,F,z){var U=m[0]-z[0],V=w[0]-z[0],G=F[0]-z[0],j=m[1]-z[1],O=w[1]-z[1],H=F[1]-z[1],W=m[2]-z[2],ee=w[2]-z[2],ue=F[2]-z[2],xe=V*H,ge=G*O,_e=G*j,Y=U*H,se=U*O,ce=V*j,ne=W*(xe-ge)+ee*(_e-Y)+ue*(se-ce),ye=(Math.abs(xe)+Math.abs(ge))*Math.abs(W)+(Math.abs(_e)+Math.abs(Y))*Math.abs(ee)+(Math.abs(se)+Math.abs(ce))*Math.abs(ue),le=y*ye;return ne>le||-ne>le?ne:k(m,w,F,z)}];function T(h){var m=I[h.length];return m||(m=I[h.length]=x(h.length)),m.apply(void 0,h)}function E(h,m,w,F,z,U,V){return function(j,O,H,W,ee){switch(arguments.length){case 0:case 1:return 0;case 2:return F(j,O);case 3:return z(j,O,H);case 4:return U(j,O,H,W);case 5:return V(j,O,H,W,ee)}for(var ue=new Array(arguments.length),xe=0;xe4)throw new i("","Invalid data type");switch(W.charAt(0)){case"b":case"i":p["uniform"+ee+"iv"](g[U],V);break;case"v":p["uniform"+ee+"fv"](g[U],V);break;default:throw new i("","Unrecognized data type for vector "+name+": "+W)}}else if(W.indexOf("mat")===0&&W.length===4){if(ee=W.charCodeAt(W.length-1)-48,ee<2||ee>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+W);p["uniformMatrix"+ee+"fv"](g[U],!1,V);break}else throw new i("","Unknown uniform data type for "+name+": "+W)}}}}}function x(E,_){if(typeof _!="object")return[[E,_]];var h=[];for(var m in _){var w=_[m],F=E;parseInt(m)+""===m?F+="["+m+"]":F+="."+m,typeof w=="object"?h.push.apply(h,x(F,w)):h.push([F,w])}return h}function A(E){switch(E){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var _=E.indexOf("vec");if(0<=_&&_<=1&&E.length===4+_){var h=E.charCodeAt(E.length-1)-48;if(h<2||h>4)throw new i("","Invalid data type");return E.charAt(0)==="b"?o(h,!1):o(h,0)}else if(E.indexOf("mat")===0&&E.length===4){var h=E.charCodeAt(E.length-1)-48;if(h<2||h>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+E);return o(h*h,0)}else throw new i("","Unknown uniform data type for "+name+": "+E)}}function k(E,_,h){if(typeof h=="object"){var m=I(h);Object.defineProperty(E,_,{get:s(m),set:f(h),enumerable:!0,configurable:!1})}else g[h]?Object.defineProperty(E,_,{get:C(h),set:f(h),enumerable:!0,configurable:!1}):E[_]=A(y[h].type)}function I(E){var _;if(Array.isArray(E)){_=new Array(E.length);for(var h=0;h=0!=_>=0&&g.push(A[0]+.5+.5*(E+_)/(E-_))}y+=T,++A[0]}}}function a(){return r()}var l=a;function i(c){var p={};return function(y,g,C){var f=y.dtype,x=y.order,A=[f,x.join()].join(),k=p[A];return k||(p[A]=k=c([f,x])),k(y.shape.slice(0),y.data,y.stride,y.offset|0,g,C)}}function s(c){return i(l.bind(void 0,c))}function o(c){return s({funcName:c.funcName})}t.exports=o({funcName:"zeroCrossings"})}),3352:(function(t,r,a){var l=a(2478),i=0,s=1,o=2;t.exports=m;function c(w,F,z,U,V){this.mid=w,this.left=F,this.right=z,this.leftPoints=U,this.rightPoints=V,this.count=(F?F.count:0)+(z?z.count:0)+U.length}var p=c.prototype;function d(w,F){w.mid=F.mid,w.left=F.left,w.right=F.right,w.leftPoints=F.leftPoints,w.rightPoints=F.rightPoints,w.count=F.count}function y(w,F){var z=E(F);w.mid=z.mid,w.left=z.left,w.right=z.right,w.leftPoints=z.leftPoints,w.rightPoints=z.rightPoints,w.count=z.count}function g(w,F){var z=w.intervals([]);z.push(F),y(w,z)}function C(w,F){var z=w.intervals([]),U=z.indexOf(F);return U<0?i:(z.splice(U,1),y(w,z),s)}p.intervals=function(w){return w.push.apply(w,this.leftPoints),this.left&&this.left.intervals(w),this.right&&this.right.intervals(w),w},p.insert=function(w){var F=this.count-this.leftPoints.length;if(this.count+=1,w[1]3*(F+1)?g(this,w):this.left.insert(w):this.left=E([w]);else if(w[0]>this.mid)this.right?4*(this.right.count+1)>3*(F+1)?g(this,w):this.right.insert(w):this.right=E([w]);else{var z=l.ge(this.leftPoints,w,I),U=l.ge(this.rightPoints,w,T);this.leftPoints.splice(z,0,w),this.rightPoints.splice(U,0,w)}},p.remove=function(w){var F=this.count-this.leftPoints;if(w[1]3*(F-1))return C(this,w);var U=this.left.remove(w);return U===o?(this.left=null,this.count-=1,s):(U===s&&(this.count-=1),U)}else if(w[0]>this.mid){if(!this.right)return i;var V=this.left?this.left.count:0;if(4*V>3*(F-1))return C(this,w);var U=this.right.remove(w);return U===o?(this.right=null,this.count-=1,s):(U===s&&(this.count-=1),U)}else{if(this.count===1)return this.leftPoints[0]===w?o:i;if(this.leftPoints.length===1&&this.leftPoints[0]===w){if(this.left&&this.right){for(var G=this,j=this.left;j.right;)G=j,j=j.right;if(G===this)j.right=this.right;else{var O=this.left,U=this.right;G.count-=j.count,G.right=j.left,j.left=O,j.right=U}d(this,j),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?d(this,this.left):d(this,this.right);return s}for(var O=l.ge(this.leftPoints,w,I);O=0&&w[U][1]>=F;--U){var V=z(w[U]);if(V)return V}}function A(w,F){for(var z=0;zthis.mid){if(this.right){var z=this.right.queryPoint(w,F);if(z)return z}return x(this.rightPoints,w,F)}else return A(this.leftPoints,F)},p.queryInterval=function(w,F,z){if(wthis.mid&&this.right){var U=this.right.queryInterval(w,F,z);if(U)return U}return Fthis.mid?x(this.rightPoints,w,z):A(this.leftPoints,z)};function k(w,F){return w-F}function I(w,F){var z=w[0]-F[0];return z||w[1]-F[1]}function T(w,F){var z=w[1]-F[1];return z||w[0]-F[0]}function E(w){if(w.length===0)return null;for(var F=[],z=0;z>1],V=[],G=[],j=[],z=0;z=0),T.type){case"b":x=parseInt(x,10).toString(2);break;case"c":x=String.fromCharCode(parseInt(x,10));break;case"d":case"i":x=parseInt(x,10);break;case"j":x=JSON.stringify(x,null,T.width?parseInt(T.width):0);break;case"e":x=T.precision?parseFloat(x).toExponential(T.precision):parseFloat(x).toExponential();break;case"f":x=T.precision?parseFloat(x).toFixed(T.precision):parseFloat(x);break;case"g":x=T.precision?String(Number(x.toPrecision(T.precision))):parseFloat(x);break;case"o":x=(parseInt(x,10)>>>0).toString(8);break;case"s":x=String(x),x=T.precision?x.substring(0,T.precision):x;break;case"t":x=String(!!x),x=T.precision?x.substring(0,T.precision):x;break;case"T":x=Object.prototype.toString.call(x).slice(8,-1).toLowerCase(),x=T.precision?x.substring(0,T.precision):x;break;case"u":x=parseInt(x,10)>>>0;break;case"v":x=x.valueOf(),x=T.precision?x.substring(0,T.precision):x;break;case"x":x=(parseInt(x,10)>>>0).toString(16);break;case"X":x=(parseInt(x,10)>>>0).toString(16).toUpperCase();break}i.json.test(T.type)?A+=x:(i.number.test(T.type)&&(!m||T.sign)?(w=m?"+":"-",x=x.toString().replace(i.sign,"")):w="",_=T.pad_char?T.pad_char==="0"?"0":T.pad_char.charAt(1):" ",h=T.width-(w+x).length,E=T.width&&h>0?_.repeat(h):"",A+=T.align?w+x+E:_==="0"?w+E+x:E+w+x)}return A}var p=Object.create(null);function d(y){if(p[y])return p[y];for(var g=y,C,f=[],x=0;g;){if((C=i.text.exec(g))!==null)f.push(C[0]);else if((C=i.modulo.exec(g))!==null)f.push("%");else if((C=i.placeholder.exec(g))!==null){if(C[2]){x|=1;var A=[],k=C[2],I=[];if((I=i.key.exec(k))!==null)for(A.push(I[1]);(k=k.substring(I[0].length))!=="";)if((I=i.key_access.exec(k))!==null)A.push(I[1]);else if((I=i.index_access.exec(k))!==null)A.push(I[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");C[2]=A}else x|=2;if(x===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");f.push({placeholder:C[0],param_no:C[1],keys:C[2],sign:C[3],pad_char:C[4],align:C[5],width:C[6],precision:C[7],type:C[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");g=g.substring(C[0].length)}return p[y]=f}r.sprintf=s,r.vsprintf=o,typeof window<"u"&&(window.sprintf=s,window.vsprintf=o,l=(function(){return{sprintf:s,vsprintf:o}}).call(r,a,r,t),l!==void 0&&(t.exports=l))})()}),3390:(function(t){t.exports=r;function r(a,l,i,s){var o=new Float32Array(4);return o[0]=a,o[1]=l,o[2]=i,o[3]=s,o}}),3436:(function(t,r,a){var l=a(3236),i=a(9405),s=l([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position, offset; +attribute vec4 color; +uniform mat4 model, view, projection; +uniform float capSize; +varying vec4 fragColor; +varying vec3 fragPosition; + +void main() { + vec4 worldPosition = model * vec4(position, 1.0); + worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0); + gl_Position = projection * (view * worldPosition); + fragColor = color; + fragPosition = position; +}`]),o=l([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float opacity; +varying vec3 fragPosition; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], fragPosition) || + fragColor.a * opacity == 0. + ) discard; + + gl_FragColor = opacity * fragColor; +}`]);t.exports=function(c){return i(c,s,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}}),3502:(function(t,r,a){t.exports=s;var l=a(5995),i=a(9127);function s(o,c){return i(l(o,c))}}),3508:(function(t,r,a){var l=a(6852);l=l.slice().filter(function(i){return!/^(gl\_|texture)/.test(i)}),t.exports=l.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"])}),3536:(function(t){t.exports=r;function r(a,l){var i=l[0],s=l[1],o=l[2],c=i*i+s*s+o*o;return c>0&&(c=1/Math.sqrt(c),a[0]=l[0]*c,a[1]=l[1]*c,a[2]=l[2]*c),a}}),3545:(function(t,r,a){t.exports=c;var l=a(8105),i=l("loy&&C[E+d]>I;--T,E-=x){for(var _=E,h=E+x,m=0;m>>1,I=2*p,T=k,E=C[I*k+d];x=F?(T=w,E=F):m>=U?(T=h,E=m):(T=z,E=U):F>=U?(T=w,E=F):U>=m?(T=h,E=m):(T=z,E=U);for(var j=I*(A-1),O=I*T,V=0;Vthis.buffer.length){i.free(this.buffer);for(var A=this.buffer=i.mallocUint8(o(x*f*4)),k=0;kT|0},vertex:function(A,k,I,T,E,_,h,m,w,F,z,U,V){var G=(h<<0)+(m<<1)+(w<<2)+(F<<3)|0;if(!(G===0||G===15))switch(G){case 0:z.push([A-.5,k-.5]);break;case 1:z.push([A-.25-.25*(T+I-2*V)/(I-T),k-.25-.25*(E+I-2*V)/(I-E)]);break;case 2:z.push([A-.75-.25*(-T-I+2*V)/(T-I),k-.25-.25*(_+T-2*V)/(T-_)]);break;case 3:z.push([A-.5,k-.5-.5*(E+I+_+T-4*V)/(I-E+T-_)]);break;case 4:z.push([A-.25-.25*(_+E-2*V)/(E-_),k-.75-.25*(-E-I+2*V)/(E-I)]);break;case 5:z.push([A-.5-.5*(T+I+_+E-4*V)/(I-T+E-_),k-.5]);break;case 6:z.push([A-.5-.25*(-T-I+_+E)/(T-I+E-_),k-.5-.25*(-E-I+_+T)/(E-I+T-_)]);break;case 7:z.push([A-.75-.25*(_+E-2*V)/(E-_),k-.75-.25*(_+T-2*V)/(T-_)]);break;case 8:z.push([A-.75-.25*(-_-E+2*V)/(_-E),k-.75-.25*(-_-T+2*V)/(_-T)]);break;case 9:z.push([A-.5-.25*(T+I+-_-E)/(I-T+_-E),k-.5-.25*(E+I+-_-T)/(I-E+_-T)]);break;case 10:z.push([A-.5-.5*(-T-I+-_-E+4*V)/(T-I+_-E),k-.5]);break;case 11:z.push([A-.25-.25*(-_-E+2*V)/(_-E),k-.75-.25*(E+I-2*V)/(I-E)]);break;case 12:z.push([A-.5,k-.5-.5*(-E-I+-_-T+4*V)/(E-I+_-T)]);break;case 13:z.push([A-.75-.25*(T+I-2*V)/(I-T),k-.25-.25*(-_-T+2*V)/(_-T)]);break;case 14:z.push([A-.25-.25*(-T-I+2*V)/(T-I),k-.25-.25*(-E-I+2*V)/(E-I)]);break;case 15:z.push([A-.5,k-.5]);break}},cell:function(A,k,I,T,E,_,h,m,w){E?m.push([A,k]):m.push([k,A])}});return function(x,A){var k=[],I=[];return f(x,k,I,A),{positions:k,cells:I}}}};function o(y,g){var C=y.length+"d",f=s[C];if(f)return f(l,y,g)}function c(y,g){for(var C=i(y,g),f=C.length,x=new Array(f),A=new Array(f),k=0;k>1,C=-7,f=i?o-1:0,x=i?-1:1,A=a[l+f];for(f+=x,c=A&(1<<-C)-1,A>>=-C,C+=d;C>0;c=c*256+a[l+f],f+=x,C-=8);for(p=c&(1<<-C)-1,c>>=-C,C+=s;C>0;p=p*256+a[l+f],f+=x,C-=8);if(c===0)c=1-g;else{if(c===y)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,s),c=c-g}return(A?-1:1)*p*Math.pow(2,c-s)},r.write=function(a,l,i,s,o,c){var p,d,y,g=c*8-o-1,C=(1<>1,x=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=s?0:c-1,k=s?1:-1,I=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(d=isNaN(l)?1:0,p=C):(p=Math.floor(Math.log(l)/Math.LN2),l*(y=Math.pow(2,-p))<1&&(p--,y*=2),p+f>=1?l+=x/y:l+=x*Math.pow(2,1-f),l*y>=2&&(p++,y/=2),p+f>=C?(d=0,p=C):p+f>=1?(d=(l*y-1)*Math.pow(2,o),p=p+f):(d=l*Math.pow(2,f-1)*Math.pow(2,o),p=0));o>=8;a[i+A]=d&255,A+=k,d/=256,o-=8);for(p=p<0;a[i+A]=p&255,A+=k,p/=256,g-=8);a[i+A-k]|=I*128}}),3788:(function(t,r,a){var l=a(8507),i=a(2419);t.exports=s;function s(o,c){return l(o,c)||i(o)-i(c)}}),3837:(function(t,r,a){t.exports=z;var l=a(4935),i=a(501),s=a(5304),o=a(6429),c=a(6444),p=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=ArrayBuffer,y=DataView;function g(U){return d.isView(U)&&!(U instanceof y)}function C(U){return Array.isArray(U)||g(U)}function f(U,V){return U[0]=V[0],U[1]=V[1],U[2]=V[2],U}function x(U){this.gl=U,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.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],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","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],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=s(U)}var A=x.prototype;A.update=function(U){U=U||{};function V(ne,ye,le){if(le in U){var Z=U[le],de=this[le],pe;(ne?C(Z)&&C(Z[0]):C(Z))?this[le]=pe=[ye(Z[0]),ye(Z[1]),ye(Z[2])]:this[le]=pe=[ye(Z),ye(Z),ye(Z)];for(var Te=0;Te<3;++Te)if(pe[Te]!==de[Te])return!0}return!1}var G=V.bind(this,!1,Number),j=V.bind(this,!1,Boolean),O=V.bind(this,!1,String),H=V.bind(this,!0,function(ne){if(C(ne)){if(ne.length===3)return[+ne[0],+ne[1],+ne[2],1];if(ne.length===4)return[+ne[0],+ne[1],+ne[2],+ne[3]]}return[0,0,0,1]}),W,ee=!1,ue=!1;if("bounds"in U)for(var xe=U.bounds,ge=0;ge<2;++ge)for(var _e=0;_e<3;++_e)xe[ge][_e]!==this.bounds[ge][_e]&&(ue=!0),this.bounds[ge][_e]=xe[ge][_e];if("ticks"in U){W=U.ticks,ee=!0,this.autoTicks=!1;for(var ge=0;ge<3;++ge)this.tickSpacing[ge]=0}else G("tickSpacing")&&(this.autoTicks=!0,ue=!0);if(this._firstInit&&("ticks"in U||"tickSpacing"in U||(this.autoTicks=!0),ue=!0,ee=!0,this._firstInit=!1),ue&&this.autoTicks&&(W=c.create(this.bounds,this.tickSpacing),ee=!0),ee){for(var ge=0;ge<3;++ge)W[ge].sort(function(ye,le){return ye.x-le.x});c.equal(W,this.ticks)?ee=!1:this.ticks=W}j("tickEnable"),O("tickFont")&&(ee=!0),O("tickFontStyle")&&(ee=!0),O("tickFontWeight")&&(ee=!0),O("tickFontVariant")&&(ee=!0),G("tickSize"),G("tickAngle"),G("tickPad"),H("tickColor");var Y=O("labels");O("labelFont")&&(Y=!0),O("labelFontStyle")&&(Y=!0),O("labelFontWeight")&&(Y=!0),O("labelFontVariant")&&(Y=!0),j("labelEnable"),G("labelSize"),G("labelPad"),H("labelColor"),j("lineEnable"),j("lineMirror"),G("lineWidth"),H("lineColor"),j("lineTickEnable"),j("lineTickMirror"),G("lineTickLength"),G("lineTickWidth"),H("lineTickColor"),j("gridEnable"),G("gridWidth"),H("gridColor"),j("zeroEnable"),H("zeroLineColor"),G("zeroLineWidth"),j("backgroundEnable"),H("backgroundColor");var se=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],ce=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(Y||ee)&&this._text.update(this.bounds,this.labels,se,this.ticks,ce):this._text=l(this.gl,this.bounds,this.labels,se,this.ticks,ce),this._lines&&ee&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};function k(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var I=[new k,new k,new k];function T(U,V,G,j,O){for(var H=U.primalOffset,W=U.primalMinor,ee=U.mirrorOffset,ue=U.mirrorMinor,xe=j[V],ge=0;ge<3;++ge)if(V!==ge){var _e=H,Y=ee,se=W,ce=ue;xe&1<0?(se[ge]=-1,ce[ge]=0):(se[ge]=0,ce[ge]=1)}}var E=[0,0,0],_={model:p,view:p,projection:p,_ortho:!1};A.isOpaque=function(){return!0},A.isTransparent=function(){return!1},A.drawTransparent=function(U){};var h=0,m=[0,0,0],w=[0,0,0],F=[0,0,0];A.draw=function(U){U=U||_;for(var le=this.gl,V=U.model||p,G=U.view||p,j=U.projection||p,O=this.bounds,H=U._ortho||!1,W=o(V,G,j,O,H),ee=W.cubeEdges,ue=W.axis,xe=G[12],ge=G[13],_e=G[14],Y=G[15],se=H?2:1,ce=se*this.pixelRatio*(j[3]*xe+j[7]*ge+j[11]*_e+j[15]*Y)/le.drawingBufferHeight,ne=0;ne<3;++ne)this.lastCubeProps.cubeEdges[ne]=ee[ne],this.lastCubeProps.axis[ne]=ue[ne];for(var ye=I,ne=0;ne<3;++ne)T(I[ne],ne,this.bounds,ee,ue);for(var le=this.gl,Z=E,ne=0;ne<3;++ne)this.backgroundEnable[ne]?Z[ne]=ue[ne]:Z[ne]=0;this._background.draw(V,G,j,O,Z,this.backgroundColor),this._lines.bind(V,G,j,this);for(var ne=0;ne<3;++ne){var de=[0,0,0];ue[ne]>0?de[ne]=O[1][ne]:de[ne]=O[0][ne];for(var pe=0;pe<2;++pe){var Te=(ne+1+pe)%3,Ne=(ne+1+(pe^1))%3;this.gridEnable[Te]&&this._lines.drawGrid(Te,Ne,this.bounds,de,this.gridColor[Te],this.gridWidth[Te]*this.pixelRatio)}for(var pe=0;pe<2;++pe){var Te=(ne+1+pe)%3,Ne=(ne+1+(pe^1))%3;this.zeroEnable[Ne]&&Math.min(O[0][Ne],O[1][Ne])<=0&&Math.max(O[0][Ne],O[1][Ne])>=0&&this._lines.drawZero(Te,Ne,this.bounds,de,this.zeroLineColor[Ne],this.zeroLineWidth[Ne]*this.pixelRatio)}}for(var ne=0;ne<3;++ne){this.lineEnable[ne]&&this._lines.drawAxisLine(ne,this.bounds,ye[ne].primalOffset,this.lineColor[ne],this.lineWidth[ne]*this.pixelRatio),this.lineMirror[ne]&&this._lines.drawAxisLine(ne,this.bounds,ye[ne].mirrorOffset,this.lineColor[ne],this.lineWidth[ne]*this.pixelRatio);for(var $e=f(m,ye[ne].primalMinor),Ze=f(w,ye[ne].mirrorMinor),Xe=this.lineTickLength,pe=0;pe<3;++pe){var it=ce/V[5*pe];$e[pe]*=Xe[pe]*it,Ze[pe]*=Xe[pe]*it}this.lineTickEnable[ne]&&this._lines.drawAxisTicks(ne,ye[ne].primalOffset,$e,this.lineTickColor[ne],this.lineTickWidth[ne]*this.pixelRatio),this.lineTickMirror[ne]&&this._lines.drawAxisTicks(ne,ye[ne].mirrorOffset,Ze,this.lineTickColor[ne],this.lineTickWidth[ne]*this.pixelRatio)}this._lines.unbind(),this._text.bind(V,G,j,this.pixelRatio);var yt,bt=.5,mt,ht;function Ve(vt){ht=[0,0,0],ht[vt]=1}function ze(vt,Kt,Qt){var fr=(vt+1)%3,mr=(vt+2)%3,Ur=Kt[fr],Br=Kt[mr],fn=Qt[fr],Fr=Qt[mr];if(Ur>0&&Fr>0){Ve(fr);return}else if(Ur>0&&Fr<0){Ve(fr);return}else if(Ur<0&&Fr>0){Ve(fr);return}else if(Ur<0&&Fr<0){Ve(fr);return}else if(Br>0&&fn>0){Ve(mr);return}else if(Br>0&&fn<0){Ve(mr);return}else if(Br<0&&fn>0){Ve(mr);return}else if(Br<0&&fn<0){Ve(mr);return}}for(var ne=0;ne<3;++ne){for(var Se=ye[ne].primalMinor,Je=ye[ne].mirrorMinor,_t=f(F,ye[ne].primalOffset),pe=0;pe<3;++pe)this.lineTickEnable[ne]&&(_t[pe]+=ce*Se[pe]*Math.max(this.lineTickLength[pe],0)/V[5*pe]);var At=[0,0,0];if(At[ne]=1,this.tickEnable[ne]){this.tickAngle[ne]===-3600?(this.tickAngle[ne]=0,this.tickAlign[ne]="auto"):this.tickAlign[ne]=-1,mt=1,yt=[this.tickAlign[ne],bt,mt],yt[0]==="auto"?yt[0]=h:yt[0]=parseInt(""+yt[0]),ht=[0,0,0],ze(ne,Se,Je);for(var pe=0;pe<3;++pe)_t[pe]+=ce*Se[pe]*this.tickPad[pe]/V[5*pe];this._text.drawTicks(ne,this.tickSize[ne],this.tickAngle[ne],_t,this.tickColor[ne],At,ht,yt)}if(this.labelEnable[ne]){mt=0,ht=[0,0,0],this.labels[ne].length>4&&(Ve(ne),mt=1),yt=[this.labelAlign[ne],bt,mt],yt[0]==="auto"?yt[0]=h:yt[0]=parseInt(""+yt[0]);for(var pe=0;pe<3;++pe)_t[pe]+=ce*Se[pe]*this.labelPad[pe]/V[5*pe];_t[ne]+=.5*(O[0][ne]+O[1][ne]),this._text.drawLabel(ne,this.labelSize[ne],this.labelAngle[ne],_t,this.labelColor[ne],[0,0,0],ht,yt)}}this._text.unbind()},A.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function z(U,V){var G=new x(U);return G.update(V),G}}),3840:(function(t){t.exports=I;var r=0,a=1;function l(T,E,_,h,m,w){this._color=T,this.key=E,this.value=_,this.left=h,this.right=m,this._count=w}function i(T){return new l(T._color,T.key,T.value,T.left,T.right,T._count)}function s(T,E){return new l(T,E.key,E.value,E.left,E.right,E._count)}function o(T){T._count=1+(T.left?T.left._count:0)+(T.right?T.right._count:0)}function c(T,E){this._compare=T,this.root=E}var p=c.prototype;Object.defineProperty(p,"keys",{get:function(){var T=[];return this.forEach(function(E,_){T.push(E)}),T}}),Object.defineProperty(p,"values",{get:function(){var T=[];return this.forEach(function(E,_){T.push(_)}),T}}),Object.defineProperty(p,"length",{get:function(){return this.root?this.root._count:0}}),p.insert=function(T,E){for(var _=this._compare,h=this.root,m=[],w=[];h;){var F=_(T,h.key);m.push(h),w.push(F),F<=0?h=h.left:h=h.right}m.push(new l(r,T,E,null,null,1));for(var z=m.length-2;z>=0;--z){var h=m[z];w[z]<=0?m[z]=new l(h._color,h.key,h.value,m[z+1],h.right,h._count+1):m[z]=new l(h._color,h.key,h.value,h.left,m[z+1],h._count+1)}for(var z=m.length-1;z>1;--z){var U=m[z-1],h=m[z];if(U._color===a||h._color===a)break;var V=m[z-2];if(V.left===U)if(U.left===h){var G=V.right;if(G&&G._color===r)U._color=a,V.right=s(a,G),V._color=r,z-=1;else{if(V._color=r,V.left=U.right,U._color=a,U.right=V,m[z-2]=U,m[z-1]=h,o(V),o(U),z>=3){var j=m[z-3];j.left===V?j.left=U:j.right=U}break}}else{var G=V.right;if(G&&G._color===r)U._color=a,V.right=s(a,G),V._color=r,z-=1;else{if(U.right=h.left,V._color=r,V.left=h.right,h._color=a,h.left=U,h.right=V,m[z-2]=h,m[z-1]=U,o(V),o(U),o(h),z>=3){var j=m[z-3];j.left===V?j.left=h:j.right=h}break}}else if(U.right===h){var G=V.left;if(G&&G._color===r)U._color=a,V.left=s(a,G),V._color=r,z-=1;else{if(V._color=r,V.right=U.left,U._color=a,U.left=V,m[z-2]=U,m[z-1]=h,o(V),o(U),z>=3){var j=m[z-3];j.right===V?j.right=U:j.left=U}break}}else{var G=V.left;if(G&&G._color===r)U._color=a,V.left=s(a,G),V._color=r,z-=1;else{if(U.left=h.right,V._color=r,V.right=h.left,h._color=a,h.right=U,h.left=V,m[z-2]=h,m[z-1]=U,o(V),o(U),o(h),z>=3){var j=m[z-3];j.right===V?j.right=h:j.left=h}break}}}return m[0]._color=a,new c(_,m[0])};function d(T,E){if(E.left){var _=d(T,E.left);if(_)return _}var _=T(E.key,E.value);if(_)return _;if(E.right)return d(T,E.right)}function y(T,E,_,h){var m=E(T,h.key);if(m<=0){if(h.left){var w=y(T,E,_,h.left);if(w)return w}var w=_(h.key,h.value);if(w)return w}if(h.right)return y(T,E,_,h.right)}function g(T,E,_,h,m){var w=_(T,m.key),F=_(E,m.key),z;if(w<=0&&(m.left&&(z=g(T,E,_,h,m.left),z)||F>0&&(z=h(m.key,m.value),z)))return z;if(F>0&&m.right)return g(T,E,_,h,m.right)}p.forEach=function(E,_,h){if(this.root)switch(arguments.length){case 1:return d(E,this.root);case 2:return y(_,this._compare,E,this.root);case 3:return this._compare(_,h)>=0?void 0:g(_,h,this._compare,E,this.root)}},Object.defineProperty(p,"begin",{get:function(){for(var T=[],E=this.root;E;)T.push(E),E=E.left;return new C(this,T)}}),Object.defineProperty(p,"end",{get:function(){for(var T=[],E=this.root;E;)T.push(E),E=E.right;return new C(this,T)}}),p.at=function(T){if(T<0)return new C(this,[]);for(var E=this.root,_=[];;){if(_.push(E),E.left){if(T=E.right._count)break;E=E.right}else break}return new C(this,[])},p.ge=function(T){for(var E=this._compare,_=this.root,h=[],m=0;_;){var w=E(T,_.key);h.push(_),w<=0&&(m=h.length),w<=0?_=_.left:_=_.right}return h.length=m,new C(this,h)},p.gt=function(T){for(var E=this._compare,_=this.root,h=[],m=0;_;){var w=E(T,_.key);h.push(_),w<0&&(m=h.length),w<0?_=_.left:_=_.right}return h.length=m,new C(this,h)},p.lt=function(T){for(var E=this._compare,_=this.root,h=[],m=0;_;){var w=E(T,_.key);h.push(_),w>0&&(m=h.length),w<=0?_=_.left:_=_.right}return h.length=m,new C(this,h)},p.le=function(T){for(var E=this._compare,_=this.root,h=[],m=0;_;){var w=E(T,_.key);h.push(_),w>=0&&(m=h.length),w<0?_=_.left:_=_.right}return h.length=m,new C(this,h)},p.find=function(T){for(var E=this._compare,_=this.root,h=[];_;){var m=E(T,_.key);if(h.push(_),m===0)return new C(this,h);m<=0?_=_.left:_=_.right}return new C(this,[])},p.remove=function(T){var E=this.find(T);return E?E.remove():this},p.get=function(T){for(var E=this._compare,_=this.root;_;){var h=E(T,_.key);if(h===0)return _.value;h<=0?_=_.left:_=_.right}};function C(T,E){this.tree=T,this._stack=E}var f=C.prototype;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())};function x(T,E){T.key=E.key,T.value=E.value,T.left=E.left,T.right=E.right,T._color=E._color,T._count=E._count}function A(T){for(var E,_,h,m,w=T.length-1;w>=0;--w){if(E=T[w],w===0){E._color=a;return}if(_=T[w-1],_.left===E){if(h=_.right,h.right&&h.right._color===r){if(h=_.right=i(h),m=h.right=i(h.right),_.right=h.left,h.left=_,h.right=m,h._color=_._color,E._color=a,_._color=a,m._color=a,o(_),o(h),w>1){var F=T[w-2];F.left===_?F.left=h:F.right=h}T[w-1]=h;return}else if(h.left&&h.left._color===r){if(h=_.right=i(h),m=h.left=i(h.left),_.right=m.left,h.left=m.right,m.left=_,m.right=h,m._color=_._color,_._color=a,h._color=a,E._color=a,o(_),o(h),o(m),w>1){var F=T[w-2];F.left===_?F.left=m:F.right=m}T[w-1]=m;return}if(h._color===a)if(_._color===r){_._color=a,_.right=s(r,h);return}else{_.right=s(r,h);continue}else{if(h=i(h),_.right=h.left,h.left=_,h._color=_._color,_._color=r,o(_),o(h),w>1){var F=T[w-2];F.left===_?F.left=h:F.right=h}T[w-1]=h,T[w]=_,w+11){var F=T[w-2];F.right===_?F.right=h:F.left=h}T[w-1]=h;return}else if(h.right&&h.right._color===r){if(h=_.left=i(h),m=h.right=i(h.right),_.left=m.right,h.right=m.left,m.right=_,m.left=h,m._color=_._color,_._color=a,h._color=a,E._color=a,o(_),o(h),o(m),w>1){var F=T[w-2];F.right===_?F.right=m:F.left=m}T[w-1]=m;return}if(h._color===a)if(_._color===r){_._color=a,_.left=s(r,h);return}else{_.left=s(r,h);continue}else{if(h=i(h),_.left=h.right,h.right=_,h._color=_._color,_._color=r,o(_),o(h),w>1){var F=T[w-2];F.right===_?F.right=h:F.left=h}T[w-1]=h,T[w]=_,w+1=0;--h){var _=T[h];_.left===T[h+1]?E[h]=new l(_._color,_.key,_.value,E[h+1],_.right,_._count):E[h]=new l(_._color,_.key,_.value,_.left,E[h+1],_._count)}if(_=E[E.length-1],_.left&&_.right){var m=E.length;for(_=_.left;_.right;)E.push(_),_=_.right;var w=E[m-1];E.push(new l(_._color,w.key,w.value,_.left,_.right,_._count)),E[m-1].key=_.key,E[m-1].value=_.value;for(var h=E.length-2;h>=m;--h)_=E[h],E[h]=new l(_._color,_.key,_.value,_.left,E[h+1],_._count);E[m-1].left=E[m]}if(_=E[E.length-1],_._color===r){var F=E[E.length-2];F.left===_?F.left=null:F.right===_&&(F.right=null),E.pop();for(var h=0;h0)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 T=0,E=this._stack;if(E.length===0){var _=this.tree.root;return _?_._count:0}else E[E.length-1].left&&(T=E[E.length-1].left._count);for(var h=E.length-2;h>=0;--h)E[h+1]===E[h].right&&(++T,E[h].left&&(T+=E[h].left._count));return T},enumerable:!0}),f.next=function(){var T=this._stack;if(T.length!==0){var E=T[T.length-1];if(E.right)for(E=E.right;E;)T.push(E),E=E.left;else for(T.pop();T.length>0&&T[T.length-1].right===E;)E=T[T.length-1],T.pop()}},Object.defineProperty(f,"hasNext",{get:function(){var T=this._stack;if(T.length===0)return!1;if(T[T.length-1].right)return!0;for(var E=T.length-1;E>0;--E)if(T[E-1].left===T[E])return!0;return!1}}),f.update=function(T){var E=this._stack;if(E.length===0)throw new Error("Can't update empty node!");var _=new Array(E.length),h=E[E.length-1];_[_.length-1]=new l(h._color,h.key,T,h.left,h.right,h._count);for(var m=E.length-2;m>=0;--m)h=E[m],h.left===E[m+1]?_[m]=new l(h._color,h.key,h.value,_[m+1],h.right,h._count):_[m]=new l(h._color,h.key,h.value,h.left,_[m+1],h._count);return new c(this.tree._compare,_[0])},f.prev=function(){var T=this._stack;if(T.length!==0){var E=T[T.length-1];if(E.left)for(E=E.left;E;)T.push(E),E=E.right;else for(T.pop();T.length>0&&T[T.length-1].left===E;)E=T[T.length-1],T.pop()}},Object.defineProperty(f,"hasPrev",{get:function(){var T=this._stack;if(T.length===0)return!1;if(T[T.length-1].left)return!0;for(var E=T.length-1;E>0;--E)if(T[E-1].right===T[E])return!0;return!1}});function k(T,E){return TE?1:0}function I(T){return new c(T||k,null)}}),3865:(function(t,r,a){var l=a(869);t.exports=i;function i(s,o){return l(s[0].mul(o[1]).add(o[0].mul(s[1])),s[1].mul(o[1]))}}),3952:(function(t,r,a){t.exports=s;var l=a(3250);function i(o,c){for(var p=new Array(c+1),d=0;d20?52:p+32}}),4040:(function(t){t.exports=r;function r(a,l,i,s,o,c,p){var d=1/(l-i),y=1/(s-o),g=1/(c-p);return a[0]=-2*d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*y,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*g,a[11]=0,a[12]=(l+i)*d,a[13]=(o+s)*y,a[14]=(p+c)*g,a[15]=1,a}}),4041:(function(t){t.exports=r;function r(a,l,i){var s=l[0],o=l[1],c=l[2],p=i[0],d=i[1],y=i[2],g=i[3],C=g*s+d*c-y*o,f=g*o+y*s-p*c,x=g*c+p*o-d*s,A=-p*s-d*o-y*c;return a[0]=C*g+A*-p+f*-y-x*-d,a[1]=f*g+A*-d+x*-p-C*-y,a[2]=x*g+A*-y+C*-d-f*-p,a[3]=l[3],a}}),4081:(function(t){t.exports=r;function r(a,l,i,s,o,c,p,d,y,g){var C=l+c+g;if(f>0){var f=Math.sqrt(C+1);a[0]=.5*(p-y)/f,a[1]=.5*(d-s)/f,a[2]=.5*(i-c)/f,a[3]=.5*f}else{var x=Math.max(l,c,g),f=Math.sqrt(2*x-C+1);l>=x?(a[0]=.5*f,a[1]=.5*(o+i)/f,a[2]=.5*(d+s)/f,a[3]=.5*(p-y)/f):c>=x?(a[0]=.5*(i+o)/f,a[1]=.5*f,a[2]=.5*(y+p)/f,a[3]=.5*(d-s)/f):(a[0]=.5*(s+d)/f,a[1]=.5*(p+y)/f,a[2]=.5*f,a[3]=.5*(i-o)/f)}return a}}),4100:(function(t,r,a){var l=a(4437),i=a(3837),s=a(5445),o=a(4449),c=a(3589),p=a(2260),d=a(7169),y=a(351),g=a(4772),C=a(4040),f=a(799),x=a(9216)({tablet:!0,featureDetect:!0});t.exports={createScene:E,createCamera:l};function A(){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 k(h,m){var w=null;try{w=h.getContext("webgl",m),w||(w=h.getContext("experimental-webgl",m))}catch{return null}return w}function I(h){var m=Math.round(Math.log(Math.abs(h))/Math.log(10));if(m<0){var w=Math.round(Math.pow(10,-m));return Math.ceil(h*w)/w}else if(m>0){var w=Math.round(Math.pow(10,m));return Math.ceil(h/w)*w}return Math.ceil(h)}function T(h){return typeof h=="boolean"?h:!0}function E(h){h=h||{},h.camera=h.camera||{};var m=h.canvas;if(!m)if(m=document.createElement("canvas"),h.container){var w=h.container;w.appendChild(m)}else document.body.appendChild(m);var F=h.gl;if(F||(h.glOptions&&(x=!!h.glOptions.preserveDrawingBuffer),F=k(m,h.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:x})),!F)throw new Error("webgl not supported");var z=h.bounds||[[-10,-10,-10],[10,10,10]],U=new A,V=p(F,F.drawingBufferWidth,F.drawingBufferHeight,{preferFloat:!x}),G=f(F),j=h.cameraObject&&h.cameraObject._ortho===!0||h.camera.projection&&h.camera.projection.type==="orthographic"||!1,O={eye:h.camera.eye||[2,0,0],center:h.camera.center||[0,0,0],up:h.camera.up||[0,1,0],zoomMin:h.camera.zoomMax||.1,zoomMax:h.camera.zoomMin||100,mode:h.camera.mode||"turntable",_ortho:j},H=h.axes||{},W=i(F,H);W.enable=!H.disable;var ee=h.spikes||{},ue=o(F,ee),xe=[],ge=[],_e=[],Y=[],se=!0,le=!0,ce=new Array(16),ne=new Array(16),ye={view:null,projection:ce,model:ne,_ortho:!1},le=!0,Z=[F.drawingBufferWidth,F.drawingBufferHeight],de=h.cameraObject||l(m,O),pe={gl:F,contextLost:!1,pixelRatio:h.pixelRatio||1,canvas:m,selection:U,camera:de,axes:W,axesPixels:null,spikes:ue,bounds:z,objects:xe,shape:Z,aspect:h.aspectRatio||[1,1,1],pickRadius:h.pickRadius||10,zNear:h.zNear||.01,zFar:h.zFar||1e3,fovy:h.fovy||Math.PI/4,clearColor:h.clearColor||[0,0,0,0],autoResize:T(h.autoResize),autoBounds:T(h.autoBounds),autoScale:!!h.autoScale,autoCenter:T(h.autoCenter),clipToBounds:T(h.clipToBounds),snapToData:!!h.snapToData,onselect:h.onselect||null,onrender:h.onrender||null,onclick:h.onclick||null,cameraParams:ye,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(ht){this.aspect[0]=ht.x,this.aspect[1]=ht.y,this.aspect[2]=ht.z,le=!0},setBounds:function(ht,Ve){this.bounds[0][ht]=Ve.min,this.bounds[1][ht]=Ve.max},setClearColor:function(ht){this.clearColor=ht},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)}},Te=[F.drawingBufferWidth/pe.pixelRatio|0,F.drawingBufferHeight/pe.pixelRatio|0];function Ne(){if(!pe._stopped&&pe.autoResize){var ht=m.parentNode,Ve=1,ze=1;ht&&ht!==document.body?(Ve=ht.clientWidth,ze=ht.clientHeight):(Ve=window.innerWidth,ze=window.innerHeight);var Se=Math.ceil(Ve*pe.pixelRatio)|0,Je=Math.ceil(ze*pe.pixelRatio)|0;if(Se!==m.width||Je!==m.height){m.width=Se,m.height=Je;var _t=m.style;_t.position=_t.position||"absolute",_t.left="0px",_t.top="0px",_t.width=Ve+"px",_t.height=ze+"px",se=!0}}}pe.autoResize&&Ne(),window.addEventListener("resize",Ne);function $e(){for(var ht=xe.length,Ve=Y.length,ze=0;ze0&&_e[Ve-1]===0;)_e.pop(),Y.pop().dispose()}pe.update=function(ht){pe._stopped||(se=!0,le=!0)},pe.add=function(ht){pe._stopped||(ht.axes=W,xe.push(ht),ge.push(-1),se=!0,le=!0,$e())},pe.remove=function(ht){if(!pe._stopped){var Ve=xe.indexOf(ht);Ve<0||(xe.splice(Ve,1),ge.pop(),se=!0,le=!0,$e())}},pe.dispose=function(){if(!pe._stopped&&(pe._stopped=!0,window.removeEventListener("resize",Ne),m.removeEventListener("webglcontextlost",Ze),pe.mouseListener.enabled=!1,!pe.contextLost)){W.dispose(),ue.dispose();for(var ht=0;htU.distance)continue;for(var Qt=0;Qtg;){var _=f[E-2],h=f[E-1];if(_f[C+1]:!0}function d(g,C,f,x){g*=2;var A=x[g];return A>1,T=I-x,E=I+x,_=A,h=T,m=I,w=E,F=k,z=g+1,U=C-1,V=0;p(_,h,f)&&(V=_,_=h,h=V),p(w,F,f)&&(V=w,w=F,F=V),p(_,m,f)&&(V=_,_=m,m=V),p(h,m,f)&&(V=h,h=m,m=V),p(_,w,f)&&(V=_,_=w,w=V),p(m,w,f)&&(V=m,m=w,w=V),p(h,F,f)&&(V=h,h=F,F=V),p(h,m,f)&&(V=h,h=m,m=V),p(w,F,f)&&(V=w,w=F,F=V);for(var G=f[2*h],j=f[2*h+1],O=f[2*w],H=f[2*w+1],W=2*_,ee=2*m,ue=2*F,xe=2*A,ge=2*I,_e=2*k,Y=0;Y<2;++Y){var se=f[W+Y],ce=f[ee+Y],ne=f[ue+Y];f[xe+Y]=se,f[ge+Y]=ce,f[_e+Y]=ne}s(T,g,f),s(E,C,f);for(var ye=z;ye<=U;++ye)if(d(ye,G,j,f))ye!==z&&i(ye,z,f),++z;else if(!d(ye,O,H,f))for(;;)if(d(U,O,H,f)){d(U,G,j,f)?(o(ye,z,U,f),++z,--U):(i(ye,U,f),--U);break}else{if(--U0)if(A[0]!==I[1][0])k=x,x=x.right;else{var h=y(x.right,A);if(h)return h;x=x.left}else{if(A[0]!==I[1][0])return x;var h=y(x.right,A);if(h)return h;x=x.left}}return k}p.castUp=function(x){var A=l.le(this.coordinates,x[0]);if(A<0)return-1;this.slabs[A];var k=y(this.slabs[A],x),I=-1;if(k&&(I=k.value),this.coordinates[A]===x[0]){var T=null;if(k&&(T=k.key),A>0){var E=y(this.slabs[A-1],x);E&&(T?o(E.key,T)>0&&(T=E.key,I=E.value):(I=E.value,T=E.key))}var _=this.horizontal[A];if(_.length>0){var h=l.ge(_,x[1],d);if(h<_.length){var m=_[h];if(x[1]===m.y){if(m.closed)return m.index;for(;h<_.length-1&&_[h+1].y===x[1];)if(h=h+1,m=_[h],m.closed)return m.index;if(m.y===x[1]&&!m.start){if(h=h+1,h>=_.length)return I;m=_[h]}}if(m.start)if(T){var w=s(T[0],T[1],[x[0],m.y]);T[0][0]>T[1][0]&&(w=-w),w>0&&(I=m.index)}else I=m.index;else m.y!==x[1]&&(I=m.index)}}}return I};function g(x,A,k,I){this.y=x,this.index=A,this.start=k,this.closed=I}function C(x,A,k,I){this.x=x,this.segment=A,this.create=k,this.index=I}function f(x){for(var A=x.length,k=2*A,I=new Array(k),T=0;TMath.abs(h))f.rotate(F,0,0,-_*m*Math.PI*T.rotateSpeed/window.innerWidth);else if(!T._ortho){var z=-T.zoomSpeed*w*h/window.innerHeight*(F-f.lastT())/20;f.pan(F,0,0,A*(Math.exp(z)-1))}}},!0)},T.enableMouseListeners(),T}}),4449:(function(t,r,a){var l=a(2762),i=a(8116),s=a(1493);t.exports=C;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function c(f,x,A,k){this.gl=f,this.buffer=x,this.vao=A,this.shader=k,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var p=c.prototype,d=[0,0,0],y=[0,0,0],g=[0,0];p.isTransparent=function(){return!1},p.drawTransparent=function(f){},p.draw=function(f){var x=this.gl,A=this.vao,k=this.shader;A.bind(),k.bind();var I=f.model||o,T=f.view||o,E=f.projection||o,_;this.axes&&(_=this.axes.lastCubeProps.axis);for(var h=d,m=y,w=0;w<3;++w)_&&_[w]<0?(h[w]=this.bounds[0][w],m[w]=this.bounds[1][w]):(h[w]=this.bounds[1][w],m[w]=this.bounds[0][w]);g[0]=x.drawingBufferWidth,g[1]=x.drawingBufferHeight,k.uniforms.model=I,k.uniforms.view=T,k.uniforms.projection=E,k.uniforms.coordinates=[this.position,h,m],k.uniforms.colors=this.colors,k.uniforms.screenShape=g;for(var w=0;w<3;++w)k.uniforms.lineWidth=this.lineWidth[w]*this.pixelRatio,this.enabled[w]&&(A.draw(x.TRIANGLES,6,6*w),this.drawSides[w]&&A.draw(x.TRIANGLES,12,18+12*w));A.unbind()},p.update=function(f){f&&("bounds"in f&&(this.bounds=f.bounds),"position"in f&&(this.position=f.position),"lineWidth"in f&&(this.lineWidth=f.lineWidth),"colors"in f&&(this.colors=f.colors),"enabled"in f&&(this.enabled=f.enabled),"drawSides"in f&&(this.drawSides=f.drawSides))},p.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function C(f,x){var A=[];function k(h,m,w,F,z,U){var V=[h,m,w,0,0,0,1];V[F+3]=1,V[F]=z,A.push.apply(A,V),V[6]=-1,A.push.apply(A,V),V[F]=U,A.push.apply(A,V),A.push.apply(A,V),V[6]=1,A.push.apply(A,V),V[F]=z,A.push.apply(A,V)}k(0,0,0,0,0,1),k(0,0,0,1,0,1),k(0,0,0,2,0,1),k(1,0,0,1,-1,1),k(1,0,0,2,-1,1),k(0,1,0,0,-1,1),k(0,1,0,2,-1,1),k(0,0,1,0,-1,1),k(0,0,1,1,-1,1);var I=l(f,A),T=i(f,[{type:f.FLOAT,buffer:I,size:3,offset:0,stride:28},{type:f.FLOAT,buffer:I,size:3,offset:12,stride:28},{type:f.FLOAT,buffer:I,size:1,offset:24,stride:28}]),E=s(f);E.attributes.position.location=0,E.attributes.color.location=1,E.attributes.weight.location=2;var _=new c(f,I,T,E);return _.update(x),_}}),4494:(function(t){t.exports=r;function r(a,l){return a[0]=1/l[0],a[1]=1/l[1],a[2]=1/l[2],a[3]=1/l[3],a}}),4505:(function(t,r,a){t.exports=a(5847)}),4578:(function(t){t.exports=r;function r(a,l,i,s,o){return a[0]=l,a[1]=i,a[2]=s,a[3]=o,a}}),4623:(function(t){"use restrict";t.exports=r;function r(a){this.roots=new Array(a),this.ranks=new Array(a);for(var l=0;l0)return 1<=0)return 1<=0;--f)p[f]=d*l[f]+y*i[f]+g*s[f]+C*o[f];return p}return d*l+y*i+g*s[f]+C*o}function a(l,i,s,o,c,p){var d=c-1,y=c*c,g=d*d,C=(1+2*c)*g,f=c*g,x=y*(3-2*c),A=y*d;if(l.length){p||(p=new Array(l.length));for(var k=l.length-1;k>=0;--k)p[k]=C*l[k]+f*i[k]+x*s[k]+A*o[k];return p}return C*l+f*i+x*s+A*o}t.exports=a,t.exports.derivative=r}),4772:(function(t){t.exports=r;function r(a,l,i,s,o){var c=1/Math.tan(l/2),p=1/(s-o);return a[0]=c/i,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=(o+s)*p,a[11]=-1,a[12]=0,a[13]=0,a[14]=2*o*s*p,a[15]=0,a}}),4793:(function(t,r,a){function l(Ie,ke){if(!(Ie instanceof ke))throw new TypeError("Cannot call a class as a function")}function i(Ie,ke){for(var Fe=0;FeE)throw new RangeError('The value "'+Ie+'" is invalid for option "size"');var ke=new Uint8Array(Ie);return Object.setPrototypeOf(ke,m.prototype),ke}function m(Ie,ke,Fe){if(typeof Ie=="number"){if(typeof ke=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return U(Ie)}return w(Ie,ke,Fe)}m.poolSize=8192;function w(Ie,ke,Fe){if(typeof Ie=="string")return V(Ie,ke);if(ArrayBuffer.isView(Ie))return j(Ie);if(Ie==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(Ie));if(Qr(Ie,ArrayBuffer)||Ie&&Qr(Ie.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Qr(Ie,SharedArrayBuffer)||Ie&&Qr(Ie.buffer,SharedArrayBuffer)))return O(Ie,ke,Fe);if(typeof Ie=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var at=Ie.valueOf&&Ie.valueOf();if(at!=null&&at!==Ie)return m.from(at,ke,Fe);var ct=H(Ie);if(ct)return ct;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ie[Symbol.toPrimitive]=="function")return m.from(Ie[Symbol.toPrimitive]("string"),ke,Fe);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(Ie))}m.from=function(Ie,ke,Fe){return w(Ie,ke,Fe)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array);function F(Ie){if(typeof Ie!="number")throw new TypeError('"size" argument must be of type number');if(Ie<0)throw new RangeError('The value "'+Ie+'" is invalid for option "size"')}function z(Ie,ke,Fe){return F(Ie),Ie<=0?h(Ie):ke!==void 0?typeof Fe=="string"?h(Ie).fill(ke,Fe):h(Ie).fill(ke):h(Ie)}m.alloc=function(Ie,ke,Fe){return z(Ie,ke,Fe)};function U(Ie){return F(Ie),h(Ie<0?0:W(Ie)|0)}m.allocUnsafe=function(Ie){return U(Ie)},m.allocUnsafeSlow=function(Ie){return U(Ie)};function V(Ie,ke){if((typeof ke!="string"||ke==="")&&(ke="utf8"),!m.isEncoding(ke))throw new TypeError("Unknown encoding: "+ke);var Fe=ee(Ie,ke)|0,at=h(Fe),ct=at.write(Ie,ke);return ct!==Fe&&(at=at.slice(0,ct)),at}function G(Ie){for(var ke=Ie.length<0?0:W(Ie.length)|0,Fe=h(ke),at=0;at=E)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+E.toString(16)+" bytes");return Ie|0}m.isBuffer=function(ke){return ke!=null&&ke._isBuffer===!0&&ke!==m.prototype},m.compare=function(ke,Fe){if(Qr(ke,Uint8Array)&&(ke=m.from(ke,ke.offset,ke.byteLength)),Qr(Fe,Uint8Array)&&(Fe=m.from(Fe,Fe.offset,Fe.byteLength)),!m.isBuffer(ke)||!m.isBuffer(Fe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ke===Fe)return 0;for(var at=ke.length,ct=Fe.length,Gt=0,Vt=Math.min(at,ct);Gtct.length?(m.isBuffer(Vt)||(Vt=m.from(Vt)),Vt.copy(ct,Gt)):Uint8Array.prototype.set.call(ct,Vt,Gt);else if(m.isBuffer(Vt))Vt.copy(ct,Gt);else throw new TypeError('"list" argument must be an Array of Buffers');Gt+=Vt.length}return ct};function ee(Ie,ke){if(m.isBuffer(Ie))return Ie.length;if(ArrayBuffer.isView(Ie)||Qr(Ie,ArrayBuffer))return Ie.byteLength;if(typeof Ie!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+A(Ie));var Fe=Ie.length,at=arguments.length>2&&arguments[2]===!0;if(!at&&Fe===0)return 0;for(var ct=!1;;)switch(ke){case"ascii":case"latin1":case"binary":return Fe;case"utf8":case"utf-8":return mr(Ie).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fe*2;case"hex":return Fe>>>1;case"base64":return fn(Ie).length;default:if(ct)return at?-1:mr(Ie).length;ke=(""+ke).toLowerCase(),ct=!0}}m.byteLength=ee;function ue(Ie,ke,Fe){var at=!1;if((ke===void 0||ke<0)&&(ke=0),ke>this.length||((Fe===void 0||Fe>this.length)&&(Fe=this.length),Fe<=0)||(Fe>>>=0,ke>>>=0,Fe<=ke))return"";for(Ie||(Ie="utf8");;)switch(Ie){case"hex":return $e(this,ke,Fe);case"utf8":case"utf-8":return Z(this,ke,Fe);case"ascii":return Te(this,ke,Fe);case"latin1":case"binary":return Ne(this,ke,Fe);case"base64":return le(this,ke,Fe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,ke,Fe);default:if(at)throw new TypeError("Unknown encoding: "+Ie);Ie=(Ie+"").toLowerCase(),at=!0}}m.prototype._isBuffer=!0;function xe(Ie,ke,Fe){var at=Ie[ke];Ie[ke]=Ie[Fe],Ie[Fe]=at}m.prototype.swap16=function(){var ke=this.length;if(ke%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Fe=0;FeFe&&(ke+=" ... "),""},T&&(m.prototype[T]=m.prototype.inspect),m.prototype.compare=function(ke,Fe,at,ct,Gt){if(Qr(ke,Uint8Array)&&(ke=m.from(ke,ke.offset,ke.byteLength)),!m.isBuffer(ke))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+A(ke));if(Fe===void 0&&(Fe=0),at===void 0&&(at=ke?ke.length:0),ct===void 0&&(ct=0),Gt===void 0&&(Gt=this.length),Fe<0||at>ke.length||ct<0||Gt>this.length)throw new RangeError("out of range index");if(ct>=Gt&&Fe>=at)return 0;if(ct>=Gt)return-1;if(Fe>=at)return 1;if(Fe>>>=0,at>>>=0,ct>>>=0,Gt>>>=0,this===ke)return 0;for(var Vt=Gt-ct,Zt=at-Fe,ur=Math.min(Vt,Zt),Dr=this.slice(ct,Gt),kr=ke.slice(Fe,at),Sr=0;Sr2147483647?Fe=2147483647:Fe<-2147483648&&(Fe=-2147483648),Fe=+Fe,Bt(Fe)&&(Fe=ct?0:Ie.length-1),Fe<0&&(Fe=Ie.length+Fe),Fe>=Ie.length){if(ct)return-1;Fe=Ie.length-1}else if(Fe<0)if(ct)Fe=0;else return-1;if(typeof ke=="string"&&(ke=m.from(ke,at)),m.isBuffer(ke))return ke.length===0?-1:_e(Ie,ke,Fe,at,ct);if(typeof ke=="number")return ke=ke&255,typeof Uint8Array.prototype.indexOf=="function"?ct?Uint8Array.prototype.indexOf.call(Ie,ke,Fe):Uint8Array.prototype.lastIndexOf.call(Ie,ke,Fe):_e(Ie,[ke],Fe,at,ct);throw new TypeError("val must be string, number or Buffer")}function _e(Ie,ke,Fe,at,ct){var Gt=1,Vt=Ie.length,Zt=ke.length;if(at!==void 0&&(at=String(at).toLowerCase(),at==="ucs2"||at==="ucs-2"||at==="utf16le"||at==="utf-16le")){if(Ie.length<2||ke.length<2)return-1;Gt=2,Vt/=2,Zt/=2,Fe/=2}function ur(jn,ha){return Gt===1?jn[ha]:jn.readUInt16BE(ha*Gt)}var Dr;if(ct){var kr=-1;for(Dr=Fe;DrVt&&(Fe=Vt-Zt),Dr=Fe;Dr>=0;Dr--){for(var Sr=!0,Jr=0;Jrct&&(at=ct)):at=ct;var Gt=ke.length;at>Gt/2&&(at=Gt/2);var Vt;for(Vt=0;Vt>>0,isFinite(at)?(at=at>>>0,ct===void 0&&(ct="utf8")):(ct=at,at=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Gt=this.length-Fe;if((at===void 0||at>Gt)&&(at=Gt),ke.length>0&&(at<0||Fe<0)||Fe>this.length)throw new RangeError("Attempt to write outside buffer bounds");ct||(ct="utf8");for(var Vt=!1;;)switch(ct){case"hex":return Y(this,ke,Fe,at);case"utf8":case"utf-8":return se(this,ke,Fe,at);case"ascii":case"latin1":case"binary":return ce(this,ke,Fe,at);case"base64":return ne(this,ke,Fe,at);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,ke,Fe,at);default:if(Vt)throw new TypeError("Unknown encoding: "+ct);ct=(""+ct).toLowerCase(),Vt=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function le(Ie,ke,Fe){return ke===0&&Fe===Ie.length?k.fromByteArray(Ie):k.fromByteArray(Ie.slice(ke,Fe))}function Z(Ie,ke,Fe){Fe=Math.min(Ie.length,Fe);for(var at=[],ct=ke;ct239?4:Gt>223?3:Gt>191?2:1;if(ct+Zt<=Fe){var ur=void 0,Dr=void 0,kr=void 0,Sr=void 0;switch(Zt){case 1:Gt<128&&(Vt=Gt);break;case 2:ur=Ie[ct+1],(ur&192)===128&&(Sr=(Gt&31)<<6|ur&63,Sr>127&&(Vt=Sr));break;case 3:ur=Ie[ct+1],Dr=Ie[ct+2],(ur&192)===128&&(Dr&192)===128&&(Sr=(Gt&15)<<12|(ur&63)<<6|Dr&63,Sr>2047&&(Sr<55296||Sr>57343)&&(Vt=Sr));break;case 4:ur=Ie[ct+1],Dr=Ie[ct+2],kr=Ie[ct+3],(ur&192)===128&&(Dr&192)===128&&(kr&192)===128&&(Sr=(Gt&15)<<18|(ur&63)<<12|(Dr&63)<<6|kr&63,Sr>65535&&Sr<1114112&&(Vt=Sr))}}Vt===null?(Vt=65533,Zt=1):Vt>65535&&(Vt-=65536,at.push(Vt>>>10&1023|55296),Vt=56320|Vt&1023),at.push(Vt),ct+=Zt}return pe(at)}var de=4096;function pe(Ie){var ke=Ie.length;if(ke<=de)return String.fromCharCode.apply(String,Ie);for(var Fe="",at=0;atat)&&(Fe=at);for(var ct="",Gt=ke;Gtat&&(ke=at),Fe<0?(Fe+=at,Fe<0&&(Fe=0)):Fe>at&&(Fe=at),FeFe)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUintLE=m.prototype.readUIntLE=function(ke,Fe,at){ke=ke>>>0,Fe=Fe>>>0,at||Xe(ke,Fe,this.length);for(var ct=this[ke],Gt=1,Vt=0;++Vt>>0,Fe=Fe>>>0,at||Xe(ke,Fe,this.length);for(var ct=this[ke+--Fe],Gt=1;Fe>0&&(Gt*=256);)ct+=this[ke+--Fe]*Gt;return ct},m.prototype.readUint8=m.prototype.readUInt8=function(ke,Fe){return ke=ke>>>0,Fe||Xe(ke,1,this.length),this[ke]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(ke,Fe){return ke=ke>>>0,Fe||Xe(ke,2,this.length),this[ke]|this[ke+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(ke,Fe){return ke=ke>>>0,Fe||Xe(ke,2,this.length),this[ke]<<8|this[ke+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(ke,Fe){return ke=ke>>>0,Fe||Xe(ke,4,this.length),(this[ke]|this[ke+1]<<8|this[ke+2]<<16)+this[ke+3]*16777216},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(ke,Fe){return ke=ke>>>0,Fe||Xe(ke,4,this.length),this[ke]*16777216+(this[ke+1]<<16|this[ke+2]<<8|this[ke+3])},m.prototype.readBigUInt64LE=ut(function(ke){ke=ke>>>0,vt(ke,"offset");var Fe=this[ke],at=this[ke+7];(Fe===void 0||at===void 0)&&Kt(ke,this.length-8);var ct=Fe+this[++ke]*Math.pow(2,8)+this[++ke]*Math.pow(2,16)+this[++ke]*Math.pow(2,24),Gt=this[++ke]+this[++ke]*Math.pow(2,8)+this[++ke]*Math.pow(2,16)+at*Math.pow(2,24);return BigInt(ct)+(BigInt(Gt)<>>0,vt(ke,"offset");var Fe=this[ke],at=this[ke+7];(Fe===void 0||at===void 0)&&Kt(ke,this.length-8);var ct=Fe*Math.pow(2,24)+this[++ke]*Math.pow(2,16)+this[++ke]*Math.pow(2,8)+this[++ke],Gt=this[++ke]*Math.pow(2,24)+this[++ke]*Math.pow(2,16)+this[++ke]*Math.pow(2,8)+at;return(BigInt(ct)<>>0,Fe=Fe>>>0,at||Xe(ke,Fe,this.length);for(var ct=this[ke],Gt=1,Vt=0;++Vt=Gt&&(ct-=Math.pow(2,8*Fe)),ct},m.prototype.readIntBE=function(ke,Fe,at){ke=ke>>>0,Fe=Fe>>>0,at||Xe(ke,Fe,this.length);for(var ct=Fe,Gt=1,Vt=this[ke+--ct];ct>0&&(Gt*=256);)Vt+=this[ke+--ct]*Gt;return Gt*=128,Vt>=Gt&&(Vt-=Math.pow(2,8*Fe)),Vt},m.prototype.readInt8=function(ke,Fe){return ke=ke>>>0,Fe||Xe(ke,1,this.length),this[ke]&128?(255-this[ke]+1)*-1:this[ke]},m.prototype.readInt16LE=function(ke,Fe){ke=ke>>>0,Fe||Xe(ke,2,this.length);var at=this[ke]|this[ke+1]<<8;return at&32768?at|4294901760:at},m.prototype.readInt16BE=function(ke,Fe){ke=ke>>>0,Fe||Xe(ke,2,this.length);var at=this[ke+1]|this[ke]<<8;return at&32768?at|4294901760:at},m.prototype.readInt32LE=function(ke,Fe){return ke=ke>>>0,Fe||Xe(ke,4,this.length),this[ke]|this[ke+1]<<8|this[ke+2]<<16|this[ke+3]<<24},m.prototype.readInt32BE=function(ke,Fe){return ke=ke>>>0,Fe||Xe(ke,4,this.length),this[ke]<<24|this[ke+1]<<16|this[ke+2]<<8|this[ke+3]},m.prototype.readBigInt64LE=ut(function(ke){ke=ke>>>0,vt(ke,"offset");var Fe=this[ke],at=this[ke+7];(Fe===void 0||at===void 0)&&Kt(ke,this.length-8);var ct=this[ke+4]+this[ke+5]*Math.pow(2,8)+this[ke+6]*Math.pow(2,16)+(at<<24);return(BigInt(ct)<>>0,vt(ke,"offset");var Fe=this[ke],at=this[ke+7];(Fe===void 0||at===void 0)&&Kt(ke,this.length-8);var ct=(Fe<<24)+this[++ke]*Math.pow(2,16)+this[++ke]*Math.pow(2,8)+this[++ke];return(BigInt(ct)<>>0,Fe||Xe(ke,4,this.length),I.read(this,ke,!0,23,4)},m.prototype.readFloatBE=function(ke,Fe){return ke=ke>>>0,Fe||Xe(ke,4,this.length),I.read(this,ke,!1,23,4)},m.prototype.readDoubleLE=function(ke,Fe){return ke=ke>>>0,Fe||Xe(ke,8,this.length),I.read(this,ke,!0,52,8)},m.prototype.readDoubleBE=function(ke,Fe){return ke=ke>>>0,Fe||Xe(ke,8,this.length),I.read(this,ke,!1,52,8)};function it(Ie,ke,Fe,at,ct,Gt){if(!m.isBuffer(Ie))throw new TypeError('"buffer" argument must be a Buffer instance');if(ke>ct||keIe.length)throw new RangeError("Index out of range")}m.prototype.writeUintLE=m.prototype.writeUIntLE=function(ke,Fe,at,ct){if(ke=+ke,Fe=Fe>>>0,at=at>>>0,!ct){var Gt=Math.pow(2,8*at)-1;it(this,ke,Fe,at,Gt,0)}var Vt=1,Zt=0;for(this[Fe]=ke&255;++Zt>>0,at=at>>>0,!ct){var Gt=Math.pow(2,8*at)-1;it(this,ke,Fe,at,Gt,0)}var Vt=at-1,Zt=1;for(this[Fe+Vt]=ke&255;--Vt>=0&&(Zt*=256);)this[Fe+Vt]=ke/Zt&255;return Fe+at},m.prototype.writeUint8=m.prototype.writeUInt8=function(ke,Fe,at){return ke=+ke,Fe=Fe>>>0,at||it(this,ke,Fe,1,255,0),this[Fe]=ke&255,Fe+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(ke,Fe,at){return ke=+ke,Fe=Fe>>>0,at||it(this,ke,Fe,2,65535,0),this[Fe]=ke&255,this[Fe+1]=ke>>>8,Fe+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(ke,Fe,at){return ke=+ke,Fe=Fe>>>0,at||it(this,ke,Fe,2,65535,0),this[Fe]=ke>>>8,this[Fe+1]=ke&255,Fe+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(ke,Fe,at){return ke=+ke,Fe=Fe>>>0,at||it(this,ke,Fe,4,4294967295,0),this[Fe+3]=ke>>>24,this[Fe+2]=ke>>>16,this[Fe+1]=ke>>>8,this[Fe]=ke&255,Fe+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(ke,Fe,at){return ke=+ke,Fe=Fe>>>0,at||it(this,ke,Fe,4,4294967295,0),this[Fe]=ke>>>24,this[Fe+1]=ke>>>16,this[Fe+2]=ke>>>8,this[Fe+3]=ke&255,Fe+4};function yt(Ie,ke,Fe,at,ct){At(ke,at,ct,Ie,Fe,7);var Gt=Number(ke&BigInt(4294967295));Ie[Fe++]=Gt,Gt=Gt>>8,Ie[Fe++]=Gt,Gt=Gt>>8,Ie[Fe++]=Gt,Gt=Gt>>8,Ie[Fe++]=Gt;var Vt=Number(ke>>BigInt(32)&BigInt(4294967295));return Ie[Fe++]=Vt,Vt=Vt>>8,Ie[Fe++]=Vt,Vt=Vt>>8,Ie[Fe++]=Vt,Vt=Vt>>8,Ie[Fe++]=Vt,Fe}function bt(Ie,ke,Fe,at,ct){At(ke,at,ct,Ie,Fe,7);var Gt=Number(ke&BigInt(4294967295));Ie[Fe+7]=Gt,Gt=Gt>>8,Ie[Fe+6]=Gt,Gt=Gt>>8,Ie[Fe+5]=Gt,Gt=Gt>>8,Ie[Fe+4]=Gt;var Vt=Number(ke>>BigInt(32)&BigInt(4294967295));return Ie[Fe+3]=Vt,Vt=Vt>>8,Ie[Fe+2]=Vt,Vt=Vt>>8,Ie[Fe+1]=Vt,Vt=Vt>>8,Ie[Fe]=Vt,Fe+8}m.prototype.writeBigUInt64LE=ut(function(ke){var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return yt(this,ke,Fe,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeBigUInt64BE=ut(function(ke){var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return bt(this,ke,Fe,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeIntLE=function(ke,Fe,at,ct){if(ke=+ke,Fe=Fe>>>0,!ct){var Gt=Math.pow(2,8*at-1);it(this,ke,Fe,at,Gt-1,-Gt)}var Vt=0,Zt=1,ur=0;for(this[Fe]=ke&255;++Vt>0)-ur&255;return Fe+at},m.prototype.writeIntBE=function(ke,Fe,at,ct){if(ke=+ke,Fe=Fe>>>0,!ct){var Gt=Math.pow(2,8*at-1);it(this,ke,Fe,at,Gt-1,-Gt)}var Vt=at-1,Zt=1,ur=0;for(this[Fe+Vt]=ke&255;--Vt>=0&&(Zt*=256);)ke<0&&ur===0&&this[Fe+Vt+1]!==0&&(ur=1),this[Fe+Vt]=(ke/Zt>>0)-ur&255;return Fe+at},m.prototype.writeInt8=function(ke,Fe,at){return ke=+ke,Fe=Fe>>>0,at||it(this,ke,Fe,1,127,-128),ke<0&&(ke=255+ke+1),this[Fe]=ke&255,Fe+1},m.prototype.writeInt16LE=function(ke,Fe,at){return ke=+ke,Fe=Fe>>>0,at||it(this,ke,Fe,2,32767,-32768),this[Fe]=ke&255,this[Fe+1]=ke>>>8,Fe+2},m.prototype.writeInt16BE=function(ke,Fe,at){return ke=+ke,Fe=Fe>>>0,at||it(this,ke,Fe,2,32767,-32768),this[Fe]=ke>>>8,this[Fe+1]=ke&255,Fe+2},m.prototype.writeInt32LE=function(ke,Fe,at){return ke=+ke,Fe=Fe>>>0,at||it(this,ke,Fe,4,2147483647,-2147483648),this[Fe]=ke&255,this[Fe+1]=ke>>>8,this[Fe+2]=ke>>>16,this[Fe+3]=ke>>>24,Fe+4},m.prototype.writeInt32BE=function(ke,Fe,at){return ke=+ke,Fe=Fe>>>0,at||it(this,ke,Fe,4,2147483647,-2147483648),ke<0&&(ke=4294967295+ke+1),this[Fe]=ke>>>24,this[Fe+1]=ke>>>16,this[Fe+2]=ke>>>8,this[Fe+3]=ke&255,Fe+4},m.prototype.writeBigInt64LE=ut(function(ke){var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return yt(this,ke,Fe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeBigInt64BE=ut(function(ke){var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return bt(this,ke,Fe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function mt(Ie,ke,Fe,at,ct,Gt){if(Fe+at>Ie.length)throw new RangeError("Index out of range");if(Fe<0)throw new RangeError("Index out of range")}function ht(Ie,ke,Fe,at,ct){return ke=+ke,Fe=Fe>>>0,ct||mt(Ie,ke,Fe,4),I.write(Ie,ke,Fe,at,23,4),Fe+4}m.prototype.writeFloatLE=function(ke,Fe,at){return ht(this,ke,Fe,!0,at)},m.prototype.writeFloatBE=function(ke,Fe,at){return ht(this,ke,Fe,!1,at)};function Ve(Ie,ke,Fe,at,ct){return ke=+ke,Fe=Fe>>>0,ct||mt(Ie,ke,Fe,8),I.write(Ie,ke,Fe,at,52,8),Fe+8}m.prototype.writeDoubleLE=function(ke,Fe,at){return Ve(this,ke,Fe,!0,at)},m.prototype.writeDoubleBE=function(ke,Fe,at){return Ve(this,ke,Fe,!1,at)},m.prototype.copy=function(ke,Fe,at,ct){if(!m.isBuffer(ke))throw new TypeError("argument should be a Buffer");if(at||(at=0),!ct&&ct!==0&&(ct=this.length),Fe>=ke.length&&(Fe=ke.length),Fe||(Fe=0),ct>0&&ct=this.length)throw new RangeError("Index out of range");if(ct<0)throw new RangeError("sourceEnd out of bounds");ct>this.length&&(ct=this.length),ke.length-Fe>>0,at=at===void 0?this.length:at>>>0,ke||(ke=0);var Vt;if(typeof ke=="number")for(Vt=Fe;VtMath.pow(2,32)?ct=Je(String(Fe)):typeof Fe=="bigint"&&(ct=String(Fe),(Fe>Math.pow(BigInt(2),BigInt(32))||Fe<-Math.pow(BigInt(2),BigInt(32)))&&(ct=Je(ct)),ct+="n"),at+=" It must be ".concat(ke,". Received ").concat(ct),at},RangeError);function Je(Ie){for(var ke="",Fe=Ie.length,at=Ie[0]==="-"?1:0;Fe>=at+4;Fe-=3)ke="_".concat(Ie.slice(Fe-3,Fe)).concat(ke);return"".concat(Ie.slice(0,Fe)).concat(ke)}function _t(Ie,ke,Fe){vt(ke,"offset"),(Ie[ke]===void 0||Ie[ke+Fe]===void 0)&&Kt(ke,Ie.length-(Fe+1))}function At(Ie,ke,Fe,at,ct,Gt){if(Ie>Fe||Ie= 0".concat(Vt," and < 2").concat(Vt," ** ").concat((Gt+1)*8).concat(Vt):Zt=">= -(2".concat(Vt," ** ").concat((Gt+1)*8-1).concat(Vt,") and < 2 ** ")+"".concat((Gt+1)*8-1).concat(Vt),new ze.ERR_OUT_OF_RANGE("value",Zt,Ie)}_t(at,ct,Gt)}function vt(Ie,ke){if(typeof Ie!="number")throw new ze.ERR_INVALID_ARG_TYPE(ke,"number",Ie)}function Kt(Ie,ke,Fe){throw Math.floor(Ie)!==Ie?(vt(Ie,Fe),new ze.ERR_OUT_OF_RANGE("offset","an integer",Ie)):ke<0?new ze.ERR_BUFFER_OUT_OF_BOUNDS:new ze.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(ke),Ie)}var Qt=/[^+/0-9A-Za-z-_]/g;function fr(Ie){if(Ie=Ie.split("=")[0],Ie=Ie.trim().replace(Qt,""),Ie.length<2)return"";for(;Ie.length%4!==0;)Ie=Ie+"=";return Ie}function mr(Ie,ke){ke=ke||1/0;for(var Fe,at=Ie.length,ct=null,Gt=[],Vt=0;Vt55295&&Fe<57344){if(!ct){if(Fe>56319){(ke-=3)>-1&&Gt.push(239,191,189);continue}else if(Vt+1===at){(ke-=3)>-1&&Gt.push(239,191,189);continue}ct=Fe;continue}if(Fe<56320){(ke-=3)>-1&&Gt.push(239,191,189),ct=Fe;continue}Fe=(ct-55296<<10|Fe-56320)+65536}else ct&&(ke-=3)>-1&&Gt.push(239,191,189);if(ct=null,Fe<128){if((ke-=1)<0)break;Gt.push(Fe)}else if(Fe<2048){if((ke-=2)<0)break;Gt.push(Fe>>6|192,Fe&63|128)}else if(Fe<65536){if((ke-=3)<0)break;Gt.push(Fe>>12|224,Fe>>6&63|128,Fe&63|128)}else if(Fe<1114112){if((ke-=4)<0)break;Gt.push(Fe>>18|240,Fe>>12&63|128,Fe>>6&63|128,Fe&63|128)}else throw new Error("Invalid code point")}return Gt}function Ur(Ie){for(var ke=[],Fe=0;Fe>8,ct=Fe%256,Gt.push(ct),Gt.push(at);return Gt}function fn(Ie){return k.toByteArray(fr(Ie))}function Fr(Ie,ke,Fe,at){var ct;for(ct=0;ct=ke.length||ct>=Ie.length);++ct)ke[ct+Fe]=Ie[ct];return ct}function Qr(Ie,ke){return Ie instanceof ke||Ie!=null&&Ie.constructor!=null&&Ie.constructor.name!=null&&Ie.constructor.name===ke.name}function Bt(Ie){return Ie!==Ie}var et=(function(){for(var Ie="0123456789abcdef",ke=new Array(256),Fe=0;Fe<16;++Fe)for(var at=Fe*16,ct=0;ct<16;++ct)ke[at+ct]=Ie[Fe]+Ie[ct];return ke})();function ut(Ie){return typeof BigInt>"u"?Be:Ie}function Be(){throw new Error("BigInt not supported")}}),4844:(function(t){t.exports=r;function r(a,l,i,s){return a[0]=l[0]+i[0]*s,a[1]=l[1]+i[1]*s,a[2]=l[2]+i[2]*s,a[3]=l[3]+i[3]*s,a}}),4905:(function(t,r,a){var l=a(5874);t.exports=i;function i(s,o){var c=l(o),p=[];return p=p.concat(c(s)),p=p.concat(c(null)),p}}),4935:(function(t,r,a){t.exports=x;var l=a(2762),i=a(8116),s=a(4359),o=a(1879).Q,c=window||process.global||{},p=c.__TEXT_CACHE||{};c.__TEXT_CACHE={};var d=3;function y(A,k,I,T){this.gl=A,this.shader=k,this.buffer=I,this.vao=T,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var g=y.prototype,C=[0,0];g.bind=function(A,k,I,T){this.vao.bind(),this.shader.bind();var E=this.shader.uniforms;E.model=A,E.view=k,E.projection=I,E.pixelScale=T,C[0]=this.gl.drawingBufferWidth,C[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=C},g.unbind=function(){this.vao.unbind()},g.update=function(A,k,I,T,E){var _=[];function h(H,W,ee,ue,xe,ge){var _e=[ee.style,ee.weight,ee.variant,ee.family].join("_"),Y=p[_e];Y||(Y=p[_e]={});var se=Y[W];se||(se=Y[W]=f(W,{triangles:!0,font:ee.family,fontStyle:ee.style,fontWeight:ee.weight,fontVariant:ee.variant,textAlign:"center",textBaseline:"middle",lineSpacing:xe,styletags:ge}));for(var ce=(ue||12)/12,ne=se.positions,ye=se.cells,le=0,Z=ye.length;le=0;--pe){var Te=ne[de[pe]];_.push(ce*Te[0],-ce*Te[1],H)}}for(var m=[0,0,0],w=[0,0,0],F=[0,0,0],z=[0,0,0],U=1.25,V={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},G=0;G<3;++G){F[G]=_.length/d|0,h(.5*(A[0][G]+A[1][G]),k[G],I[G],12,U,V),z[G]=(_.length/d|0)-F[G],m[G]=_.length/d|0;for(var j=0;j0||k.length>0;){for(;A.length>0;){var h=A.pop();if(I[h]!==-x){I[h]=x,T[h];for(var m=0;m<3;++m){var w=_[3*h+m];w>=0&&I[w]===0&&(E[3*h+m]?k.push(w):(A.push(w),I[w]=x))}}}var F=k;k=A,A=F,k.length=0,x=-x}var z=p(T,I,g);return C?z.concat(f.boundary):z}}),5033:(function(t){t.exports=r;function r(a,l,i){var s=l||0,o=i||1;return[[a[12]+a[0],a[13]+a[1],a[14]+a[2],a[15]+a[3]],[a[12]-a[0],a[13]-a[1],a[14]-a[2],a[15]-a[3]],[a[12]+a[4],a[13]+a[5],a[14]+a[6],a[15]+a[7]],[a[12]-a[4],a[13]-a[5],a[14]-a[6],a[15]-a[7]],[s*a[12]+a[8],s*a[13]+a[9],s*a[14]+a[10],s*a[15]+a[11]],[o*a[12]-a[8],o*a[13]-a[9],o*a[14]-a[10],o*a[15]-a[11]]]}}),5085:(function(t,r,a){t.exports=x;var l=a(3250)[3],i=a(4209),s=a(3352),o=a(2478);function c(){return!0}function p(A){return function(k,I){var T=A[k];return T?!!T.queryPoint(I,c):!1}}function d(A){for(var k={},I=0;I0&&k[T]===I[0])E=A[T-1];else return 1;for(var _=1;E;){var h=E.key,m=l(I,h[0],h[1]);if(h[0][0]0)_=-1,E=E.right;else return 0;else if(m>0)E=E.left;else if(m<0)_=1,E=E.right;else return 0}return _}}function g(A){return 1}function C(A){return function(I){return A(I[0],I[1])?0:1}}function f(A,k){return function(T){return A(T[0],T[1])?0:k(T)}}function x(A){for(var k=A.length,I=[],T=[],E=0;E"u"?a(606):WeakMap,o=new s,c=0;function p(k,I,T,E,_,h,m){this.id=k,this.src=I,this.type=T,this.shader=E,this.count=h,this.programs=[],this.cache=m}p.prototype.dispose=function(){if(--this.count===0){for(var k=this.cache,I=k.gl,T=this.programs,E=0,_=T.length;E<_;++E){var h=k.programs[T[E]];h&&(delete k.programs[E],I.deleteProgram(h))}I.deleteShader(this.shader),delete k.shaders[this.type===I.FRAGMENT_SHADER|0][this.src]}};function d(k){this.gl=k,this.shaders=[{},{}],this.programs={}}var y=d.prototype;function g(k,I,T){var E=k.createShader(I);if(k.shaderSource(E,T),k.compileShader(E),!k.getShaderParameter(E,k.COMPILE_STATUS)){var _=k.getShaderInfoLog(E);try{var h=i(_,T,I)}catch(m){throw console.warn("Failed to format compiler error: "+m),new l(_,`Error compiling shader: +`+_)}throw new l(_,h.short,h.long)}return E}y.getShaderReference=function(k,I){var T=this.gl,E=this.shaders[k===T.FRAGMENT_SHADER|0],_=E[I];if(!_||!T.isShader(_.shader)){var h=g(T,k,I);_=E[I]=new p(c++,I,k,h,[],1,this)}else _.count+=1;return _};function C(k,I,T,E,_){var h=k.createProgram();k.attachShader(h,I),k.attachShader(h,T);for(var m=0;m0&&(p=1/Math.sqrt(p),a[0]=i*p,a[1]=s*p,a[2]=o*p,a[3]=c*p),a}}),5202:(function(t,r,a){var l=a(1944),i=a(8210);t.exports=c,t.exports.positive=p,t.exports.negative=d;function s(y,g){var C=i(l(y,g),[g[g.length-1]]);return C[C.length-1]}function o(y,g,C,f){var x=f-g,A=-g/x;A<0?A=0:A>1&&(A=1);for(var k=1-A,I=y.length,T=new Array(I),E=0;E0||x>0&&T<0){var E=o(A,T,k,x);C.push(E),f.push(E.slice())}T<0?f.push(k.slice()):T>0?C.push(k.slice()):(C.push(k.slice()),f.push(k.slice())),x=T}return{positive:C,negative:f}}function p(y,g){for(var C=[],f=s(y[y.length-1],g),x=y[y.length-1],A=y[0],k=0;k0||f>0&&I<0)&&C.push(o(x,I,A,f)),I>=0&&C.push(A.slice()),f=I}return C}function d(y,g){for(var C=[],f=s(y[y.length-1],g),x=y[y.length-1],A=y[0],k=0;k0||f>0&&I<0)&&C.push(o(x,I,A,f)),I<=0&&C.push(A.slice()),f=I}return C}}),5219:(function(t){t.exports=function(r){for(var a=r.length,l,i=0;i13)&&l!==32&&l!==133&&l!==160&&l!==5760&&l!==6158&&(l<8192||l>8205)&&l!==8232&&l!==8233&&l!==8239&&l!==8287&&l!==8288&&l!==12288&&l!==65279)return!1;return!0}}),5250:(function(t){t.exports=a;var r=+(Math.pow(2,27)+1);function a(l,i,s){var o=l*i,c=r*l,p=c-l,d=c-p,y=l-d,g=r*i,C=g-i,f=g-C,x=i-f,A=o-d*f,k=A-y*f,I=k-d*x,T=y*x-I;return s?(s[0]=T,s[1]=o,s):[T,o]}}),5298:(function(t,r){var a={"float64,2,1,0":function(){return function(y,g,C,f,x){var A=y[0],k=y[1],I=y[2],T=C[0],E=C[1],_=C[2];f|=0;var h=0,m=0,w=0,F=_,z=E-I*_,U=T-k*E;for(w=0;w0;){j<64?(T=j,j=0):(T=64,j-=64);for(var O=y[1]|0;O>0;){O<64?(E=O,O=0):(E=64,O-=64),f=V+j*h+O*m,k=G+j*F+O*z;var H=0,W=0,ee=0,ue=w,xe=h-_*w,ge=m-T*h,_e=U,Y=F-_*U,se=z-T*F;for(ee=0;ee0;){z<64?(T=z,z=0):(T=64,z-=64);for(var U=y[0]|0;U>0;){U<64?(I=U,U=0):(I=64,U-=64),f=w+z*_+U*E,k=F+z*m+U*h;var V=0,G=0,j=_,O=E-T*_,H=m,W=h-T*m;for(G=0;G0;){G<64?(E=G,G=0):(E=64,G-=64);for(var j=y[0]|0;j>0;){j<64?(I=j,j=0):(I=64,j-=64);for(var O=y[1]|0;O>0;){O<64?(T=O,O=0):(T=64,O-=64),f=U+G*m+j*_+O*h,k=V+G*z+j*w+O*F;var H=0,W=0,ee=0,ue=m,xe=_-E*m,ge=h-I*_,_e=z,Y=w-E*z,se=F-I*w;for(ee=0;ee=0}})(),s.removeTriangle=function(p,d,y){var g=this.stars;o(g[p],d,y),o(g[d],y,p),o(g[y],p,d)},s.addTriangle=function(p,d,y){var g=this.stars;g[p].push(d,y),g[d].push(y,p),g[y].push(p,d)},s.opposite=function(p,d){for(var y=this.stars[d],g=1,C=y.length;g0;){var f=y.pop();p[f]=!1;for(var x=c[f],g=0;g0){for(var _e=0;_e<24;++_e)z.push(z[z.length-12]);j+=2,ue=!0}continue e}O[0][w]=Math.min(O[0][w],xe[w],ge[w]),O[1][w]=Math.max(O[1][w],xe[w],ge[w])}var Y,se;Array.isArray(W[0])?(Y=W.length>m-1?W[m-1]:W.length>0?W[W.length-1]:[0,0,0,1],se=W.length>m?W[m]:W.length>0?W[W.length-1]:[0,0,0,1]):Y=se=W,Y.length===3&&(Y=[Y[0],Y[1],Y[2],1]),se.length===3&&(se=[se[0],se[1],se[2],1]),!this.hasAlpha&&Y[3]<1&&(this.hasAlpha=!0);var ce;Array.isArray(ee)?ce=ee.length>m-1?ee[m-1]:ee.length>0?ee[ee.length-1]:[0,0,0,1]:ce=ee;var ne=G;if(G+=A(xe,ge),ue){for(w=0;w<2;++w)z.push(xe[0],xe[1],xe[2],ge[0],ge[1],ge[2],ne,ce,Y[0],Y[1],Y[2],Y[3]);j+=2,ue=!1}z.push(xe[0],xe[1],xe[2],ge[0],ge[1],ge[2],ne,ce,Y[0],Y[1],Y[2],Y[3],xe[0],xe[1],xe[2],ge[0],ge[1],ge[2],ne,-ce,Y[0],Y[1],Y[2],Y[3],ge[0],ge[1],ge[2],xe[0],xe[1],xe[2],G,-ce,se[0],se[1],se[2],se[3],ge[0],ge[1],ge[2],xe[0],xe[1],xe[2],G,ce,se[0],se[1],se[2],se[3]),j+=4}}if(this.buffer.update(z),U.push(G),V.push(H[H.length-1].slice()),this.bounds=O,this.vertexCount=j,this.points=V,this.arcLength=U,"dashes"in h){var ye=h.dashes,le=ye.slice();for(le.unshift(0),m=1;ma[i][0]&&(i=s);return li?[[i],[l]]:[[l]]}}),5771:(function(t,r,a){var l=a(8507),i=a(3788),s=a(2419);t.exports=o;function o(c){c.sort(i);for(var p=c.length,d=0,y=0;y0){var f=c[d-1];if(l(g,f)===0&&s(f)!==C){d-=1;continue}}c[d++]=g}}return c.length=d,c}}),5838:(function(t,r,a){t.exports=i;var l=a(7842);function i(s){for(var o=new Array(s.length),c=0;c0)continue;Je=Ve.slice(0,1).join("")}return le(Je),ue+=Je.length,O=O.slice(Je.length),O.length}while(!0)}function yt(){return/[^a-fA-F0-9]/.test(G)?(le(O.join("")),V=p,z):(O.push(G),j=G,z+1)}function bt(){return G==="."||/[eE]/.test(G)?(O.push(G),V=A,j=G,z+1):G==="x"&&O.length===1&&O[0]==="0"?(V=h,O.push(G),j=G,z+1):/[^\d]/.test(G)?(le(O.join("")),V=p,z):(O.push(G),j=G,z+1)}function mt(){return G==="f"&&(O.push(G),j=G,z+=1),/[eE]/.test(G)||(G==="-"||G==="+")&&/[eE]/.test(j)?(O.push(G),j=G,z+1):/[^\d]/.test(G)?(le(O.join("")),V=p,z):(O.push(G),j=G,z+1)}function ht(){if(/[^\d\w_]/.test(G)){var Ve=O.join("");return ye[Ve]?V=T:ne[Ve]?V=I:V=k,le(O.join("")),V=p,z}return O.push(G),j=G,z+1}}}),5878:(function(t,r,a){t.exports=o;var l=a(3250),i=a(2014);function s(c,p,d){var y=Math.abs(l(c,p,d)),g=Math.sqrt(Math.pow(p[0]-d[0],2)+Math.pow(p[1]-d[1],2));return y/g}function o(c,p,d){for(var y=p.length,g=c.length,C=new Array(y),f=new Array(y),x=new Array(y),A=new Array(y),k=0;k>1:(_e>>1)-1}function F(_e){for(var Y=m(_e);;){var se=Y,ce=2*_e+1,ne=2*(_e+1),ye=_e;if(ce0;){var se=w(_e);if(se>=0){var ce=m(se);if(Y0){var _e=j[0];return h(0,W-1),W-=1,F(0),_e}return-1}function V(_e,Y){var se=j[_e];return x[se]===Y?_e:(x[se]=-1/0,z(_e),U(),x[se]=Y,W+=1,z(W-1))}function G(_e){if(!A[_e]){A[_e]=!0;var Y=C[_e],se=f[_e];C[se]>=0&&(C[se]=Y),f[Y]>=0&&(f[Y]=se),O[Y]>=0&&V(O[Y],_(Y)),O[se]>=0&&V(O[se],_(se))}}for(var j=[],O=new Array(y),k=0;k>1;k>=0;--k)F(k);for(;;){var ee=U();if(ee<0||x[ee]>d)break;G(ee)}for(var ue=[],k=0;k=0&&se>=0&&Y!==se){var ce=O[Y],ne=O[se];ce!==ne&&ge.push([ce,ne])}}),i.unique(i.normalize(ge)),{positions:ue,edges:ge}}}),5911:(function(t){t.exports=r;function r(a,l,i){var s=l[0],o=l[1],c=l[2],p=i[0],d=i[1],y=i[2];return a[0]=o*y-c*d,a[1]=c*p-s*y,a[2]=s*d-o*p,a}}),5964:(function(t){t.exports=function(r){return!r&&r!==0?"":r.toString()}}),5995:(function(t,r,a){t.exports=s;var l=a(7642),i=a(6037);function s(o,c){return l(c).filter(function(p){for(var d=new Array(p.length),y=0;y2&&m[1]>2&&E(h.pick(-1,-1).lo(1,1).hi(m[0]-2,m[1]-2),_.pick(-1,-1,0).lo(1,1).hi(m[0]-2,m[1]-2),_.pick(-1,-1,1).lo(1,1).hi(m[0]-2,m[1]-2)),m[1]>2&&(T(h.pick(0,-1).lo(1).hi(m[1]-2),_.pick(0,-1,1).lo(1).hi(m[1]-2)),I(_.pick(0,-1,0).lo(1).hi(m[1]-2))),m[1]>2&&(T(h.pick(m[0]-1,-1).lo(1).hi(m[1]-2),_.pick(m[0]-1,-1,1).lo(1).hi(m[1]-2)),I(_.pick(m[0]-1,-1,0).lo(1).hi(m[1]-2))),m[0]>2&&(T(h.pick(-1,0).lo(1).hi(m[0]-2),_.pick(-1,0,0).lo(1).hi(m[0]-2)),I(_.pick(-1,0,1).lo(1).hi(m[0]-2))),m[0]>2&&(T(h.pick(-1,m[1]-1).lo(1).hi(m[0]-2),_.pick(-1,m[1]-1,0).lo(1).hi(m[0]-2)),I(_.pick(-1,m[1]-1,1).lo(1).hi(m[0]-2))),_.set(0,0,0,0),_.set(0,0,1,0),_.set(m[0]-1,0,0,0),_.set(m[0]-1,0,1,0),_.set(0,m[1]-1,0,0),_.set(0,m[1]-1,1,0),_.set(m[0]-1,m[1]-1,0,0),_.set(m[0]-1,m[1]-1,1,0),_}}function A(k){var I=k.join(),m=y[I];if(m)return m;for(var T=k.length,E=[g,C],_=1;_<=T;++_)E.push(f(_));var h=x,m=h.apply(void 0,E);return y[I]=m,m}t.exports=function(I,T,E){if(Array.isArray(E)||(typeof E=="string"?E=l(T.dimension,E):E=l(T.dimension,"clamp")),T.size===0)return I;if(T.dimension===0)return I.set(0),I;var _=A(E);return _(I,T)}}),6204:(function(t){t.exports=r;function r(a){var l,i,s,o=a.length,c=0;for(l=0;ly&&(y=l.length(z)),w&&!m){var U=2*l.distance(I,F)/(l.length(T)+l.length(z));U?(_=Math.min(_,U),h=!1):h=!0}h||(I=F,T=z),E.push(z)}var V=[g,f,A],G=[C,x,k];o&&(o[0]=V,o[1]=G),y===0&&(y=1);var j=1/y;isFinite(_)||(_=1),d.vectorScale=_;var O=s.coneSize||(m?1:.5);s.absoluteConeSize&&(O=s.absoluteConeSize*j),d.coneScale=O;for(var w=0,H=0;wue&&(G|=1<ue){G|=1<d[z][1])&&(ye=z);for(var le=-1,z=0;z<3;++z){var Z=ye^1<d[de][0]&&(de=Z)}}var pe=A;pe[0]=pe[1]=pe[2]=0,pe[l.log2(le^ye)]=ye&le,pe[l.log2(ye^de)]=ye&de;var Te=de^7;Te===G||Te===ne?(Te=le^7,pe[l.log2(de^Te)]=Te&de):pe[l.log2(le^Te)]=Te≤for(var Ne=k,$e=G,H=0;H<3;++H)$e&1<=0&&(d=c.length-p-1);var y=Math.pow(10,d),g=Math.round(s*o*y),C=g+"";if(C.indexOf("e")>=0)return C;var f=g/y,x=g%y;g<0?(f=-Math.ceil(f)|0,x=-x|0):(f=Math.floor(f)|0,x=x|0);var A=""+f;if(g<0&&(A="-"+A),d){for(var k=""+x;k.length=s[0][p];--y)d.push({x:y*o[p],text:a(o[p],y)});c.push(d)}return c}function i(s,o){for(var c=0;c<3;++c){if(s[c].length!==o[c].length)return!1;for(var p=0;pI+1)throw new Error(A+" map requires nshades to be at least size "+x.length);Array.isArray(d.alpha)?d.alpha.length!==2?T=[1,1]:T=d.alpha.slice():typeof d.alpha=="number"?T=[d.alpha,d.alpha]:T=[1,1],y=x.map(function(F){return Math.round(F.index*I)}),T[0]=Math.min(Math.max(T[0],0),1),T[1]=Math.min(Math.max(T[1],0),1);var _=x.map(function(F,z){var U=x[z].index,V=x[z].rgb.slice();return V.length===4&&V[3]>=0&&V[3]<=1||(V[3]=T[0]+(T[1]-T[0])*U),V}),h=[];for(E=0;E 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, tubeScale; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * tubePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(tubePosition, 1.0); + vec4 t_position = view * tubePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = tubePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),s=l([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),o=l([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // 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). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float tubeScale; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + gl_Position = projection * (view * tubePosition); + f_id = id; + f_position = position.xyz; +} +`]),c=l([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);r.meshShader={vertex:i,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:c,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}}),6743:(function(t){t.exports=r;function r(a,l,i){var s=l[0],o=l[1],c=l[2],p=l[3],d=s+s,y=o+o,g=c+c,C=s*d,f=s*y,x=s*g,A=o*y,k=o*g,I=c*g,T=p*d,E=p*y,_=p*g;return a[0]=1-(A+I),a[1]=f+_,a[2]=x-E,a[3]=0,a[4]=f-_,a[5]=1-(C+I),a[6]=k+T,a[7]=0,a[8]=x+E,a[9]=k-T,a[10]=1-(C+A),a[11]=0,a[12]=i[0],a[13]=i[1],a[14]=i[2],a[15]=1,a}}),6760:(function(t){t.exports=r;function r(a,l,i){var s=l[0],o=l[1],c=l[2],p=l[3],d=l[4],y=l[5],g=l[6],C=l[7],f=l[8],x=l[9],A=l[10],k=l[11],I=l[12],T=l[13],E=l[14],_=l[15],h=i[0],m=i[1],w=i[2],F=i[3];return a[0]=h*s+m*d+w*f+F*I,a[1]=h*o+m*y+w*x+F*T,a[2]=h*c+m*g+w*A+F*E,a[3]=h*p+m*C+w*k+F*_,h=i[4],m=i[5],w=i[6],F=i[7],a[4]=h*s+m*d+w*f+F*I,a[5]=h*o+m*y+w*x+F*T,a[6]=h*c+m*g+w*A+F*E,a[7]=h*p+m*C+w*k+F*_,h=i[8],m=i[9],w=i[10],F=i[11],a[8]=h*s+m*d+w*f+F*I,a[9]=h*o+m*y+w*x+F*T,a[10]=h*c+m*g+w*A+F*E,a[11]=h*p+m*C+w*k+F*_,h=i[12],m=i[13],w=i[14],F=i[15],a[12]=h*s+m*d+w*f+F*I,a[13]=h*o+m*y+w*x+F*T,a[14]=h*c+m*g+w*A+F*E,a[15]=h*p+m*C+w*k+F*_,a}}),6768:(function(t,r,a){var l=a(6859);t.exports=i;function i(s){return new l(s)}}),6803:(function(t,r,a){a(8828),a(1755);function l(i,s){var o=i.length,c=i.length-s.length,p=Math.min;if(c)return c;switch(o){case 0:return 0;case 1:return i[0]-s[0];case 2:var f=i[0]+i[1]-s[0]-s[1];return f||p(i[0],i[1])-p(s[0],s[1]);case 3:var d=i[0]+i[1],y=s[0]+s[1];if(f=d+i[2]-(y+s[2]),f)return f;var g=p(i[0],i[1]),C=p(s[0],s[1]),f=p(g,i[2])-p(C,s[2]);return f||p(g+i[2],d)-p(C+s[2],y);default:var x=i.slice(0);x.sort();var A=s.slice(0);A.sort();for(var k=0;k0?O:H},c.min=function(O,H){return O.cmp(H)<0?O:H},c.prototype._init=function(O,H,W){if(typeof O=="number")return this._initNumber(O,H,W);if(typeof O=="object")return this._initArray(O,H,W);H==="hex"&&(H=16),s(H===(H|0)&&H>=2&&H<=36),O=O.toString().replace(/\s+/g,"");var ee=0;O[0]==="-"&&(ee++,this.negative=1),ee=0;ee-=3)xe=O[ee]|O[ee-1]<<8|O[ee-2]<<16,this.words[ue]|=xe<>>26-ge&67108863,ge+=24,ge>=26&&(ge-=26,ue++);else if(W==="le")for(ee=0,ue=0;ee>>26-ge&67108863,ge+=24,ge>=26&&(ge-=26,ue++);return this.strip()};function d(j,O){var H=j.charCodeAt(O);return H>=65&&H<=70?H-55:H>=97&&H<=102?H-87:H-48&15}function y(j,O,H){var W=d(j,H);return H-1>=O&&(W|=d(j,H-1)<<4),W}c.prototype._parseHex=function(O,H,W){this.length=Math.ceil((O.length-H)/6),this.words=new Array(this.length);for(var ee=0;ee=H;ee-=2)ge=y(O,H,ee)<=18?(ue-=18,xe+=1,this.words[xe]|=ge>>>26):ue+=8;else{var _e=O.length-H;for(ee=_e%2===0?H+1:H;ee=18?(ue-=18,xe+=1,this.words[xe]|=ge>>>26):ue+=8}this.strip()};function g(j,O,H,W){for(var ee=0,ue=Math.min(j.length,H),xe=O;xe=49?ee+=ge-49+10:ge>=17?ee+=ge-17+10:ee+=ge}return ee}c.prototype._parseBase=function(O,H,W){this.words=[0],this.length=1;for(var ee=0,ue=1;ue<=67108863;ue*=H)ee++;ee--,ue=ue/H|0;for(var xe=O.length-W,ge=xe%ee,_e=Math.min(xe,xe-ge)+W,Y=0,se=W;se<_e;se+=ee)Y=g(O,se,se+ee,H),this.imuln(ue),this.words[0]+Y<67108864?this.words[0]+=Y:this._iaddn(Y);if(ge!==0){var ce=1;for(Y=g(O,se,O.length,H),se=0;se1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.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],x=[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];c.prototype.toString=function(O,H){O=O||10,H=H|0||1;var W;if(O===16||O==="hex"){W="";for(var ee=0,ue=0,xe=0;xe>>24-ee&16777215,ue!==0||xe!==this.length-1?W=C[6-_e.length]+_e+W:W=_e+W,ee+=2,ee>=26&&(ee-=26,xe--)}for(ue!==0&&(W=ue.toString(16)+W);W.length%H!==0;)W="0"+W;return this.negative!==0&&(W="-"+W),W}if(O===(O|0)&&O>=2&&O<=36){var Y=f[O],se=x[O];W="";var ce=this.clone();for(ce.negative=0;!ce.isZero();){var ne=ce.modn(se).toString(O);ce=ce.idivn(se),ce.isZero()?W=ne+W:W=C[Y-ne.length]+ne+W}for(this.isZero()&&(W="0"+W);W.length%H!==0;)W="0"+W;return this.negative!==0&&(W="-"+W),W}s(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var O=this.words[0];return this.length===2?O+=this.words[1]*67108864:this.length===3&&this.words[2]===1?O+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-O:O},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(O,H){return s(typeof p<"u"),this.toArrayLike(p,O,H)},c.prototype.toArray=function(O,H){return this.toArrayLike(Array,O,H)},c.prototype.toArrayLike=function(O,H,W){var ee=this.byteLength(),ue=W||Math.max(1,ee);s(ee<=ue,"byte array longer than desired length"),s(ue>0,"Requested array length <= 0"),this.strip();var xe=H==="le",ge=new O(ue),_e,Y,se=this.clone();if(xe){for(Y=0;!se.isZero();Y++)_e=se.andln(255),se.iushrn(8),ge[Y]=_e;for(;Y=4096&&(W+=13,H>>>=13),H>=64&&(W+=7,H>>>=7),H>=8&&(W+=4,H>>>=4),H>=2&&(W+=2,H>>>=2),W+H},c.prototype._zeroBits=function(O){if(O===0)return 26;var H=O,W=0;return(H&8191)===0&&(W+=13,H>>>=13),(H&127)===0&&(W+=7,H>>>=7),(H&15)===0&&(W+=4,H>>>=4),(H&3)===0&&(W+=2,H>>>=2),(H&1)===0&&W++,W},c.prototype.bitLength=function(){var O=this.words[this.length-1],H=this._countBits(O);return(this.length-1)*26+H};function A(j){for(var O=new Array(j.bitLength()),H=0;H>>ee}return O}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var O=0,H=0;HO.length?this.clone().ior(O):O.clone().ior(this)},c.prototype.uor=function(O){return this.length>O.length?this.clone().iuor(O):O.clone().iuor(this)},c.prototype.iuand=function(O){var H;this.length>O.length?H=O:H=this;for(var W=0;WO.length?this.clone().iand(O):O.clone().iand(this)},c.prototype.uand=function(O){return this.length>O.length?this.clone().iuand(O):O.clone().iuand(this)},c.prototype.iuxor=function(O){var H,W;this.length>O.length?(H=this,W=O):(H=O,W=this);for(var ee=0;eeO.length?this.clone().ixor(O):O.clone().ixor(this)},c.prototype.uxor=function(O){return this.length>O.length?this.clone().iuxor(O):O.clone().iuxor(this)},c.prototype.inotn=function(O){s(typeof O=="number"&&O>=0);var H=Math.ceil(O/26)|0,W=O%26;this._expand(H),W>0&&H--;for(var ee=0;ee0&&(this.words[ee]=~this.words[ee]&67108863>>26-W),this.strip()},c.prototype.notn=function(O){return this.clone().inotn(O)},c.prototype.setn=function(O,H){s(typeof O=="number"&&O>=0);var W=O/26|0,ee=O%26;return this._expand(W+1),H?this.words[W]=this.words[W]|1<O.length?(W=this,ee=O):(W=O,ee=this);for(var ue=0,xe=0;xe>>26;for(;ue!==0&&xe>>26;if(this.length=W.length,ue!==0)this.words[this.length]=ue,this.length++;else if(W!==this)for(;xeO.length?this.clone().iadd(O):O.clone().iadd(this)},c.prototype.isub=function(O){if(O.negative!==0){O.negative=0;var H=this.iadd(O);return O.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(O),this.negative=1,this._normSign();var W=this.cmp(O);if(W===0)return this.negative=0,this.length=1,this.words[0]=0,this;var ee,ue;W>0?(ee=this,ue=O):(ee=O,ue=this);for(var xe=0,ge=0;ge>26,this.words[ge]=H&67108863;for(;xe!==0&&ge>26,this.words[ge]=H&67108863;if(xe===0&&ge>>26,ce=_e&67108863,ne=Math.min(Y,O.length-1),ye=Math.max(0,Y-j.length+1);ye<=ne;ye++){var le=Y-ye|0;ee=j.words[le]|0,ue=O.words[ye]|0,xe=ee*ue+ce,se+=xe/67108864|0,ce=xe&67108863}H.words[Y]=ce|0,_e=se|0}return _e!==0?H.words[Y]=_e|0:H.length--,H.strip()}var I=function(O,H,W){var ee=O.words,ue=H.words,xe=W.words,ge=0,_e,Y,se,ce=ee[0]|0,ne=ce&8191,ye=ce>>>13,le=ee[1]|0,Z=le&8191,de=le>>>13,pe=ee[2]|0,Te=pe&8191,Ne=pe>>>13,$e=ee[3]|0,Ze=$e&8191,Xe=$e>>>13,it=ee[4]|0,yt=it&8191,bt=it>>>13,mt=ee[5]|0,ht=mt&8191,Ve=mt>>>13,ze=ee[6]|0,Se=ze&8191,Je=ze>>>13,_t=ee[7]|0,At=_t&8191,vt=_t>>>13,Kt=ee[8]|0,Qt=Kt&8191,fr=Kt>>>13,mr=ee[9]|0,Ur=mr&8191,Br=mr>>>13,fn=ue[0]|0,Fr=fn&8191,Qr=fn>>>13,Bt=ue[1]|0,et=Bt&8191,ut=Bt>>>13,Be=ue[2]|0,Ie=Be&8191,ke=Be>>>13,Fe=ue[3]|0,at=Fe&8191,ct=Fe>>>13,Gt=ue[4]|0,Vt=Gt&8191,Zt=Gt>>>13,ur=ue[5]|0,Dr=ur&8191,kr=ur>>>13,Sr=ue[6]|0,Jr=Sr&8191,jn=Sr>>>13,ha=ue[7]|0,oa=ha&8191,_a=ha>>>13,xa=ue[8]|0,ra=xa&8191,Ha=xa>>>13,ci=ue[9]|0,_r=ci&8191,rr=ci>>>13;W.negative=O.negative^H.negative,W.length=19,_e=Math.imul(ne,Fr),Y=Math.imul(ne,Qr),Y=Y+Math.imul(ye,Fr)|0,se=Math.imul(ye,Qr);var yr=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(yr>>>26)|0,yr&=67108863,_e=Math.imul(Z,Fr),Y=Math.imul(Z,Qr),Y=Y+Math.imul(de,Fr)|0,se=Math.imul(de,Qr),_e=_e+Math.imul(ne,et)|0,Y=Y+Math.imul(ne,ut)|0,Y=Y+Math.imul(ye,et)|0,se=se+Math.imul(ye,ut)|0;var br=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(br>>>26)|0,br&=67108863,_e=Math.imul(Te,Fr),Y=Math.imul(Te,Qr),Y=Y+Math.imul(Ne,Fr)|0,se=Math.imul(Ne,Qr),_e=_e+Math.imul(Z,et)|0,Y=Y+Math.imul(Z,ut)|0,Y=Y+Math.imul(de,et)|0,se=se+Math.imul(de,ut)|0,_e=_e+Math.imul(ne,Ie)|0,Y=Y+Math.imul(ne,ke)|0,Y=Y+Math.imul(ye,Ie)|0,se=se+Math.imul(ye,ke)|0;var an=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(an>>>26)|0,an&=67108863,_e=Math.imul(Ze,Fr),Y=Math.imul(Ze,Qr),Y=Y+Math.imul(Xe,Fr)|0,se=Math.imul(Xe,Qr),_e=_e+Math.imul(Te,et)|0,Y=Y+Math.imul(Te,ut)|0,Y=Y+Math.imul(Ne,et)|0,se=se+Math.imul(Ne,ut)|0,_e=_e+Math.imul(Z,Ie)|0,Y=Y+Math.imul(Z,ke)|0,Y=Y+Math.imul(de,Ie)|0,se=se+Math.imul(de,ke)|0,_e=_e+Math.imul(ne,at)|0,Y=Y+Math.imul(ne,ct)|0,Y=Y+Math.imul(ye,at)|0,se=se+Math.imul(ye,ct)|0;var bn=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(bn>>>26)|0,bn&=67108863,_e=Math.imul(yt,Fr),Y=Math.imul(yt,Qr),Y=Y+Math.imul(bt,Fr)|0,se=Math.imul(bt,Qr),_e=_e+Math.imul(Ze,et)|0,Y=Y+Math.imul(Ze,ut)|0,Y=Y+Math.imul(Xe,et)|0,se=se+Math.imul(Xe,ut)|0,_e=_e+Math.imul(Te,Ie)|0,Y=Y+Math.imul(Te,ke)|0,Y=Y+Math.imul(Ne,Ie)|0,se=se+Math.imul(Ne,ke)|0,_e=_e+Math.imul(Z,at)|0,Y=Y+Math.imul(Z,ct)|0,Y=Y+Math.imul(de,at)|0,se=se+Math.imul(de,ct)|0,_e=_e+Math.imul(ne,Vt)|0,Y=Y+Math.imul(ne,Zt)|0,Y=Y+Math.imul(ye,Vt)|0,se=se+Math.imul(ye,Zt)|0;var In=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(In>>>26)|0,In&=67108863,_e=Math.imul(ht,Fr),Y=Math.imul(ht,Qr),Y=Y+Math.imul(Ve,Fr)|0,se=Math.imul(Ve,Qr),_e=_e+Math.imul(yt,et)|0,Y=Y+Math.imul(yt,ut)|0,Y=Y+Math.imul(bt,et)|0,se=se+Math.imul(bt,ut)|0,_e=_e+Math.imul(Ze,Ie)|0,Y=Y+Math.imul(Ze,ke)|0,Y=Y+Math.imul(Xe,Ie)|0,se=se+Math.imul(Xe,ke)|0,_e=_e+Math.imul(Te,at)|0,Y=Y+Math.imul(Te,ct)|0,Y=Y+Math.imul(Ne,at)|0,se=se+Math.imul(Ne,ct)|0,_e=_e+Math.imul(Z,Vt)|0,Y=Y+Math.imul(Z,Zt)|0,Y=Y+Math.imul(de,Vt)|0,se=se+Math.imul(de,Zt)|0,_e=_e+Math.imul(ne,Dr)|0,Y=Y+Math.imul(ne,kr)|0,Y=Y+Math.imul(ye,Dr)|0,se=se+Math.imul(ye,kr)|0;var Fn=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,_e=Math.imul(Se,Fr),Y=Math.imul(Se,Qr),Y=Y+Math.imul(Je,Fr)|0,se=Math.imul(Je,Qr),_e=_e+Math.imul(ht,et)|0,Y=Y+Math.imul(ht,ut)|0,Y=Y+Math.imul(Ve,et)|0,se=se+Math.imul(Ve,ut)|0,_e=_e+Math.imul(yt,Ie)|0,Y=Y+Math.imul(yt,ke)|0,Y=Y+Math.imul(bt,Ie)|0,se=se+Math.imul(bt,ke)|0,_e=_e+Math.imul(Ze,at)|0,Y=Y+Math.imul(Ze,ct)|0,Y=Y+Math.imul(Xe,at)|0,se=se+Math.imul(Xe,ct)|0,_e=_e+Math.imul(Te,Vt)|0,Y=Y+Math.imul(Te,Zt)|0,Y=Y+Math.imul(Ne,Vt)|0,se=se+Math.imul(Ne,Zt)|0,_e=_e+Math.imul(Z,Dr)|0,Y=Y+Math.imul(Z,kr)|0,Y=Y+Math.imul(de,Dr)|0,se=se+Math.imul(de,kr)|0,_e=_e+Math.imul(ne,Jr)|0,Y=Y+Math.imul(ne,jn)|0,Y=Y+Math.imul(ye,Jr)|0,se=se+Math.imul(ye,jn)|0;var va=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(va>>>26)|0,va&=67108863,_e=Math.imul(At,Fr),Y=Math.imul(At,Qr),Y=Y+Math.imul(vt,Fr)|0,se=Math.imul(vt,Qr),_e=_e+Math.imul(Se,et)|0,Y=Y+Math.imul(Se,ut)|0,Y=Y+Math.imul(Je,et)|0,se=se+Math.imul(Je,ut)|0,_e=_e+Math.imul(ht,Ie)|0,Y=Y+Math.imul(ht,ke)|0,Y=Y+Math.imul(Ve,Ie)|0,se=se+Math.imul(Ve,ke)|0,_e=_e+Math.imul(yt,at)|0,Y=Y+Math.imul(yt,ct)|0,Y=Y+Math.imul(bt,at)|0,se=se+Math.imul(bt,ct)|0,_e=_e+Math.imul(Ze,Vt)|0,Y=Y+Math.imul(Ze,Zt)|0,Y=Y+Math.imul(Xe,Vt)|0,se=se+Math.imul(Xe,Zt)|0,_e=_e+Math.imul(Te,Dr)|0,Y=Y+Math.imul(Te,kr)|0,Y=Y+Math.imul(Ne,Dr)|0,se=se+Math.imul(Ne,kr)|0,_e=_e+Math.imul(Z,Jr)|0,Y=Y+Math.imul(Z,jn)|0,Y=Y+Math.imul(de,Jr)|0,se=se+Math.imul(de,jn)|0,_e=_e+Math.imul(ne,oa)|0,Y=Y+Math.imul(ne,_a)|0,Y=Y+Math.imul(ye,oa)|0,se=se+Math.imul(ye,_a)|0;var Pa=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,_e=Math.imul(Qt,Fr),Y=Math.imul(Qt,Qr),Y=Y+Math.imul(fr,Fr)|0,se=Math.imul(fr,Qr),_e=_e+Math.imul(At,et)|0,Y=Y+Math.imul(At,ut)|0,Y=Y+Math.imul(vt,et)|0,se=se+Math.imul(vt,ut)|0,_e=_e+Math.imul(Se,Ie)|0,Y=Y+Math.imul(Se,ke)|0,Y=Y+Math.imul(Je,Ie)|0,se=se+Math.imul(Je,ke)|0,_e=_e+Math.imul(ht,at)|0,Y=Y+Math.imul(ht,ct)|0,Y=Y+Math.imul(Ve,at)|0,se=se+Math.imul(Ve,ct)|0,_e=_e+Math.imul(yt,Vt)|0,Y=Y+Math.imul(yt,Zt)|0,Y=Y+Math.imul(bt,Vt)|0,se=se+Math.imul(bt,Zt)|0,_e=_e+Math.imul(Ze,Dr)|0,Y=Y+Math.imul(Ze,kr)|0,Y=Y+Math.imul(Xe,Dr)|0,se=se+Math.imul(Xe,kr)|0,_e=_e+Math.imul(Te,Jr)|0,Y=Y+Math.imul(Te,jn)|0,Y=Y+Math.imul(Ne,Jr)|0,se=se+Math.imul(Ne,jn)|0,_e=_e+Math.imul(Z,oa)|0,Y=Y+Math.imul(Z,_a)|0,Y=Y+Math.imul(de,oa)|0,se=se+Math.imul(de,_a)|0,_e=_e+Math.imul(ne,ra)|0,Y=Y+Math.imul(ne,Ha)|0,Y=Y+Math.imul(ye,ra)|0,se=se+Math.imul(ye,Ha)|0;var La=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(La>>>26)|0,La&=67108863,_e=Math.imul(Ur,Fr),Y=Math.imul(Ur,Qr),Y=Y+Math.imul(Br,Fr)|0,se=Math.imul(Br,Qr),_e=_e+Math.imul(Qt,et)|0,Y=Y+Math.imul(Qt,ut)|0,Y=Y+Math.imul(fr,et)|0,se=se+Math.imul(fr,ut)|0,_e=_e+Math.imul(At,Ie)|0,Y=Y+Math.imul(At,ke)|0,Y=Y+Math.imul(vt,Ie)|0,se=se+Math.imul(vt,ke)|0,_e=_e+Math.imul(Se,at)|0,Y=Y+Math.imul(Se,ct)|0,Y=Y+Math.imul(Je,at)|0,se=se+Math.imul(Je,ct)|0,_e=_e+Math.imul(ht,Vt)|0,Y=Y+Math.imul(ht,Zt)|0,Y=Y+Math.imul(Ve,Vt)|0,se=se+Math.imul(Ve,Zt)|0,_e=_e+Math.imul(yt,Dr)|0,Y=Y+Math.imul(yt,kr)|0,Y=Y+Math.imul(bt,Dr)|0,se=se+Math.imul(bt,kr)|0,_e=_e+Math.imul(Ze,Jr)|0,Y=Y+Math.imul(Ze,jn)|0,Y=Y+Math.imul(Xe,Jr)|0,se=se+Math.imul(Xe,jn)|0,_e=_e+Math.imul(Te,oa)|0,Y=Y+Math.imul(Te,_a)|0,Y=Y+Math.imul(Ne,oa)|0,se=se+Math.imul(Ne,_a)|0,_e=_e+Math.imul(Z,ra)|0,Y=Y+Math.imul(Z,Ha)|0,Y=Y+Math.imul(de,ra)|0,se=se+Math.imul(de,Ha)|0,_e=_e+Math.imul(ne,_r)|0,Y=Y+Math.imul(ne,rr)|0,Y=Y+Math.imul(ye,_r)|0,se=se+Math.imul(ye,rr)|0;var Oa=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(Oa>>>26)|0,Oa&=67108863,_e=Math.imul(Ur,et),Y=Math.imul(Ur,ut),Y=Y+Math.imul(Br,et)|0,se=Math.imul(Br,ut),_e=_e+Math.imul(Qt,Ie)|0,Y=Y+Math.imul(Qt,ke)|0,Y=Y+Math.imul(fr,Ie)|0,se=se+Math.imul(fr,ke)|0,_e=_e+Math.imul(At,at)|0,Y=Y+Math.imul(At,ct)|0,Y=Y+Math.imul(vt,at)|0,se=se+Math.imul(vt,ct)|0,_e=_e+Math.imul(Se,Vt)|0,Y=Y+Math.imul(Se,Zt)|0,Y=Y+Math.imul(Je,Vt)|0,se=se+Math.imul(Je,Zt)|0,_e=_e+Math.imul(ht,Dr)|0,Y=Y+Math.imul(ht,kr)|0,Y=Y+Math.imul(Ve,Dr)|0,se=se+Math.imul(Ve,kr)|0,_e=_e+Math.imul(yt,Jr)|0,Y=Y+Math.imul(yt,jn)|0,Y=Y+Math.imul(bt,Jr)|0,se=se+Math.imul(bt,jn)|0,_e=_e+Math.imul(Ze,oa)|0,Y=Y+Math.imul(Ze,_a)|0,Y=Y+Math.imul(Xe,oa)|0,se=se+Math.imul(Xe,_a)|0,_e=_e+Math.imul(Te,ra)|0,Y=Y+Math.imul(Te,Ha)|0,Y=Y+Math.imul(Ne,ra)|0,se=se+Math.imul(Ne,Ha)|0,_e=_e+Math.imul(Z,_r)|0,Y=Y+Math.imul(Z,rr)|0,Y=Y+Math.imul(de,_r)|0,se=se+Math.imul(de,rr)|0;var Wa=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(Wa>>>26)|0,Wa&=67108863,_e=Math.imul(Ur,Ie),Y=Math.imul(Ur,ke),Y=Y+Math.imul(Br,Ie)|0,se=Math.imul(Br,ke),_e=_e+Math.imul(Qt,at)|0,Y=Y+Math.imul(Qt,ct)|0,Y=Y+Math.imul(fr,at)|0,se=se+Math.imul(fr,ct)|0,_e=_e+Math.imul(At,Vt)|0,Y=Y+Math.imul(At,Zt)|0,Y=Y+Math.imul(vt,Vt)|0,se=se+Math.imul(vt,Zt)|0,_e=_e+Math.imul(Se,Dr)|0,Y=Y+Math.imul(Se,kr)|0,Y=Y+Math.imul(Je,Dr)|0,se=se+Math.imul(Je,kr)|0,_e=_e+Math.imul(ht,Jr)|0,Y=Y+Math.imul(ht,jn)|0,Y=Y+Math.imul(Ve,Jr)|0,se=se+Math.imul(Ve,jn)|0,_e=_e+Math.imul(yt,oa)|0,Y=Y+Math.imul(yt,_a)|0,Y=Y+Math.imul(bt,oa)|0,se=se+Math.imul(bt,_a)|0,_e=_e+Math.imul(Ze,ra)|0,Y=Y+Math.imul(Ze,Ha)|0,Y=Y+Math.imul(Xe,ra)|0,se=se+Math.imul(Xe,Ha)|0,_e=_e+Math.imul(Te,_r)|0,Y=Y+Math.imul(Te,rr)|0,Y=Y+Math.imul(Ne,_r)|0,se=se+Math.imul(Ne,rr)|0;var sa=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(sa>>>26)|0,sa&=67108863,_e=Math.imul(Ur,at),Y=Math.imul(Ur,ct),Y=Y+Math.imul(Br,at)|0,se=Math.imul(Br,ct),_e=_e+Math.imul(Qt,Vt)|0,Y=Y+Math.imul(Qt,Zt)|0,Y=Y+Math.imul(fr,Vt)|0,se=se+Math.imul(fr,Zt)|0,_e=_e+Math.imul(At,Dr)|0,Y=Y+Math.imul(At,kr)|0,Y=Y+Math.imul(vt,Dr)|0,se=se+Math.imul(vt,kr)|0,_e=_e+Math.imul(Se,Jr)|0,Y=Y+Math.imul(Se,jn)|0,Y=Y+Math.imul(Je,Jr)|0,se=se+Math.imul(Je,jn)|0,_e=_e+Math.imul(ht,oa)|0,Y=Y+Math.imul(ht,_a)|0,Y=Y+Math.imul(Ve,oa)|0,se=se+Math.imul(Ve,_a)|0,_e=_e+Math.imul(yt,ra)|0,Y=Y+Math.imul(yt,Ha)|0,Y=Y+Math.imul(bt,ra)|0,se=se+Math.imul(bt,Ha)|0,_e=_e+Math.imul(Ze,_r)|0,Y=Y+Math.imul(Ze,rr)|0,Y=Y+Math.imul(Xe,_r)|0,se=se+Math.imul(Xe,rr)|0;var ji=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(ji>>>26)|0,ji&=67108863,_e=Math.imul(Ur,Vt),Y=Math.imul(Ur,Zt),Y=Y+Math.imul(Br,Vt)|0,se=Math.imul(Br,Zt),_e=_e+Math.imul(Qt,Dr)|0,Y=Y+Math.imul(Qt,kr)|0,Y=Y+Math.imul(fr,Dr)|0,se=se+Math.imul(fr,kr)|0,_e=_e+Math.imul(At,Jr)|0,Y=Y+Math.imul(At,jn)|0,Y=Y+Math.imul(vt,Jr)|0,se=se+Math.imul(vt,jn)|0,_e=_e+Math.imul(Se,oa)|0,Y=Y+Math.imul(Se,_a)|0,Y=Y+Math.imul(Je,oa)|0,se=se+Math.imul(Je,_a)|0,_e=_e+Math.imul(ht,ra)|0,Y=Y+Math.imul(ht,Ha)|0,Y=Y+Math.imul(Ve,ra)|0,se=se+Math.imul(Ve,Ha)|0,_e=_e+Math.imul(yt,_r)|0,Y=Y+Math.imul(yt,rr)|0,Y=Y+Math.imul(bt,_r)|0,se=se+Math.imul(bt,rr)|0;var Qi=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,_e=Math.imul(Ur,Dr),Y=Math.imul(Ur,kr),Y=Y+Math.imul(Br,Dr)|0,se=Math.imul(Br,kr),_e=_e+Math.imul(Qt,Jr)|0,Y=Y+Math.imul(Qt,jn)|0,Y=Y+Math.imul(fr,Jr)|0,se=se+Math.imul(fr,jn)|0,_e=_e+Math.imul(At,oa)|0,Y=Y+Math.imul(At,_a)|0,Y=Y+Math.imul(vt,oa)|0,se=se+Math.imul(vt,_a)|0,_e=_e+Math.imul(Se,ra)|0,Y=Y+Math.imul(Se,Ha)|0,Y=Y+Math.imul(Je,ra)|0,se=se+Math.imul(Je,Ha)|0,_e=_e+Math.imul(ht,_r)|0,Y=Y+Math.imul(ht,rr)|0,Y=Y+Math.imul(Ve,_r)|0,se=se+Math.imul(Ve,rr)|0;var Xt=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,_e=Math.imul(Ur,Jr),Y=Math.imul(Ur,jn),Y=Y+Math.imul(Br,Jr)|0,se=Math.imul(Br,jn),_e=_e+Math.imul(Qt,oa)|0,Y=Y+Math.imul(Qt,_a)|0,Y=Y+Math.imul(fr,oa)|0,se=se+Math.imul(fr,_a)|0,_e=_e+Math.imul(At,ra)|0,Y=Y+Math.imul(At,Ha)|0,Y=Y+Math.imul(vt,ra)|0,se=se+Math.imul(vt,Ha)|0,_e=_e+Math.imul(Se,_r)|0,Y=Y+Math.imul(Se,rr)|0,Y=Y+Math.imul(Je,_r)|0,se=se+Math.imul(Je,rr)|0;var Lt=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,_e=Math.imul(Ur,oa),Y=Math.imul(Ur,_a),Y=Y+Math.imul(Br,oa)|0,se=Math.imul(Br,_a),_e=_e+Math.imul(Qt,ra)|0,Y=Y+Math.imul(Qt,Ha)|0,Y=Y+Math.imul(fr,ra)|0,se=se+Math.imul(fr,Ha)|0,_e=_e+Math.imul(At,_r)|0,Y=Y+Math.imul(At,rr)|0,Y=Y+Math.imul(vt,_r)|0,se=se+Math.imul(vt,rr)|0;var $r=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+($r>>>26)|0,$r&=67108863,_e=Math.imul(Ur,ra),Y=Math.imul(Ur,Ha),Y=Y+Math.imul(Br,ra)|0,se=Math.imul(Br,Ha),_e=_e+Math.imul(Qt,_r)|0,Y=Y+Math.imul(Qt,rr)|0,Y=Y+Math.imul(fr,_r)|0,se=se+Math.imul(fr,rr)|0;var en=(ge+_e|0)+((Y&8191)<<13)|0;ge=(se+(Y>>>13)|0)+(en>>>26)|0,en&=67108863,_e=Math.imul(Ur,_r),Y=Math.imul(Ur,rr),Y=Y+Math.imul(Br,_r)|0,se=Math.imul(Br,rr);var rn=(ge+_e|0)+((Y&8191)<<13)|0;return ge=(se+(Y>>>13)|0)+(rn>>>26)|0,rn&=67108863,xe[0]=yr,xe[1]=br,xe[2]=an,xe[3]=bn,xe[4]=In,xe[5]=Fn,xe[6]=va,xe[7]=Pa,xe[8]=La,xe[9]=Oa,xe[10]=Wa,xe[11]=sa,xe[12]=ji,xe[13]=Qi,xe[14]=Xt,xe[15]=Lt,xe[16]=$r,xe[17]=en,xe[18]=rn,ge!==0&&(xe[19]=ge,W.length++),W};Math.imul||(I=k);function T(j,O,H){H.negative=O.negative^j.negative,H.length=j.length+O.length;for(var W=0,ee=0,ue=0;ue>>26)|0,ee+=xe>>>26,xe&=67108863}H.words[ue]=ge,W=xe,xe=ee}return W!==0?H.words[ue]=W:H.length--,H.strip()}function E(j,O,H){var W=new _;return W.mulp(j,O,H)}c.prototype.mulTo=function(O,H){var W,ee=this.length+O.length;return this.length===10&&O.length===10?W=I(this,O,H):ee<63?W=k(this,O,H):ee<1024?W=T(this,O,H):W=E(this,O,H),W};function _(j,O){this.x=j,this.y=O}_.prototype.makeRBT=function(O){for(var H=new Array(O),W=c.prototype._countBits(O)-1,ee=0;ee>=1;return ee},_.prototype.permute=function(O,H,W,ee,ue,xe){for(var ge=0;ge>>1)ue++;return 1<>>13,W[2*xe+1]=ue&8191,ue=ue>>>13;for(xe=2*H;xe>=26,H+=ee/67108864|0,H+=ue>>>26,this.words[W]=ue&67108863}return H!==0&&(this.words[W]=H,this.length++),this},c.prototype.muln=function(O){return this.clone().imuln(O)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(O){var H=A(O);if(H.length===0)return new c(1);for(var W=this,ee=0;ee=0);var H=O%26,W=(O-H)/26,ee=67108863>>>26-H<<26-H,ue;if(H!==0){var xe=0;for(ue=0;ue>>26-H}xe&&(this.words[ue]=xe,this.length++)}if(W!==0){for(ue=this.length-1;ue>=0;ue--)this.words[ue+W]=this.words[ue];for(ue=0;ue=0);var ee;H?ee=(H-H%26)/26:ee=0;var ue=O%26,xe=Math.min((O-ue)/26,this.length),ge=67108863^67108863>>>ue<xe)for(this.length-=xe,Y=0;Y=0&&(se!==0||Y>=ee);Y--){var ce=this.words[Y]|0;this.words[Y]=se<<26-ue|ce>>>ue,se=ce&ge}return _e&&se!==0&&(_e.words[_e.length++]=se),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(O,H,W){return s(this.negative===0),this.iushrn(O,H,W)},c.prototype.shln=function(O){return this.clone().ishln(O)},c.prototype.ushln=function(O){return this.clone().iushln(O)},c.prototype.shrn=function(O){return this.clone().ishrn(O)},c.prototype.ushrn=function(O){return this.clone().iushrn(O)},c.prototype.testn=function(O){s(typeof O=="number"&&O>=0);var H=O%26,W=(O-H)/26,ee=1<=0);var H=O%26,W=(O-H)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=W)return this;if(H!==0&&W++,this.length=Math.min(W,this.length),H!==0){var ee=67108863^67108863>>>H<=67108864;H++)this.words[H]-=67108864,H===this.length-1?this.words[H+1]=1:this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},c.prototype.isubn=function(O){if(s(typeof O=="number"),s(O<67108864),O<0)return this.iaddn(-O);if(this.negative!==0)return this.negative=0,this.iaddn(O),this.negative=1,this;if(this.words[0]-=O,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H>26)-(_e/67108864|0),this.words[ue+W]=xe&67108863}for(;ue>26,this.words[ue+W]=xe&67108863;if(ge===0)return this.strip();for(s(ge===-1),ge=0,ue=0;ue>26,this.words[ue]=xe&67108863;return this.negative=1,this.strip()},c.prototype._wordDiv=function(O,H){var W=this.length-O.length,ee=this.clone(),ue=O,xe=ue.words[ue.length-1]|0,ge=this._countBits(xe);W=26-ge,W!==0&&(ue=ue.ushln(W),ee.iushln(W),xe=ue.words[ue.length-1]|0);var _e=ee.length-ue.length,Y;if(H!=="mod"){Y=new c(null),Y.length=_e+1,Y.words=new Array(Y.length);for(var se=0;se=0;ne--){var ye=(ee.words[ue.length+ne]|0)*67108864+(ee.words[ue.length+ne-1]|0);for(ye=Math.min(ye/xe|0,67108863),ee._ishlnsubmul(ue,ye,ne);ee.negative!==0;)ye--,ee.negative=0,ee._ishlnsubmul(ue,1,ne),ee.isZero()||(ee.negative^=1);Y&&(Y.words[ne]=ye)}return Y&&Y.strip(),ee.strip(),H!=="div"&&W!==0&&ee.iushrn(W),{div:Y||null,mod:ee}},c.prototype.divmod=function(O,H,W){if(s(!O.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var ee,ue,xe;return this.negative!==0&&O.negative===0?(xe=this.neg().divmod(O,H),H!=="mod"&&(ee=xe.div.neg()),H!=="div"&&(ue=xe.mod.neg(),W&&ue.negative!==0&&ue.iadd(O)),{div:ee,mod:ue}):this.negative===0&&O.negative!==0?(xe=this.divmod(O.neg(),H),H!=="mod"&&(ee=xe.div.neg()),{div:ee,mod:xe.mod}):(this.negative&O.negative)!==0?(xe=this.neg().divmod(O.neg(),H),H!=="div"&&(ue=xe.mod.neg(),W&&ue.negative!==0&&ue.isub(O)),{div:xe.div,mod:ue}):O.length>this.length||this.cmp(O)<0?{div:new c(0),mod:this}:O.length===1?H==="div"?{div:this.divn(O.words[0]),mod:null}:H==="mod"?{div:null,mod:new c(this.modn(O.words[0]))}:{div:this.divn(O.words[0]),mod:new c(this.modn(O.words[0]))}:this._wordDiv(O,H)},c.prototype.div=function(O){return this.divmod(O,"div",!1).div},c.prototype.mod=function(O){return this.divmod(O,"mod",!1).mod},c.prototype.umod=function(O){return this.divmod(O,"mod",!0).mod},c.prototype.divRound=function(O){var H=this.divmod(O);if(H.mod.isZero())return H.div;var W=H.div.negative!==0?H.mod.isub(O):H.mod,ee=O.ushrn(1),ue=O.andln(1),xe=W.cmp(ee);return xe<0||ue===1&&xe===0?H.div:H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},c.prototype.modn=function(O){s(O<=67108863);for(var H=(1<<26)%O,W=0,ee=this.length-1;ee>=0;ee--)W=(H*W+(this.words[ee]|0))%O;return W},c.prototype.idivn=function(O){s(O<=67108863);for(var H=0,W=this.length-1;W>=0;W--){var ee=(this.words[W]|0)+H*67108864;this.words[W]=ee/O|0,H=ee%O}return this.strip()},c.prototype.divn=function(O){return this.clone().idivn(O)},c.prototype.egcd=function(O){s(O.negative===0),s(!O.isZero());var H=this,W=O.clone();H.negative!==0?H=H.umod(O):H=H.clone();for(var ee=new c(1),ue=new c(0),xe=new c(0),ge=new c(1),_e=0;H.isEven()&&W.isEven();)H.iushrn(1),W.iushrn(1),++_e;for(var Y=W.clone(),se=H.clone();!H.isZero();){for(var ce=0,ne=1;(H.words[0]&ne)===0&&ce<26;++ce,ne<<=1);if(ce>0)for(H.iushrn(ce);ce-- >0;)(ee.isOdd()||ue.isOdd())&&(ee.iadd(Y),ue.isub(se)),ee.iushrn(1),ue.iushrn(1);for(var ye=0,le=1;(W.words[0]&le)===0&&ye<26;++ye,le<<=1);if(ye>0)for(W.iushrn(ye);ye-- >0;)(xe.isOdd()||ge.isOdd())&&(xe.iadd(Y),ge.isub(se)),xe.iushrn(1),ge.iushrn(1);H.cmp(W)>=0?(H.isub(W),ee.isub(xe),ue.isub(ge)):(W.isub(H),xe.isub(ee),ge.isub(ue))}return{a:xe,b:ge,gcd:W.iushln(_e)}},c.prototype._invmp=function(O){s(O.negative===0),s(!O.isZero());var H=this,W=O.clone();H.negative!==0?H=H.umod(O):H=H.clone();for(var ee=new c(1),ue=new c(0),xe=W.clone();H.cmpn(1)>0&&W.cmpn(1)>0;){for(var ge=0,_e=1;(H.words[0]&_e)===0&&ge<26;++ge,_e<<=1);if(ge>0)for(H.iushrn(ge);ge-- >0;)ee.isOdd()&&ee.iadd(xe),ee.iushrn(1);for(var Y=0,se=1;(W.words[0]&se)===0&&Y<26;++Y,se<<=1);if(Y>0)for(W.iushrn(Y);Y-- >0;)ue.isOdd()&&ue.iadd(xe),ue.iushrn(1);H.cmp(W)>=0?(H.isub(W),ee.isub(ue)):(W.isub(H),ue.isub(ee))}var ce;return H.cmpn(1)===0?ce=ee:ce=ue,ce.cmpn(0)<0&&ce.iadd(O),ce},c.prototype.gcd=function(O){if(this.isZero())return O.abs();if(O.isZero())return this.abs();var H=this.clone(),W=O.clone();H.negative=0,W.negative=0;for(var ee=0;H.isEven()&&W.isEven();ee++)H.iushrn(1),W.iushrn(1);do{for(;H.isEven();)H.iushrn(1);for(;W.isEven();)W.iushrn(1);var ue=H.cmp(W);if(ue<0){var xe=H;H=W,W=xe}else if(ue===0||W.cmpn(1)===0)break;H.isub(W)}while(!0);return W.iushln(ee)},c.prototype.invm=function(O){return this.egcd(O).a.umod(O)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(O){return this.words[0]&O},c.prototype.bincn=function(O){s(typeof O=="number");var H=O%26,W=(O-H)/26,ee=1<>>26,ge&=67108863,this.words[xe]=ge}return ue!==0&&(this.words[xe]=ue,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(O){var H=O<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var W;if(this.length>1)W=1;else{H&&(O=-O),s(O<=67108863,"Number is too big");var ee=this.words[0]|0;W=ee===O?0:eeO.length)return 1;if(this.length=0;W--){var ee=this.words[W]|0,ue=O.words[W]|0;if(ee!==ue){eeue&&(H=1);break}}return H},c.prototype.gtn=function(O){return this.cmpn(O)===1},c.prototype.gt=function(O){return this.cmp(O)===1},c.prototype.gten=function(O){return this.cmpn(O)>=0},c.prototype.gte=function(O){return this.cmp(O)>=0},c.prototype.ltn=function(O){return this.cmpn(O)===-1},c.prototype.lt=function(O){return this.cmp(O)===-1},c.prototype.lten=function(O){return this.cmpn(O)<=0},c.prototype.lte=function(O){return this.cmp(O)<=0},c.prototype.eqn=function(O){return this.cmpn(O)===0},c.prototype.eq=function(O){return this.cmp(O)===0},c.red=function(O){return new V(O)},c.prototype.toRed=function(O){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),O.convertTo(this)._forceRed(O)},c.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(O){return this.red=O,this},c.prototype.forceRed=function(O){return s(!this.red,"Already a number in reduction context"),this._forceRed(O)},c.prototype.redAdd=function(O){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,O)},c.prototype.redIAdd=function(O){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,O)},c.prototype.redSub=function(O){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,O)},c.prototype.redISub=function(O){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,O)},c.prototype.redShl=function(O){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,O)},c.prototype.redMul=function(O){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,O),this.red.mul(this,O)},c.prototype.redIMul=function(O){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,O),this.red.imul(this,O)},c.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(O){return s(this.red&&!O.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,O)};var h={k256:null,p224:null,p192:null,p25519:null};function m(j,O){this.name=j,this.p=new c(O,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}m.prototype._tmp=function(){var O=new c(null);return O.words=new Array(Math.ceil(this.n/13)),O},m.prototype.ireduce=function(O){var H=O,W;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),W=H.bitLength();while(W>this.n);var ee=W0?H.isub(this.p):H.strip!==void 0?H.strip():H._strip(),H},m.prototype.split=function(O,H){O.iushrn(this.n,0,H)},m.prototype.imulK=function(O){return O.imul(this.k)};function w(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(w,m),w.prototype.split=function(O,H){for(var W=4194303,ee=Math.min(O.length,9),ue=0;ue>>22,xe=ge}xe>>>=22,O.words[ue-10]=xe,xe===0&&O.length>10?O.length-=10:O.length-=9},w.prototype.imulK=function(O){O.words[O.length]=0,O.words[O.length+1]=0,O.length+=2;for(var H=0,W=0;W>>=26,O.words[W]=ue,H=ee}return H!==0&&(O.words[O.length++]=H),O},c._prime=function(O){if(h[O])return h[O];var H;if(O==="k256")H=new w;else if(O==="p224")H=new F;else if(O==="p192")H=new z;else if(O==="p25519")H=new U;else throw new Error("Unknown prime "+O);return h[O]=H,H};function V(j){if(typeof j=="string"){var O=c._prime(j);this.m=O.p,this.prime=O}else s(j.gtn(1),"modulus must be greater than 1"),this.m=j,this.prime=null}V.prototype._verify1=function(O){s(O.negative===0,"red works only with positives"),s(O.red,"red works only with red numbers")},V.prototype._verify2=function(O,H){s((O.negative|H.negative)===0,"red works only with positives"),s(O.red&&O.red===H.red,"red works only with red numbers")},V.prototype.imod=function(O){return this.prime?this.prime.ireduce(O)._forceRed(this):O.umod(this.m)._forceRed(this)},V.prototype.neg=function(O){return O.isZero()?O.clone():this.m.sub(O)._forceRed(this)},V.prototype.add=function(O,H){this._verify2(O,H);var W=O.add(H);return W.cmp(this.m)>=0&&W.isub(this.m),W._forceRed(this)},V.prototype.iadd=function(O,H){this._verify2(O,H);var W=O.iadd(H);return W.cmp(this.m)>=0&&W.isub(this.m),W},V.prototype.sub=function(O,H){this._verify2(O,H);var W=O.sub(H);return W.cmpn(0)<0&&W.iadd(this.m),W._forceRed(this)},V.prototype.isub=function(O,H){this._verify2(O,H);var W=O.isub(H);return W.cmpn(0)<0&&W.iadd(this.m),W},V.prototype.shl=function(O,H){return this._verify1(O),this.imod(O.ushln(H))},V.prototype.imul=function(O,H){return this._verify2(O,H),this.imod(O.imul(H))},V.prototype.mul=function(O,H){return this._verify2(O,H),this.imod(O.mul(H))},V.prototype.isqr=function(O){return this.imul(O,O.clone())},V.prototype.sqr=function(O){return this.mul(O,O)},V.prototype.sqrt=function(O){if(O.isZero())return O.clone();var H=this.m.andln(3);if(s(H%2===1),H===3){var W=this.m.add(new c(1)).iushrn(2);return this.pow(O,W)}for(var ee=this.m.subn(1),ue=0;!ee.isZero()&&ee.andln(1)===0;)ue++,ee.iushrn(1);s(!ee.isZero());var xe=new c(1).toRed(this),ge=xe.redNeg(),_e=this.m.subn(1).iushrn(1),Y=this.m.bitLength();for(Y=new c(2*Y*Y).toRed(this);this.pow(Y,_e).cmp(ge)!==0;)Y.redIAdd(ge);for(var se=this.pow(Y,ee),ce=this.pow(O,ee.addn(1).iushrn(1)),ne=this.pow(O,ee),ye=ue;ne.cmp(xe)!==0;){for(var le=ne,Z=0;le.cmp(xe)!==0;Z++)le=le.redSqr();s(Z=0;ue--){for(var se=H.words[ue],ce=Y-1;ce>=0;ce--){var ne=se>>ce&1;if(xe!==ee[0]&&(xe=this.sqr(xe)),ne===0&&ge===0){_e=0;continue}ge<<=1,ge|=ne,_e++,!(_e!==W&&(ue!==0||ce!==0))&&(xe=this.mul(xe,ee[ge]),_e=0,ge=0)}Y=26}return xe},V.prototype.convertTo=function(O){var H=O.umod(this.m);return H===O?H.clone():H},V.prototype.convertFrom=function(O){var H=O.clone();return H.red=null,H},c.mont=function(O){return new G(O)};function G(j){V.call(this,j),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(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)}o(G,V),G.prototype.convertTo=function(O){return this.imod(O.ushln(this.shift))},G.prototype.convertFrom=function(O){var H=this.imod(O.mul(this.rinv));return H.red=null,H},G.prototype.imul=function(O,H){if(O.isZero()||H.isZero())return O.words[0]=0,O.length=1,O;var W=O.imul(H),ee=W.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ue=W.isub(ee).iushrn(this.shift),xe=ue;return ue.cmp(this.m)>=0?xe=ue.isub(this.m):ue.cmpn(0)<0&&(xe=ue.iadd(this.m)),xe._forceRed(this)},G.prototype.mul=function(O,H){if(O.isZero()||H.isZero())return new c(0)._forceRed(this);var W=O.mul(H),ee=W.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ue=W.isub(ee).iushrn(this.shift),xe=ue;return ue.cmp(this.m)>=0?xe=ue.isub(this.m):ue.cmpn(0)<0&&(xe=ue.iadd(this.m)),xe._forceRed(this)},G.prototype.invm=function(O){var H=this.imod(O._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(t,this)}),6860:(function(t){t.exports=r;function r(a,l,i){return a[0]=l[0]-i[0],a[1]=l[1]-i[1],a[2]=l[2]-i[2],a[3]=l[3]-i[3],a}}),6864:(function(t){t.exports=r;function r(){var a=new Float32Array(16);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}}),6867:(function(t,r,a){t.exports=f;var l=a(1888),i=a(855),s=a(7150);function o(x,A){for(var k=0;k>>1;if(!(_<=0)){var h,m=l.mallocDouble(2*_*T),w=l.mallocInt32(T);if(T=c(x,_,m,w),T>0){if(_===1&&I)i.init(T),h=i.sweepComplete(_,k,0,T,m,w,0,T,m,w);else{var F=l.mallocDouble(2*_*E),z=l.mallocInt32(E);E=c(A,_,F,z),E>0&&(i.init(T+E),_===1?h=i.sweepBipartite(_,k,0,T,m,w,0,E,F,z):h=s(_,k,I,T,m,w,E,F,z),l.free(F),l.free(z))}l.free(m),l.free(w)}return h}}}var d;function y(x,A){d.push([x,A])}function g(x){return d=[],p(x,x,y,!0),d}function C(x,A){return d=[],p(x,A,y,!1),d}function f(x,A,k){switch(arguments.length){case 1:return g(x);case 2:return typeof A=="function"?p(x,x,A,!0):C(x,A);case 3:return p(x,A,k,!1);default:throw new Error("box-intersect: Invalid arguments")}}}),6894:(function(t){t.exports=r;function r(a,l,i,s){var o=i[1],c=i[2],p=l[1]-o,d=l[2]-c,y=Math.sin(s),g=Math.cos(s);return a[0]=l[0],a[1]=o+p*g-d*y,a[2]=c+p*y+d*g,a}}),7004:(function(t){t.exports=r;function r(a){for(var l=a.length,i=a[a.length-1],s=l,o=l-2;o>=0;--o){var c=i,p=a[o];i=c+p;var d=i-c,y=p-d;y&&(a[--s]=i,i=y)}for(var g=0,o=s;o=p0)&&!(p1>=hi)"),A=y("lo===p0"),k=y("lo0;){se-=1;var ye=se*_,le=w[ye],Z=w[ye+1],de=w[ye+2],pe=w[ye+3],Te=w[ye+4],Ne=w[ye+5],$e=se*h,Ze=F[$e],Xe=F[$e+1],it=Ne&1,yt=!!(Ne&16),bt=ue,mt=xe,ht=_e,Ve=Y;if(it&&(bt=_e,mt=Y,ht=ue,Ve=xe),!(Ne&2&&(de=k(O,le,Z,de,bt,mt,Xe),Z>=de))&&!(Ne&4&&(Z=I(O,le,Z,de,bt,mt,Ze),Z>=de))){var ze=de-Z,Se=Te-pe;if(yt){if(O*ze*(ze+Se)"u"?a(1538):WeakMap,i=a(2762),s=a(8116),o=new l;function c(p){var d=o.get(p),y=d&&(d._triangleBuffer.handle||d._triangleBuffer.buffer);if(!y||!p.isBuffer(y)){var g=i(p,new Float32Array([-1,-1,-1,4,4,-1]));d=s(p,[{buffer:g,type:p.FLOAT,size:2}]),d._triangleBuffer=g,o.set(p,d)}d.bind(),p.drawArrays(p.TRIANGLES,0,3),d.unbind()}t.exports=c}),7182:(function(t,r,a){var l={identity:a(7894),translate:a(7656),multiply:a(6760),create:a(6864),scale:a(2504),fromRotationTranslation:a(6743)};l.create();var i=l.create();t.exports=function(o,c,p,d,y,g){return l.identity(o),l.fromRotationTranslation(o,g,c),o[3]=y[0],o[7]=y[1],o[11]=y[2],o[15]=y[3],l.identity(i),d[2]!==0&&(i[9]=d[2],l.multiply(o,o,i)),d[1]!==0&&(i[9]=0,i[8]=d[1],l.multiply(o,o,i)),d[0]!==0&&(i[8]=0,i[4]=d[0],l.multiply(o,o,i)),l.scale(o,o,p),o}}),7201:(function(t,r,a){var l=1e-6,i=1e-6,s=a(9405),o=a(2762),c=a(8116),p=a(7766),d=a(8406),y=a(6760),g=a(7608),C=a(9618),f=a(6729),x=a(7765),A=a(1888),k=a(840),I=a(7626),T=k.meshShader,E=k.wireShader,_=k.pointShader,h=k.pickShader,m=k.pointPickShader,w=k.contourShader,F=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function z(_e,Y,se,ce,ne,ye,le,Z,de,pe,Te,Ne,$e,Ze,Xe,it,yt,bt,mt,ht,Ve,ze,Se,Je,_t,At,vt){this.gl=_e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=Y,this.dirty=!0,this.triShader=se,this.lineShader=ce,this.pointShader=ne,this.pickShader=ye,this.pointPickShader=le,this.contourShader=Z,this.trianglePositions=de,this.triangleColors=Te,this.triangleNormals=$e,this.triangleUVs=Ne,this.triangleIds=pe,this.triangleVAO=Ze,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Xe,this.edgeColors=yt,this.edgeUVs=bt,this.edgeIds=it,this.edgeVAO=mt,this.edgeCount=0,this.pointPositions=ht,this.pointColors=ze,this.pointUVs=Se,this.pointSizes=Je,this.pointIds=Ve,this.pointVAO=_t,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=At,this.contourVAO=vt,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=F,this._view=F,this._projection=F,this._resolution=[1,1]}var U=z.prototype;U.isOpaque=function(){return!this.hasAlpha},U.isTransparent=function(){return this.hasAlpha},U.pickSlots=1,U.setPickBase=function(_e){this.pickId=_e};function V(_e,Y){if(!Y||!Y.length)return 1;for(var se=0;se_e&&se>0){var ce=(Y[se][0]-_e)/(Y[se][0]-Y[se-1][0]);return Y[se][1]*(1-ce)+ce*Y[se-1][1]}}return 1}function G(_e,Y){for(var se=f({colormap:_e,nshades:256,format:"rgba"}),ce=new Uint8Array(256*4),ne=0;ne<256;++ne){for(var ye=se[ne],le=0;le<3;++le)ce[4*ne+le]=ye[le];Y?ce[4*ne+3]=255*V(ne/255,Y):ce[4*ne+3]=255*ye[3]}return C(ce,[256,256,4],[4,0,1])}function j(_e){for(var Y=_e.length,se=new Array(Y),ce=0;ce0){var $e=this.triShader;$e.bind(),$e.uniforms=Z,this.triangleVAO.bind(),Y.drawArrays(Y.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var $e=this.lineShader;$e.bind(),$e.uniforms=Z,this.edgeVAO.bind(),Y.lineWidth(this.lineWidth*this.pixelRatio),Y.drawArrays(Y.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var $e=this.pointShader;$e.bind(),$e.uniforms=Z,this.pointVAO.bind(),Y.drawArrays(Y.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var $e=this.contourShader;$e.bind(),$e.uniforms=Z,this.contourVAO.bind(),Y.drawArrays(Y.LINES,0,this.contourCount),this.contourVAO.unbind()}},U.drawPick=function(_e){_e=_e||{};for(var Y=this.gl,se=_e.model||F,ce=_e.view||F,ne=_e.projection||F,ye=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],le=0;le<3;++le)ye[0][le]=Math.max(ye[0][le],this.clipBounds[0][le]),ye[1][le]=Math.min(ye[1][le],this.clipBounds[1][le]);this._model=[].slice.call(se),this._view=[].slice.call(ce),this._projection=[].slice.call(ne),this._resolution=[Y.drawingBufferWidth,Y.drawingBufferHeight];var Z={model:se,view:ce,projection:ne,clipBounds:ye,pickId:this.pickId/255},de=this.pickShader;if(de.bind(),de.uniforms=Z,this.triangleCount>0&&(this.triangleVAO.bind(),Y.drawArrays(Y.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),Y.lineWidth(this.lineWidth*this.pixelRatio),Y.drawArrays(Y.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var de=this.pointPickShader;de.bind(),de.uniforms=Z,this.pointVAO.bind(),Y.drawArrays(Y.POINTS,0,this.pointCount),this.pointVAO.unbind()}},U.pick=function(_e){if(!_e||_e.id!==this.pickId)return null;for(var Y=_e.value[0]+256*_e.value[1]+65536*_e.value[2],se=this.cells[Y],ce=this.positions,ne=new Array(se.length),ye=0;yeMath.max(T,E)?_[2]=1:T>Math.max(I,E)?_[0]=1:_[1]=1;for(var h=0,m=0,w=0;w<3;++w)h+=k[w]*k[w],m+=_[w]*k[w];for(var w=0;w<3;++w)_[w]-=m/h*k[w];return c(_,_),_}function C(k,I,T,E,_,h,m,w){this.center=l(T),this.up=l(E),this.right=l(_),this.radius=l([h]),this.angle=l([m,w]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(k,I),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 F=0;F<16;++F)this.computedMatrix[F]=.5;this.recalcMatrix(0)}var f=C.prototype;f.setDistanceLimits=function(k,I){k>0?k=Math.log(k):k=-1/0,I>0?I=Math.log(I):I=1/0,I=Math.max(I,k),this.radius.bounds[0][0]=k,this.radius.bounds[1][0]=I},f.getDistanceLimits=function(k){var I=this.radius.bounds[0];return k?(k[0]=Math.exp(I[0][0]),k[1]=Math.exp(I[1][0]),k):[Math.exp(I[0][0]),Math.exp(I[1][0])]},f.recalcMatrix=function(k){this.center.curve(k),this.up.curve(k),this.right.curve(k),this.radius.curve(k),this.angle.curve(k);for(var I=this.computedUp,T=this.computedRight,E=0,_=0,h=0;h<3;++h)_+=I[h]*T[h],E+=I[h]*I[h];for(var m=Math.sqrt(E),w=0,h=0;h<3;++h)T[h]-=I[h]*_/E,w+=T[h]*T[h],I[h]/=m;for(var F=Math.sqrt(w),h=0;h<3;++h)T[h]/=F;var z=this.computedToward;o(z,I,T),c(z,z);for(var U=Math.exp(this.computedRadius[0]),V=this.computedAngle[0],G=this.computedAngle[1],j=Math.cos(V),O=Math.sin(V),H=Math.cos(G),W=Math.sin(G),ee=this.computedCenter,ue=j*H,xe=O*H,ge=W,_e=-j*W,Y=-O*W,se=H,ce=this.computedEye,ne=this.computedMatrix,h=0;h<3;++h){var ye=ue*T[h]+xe*z[h]+ge*I[h];ne[4*h+1]=_e*T[h]+Y*z[h]+se*I[h],ne[4*h+2]=ye,ne[4*h+3]=0}var le=ne[1],Z=ne[5],de=ne[9],pe=ne[2],Te=ne[6],Ne=ne[10],$e=Z*Ne-de*Te,Ze=de*pe-le*Ne,Xe=le*Te-Z*pe,it=d($e,Ze,Xe);$e/=it,Ze/=it,Xe/=it,ne[0]=$e,ne[4]=Ze,ne[8]=Xe;for(var h=0;h<3;++h)ce[h]=ee[h]+ne[2+4*h]*U;for(var h=0;h<3;++h){for(var w=0,yt=0;yt<3;++yt)w+=ne[h+4*yt]*ce[yt];ne[12+h]=-w}ne[15]=1},f.getMatrix=function(k,I){this.recalcMatrix(k);var T=this.computedMatrix;if(I){for(var E=0;E<16;++E)I[E]=T[E];return I}return T};var x=[0,0,0];f.rotate=function(k,I,T,E){if(this.angle.move(k,I,T),E){this.recalcMatrix(k);var _=this.computedMatrix;x[0]=_[2],x[1]=_[6],x[2]=_[10];for(var h=this.computedUp,m=this.computedRight,w=this.computedToward,F=0;F<3;++F)_[4*F]=h[F],_[4*F+1]=m[F],_[4*F+2]=w[F];s(_,_,E,x);for(var F=0;F<3;++F)h[F]=_[4*F],m[F]=_[4*F+1];this.up.set(k,h[0],h[1],h[2]),this.right.set(k,m[0],m[1],m[2])}},f.pan=function(k,I,T,E){I=I||0,T=T||0,E=E||0,this.recalcMatrix(k);var _=this.computedMatrix;Math.exp(this.computedRadius[0]);var h=_[1],m=_[5],w=_[9],F=d(h,m,w);h/=F,m/=F,w/=F;var z=_[0],U=_[4],V=_[8],G=z*h+U*m+V*w;z-=h*G,U-=m*G,V-=w*G;var j=d(z,U,V);z/=j,U/=j,V/=j;var O=z*I+h*T,H=U*I+m*T,W=V*I+w*T;this.center.move(k,O,H,W);var ee=Math.exp(this.computedRadius[0]);ee=Math.max(1e-4,ee+E),this.radius.set(k,Math.log(ee))},f.translate=function(k,I,T,E){this.center.move(k,I||0,T||0,E||0)},f.setMatrix=function(k,I,T,E){var _=1;typeof T=="number"&&(_=T|0),(_<0||_>3)&&(_=1);var h=(_+2)%3;I||(this.recalcMatrix(k),I=this.computedMatrix);var m=I[_],w=I[_+4],F=I[_+8];if(E){var U=Math.abs(m),V=Math.abs(w),G=Math.abs(F),j=Math.max(U,V,G);U===j?(m=m<0?-1:1,w=F=0):G===j?(F=F<0?-1:1,m=w=0):(w=w<0?-1:1,m=F=0)}else{var z=d(m,w,F);m/=z,w/=z,F/=z}var O=I[h],H=I[h+4],W=I[h+8],ee=O*m+H*w+W*F;O-=m*ee,H-=w*ee,W-=F*ee;var ue=d(O,H,W);O/=ue,H/=ue,W/=ue;var xe=w*W-F*H,ge=F*O-m*W,_e=m*H-w*O,Y=d(xe,ge,_e);xe/=Y,ge/=Y,_e/=Y,this.center.jump(k,Ve,ze,Se),this.radius.idle(k),this.up.jump(k,m,w,F),this.right.jump(k,O,H,W);var se,ce;if(_===2){var ne=I[1],ye=I[5],le=I[9],Z=ne*O+ye*H+le*W,de=ne*xe+ye*ge+le*_e;$e<0?se=-Math.PI/2:se=Math.PI/2,ce=Math.atan2(de,Z)}else{var pe=I[2],Te=I[6],Ne=I[10],$e=pe*m+Te*w+Ne*F,Ze=pe*O+Te*H+Ne*W,Xe=pe*xe+Te*ge+Ne*_e;se=Math.asin(y($e)),ce=Math.atan2(Xe,Ze)}this.angle.jump(k,ce,se),this.recalcMatrix(k);var it=I[2],yt=I[6],bt=I[10],mt=this.computedMatrix;i(mt,I);var ht=mt[15],Ve=mt[12]/ht,ze=mt[13]/ht,Se=mt[14]/ht,Je=Math.exp(this.computedRadius[0]);this.center.jump(k,Ve-it*Je,ze-yt*Je,Se-bt*Je)},f.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},f.idle=function(k){this.center.idle(k),this.up.idle(k),this.right.idle(k),this.radius.idle(k),this.angle.idle(k)},f.flush=function(k){this.center.flush(k),this.up.flush(k),this.right.flush(k),this.radius.flush(k),this.angle.flush(k)},f.setDistance=function(k,I){I>0&&this.radius.set(k,Math.log(I))},f.lookAt=function(k,I,T,E){this.recalcMatrix(k),I=I||this.computedEye,T=T||this.computedCenter,E=E||this.computedUp;var _=E[0],h=E[1],m=E[2],w=d(_,h,m);if(!(w<1e-6)){_/=w,h/=w,m/=w;var F=I[0]-T[0],z=I[1]-T[1],U=I[2]-T[2],V=d(F,z,U);if(!(V<1e-6)){F/=V,z/=V,U/=V;var G=this.computedRight,j=G[0],O=G[1],H=G[2],W=_*j+h*O+m*H;j-=W*_,O-=W*h,H-=W*m;var ee=d(j,O,H);if(!(ee<.01&&(j=h*U-m*z,O=m*F-_*U,H=_*z-h*F,ee=d(j,O,H),ee<1e-6))){j/=ee,O/=ee,H/=ee,this.up.set(k,_,h,m),this.right.set(k,j,O,H),this.center.set(k,T[0],T[1],T[2]),this.radius.set(k,Math.log(V));var ue=h*H-m*O,xe=m*j-_*H,ge=_*O-h*j,_e=d(ue,xe,ge);ue/=_e,xe/=_e,ge/=_e;var Y=_*F+h*z+m*U,se=j*F+O*z+H*U,ce=ue*F+xe*z+ge*U,ne=Math.asin(y(Y)),ye=Math.atan2(ce,se),le=this.angle._state,Z=le[le.length-1],de=le[le.length-2];Z=Z%(2*Math.PI);var pe=Math.abs(Z+2*Math.PI-ye),Te=Math.abs(Z-ye),Ne=Math.abs(Z-2*Math.PI-ye);pe max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D dashTexture; +uniform float dashScale; +uniform float opacity; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], worldPosition) || + fragColor.a * opacity == 0. + ) discard; + + float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r; + if(dashWeight < 0.5) { + discard; + } + gl_FragColor = fragColor * opacity; +} +`]),c=l([`precision highp float; +#define GLSLIFY 1 + +#define FLOAT_MAX 1.70141184e38 +#define FLOAT_MIN 1.17549435e-38 + +// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl +vec4 packFloat(float v) { + float av = abs(v); + + //Handle special cases + if(av < FLOAT_MIN) { + return vec4(0.0, 0.0, 0.0, 0.0); + } else if(v > FLOAT_MAX) { + return vec4(127.0, 128.0, 0.0, 0.0) / 255.0; + } else if(v < -FLOAT_MAX) { + return vec4(255.0, 128.0, 0.0, 0.0) / 255.0; + } + + vec4 c = vec4(0,0,0,0); + + //Compute exponent and mantissa + float e = floor(log2(av)); + float m = av * pow(2.0, -e) - 1.0; + + //Unpack mantissa + c[1] = floor(128.0 * m); + m -= c[1] / 128.0; + c[2] = floor(32768.0 * m); + m -= c[2] / 32768.0; + c[3] = floor(8388608.0 * m); + + //Unpack exponent + float ebias = e + 127.0; + c[0] = floor(ebias / 2.0); + ebias -= c[0] * 2.0; + c[1] += floor(ebias) * 128.0; + + //Unpack sign bit + c[0] += 128.0 * step(0.0, -v); + + //Scale back to range + return c / 255.0; +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform float pickId; +uniform vec3 clipBounds[2]; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard; + + gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz); +}`]),p=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(d){return i(d,s,o,null,p)},r.createPickShader=function(d){return i(d,s,c,null,p)}}),7352:(function(t,r,a){var l=a(5721),i=a(4750),s=a(2690);t.exports=o;function o(c){var p=c.length;if(p===0)return[];if(p===1)return[[0]];var d=c[0].length;return d===0?[]:d===1?l(c):d===2?i(c):s(c,d)}}),7399:(function(t){t.exports=r;function r(a,l){var i=l[0],s=l[1],o=l[2],c=l[3],p=i+i,d=s+s,y=o+o,g=i*p,C=s*p,f=s*d,x=o*p,A=o*d,k=o*y,I=c*p,T=c*d,E=c*y;return a[0]=1-f-k,a[1]=C+E,a[2]=x-T,a[3]=0,a[4]=C-E,a[5]=1-g-k,a[6]=A+I,a[7]=0,a[8]=x+T,a[9]=A-I,a[10]=1-g-f,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}}),7417:(function(t){t.exports=r;function r(a,l,i){return a[0]=Math.max(l[0],i[0]),a[1]=Math.max(l[1],i[1]),a[2]=Math.max(l[2],i[2]),a}}),7442:(function(t,r,a){var l=a(6658),i=a(7182),s=a(2652),o=a(9921),c=a(8648),p=C(),d=C(),y=C();t.exports=g;function g(A,k,I,T){if(o(k)===0||o(I)===0)return!1;var E=s(k,p.translate,p.scale,p.skew,p.perspective,p.quaternion),_=s(I,d.translate,d.scale,d.skew,d.perspective,d.quaternion);return!E||!_?!1:(l(y.translate,p.translate,d.translate,T),l(y.skew,p.skew,d.skew,T),l(y.scale,p.scale,d.scale,T),l(y.perspective,p.perspective,d.perspective,T),c(y.quaternion,p.quaternion,d.quaternion,T),i(A,y.translate,y.scale,y.skew,y.perspective,y.quaternion),!0)}function C(){return{translate:f(),scale:f(1),skew:f(),perspective:x(),quaternion:x()}}function f(A){return[A||0,A||0,A||0]}function x(){return[0,0,0,1]}}),7507:(function(t,r){r.byteLength=d,r.toByteArray=g,r.fromByteArray=x;for(var a=[],l=[],i=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,c=s.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var I=A.indexOf("=");I===-1&&(I=k);var T=I===k?0:4-I%4;return[I,T]}function d(A){var k=p(A),I=k[0],T=k[1];return(I+T)*3/4-T}function y(A,k,I){return(k+I)*3/4-I}function g(A){var k,I=p(A),T=I[0],E=I[1],_=new i(y(A,T,E)),h=0,m=E>0?T-4:T,w;for(w=0;w>16&255,_[h++]=k>>8&255,_[h++]=k&255;return E===2&&(k=l[A.charCodeAt(w)]<<2|l[A.charCodeAt(w+1)]>>4,_[h++]=k&255),E===1&&(k=l[A.charCodeAt(w)]<<10|l[A.charCodeAt(w+1)]<<4|l[A.charCodeAt(w+2)]>>2,_[h++]=k>>8&255,_[h++]=k&255),_}function C(A){return a[A>>18&63]+a[A>>12&63]+a[A>>6&63]+a[A&63]}function f(A,k,I){for(var T,E=[],_=k;_m?m:h+_));return T===1?(k=A[I-1],E.push(a[k>>2]+a[k<<4&63]+"==")):T===2&&(k=(A[I-2]<<8)+A[I-1],E.push(a[k>>10]+a[k>>4&63]+a[k<<2&63]+"=")),E.join("")}}),7518:(function(t,r,a){var l=a(1433);function i(c,p,d,y,g,C){this.location=c,this.dimension=p,this.a=d,this.b=y,this.c=g,this.d=C}i.prototype.bind=function(c){switch(this.dimension){case 1:c.vertexAttrib1f(this.location,this.a);break;case 2:c.vertexAttrib2f(this.location,this.a,this.b);break;case 3:c.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:c.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d);break}};function s(c,p,d){this.gl=c,this._ext=p,this.handle=d,this._attribs=[],this._useElements=!1,this._elementsType=c.UNSIGNED_SHORT}s.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var c=0;c1.0001)return null;w+=m[I]}return Math.abs(w-1)>.001?null:[T,p(y,m),m]}}),7636:(function(t){t.exports=r;function r(a,l){l=l||1;var i=Math.random()*2*Math.PI,s=Math.random()*2-1,o=Math.sqrt(1-s*s)*l;return a[0]=Math.cos(i)*o,a[1]=Math.sin(i)*o,a[2]=s*l,a}}),7640:(function(t,r,a){var l=a(1888);function i(g){return g==="uint32"?[l.mallocUint32,l.freeUint32]:null}var s={"uint32,1,0":function(g,C){return function(x,A,k,I,T,E,_,h,m,w,F){var z,U,V,G=x*T+I,j,O=g(h),H,W,ee,ue;for(z=x+1;z<=A;++z){for(U=z,G+=T,V=G,H=0,W=G,j=0;jx;){H=0,W=V-T;t:for(j=0;jue)break t;W+=w,H+=F}for(H=V,W=V-T,j=0;j>1,O=j-U,H=j+U,W=V,ee=O,ue=j,xe=H,ge=G,_e=A+1,Y=k-1,se=!0,ce,ne,ye,le,Z,de,pe,Te,Ne,$e=0,Ze=0,Xe=0,it,yt,bt,mt,ht,Ve,ze,Se,Je,_t,At,vt,Kt,Qt,fr,mr,Ur=m,Br=C(Ur),fn=C(Ur);yt=E*W,bt=E*ee,mr=T;e:for(it=0;it0){ne=W,W=ee,ee=ne;break e}if(Xe<0)break e;mr+=F}yt=E*xe,bt=E*ge,mr=T;e:for(it=0;it0){ne=xe,xe=ge,ge=ne;break e}if(Xe<0)break e;mr+=F}yt=E*W,bt=E*ue,mr=T;e:for(it=0;it0){ne=W,W=ue,ue=ne;break e}if(Xe<0)break e;mr+=F}yt=E*ee,bt=E*ue,mr=T;e:for(it=0;it0){ne=ee,ee=ue,ue=ne;break e}if(Xe<0)break e;mr+=F}yt=E*W,bt=E*xe,mr=T;e:for(it=0;it0){ne=W,W=xe,xe=ne;break e}if(Xe<0)break e;mr+=F}yt=E*ue,bt=E*xe,mr=T;e:for(it=0;it0){ne=ue,ue=xe,xe=ne;break e}if(Xe<0)break e;mr+=F}yt=E*ee,bt=E*ge,mr=T;e:for(it=0;it0){ne=ee,ee=ge,ge=ne;break e}if(Xe<0)break e;mr+=F}yt=E*ee,bt=E*ue,mr=T;e:for(it=0;it0){ne=ee,ee=ue,ue=ne;break e}if(Xe<0)break e;mr+=F}yt=E*xe,bt=E*ge,mr=T;e:for(it=0;it0){ne=xe,xe=ge,ge=ne;break e}if(Xe<0)break e;mr+=F}for(yt=E*W,bt=E*ee,mt=E*ue,ht=E*xe,Ve=E*ge,ze=E*V,Se=E*j,Je=E*G,fr=0,mr=T,it=0;it0)Y--;else if(Xe<0){for(yt=E*de,bt=E*_e,mt=E*Y,mr=T,it=0;it0)for(;;){pe=T+Y*E,fr=0;e:for(it=0;it0){if(--YG){e:for(;;){for(pe=T+_e*E,fr=0,mr=T,it=0;it1&&x?k(f,x[0],x[1]):k(f)}var d={"uint32,1,0":function(g,C){return function(f){var x=f.data,A=f.offset|0,k=f.shape,I=f.stride,T=I[0]|0,E=k[0]|0,_=I[1]|0,h=k[1]|0,m=_,w=_,F=1;E<=32?g(0,E-1,x,A,T,_,E,h,m,w,F):C(0,E-1,x,A,T,_,E,h,m,w,F)}}};function y(g,C){var f=[C,g].join(","),x=d[f],A=o(g,C),k=p(g,C,A);return x(A,k)}t.exports=y}),7642:(function(t,r,a){var l=a(8954),i=a(1682);t.exports=p;function s(d,y){this.point=d,this.index=y}function o(d,y){for(var g=d.point,C=y.point,f=g.length,x=0;x=2)return!1;V[j]=O}return!0}):U=U.filter(function(V){for(var G=0;G<=C;++G){var j=m[V[G]];if(j<0)return!1;V[G]=j}return!0}),C&1)for(var A=0;A",H="",W=O.length,ee=H.length,ue=V[0]===x||V[0]===I,xe=0,ge=-ee;xe>-1&&(xe=G.indexOf(O,xe),!(xe===-1||(ge=G.indexOf(H,xe+W),ge===-1)||ge<=xe));){for(var _e=xe;_e=ge)j[_e]=null,G=G.substr(0,_e)+" "+G.substr(_e+1);else if(j[_e]!==null){var Y=j[_e].indexOf(V[0]);Y===-1?j[_e]+=V:ue&&(j[_e]=j[_e].substr(0,Y+1)+(1+parseInt(j[_e][Y+1]))+j[_e].substr(Y+2))}var se=xe+W,ce=G.substr(se,ge-se),ne=ce.indexOf(O);ne!==-1?xe=ne:xe=ge+ee}return j}function _(U,V,G){for(var j=V.textAlign||"start",O=V.textBaseline||"alphabetic",H=[1<<30,1<<30],W=[0,0],ee=U.length,ue=0;ue/g,` +`):G=G.replace(/\/g," ");var W="",ee=[];for(Z=0;Z-1?parseInt(Se[1+At]):0,Qt=vt>-1?parseInt(Je[1+vt]):0;Kt!==Qt&&(_t=_t.replace(Xe(),"?px "),Te*=Math.pow(.75,Qt-Kt),_t=_t.replace("?px ",Xe())),pe+=.25*Y*(Qt-Kt)}if(H.superscripts===!0){var fr=Se.indexOf(x),mr=Je.indexOf(x),Ur=fr>-1?parseInt(Se[1+fr]):0,Br=mr>-1?parseInt(Je[1+mr]):0;Ur!==Br&&(_t=_t.replace(Xe(),"?px "),Te*=Math.pow(.75,Br-Ur),_t=_t.replace("?px ",Xe())),pe-=.25*Y*(Br-Ur)}if(H.bolds===!0){var fn=Se.indexOf(y)>-1,Fr=Je.indexOf(y)>-1;!fn&&Fr&&(Qr?_t=_t.replace("italic ","italic bold "):_t="bold "+_t),fn&&!Fr&&(_t=_t.replace("bold ",""))}if(H.italics===!0){var Qr=Se.indexOf(C)>-1,Bt=Je.indexOf(C)>-1;!Qr&&Bt&&(_t="italic "+_t),Qr&&!Bt&&(_t=_t.replace("italic ",""))}V.font=_t}for(le=0;le<_e;++le){var yt=ge[le]+` +`;for(de=0,pe=le*Y,Te=j,$e="",Z=0;Z0&&(O=j.size),j.lineSpacing&&j.lineSpacing>0&&(H=j.lineSpacing),j.styletags&&j.styletags.breaklines&&(W.breaklines=!!j.styletags.breaklines),j.styletags&&j.styletags.bolds&&(W.bolds=!!j.styletags.bolds),j.styletags&&j.styletags.italics&&(W.italics=!!j.styletags.italics),j.styletags&&j.styletags.subscripts&&(W.subscripts=!!j.styletags.subscripts),j.styletags&&j.styletags.superscripts&&(W.superscripts=!!j.styletags.superscripts)),G.font=[j.fontStyle,j.fontVariant,j.fontWeight,O+"px",j.font].filter(function(ue){return ue}).join(" "),G.textAlign="start",G.textBaseline="alphabetic",G.direction="ltr";var ee=h(V,G,U,O,H,W);return F(ee,j,O)}}),7721:(function(t,r,a){var l=a(5716);t.exports=i;function i(s){return l(s[0])*l(s[1])}}),7765:(function(t,r,a){t.exports=f;var l=a(9618),i=a(1888),s=a(446),o=a(1570);function c(x){for(var A=x.length,k=0,I=0;I"u"&&(I=c(x));var T=x.length;if(T===0||I<1)return{cells:[],vertexIds:[],vertexWeights:[]};var E=p(A,+k),_=d(x,I),h=y(_,A,E,+k),m=g(_,A.length|0),w=o(I)(x,_.data,m,E),F=C(_),z=[].slice.call(h.data,0,h.shape[0]);return i.free(E),i.free(_.data),i.free(h.data),i.free(m),{cells:w,vertexIds:F,vertexWeights:z}}}),7766:(function(t,r,a){var l=a(9618),i=a(5298),s=a(1888);t.exports=h;var o=null,c=null,p=null;function d(m){o=[m.LINEAR,m.NEAREST_MIPMAP_LINEAR,m.LINEAR_MIPMAP_NEAREST,m.LINEAR_MIPMAP_NEAREST],c=[m.NEAREST,m.LINEAR,m.NEAREST_MIPMAP_NEAREST,m.NEAREST_MIPMAP_LINEAR,m.LINEAR_MIPMAP_NEAREST,m.LINEAR_MIPMAP_LINEAR],p=[m.REPEAT,m.CLAMP_TO_EDGE,m.MIRRORED_REPEAT]}function y(m){return typeof HTMLCanvasElement<"u"&&m instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&m instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&m instanceof HTMLVideoElement||typeof ImageData<"u"&&m instanceof ImageData}var g=function(m,w){i.muls(m,w,255)};function C(m,w,F){var z=m.gl,U=z.getParameter(z.MAX_TEXTURE_SIZE);if(w<0||w>U||F<0||F>U)throw new Error("gl-texture2d: Invalid texture size");return m._shape=[w,F],m.bind(),z.texImage2D(z.TEXTURE_2D,0,m.format,w,F,0,m.format,m.type,null),m._mipLevels=[0],m}function f(m,w,F,z,U,V){this.gl=m,this.handle=w,this.format=U,this.type=V,this._shape=[F,z],this._mipLevels=[0],this._magFilter=m.NEAREST,this._minFilter=m.NEAREST,this._wrapS=m.CLAMP_TO_EDGE,this._wrapT=m.CLAMP_TO_EDGE,this._anisoSamples=1;var G=this,j=[this._wrapS,this._wrapT];Object.defineProperties(j,[{get:function(){return G._wrapS},set:function(H){return G.wrapS=H}},{get:function(){return G._wrapT},set:function(H){return G.wrapT=H}}]),this._wrapVector=j;var O=[this._shape[0],this._shape[1]];Object.defineProperties(O,[{get:function(){return G._shape[0]},set:function(H){return G.width=H}},{get:function(){return G._shape[1]},set:function(H){return G.height=H}}]),this._shapeVector=O}var x=f.prototype;Object.defineProperties(x,{minFilter:{get:function(){return this._minFilter},set:function(m){this.bind();var w=this.gl;if(this.type===w.FLOAT&&o.indexOf(m)>=0&&(w.getExtension("OES_texture_float_linear")||(m=w.NEAREST)),c.indexOf(m)<0)throw new Error("gl-texture2d: Unknown filter mode "+m);return w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MIN_FILTER,m),this._minFilter=m}},magFilter:{get:function(){return this._magFilter},set:function(m){this.bind();var w=this.gl;if(this.type===w.FLOAT&&o.indexOf(m)>=0&&(w.getExtension("OES_texture_float_linear")||(m=w.NEAREST)),c.indexOf(m)<0)throw new Error("gl-texture2d: Unknown filter mode "+m);return w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MAG_FILTER,m),this._magFilter=m}},mipSamples:{get:function(){return this._anisoSamples},set:function(m){var w=this._anisoSamples;if(this._anisoSamples=Math.max(m,1)|0,w!==this._anisoSamples){var F=this.gl.getExtension("EXT_texture_filter_anisotropic");F&&this.gl.texParameterf(this.gl.TEXTURE_2D,F.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(m){if(this.bind(),p.indexOf(m)<0)throw new Error("gl-texture2d: Unknown wrap mode "+m);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,m),this._wrapS=m}},wrapT:{get:function(){return this._wrapT},set:function(m){if(this.bind(),p.indexOf(m)<0)throw new Error("gl-texture2d: Unknown wrap mode "+m);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,m),this._wrapT=m}},wrap:{get:function(){return this._wrapVector},set:function(m){if(Array.isArray(m)||(m=[m,m]),m.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var w=0;w<2;++w)if(p.indexOf(m[w])<0)throw new Error("gl-texture2d: Unknown wrap mode "+m);this._wrapS=m[0],this._wrapT=m[1];var F=this.gl;return this.bind(),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_S,this._wrapS),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_T,this._wrapT),m}},shape:{get:function(){return this._shapeVector},set:function(m){if(!Array.isArray(m))m=[m|0,m|0];else if(m.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return C(this,m[0]|0,m[1]|0),[m[0]|0,m[1]|0]}},width:{get:function(){return this._shape[0]},set:function(m){return m=m|0,C(this,m,this._shape[1]),m}},height:{get:function(){return this._shape[1]},set:function(m){return m=m|0,C(this,this._shape[0],m),m}}}),x.bind=function(m){var w=this.gl;return m!==void 0&&w.activeTexture(w.TEXTURE0+(m|0)),w.bindTexture(w.TEXTURE_2D,this.handle),m!==void 0?m|0:w.getParameter(w.ACTIVE_TEXTURE)-w.TEXTURE0},x.dispose=function(){this.gl.deleteTexture(this.handle)},x.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var m=Math.min(this._shape[0],this._shape[1]),w=0;m>0;++w,m>>>=1)this._mipLevels.indexOf(w)<0&&this._mipLevels.push(w)},x.setPixels=function(m,w,F,z){var U=this.gl;this.bind(),Array.isArray(w)?(z=F,F=w[1]|0,w=w[0]|0):(w=w||0,F=F||0),z=z||0;var V=y(m)?m:m.raw;if(V){var G=this._mipLevels.indexOf(z)<0;G?(U.texImage2D(U.TEXTURE_2D,0,this.format,this.format,this.type,V),this._mipLevels.push(z)):U.texSubImage2D(U.TEXTURE_2D,z,w,F,this.format,this.type,V)}else if(m.shape&&m.stride&&m.data){if(m.shape.length<2||w+m.shape[1]>this._shape[1]>>>z||F+m.shape[0]>this._shape[0]>>>z||w<0||F<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");k(U,w,F,z,this.format,this.type,this._mipLevels,m)}else throw new Error("gl-texture2d: Unsupported data type")};function A(m,w){return m.length===3?w[2]===1&&w[1]===m[0]*m[2]&&w[0]===m[2]:w[0]===1&&w[1]===m[0]}function k(m,w,F,z,U,V,G,j){var O=j.dtype,H=j.shape.slice();if(H.length<2||H.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var W=0,ee=0,ue=A(H,j.stride.slice());if(O==="float32"?W=m.FLOAT:O==="float64"?(W=m.FLOAT,ue=!1,O="float32"):O==="uint8"?W=m.UNSIGNED_BYTE:(W=m.UNSIGNED_BYTE,ue=!1,O="uint8"),H.length===2)ee=m.LUMINANCE,H=[H[0],H[1],1],j=l(j.data,H,[j.stride[0],j.stride[1],1],j.offset);else if(H.length===3){if(H[2]===1)ee=m.ALPHA;else if(H[2]===2)ee=m.LUMINANCE_ALPHA;else if(H[2]===3)ee=m.RGB;else if(H[2]===4)ee=m.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");H[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((ee===m.LUMINANCE||ee===m.ALPHA)&&(U===m.LUMINANCE||U===m.ALPHA)&&(ee=U),ee!==U)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var xe=j.size,ge=G.indexOf(z)<0;if(ge&&G.push(z),W===V&&ue)j.offset===0&&j.data.length===xe?ge?m.texImage2D(m.TEXTURE_2D,z,U,H[0],H[1],0,U,V,j.data):m.texSubImage2D(m.TEXTURE_2D,z,w,F,H[0],H[1],U,V,j.data):ge?m.texImage2D(m.TEXTURE_2D,z,U,H[0],H[1],0,U,V,j.data.subarray(j.offset,j.offset+xe)):m.texSubImage2D(m.TEXTURE_2D,z,w,F,H[0],H[1],U,V,j.data.subarray(j.offset,j.offset+xe));else{var _e;V===m.FLOAT?_e=s.mallocFloat32(xe):_e=s.mallocUint8(xe);var Y=l(_e,H,[H[2],H[2]*H[0],1]);W===m.FLOAT&&V===m.UNSIGNED_BYTE?g(Y,j):i.assign(Y,j),ge?m.texImage2D(m.TEXTURE_2D,z,U,H[0],H[1],0,U,V,_e.subarray(0,xe)):m.texSubImage2D(m.TEXTURE_2D,z,w,F,H[0],H[1],U,V,_e.subarray(0,xe)),V===m.FLOAT?s.freeFloat32(_e):s.freeUint8(_e)}}function I(m){var w=m.createTexture();return m.bindTexture(m.TEXTURE_2D,w),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),w}function T(m,w,F,z,U){var V=m.getParameter(m.MAX_TEXTURE_SIZE);if(w<0||w>V||F<0||F>V)throw new Error("gl-texture2d: Invalid texture shape");if(U===m.FLOAT&&!m.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var G=I(m);return m.texImage2D(m.TEXTURE_2D,0,z,w,F,0,z,U,null),new f(m,G,w,F,z,U)}function E(m,w,F,z,U,V){var G=I(m);return m.texImage2D(m.TEXTURE_2D,0,U,U,V,w),new f(m,G,F,z,U,V)}function _(m,w){var F=w.dtype,z=w.shape.slice(),U=m.getParameter(m.MAX_TEXTURE_SIZE);if(z[0]<0||z[0]>U||z[1]<0||z[1]>U)throw new Error("gl-texture2d: Invalid texture size");var V=A(z,w.stride.slice()),G=0;F==="float32"?G=m.FLOAT:F==="float64"?(G=m.FLOAT,V=!1,F="float32"):F==="uint8"?G=m.UNSIGNED_BYTE:(G=m.UNSIGNED_BYTE,V=!1,F="uint8");var j=0;if(z.length===2)j=m.LUMINANCE,z=[z[0],z[1],1],w=l(w.data,z,[w.stride[0],w.stride[1],1],w.offset);else if(z.length===3)if(z[2]===1)j=m.ALPHA;else if(z[2]===2)j=m.LUMINANCE_ALPHA;else if(z[2]===3)j=m.RGB;else if(z[2]===4)j=m.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");G===m.FLOAT&&!m.getExtension("OES_texture_float")&&(G=m.UNSIGNED_BYTE,V=!1);var O,H,W=w.size;if(V)w.offset===0&&w.data.length===W?O=w.data:O=w.data.subarray(w.offset,w.offset+W);else{var ee=[z[2],z[2]*z[0],1];H=s.malloc(W,F);var ue=l(H,z,ee,0);(F==="float32"||F==="float64")&&G===m.UNSIGNED_BYTE?g(ue,w):i.assign(ue,w),O=H.subarray(0,W)}var xe=I(m);return m.texImage2D(m.TEXTURE_2D,0,j,z[0],z[1],0,j,G,O),V||s.free(H),new f(m,xe,z[0],z[1],j,G)}function h(m){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(o||d(m),typeof arguments[1]=="number")return T(m,arguments[1],arguments[2],arguments[3]||m.RGBA,arguments[4]||m.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return T(m,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||m.RGBA,arguments[3]||m.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var w=arguments[1],F=y(w)?w:w.raw;if(F)return E(m,F,w.width|0,w.height|0,arguments[2]||m.RGBA,arguments[3]||m.UNSIGNED_BYTE);if(w.shape&&w.data&&w.stride)return _(m,w)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}}),7790:(function(){}),7815:(function(t,r,a){var l=a(2931),i=a(9970),s=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(A,k,I,T){for(var E=A.points,_=A.velocities,h=A.divergences,m=[],w=[],F=[],z=[],U=[],V=[],G=0,j=0,O=i.create(),H=i.create(),W=8,ee=0;ee0)for(var _e=0;_ek)return T-1}return T},d=function(A,k,I){return AI?I:A},y=function(A,k,I){var T=k.vectors,E=k.meshgrid,_=A[0],h=A[1],m=A[2],w=E[0].length,F=E[1].length,z=E[2].length,U=p(E[0],_),V=p(E[1],h),G=p(E[2],m),j=U+1,O=V+1,H=G+1;if(U=d(U,0,w-1),j=d(j,0,w-1),V=d(V,0,F-1),O=d(O,0,F-1),G=d(G,0,z-1),H=d(H,0,z-1),U<0||V<0||G<0||j>w-1||O>F-1||H>z-1)return l.create();var W=E[0][U],ee=E[0][j],ue=E[1][V],xe=E[1][O],ge=E[2][G],_e=E[2][H],Y=(_-W)/(ee-W),se=(h-ue)/(xe-ue),ce=(m-ge)/(_e-ge);isFinite(Y)||(Y=.5),isFinite(se)||(se=.5),isFinite(ce)||(ce=.5);var ne,ye,le,Z,de,pe;switch(I.reversedX&&(U=w-1-U,j=w-1-j),I.reversedY&&(V=F-1-V,O=F-1-O),I.reversedZ&&(G=z-1-G,H=z-1-H),I.filled){case 5:de=G,pe=H,le=V*z,Z=O*z,ne=U*z*F,ye=j*z*F;break;case 4:de=G,pe=H,ne=U*z,ye=j*z,le=V*z*w,Z=O*z*w;break;case 3:le=V,Z=O,de=G*F,pe=H*F,ne=U*F*z,ye=j*F*z;break;case 2:le=V,Z=O,ne=U*F,ye=j*F,de=G*F*w,pe=H*F*w;break;case 1:ne=U,ye=j,de=G*w,pe=H*w,le=V*w*z,Z=O*w*z;break;default:ne=U,ye=j,le=V*w,Z=O*w,de=G*w*F,pe=H*w*F;break}var Te=T[ne+le+de],Ne=T[ne+le+pe],$e=T[ne+Z+de],Ze=T[ne+Z+pe],Xe=T[ye+le+de],it=T[ye+le+pe],yt=T[ye+Z+de],bt=T[ye+Z+pe],mt=l.create(),ht=l.create(),Ve=l.create(),ze=l.create();l.lerp(mt,Te,Xe,Y),l.lerp(ht,Ne,it,Y),l.lerp(Ve,$e,yt,Y),l.lerp(ze,Ze,bt,Y);var Se=l.create(),Je=l.create();l.lerp(Se,mt,Ve,se),l.lerp(Je,ht,ze,se);var _t=l.create();return l.lerp(_t,Se,Je,ce),_t},g=function(A){var k=1/0;A.sort(function(_,h){return _-h});for(var I=A.length,T=1;Tj||btO||mtH)},ee=l.distance(k[0],k[1]),ue=10*ee/T,xe=ue*ue,ge=1,_e=0,Y=I.length;Y>1&&(ge=C(I));for(var se=0;se_e&&(_e=Te),de.push(Te),z.push({points:ne,velocities:ye,divergences:de});for(var Ne=0;Nexe&&l.scale($e,$e,ue/Math.sqrt(Ze)),l.add($e,$e,ce),le=w($e),l.squaredDistance(Z,$e)-xe>-1e-4*xe){ne.push($e),Z=$e,ye.push(le);var pe=F($e,le),Te=l.length(pe);isFinite(Te)&&Te>_e&&(_e=Te),de.push(Te)}ce=$e}}var Xe=c(z,A.colormap,_e,ge);return _?Xe.tubeScale=_:(_e===0&&(_e=1),Xe.tubeScale=E*.5*ge/_e),Xe};var f=a(6740),x=a(6405).createMesh;t.exports.createTubeMesh=function(A,k){return x(A,k,{shaders:f,traceType:"streamtube"})}}),7827:(function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]}),7842:(function(t,r,a){var l=a(6330),i=a(1533),s=a(2651),o=a(6768),c=a(869),p=a(8697);t.exports=d;function d(y,g){if(l(y))return g?p(y,d(g)):[y[0].clone(),y[1].clone()];var C=0,f,x;if(i(y))f=y.clone();else if(typeof y=="string")f=o(y);else{if(y===0)return[s(0),s(1)];if(y===Math.floor(y))f=s(y);else{for(;y!==Math.floor(y);)y=y*Math.pow(2,256),C-=256;f=s(y)}}if(l(g))f.mul(g[1]),x=g[0].clone();else if(i(g))x=g.clone();else if(typeof g=="string")x=o(g);else if(!g)x=s(1);else if(g===Math.floor(g))x=s(g);else{for(;g!==Math.floor(g);)g=g*Math.pow(2,256),C+=256;x=s(g)}return C>0?f=f.ushln(C):C<0&&(x=x.ushln(-C)),c(f,x)}}),7894:(function(t){t.exports=r;function r(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}}),7932:(function(t,r,a){var l=a(620);t.exports=l.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"])}),7960:(function(t){t.exports=r;function r(a,l){var i=l[0]-a[0],s=l[1]-a[1],o=l[2]-a[2],c=l[3]-a[3];return i*i+s*s+o*o+c*c}}),8105:(function(t){t.exports=a;var r={"lo===p0":l,"lo=p0)&&!(p1>=hi)":d};function a(y){return r[y]}function l(y,g,C,f,x,A,k){for(var I=2*y,T=I*C,E=T,_=C,h=g,m=y+g,w=C;f>w;++w,T+=I){var F=x[T+h];if(F===k)if(_===w)_+=1,E+=I;else{for(var z=0;I>z;++z){var U=x[T+z];x[T+z]=x[E],x[E++]=U}var V=A[w];A[w]=A[_],A[_++]=V}}return _}function i(y,g,C,f,x,A,k){for(var I=2*y,T=I*C,E=T,_=C,h=g,m=y+g,w=C;f>w;++w,T+=I){var F=x[T+h];if(Fz;++z){var U=x[T+z];x[T+z]=x[E],x[E++]=U}var V=A[w];A[w]=A[_],A[_++]=V}}return _}function s(y,g,C,f,x,A,k){for(var I=2*y,T=I*C,E=T,_=C,h=g,m=y+g,w=C;f>w;++w,T+=I){var F=x[T+m];if(F<=k)if(_===w)_+=1,E+=I;else{for(var z=0;I>z;++z){var U=x[T+z];x[T+z]=x[E],x[E++]=U}var V=A[w];A[w]=A[_],A[_++]=V}}return _}function o(y,g,C,f,x,A,k){for(var I=2*y,T=I*C,E=T,_=C,h=g,m=y+g,w=C;f>w;++w,T+=I){var F=x[T+m];if(F<=k)if(_===w)_+=1,E+=I;else{for(var z=0;I>z;++z){var U=x[T+z];x[T+z]=x[E],x[E++]=U}var V=A[w];A[w]=A[_],A[_++]=V}}return _}function c(y,g,C,f,x,A,k){for(var I=2*y,T=I*C,E=T,_=C,h=g,m=y+g,w=C;f>w;++w,T+=I){var F=x[T+h],z=x[T+m];if(F<=k&&k<=z)if(_===w)_+=1,E+=I;else{for(var U=0;I>U;++U){var V=x[T+U];x[T+U]=x[E],x[E++]=V}var G=A[w];A[w]=A[_],A[_++]=G}}return _}function p(y,g,C,f,x,A,k){for(var I=2*y,T=I*C,E=T,_=C,h=g,m=y+g,w=C;f>w;++w,T+=I){var F=x[T+h],z=x[T+m];if(FU;++U){var V=x[T+U];x[T+U]=x[E],x[E++]=V}var G=A[w];A[w]=A[_],A[_++]=G}}return _}function d(y,g,C,f,x,A,k,I){for(var T=2*y,E=T*C,_=E,h=C,m=g,w=y+g,F=C;f>F;++F,E+=T){var z=x[E+m],U=x[E+w];if(!(z>=k)&&!(I>=U))if(h===F)h+=1,_+=T;else{for(var V=0;T>V;++V){var G=x[E+V];x[E+V]=x[_],x[_++]=G}var j=A[F];A[F]=A[h],A[h++]=j}}return h}}),8107:(function(t){t.exports=r;function r(a,l,i){return a[0]=Math.min(l[0],i[0]),a[1]=Math.min(l[1],i[1]),a[2]=Math.min(l[2],i[2]),a}}),8116:(function(t,r,a){var l=a(7518),i=a(870);function s(c){this.bindVertexArrayOES=c.bindVertexArray.bind(c),this.createVertexArrayOES=c.createVertexArray.bind(c),this.deleteVertexArrayOES=c.deleteVertexArray.bind(c)}function o(c,p,d,y){var g=c.createVertexArray?new s(c):c.getExtension("OES_vertex_array_object"),C;return g?C=l(c,g):C=i(c),C.update(p,d,y),C}t.exports=o}),8192:(function(t,r,a){t.exports=o;var l=a(2825),i=a(3536),s=a(244);function o(c,p){var d=l(c[0],c[1],c[2]),y=l(p[0],p[1],p[2]);i(d,d),i(y,y);var g=s(d,y);return g>1?0:Math.acos(g)}}),8210:(function(t){t.exports=a;function r(l,i){var s=l+i,o=s-l,c=s-o,p=i-o,d=l-c,y=d+p;return y?[y,s]:[s]}function a(l,i){var s=l.length|0,o=i.length|0;if(s===1&&o===1)return r(l[0],i[0]);var c=s+o,p=new Array(c),d=0,y=0,g=0,C=Math.abs,f=l[y],x=C(f),A=i[g],k=C(A),I,T;x=o?(I=f,y+=1,yd)for(var F=p[f],z=1/Math.sqrt(_*m),w=0;w<3;++w){var U=(w+1)%3,V=(w+2)%3;F[w]+=z*(h[U]*E[V]-h[V]*E[U])}}for(var y=0;yd)for(var z=1/Math.sqrt(G),w=0;w<3;++w)F[w]*=z;else for(var w=0;w<3;++w)F[w]=0}return p},r.faceNormals=function(i,s,o){for(var c=i.length,p=new Array(c),d=o===void 0?l:o,y=0;yd?I=1/Math.sqrt(I):I=0;for(var f=0;f<3;++f)k[f]*=I;p[y]=k}return p}}),8418:(function(t,r,a){var l=a(5219),i=a(2762),s=a(8116),o=a(1888),c=a(6760),p=a(1283),d=a(9366),y=a(5964),g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],C=ArrayBuffer,f=DataView;function x(ne){return C.isView(ne)&&!(ne instanceof f)}function A(ne){return Array.isArray(ne)||x(ne)}t.exports=ce;function k(ne,ye){var le=ne[0],Z=ne[1],de=ne[2],pe=ne[3];return ne[0]=ye[0]*le+ye[4]*Z+ye[8]*de+ye[12]*pe,ne[1]=ye[1]*le+ye[5]*Z+ye[9]*de+ye[13]*pe,ne[2]=ye[2]*le+ye[6]*Z+ye[10]*de+ye[14]*pe,ne[3]=ye[3]*le+ye[7]*Z+ye[11]*de+ye[15]*pe,ne}function I(ne,ye,le,Z){return k(Z,Z),k(Z,Z),k(Z,Z)}function T(ne,ye){this.index=ne,this.dataCoordinate=this.position=ye}function E(ne){return ne===!0||ne>1?1:ne}function _(ne,ye,le,Z,de,pe,Te,Ne,$e,Ze,Xe,it){this.gl=ne,this.pixelRatio=1,this.shader=ye,this.orthoShader=le,this.projectShader=Z,this.pointBuffer=de,this.colorBuffer=pe,this.glyphBuffer=Te,this.idBuffer=Ne,this.vao=$e,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Ze,this.pickOrthoShader=Xe,this.pickProjectShader=it,this.points=[],this._selectResult=new T(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}var h=_.prototype;h.pickSlots=1,h.setPickBase=function(ne){this.pickId=ne},h.isTransparent=function(){if(this.hasAlpha)return!0;for(var ne=0;ne<3;++ne)if(this.axesProject[ne]&&this.projectHasAlpha)return!0;return!1},h.isOpaque=function(){if(!this.hasAlpha)return!0;for(var ne=0;ne<3;++ne)if(this.axesProject[ne]&&!this.projectHasAlpha)return!0;return!1};var m=[0,0],w=[0,0,0],F=[0,0,0],z=[0,0,0,1],U=[0,0,0,1],V=g.slice(),G=[0,0,0],j=[[0,0,0],[0,0,0]];function O(ne){return ne[0]=ne[1]=ne[2]=0,ne}function H(ne,ye){return ne[0]=ye[0],ne[1]=ye[1],ne[2]=ye[2],ne[3]=1,ne}function W(ne,ye,le,Z){return ne[0]=ye[0],ne[1]=ye[1],ne[2]=ye[2],ne[le]=Z,ne}function ee(ne){for(var ye=j,le=0;le<2;++le)for(var Z=0;Z<3;++Z)ye[le][Z]=Math.max(Math.min(ne[le][Z],1e8),-1e8);return ye}function ue(ne,ye,le,Z){var de=ye.axesProject,pe=ye.gl,Te=ne.uniforms,Ne=le.model||g,$e=le.view||g,Ze=le.projection||g,Xe=ye.axesBounds,it=ee(ye.clipBounds),yt;ye.axes&&ye.axes.lastCubeProps?yt=ye.axes.lastCubeProps.axis:yt=[1,1,1],m[0]=2/pe.drawingBufferWidth,m[1]=2/pe.drawingBufferHeight,ne.bind(),Te.view=$e,Te.projection=Ze,Te.screenSize=m,Te.highlightId=ye.highlightId,Te.highlightScale=ye.highlightScale,Te.clipBounds=it,Te.pickGroup=ye.pickId/255,Te.pixelRatio=Z;for(var bt=0;bt<3;++bt)if(de[bt]){Te.scale=ye.projectScale[bt],Te.opacity=ye.projectOpacity[bt];for(var mt=V,ht=0;ht<16;++ht)mt[ht]=0;for(var ht=0;ht<4;++ht)mt[5*ht]=1;mt[5*bt]=0,yt[bt]<0?mt[12+bt]=Xe[0][bt]:mt[12+bt]=Xe[1][bt],c(mt,Ne,mt),Te.model=mt;var Ve=(bt+1)%3,ze=(bt+2)%3,Se=O(w),Je=O(F);Se[Ve]=1,Je[ze]=1;var _t=I(Ze,$e,Ne,H(z,Se)),At=I(Ze,$e,Ne,H(U,Je));if(Math.abs(_t[1])>Math.abs(At[1])){var vt=_t;_t=At,At=vt,vt=Se,Se=Je,Je=vt;var Kt=Ve;Ve=ze,ze=Kt}_t[0]<0&&(Se[Ve]=-1),At[1]>0&&(Je[ze]=-1);for(var Qt=0,fr=0,ht=0;ht<4;++ht)Qt+=Math.pow(Ne[4*Ve+ht],2),fr+=Math.pow(Ne[4*ze+ht],2);Se[Ve]/=Math.sqrt(Qt),Je[ze]/=Math.sqrt(fr),Te.axes[0]=Se,Te.axes[1]=Je,Te.fragClipBounds[0]=W(G,it[0],bt,-1e8),Te.fragClipBounds[1]=W(G,it[1],bt,1e8),ye.vao.bind(),ye.vao.draw(pe.TRIANGLES,ye.vertexCount),ye.lineWidth>0&&(pe.lineWidth(ye.lineWidth*Z),ye.vao.draw(pe.LINES,ye.lineVertexCount,ye.vertexCount)),ye.vao.unbind()}}var xe=[-1e8,-1e8,-1e8],ge=[1e8,1e8,1e8],_e=[xe,ge];function Y(ne,ye,le,Z,de,pe,Te){var Ne=le.gl;if((pe===le.projectHasAlpha||Te)&&ue(ye,le,Z,de),pe===le.hasAlpha||Te){ne.bind();var $e=ne.uniforms;$e.model=Z.model||g,$e.view=Z.view||g,$e.projection=Z.projection||g,m[0]=2/Ne.drawingBufferWidth,m[1]=2/Ne.drawingBufferHeight,$e.screenSize=m,$e.highlightId=le.highlightId,$e.highlightScale=le.highlightScale,$e.fragClipBounds=_e,$e.clipBounds=le.axes.bounds,$e.opacity=le.opacity,$e.pickGroup=le.pickId/255,$e.pixelRatio=de,le.vao.bind(),le.vao.draw(Ne.TRIANGLES,le.vertexCount),le.lineWidth>0&&(Ne.lineWidth(le.lineWidth*de),le.vao.draw(Ne.LINES,le.lineVertexCount,le.vertexCount)),le.vao.unbind()}}h.draw=function(ne){var ye=this.useOrtho?this.orthoShader:this.shader;Y(ye,this.projectShader,this,ne,this.pixelRatio,!1,!1)},h.drawTransparent=function(ne){var ye=this.useOrtho?this.orthoShader:this.shader;Y(ye,this.projectShader,this,ne,this.pixelRatio,!0,!1)},h.drawPick=function(ne){var ye=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;Y(ye,this.pickProjectShader,this,ne,1,!0,!0)},h.pick=function(ne){if(!ne||ne.id!==this.pickId)return null;var ye=ne.value[2]+(ne.value[1]<<8)+(ne.value[0]<<16);if(ye>=this.pointCount||ye<0)return null;var le=this.points[ye],Z=this._selectResult;Z.index=ye;for(var de=0;de<3;++de)Z.position[de]=Z.dataCoordinate[de]=le[de];return Z},h.highlight=function(ne){if(!ne)this.highlightId=[1,1,1,1];else{var ye=ne.index,le=ye&255,Z=ye>>8&255,de=ye>>16&255;this.highlightId=[le/255,Z/255,de/255,0]}};function se(ne,ye,le,Z){var de;A(ne)?ye0){var Qr=0,Bt=ze,et=[0,0,0,1],ut=[0,0,0,1],Be=A(yt)&&A(yt[0]),Ie=A(ht)&&A(ht[0]);e:for(var Z=0;Z0?1-fr[0][0]:Zt<0?1+fr[1][0]:1,ur*=ur>0?1-fr[0][1]:ur<0?1+fr[1][1]:1;for(var Dr=[Zt,ur],ha=Kt.cells||[],oa=Kt.positions||[],At=0;At=o?(I=f,y+=1,y0?1:0}}),8648:(function(t,r,a){t.exports=a(783)}),8692:(function(t){t.exports=r;function r(a,l,i,s){var o=i[0],c=i[1],p=l[0]-o,d=l[1]-c,y=Math.sin(s),g=Math.cos(s);return a[0]=o+p*g-d*y,a[1]=c+p*y+d*g,a[2]=l[2],a}}),8697:(function(t,r,a){var l=a(869);t.exports=i;function i(s,o){return l(s[0].mul(o[1]),s[1].mul(o[0]))}}),8731:(function(t,r,a){t.exports=d;var l=a(8866);function i(y,g,C,f,x,A){this._gl=y,this._wrapper=g,this._index=C,this._locations=f,this._dimension=x,this._constFunc=A}var s=i.prototype;s.pointer=function(g,C,f,x){var A=this,k=A._gl,I=A._locations[A._index];k.vertexAttribPointer(I,A._dimension,g||k.FLOAT,!!C,f||0,x||0),k.enableVertexAttribArray(I)},s.set=function(y,g,C,f){return this._constFunc(this._locations[this._index],y,g,C,f)},Object.defineProperty(s,"location",{get:function(){return this._locations[this._index]},set:function(y){return y!==this._locations[this._index]&&(this._locations[this._index]=y|0,this._wrapper.program=null),y|0}});var o=[function(y,g,C){return C.length===void 0?y.vertexAttrib1f(g,C):y.vertexAttrib1fv(g,C)},function(y,g,C,f){return C.length===void 0?y.vertexAttrib2f(g,C,f):y.vertexAttrib2fv(g,C)},function(y,g,C,f,x){return C.length===void 0?y.vertexAttrib3f(g,C,f,x):y.vertexAttrib3fv(g,C)},function(y,g,C,f,x,A){return C.length===void 0?y.vertexAttrib4f(g,C,f,x,A):y.vertexAttrib4fv(g,C)}];function c(y,g,C,f,x,A,k){var I=o[x],T=new i(y,g,C,f,x,I);Object.defineProperty(A,k,{set:function(E){return y.disableVertexAttribArray(f[C]),I(y,f[C],E),E},get:function(){return T},enumerable:!0})}function p(y,g,C,f,x,A,k){for(var I=new Array(x),T=new Array(x),E=0;E=0){var h=E.charCodeAt(E.length-1)-48;if(h<2||h>4)throw new l("","Invalid data type for attribute "+T+": "+E);c(y,g,_[0],f,h,x,T)}else if(E.indexOf("mat")>=0){var h=E.charCodeAt(E.length-1)-48;if(h<2||h>4)throw new l("","Invalid data type for attribute "+T+": "+E);p(y,g,_,f,h,x,T)}else throw new l("","Unknown data type for attribute "+T+": "+E);break}}return x}}),8828:(function(t,r){"use restrict";var a=32;r.INT_BITS=a,r.INT_MAX=2147483647,r.INT_MIN=-1<0)-(s<0)},r.abs=function(s){var o=s>>a-1;return(s^o)-o},r.min=function(s,o){return o^(s^o)&-(s65535)<<4,s>>>=o,c=(s>255)<<3,s>>>=c,o|=c,c=(s>15)<<2,s>>>=c,o|=c,c=(s>3)<<1,s>>>=c,o|=c,o|s>>1},r.log10=function(s){return s>=1e9?9:s>=1e8?8:s>=1e7?7:s>=1e6?6:s>=1e5?5:s>=1e4?4:s>=1e3?3:s>=100?2:s>=10?1:0},r.popCount=function(s){return s=s-(s>>>1&1431655765),s=(s&858993459)+(s>>>2&858993459),(s+(s>>>4)&252645135)*16843009>>>24};function l(s){var o=32;return s&=-s,s&&o--,s&65535&&(o-=16),s&16711935&&(o-=8),s&252645135&&(o-=4),s&858993459&&(o-=2),s&1431655765&&(o-=1),o}r.countTrailingZeros=l,r.nextPow2=function(s){return s+=s===0,--s,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1},r.prevPow2=function(s){return s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s-(s>>>1)},r.parity=function(s){return s^=s>>>16,s^=s>>>8,s^=s>>>4,s&=15,27030>>>s&1};var i=new Array(256);(function(s){for(var o=0;o<256;++o){var c=o,p=o,d=7;for(c>>>=1;c;c>>>=1)p<<=1,p|=c&1,--d;s[o]=p<>>8&255]<<16|i[s>>>16&255]<<8|i[s>>>24&255]},r.interleave2=function(s,o){return s&=65535,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,s|o<<1},r.deinterleave2=function(s,o){return s=s>>>o&1431655765,s=(s|s>>>1)&858993459,s=(s|s>>>2)&252645135,s=(s|s>>>4)&16711935,s=(s|s>>>16)&65535,s<<16>>16},r.interleave3=function(s,o,c){return s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,s|=o<<1,c&=1023,c=(c|c<<16)&4278190335,c=(c|c<<8)&251719695,c=(c|c<<4)&3272356035,c=(c|c<<2)&1227133513,s|c<<2},r.deinterleave3=function(s,o){return s=s>>>o&1227133513,s=(s|s>>>2)&3272356035,s=(s|s>>>4)&251719695,s=(s|s>>>8)&4278190335,s=(s|s>>>16)&1023,s<<22>>22},r.nextCombination=function(s){var o=s|s-1;return o+1|(~o&-~o)-1>>>l(s)+1}}),8866:(function(t){function r(a,l,i){this.shortMessage=l||"",this.longMessage=i||"",this.rawError=a||"",this.message="gl-shader: "+(l||a||"")+(i?` +`+i:""),this.stack=new Error().stack}r.prototype=new Error,r.prototype.name="GLError",r.prototype.constructor=r,t.exports=r}),8902:(function(t,r,a){var l=a(2478),i=a(3250)[3],s=0,o=1,c=2;t.exports=k;function p(I,T,E,_,h){this.a=I,this.b=T,this.idx=E,this.lowerIds=_,this.upperIds=h}function d(I,T,E,_){this.a=I,this.b=T,this.type=E,this.idx=_}function y(I,T){var E=I.a[0]-T.a[0]||I.a[1]-T.a[1]||I.type-T.type;return E||I.type!==s&&(E=i(I.a,I.b,T.b),E)?E:I.idx-T.idx}function g(I,T){return i(I.a,I.b,T)}function C(I,T,E,_,h){for(var m=l.lt(T,_,g),w=l.gt(T,_,g),F=m;F1&&i(E[U[G-2]],E[U[G-1]],_)>0;)I.push([U[G-1],U[G-2],h]),G-=1;U.length=G,U.push(h);for(var V=z.upperIds,G=V.length;G>1&&i(E[V[G-2]],E[V[G-1]],_)<0;)I.push([V[G-2],V[G-1],h]),G-=1;V.length=G,V.push(h)}}function f(I,T){var E;return I.a[0]z[0]&&h.push(new d(z,F,c,m),new d(F,z,o,m))}h.sort(y);for(var U=h[0].a[0]-(1+Math.abs(h[0].a[0]))*Math.pow(2,-52),V=[new p([U,1],[U,0],-1,[],[])],G=[],m=0,j=h.length;m0;){x=_.pop();for(var h=x.adjacent,m=0;m<=k;++m){var w=h[m];if(!(!w.boundary||w.lastVisited<=-I)){for(var F=w.vertices,z=0;z<=k;++z){var U=F[z];U<0?T[z]=A:T[z]=E[U]}var V=this.orient();if(V>0)return w;w.lastVisited=-I,V===0&&_.push(w)}}}return null},C.walk=function(x,A){var k=this.vertices.length-1,I=this.dimension,T=this.vertices,E=this.tuple,_=A?this.interior.length*Math.random()|0:this.interior.length-1,h=this.interior[_];e:for(;!h.boundary;){for(var m=h.vertices,w=h.adjacent,F=0;F<=I;++F)E[F]=T[m[F]];h.lastVisited=k;for(var F=0;F<=I;++F){var z=w[F];if(!(z.lastVisited>=k)){var U=E[F];E[F]=x;var V=this.orient();if(E[F]=U,V<0){h=z;continue e}else z.boundary?z.lastVisited=-k:z.lastVisited=k}}return}return h},C.addPeaks=function(x,A){var k=this.vertices.length-1,I=this.dimension,T=this.vertices,E=this.tuple,_=this.interior,h=this.simplices,m=[A];A.lastVisited=k,A.vertices[A.vertices.indexOf(-1)]=k,A.boundary=!1,_.push(A);for(var w=[];m.length>0;){var A=m.pop(),F=A.vertices,z=A.adjacent,U=F.indexOf(k);if(!(U<0)){for(var V=0;V<=I;++V)if(V!==U){var G=z[V];if(!(!G.boundary||G.lastVisited>=k)){var j=G.vertices;if(G.lastVisited!==-k){for(var O=0,H=0;H<=I;++H)j[H]<0?(O=H,E[H]=x):E[H]=T[j[H]];var W=this.orient();if(W>0){j[O]=k,G.boundary=!1,_.push(G),m.push(G),G.lastVisited=k;continue}else G.lastVisited=-k}var ee=G.adjacent,ue=F.slice(),xe=z.slice(),ge=new s(ue,xe,!0);h.push(ge);var _e=ee.indexOf(A);if(!(_e<0)){ee[_e]=ge,xe[U]=G,ue[V]=-1,xe[V]=A,z[V]=ge,ge.flip();for(var H=0;H<=I;++H){var Y=ue[H];if(!(Y<0||Y===k)){for(var se=new Array(I-1),ce=0,ne=0;ne<=I;++ne){var ye=ue[ne];ye<0||ne===H||(se[ce++]=ye)}w.push(new o(se,ge,H))}}}}}}}w.sort(c);for(var V=0;V+1=0?_[m++]=h[F]:w=F&1;if(w===(x&1)){var z=_[0];_[0]=_[1],_[1]=z}A.push(_)}}return A};function f(x,A){var k=x.length;if(k===0)throw new Error("Must have at least d+1 points");var I=x[0].length;if(k<=I)throw new Error("Must input at least d+1 points");var T=x.slice(0,I+1),E=l.apply(void 0,T);if(E===0)throw new Error("Input not in general position");for(var _=new Array(I+1),h=0;h<=I;++h)_[h]=h;E<0&&(_[0]=1,_[1]=0);for(var m=new s(_,new Array(I+1),!1),w=m.adjacent,F=new Array(I+2),h=0;h<=I;++h){for(var z=_.slice(),U=0;U<=I;++U)U===h&&(z[U]=-1);var V=z[0];z[0]=z[1],z[1]=V;var G=new s(z,new Array(I+1),!0);w[h]=G,F[h]=G}F[I+1]=m;for(var h=0;h<=I;++h)for(var z=w[h].vertices,j=w[h].adjacent,U=0;U<=I;++U){var O=z[U];if(O<0){j[U]=m;continue}for(var H=0;H<=I;++H)w[H].vertices.indexOf(O)<0&&(j[U]=w[H])}for(var W=new g(I,T,F),ee=!!A,h=I+1;h=1},f.isTransparent=function(){return this.opacity<1},f.pickSlots=1,f.setPickBase=function(E){this.pickId=E};function x(E){for(var _=y({colormap:E,nshades:256,format:"rgba"}),h=new Uint8Array(256*4),m=0;m<256;++m){for(var w=_[m],F=0;F<3;++F)h[4*m+F]=w[F];h[4*m+3]=w[3]*255}return d(h,[256,256,4],[4,0,1])}function A(E){for(var _=E.length,h=new Array(_),m=0;m<_;++m)h[m]=E[m][2];return h}f.update=function(E){E=E||{};var _=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),E.tubeScale!==void 0&&(this.tubeScale=E.tubeScale),E.vectorScale!==void 0&&(this.vectorScale=E.vectorScale),E.coneScale!==void 0&&(this.coneScale=E.coneScale),E.coneOffset!==void 0&&(this.coneOffset=E.coneOffset),E.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=_.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=_.LINEAR,this.texture.setPixels(x(E.colormap)),this.texture.generateMipmap());var h=E.cells,m=E.positions,w=E.vectors;if(!(!m||!h||!w)){var F=[],z=[],U=[],V=[],G=[];this.cells=h,this.positions=m,this.vectors=w;var j=E.meshColor||[1,1,1,1],O=E.vertexIntensity,H=1/0,W=-1/0;if(O)if(E.vertexIntensityBounds)H=+E.vertexIntensityBounds[0],W=+E.vertexIntensityBounds[1];else for(var ee=0;ee0){var H=this.triShader;H.bind(),H.uniforms=U,this.triangleVAO.bind(),_.drawArrays(_.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},f.drawPick=function(E){E=E||{};for(var _=this.gl,h=E.model||g,m=E.view||g,w=E.projection||g,F=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],z=0;z<3;++z)F[0][z]=Math.max(F[0][z],this.clipBounds[0][z]),F[1][z]=Math.min(F[1][z],this.clipBounds[1][z]);this._model=[].slice.call(h),this._view=[].slice.call(m),this._projection=[].slice.call(w),this._resolution=[_.drawingBufferWidth,_.drawingBufferHeight];var U={model:h,view:m,projection:w,clipBounds:F,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},V=this.pickShader;V.bind(),V.uniforms=U,this.triangleCount>0&&(this.triangleVAO.bind(),_.drawArrays(_.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},f.pick=function(E){if(!E||E.id!==this.pickId)return null;var _=E.value[0]+256*E.value[1]+65536*E.value[2],h=this.cells[_],m=this.positions[h[1]].slice(0,3),w={position:m,dataCoordinate:m,index:Math.floor(h[1]/48)};return this.traceType==="cone"?w.index=Math.floor(h[1]/48):this.traceType==="streamtube"&&(w.intensity=this.intensity[h[1]],w.velocity=this.vectors[h[1]].slice(0,3),w.divergence=this.vectors[h[1]][3],w.index=_),w},f.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()};function k(E,_){var h=l(E,_.meshShader.vertex,_.meshShader.fragment,null,_.meshShader.attributes);return h.attributes.position.location=0,h.attributes.color.location=2,h.attributes.uv.location=3,h.attributes.vector.location=4,h}function I(E,_){var h=l(E,_.pickShader.vertex,_.pickShader.fragment,null,_.pickShader.attributes);return h.attributes.position.location=0,h.attributes.id.location=1,h.attributes.vector.location=4,h}function T(E,_,h){var m=h.shaders;arguments.length===1&&(_=E,E=_.gl);var w=k(E,m),F=I(E,m),z=o(E,d(new Uint8Array([255,255,255,255]),[1,1,4]));z.generateMipmap(),z.minFilter=E.LINEAR_MIPMAP_LINEAR,z.magFilter=E.LINEAR;var U=i(E),V=i(E),G=i(E),j=i(E),O=i(E),H=s(E,[{buffer:U,type:E.FLOAT,size:4},{buffer:O,type:E.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:G,type:E.FLOAT,size:4},{buffer:j,type:E.FLOAT,size:2},{buffer:V,type:E.FLOAT,size:4}]),W=new C(E,z,w,F,U,V,O,G,j,H,h.traceType||"cone");return W.update(_),W}t.exports=T}),9127:(function(t,r,a){t.exports=s;var l=a(6204),i=a(5771);function s(o){return i(l(o))}}),9131:(function(t,r,a){var l=a(5177),i=a(9288);t.exports=s;function s(o,c){return c=c||1,o[0]=Math.random(),o[1]=Math.random(),o[2]=Math.random(),o[3]=Math.random(),l(o,o),i(o,o,c),o}}),9165:(function(t,r,a){t.exports=C;var l=a(2762),i=a(8116),s=a(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function c(f,x,A,k){this.gl=f,this.shader=k,this.buffer=x,this.vao=A,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 p=c.prototype;p.isOpaque=function(){return!this.hasAlpha},p.isTransparent=function(){return this.hasAlpha},p.drawTransparent=p.draw=function(f){var x=this.gl,A=this.shader.uniforms;this.shader.bind();var k=A.view=f.view||o,I=A.projection=f.projection||o;A.model=f.model||o,A.clipBounds=this.clipBounds,A.opacity=this.opacity;var T=k[12],E=k[13],_=k[14],h=k[15],m=f._ortho||!1,w=m?2:1,F=w*this.pixelRatio*(I[3]*T+I[7]*E+I[11]*_+I[15]*h)/x.drawingBufferHeight;this.vao.bind();for(var z=0;z<3;++z)x.lineWidth(this.lineWidth[z]*this.pixelRatio),A.capSize=this.capSize[z]*F,this.lineCount[z]&&x.drawArrays(x.LINES,this.lineOffset[z],this.lineCount[z]);this.vao.unbind()};function d(f,x){for(var A=0;A<3;++A)f[0][A]=Math.min(f[0][A],x[A]),f[1][A]=Math.max(f[1][A],x[A])}var y=(function(){for(var f=new Array(3),x=0;x<3;++x){for(var A=[],k=1;k<=2;++k)for(var I=-1;I<=1;I+=2){var T=(k+x)%3,E=[0,0,0];E[T]=I,A.push(E)}f[x]=A}return f})();function g(f,x,A,k){for(var I=y[k],T=0;T0){var U=m.slice();U[_]+=F[1][_],I.push(m[0],m[1],m[2],z[0],z[1],z[2],z[3],0,0,0,U[0],U[1],U[2],z[0],z[1],z[2],z[3],0,0,0),d(this.bounds,U),E+=2+g(I,U,z,_)}}}this.lineCount[_]=E-this.lineOffset[_]}this.buffer.update(I)}},p.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function C(f){var x=f.gl,A=l(x),k=i(x,[{buffer:A,type:x.FLOAT,size:3,offset:0,stride:40},{buffer:A,type:x.FLOAT,size:4,offset:12,stride:40},{buffer:A,type:x.FLOAT,size:3,offset:28,stride:40}]),I=s(x);I.attributes.position.location=0,I.attributes.color.location=1,I.attributes.offset.location=2;var T=new c(x,A,k,I);return T.update(f),T}}),9215:(function(t,r,a){t.exports=d;var l=a(4769),i=a(2478);function s(y,g,C){return Math.min(g,Math.max(y,C))}function o(y,g,C){this.dimension=y.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var f=0;f=C-1)for(var E=A.length-1,h=y-g[C-1],_=0;_=C-1){var T=A.length-1;y-g[C-1];for(var E=0;E=0;--C)if(y[--g])return!1;return!0},c.jump=function(y){var g=this.lastT(),C=this.dimension;if(!(y0;--_)f.push(s(I[_-1],T[_-1],arguments[_])),x.push(0)}},c.push=function(y){var g=this.lastT(),C=this.dimension;if(!(y1e-6?1/k:0;this._time.push(y);for(var h=C;h>0;--h){var m=s(T[h-1],E[h-1],arguments[h]);f.push(m),x.push((m-f[A++])*_)}}},c.set=function(y){var g=this.dimension;if(!(y0;--I)C.push(s(A[I-1],k[I-1],arguments[I])),f.push(0)}},c.move=function(y){var g=this.lastT(),C=this.dimension;if(!(y<=g||arguments.length!==C+1)){var f=this._state,x=this._velocity,A=f.length-this.dimension,k=this.bounds,I=k[0],T=k[1],E=y-g,_=E>1e-6?1/E:0;this._time.push(y);for(var h=C;h>0;--h){var m=arguments[h];f.push(s(I[h-1],T[h-1],f[A++]+m)),x.push(m*_)}}},c.idle=function(y){var g=this.lastT();if(!(y=0;--_)f.push(s(I[_],T[_],f[A]+E*x[A])),x.push(0),A+=1}};function p(y){for(var g=new Array(y),C=0;C1&&o.indexOf("Macintosh")!==-1&&o.indexOf("Safari")!==-1&&(c=!0),c}}),9226:(function(t){t.exports=r;function r(a,l){return a[0]=Math.ceil(l[0]),a[1]=Math.ceil(l[1]),a[2]=Math.ceil(l[2]),a}}),9265:(function(t){t.exports=r;function r(a,l){return a[0]===l[0]&&a[1]===l[1]&&a[2]===l[2]}}),9288:(function(t){t.exports=r;function r(a,l,i){return a[0]=l[0]*i,a[1]=l[1]*i,a[2]=l[2]*i,a[3]=l[3]*i,a}}),9346:(function(t){var r=new Float64Array(4),a=new Float64Array(4),l=new Float64Array(4);function i(s,o,c,p,d){r.length=g?(h=1,w=g+2*x+k):(h=-x/g,w=x*h+k)):(h=0,A>=0?(m=0,w=k):-A>=f?(m=1,w=f+2*A+k):(m=-A/f,w=A*m+k));else if(m<0)m=0,x>=0?(h=0,w=k):-x>=g?(h=1,w=g+2*x+k):(h=-x/g,w=x*h+k);else{var F=1/_;h*=F,m*=F,w=h*(g*h+C*m+2*x)+m*(C*h+f*m+2*A)+k}else{var z,U,V,G;h<0?(z=C+x,U=f+A,U>z?(V=U-z,G=g-2*C+f,V>=G?(h=1,m=0,w=g+2*x+k):(h=V/G,m=1-h,w=h*(g*h+C*m+2*x)+m*(C*h+f*m+2*A)+k)):(h=0,U<=0?(m=1,w=f+2*A+k):A>=0?(m=0,w=k):(m=-A/f,w=A*m+k))):m<0?(z=C+A,U=g+x,U>z?(V=U-z,G=g-2*C+f,V>=G?(m=1,h=0,w=f+2*A+k):(m=V/G,h=1-m,w=h*(g*h+C*m+2*x)+m*(C*h+f*m+2*A)+k)):(m=0,U<=0?(h=1,w=g+2*x+k):x>=0?(h=0,w=k):(h=-x/g,w=x*h+k))):(V=f+A-C-x,V<=0?(h=0,m=1,w=f+2*A+k):(G=g-2*C+f,V>=G?(h=1,m=0,w=g+2*x+k):(h=V/G,m=1-h,w=h*(g*h+C*m+2*x)+m*(C*h+f*m+2*A)+k)))}for(var j=1-h-m,y=0;yA)for(f=A;fx)for(f=x;f=0){for(var j=G.type.charAt(G.type.length-1)|0,O=new Array(j),H=0;H=0;)W+=1;U[V]=W}var ee=new Array(A.length);function ue(){T.program=o.program(E,T._vref,T._fref,z,U);for(var xe=0;xele&&de>0){var pe=(Z[de][0]-le)/(Z[de][0]-Z[de-1][0]);return Z[de][1]*(1-pe)+pe*Z[de-1][1]}}return 1}var H=[0,0,0],W={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function ee(le,Z){var de,pe,Te,Ne=Z.axes&&Z.axes.lastCubeProps.axis||H,$e=Z.showSurface,Ze=Z.showContour;for(de=0;de<3;++de)for($e=$e||Z.surfaceProject[de],pe=0;pe<3;++pe)Ze=Ze||Z.contourProject[de][pe];for(de=0;de<3;++de){var Xe=W.projections[de];for(pe=0;pe<16;++pe)Xe[pe]=0;for(pe=0;pe<4;++pe)Xe[5*pe]=1;Xe[5*de]=0,Xe[12+de]=Z.axesBounds[+(Ne[de]>0)][de],f(Xe,le.model,Xe);var it=W.clipBounds[de];for(Te=0;Te<2;++Te)for(pe=0;pe<3;++pe)it[Te][pe]=le.clipBounds[Te][pe];it[0][de]=-1e8,it[1][de]=1e8}return W.showSurface=$e,W.showContour=Ze,W}var ue={model:w,view:w,projection:w,inverseModel:w.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},xe=w.slice(),ge=[1,0,0,0,1,0,0,0,1];function _e(le,Z){le=le||{};var de=this.gl;de.disable(de.CULL_FACE),this._colorMap.bind(0);var pe=ue;pe.model=le.model||w,pe.view=le.view||w,pe.projection=le.projection||w,pe.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],pe.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],pe.objectOffset=this.objectOffset,pe.contourColor=this.contourColor[0],pe.inverseModel=x(pe.inverseModel,pe.model);for(var Te=0;Te<2;++Te)for(var Ne=pe.clipBounds[Te],$e=0;$e<3;++$e)Ne[$e]=Math.min(Math.max(this.clipBounds[Te][$e],-1e8),1e8);pe.kambient=this.ambientLight,pe.kdiffuse=this.diffuseLight,pe.kspecular=this.specularLight,pe.roughness=this.roughness,pe.fresnel=this.fresnel,pe.opacity=this.opacity,pe.height=0,pe.permutation=ge,pe.vertexColor=this.vertexColor;var Ze=xe;for(f(Ze,pe.view,pe.model),f(Ze,pe.projection,Ze),x(Ze,Ze),Te=0;Te<3;++Te)pe.eyePosition[Te]=Ze[12+Te]/Ze[15];var Xe=Ze[15];for(Te=0;Te<3;++Te)Xe+=this.lightPosition[Te]*Ze[4*Te+3];for(Te=0;Te<3;++Te){var it=Ze[12+Te];for($e=0;$e<3;++$e)it+=Ze[4*$e+Te]*this.lightPosition[$e];pe.lightPosition[Te]=it/Xe}var yt=ee(pe,this);if(yt.showSurface){for(this._shader.bind(),this._shader.uniforms=pe,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(de.TRIANGLES,this._vertexCount),Te=0;Te<3;++Te)!this.surfaceProject[Te]||!this.vertexCount||(this._shader.uniforms.model=yt.projections[Te],this._shader.uniforms.clipBounds=yt.clipBounds[Te],this._vao.draw(de.TRIANGLES,this._vertexCount));this._vao.unbind()}if(yt.showContour){var bt=this._contourShader;pe.kambient=1,pe.kdiffuse=0,pe.kspecular=0,pe.opacity=1,bt.bind(),bt.uniforms=pe;var mt=this._contourVAO;for(mt.bind(),Te=0;Te<3;++Te)for(bt.uniforms.permutation=z[Te],de.lineWidth(this.contourWidth[Te]*this.pixelRatio),$e=0;$e>4)/16)/255,Te=Math.floor(pe),Ne=pe-Te,$e=Z[1]*(le.value[1]+(le.value[2]&15)/16)/255,Ze=Math.floor($e),Xe=$e-Ze;Te+=1,Ze+=1;var it=de.position;it[0]=it[1]=it[2]=0;for(var yt=0;yt<2;++yt)for(var bt=yt?Ne:1-Ne,mt=0;mt<2;++mt)for(var ht=mt?Xe:1-Xe,Ve=Te+yt,ze=Ze+mt,Se=bt*ht,Je=0;Je<3;++Je)it[Je]+=this._field[Je].get(Ve,ze)*Se;for(var _t=this._pickResult.level,At=0;At<3;++At)if(_t[At]=A.le(this.contourLevels[At],it[At]),_t[At]<0)this.contourLevels[At].length>0&&(_t[At]=0);else if(_t[At]Math.abs(Kt-it[At])&&(_t[At]+=1)}for(de.index[0]=Ne<.5?Te:Te+1,de.index[1]=Xe<.5?Ze:Ze+1,de.uv[0]=pe/Z[0],de.uv[1]=$e/Z[1],Je=0;Je<3;++Je)de.dataCoordinate[Je]=this._field[Je].get(de.index[0],de.index[1]);return de},j.padField=function(le,Z){var de=Z.shape.slice(),pe=le.shape.slice();d.assign(le.lo(1,1).hi(de[0],de[1]),Z),d.assign(le.lo(1).hi(de[0],1),Z.hi(de[0],1)),d.assign(le.lo(1,pe[1]-1).hi(de[0],1),Z.lo(0,de[1]-1).hi(de[0],1)),d.assign(le.lo(0,1).hi(1,de[1]),Z.hi(1)),d.assign(le.lo(pe[0]-1,1).hi(1,de[1]),Z.lo(de[0]-1)),le.set(0,0,Z.get(0,0)),le.set(0,pe[1]-1,Z.get(0,de[1]-1)),le.set(pe[0]-1,0,Z.get(de[0]-1,0)),le.set(pe[0]-1,pe[1]-1,Z.get(de[0]-1,de[1]-1))};function se(le,Z){return Array.isArray(le)?[Z(le[0]),Z(le[1]),Z(le[2])]:[Z(le),Z(le),Z(le)]}function ce(le){return Array.isArray(le)?le.length===3?[le[0],le[1],le[2],1]:[le[0],le[1],le[2],le[3]]:[0,0,0,1]}function ne(le){if(Array.isArray(le)){if(Array.isArray(le))return[ce(le[0]),ce(le[1]),ce(le[2])];var Z=ce(le);return[Z.slice(),Z.slice(),Z.slice()]}}j.update=function(le){le=le||{},this.objectOffset=le.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in le&&(this.contourWidth=se(le.contourWidth,Number)),"showContour"in le&&(this.showContour=se(le.showContour,Boolean)),"showSurface"in le&&(this.showSurface=!!le.showSurface),"contourTint"in le&&(this.contourTint=se(le.contourTint,Boolean)),"contourColor"in le&&(this.contourColor=ne(le.contourColor)),"contourProject"in le&&(this.contourProject=se(le.contourProject,function(Wa){return se(Wa,Boolean)})),"surfaceProject"in le&&(this.surfaceProject=le.surfaceProject),"dynamicColor"in le&&(this.dynamicColor=ne(le.dynamicColor)),"dynamicTint"in le&&(this.dynamicTint=se(le.dynamicTint,Number)),"dynamicWidth"in le&&(this.dynamicWidth=se(le.dynamicWidth,Number)),"opacity"in le&&(this.opacity=le.opacity),"opacityscale"in le&&(this.opacityscale=le.opacityscale),"colorBounds"in le&&(this.colorBounds=le.colorBounds),"vertexColor"in le&&(this.vertexColor=le.vertexColor?1:0),"colormap"in le&&this._colorMap.setPixels(this.genColormap(le.colormap,this.opacityscale));var Z=le.field||le.coords&&le.coords[2]||null,de=!1;if(Z||(this._field[2].shape[0]||this._field[2].shape[2]?Z=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):Z=this._field[2].hi(0,0)),"field"in le||"coords"in le){var pe=(Z.shape[0]+2)*(Z.shape[1]+2);pe>this._field[2].data.length&&(c.freeFloat(this._field[2].data),this._field[2].data=c.mallocFloat(l.nextPow2(pe))),this._field[2]=g(this._field[2].data,[Z.shape[0]+2,Z.shape[1]+2]),this.padField(this._field[2],Z),this.shape=Z.shape.slice();for(var Te=this.shape,Ne=0;Ne<2;++Ne)this._field[2].size>this._field[Ne].data.length&&(c.freeFloat(this._field[Ne].data),this._field[Ne].data=c.mallocFloat(this._field[2].size)),this._field[Ne]=g(this._field[Ne].data,[Te[0]+2,Te[1]+2]);if(le.coords){var $e=le.coords;if(!Array.isArray($e)||$e.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Ne=0;Ne<2;++Ne){var Ze=$e[Ne];for(mt=0;mt<2;++mt)if(Ze.shape[mt]!==Te[mt])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Ne],Ze)}}else if(le.ticks){var Xe=le.ticks;if(!Array.isArray(Xe)||Xe.length!==2)throw new Error("gl-surface: invalid ticks");for(Ne=0;Ne<2;++Ne){var it=Xe[Ne];if((Array.isArray(it)||it.length)&&(it=g(it)),it.shape[0]!==Te[Ne])throw new Error("gl-surface: invalid tick length");var yt=g(it.data,Te);yt.stride[Ne]=it.stride[0],yt.stride[Ne^1]=0,this.padField(this._field[Ne],yt)}}else{for(Ne=0;Ne<2;++Ne){var bt=[0,0];bt[Ne]=1,this._field[Ne]=g(this._field[Ne].data,[Te[0]+2,Te[1]+2],bt,0)}this._field[0].set(0,0,0);for(var mt=0;mt0){for(var La=0;La<5;++La)kr.pop();Be-=1}continue e}}}ha.push(Be)}this._contourOffsets[Sr]=jn,this._contourCounts[Sr]=ha}var Oa=c.mallocFloat(kr.length);for(Ne=0;Ne=0&&(_=T|0,E+=m*_,h-=_),new A(this.data,h,m,E)},k.step=function(T){var E=this.shape[0],_=this.stride[0],h=this.offset,m=0,w=Math.ceil;return typeof T=="number"&&(m=T|0,m<0?(h+=_*(E-1),E=w(-E/m)):E=w(E/m),_*=m),new A(this.data,E,_,h)},k.transpose=function(T){T=T===void 0?0:T|0;var E=this.shape,_=this.stride;return new A(this.data,E[T],_[T],this.offset)},k.pick=function(T){var E=[],_=[],h=this.offset;typeof T=="number"&&T>=0?h=h+this.stride[0]*T|0:(E.push(this.shape[0]),_.push(this.stride[0]));var m=f[E.length+1];return m(this.data,E,_,h)},function(T,E,_,h){return new A(T,E[0],_[0],h)}},2:function(C,f,x){function A(I,T,E,_,h,m){this.data=I,this.shape=[T,E],this.stride=[_,h],this.offset=m|0}var k=A.prototype;return k.dtype=C,k.dimension=2,Object.defineProperty(k,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(k,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),k.set=function(T,E,_){return C==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*E,_):this.data[this.offset+this.stride[0]*T+this.stride[1]*E]=_},k.get=function(T,E){return C==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*E):this.data[this.offset+this.stride[0]*T+this.stride[1]*E]},k.index=function(T,E){return this.offset+this.stride[0]*T+this.stride[1]*E},k.hi=function(T,E){return new A(this.data,typeof T!="number"||T<0?this.shape[0]:T|0,typeof E!="number"||E<0?this.shape[1]:E|0,this.stride[0],this.stride[1],this.offset)},k.lo=function(T,E){var _=this.offset,h=0,m=this.shape[0],w=this.shape[1],F=this.stride[0],z=this.stride[1];return typeof T=="number"&&T>=0&&(h=T|0,_+=F*h,m-=h),typeof E=="number"&&E>=0&&(h=E|0,_+=z*h,w-=h),new A(this.data,m,w,F,z,_)},k.step=function(T,E){var _=this.shape[0],h=this.shape[1],m=this.stride[0],w=this.stride[1],F=this.offset,z=0,U=Math.ceil;return typeof T=="number"&&(z=T|0,z<0?(F+=m*(_-1),_=U(-_/z)):_=U(_/z),m*=z),typeof E=="number"&&(z=E|0,z<0?(F+=w*(h-1),h=U(-h/z)):h=U(h/z),w*=z),new A(this.data,_,h,m,w,F)},k.transpose=function(T,E){T=T===void 0?0:T|0,E=E===void 0?1:E|0;var _=this.shape,h=this.stride;return new A(this.data,_[T],_[E],h[T],h[E],this.offset)},k.pick=function(T,E){var _=[],h=[],m=this.offset;typeof T=="number"&&T>=0?m=m+this.stride[0]*T|0:(_.push(this.shape[0]),h.push(this.stride[0])),typeof E=="number"&&E>=0?m=m+this.stride[1]*E|0:(_.push(this.shape[1]),h.push(this.stride[1]));var w=f[_.length+1];return w(this.data,_,h,m)},function(T,E,_,h){return new A(T,E[0],E[1],_[0],_[1],h)}},3:function(C,f,x){function A(I,T,E,_,h,m,w,F){this.data=I,this.shape=[T,E,_],this.stride=[h,m,w],this.offset=F|0}var k=A.prototype;return k.dtype=C,k.dimension=3,Object.defineProperty(k,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(k,"order",{get:function(){var T=Math.abs(this.stride[0]),E=Math.abs(this.stride[1]),_=Math.abs(this.stride[2]);return T>E?E>_?[2,1,0]:T>_?[1,2,0]:[1,0,2]:T>_?[2,0,1]:_>E?[0,1,2]:[0,2,1]}}),k.set=function(T,E,_,h){return C==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*E+this.stride[2]*_,h):this.data[this.offset+this.stride[0]*T+this.stride[1]*E+this.stride[2]*_]=h},k.get=function(T,E,_){return C==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*E+this.stride[2]*_):this.data[this.offset+this.stride[0]*T+this.stride[1]*E+this.stride[2]*_]},k.index=function(T,E,_){return this.offset+this.stride[0]*T+this.stride[1]*E+this.stride[2]*_},k.hi=function(T,E,_){return new A(this.data,typeof T!="number"||T<0?this.shape[0]:T|0,typeof E!="number"||E<0?this.shape[1]:E|0,typeof _!="number"||_<0?this.shape[2]:_|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},k.lo=function(T,E,_){var h=this.offset,m=0,w=this.shape[0],F=this.shape[1],z=this.shape[2],U=this.stride[0],V=this.stride[1],G=this.stride[2];return typeof T=="number"&&T>=0&&(m=T|0,h+=U*m,w-=m),typeof E=="number"&&E>=0&&(m=E|0,h+=V*m,F-=m),typeof _=="number"&&_>=0&&(m=_|0,h+=G*m,z-=m),new A(this.data,w,F,z,U,V,G,h)},k.step=function(T,E,_){var h=this.shape[0],m=this.shape[1],w=this.shape[2],F=this.stride[0],z=this.stride[1],U=this.stride[2],V=this.offset,G=0,j=Math.ceil;return typeof T=="number"&&(G=T|0,G<0?(V+=F*(h-1),h=j(-h/G)):h=j(h/G),F*=G),typeof E=="number"&&(G=E|0,G<0?(V+=z*(m-1),m=j(-m/G)):m=j(m/G),z*=G),typeof _=="number"&&(G=_|0,G<0?(V+=U*(w-1),w=j(-w/G)):w=j(w/G),U*=G),new A(this.data,h,m,w,F,z,U,V)},k.transpose=function(T,E,_){T=T===void 0?0:T|0,E=E===void 0?1:E|0,_=_===void 0?2:_|0;var h=this.shape,m=this.stride;return new A(this.data,h[T],h[E],h[_],m[T],m[E],m[_],this.offset)},k.pick=function(T,E,_){var h=[],m=[],w=this.offset;typeof T=="number"&&T>=0?w=w+this.stride[0]*T|0:(h.push(this.shape[0]),m.push(this.stride[0])),typeof E=="number"&&E>=0?w=w+this.stride[1]*E|0:(h.push(this.shape[1]),m.push(this.stride[1])),typeof _=="number"&&_>=0?w=w+this.stride[2]*_|0:(h.push(this.shape[2]),m.push(this.stride[2]));var F=f[h.length+1];return F(this.data,h,m,w)},function(T,E,_,h){return new A(T,E[0],E[1],E[2],_[0],_[1],_[2],h)}},4:function(C,f,x){function A(I,T,E,_,h,m,w,F,z,U){this.data=I,this.shape=[T,E,_,h],this.stride=[m,w,F,z],this.offset=U|0}var k=A.prototype;return k.dtype=C,k.dimension=4,Object.defineProperty(k,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(k,"order",{get:x}),k.set=function(T,E,_,h,m){return C==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*E+this.stride[2]*_+this.stride[3]*h,m):this.data[this.offset+this.stride[0]*T+this.stride[1]*E+this.stride[2]*_+this.stride[3]*h]=m},k.get=function(T,E,_,h){return C==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*E+this.stride[2]*_+this.stride[3]*h):this.data[this.offset+this.stride[0]*T+this.stride[1]*E+this.stride[2]*_+this.stride[3]*h]},k.index=function(T,E,_,h){return this.offset+this.stride[0]*T+this.stride[1]*E+this.stride[2]*_+this.stride[3]*h},k.hi=function(T,E,_,h){return new A(this.data,typeof T!="number"||T<0?this.shape[0]:T|0,typeof E!="number"||E<0?this.shape[1]:E|0,typeof _!="number"||_<0?this.shape[2]:_|0,typeof h!="number"||h<0?this.shape[3]:h|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},k.lo=function(T,E,_,h){var m=this.offset,w=0,F=this.shape[0],z=this.shape[1],U=this.shape[2],V=this.shape[3],G=this.stride[0],j=this.stride[1],O=this.stride[2],H=this.stride[3];return typeof T=="number"&&T>=0&&(w=T|0,m+=G*w,F-=w),typeof E=="number"&&E>=0&&(w=E|0,m+=j*w,z-=w),typeof _=="number"&&_>=0&&(w=_|0,m+=O*w,U-=w),typeof h=="number"&&h>=0&&(w=h|0,m+=H*w,V-=w),new A(this.data,F,z,U,V,G,j,O,H,m)},k.step=function(T,E,_,h){var m=this.shape[0],w=this.shape[1],F=this.shape[2],z=this.shape[3],U=this.stride[0],V=this.stride[1],G=this.stride[2],j=this.stride[3],O=this.offset,H=0,W=Math.ceil;return typeof T=="number"&&(H=T|0,H<0?(O+=U*(m-1),m=W(-m/H)):m=W(m/H),U*=H),typeof E=="number"&&(H=E|0,H<0?(O+=V*(w-1),w=W(-w/H)):w=W(w/H),V*=H),typeof _=="number"&&(H=_|0,H<0?(O+=G*(F-1),F=W(-F/H)):F=W(F/H),G*=H),typeof h=="number"&&(H=h|0,H<0?(O+=j*(z-1),z=W(-z/H)):z=W(z/H),j*=H),new A(this.data,m,w,F,z,U,V,G,j,O)},k.transpose=function(T,E,_,h){T=T===void 0?0:T|0,E=E===void 0?1:E|0,_=_===void 0?2:_|0,h=h===void 0?3:h|0;var m=this.shape,w=this.stride;return new A(this.data,m[T],m[E],m[_],m[h],w[T],w[E],w[_],w[h],this.offset)},k.pick=function(T,E,_,h){var m=[],w=[],F=this.offset;typeof T=="number"&&T>=0?F=F+this.stride[0]*T|0:(m.push(this.shape[0]),w.push(this.stride[0])),typeof E=="number"&&E>=0?F=F+this.stride[1]*E|0:(m.push(this.shape[1]),w.push(this.stride[1])),typeof _=="number"&&_>=0?F=F+this.stride[2]*_|0:(m.push(this.shape[2]),w.push(this.stride[2])),typeof h=="number"&&h>=0?F=F+this.stride[3]*h|0:(m.push(this.shape[3]),w.push(this.stride[3]));var z=f[m.length+1];return z(this.data,m,w,F)},function(T,E,_,h){return new A(T,E[0],E[1],E[2],E[3],_[0],_[1],_[2],_[3],h)}},5:function(f,x,A){function k(T,E,_,h,m,w,F,z,U,V,G,j){this.data=T,this.shape=[E,_,h,m,w],this.stride=[F,z,U,V,G],this.offset=j|0}var I=k.prototype;return I.dtype=f,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:A}),I.set=function(E,_,h,m,w,F){return f==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*_+this.stride[2]*h+this.stride[3]*m+this.stride[4]*w,F):this.data[this.offset+this.stride[0]*E+this.stride[1]*_+this.stride[2]*h+this.stride[3]*m+this.stride[4]*w]=F},I.get=function(E,_,h,m,w){return f==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*_+this.stride[2]*h+this.stride[3]*m+this.stride[4]*w):this.data[this.offset+this.stride[0]*E+this.stride[1]*_+this.stride[2]*h+this.stride[3]*m+this.stride[4]*w]},I.index=function(E,_,h,m,w){return this.offset+this.stride[0]*E+this.stride[1]*_+this.stride[2]*h+this.stride[3]*m+this.stride[4]*w},I.hi=function(E,_,h,m,w){return new k(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof _!="number"||_<0?this.shape[1]:_|0,typeof h!="number"||h<0?this.shape[2]:h|0,typeof m!="number"||m<0?this.shape[3]:m|0,typeof w!="number"||w<0?this.shape[4]:w|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},I.lo=function(E,_,h,m,w){var F=this.offset,z=0,U=this.shape[0],V=this.shape[1],G=this.shape[2],j=this.shape[3],O=this.shape[4],H=this.stride[0],W=this.stride[1],ee=this.stride[2],ue=this.stride[3],xe=this.stride[4];return typeof E=="number"&&E>=0&&(z=E|0,F+=H*z,U-=z),typeof _=="number"&&_>=0&&(z=_|0,F+=W*z,V-=z),typeof h=="number"&&h>=0&&(z=h|0,F+=ee*z,G-=z),typeof m=="number"&&m>=0&&(z=m|0,F+=ue*z,j-=z),typeof w=="number"&&w>=0&&(z=w|0,F+=xe*z,O-=z),new k(this.data,U,V,G,j,O,H,W,ee,ue,xe,F)},I.step=function(E,_,h,m,w){var F=this.shape[0],z=this.shape[1],U=this.shape[2],V=this.shape[3],G=this.shape[4],j=this.stride[0],O=this.stride[1],H=this.stride[2],W=this.stride[3],ee=this.stride[4],ue=this.offset,xe=0,ge=Math.ceil;return typeof E=="number"&&(xe=E|0,xe<0?(ue+=j*(F-1),F=ge(-F/xe)):F=ge(F/xe),j*=xe),typeof _=="number"&&(xe=_|0,xe<0?(ue+=O*(z-1),z=ge(-z/xe)):z=ge(z/xe),O*=xe),typeof h=="number"&&(xe=h|0,xe<0?(ue+=H*(U-1),U=ge(-U/xe)):U=ge(U/xe),H*=xe),typeof m=="number"&&(xe=m|0,xe<0?(ue+=W*(V-1),V=ge(-V/xe)):V=ge(V/xe),W*=xe),typeof w=="number"&&(xe=w|0,xe<0?(ue+=ee*(G-1),G=ge(-G/xe)):G=ge(G/xe),ee*=xe),new k(this.data,F,z,U,V,G,j,O,H,W,ee,ue)},I.transpose=function(E,_,h,m,w){E=E===void 0?0:E|0,_=_===void 0?1:_|0,h=h===void 0?2:h|0,m=m===void 0?3:m|0,w=w===void 0?4:w|0;var F=this.shape,z=this.stride;return new k(this.data,F[E],F[_],F[h],F[m],F[w],z[E],z[_],z[h],z[m],z[w],this.offset)},I.pick=function(E,_,h,m,w){var F=[],z=[],U=this.offset;typeof E=="number"&&E>=0?U=U+this.stride[0]*E|0:(F.push(this.shape[0]),z.push(this.stride[0])),typeof _=="number"&&_>=0?U=U+this.stride[1]*_|0:(F.push(this.shape[1]),z.push(this.stride[1])),typeof h=="number"&&h>=0?U=U+this.stride[2]*h|0:(F.push(this.shape[2]),z.push(this.stride[2])),typeof m=="number"&&m>=0?U=U+this.stride[3]*m|0:(F.push(this.shape[3]),z.push(this.stride[3])),typeof w=="number"&&w>=0?U=U+this.stride[4]*w|0:(F.push(this.shape[4]),z.push(this.stride[4]));var V=x[F.length+1];return V(this.data,F,z,U)},function(E,_,h,m){return new k(E,_[0],_[1],_[2],_[3],_[4],h[0],h[1],h[2],h[3],h[4],m)}}};function p(C,f){var x=f===-1?"T":String(f),A=c[x];return f===-1?A(C):f===0?A(C,y[C][0]):A(C,y[C],o)}function d(C){if(l(C))return"buffer";if(i)switch(Object.prototype.toString.call(C)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(C)?"array":"generic"}var y={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function g(C,f,x,A){if(C===void 0){var h=y.array[0];return h([])}else typeof C=="number"&&(C=[C]);f===void 0&&(f=[C.length]);var k=f.length;if(x===void 0){x=new Array(k);for(var I=k-1,T=1;I>=0;--I)x[I]=T,T*=f[I]}if(A===void 0){A=0;for(var I=0;I1e-6?(x[0]=k/_,x[1]=I/_,x[2]=T/_,x[3]=E/_):(x[0]=x[1]=x[2]=0,x[3]=1)}function g(x,A,k){this.radius=l([k]),this.center=l(A),this.rotation=l(x),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 C=g.prototype;C.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},C.recalcMatrix=function(x){this.radius.curve(x),this.center.curve(x),this.rotation.curve(x);var A=this.computedRotation;y(A,A);var k=this.computedMatrix;s(k,A);var I=this.computedCenter,T=this.computedEye,E=this.computedUp,_=Math.exp(this.computedRadius[0]);T[0]=I[0]+_*k[2],T[1]=I[1]+_*k[6],T[2]=I[2]+_*k[10],E[0]=k[1],E[1]=k[5],E[2]=k[9];for(var h=0;h<3;++h){for(var m=0,w=0;w<3;++w)m+=k[h+4*w]*T[w];k[12+h]=-m}},C.getMatrix=function(x,A){this.recalcMatrix(x);var k=this.computedMatrix;if(A){for(var I=0;I<16;++I)A[I]=k[I];return A}return k},C.idle=function(x){this.center.idle(x),this.radius.idle(x),this.rotation.idle(x)},C.flush=function(x){this.center.flush(x),this.radius.flush(x),this.rotation.flush(x)},C.pan=function(x,A,k,I){A=A||0,k=k||0,I=I||0,this.recalcMatrix(x);var T=this.computedMatrix,E=T[1],_=T[5],h=T[9],m=p(E,_,h);E/=m,_/=m,h/=m;var w=T[0],F=T[4],z=T[8],U=w*E+F*_+z*h;w-=E*U,F-=_*U,z-=h*U;var V=p(w,F,z);w/=V,F/=V,z/=V,T[2],T[6],T[10];var G=w*A+E*k,j=F*A+_*k,O=z*A+h*k;this.center.move(x,G,j,O);var H=Math.exp(this.computedRadius[0]);H=Math.max(1e-4,H+I),this.radius.set(x,Math.log(H))},C.rotate=function(x,A,k,I){this.recalcMatrix(x),A=A||0,k=k||0;var T=this.computedMatrix,E=T[0],_=T[4],h=T[8],m=T[1],w=T[5],F=T[9],z=T[2],U=T[6],V=T[10],G=A*E+k*m,j=A*_+k*w,O=A*h+k*F,H=-(U*O-V*j),W=-(V*G-z*O),ee=-(z*j-U*G),ue=Math.sqrt(Math.max(0,1-Math.pow(H,2)-Math.pow(W,2)-Math.pow(ee,2))),xe=d(H,W,ee,ue);xe>1e-6?(H/=xe,W/=xe,ee/=xe,ue/=xe):(H=W=ee=0,ue=1);var ge=this.computedRotation,_e=ge[0],Y=ge[1],se=ge[2],ce=ge[3],ne=_e*ue+ce*H+Y*ee-se*W,ye=Y*ue+ce*W+se*H-_e*ee,le=se*ue+ce*ee+_e*W-Y*H,Z=ce*ue-_e*H-Y*W-se*ee;if(I){H=z,W=U,ee=V;var de=Math.sin(I)/p(H,W,ee);H*=de,W*=de,ee*=de,ue=Math.cos(A),ne=ne*ue+Z*H+ye*ee-le*W,ye=ye*ue+Z*W+le*H-ne*ee,le=le*ue+Z*ee+ne*W-ye*H,Z=Z*ue-ne*H-ye*W-le*ee}var pe=d(ne,ye,le,Z);pe>1e-6?(ne/=pe,ye/=pe,le/=pe,Z/=pe):(ne=ye=le=0,Z=1),this.rotation.set(x,ne,ye,le,Z)},C.lookAt=function(x,A,k,I){this.recalcMatrix(x),k=k||this.computedCenter,A=A||this.computedEye,I=I||this.computedUp;var T=this.computedMatrix;i(T,A,k,I);var E=this.computedRotation;c(E,T[0],T[1],T[2],T[4],T[5],T[6],T[8],T[9],T[10]),y(E,E),this.rotation.set(x,E[0],E[1],E[2],E[3]);for(var _=0,h=0;h<3;++h)_+=Math.pow(k[h]-A[h],2);this.radius.set(x,.5*Math.log(Math.max(_,1e-6))),this.center.set(x,k[0],k[1],k[2])},C.translate=function(x,A,k,I){this.center.move(x,A||0,k||0,I||0)},C.setMatrix=function(x,A){var k=this.computedRotation;c(k,A[0],A[1],A[2],A[4],A[5],A[6],A[8],A[9],A[10]),y(k,k),this.rotation.set(x,k[0],k[1],k[2],k[3]);var I=this.computedMatrix;o(I,A);var T=I[15];if(Math.abs(T)>1e-6){var E=I[12]/T,_=I[13]/T,h=I[14]/T;this.recalcMatrix(x);var m=Math.exp(this.computedRadius[0]);this.center.set(x,E-I[2]*m,_-I[6]*m,h-I[10]*m),this.radius.idle(x)}else this.center.idle(x),this.radius.idle(x)},C.setDistance=function(x,A){A>0&&this.radius.set(x,Math.log(A))},C.setDistanceLimits=function(x,A){x>0?x=Math.log(x):x=-1/0,A>0?A=Math.log(A):A=1/0,A=Math.max(A,x),this.radius.bounds[0][0]=x,this.radius.bounds[1][0]=A},C.getDistanceLimits=function(x){var A=this.radius.bounds;return x?(x[0]=Math.exp(A[0][0]),x[1]=Math.exp(A[1][0]),x):[Math.exp(A[0][0]),Math.exp(A[1][0])]},C.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]}},C.fromJSON=function(x){var A=this.lastT(),k=x.center;k&&this.center.set(A,k[0],k[1],k[2]);var I=x.rotation;I&&this.rotation.set(A,I[0],I[1],I[2],I[3]);var T=x.distance;T&&T>0&&this.radius.set(A,Math.log(T)),this.setDistanceLimits(x.zoomMin,x.zoomMax)};function f(x){x=x||{};var A=x.center||[0,0,0],k=x.rotation||[0,0,0,1],I=x.radius||1;A=[].slice.call(A,0,3),k=[].slice.call(k,0,4),y(k,k);var T=new g(k,A,Math.log(I));return T.setDistanceLimits(x.zoomMin,x.zoomMax),("eye"in x||"up"in x)&&T.lookAt(0,x.eye,x.center,x.up),T}}),9994:(function(t,r,a){var l=a(9618),i=a(8277);t.exports=function(o,c){for(var p=[],d=o,y=1;Array.isArray(d);)p.push(d.length),y*=d.length,d=d[0];return p.length===0?l():(c||(c=l(new Float64Array(y),p)),i(c,o),c)}})},S={};function M(t){var r=S[t];if(r!==void 0)return r.exports;var a=S[t]={id:t,loaded:!1,exports:{}};return v[t].call(a.exports,a,a.exports,M),a.loaded=!0,a.exports}(function(){M.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})()})(),(function(){M.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t}})();var L=M(1964);K.exports=L})()}}),ZO=Re({"node_modules/color-name/index.js"(ae,K){K.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]}}}),_W=Re({"node_modules/color-normalize/node_modules/color-parse/index.js"(ae,K){var v=ZO();K.exports=M;var S={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function M(L){var t,r=[],a=1,l;if(typeof L=="string")if(L=L.toLowerCase(),v[L])r=v[L].slice(),l="rgb";else if(L==="transparent")a=0,l="rgb",r=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(L)){var i=L.slice(1),s=i.length,o=s<=4;a=1,o?(r=[parseInt(i[0]+i[0],16),parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16)],s===4&&(a=parseInt(i[3]+i[3],16)/255)):(r=[parseInt(i[0]+i[1],16),parseInt(i[2]+i[3],16),parseInt(i[4]+i[5],16)],s===8&&(a=parseInt(i[6]+i[7],16)/255)),r[0]||(r[0]=0),r[1]||(r[1]=0),r[2]||(r[2]=0),l="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(L)){var c=t[1],p=c==="rgb",i=c.replace(/a$/,"");l=i;var s=i==="cmyk"?4:i==="gray"?1:3;r=t[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(g,C){if(/%$/.test(g))return C===s?parseFloat(g)/100:i==="rgb"?parseFloat(g)*255/100:parseFloat(g);if(i[C]==="h"){if(/deg$/.test(g))return parseFloat(g);if(S[g]!==void 0)return S[g]}return parseFloat(g)}),c===i&&r.push(1),a=p||r[s]===void 0?1:r[s],r=r.slice(0,s)}else L.length>10&&/[0-9](?:\s|\/)/.test(L)&&(r=L.match(/([0-9]+)/g).map(function(d){return parseFloat(d)}),l=L.match(/([a-z])/ig).join("").toLowerCase());else isNaN(L)?Array.isArray(L)||L.length?(r=[L[0],L[1],L[2]],l="rgb",a=L.length===4?L[3]:1):L instanceof Object&&(L.r!=null||L.red!=null||L.R!=null?(l="rgb",r=[L.r||L.red||L.R||0,L.g||L.green||L.G||0,L.b||L.blue||L.B||0]):(l="hsl",r=[L.h||L.hue||L.H||0,L.s||L.saturation||L.S||0,L.l||L.lightness||L.L||L.b||L.brightness]),a=L.a||L.alpha||L.opacity||1,L.opacity!=null&&(a/=100)):(l="rgb",r=[L>>>16,(L&65280)>>>8,L&255]);return{space:l,values:r,alpha:a}}}}),xW=Re({"node_modules/color-normalize/node_modules/color-rgba/index.js"(ae,K){var v=_W();K.exports=function(L){Array.isArray(L)&&L.raw&&(L=String.raw.apply(null,arguments));var t,r=v(L);if(!r.space)return[];var a=[0,0,0],l=r.space[0]==="h"?[360,100,100]:[255,255,255];return t=Array(3),t[0]=Math.min(Math.max(r.values[0],a[0]),l[0]),t[1]=Math.min(Math.max(r.values[1],a[1]),l[1]),t[2]=Math.min(Math.max(r.values[2],a[2]),l[2]),r.space[0]==="h"&&(t=S(t)),t.push(Math.min(Math.max(r.alpha,0),1)),t};function S(M){var L=M[0]/360,t=M[1]/100,r=M[2]/100,a,l,i,s,o,c=0;if(t===0)return o=r*255,[o,o,o];for(l=r<.5?r*(1+t):r+t-r*t,a=2*r-l,s=[0,0,0];c<3;)i=L+1/3*-(c-1),i<0?i++:i>1&&i--,o=6*i<1?a+(l-a)*6*i:2*i<1?l:3*i<2?a+(l-a)*(2/3-i)*6:a,s[c++]=o*255;return s}}}),$I=Re({"node_modules/clamp/index.js"(ae,K){K.exports=v;function v(S,M,L){return ML?L:S:SM?M:S}}}),bP=Re({"node_modules/dtype/index.js"(ae,K){K.exports=function(v){switch(v){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),Uw=Re({"node_modules/color-normalize/index.js"(ae,K){var v=xW(),S=$I(),M=bP();K.exports=function(r,a){(a==="float"||!a)&&(a="array"),a==="uint"&&(a="uint8"),a==="uint_clamped"&&(a="uint8_clamped");var l=M(a),i=new l(4),s=a!=="uint8"&&a!=="uint8_clamped";return(!r.length||typeof r=="string")&&(r=v(r),r[0]/=255,r[1]/=255,r[2]/=255),L(r)?(i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3]!=null?r[3]:255,s&&(i[0]/=255,i[1]/=255,i[2]/=255,i[3]/=255),i):(s?(i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3]!=null?r[3]:1):(i[0]=S(Math.floor(r[0]*255),0,255),i[1]=S(Math.floor(r[1]*255),0,255),i[2]=S(Math.floor(r[2]*255),0,255),i[3]=r[3]==null?255:S(Math.floor(r[3]*255),0,255)),i)};function L(t){return!!(t instanceof Uint8Array||t instanceof Uint8ClampedArray||Array.isArray(t)&&(t[0]>1||t[0]===0)&&(t[1]>1||t[1]===0)&&(t[2]>1||t[2]===0)&&(!t[3]||t[3]>1))}}}),Ex=Re({"src/lib/str2rgbarray.js"(ae,K){var v=Uw();function S(M){return M?v(M):[0,0,0,1]}K.exports=S}}),Cx=Re({"src/lib/gl_format_color.js"(ae,K){var v=da(),S=oo(),M=Uw(),L=nf(),t=du().defaultLine,r=ai().isArrayOrTypedArray,a=M(t),l=1;function i(d,y){var g=d;return g[3]*=y,g}function s(d){if(v(d))return a;var y=M(d);return y.length?y:a}function o(d){return v(d)?d:l}function c(d,y,g){var C=d.color;C&&C._inputArray&&(C=C._inputArray);var f=r(C),x=r(y),A=L.extractOpts(d),k=[],I,T,E,_,h;if(A.colorscale!==void 0?I=L.makeColorScaleFuncFromTrace(d):I=s,f?T=function(w,F){return w[F]===void 0?a:M(I(w[F]))}:T=s,x?E=function(w,F){return w[F]===void 0?l:o(w[F])}:E=o,f||x)for(var m=0;m0){var g=l.c2l(d);l._lowerLogErrorBound||(l._lowerLogErrorBound=g),l._lowerErrorBound=Math.min(l._lowerLogErrorBound,g)}}else s[o]=[-c[0]*a,c[1]*a]}return s}function M(t){for(var r=0;r-1?-1:F.indexOf("right")>-1?1:0}function A(F){return F==null?0:F.indexOf("top")>-1?-1:F.indexOf("bottom")>-1?1:0}function k(F){var z=0,U=0,V=[z,U];if(Array.isArray(F))for(var G=0;G=0){var ee=C(H.position,H.delaunayColor,H.delaunayAxis);ee.opacity=F.opacity,this.delaunayMesh?this.delaunayMesh.update(ee):(ee.gl=z,this.delaunayMesh=L(ee),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},g.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function w(F,z){var U=new y(F,z.uid);return U.update(z),U}K.exports=w}}),JO=Re({"src/traces/scatter3d/attributes.js"(ae,K){var v=wf(),S=Do(),M=ac(),L=$c().axisHoverFormat,{hovertemplateAttrs:t,texttemplateAttrs:r,templatefallbackAttrs:a}=Wl(),l=As(),i=KO(),s=wP(),o=Li().extendFlat,c=bf().overrideAll,p=hg(),d=v.line,y=v.marker,g=y.line,C=o({width:d.width,dash:{valType:"enumerated",values:p(i),dflt:"solid"}},M("line"));function f(A){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var x=K.exports=c({x:v.x,y:v.y,z:{valType:"data_array"},text:o({},v.text,{}),texttemplate:r(),texttemplatefallback:a({editType:"calc"}),hovertext:o({},v.hovertext,{}),hovertemplate:t(),hovertemplatefallback:a(),xhoverformat:L("x"),yhoverformat:L("y"),zhoverformat:L("z"),mode:o({},v.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:f(),y:f(),z:f()},connectgaps:v.connectgaps,line:C,marker:o({symbol:{valType:"enumerated",values:p(s),dflt:"circle",arrayOk:!0},size:o({},y.size,{dflt:8}),sizeref:y.sizeref,sizemin:y.sizemin,sizemode:y.sizemode,opacity:o({},y.opacity,{arrayOk:!1}),colorbar:y.colorbar,line:o({width:o({},g.width,{arrayOk:!1})},M("marker.line"))},M("marker")),textposition:o({},v.textposition,{dflt:"top center"}),textfont:S({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:l.opacity,hoverinfo:o({},l.hoverinfo)},"calc","nested");x.x.editType=x.y.editType=x.z.editType="calc+clearAxisTypes"}}),TW=Re({"src/traces/scatter3d/defaults.js"(ae,K){var v=es(),S=Rn(),M=Mu(),L=Yp(),t=xg(),r=Sm(),a=JO();K.exports=function(s,o,c,p){function d(I,T){return S.coerce(s,o,a,I,T)}var y=l(s,o,d,p);if(!y){o.visible=!1;return}d("text"),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback"),d("xhoverformat"),d("yhoverformat"),d("zhoverformat"),d("mode"),M.hasMarkers(o)&&L(s,o,c,p,d,{noSelect:!0,noAngle:!0}),M.hasLines(o)&&(d("connectgaps"),t(s,o,c,p,d)),M.hasText(o)&&(d("texttemplate"),d("texttemplatefallback"),r(s,o,p,d,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var g=(o.line||{}).color,C=(o.marker||{}).color;d("surfaceaxis")>=0&&d("surfacecolor",g||C);for(var f=["x","y","z"],x=0;x<3;++x){var A="projection."+f[x];d(A+".show")&&(d(A+".opacity"),d(A+".scale"))}var k=v.getComponentMethod("errorbars","supplyDefaults");k(s,o,g||C||c,{axis:"z"}),k(s,o,g||C||c,{axis:"y",inherit:"z"}),k(s,o,g||C||c,{axis:"x",inherit:"z"})};function l(i,s,o,c){var p=0,d=o("x"),y=o("y"),g=o("z"),C=v.getComponentMethod("calendars","handleTraceDefaults");return C(i,s,["x","y","z"],c),d&&y&&g&&(p=Math.min(d.length,y.length,g.length),s._length=s._xlength=s._ylength=s._zlength=p),p}}}),AW=Re({"src/traces/scatter3d/calc.js"(ae,K){var v=Yg(),S=Em();K.exports=function(L,t){var r=[{x:!1,y:!1,trace:t,t:{}}];return v(r,t),S(L,t),r}}}),SW=Re({"node_modules/get-canvas-context/index.js"(ae,K){K.exports=v;function v(S,M){if(typeof S!="string")throw new TypeError("must specify type string");if(M=M||{},typeof document>"u"&&!M.canvas)return null;var L=M.canvas||document.createElement("canvas");typeof M.width=="number"&&(L.width=M.width),typeof M.height=="number"&&(L.height=M.height);var t=M,r;try{var a=[S];S.indexOf("webgl")===0&&a.push("experimental-"+S);for(var l=0;l/g," "));s[o]=y,c.tickmode=p}}a.ticks=s;for(var o=0;o<3;++o){.5*(r.glplot.bounds[0][o]+r.glplot.bounds[1][o]);for(var g=0;g<2;++g)a.bounds[g][o]=r.glplot.bounds[g][o]}r.contourLevels=L(s)}}}),IW=Re({"src/plots/gl3d/scene.js"(ae,K){var v=vv().gl_plot3d,S=v.createCamera,M=v.createScene,L=EW(),t=cS(),r=es(),a=Rn(),l=a.preserveDrawingBuffer(),i=js(),s=Sh(),o=Ex(),c=QO(),p=L1(),d=CW(),y=kW(),g=MW(),C=vg().applyAutorangeOptions,f,x,A=!1;function k(U,V){var G=document.createElement("div"),j=U.container;this.graphDiv=U.graphDiv;var O=document.createElementNS("http://www.w3.org/2000/svg","svg");O.style.position="absolute",O.style.top=O.style.left="0px",O.style.width=O.style.height="100%",O.style["z-index"]=20,O.style["pointer-events"]="none",G.appendChild(O),this.svgContainer=O,G.id=U.id,G.style.position="absolute",G.style.top=G.style.left="0px",G.style.width=G.style.height="100%",j.appendChild(G),this.fullLayout=V,this.id=U.id||"scene",this.fullSceneLayout=V[this.id],this.plotArgs=[[],{},{}],this.axesOptions=d(V,V[this.id]),this.spikeOptions=y(V[this.id]),this.container=G,this.staticMode=!!U.staticPlot,this.pixelRatio=this.pixelRatio||U.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=r.getComponentMethod("annotations3d","convert"),this.drawAnnotations=r.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var I=k.prototype;I.prepareOptions=function(){var U=this,V={canvas:U.canvas,gl:U.gl,glOptions:{preserveDrawingBuffer:l,premultipliedAlpha:!0,antialias:!0},container:U.container,axes:U.axesOptions,spikes:U.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:U.camera,pixelRatio:U.pixelRatio};if(U.staticMode){if(!x&&(f=document.createElement("canvas"),x=L({canvas:f,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!x))throw new Error("error creating static canvas/context for image server");V.gl=x,V.canvas=f}return V};var T=!0;I.tryCreatePlot=function(){var U=this,V=U.prepareOptions(),G=!0;try{U.glplot=M(V)}catch{if(U.staticMode||!T||l)G=!1;else{a.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{l=V.glOptions.preserveDrawingBuffer=!0,U.glplot=M(V)}catch{l=V.glOptions.preserveDrawingBuffer=!1,G=!1}}}return T=!1,G},I.initializeGLCamera=function(){var U=this,V=U.fullSceneLayout.camera,G=V.projection.type==="orthographic";U.camera=S(U.container,{center:[V.center.x,V.center.y,V.center.z],eye:[V.eye.x,V.eye.y,V.eye.z],up:[V.up.x,V.up.y,V.up.z],_ortho:G,zoomMin:.01,zoomMax:100,mode:"orbit"})},I.initializeGLPlot=function(){var U=this;U.initializeGLCamera();var V=U.tryCreatePlot();if(!V)return c(U);U.traces={},U.make4thDimension();var G=U.graphDiv,j=G.layout,O=function(){var W={};return U.isCameraChanged(j)&&(W[U.id+".camera"]=U.getCamera()),U.isAspectChanged(j)&&(W[U.id+".aspectratio"]=U.glplot.getAspectratio(),j[U.id].aspectmode!=="manual"&&(U.fullSceneLayout.aspectmode=j[U.id].aspectmode=W[U.id+".aspectmode"]="manual")),W},H=function(W){if(W.fullSceneLayout.dragmode!==!1){var ee=O();W.saveLayout(j),W.graphDiv.emit("plotly_relayout",ee)}};return U.glplot.canvas&&(U.glplot.canvas.addEventListener("mouseup",function(){H(U)}),U.glplot.canvas.addEventListener("touchstart",function(){A=!0}),U.glplot.canvas.addEventListener("wheel",function(W){if(G._context._scrollZoom.gl3d){if(U.camera._ortho){var ee=W.deltaX>W.deltaY?1.1:.9090909090909091,ue=U.glplot.getAspectratio();U.glplot.setAspectratio({x:ee*ue.x,y:ee*ue.y,z:ee*ue.z})}H(U)}},t?{passive:!1}:!1),U.glplot.canvas.addEventListener("mousemove",function(){if(U.fullSceneLayout.dragmode!==!1&&U.camera.mouseListener.buttons!==0){var W=O();U.graphDiv.emit("plotly_relayouting",W)}}),U.staticMode||U.glplot.canvas.addEventListener("webglcontextlost",function(W){G&&G.emit&&G.emit("plotly_webglcontextlost",{event:W,layer:U.id})},!1)),U.glplot.oncontextloss=function(){U.recoverContext()},U.glplot.onrender=function(){U.render()},!0},I.render=function(){var U=this,V=U.graphDiv,G,j=U.svgContainer,O=U.container.getBoundingClientRect();V._fullLayout._calcInverseTransform(V);var H=V._fullLayout._invScaleX,W=V._fullLayout._invScaleY,ee=O.width*H,ue=O.height*W;j.setAttributeNS(null,"viewBox","0 0 "+ee+" "+ue),j.setAttributeNS(null,"width",ee),j.setAttributeNS(null,"height",ue),g(U),U.glplot.axes.update(U.axesOptions);for(var xe=Object.keys(U.traces),ge=null,_e=U.glplot.selection,Y=0;Y")):G.type==="isosurface"||G.type==="volume"?(le.valueLabel=i.hoverLabelText(U._mockAxis,U._mockAxis.d2l(_e.traceCoordinate[3]),G.valuehoverformat),Ne.push("value: "+le.valueLabel),_e.textLabel&&Ne.push(_e.textLabel),Te=Ne.join("
")):Te=_e.textLabel;var $e={x:_e.traceCoordinate[0],y:_e.traceCoordinate[1],z:_e.traceCoordinate[2],data:ne._input,fullData:ne,curveNumber:ne.index,pointNumber:ye};s.appendArrayPointValue($e,ne,ye),G._module.eventData&&($e=ne._module.eventData($e,_e,ne,{},ye));var Ze={points:[$e]};if(U.fullSceneLayout.hovermode){var Xe=[];s.loneHover({trace:ne,x:(.5+.5*ce[0]/ce[3])*ee,y:(.5-.5*ce[1]/ce[3])*ue,xLabel:le.xLabel,yLabel:le.yLabel,zLabel:le.zLabel,text:Te,name:ge.name,color:s.castHoverOption(ne,ye,"bgcolor")||ge.color,borderColor:s.castHoverOption(ne,ye,"bordercolor"),fontFamily:s.castHoverOption(ne,ye,"font.family"),fontSize:s.castHoverOption(ne,ye,"font.size"),fontColor:s.castHoverOption(ne,ye,"font.color"),nameLength:s.castHoverOption(ne,ye,"namelength"),textAlign:s.castHoverOption(ne,ye,"align"),hovertemplate:a.castOption(ne,ye,"hovertemplate"),hovertemplateLabels:a.extendFlat({},$e,le),eventData:[$e]},{container:j,gd:V,inOut_bbox:Xe}),$e.bbox=Xe[0]}_e.distance<5&&(_e.buttons||A)?V.emit("plotly_click",Ze):V.emit("plotly_hover",Ze),this.oldEventData=Ze}else s.loneUnhover(j),this.oldEventData&&V.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;U.drawAnnotations(U)},I.recoverContext=function(){var U=this;U.glplot.dispose();var V=function(){if(U.glplot.gl.isContextLost()){requestAnimationFrame(V);return}if(!U.initializeGLPlot()){a.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}U.plot.apply(U,U.plotArgs)};requestAnimationFrame(V)};var E=["xaxis","yaxis","zaxis"];function _(U,V,G){for(var j=U.fullSceneLayout,O=0;O<3;O++){var H=E[O],W=H.charAt(0),ee=j[H],ue=V[W],xe=V[W+"calendar"],ge=V["_"+W+"length"];if(!a.isArrayOrTypedArray(ue))G[0][O]=Math.min(G[0][O],0),G[1][O]=Math.max(G[1][O],ge-1);else for(var _e,Y=0;Y<(ge||ue.length);Y++)if(a.isArrayOrTypedArray(ue[Y]))for(var se=0;sene[1][W])ne[0][W]=-1,ne[1][W]=1;else{var it=ne[1][W]-ne[0][W];ne[0][W]-=it/32,ne[1][W]+=it/32}if(le=[ne[0][W],ne[1][W]],le=C(le,ue),ne[0][W]=le[0],ne[1][W]=le[1],ue.isReversed()){var yt=ne[0][W];ne[0][W]=ne[1][W],ne[1][W]=yt}}else le=ue.range,ne[0][W]=ue.r2l(le[0]),ne[1][W]=ue.r2l(le[1]);ne[0][W]===ne[1][W]&&(ne[0][W]-=1,ne[1][W]+=1),ue.range=[ne[0][W],ne[1][W]],ue.limitRange(),j.glplot.setBounds(W,{min:ue.range[0]*se[W],max:ue.range[1]*se[W]})}var bt,mt=ge.aspectmode;if(mt==="cube")bt=[1,1,1];else if(mt==="manual"){var ht=ge.aspectratio;bt=[ht.x,ht.y,ht.z]}else if(mt==="auto"||mt==="data"){var Ve=[1,1,1];for(W=0;W<3;++W){ue=ge[E[W]],xe=ue.type;var ze=ye[xe];Ve[W]=Math.pow(ze.acc,1/ze.count)/se[W]}mt==="data"||Math.max.apply(null,Ve)/Math.min.apply(null,Ve)<=4?bt=Ve:bt=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");ge.aspectratio.x=_e.aspectratio.x=bt[0],ge.aspectratio.y=_e.aspectratio.y=bt[1],ge.aspectratio.z=_e.aspectratio.z=bt[2],j.glplot.setAspectratio(ge.aspectratio),j.viewInitial.aspectratio||(j.viewInitial.aspectratio={x:ge.aspectratio.x,y:ge.aspectratio.y,z:ge.aspectratio.z}),j.viewInitial.aspectmode||(j.viewInitial.aspectmode=ge.aspectmode);var Se=ge.domain||null,Je=V._size||null;if(Se&&Je){var _t=j.container.style;_t.position="absolute",_t.left=Je.l+Se.x[0]*Je.w+"px",_t.top=Je.t+(1-Se.y[1])*Je.h+"px",_t.width=Je.w*(Se.x[1]-Se.x[0])+"px",_t.height=Je.h*(Se.y[1]-Se.y[0])+"px"}j.glplot.redraw()}},I.destroy=function(){var U=this;U.glplot&&(U.camera.mouseListener.enabled=!1,U.container.removeEventListener("wheel",U.camera.wheelListener),U.camera=null,U.glplot.dispose(),U.container.parentNode.removeChild(U.container),U.glplot=null)};function m(U){return[[U.eye.x,U.eye.y,U.eye.z],[U.center.x,U.center.y,U.center.z],[U.up.x,U.up.y,U.up.z]]}function w(U){return{up:{x:U.up[0],y:U.up[1],z:U.up[2]},center:{x:U.center[0],y:U.center[1],z:U.center[2]},eye:{x:U.eye[0],y:U.eye[1],z:U.eye[2]},projection:{type:U._ortho===!0?"orthographic":"perspective"}}}I.getCamera=function(){var U=this;return U.camera.view.recalcMatrix(U.camera.view.lastT()),w(U.camera)},I.setViewport=function(U){var V=this,G=U.camera;V.camera.lookAt.apply(this,m(G)),V.glplot.setAspectratio(U.aspectratio);var j=G.projection.type==="orthographic",O=V.camera._ortho;j!==O&&(V.glplot.redraw(),V.glplot.clearRGBA(),V.glplot.dispose(),V.initializeGLPlot())},I.isCameraChanged=function(U){var V=this,G=V.getCamera(),j=a.nestedProperty(U,V.id+".camera"),O=j.get();function H(xe,ge,_e,Y){var se=["up","center","eye"],ce=["x","y","z"];return ge[se[_e]]&&xe[se[_e]][ce[Y]]===ge[se[_e]][ce[Y]]}var W=!1;if(O===void 0)W=!0;else{for(var ee=0;ee<3;ee++)for(var ue=0;ue<3;ue++)if(!H(G,O,ee,ue)){W=!0;break}(!O.projection||G.projection&&G.projection.type!==O.projection.type)&&(W=!0)}return W},I.isAspectChanged=function(U){var V=this,G=V.glplot.getAspectratio(),j=a.nestedProperty(U,V.id+".aspectratio"),O=j.get();return O===void 0||O.x!==G.x||O.y!==G.y||O.z!==G.z},I.saveLayout=function(U){var V=this,G=V.fullLayout,j,O,H,W,ee,ue,xe=V.isCameraChanged(U),ge=V.isAspectChanged(U),_e=xe||ge;if(_e){var Y={};if(xe&&(j=V.getCamera(),O=a.nestedProperty(U,V.id+".camera"),H=O.get(),Y[V.id+".camera"]=H),ge&&(W=V.glplot.getAspectratio(),ee=a.nestedProperty(U,V.id+".aspectratio"),ue=ee.get(),Y[V.id+".aspectratio"]=ue),r.call("_storeDirectGUIEdit",U,G._preGUI,Y),xe){O.set(j);var se=a.nestedProperty(G,V.id+".camera");se.set(j)}if(ge){ee.set(W);var ce=a.nestedProperty(G,V.id+".aspectratio");ce.set(W),V.glplot.redraw()}}return _e},I.updateFx=function(U,V){var G=this,j=G.camera;if(j)if(U==="orbit")j.mode="orbit",j.keyBindingMode="rotate";else if(U==="turntable"){j.up=[0,0,1],j.mode="turntable",j.keyBindingMode="rotate";var O=G.graphDiv,H=O._fullLayout,W=G.fullSceneLayout.camera,ee=W.up.x,ue=W.up.y,xe=W.up.z;if(xe/Math.sqrt(ee*ee+ue*ue+xe*xe)<.999){var ge=G.id+".camera.up",_e={x:0,y:0,z:1},Y={};Y[ge]=_e;var se=O.layout;r.call("_storeDirectGUIEdit",se,H._preGUI,Y),W.up=_e,a.nestedProperty(se,ge).set(_e)}}else j.keyBindingMode=U;G.fullSceneLayout.hovermode=V};function F(U,V,G){for(var j=0,O=G-1;j0)for(var ee=255/W,ue=0;ue<3;++ue)U[H+ue]=Math.min(ee*U[H+ue],255)}}I.toImage=function(U){var V=this;U||(U="png"),V.staticMode&&V.container.appendChild(f),V.glplot.redraw();var G=V.glplot.gl,j=G.drawingBufferWidth,O=G.drawingBufferHeight;G.bindFramebuffer(G.FRAMEBUFFER,null);var H=new Uint8Array(j*O*4);G.readPixels(0,0,j,O,G.RGBA,G.UNSIGNED_BYTE,H),F(H,j,O),z(H,j,O);var W=document.createElement("canvas");W.width=j,W.height=O;var ee=W.getContext("2d",{willReadFrequently:!0}),ue=ee.createImageData(j,O);ue.data.set(H),ee.putImageData(ue,0,0);var xe;switch(U){case"jpeg":xe=W.toDataURL("image/jpeg");break;case"webp":xe=W.toDataURL("image/webp");break;default:xe=W.toDataURL("image/png")}return V.staticMode&&V.container.removeChild(f),xe},I.setConvert=function(){for(var U=this,V=0;V<3;V++){var G=U.fullSceneLayout[E[V]];i.setConvert(G,U.fullLayout),G.setScale=a.noop}},I.make4thDimension=function(){var U=this,V=U.graphDiv,G=V._fullLayout;U._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},i.setConvert(U._mockAxis,G)},K.exports=k}}),LW=Re({"src/plots/gl3d/layout/attributes.js"(ae,K){K.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),eF=Re({"src/plots/gl3d/layout/axis_attributes.js"(ae,K){var v=ko(),S=Hd(),M=Li().extendFlat,L=bf().overrideAll;K.exports=L({visible:S.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:v.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:S.color,categoryorder:S.categoryorder,categoryarray:S.categoryarray,title:{text:S.title.text,font:S.title.font},type:M({},S.type,{values:["-","linear","log","date","category"]}),autotypenumbers:S.autotypenumbers,autorange:S.autorange,autorangeoptions:{minallowed:S.autorangeoptions.minallowed,maxallowed:S.autorangeoptions.maxallowed,clipmin:S.autorangeoptions.clipmin,clipmax:S.autorangeoptions.clipmax,include:S.autorangeoptions.include,editType:"plot"},rangemode:S.rangemode,minallowed:S.minallowed,maxallowed:S.maxallowed,range:M({},S.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:S.minor.tickmode,nticks:S.nticks,tick0:S.tick0,dtick:S.dtick,tickvals:S.tickvals,ticktext:S.ticktext,ticks:S.ticks,mirror:S.mirror,ticklen:S.ticklen,tickwidth:S.tickwidth,tickcolor:S.tickcolor,showticklabels:S.showticklabels,labelalias:S.labelalias,tickfont:S.tickfont,tickangle:S.tickangle,tickprefix:S.tickprefix,showtickprefix:S.showtickprefix,ticksuffix:S.ticksuffix,showticksuffix:S.showticksuffix,showexponent:S.showexponent,exponentformat:S.exponentformat,minexponent:S.minexponent,separatethousands:S.separatethousands,tickformat:S.tickformat,tickformatstops:S.tickformatstops,hoverformat:S.hoverformat,showline:S.showline,linecolor:S.linecolor,linewidth:S.linewidth,showgrid:S.showgrid,gridcolor:M({},S.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:S.gridwidth,zeroline:S.zeroline,zerolinecolor:S.zerolinecolor,zerolinewidth:S.zerolinewidth},"plot","from-root")}}),tF=Re({"src/plots/gl3d/layout/layout_attributes.js"(ae,K){var v=eF(),S=af().attributes,M=Li().extendFlat,L=Rn().counterRegex;function t(r,a,l){return{x:{valType:"number",dflt:r,editType:"camera"},y:{valType:"number",dflt:a,editType:"camera"},z:{valType:"number",dflt:l,editType:"camera"},editType:"camera"}}K.exports={_arrayAttrRegexps:[L("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:M(t(0,0,1),{}),center:M(t(0,0,0),{}),eye:M(t(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:S({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:v,yaxis:v,zaxis:v,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"}}}),RW=Re({"src/plots/gl3d/layout/axis_defaults.js"(ae,K){var v=oo().mix,S=Rn(),M=Bu(),L=eF(),t=Dp(),r=wg(),a=["xaxis","yaxis","zaxis"],l=13600/187;K.exports=function(s,o,c){var p,d;function y(f,x){return S.coerce(p,d,L,f,x)}for(var g=0;g1;function y(g){if(!d){var C=v.validate(o[g],r[g]);if(C)return o[g]}}L(o,c,p,{type:l,attributes:r,handleDefaults:i,fullLayout:c,font:c.font,fullData:p,getDfltFromLayout:y,autotypenumbersDflt:c.autotypenumbers,paper_bgcolor:c.paper_bgcolor,calendar:c.calendar})};function i(s,o,c,p){for(var d=c("bgcolor"),y=S.combine(d,p.paper_bgcolor),g=["up","center","eye"],C=0;C.999)&&(I="turntable")}else I="turntable";c("dragmode",I),c("hovermode",p.getDfltFromLayout("hovermode"))}}}),$w=Re({"src/plots/gl3d/index.js"(ae){var K=bf().overrideAll,v=Ps(),S=IW(),M=Lp().getSubplotData,L=Rn(),t=jv(),r="gl3d",a="scene";ae.name=r,ae.attr=a,ae.idRoot=a,ae.idRegex=ae.attrRegex=L.counterRegex("scene"),ae.attributes=LW(),ae.layoutAttributes=tF(),ae.baseLayoutAttrOverrides=K({hoverlabel:v.hoverlabel},"plot","nested"),ae.supplyLayoutDefaults=DW(),ae.plot=function(i){for(var s=i._fullLayout,o=i._fullData,c=s._subplots[r],p=0;p0){F=p[z];break}return F}function C(m,w){if(!(m<1||w<1)){for(var F=y(m),z=y(w),U=1,V=0;Vk;)z--,z/=g(z),z++,z1?U:1};function I(m,w,F){var z=F[8]+F[2]*w[0]+F[5]*w[1];return m[0]=(F[6]+F[0]*w[0]+F[3]*w[1])/z,m[1]=(F[7]+F[1]*w[0]+F[4]*w[1])/z,m}function T(m,w,F){return E(m,w,I,F),m}function E(m,w,F,z){for(var U=[0,0],V=m.shape[0],G=m.shape[1],j=0;j0&&this.contourStart[z]!==null&&this.contourEnd[z]!==null&&this.contourEnd[z]>this.contourStart[z]))for(w[z]=!0,U=this.contourStart[z];Uue&&(this.minValues[H]=ue),this.maxValues[H]p&&(l.isomin=null,l.isomax=null);var d=o("x"),y=o("y"),g=o("z"),C=o("value");if(!d||!d.length||!y||!y.length||!g||!g.length||!C||!C.length){l.visible=!1;return}var f=S.getComponentMethod("calendars","handleTraceDefaults");f(a,l,["x","y","z"],s),o("valuehoverformat"),["x","y","z"].forEach(function(I){o(I+"hoverformat");var T="caps."+I,E=o(T+".show");E&&o(T+".fill");var _="slices."+I,h=o(_+".show");h&&(o(_+".fill"),o(_+".locations"))});var x=o("spaceframe.show");x&&o("spaceframe.fill");var A=o("surface.show");A&&(o("surface.count"),o("surface.fill"),o("surface.pattern"));var k=o("contour.show");k&&(o("contour.color"),o("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(I){o(I)}),L(a,l,s,o,{prefix:"",cLetter:"c"}),l._length=null}K.exports={supplyDefaults:t,supplyIsoDefaults:r}}}),AP=Re({"src/traces/streamtube/calc.js"(ae,K){var v=Rn(),S=hp();function M(a,l){l._len=Math.min(l.u.length,l.v.length,l.w.length,l.x.length,l.y.length,l.z.length),l._u=r(l.u,l._len),l._v=r(l.v,l._len),l._w=r(l.w,l._len),l._x=r(l.x,l._len),l._y=r(l.y,l._len),l._z=r(l.z,l._len);var i=L(l);l._gridFill=i.fill,l._Xs=i.Xs,l._Ys=i.Ys,l._Zs=i.Zs,l._len=i.len;var s=0,o,c,p;l.starts&&(o=r(l.starts.x||[]),c=r(l.starts.y||[]),p=r(l.starts.z||[]),s=Math.min(o.length,c.length,p.length)),l._startsX=o||[],l._startsY=c||[],l._startsZ=p||[];var d=0,y=1/0,g;for(g=0;g1&&(h=l[o-1],w=i[o-1],z=s[o-1]),c=0;ch?"-":"+")+"x"),k=k.replace("y",(m>w?"-":"+")+"y"),k=k.replace("z",(F>z?"-":"+")+"z");var j=function(){o=0,U=[],V=[],G=[]};(!o||o0;y--){var g=Math.min(d[y],d[y-1]),C=Math.max(d[y],d[y-1]);if(C>g&&g-1}function de(Bt,et){return Bt===null?et:Bt}function pe(Bt,et,ut){xe();var Be=[et],Ie=[ut];if(ne>=1)Be=[et],Ie=[ut];else if(ne>0){var ke=le(et,ut);Be=ke.xyzv,Ie=ke.abc}for(var Fe=0;Fe-1?ut[ct]:ue(Gt,Vt,Zt);Dr>-1?at[ct]=Dr:at[ct]=_e(Gt,Vt,Zt,de(Bt,ur))}Y(at[0],at[1],at[2])}}function Te(Bt,et,ut){var Be=function(Ie,ke,Fe){pe(Bt,[et[Ie],et[ke],et[Fe]],[ut[Ie],ut[ke],ut[Fe]])};Be(0,1,2),Be(2,3,0)}function Ne(Bt,et,ut){var Be=function(Ie,ke,Fe){pe(Bt,[et[Ie],et[ke],et[Fe]],[ut[Ie],ut[ke],ut[Fe]])};Be(0,1,2),Be(3,0,1),Be(2,3,0),Be(1,2,3)}function $e(Bt,et,ut,Be){var Ie=Bt[3];IeBe&&(Ie=Be);for(var ke=(Bt[3]-Ie)/(Bt[3]-et[3]+1e-9),Fe=[],at=0;at<4;at++)Fe[at]=(1-ke)*Bt[at]+ke*et[at];return Fe}function Ze(Bt,et,ut){return Bt>=et&&Bt<=ut}function Xe(Bt){var et=.001*(j-G);return Bt>=G-et&&Bt<=j+et}function it(Bt){for(var et=[],ut=0;ut<4;ut++){var Be=Bt[ut];et.push([p._x[Be],p._y[Be],p._z[Be],p._value[Be]])}return et}var yt=3;function bt(Bt,et,ut,Be,Ie,ke){ke||(ke=1),ut=[-1,-1,-1];var Fe=!1,at=[Ze(et[0][3],Be,Ie),Ze(et[1][3],Be,Ie),Ze(et[2][3],Be,Ie)];if(!at[0]&&!at[1]&&!at[2])return!1;var ct=function(Vt,Zt,ur){return Xe(Zt[0][3])&&Xe(Zt[1][3])&&Xe(Zt[2][3])?(pe(Vt,Zt,ur),!0):keat?[U,ke]:[ke,V];fr(et,ct[0],ct[1])}}var Gt=[[Math.min(G,V),Math.max(G,V)],[Math.min(U,j),Math.max(U,j)]];["x","y","z"].forEach(function(Vt){for(var Zt=[],ur=0;ur0&&(ha.push(xa.id),Vt==="x"?oa.push([xa.distRatio,0,0]):Vt==="y"?oa.push([0,xa.distRatio,0]):oa.push([0,0,xa.distRatio]))}else Vt==="x"?jn=fn(1,h-1):Vt==="y"?jn=fn(1,m-1):jn=fn(1,w-1);ha.length>0&&(Vt==="x"?Zt[Dr]=mr(Bt,ha,kr,Sr,oa,Zt[Dr]):Vt==="y"?Zt[Dr]=Ur(Bt,ha,kr,Sr,oa,Zt[Dr]):Zt[Dr]=Br(Bt,ha,kr,Sr,oa,Zt[Dr]),Dr++),jn.length>0&&(Vt==="x"?Zt[Dr]=_t(Bt,jn,kr,Sr,Zt[Dr]):Vt==="y"?Zt[Dr]=At(Bt,jn,kr,Sr,Zt[Dr]):Zt[Dr]=vt(Bt,jn,kr,Sr,Zt[Dr]),Dr++)}var ra=p.caps[Vt];ra.show&&ra.fill&&(ye(ra.fill),Vt==="x"?Zt[Dr]=_t(Bt,[0,h-1],kr,Sr,Zt[Dr]):Vt==="y"?Zt[Dr]=At(Bt,[0,m-1],kr,Sr,Zt[Dr]):Zt[Dr]=vt(Bt,[0,w-1],kr,Sr,Zt[Dr]),Dr++)}}),A===0&&ge(),p._meshX=O,p._meshY=H,p._meshZ=W,p._meshIntensity=ee,p._Xs=T,p._Ys=E,p._Zs=_}return Qr(),p}function c(p,d){var y=p.glplot.gl,g=v({gl:y}),C=new l(p,g,d.uid);return g._trace=C,C.update(d),p.glplot.add(g),C}K.exports={findNearestOnAxis:a,generateIsoMeshes:o,createIsosurfaceTrace:c}}}),UW=Re({"src/traces/isosurface/index.js"(ae,K){K.exports={attributes:TP(),supplyDefaults:nF().supplyDefaults,calc:aF(),colorbar:{min:"cmin",max:"cmax"},plot:SP().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:$w(),categories:["gl3d","showLegend"],meta:{}}}}),$W=Re({"lib/isosurface.js"(ae,K){K.exports=UW()}}),iF=Re({"src/traces/volume/attributes.js"(ae,K){var v=ac(),S=TP(),M=VI(),L=As(),t=Li().extendFlat,r=bf().overrideAll,a=K.exports=r(t({x:S.x,y:S.y,z:S.z,value:S.value,isomin:S.isomin,isomax:S.isomax,surface:S.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:S.slices,caps:S.caps,text:S.text,hovertext:S.hovertext,xhoverformat:S.xhoverformat,yhoverformat:S.yhoverformat,zhoverformat:S.zhoverformat,valuehoverformat:S.valuehoverformat,hovertemplate:S.hovertemplate,hovertemplatefallback:S.hovertemplatefallback},v("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:S.colorbar,opacity:S.opacity,opacityscale:M.opacityscale,lightposition:S.lightposition,lighting:S.lighting,flatshading:S.flatshading,contour:S.contour,hoverinfo:t({},L.hoverinfo),showlegend:t({},L.showlegend,{dflt:!1})}),"calc","nested");a.x.editType=a.y.editType=a.z.editType=a.value.editType="calc+clearAxisTypes"}}),VW=Re({"src/traces/volume/defaults.js"(ae,K){var v=Rn(),S=iF(),M=nF().supplyIsoDefaults,L=rF().opacityscaleDefaults;K.exports=function(r,a,l,i){function s(o,c){return v.coerce(r,a,S,o,c)}M(r,a,l,i,s),L(r,a,i,s)}}}),jW=Re({"src/traces/volume/convert.js"(ae,K){var v=vv().gl_mesh3d,S=Cx().parseColorScale,M=Rn().isArrayOrTypedArray,L=Ex(),t=nf().extractOpts,r=nE(),a=SP().findNearestOnAxis,l=SP().generateIsoMeshes;function i(c,p,d){this.scene=c,this.uid=d,this.mesh=p,this.name="",this.data=null,this.showContour=!1}var s=i.prototype;s.handlePick=function(c){if(c.object===this.mesh){var p=c.data.index,d=this.data._meshX[p],y=this.data._meshY[p],g=this.data._meshZ[p],C=this.data._Ys.length,f=this.data._Zs.length,x=a(d,this.data._Xs).id,A=a(y,this.data._Ys).id,k=a(g,this.data._Zs).id,I=c.index=k+f*A+f*C*x;c.traceCoordinate=[this.data._meshX[I],this.data._meshY[I],this.data._meshZ[I],this.data._value[I]];var T=this.data.hovertext||this.data.text;return M(T)&&T[I]!==void 0?c.textLabel=T[I]:T&&(c.textLabel=T),!0}},s.update=function(c){var p=this.scene,d=p.fullSceneLayout;this.data=l(c);function y(A,k,I,T){return k.map(function(E){return A.d2l(E,0,T)*I})}var g=r(y(d.xaxis,c._meshX,p.dataScale[0],c.xcalendar),y(d.yaxis,c._meshY,p.dataScale[1],c.ycalendar),y(d.zaxis,c._meshZ,p.dataScale[2],c.zcalendar)),C=r(c._meshI,c._meshJ,c._meshK),f={positions:g,cells:C,lightPosition:[c.lightposition.x,c.lightposition.y,c.lightposition.z],ambient:c.lighting.ambient,diffuse:c.lighting.diffuse,specular:c.lighting.specular,roughness:c.lighting.roughness,fresnel:c.lighting.fresnel,vertexNormalsEpsilon:c.lighting.vertexnormalsepsilon,faceNormalsEpsilon:c.lighting.facenormalsepsilon,opacity:c.opacity,opacityscale:c.opacityscale,contourEnable:c.contour.show,contourColor:L(c.contour.color).slice(0,3),contourWidth:c.contour.width,useFacetNormals:c.flatshading},x=t(c);f.vertexIntensity=c._meshIntensity,f.vertexIntensityBounds=[x.min,x.max],f.colormap=S(c),this.mesh.update(f)},s.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function o(c,p){var d=c.glplot.gl,y=v({gl:d}),g=new i(c,y,p.uid);return y._trace=g,g.update(p),c.glplot.add(y),g}K.exports=o}}),GW=Re({"src/traces/volume/index.js"(ae,K){K.exports={attributes:iF(),supplyDefaults:VW(),calc:aF(),colorbar:{min:"cmin",max:"cmax"},plot:jW(),moduleType:"trace",name:"volume",basePlotModule:$w(),categories:["gl3d","showLegend"],meta:{}}}}),qW=Re({"lib/volume.js"(ae,K){K.exports=GW()}}),HW=Re({"src/traces/mesh3d/defaults.js"(ae,K){var v=es(),S=Rn(),M=ed(),L=rE();K.exports=function(r,a,l,i){function s(y,g){return S.coerce(r,a,L,y,g)}function o(y){var g=y.map(function(C){var f=s(C);return f&&S.isArrayOrTypedArray(f)?f:null});return g.every(function(C){return C&&C.length===g[0].length})&&g}var c=o(["x","y","z"]);if(!c){a.visible=!1;return}if(o(["i","j","k"]),a.i&&(!a.j||!a.k)||a.j&&(!a.k||!a.i)||a.k&&(!a.i||!a.j)){a.visible=!1;return}var p=v.getComponentMethod("calendars","handleTraceDefaults");p(r,a,["x","y","z"],i),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(y){s(y)});var d=s("contour.show");d&&(s("contour.color"),s("contour.width")),"intensity"in r?(s("intensity"),s("intensitymode"),M(r,a,i,s,{prefix:"",cLetter:"c"})):(a.showscale=!1,"facecolor"in r?s("facecolor"):"vertexcolor"in r?s("vertexcolor"):s("color",l)),s("text"),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),s("xhoverformat"),s("yhoverformat"),s("zhoverformat"),a._length=null}}}),WW=Re({"src/traces/mesh3d/calc.js"(ae,K){var v=hp();K.exports=function(M,L){L.intensity&&v(M,L,{vals:L.intensity,containerStr:"",cLetter:"c"})}}}),XW=Re({"src/traces/mesh3d/convert.js"(ae,K){var v=vv().gl_mesh3d,S=vv().delaunay_triangulate,M=vv().alpha_shape,L=vv().convex_hull,t=Cx().parseColorScale,r=Rn().isArrayOrTypedArray,a=Ex(),l=nf().extractOpts,i=nE();function s(f,x,A){this.scene=f,this.uid=A,this.mesh=x,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var o=s.prototype;o.handlePick=function(f){if(f.object===this.mesh){var x=f.index=f.data.index;f.data._cellCenter?f.traceCoordinate=f.data.dataCoordinate:f.traceCoordinate=[this.data.x[x],this.data.y[x],this.data.z[x]];var A=this.data.hovertext||this.data.text;return r(A)&&A[x]!==void 0?f.textLabel=A[x]:A&&(f.textLabel=A),!0}};function c(f){for(var x=[],A=f.length,k=0;k=x-.5)return!1;return!0}o.update=function(f){var x=this.scene,A=x.fullSceneLayout;this.data=f;var k=f.x.length,I=i(p(A.xaxis,f.x,x.dataScale[0],f.xcalendar),p(A.yaxis,f.y,x.dataScale[1],f.ycalendar),p(A.zaxis,f.z,x.dataScale[2],f.zcalendar)),T;if(f.i&&f.j&&f.k){if(f.i.length!==f.j.length||f.j.length!==f.k.length||!g(f.i,k)||!g(f.j,k)||!g(f.k,k))return;T=i(d(f.i),d(f.j),d(f.k))}else f.alphahull===0?T=L(I):f.alphahull>0?T=M(f.alphahull,I):T=y(f.delaunayaxis,I);var E={positions:I,cells:T,lightPosition:[f.lightposition.x,f.lightposition.y,f.lightposition.z],ambient:f.lighting.ambient,diffuse:f.lighting.diffuse,specular:f.lighting.specular,roughness:f.lighting.roughness,fresnel:f.lighting.fresnel,vertexNormalsEpsilon:f.lighting.vertexnormalsepsilon,faceNormalsEpsilon:f.lighting.facenormalsepsilon,opacity:f.opacity,contourEnable:f.contour.show,contourColor:a(f.contour.color).slice(0,3),contourWidth:f.contour.width,useFacetNormals:f.flatshading};if(f.intensity){var _=l(f);this.color="#fff";var h=f.intensitymode;E[h+"Intensity"]=f.intensity,E[h+"IntensityBounds"]=[_.min,_.max],E.colormap=t(f)}else f.vertexcolor?(this.color=f.vertexcolor[0],E.vertexColors=c(f.vertexcolor)):f.facecolor?(this.color=f.facecolor[0],E.cellColors=c(f.facecolor)):(this.color=f.color,E.meshColor=a(f.color));this.mesh.update(E)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function C(f,x){var A=f.glplot.gl,k=v({gl:A}),I=new s(f,k,x.uid);return k._trace=I,I.update(x),f.glplot.add(k),I}K.exports=C}}),YW=Re({"src/traces/mesh3d/index.js"(ae,K){K.exports={attributes:rE(),supplyDefaults:HW(),calc:WW(),colorbar:{min:"cmin",max:"cmax"},plot:XW(),moduleType:"trace",name:"mesh3d",basePlotModule:$w(),categories:["gl3d","showLegend"],meta:{}}}}),ZW=Re({"lib/mesh3d.js"(ae,K){K.exports=YW()}}),oF=Re({"src/traces/cone/attributes.js"(ae,K){var v=ac(),S=$c().axisHoverFormat,{hovertemplateAttrs:M,templatefallbackAttrs:L}=Wl(),t=rE(),r=As(),a=Li().extendFlat,l={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","raw"],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:M({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:L({editType:"calc"}),uhoverformat:S("u",1),vhoverformat:S("v",1),whoverformat:S("w",1),xhoverformat:S("x"),yhoverformat:S("y"),zhoverformat:S("z"),showlegend:a({},r.showlegend,{dflt:!1})};a(l,v("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var i=["opacity","lightposition","lighting"];i.forEach(function(s){l[s]=t[s]}),l.hoverinfo=a({},r.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),K.exports=l}}),KW=Re({"src/traces/cone/defaults.js"(ae,K){var v=Rn(),S=ed(),M=oF();K.exports=function(t,r,a,l){function i(C,f){return v.coerce(t,r,M,C,f)}var s=i("u"),o=i("v"),c=i("w"),p=i("x"),d=i("y"),y=i("z");if(!s||!s.length||!o||!o.length||!c||!c.length||!p||!p.length||!d||!d.length||!y||!y.length){r.visible=!1;return}var g=i("sizemode");i("sizeref",g==="raw"?1:.5),i("anchor"),i("lighting.ambient"),i("lighting.diffuse"),i("lighting.specular"),i("lighting.roughness"),i("lighting.fresnel"),i("lightposition.x"),i("lightposition.y"),i("lightposition.z"),S(t,r,l,i,{prefix:"",cLetter:"c"}),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("uhoverformat"),i("vhoverformat"),i("whoverformat"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),r._length=null}}}),JW=Re({"src/traces/cone/calc.js"(ae,K){var v=hp();K.exports=function(M,L){for(var t=L.u,r=L.v,a=L.w,l=Math.min(L.x.length,L.y.length,L.z.length,t.length,r.length,a.length),i=-1/0,s=1/0,o=0;o2?g=d.slice(1,y-1):y===2?g=[(d[0]+d[1])/2]:g=d,g}function o(d){var y=d.length;return y===1?[.5,.5]:[d[1]-d[0],d[y-1]-d[y-2]]}function c(d,y){var g=d.fullSceneLayout,C=d.dataScale,f=y._len,x={};function A(_e,Y){var se=g[Y],ce=C[a[Y]];return M.simpleMap(_e,function(ne){return se.d2l(ne)*ce})}if(x.vectors=r(A(y._u,"xaxis"),A(y._v,"yaxis"),A(y._w,"zaxis"),f),!f)return{positions:[],cells:[]};var k=A(y._Xs,"xaxis"),I=A(y._Ys,"yaxis"),T=A(y._Zs,"zaxis");x.meshgrid=[k,I,T],x.gridFill=y._gridFill;var E=y._slen;if(E)x.startingPositions=r(A(y._startsX,"xaxis"),A(y._startsY,"yaxis"),A(y._startsZ,"zaxis"));else{for(var _=I[0],h=s(k),m=s(T),w=new Array(h.length*m.length),F=0,z=0;z_&&(_=F[0]),F[1]h&&(h=F[1])}function w(F){switch(F.type){case"GeometryCollection":F.geometries.forEach(w);break;case"Point":m(F.coordinates);break;case"MultiPoint":F.coordinates.forEach(m);break}}A.arcs.forEach(function(F){for(var z=-1,U=F.length,V;++z_&&(_=V[0]),V[1]h&&(h=V[1])});for(I in A.objects)w(A.objects[I]);return[T,E,_,h]}function t(A,k){for(var I,T=A.length,E=T-k;E<--T;)I=A[E],A[E++]=A[T],A[T]=I}function r(A,k){return typeof k=="string"&&(k=A.objects[k]),k.type==="GeometryCollection"?{type:"FeatureCollection",features:k.geometries.map(function(I){return a(A,I)})}:a(A,k)}function a(A,k){var I=k.id,T=k.bbox,E=k.properties==null?{}:k.properties,_=l(A,k);return I==null&&T==null?{type:"Feature",properties:E,geometry:_}:T==null?{type:"Feature",id:I,properties:E,geometry:_}:{type:"Feature",id:I,bbox:T,properties:E,geometry:_}}function l(A,k){var I=M(A.transform),T=A.arcs;function E(z,U){U.length&&U.pop();for(var V=T[z<0?~z:z],G=0,j=V.length;G1)T=c(A,k,I);else for(E=0,T=new Array(_=A.arcs.length);E<_;++E)T[E]=E;return{type:"MultiLineString",arcs:i(A,T)}}function c(A,k,I){var T=[],E=[],_;function h(U){var V=U<0?~U:U;(E[V]||(E[V]=[])).push({i:U,g:_})}function m(U){U.forEach(h)}function w(U){U.forEach(m)}function F(U){U.forEach(w)}function z(U){switch(_=U,U.type){case"GeometryCollection":U.geometries.forEach(z);break;case"LineString":m(U.arcs);break;case"MultiLineString":case"Polygon":w(U.arcs);break;case"MultiPolygon":F(U.arcs);break}}return z(k),E.forEach(I==null?function(U){T.push(U[0].i)}:function(U){I(U[0].g,U[U.length-1].g)&&T.push(U[0].i)}),T}function p(A){for(var k=-1,I=A.length,T,E=A[I-1],_=0;++k1)for(var U=1,V=m(F[0]),G,j;UV&&(j=F[0],F[0]=F[U],F[U]=j,V=G);return F}).filter(function(w){return w.length>0})}}function g(A,k){for(var I=0,T=A.length;I>>1;A[E]=2))throw new Error("n must be ≥2");w=A.bbox||L(A);var I=w[0],T=w[1],E=w[2],_=w[3],h;k={scale:[E-I?(E-I)/(h-1):1,_-T?(_-T)/(h-1):1],translate:[I,T]}}else w=A.bbox;var m=f(k),w,F,z=A.objects,U={};function V(O){return m(O)}function G(O){var H;switch(O.type){case"GeometryCollection":H={type:"GeometryCollection",geometries:O.geometries.map(G)};break;case"Point":H={type:"Point",coordinates:V(O.coordinates)};break;case"MultiPoint":H={type:"MultiPoint",coordinates:O.coordinates.map(V)};break;default:return O}return O.id!=null&&(H.id=O.id),O.bbox!=null&&(H.bbox=O.bbox),O.properties!=null&&(H.properties=O.properties),H}function j(O){var H=0,W=1,ee=O.length,ue,xe=new Array(ee);for(xe[0]=m(O[0],0);++H0&&(L.push(t),t=[])}return t.length>0&&L.push(t),L},ae.makeLine=function(v){return v.length===1?{type:"LineString",coordinates:v[0]}:{type:"MultiLineString",coordinates:v}},ae.makePolygon=function(v){if(v.length===1)return{type:"Polygon",coordinates:v};for(var S=new Array(v.length),M=0;Mt(G,U)),V)}function a(z,U,V={}){for(const j of z){if(j.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(j[j.length-1].length!==j[0].length)throw new Error("First and last Position are not equivalent.");for(let O=0;Oa(G,U)),V)}function i(z,U,V={}){if(z.length<2)throw new Error("coordinates must be an array of two or more positions");return M({type:"LineString",coordinates:z},U,V)}function s(z,U,V={}){return o(z.map(G=>i(G,U)),V)}function o(z,U={}){const V={type:"FeatureCollection"};return U.id&&(V.id=U.id),U.bbox&&(V.bbox=U.bbox),V.features=z,V}function c(z,U,V={}){return M({type:"MultiLineString",coordinates:z},U,V)}function p(z,U,V={}){return M({type:"MultiPoint",coordinates:z},U,V)}function d(z,U,V={}){return M({type:"MultiPolygon",coordinates:z},U,V)}function y(z,U,V={}){return M({type:"GeometryCollection",geometries:z},U,V)}function g(z,U=0){if(U&&!(U>=0))throw new Error("precision must be a positive number");const V=Math.pow(10,U||0);return Math.round(z*V)/V}function C(z,U="kilometers"){const V=v[U];if(!V)throw new Error(U+" units is invalid");return z*V}function f(z,U="kilometers"){const V=v[U];if(!V)throw new Error(U+" units is invalid");return z/V}function x(z,U){return I(f(z,U))}function A(z){let U=z%360;return U<0&&(U+=360),U}function k(z){return z=z%360,z>180?z-360:z<-180?z+360:z}function I(z){return z%(2*Math.PI)*180/Math.PI}function T(z){return z%360*Math.PI/180}function E(z,U="kilometers",V="kilometers"){if(!(z>=0))throw new Error("length must be a positive number");return C(f(z,U),V)}function _(z,U="meters",V="kilometers"){if(!(z>=0))throw new Error("area must be a positive number");const G=S[U];if(!G)throw new Error("invalid original units");const j=S[V];if(!j)throw new Error("invalid final units");return z/G*j}function h(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}function m(z){return z!==null&&typeof z=="object"&&!Array.isArray(z)}function w(z){if(!z)throw new Error("bbox is required");if(!Array.isArray(z))throw new Error("bbox must be an Array");if(z.length!==4&&z.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");z.forEach(U=>{if(!h(U))throw new Error("bbox must only contain numbers")})}function F(z){if(!z)throw new Error("id is required");if(["string","number"].indexOf(typeof z)===-1)throw new Error("id must be a number or a string")}ae.areaFactors=S,ae.azimuthToBearing=k,ae.bearingToAzimuth=A,ae.convertArea=_,ae.convertLength=E,ae.degreesToRadians=T,ae.earthRadius=K,ae.factors=v,ae.feature=M,ae.featureCollection=o,ae.geometry=L,ae.geometryCollection=y,ae.isNumber=h,ae.isObject=m,ae.lengthToDegrees=x,ae.lengthToRadians=f,ae.lineString=i,ae.lineStrings=s,ae.multiLineString=c,ae.multiPoint=p,ae.multiPolygon=d,ae.point=t,ae.points=r,ae.polygon=a,ae.polygons=l,ae.radiansToDegrees=I,ae.radiansToLength=C,ae.round=g,ae.validateBBox=w,ae.validateId=F}}),MP=Re({"node_modules/@turf/meta/dist/cjs/index.cjs"(ae){Object.defineProperty(ae,"__esModule",{value:!0});var K=kP();function v(f,x,A){if(f!==null)for(var k,I,T,E,_,h,m,w=0,F=0,z,U=f.type,V=U==="FeatureCollection",G=U==="Feature",j=V?f.features.length:1,O=0;Oh||V>m||G>w){_=F,h=k,m=V,w=G,T=0;return}var j=K.lineString.call(void 0,[_,F],A.properties);if(x(j,k,I,G,T)===!1)return!1;T++,_=F})===!1)return!1}}})}function p(f,x,A){var k=A,I=!1;return c(f,function(T,E,_,h,m){I===!1&&A===void 0?k=T:k=x(k,T,E,_,h,m),I=!0}),k}function d(f,x){if(!f)throw new Error("geojson is required");s(f,function(A,k,I){if(A.geometry!==null){var T=A.geometry.type,E=A.geometry.coordinates;switch(T){case"LineString":if(x(A,k,I,0,0)===!1)return!1;break;case"Polygon":for(var _=0;_s+M(o),0)}function M(i){let s=0,o;switch(i.type){case"Polygon":return L(i.coordinates);case"MultiPolygon":for(o=0;o0){s+=Math.abs(a(i[0]));for(let o=1;o=s?(c+2)%s:c+2],g=p[0]*r,C=d[1]*r,f=y[0]*r;o+=(f-g)*Math.sin(C),c++}return o*t}var l=S;ae.area=S,ae.default=l}}),cX=Re({"node_modules/@turf/centroid/dist/cjs/index.cjs"(ae){Object.defineProperty(ae,"__esModule",{value:!0});var K=kP(),v=MP();function S(L,t={}){let r=0,a=0,l=0;return v.coordEach.call(void 0,L,function(i){r+=i[0],a+=i[1],l++},!0),K.point.call(void 0,[r/l,a/l],t.properties)}var M=S;ae.centroid=S,ae.default=M}}),fX=Re({"node_modules/@turf/bbox/dist/cjs/index.cjs"(ae){Object.defineProperty(ae,"__esModule",{value:!0});var K=MP();function v(M,L={}){if(M.bbox!=null&&L.recompute!==!0)return M.bbox;const t=[1/0,1/0,-1/0,-1/0];return K.coordEach.call(void 0,M,r=>{t[0]>r[0]&&(t[0]=r[0]),t[1]>r[1]&&(t[1]=r[1]),t[2]0&&U[V+1][0]<0)return V;return null}switch(E==="RUS"||E==="FJI"?h=function(U){var V;if(z(U)===null)V=U;else for(V=new Array(U.length),F=0;FV?G[j++]=[U[F][0]+360,U[F][1]]:F===V?(G[j++]=U[F],G[j++]=[U[F][0],-90]):G[j++]=U[F];var O=s.tester(G);O.pts.pop(),_.push(O)}:h=function(U){_.push(s.tester(U))},I.type){case"MultiPolygon":for(m=0;m0?O.properties.ct=f(O):O.properties.ct=[NaN,NaN],G.fIn=U,G.fOut=O,_.push(O)}else a.log(["Location",G.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete E[V]}switch(T.type){case"FeatureCollection":var F=T.features;for(h=0;h_&&(_=w,T=m)}else T=I;return L(T).geometry.coordinates}function x(k){var I=window.PlotlyGeoAssets||{},T=[];function E(F){return new Promise(function(z,U){v.json(F,function(V,G){if(V){delete I[F];var j=V.status===404?'GeoJSON at URL "'+F+'" does not exist.':"Unexpected error while fetching from "+F;return U(new Error(j))}return I[F]=G,z(G)})})}function _(F){return new Promise(function(z,U){var V=0,G=setInterval(function(){if(I[F]&&I[F]!=="pending")return clearInterval(G),z(I[F]);if(V>100)return clearInterval(G),U("Unexpected error while fetching from "+F);V++},50)})}for(var h=0;h")}}}),dX=Re({"src/traces/scattergeo/event_data.js"(ae,K){K.exports=function(S,M,L,t,r){S.lon=M.lon,S.lat=M.lat,S.location=M.loc?M.loc:null;var a=t[r];return a.fIn&&a.fIn.properties&&(S.properties=a.fIn.properties),S}}}),pX=Re({"src/traces/scattergeo/select.js"(ae,K){var v=Mu(),S=Ia().BADNUM;K.exports=function(L,t){var r=L.cd,a=L.xaxis,l=L.yaxis,i=[],s=r[0].trace,o,c,p,d,y,g=!v.hasMarkers(s)&&!v.hasText(s);if(g)return[];if(t===!1)for(y=0;yne?1:ce>=ne?0:NaN}function M(ce){return ce.length===1&&(ce=L(ce)),{left:function(ne,ye,le,Z){for(le==null&&(le=0),Z==null&&(Z=ne.length);le>>1;ce(ne[de],ye)<0?le=de+1:Z=de}return le},right:function(ne,ye,le,Z){for(le==null&&(le=0),Z==null&&(Z=ne.length);le>>1;ce(ne[de],ye)>0?Z=de:le=de+1}return le}}}function L(ce){return function(ne,ye){return S(ce(ne),ye)}}var t=M(S),r=t.right,a=t.left;function l(ce,ne){ne==null&&(ne=i);for(var ye=0,le=ce.length-1,Z=ce[0],de=new Array(le<0?0:le);yece?1:ne>=ce?0:NaN}function c(ce){return ce===null?NaN:+ce}function p(ce,ne){var ye=ce.length,le=0,Z=-1,de=0,pe,Te,Ne=0;if(ne==null)for(;++Z1)return Ne/(le-1)}function d(ce,ne){var ye=p(ce,ne);return ye&&Math.sqrt(ye)}function y(ce,ne){var ye=ce.length,le=-1,Z,de,pe;if(ne==null){for(;++le=Z)for(de=pe=Z;++leZ&&(de=Z),pe=Z)for(de=pe=Z;++leZ&&(de=Z),pe0)return[ce];if((le=ne0)for(ce=Math.ceil(ce/Te),ne=Math.floor(ne/Te),pe=new Array(de=Math.ceil(ne-ce+1));++Z=0?(de>=I?10:de>=T?5:de>=E?2:1)*Math.pow(10,Z):-Math.pow(10,-Z)/(de>=I?10:de>=T?5:de>=E?2:1)}function m(ce,ne,ye){var le=Math.abs(ne-ce)/Math.max(0,ye),Z=Math.pow(10,Math.floor(Math.log(le)/Math.LN10)),de=le/Z;return de>=I?Z*=10:de>=T?Z*=5:de>=E&&(Z*=2),neXe;)it.pop(),--yt;var bt=new Array(yt+1),mt;for(de=0;de<=yt;++de)mt=bt[de]=[],mt.x0=de>0?it[de-1]:Ze,mt.x1=de=1)return+ye(ce[le-1],le-1,ce);var le,Z=(le-1)*ne,de=Math.floor(Z),pe=+ye(ce[de],de,ce),Te=+ye(ce[de+1],de+1,ce);return pe+(Te-pe)*(Z-de)}}function U(ce,ne,ye){return ce=f.call(ce,c).sort(S),Math.ceil((ye-ne)/(2*(z(ce,.75)-z(ce,.25))*Math.pow(ce.length,-1/3)))}function V(ce,ne,ye){return Math.ceil((ye-ne)/(3.5*d(ce)*Math.pow(ce.length,-1/3)))}function G(ce,ne){var ye=ce.length,le=-1,Z,de;if(ne==null){for(;++le=Z)for(de=Z;++lede&&(de=Z)}else for(;++le=Z)for(de=Z;++lede&&(de=Z);return de}function j(ce,ne){var ye=ce.length,le=ye,Z=-1,de,pe=0;if(ne==null)for(;++Z=0;)for(pe=ce[ne],ye=pe.length;--ye>=0;)de[--Z]=pe[ye];return de}function W(ce,ne){var ye=ce.length,le=-1,Z,de;if(ne==null){for(;++le=Z)for(de=Z;++leZ&&(de=Z)}else for(;++le=Z)for(de=Z;++leZ&&(de=Z);return de}function ee(ce,ne){for(var ye=ne.length,le=new Array(ye);ye--;)le[ye]=ce[ne[ye]];return le}function ue(ce,ne){if(ye=ce.length){var ye,le=0,Z=0,de,pe=ce[Z];for(ne==null&&(ne=S);++le0?1:wr<0?-1:0},_=Math.sqrt,h=Math.tan;function m(wr){return wr>1?0:wr<-1?i:Math.acos(wr)}function w(wr){return wr>1?s:wr<-1?-s:Math.asin(wr)}function F(wr){return(wr=T(wr/2))*wr}function z(){}function U(wr,qr){wr&&G.hasOwnProperty(wr.type)&&G[wr.type](wr,qr)}var V={Feature:function(wr,qr){U(wr.geometry,qr)},FeatureCollection:function(wr,qr){for(var kn=wr.features,_n=-1,Qn=kn.length;++_n=0?1:-1,Qn=_n*kn,$a=f(qr),Fa=T(qr),Ai=Y*Fa,Ni=_e*$a+Ai*f(Qn),ho=Ai*_n*T(Qn);W.add(C(ho,Ni)),ge=wr,_e=$a,Y=Fa}function Z(wr){return ee.reset(),H(wr,se),ee*2}function de(wr){return[C(wr[1],wr[0]),w(wr[2])]}function pe(wr){var qr=wr[0],kn=wr[1],_n=f(kn);return[_n*f(qr),_n*T(qr),T(kn)]}function Te(wr,qr){return wr[0]*qr[0]+wr[1]*qr[1]+wr[2]*qr[2]}function Ne(wr,qr){return[wr[1]*qr[2]-wr[2]*qr[1],wr[2]*qr[0]-wr[0]*qr[2],wr[0]*qr[1]-wr[1]*qr[0]]}function $e(wr,qr){wr[0]+=qr[0],wr[1]+=qr[1],wr[2]+=qr[2]}function Ze(wr,qr){return[wr[0]*qr,wr[1]*qr,wr[2]*qr]}function Xe(wr){var qr=_(wr[0]*wr[0]+wr[1]*wr[1]+wr[2]*wr[2]);wr[0]/=qr,wr[1]/=qr,wr[2]/=qr}var it,yt,bt,mt,ht,Ve,ze,Se,Je=M(),_t,At,vt={point:Kt,lineStart:fr,lineEnd:mr,polygonStart:function(){vt.point=Ur,vt.lineStart=Br,vt.lineEnd=fn,Je.reset(),se.polygonStart()},polygonEnd:function(){se.polygonEnd(),vt.point=Kt,vt.lineStart=fr,vt.lineEnd=mr,W<0?(it=-(bt=180),yt=-(mt=90)):Je>a?mt=90:Je<-a&&(yt=-90),At[0]=it,At[1]=bt},sphere:function(){it=-(bt=180),yt=-(mt=90)}};function Kt(wr,qr){_t.push(At=[it=wr,bt=wr]),qrmt&&(mt=qr)}function Qt(wr,qr){var kn=pe([wr*d,qr*d]);if(Se){var _n=Ne(Se,kn),Qn=[_n[1],-_n[0],0],$a=Ne(Qn,_n);Xe($a),$a=de($a);var Fa=wr-ht,Ai=Fa>0?1:-1,Ni=$a[0]*p*Ai,ho,fi=y(Fa)>180;fi^(Ai*htmt&&(mt=ho)):(Ni=(Ni+360)%360-180,fi^(Ai*htmt&&(mt=qr))),fi?wrFr(it,bt)&&(bt=wr):Fr(wr,bt)>Fr(it,bt)&&(it=wr):bt>=it?(wrbt&&(bt=wr)):wr>ht?Fr(it,wr)>Fr(it,bt)&&(bt=wr):Fr(wr,bt)>Fr(it,bt)&&(it=wr)}else _t.push(At=[it=wr,bt=wr]);qrmt&&(mt=qr),Se=kn,ht=wr}function fr(){vt.point=Qt}function mr(){At[0]=it,At[1]=bt,vt.point=Kt,Se=null}function Ur(wr,qr){if(Se){var kn=wr-ht;Je.add(y(kn)>180?kn+(kn>0?360:-360):kn)}else Ve=wr,ze=qr;se.point(wr,qr),Qt(wr,qr)}function Br(){se.lineStart()}function fn(){Ur(Ve,ze),se.lineEnd(),y(Je)>a&&(it=-(bt=180)),At[0]=it,At[1]=bt,Se=null}function Fr(wr,qr){return(qr-=wr)<0?qr+360:qr}function Qr(wr,qr){return wr[0]-qr[0]}function Bt(wr,qr){return wr[0]<=wr[1]?wr[0]<=qr&&qr<=wr[1]:qrFr(_n[0],_n[1])&&(_n[1]=Qn[1]),Fr(Qn[0],_n[1])>Fr(_n[0],_n[1])&&(_n[0]=Qn[0])):$a.push(_n=Qn);for(Fa=-1/0,kn=$a.length-1,qr=0,_n=$a[kn];qr<=kn;_n=Qn,++qr)Qn=$a[qr],(Ai=Fr(_n[1],Qn[0]))>Fa&&(Fa=Ai,it=Qn[0],bt=_n[1])}return _t=At=null,it===1/0||yt===1/0?[[NaN,NaN],[NaN,NaN]]:[[it,yt],[bt,mt]]}var ut,Be,Ie,ke,Fe,at,ct,Gt,Vt,Zt,ur,Dr,kr,Sr,Jr,jn,ha={sphere:z,point:oa,lineStart:xa,lineEnd:ci,polygonStart:function(){ha.lineStart=_r,ha.lineEnd=rr},polygonEnd:function(){ha.lineStart=xa,ha.lineEnd=ci}};function oa(wr,qr){wr*=d,qr*=d;var kn=f(qr);_a(kn*f(wr),kn*T(wr),T(qr))}function _a(wr,qr,kn){++ut,Ie+=(wr-Ie)/ut,ke+=(qr-ke)/ut,Fe+=(kn-Fe)/ut}function xa(){ha.point=ra}function ra(wr,qr){wr*=d,qr*=d;var kn=f(qr);Sr=kn*f(wr),Jr=kn*T(wr),jn=T(qr),ha.point=Ha,_a(Sr,Jr,jn)}function Ha(wr,qr){wr*=d,qr*=d;var kn=f(qr),_n=kn*f(wr),Qn=kn*T(wr),$a=T(qr),Fa=C(_((Fa=Jr*$a-jn*Qn)*Fa+(Fa=jn*_n-Sr*$a)*Fa+(Fa=Sr*Qn-Jr*_n)*Fa),Sr*_n+Jr*Qn+jn*$a);Be+=Fa,at+=Fa*(Sr+(Sr=_n)),ct+=Fa*(Jr+(Jr=Qn)),Gt+=Fa*(jn+(jn=$a)),_a(Sr,Jr,jn)}function ci(){ha.point=oa}function _r(){ha.point=yr}function rr(){br(Dr,kr),ha.point=oa}function yr(wr,qr){Dr=wr,kr=qr,wr*=d,qr*=d,ha.point=br;var kn=f(qr);Sr=kn*f(wr),Jr=kn*T(wr),jn=T(qr),_a(Sr,Jr,jn)}function br(wr,qr){wr*=d,qr*=d;var kn=f(qr),_n=kn*f(wr),Qn=kn*T(wr),$a=T(qr),Fa=Jr*$a-jn*Qn,Ai=jn*_n-Sr*$a,Ni=Sr*Qn-Jr*_n,ho=_(Fa*Fa+Ai*Ai+Ni*Ni),fi=w(ho),Yi=ho&&-fi/ho;Vt+=Yi*Fa,Zt+=Yi*Ai,ur+=Yi*Ni,Be+=fi,at+=fi*(Sr+(Sr=_n)),ct+=fi*(Jr+(Jr=Qn)),Gt+=fi*(jn+(jn=$a)),_a(Sr,Jr,jn)}function an(wr){ut=Be=Ie=ke=Fe=at=ct=Gt=Vt=Zt=ur=0,H(wr,ha);var qr=Vt,kn=Zt,_n=ur,Qn=qr*qr+kn*kn+_n*_n;return Qni?wr+Math.round(-wr/c)*c:wr,qr]}Fn.invert=Fn;function va(wr,qr,kn){return(wr%=c)?qr||kn?In(La(wr),Oa(qr,kn)):La(wr):qr||kn?Oa(qr,kn):Fn}function Pa(wr){return function(qr,kn){return qr+=wr,[qr>i?qr-c:qr<-i?qr+c:qr,kn]}}function La(wr){var qr=Pa(wr);return qr.invert=Pa(-wr),qr}function Oa(wr,qr){var kn=f(wr),_n=T(wr),Qn=f(qr),$a=T(qr);function Fa(Ai,Ni){var ho=f(Ni),fi=f(Ai)*ho,Yi=T(Ai)*ho,bi=T(Ni),ii=bi*kn+fi*_n;return[C(Yi*Qn-ii*$a,fi*kn-bi*_n),w(ii*Qn+Yi*$a)]}return Fa.invert=function(Ai,Ni){var ho=f(Ni),fi=f(Ai)*ho,Yi=T(Ai)*ho,bi=T(Ni),ii=bi*Qn-Yi*$a;return[C(Yi*Qn+bi*$a,fi*kn+ii*_n),w(ii*kn-fi*_n)]},Fa}function Wa(wr){wr=va(wr[0]*d,wr[1]*d,wr.length>2?wr[2]*d:0);function qr(kn){return kn=wr(kn[0]*d,kn[1]*d),kn[0]*=p,kn[1]*=p,kn}return qr.invert=function(kn){return kn=wr.invert(kn[0]*d,kn[1]*d),kn[0]*=p,kn[1]*=p,kn},qr}function sa(wr,qr,kn,_n,Qn,$a){if(kn){var Fa=f(qr),Ai=T(qr),Ni=_n*kn;Qn==null?(Qn=qr+_n*c,$a=qr-Ni/2):(Qn=ji(Fa,Qn),$a=ji(Fa,$a),(_n>0?Qn<$a:Qn>$a)&&(Qn+=_n*c));for(var ho,fi=Qn;_n>0?fi>$a:fi<$a;fi-=Ni)ho=de([Fa,-Ai*f(fi),-Ai*T(fi)]),wr.point(ho[0],ho[1])}}function ji(wr,qr){qr=pe(qr),qr[0]-=wr,Xe(qr);var kn=m(-qr[1]);return((-qr[2]<0?-kn:kn)+c-a)%c}function Qi(){var wr=bn([0,0]),qr=bn(90),kn=bn(6),_n,Qn,$a={point:Fa};function Fa(Ni,ho){_n.push(Ni=Qn(Ni,ho)),Ni[0]*=p,Ni[1]*=p}function Ai(){var Ni=wr.apply(this,arguments),ho=qr.apply(this,arguments)*d,fi=kn.apply(this,arguments)*d;return _n=[],Qn=va(-Ni[0]*d,-Ni[1]*d,0).invert,sa($a,ho,fi,1),Ni={type:"Polygon",coordinates:[_n]},_n=Qn=null,Ni}return Ai.center=function(Ni){return arguments.length?(wr=typeof Ni=="function"?Ni:bn([+Ni[0],+Ni[1]]),Ai):wr},Ai.radius=function(Ni){return arguments.length?(qr=typeof Ni=="function"?Ni:bn(+Ni),Ai):qr},Ai.precision=function(Ni){return arguments.length?(kn=typeof Ni=="function"?Ni:bn(+Ni),Ai):kn},Ai}function Xt(){var wr=[],qr;return{point:function(kn,_n,Qn){qr.push([kn,_n,Qn])},lineStart:function(){wr.push(qr=[])},lineEnd:z,rejoin:function(){wr.length>1&&wr.push(wr.pop().concat(wr.shift()))},result:function(){var kn=wr;return wr=[],qr=null,kn}}}function Lt(wr,qr){return y(wr[0]-qr[0])=0;--Ai)Qn.point((Yi=fi[Ai])[0],Yi[1]);else _n(bi.x,bi.p.x,-1,Qn);bi=bi.p}bi=bi.o,fi=bi.z,ii=!ii}while(!bi.v);Qn.lineEnd()}}}function rn(wr){if(qr=wr.length){for(var qr,kn=0,_n=wr[0],Qn;++kn=0?1:-1,Xl=mu*Hl,gu=Xl>i,wl=os*Ts;if(Wr.add(C(wl*mu*T(Xl),rs*il+wl*f(Xl))),Fa+=gu?Hl+mu*c:Hl,gu^ii>=kn^To>=kn){var Zu=Ne(pe(bi),pe(ls));Xe(Zu);var Hu=Ne($a,Zu);Xe(Hu);var fu=(gu^Hl>=0?-1:1)*w(Hu[2]);(_n>fu||_n===fu&&(Zu[0]||Zu[1]))&&(Ai+=gu^Hl>=0?1:-1)}}return(Fa<-a||Fa0){for(Ni||(Qn.polygonStart(),Ni=!0),Qn.lineStart(),il=0;il1&&ro&2&&Ts.push(Ts.pop().concat(Ts.shift())),fi.push(Ts.filter(Nt))}}return bi}}function Nt(wr){return wr.length>1}function xr(wr,qr){return((wr=wr.x)[0]<0?wr[1]-s-a:s-wr[1])-((qr=qr.x)[0]<0?qr[1]-s-a:s-qr[1])}var Xr=dn(function(){return!0},Tn,ia,[-i,-s]);function Tn(wr){var qr=NaN,kn=NaN,_n=NaN,Qn;return{lineStart:function(){wr.lineStart(),Qn=1},point:function($a,Fa){var Ai=$a>0?i:-i,Ni=y($a-qr);y(Ni-i)0?s:-s),wr.point(_n,kn),wr.lineEnd(),wr.lineStart(),wr.point(Ai,kn),wr.point($a,kn),Qn=0):_n!==Ai&&Ni>=i&&(y(qr-_n)a?g((T(qr)*($a=f(_n))*T(kn)-T(_n)*(Qn=f(qr))*T(wr))/(Qn*$a*Fa)):(qr+_n)/2}function ia(wr,qr,kn,_n){var Qn;if(wr==null)Qn=kn*s,_n.point(-i,Qn),_n.point(0,Qn),_n.point(i,Qn),_n.point(i,0),_n.point(i,-Qn),_n.point(0,-Qn),_n.point(-i,-Qn),_n.point(-i,0),_n.point(-i,Qn);else if(y(wr[0]-qr[0])>a){var $a=wr[0]0,Qn=y(qr)>a;function $a(fi,Yi,bi,ii){sa(ii,wr,kn,bi,fi,Yi)}function Fa(fi,Yi){return f(fi)*f(Yi)>qr}function Ai(fi){var Yi,bi,ii,bo,os;return{lineStart:function(){bo=ii=!1,os=1},point:function(rs,fs){var ls=[rs,fs],To,ro=Fa(rs,fs),Ts=_n?ro?0:ho(rs,fs):ro?ho(rs+(rs<0?i:-i),fs):0;if(!Yi&&(bo=ii=ro)&&fi.lineStart(),ro!==ii&&(To=Ni(Yi,ls),(!To||Lt(Yi,To)||Lt(ls,To))&&(ls[2]=1)),ro!==ii)os=0,ro?(fi.lineStart(),To=Ni(ls,Yi),fi.point(To[0],To[1])):(To=Ni(Yi,ls),fi.point(To[0],To[1],2),fi.lineEnd()),Yi=To;else if(Qn&&Yi&&_n^ro){var il;!(Ts&bi)&&(il=Ni(ls,Yi,!0))&&(os=0,_n?(fi.lineStart(),fi.point(il[0][0],il[0][1]),fi.point(il[1][0],il[1][1]),fi.lineEnd()):(fi.point(il[1][0],il[1][1]),fi.lineEnd(),fi.lineStart(),fi.point(il[0][0],il[0][1],3)))}ro&&(!Yi||!Lt(Yi,ls))&&fi.point(ls[0],ls[1]),Yi=ls,ii=ro,bi=Ts},lineEnd:function(){ii&&fi.lineEnd(),Yi=null},clean:function(){return os|(bo&&ii)<<1}}}function Ni(fi,Yi,bi){var ii=pe(fi),bo=pe(Yi),os=[1,0,0],rs=Ne(ii,bo),fs=Te(rs,rs),ls=rs[0],To=fs-ls*ls;if(!To)return!bi&&fi;var ro=qr*fs/To,Ts=-qr*ls/To,il=Ne(os,rs),Hl=Ze(os,ro),mu=Ze(rs,Ts);$e(Hl,mu);var Xl=il,gu=Te(Hl,Xl),wl=Te(Xl,Xl),Zu=gu*gu-wl*(Te(Hl,Hl)-1);if(!(Zu<0)){var Hu=_(Zu),fu=Ze(Xl,(-gu-Hu)/wl);if($e(fu,Hl),fu=de(fu),!bi)return fu;var Vo=fi[0],Fs=Yi[0],nu=fi[1],Fl=Yi[1],jc;Fs0^fu[1]<(y(fu[0]-Vo)i^(Vo<=fu[0]&&fu[0]<=Fs)){var qc=Ze(Xl,(-gu+Hu)/wl);return $e(qc,Hl),[fu,de(qc)]}}}function ho(fi,Yi){var bi=_n?wr:i-wr,ii=0;return fi<-bi?ii|=1:fi>bi&&(ii|=2),Yi<-bi?ii|=4:Yi>bi&&(ii|=8),ii}return dn(Fa,Ai,$a,_n?[0,-wr]:[-i,wr-i])}function An(wr,qr,kn,_n,Qn,$a){var Fa=wr[0],Ai=wr[1],Ni=qr[0],ho=qr[1],fi=0,Yi=1,bi=Ni-Fa,ii=ho-Ai,bo;if(bo=kn-Fa,!(!bi&&bo>0)){if(bo/=bi,bi<0){if(bo0){if(bo>Yi)return;bo>fi&&(fi=bo)}if(bo=Qn-Fa,!(!bi&&bo<0)){if(bo/=bi,bi<0){if(bo>Yi)return;bo>fi&&(fi=bo)}else if(bi>0){if(bo0)){if(bo/=ii,ii<0){if(bo0){if(bo>Yi)return;bo>fi&&(fi=bo)}if(bo=$a-Ai,!(!ii&&bo<0)){if(bo/=ii,ii<0){if(bo>Yi)return;bo>fi&&(fi=bo)}else if(ii>0){if(bo0&&(wr[0]=Fa+fi*bi,wr[1]=Ai+fi*ii),Yi<1&&(qr[0]=Fa+Yi*bi,qr[1]=Ai+Yi*ii),!0}}}}}var Yn=1e9,qi=-Yn;function Ga(wr,qr,kn,_n){function Qn(ho,fi){return wr<=ho&&ho<=kn&&qr<=fi&&fi<=_n}function $a(ho,fi,Yi,bi){var ii=0,bo=0;if(ho==null||(ii=Fa(ho,Yi))!==(bo=Fa(fi,Yi))||Ni(ho,fi)<0^Yi>0)do bi.point(ii===0||ii===3?wr:kn,ii>1?_n:qr);while((ii=(ii+Yi+4)%4)!==bo);else bi.point(fi[0],fi[1])}function Fa(ho,fi){return y(ho[0]-wr)0?0:3:y(ho[0]-kn)0?2:1:y(ho[1]-qr)0?1:0:fi>0?3:2}function Ai(ho,fi){return Ni(ho.x,fi.x)}function Ni(ho,fi){var Yi=Fa(ho,1),bi=Fa(fi,1);return Yi!==bi?Yi-bi:Yi===0?fi[1]-ho[1]:Yi===1?ho[0]-fi[0]:Yi===2?ho[1]-fi[1]:fi[0]-ho[0]}return function(ho){var fi=ho,Yi=Xt(),bi,ii,bo,os,rs,fs,ls,To,ro,Ts,il,Hl={point:mu,lineStart:Zu,lineEnd:Hu,polygonStart:gu,polygonEnd:wl};function mu(Vo,Fs){Qn(Vo,Fs)&&fi.point(Vo,Fs)}function Xl(){for(var Vo=0,Fs=0,nu=ii.length;Fs_n&&(oh-kh)*(_n-qc)>(Ku-qc)*(wr-kh)&&++Vo:Ku<=_n&&(oh-kh)*(_n-qc)<(Ku-qc)*(wr-kh)&&--Vo;return Vo}function gu(){fi=Yi,bi=[],ii=[],il=!0}function wl(){var Vo=Xl(),Fs=il&&Vo,nu=(bi=S.merge(bi)).length;(Fs||nu)&&(ho.polygonStart(),Fs&&(ho.lineStart(),$a(null,null,1,ho),ho.lineEnd()),nu&&en(bi,Ai,Vo,$a,ho),ho.polygonEnd()),fi=ho,bi=ii=bo=null}function Zu(){Hl.point=fu,ii&&ii.push(bo=[]),Ts=!0,ro=!1,ls=To=NaN}function Hu(){bi&&(fu(os,rs),fs&&ro&&Yi.rejoin(),bi.push(Yi.result())),Hl.point=mu,ro&&fi.lineEnd()}function fu(Vo,Fs){var nu=Qn(Vo,Fs);if(ii&&bo.push([Vo,Fs]),Ts)os=Vo,rs=Fs,fs=nu,Ts=!1,nu&&(fi.lineStart(),fi.point(Vo,Fs));else if(nu&&ro)fi.point(Vo,Fs);else{var Fl=[ls=Math.max(qi,Math.min(Yn,ls)),To=Math.max(qi,Math.min(Yn,To))],jc=[Vo=Math.max(qi,Math.min(Yn,Vo)),Fs=Math.max(qi,Math.min(Yn,Fs))];An(Fl,jc,wr,qr,kn,_n)?(ro||(fi.lineStart(),fi.point(Fl[0],Fl[1])),fi.point(jc[0],jc[1]),nu||fi.lineEnd(),il=!1):nu&&(fi.lineStart(),fi.point(Vo,Fs),il=!1)}ls=Vo,To=Fs,ro=nu}return Hl}}function to(){var wr=0,qr=0,kn=960,_n=500,Qn,$a,Fa;return Fa={stream:function(Ai){return Qn&&$a===Ai?Qn:Qn=Ga(wr,qr,kn,_n)($a=Ai)},extent:function(Ai){return arguments.length?(wr=+Ai[0][0],qr=+Ai[0][1],kn=+Ai[1][0],_n=+Ai[1][1],Qn=$a=null,Fa):[[wr,qr],[kn,_n]]}}}var _o=M(),Po,Ro,Xo,Oi={sphere:z,point:z,lineStart:bs,lineEnd:z,polygonStart:z,polygonEnd:z};function bs(){Oi.point=fl,Oi.lineEnd=cs}function cs(){Oi.point=Oi.lineEnd=z}function fl(wr,qr){wr*=d,qr*=d,Po=wr,Ro=T(qr),Xo=f(qr),Oi.point=Is}function Is(wr,qr){wr*=d,qr*=d;var kn=T(qr),_n=f(qr),Qn=y(wr-Po),$a=f(Qn),Fa=T(Qn),Ai=_n*Fa,Ni=Xo*kn-Ro*_n*$a,ho=Ro*kn+Xo*_n*$a;_o.add(C(_(Ai*Ai+Ni*Ni),ho)),Po=wr,Ro=kn,Xo=_n}function ys(wr){return _o.reset(),H(wr,Oi),+_o}var ss=[null,null],hl={type:"LineString",coordinates:ss};function ll(wr,qr){return ss[0]=wr,ss[1]=qr,ys(hl)}var Il={Feature:function(wr,qr){return ps(wr.geometry,qr)},FeatureCollection:function(wr,qr){for(var kn=wr.features,_n=-1,Qn=kn.length;++_n0&&(Qn=ll(wr[$a],wr[$a-1]),Qn>0&&kn<=Qn&&_n<=Qn&&(kn+_n-Qn)*(1-Math.pow((kn-_n)/Qn,2))a}).map(bi)).concat(S.range(x($a/ho)*ho,Qn,ho).filter(function(To){return y(To%Yi)>a}).map(ii))}return fs.lines=function(){return ls().map(function(To){return{type:"LineString",coordinates:To}})},fs.outline=function(){return{type:"Polygon",coordinates:[bo(_n).concat(os(Fa).slice(1),bo(kn).reverse().slice(1),os(Ai).reverse().slice(1))]}},fs.extent=function(To){return arguments.length?fs.extentMajor(To).extentMinor(To):fs.extentMinor()},fs.extentMajor=function(To){return arguments.length?(_n=+To[0][0],kn=+To[1][0],Ai=+To[0][1],Fa=+To[1][1],_n>kn&&(To=_n,_n=kn,kn=To),Ai>Fa&&(To=Ai,Ai=Fa,Fa=To),fs.precision(rs)):[[_n,Ai],[kn,Fa]]},fs.extentMinor=function(To){return arguments.length?(qr=+To[0][0],wr=+To[1][0],$a=+To[0][1],Qn=+To[1][1],qr>wr&&(To=qr,qr=wr,wr=To),$a>Qn&&(To=$a,$a=Qn,Qn=To),fs.precision(rs)):[[qr,$a],[wr,Qn]]},fs.step=function(To){return arguments.length?fs.stepMajor(To).stepMinor(To):fs.stepMinor()},fs.stepMajor=function(To){return arguments.length?(fi=+To[0],Yi=+To[1],fs):[fi,Yi]},fs.stepMinor=function(To){return arguments.length?(Ni=+To[0],ho=+To[1],fs):[Ni,ho]},fs.precision=function(To){return arguments.length?(rs=+To,bi=Bi($a,Qn,90),ii=Mo(qr,wr,rs),bo=Bi(Ai,Fa,90),os=Mo(_n,kn,rs),fs):rs},fs.extentMajor([[-180,-90+a],[180,90-a]]).extentMinor([[-180,-80-a],[180,80+a]])}function Qs(){return Jl()()}function as(wr,qr){var kn=wr[0]*d,_n=wr[1]*d,Qn=qr[0]*d,$a=qr[1]*d,Fa=f(_n),Ai=T(_n),Ni=f($a),ho=T($a),fi=Fa*f(kn),Yi=Fa*T(kn),bi=Ni*f(Qn),ii=Ni*T(Qn),bo=2*w(_(F($a-_n)+Fa*Ni*F(Qn-kn))),os=T(bo),rs=bo?function(fs){var ls=T(fs*=bo)/os,To=T(bo-fs)/os,ro=To*fi+ls*bi,Ts=To*Yi+ls*ii,il=To*Ai+ls*ho;return[C(Ts,ro)*p,C(il,_(ro*ro+Ts*Ts))*p]}:function(){return[kn*p,_n*p]};return rs.distance=bo,rs}function tu(wr){return wr}var dl=M(),Rl=M(),Gu,Eo,Os,ws,pu={point:z,lineStart:z,lineEnd:z,polygonStart:function(){pu.lineStart=vu,pu.lineEnd=zu},polygonEnd:function(){pu.lineStart=pu.lineEnd=pu.point=z,dl.add(y(Rl)),Rl.reset()},result:function(){var wr=dl/2;return dl.reset(),wr}};function vu(){pu.point=ts}function ts(wr,qr){pu.point=Iu,Gu=Os=wr,Eo=ws=qr}function Iu(wr,qr){Rl.add(ws*wr-Os*qr),Os=wr,ws=qr}function zu(){Iu(Gu,Eo)}var nl=1/0,Gl=nl,su=-nl,cu=su,vc={point:jf,lineStart:z,lineEnd:z,polygonStart:z,polygonEnd:z,result:function(){var wr=[[nl,Gl],[su,cu]];return su=cu=-(Gl=nl=1/0),wr}};function jf(wr,qr){wrsu&&(su=wr),qrcu&&(cu=qr)}var Tf=0,Rf=0,_d=0,ad=0,ql=0,cf=0,xd=0,Lc=0,mc=0,Rc,Df,xu,gc,ul={point:ru,lineStart:rh,lineEnd:Lu,polygonStart:function(){ul.lineStart=yp,ul.lineEnd=al},polygonEnd:function(){ul.point=ru,ul.lineStart=rh,ul.lineEnd=Lu},result:function(){var wr=mc?[xd/mc,Lc/mc]:cf?[ad/cf,ql/cf]:_d?[Tf/_d,Rf/_d]:[NaN,NaN];return Tf=Rf=_d=ad=ql=cf=xd=Lc=mc=0,wr}};function ru(wr,qr){Tf+=wr,Rf+=qr,++_d}function rh(){ul.point=Xc}function Xc(wr,qr){ul.point=ph,ru(xu=wr,gc=qr)}function ph(wr,qr){var kn=wr-xu,_n=qr-gc,Qn=_(kn*kn+_n*_n);ad+=Qn*(xu+wr)/2,ql+=Qn*(gc+qr)/2,cf+=Qn,ru(xu=wr,gc=qr)}function Lu(){ul.point=ru}function yp(){ul.point=Np}function al(){Ol(Rc,Df)}function Np(wr,qr){ul.point=Ol,ru(Rc=xu=wr,Df=gc=qr)}function Ol(wr,qr){var kn=wr-xu,_n=qr-gc,Qn=_(kn*kn+_n*_n);ad+=Qn*(xu+wr)/2,ql+=Qn*(gc+qr)/2,cf+=Qn,Qn=gc*wr-xu*qr,xd+=Qn*(xu+wr),Lc+=Qn*(gc+qr),mc+=Qn*3,ru(xu=wr,gc=qr)}function ns(wr){this._context=wr}ns.prototype={_radius:4.5,pointRadius:function(wr){return this._radius=wr,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(wr,qr){switch(this._point){case 0:{this._context.moveTo(wr,qr),this._point=1;break}case 1:{this._context.lineTo(wr,qr);break}default:{this._context.moveTo(wr+this._radius,qr),this._context.arc(wr,qr,this._radius,0,c);break}}},result:z};var zh=M(),Pf,ic,bd,vh,Wh,yc={point:z,lineStart:function(){yc.point=Jd},lineEnd:function(){Pf&&Ld(ic,bd),yc.point=z},polygonStart:function(){Pf=!0},polygonEnd:function(){Pf=null},result:function(){var wr=+zh;return zh.reset(),wr}};function Jd(wr,qr){yc.point=Ld,ic=vh=wr,bd=Wh=qr}function Ld(wr,qr){vh-=wr,Wh-=qr,zh.add(_(vh*vh+Wh*Wh)),vh=wr,Wh=qr}function Xh(){this._string=[]}Xh.prototype={_radius:4.5,_circle:mh(4.5),pointRadius:function(wr){return(wr=+wr)!==this._radius&&(this._radius=wr,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(wr,qr){switch(this._point){case 0:{this._string.push("M",wr,",",qr),this._point=1;break}case 1:{this._string.push("L",wr,",",qr);break}default:{this._circle==null&&(this._circle=mh(this._radius)),this._string.push("M",wr,",",qr,this._circle);break}}},result:function(){if(this._string.length){var wr=this._string.join("");return this._string=[],wr}else return null}};function mh(wr){return"m0,"+wr+"a"+wr+","+wr+" 0 1,1 0,"+-2*wr+"a"+wr+","+wr+" 0 1,1 0,"+2*wr+"z"}function wd(wr,qr){var kn=4.5,_n,Qn;function $a(Fa){return Fa&&(typeof kn=="function"&&Qn.pointRadius(+kn.apply(this,arguments)),H(Fa,_n(Qn))),Qn.result()}return $a.area=function(Fa){return H(Fa,_n(pu)),pu.result()},$a.measure=function(Fa){return H(Fa,_n(yc)),yc.result()},$a.bounds=function(Fa){return H(Fa,_n(vc)),vc.result()},$a.centroid=function(Fa){return H(Fa,_n(ul)),ul.result()},$a.projection=function(Fa){return arguments.length?(_n=Fa==null?(wr=null,tu):(wr=Fa).stream,$a):wr},$a.context=function(Fa){return arguments.length?(Qn=Fa==null?(qr=null,new Xh):new ns(qr=Fa),typeof kn!="function"&&Qn.pointRadius(kn),$a):qr},$a.pointRadius=function(Fa){return arguments.length?(kn=typeof Fa=="function"?Fa:(Qn.pointRadius(+Fa),+Fa),$a):kn},$a.projection(wr).context(qr)}function Td(wr){return{stream:zf(wr)}}function zf(wr){return function(qr){var kn=new Rd;for(var _n in wr)kn[_n]=wr[_n];return kn.stream=qr,kn}}function Rd(){}Rd.prototype={constructor:Rd,point:function(wr,qr){this.stream.point(wr,qr)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function nh(wr,qr,kn){var _n=wr.clipExtent&&wr.clipExtent();return wr.scale(150).translate([0,0]),_n!=null&&wr.clipExtent(null),H(kn,wr.stream(vc)),qr(vc.result()),_n!=null&&wr.clipExtent(_n),wr}function Gf(wr,qr,kn){return nh(wr,function(_n){var Qn=qr[1][0]-qr[0][0],$a=qr[1][1]-qr[0][1],Fa=Math.min(Qn/(_n[1][0]-_n[0][0]),$a/(_n[1][1]-_n[0][1])),Ai=+qr[0][0]+(Qn-Fa*(_n[1][0]+_n[0][0]))/2,Ni=+qr[0][1]+($a-Fa*(_n[1][1]+_n[0][1]))/2;wr.scale(150*Fa).translate([Ai,Ni])},kn)}function _c(wr,qr,kn){return Gf(wr,[[0,0],qr],kn)}function Ch(wr,qr,kn){return nh(wr,function(_n){var Qn=+qr,$a=Qn/(_n[1][0]-_n[0][0]),Fa=(Qn-$a*(_n[1][0]+_n[0][0]))/2,Ai=-$a*_n[0][1];wr.scale(150*$a).translate([Fa,Ai])},kn)}function Ad(wr,qr,kn){return nh(wr,function(_n){var Qn=+qr,$a=Qn/(_n[1][1]-_n[0][1]),Fa=-$a*_n[0][0],Ai=(Qn-$a*(_n[1][1]+_n[0][1]))/2;wr.scale(150*$a).translate([Fa,Ai])},kn)}var lu=16,id=f(30*d);function _p(wr,qr){return+qr?Yh(wr,qr):Dd(wr)}function Dd(wr){return zf({point:function(qr,kn){qr=wr(qr,kn),this.stream.point(qr[0],qr[1])}})}function Yh(wr,qr){function kn(_n,Qn,$a,Fa,Ai,Ni,ho,fi,Yi,bi,ii,bo,os,rs){var fs=ho-_n,ls=fi-Qn,To=fs*fs+ls*ls;if(To>4*qr&&os--){var ro=Fa+bi,Ts=Ai+ii,il=Ni+bo,Hl=_(ro*ro+Ts*Ts+il*il),mu=w(il/=Hl),Xl=y(y(il)-1)qr||y((fs*Hu+ls*fu)/To-.5)>.3||Fa*bi+Ai*ii+Ni*bo2?Vo[2]%360*d:0,Hu()):[Ai*p,Ni*p,ho*p]},wl.angle=function(Vo){return arguments.length?(Yi=Vo%360*d,Hu()):Yi*p},wl.reflectX=function(Vo){return arguments.length?(bi=Vo?-1:1,Hu()):bi<0},wl.reflectY=function(Vo){return arguments.length?(ii=Vo?-1:1,Hu()):ii<0},wl.precision=function(Vo){return arguments.length?(il=_p(Hl,Ts=Vo*Vo),fu()):_(Ts)},wl.fitExtent=function(Vo,Fs){return Gf(wl,Vo,Fs)},wl.fitSize=function(Vo,Fs){return _c(wl,Vo,Fs)},wl.fitWidth=function(Vo,Fs){return Ch(wl,Vo,Fs)},wl.fitHeight=function(Vo,Fs){return Ad(wl,Vo,Fs)};function Hu(){var Vo=Vu(kn,0,0,bi,ii,Yi).apply(null,qr($a,Fa)),Fs=(Yi?Vu:zd)(kn,_n-Vo[0],Qn-Vo[1],bi,ii,Yi);return fi=va(Ai,Ni,ho),Hl=In(qr,Fs),mu=In(fi,Hl),il=_p(Hl,Ts),fu()}function fu(){return Xl=gu=null,wl}return function(){return qr=wr.apply(this,arguments),wl.invert=qr.invert&&Zu,Hu()}}function bu(wr){var qr=0,kn=i/3,_n=gh(wr),Qn=_n(qr,kn);return Qn.parallels=function($a){return arguments.length?_n(qr=$a[0]*d,kn=$a[1]*d):[qr*p,kn*p]},Qn}function ah(wr){var qr=f(wr);function kn(_n,Qn){return[_n*qr,T(Qn)/qr]}return kn.invert=function(_n,Qn){return[_n/qr,w(Qn*qr)]},kn}function Vc(wr,qr){var kn=T(wr),_n=(kn+T(qr))/2;if(y(_n)=.12&&rs<.234&&os>=-.425&&os<-.214?Qn:rs>=.166&&rs<.234&&os>=-.214&&os<-.115?Fa:kn).invert(bi)},fi.stream=function(bi){return wr&&qr===bi?wr:wr=Nh([kn.stream(qr=bi),Qn.stream(bi),Fa.stream(bi)])},fi.precision=function(bi){return arguments.length?(kn.precision(bi),Qn.precision(bi),Fa.precision(bi),Yi()):kn.precision()},fi.scale=function(bi){return arguments.length?(kn.scale(bi),Qn.scale(bi*.35),Fa.scale(bi),fi.translate(kn.translate())):kn.scale()},fi.translate=function(bi){if(!arguments.length)return kn.translate();var ii=kn.scale(),bo=+bi[0],os=+bi[1];return _n=kn.translate(bi).clipExtent([[bo-.455*ii,os-.238*ii],[bo+.455*ii,os+.238*ii]]).stream(ho),$a=Qn.translate([bo-.307*ii,os+.201*ii]).clipExtent([[bo-.425*ii+a,os+.12*ii+a],[bo-.214*ii-a,os+.234*ii-a]]).stream(ho),Ai=Fa.translate([bo-.205*ii,os+.212*ii]).clipExtent([[bo-.214*ii+a,os+.166*ii+a],[bo-.115*ii-a,os+.234*ii-a]]).stream(ho),Yi()},fi.fitExtent=function(bi,ii){return Gf(fi,bi,ii)},fi.fitSize=function(bi,ii){return _c(fi,bi,ii)},fi.fitWidth=function(bi,ii){return Ch(fi,bi,ii)},fi.fitHeight=function(bi,ii){return Ad(fi,bi,ii)};function Yi(){return wr=qr=null,fi}return fi.scale(1070)}function yh(wr){return function(qr,kn){var _n=f(qr),Qn=f(kn),$a=wr(_n*Qn);return[$a*Qn*T(qr),$a*T(kn)]}}function od(wr){return function(qr,kn){var _n=_(qr*qr+kn*kn),Qn=wr(_n),$a=T(Qn),Fa=f(Qn);return[C(qr*$a,_n*Fa),w(_n&&kn*$a/_n)]}}var xp=yh(function(wr){return _(2/(1+wr))});xp.invert=od(function(wr){return 2*w(wr/2)});function Jp(){return hf(xp).scale(124.75).clipAngle(180-.001)}var Oh=yh(function(wr){return(wr=m(wr))&&wr/T(wr)});Oh.invert=od(function(wr){return wr});function sd(){return hf(Oh).scale(79.4188).clipAngle(180-.001)}function Af(wr,qr){return[wr,k(h((s+qr)/2))]}Af.invert=function(wr,qr){return[wr,2*g(A(qr))-s]};function ld(){return Dc(Af).scale(961/c)}function Dc(wr){var qr=hf(wr),kn=qr.center,_n=qr.scale,Qn=qr.translate,$a=qr.clipExtent,Fa=null,Ai,Ni,ho;qr.scale=function(Yi){return arguments.length?(_n(Yi),fi()):_n()},qr.translate=function(Yi){return arguments.length?(Qn(Yi),fi()):Qn()},qr.center=function(Yi){return arguments.length?(kn(Yi),fi()):kn()},qr.clipExtent=function(Yi){return arguments.length?(Yi==null?Fa=Ai=Ni=ho=null:(Fa=+Yi[0][0],Ai=+Yi[0][1],Ni=+Yi[1][0],ho=+Yi[1][1]),fi()):Fa==null?null:[[Fa,Ai],[Ni,ho]]};function fi(){var Yi=i*_n(),bi=qr(Wa(qr.rotate()).invert([0,0]));return $a(Fa==null?[[bi[0]-Yi,bi[1]-Yi],[bi[0]+Yi,bi[1]+Yi]]:wr===Af?[[Math.max(bi[0]-Yi,Fa),Ai],[Math.min(bi[0]+Yi,Ni),ho]]:[[Fa,Math.max(bi[1]-Yi,Ai)],[Ni,Math.min(bi[1]+Yi,ho)]])}return fi()}function Fh(wr){return h((s+wr)/2)}function Nd(wr,qr){var kn=f(wr),_n=wr===qr?T(wr):k(kn/f(qr))/k(Fh(qr)/Fh(wr)),Qn=kn*I(Fh(wr),_n)/_n;if(!_n)return Af;function $a(Fa,Ai){Qn>0?Ai<-s+a&&(Ai=-s+a):Ai>s-a&&(Ai=s-a);var Ni=Qn/I(Fh(Ai),_n);return[Ni*T(_n*Fa),Qn-Ni*f(_n*Fa)]}return $a.invert=function(Fa,Ai){var Ni=Qn-Ai,ho=E(_n)*_(Fa*Fa+Ni*Ni),fi=C(Fa,y(Ni))*E(Ni);return Ni*_n<0&&(fi-=i*E(Fa)*E(Ni)),[fi/_n,2*g(I(Qn/ho,1/_n))-s]},$a}function Bh(){return bu(Nd).scale(109.5).parallels([30,30])}function Au(wr,qr){return[wr,qr]}Au.invert=Au;function pf(){return hf(Au).scale(152.63)}function Nf(wr,qr){var kn=f(wr),_n=wr===qr?T(wr):(kn-f(qr))/(qr-wr),Qn=kn/_n+wr;if(y(_n)a&&--_n>0);return[wr/(.8707+($a=kn*kn)*(-.131979+$a*(-.013791+$a*$a*$a*(.003971-.001529*$a)))),kn]};function Wf(){return hf(ih).scale(175.295)}function qu(wr,qr){return[f(qr)*T(wr),T(qr)]}qu.invert=od(w);function Yc(){return hf(qu).scale(249.5).clipAngle(90+a)}function Nu(wr,qr){var kn=f(qr),_n=1+f(wr)*kn;return[kn*T(wr)/_n,T(qr)/_n]}Nu.invert=od(function(wr){return 2*g(wr)});function xh(){return hf(Nu).scale(250).clipAngle(142)}function Xf(wr,qr){return[k(h((s+qr)/2)),-wr]}Xf.invert=function(wr,qr){return[-qr,2*g(A(wr))-s]};function Ed(){var wr=Dc(Xf),qr=wr.center,kn=wr.rotate;return wr.center=function(_n){return arguments.length?qr([-_n[1],_n[0]]):(_n=qr(),[_n[1],-_n[0]])},wr.rotate=function(_n){return arguments.length?kn([_n[0],_n[1],_n.length>2?_n[2]+90:90]):(_n=kn(),[_n[0],_n[1],_n[2]-90])},kn([0,0,90]).scale(159.155)}v.geoAlbers=Ru,v.geoAlbersUsa=qf,v.geoArea=Z,v.geoAzimuthalEqualArea=Jp,v.geoAzimuthalEqualAreaRaw=xp,v.geoAzimuthalEquidistant=sd,v.geoAzimuthalEquidistantRaw=Oh,v.geoBounds=et,v.geoCentroid=an,v.geoCircle=Qi,v.geoClipAntimeridian=Xr,v.geoClipCircle=na,v.geoClipExtent=to,v.geoClipRectangle=Ga,v.geoConicConformal=Bh,v.geoConicConformalRaw=Nd,v.geoConicEqualArea=df,v.geoConicEqualAreaRaw=Vc,v.geoConicEquidistant=Sd,v.geoConicEquidistantRaw=Nf,v.geoContains=Ws,v.geoDistance=ll,v.geoEqualEarth=bp,v.geoEqualEarthRaw=Jh,v.geoEquirectangular=pf,v.geoEquirectangularRaw=Au,v.geoGnomonic=Od,v.geoGnomonicRaw=Oc,v.geoGraticule=Jl,v.geoGraticule10=Qs,v.geoIdentity=Ef,v.geoInterpolate=as,v.geoLength=ys,v.geoMercator=ld,v.geoMercatorRaw=Af,v.geoNaturalEarth1=Wf,v.geoNaturalEarth1Raw=ih,v.geoOrthographic=Yc,v.geoOrthographicRaw=qu,v.geoPath=wd,v.geoProjection=hf,v.geoProjectionMutator=gh,v.geoRotation=Wa,v.geoStereographic=xh,v.geoStereographicRaw=Nu,v.geoStream=H,v.geoTransform=Td,v.geoTransverseMercator=Ed,v.geoTransverseMercatorRaw=Xf,Object.defineProperty(v,"__esModule",{value:!0})})}}),vX=Re({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(ae,K){(function(v,S){typeof ae=="object"&&typeof K<"u"?S(ae,fF(),GI()):S(v.d3=v.d3||{},v.d3,v.d3)})(ae,function(v,S,M){var L=Math.abs,t=Math.atan,r=Math.atan2,a=Math.cos,l=Math.exp,i=Math.floor,s=Math.log,o=Math.max,c=Math.min,p=Math.pow,d=Math.round,y=Math.sign||function(ot){return ot>0?1:ot<0?-1:0},g=Math.sin,C=Math.tan,f=1e-6,x=1e-12,A=Math.PI,k=A/2,I=A/4,T=Math.SQRT1_2,E=V(2),_=V(A),h=A*2,m=180/A,w=A/180;function F(ot){return ot?ot/Math.sin(ot):1}function z(ot){return ot>1?k:ot<-1?-k:Math.asin(ot)}function U(ot){return ot>1?0:ot<-1?A:Math.acos(ot)}function V(ot){return ot>0?Math.sqrt(ot):0}function G(ot){return ot=l(2*ot),(ot-1)/(ot+1)}function j(ot){return(l(ot)-l(-ot))/2}function O(ot){return(l(ot)+l(-ot))/2}function H(ot){return s(ot+V(ot*ot+1))}function W(ot){return s(ot+V(ot*ot-1))}function ee(ot){var dt=C(ot/2),St=2*s(a(ot/2))/(dt*dt);function Rt(Yt,Ut){var er=a(Yt),Mr=a(Ut),Nr=g(Ut),jr=Mr*er,sn=-((1-jr?s((1+jr)/2)/(1-jr):-.5)+St/(1+jr));return[sn*Mr*g(Yt),sn*Nr]}return Rt.invert=function(Yt,Ut){var er=V(Yt*Yt+Ut*Ut),Mr=-ot/2,Nr=50,jr;if(!er)return[0,0];do{var sn=Mr/2,xn=a(sn),$n=g(sn),Wn=$n/xn,ua=-s(L(xn));Mr-=jr=(2/Wn*ua-St*Wn-er)/(-ua/($n*$n)+1-St/(2*xn*xn))*(xn<0?.7:1)}while(L(jr)>f&&--Nr>0);var Ua=g(Mr);return[r(Yt*Ua,er*a(Mr)),z(Ut*Ua/er)]},Rt}function ue(){var ot=k,dt=S.geoProjectionMutator(ee),St=dt(ot);return St.radius=function(Rt){return arguments.length?dt(ot=Rt*w):ot*m},St.scale(179.976).clipAngle(147)}function xe(ot,dt){var St=a(dt),Rt=F(U(St*a(ot/=2)));return[2*St*g(ot)*Rt,g(dt)*Rt]}xe.invert=function(ot,dt){if(!(ot*ot+4*dt*dt>A*A+f)){var St=ot,Rt=dt,Yt=25;do{var Ut=g(St),er=g(St/2),Mr=a(St/2),Nr=g(Rt),jr=a(Rt),sn=g(2*Rt),xn=Nr*Nr,$n=jr*jr,Wn=er*er,ua=1-$n*Mr*Mr,Ua=ua?U(jr*Mr)*V(Si=1/ua):Si=0,Si,gi=2*Ua*jr*er-ot,Mi=Ua*Nr-dt,Ao=Si*($n*Wn+Ua*jr*Mr*xn),qo=Si*(.5*Ut*sn-Ua*2*Nr*er),Bo=Si*.25*(sn*er-Ua*Nr*$n*Ut),vs=Si*(xn*Mr+Ua*Wn*jr),ml=qo*Bo-vs*Ao;if(!ml)break;var yl=(Mi*qo-gi*vs)/ml,Xs=(gi*Bo-Mi*Ao)/ml;St-=yl,Rt-=Xs}while((L(yl)>f||L(Xs)>f)&&--Yt>0);return[St,Rt]}};function ge(){return S.geoProjection(xe).scale(152.63)}function _e(ot){var dt=g(ot),St=a(ot),Rt=ot>=0?1:-1,Yt=C(Rt*ot),Ut=(1+dt-St)/2;function er(Mr,Nr){var jr=a(Nr),sn=a(Mr/=2);return[(1+jr)*g(Mr),(Rt*Nr>-r(sn,Yt)-.001?0:-Rt*10)+Ut+g(Nr)*St-(1+jr)*dt*sn]}return er.invert=function(Mr,Nr){var jr=0,sn=0,xn=50;do{var $n=a(jr),Wn=g(jr),ua=a(sn),Ua=g(sn),Si=1+ua,gi=Si*Wn-Mr,Mi=Ut+Ua*St-Si*dt*$n-Nr,Ao=Si*$n/2,qo=-Wn*Ua,Bo=dt*Si*Wn/2,vs=St*ua+dt*$n*Ua,ml=qo*Bo-vs*Ao,yl=(Mi*qo-gi*vs)/ml/2,Xs=(gi*Bo-Mi*Ao)/ml;L(Xs)>2&&(Xs/=2),jr-=yl,sn-=Xs}while((L(yl)>f||L(Xs)>f)&&--xn>0);return Rt*sn>-r(a(jr),Yt)-.001?[jr*2,sn]:null},er}function Y(){var ot=20*w,dt=ot>=0?1:-1,St=C(dt*ot),Rt=S.geoProjectionMutator(_e),Yt=Rt(ot),Ut=Yt.stream;return Yt.parallel=function(er){return arguments.length?(St=C((dt=(ot=er*w)>=0?1:-1)*ot),Rt(ot)):ot*m},Yt.stream=function(er){var Mr=Yt.rotate(),Nr=Ut(er),jr=(Yt.rotate([0,0]),Ut(er)),sn=Yt.precision();return Yt.rotate(Mr),Nr.sphere=function(){jr.polygonStart(),jr.lineStart();for(var xn=dt*-180;dt*xn<180;xn+=dt*90)jr.point(xn,dt*90);if(ot)for(;dt*(xn-=3*dt*sn)>=-180;)jr.point(xn,dt*-r(a(xn*w/2),St)*m);jr.lineEnd(),jr.polygonEnd()},Nr},Yt.scale(218.695).center([0,28.0974])}function se(ot,dt){var St=C(dt/2),Rt=V(1-St*St),Yt=1+Rt*a(ot/=2),Ut=g(ot)*Rt/Yt,er=St/Yt,Mr=Ut*Ut,Nr=er*er;return[4/3*Ut*(3+Mr-3*Nr),4/3*er*(3+3*Mr-Nr)]}se.invert=function(ot,dt){if(ot*=3/8,dt*=3/8,!ot&&L(dt)>1)return null;var St=ot*ot,Rt=dt*dt,Yt=1+St+Rt,Ut=V((Yt-V(Yt*Yt-4*dt*dt))/2),er=z(Ut)/3,Mr=Ut?W(L(dt/Ut))/3:H(L(ot))/3,Nr=a(er),jr=O(Mr),sn=jr*jr-Nr*Nr;return[y(ot)*2*r(j(Mr)*Nr,.25-sn),y(dt)*2*r(jr*g(er),.25+sn)]};function ce(){return S.geoProjection(se).scale(66.1603)}var ne=V(8),ye=s(1+E);function le(ot,dt){var St=L(dt);return Stx&&--Rt>0);return[ot/(a(St)*(ne-1/g(St))),y(dt)*St]};function Z(){return S.geoProjection(le).scale(112.314)}function de(ot){var dt=2*A/ot;function St(Rt,Yt){var Ut=S.geoAzimuthalEquidistantRaw(Rt,Yt);if(L(Rt)>k){var er=r(Ut[1],Ut[0]),Mr=V(Ut[0]*Ut[0]+Ut[1]*Ut[1]),Nr=dt*d((er-k)/dt)+k,jr=r(g(er-=Nr),2-a(er));er=Nr+z(A/Mr*g(jr))-jr,Ut[0]=Mr*a(er),Ut[1]=Mr*g(er)}return Ut}return St.invert=function(Rt,Yt){var Ut=V(Rt*Rt+Yt*Yt);if(Ut>k){var er=r(Yt,Rt),Mr=dt*d((er-k)/dt)+k,Nr=er>Mr?-1:1,jr=Ut*a(Mr-er),sn=1/C(Nr*U((jr-A)/V(A*(A-2*jr)+Ut*Ut)));er=Mr+2*t((sn+Nr*V(sn*sn-3))/3),Rt=Ut*a(er),Yt=Ut*g(er)}return S.geoAzimuthalEquidistantRaw.invert(Rt,Yt)},St}function pe(){var ot=5,dt=S.geoProjectionMutator(de),St=dt(ot),Rt=St.stream,Yt=.01,Ut=-a(Yt*w),er=g(Yt*w);return St.lobes=function(Mr){return arguments.length?dt(ot=+Mr):ot},St.stream=function(Mr){var Nr=St.rotate(),jr=Rt(Mr),sn=(St.rotate([0,0]),Rt(Mr));return St.rotate(Nr),jr.sphere=function(){sn.polygonStart(),sn.lineStart();for(var xn=0,$n=360/ot,Wn=2*A/ot,ua=90-180/ot,Ua=k;xn0&&L(Yt)>f);return Rt<0?NaN:St}function Xe(ot,dt,St){return dt===void 0&&(dt=40),St===void 0&&(St=x),function(Rt,Yt,Ut,er){var Mr,Nr,jr;Ut=Ut===void 0?0:+Ut,er=er===void 0?0:+er;for(var sn=0;snMr){Ut-=Nr/=2,er-=jr/=2;continue}Mr=ua;var Ua=(Ut>0?-1:1)*St,Si=(er>0?-1:1)*St,gi=ot(Ut+Ua,er),Mi=ot(Ut,er+Si),Ao=(gi[0]-xn[0])/Ua,qo=(gi[1]-xn[1])/Ua,Bo=(Mi[0]-xn[0])/Si,vs=(Mi[1]-xn[1])/Si,ml=vs*Ao-qo*Bo,yl=(L(ml)<.5?.5:1)/ml;if(Nr=(Wn*Bo-$n*vs)*yl,jr=($n*qo-Wn*Ao)*yl,Ut+=Nr,er+=jr,L(Nr)0&&(Mr[1]*=1+Nr/1.5*Mr[0]*Mr[0]),Mr}return Rt.invert=Xe(Rt),Rt}function yt(){return S.geoProjection(it()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function bt(ot,dt){var St=ot*g(dt),Rt=30,Yt;do dt-=Yt=(dt+g(dt)-St)/(1+a(dt));while(L(Yt)>f&&--Rt>0);return dt/2}function mt(ot,dt,St){function Rt(Yt,Ut){return[ot*Yt*a(Ut=bt(St,Ut)),dt*g(Ut)]}return Rt.invert=function(Yt,Ut){return Ut=z(Ut/dt),[Yt/(ot*a(Ut)),z((2*Ut+g(2*Ut))/St)]},Rt}var ht=mt(E/k,E,A);function Ve(){return S.geoProjection(ht).scale(169.529)}var ze=2.00276,Se=1.11072;function Je(ot,dt){var St=bt(A,dt);return[ze*ot/(1/a(dt)+Se/a(St)),(dt+E*g(St))/ze]}Je.invert=function(ot,dt){var St=ze*dt,Rt=dt<0?-I:I,Yt=25,Ut,er;do er=St-E*g(Rt),Rt-=Ut=(g(2*Rt)+2*Rt-A*g(er))/(2*a(2*Rt)+2+A*a(er)*E*a(Rt));while(L(Ut)>f&&--Yt>0);return er=St-E*g(Rt),[ot*(1/a(er)+Se/a(Rt))/ze,er]};function _t(){return S.geoProjection(Je).scale(160.857)}function At(ot){var dt=0,St=S.geoProjectionMutator(ot),Rt=St(dt);return Rt.parallel=function(Yt){return arguments.length?St(dt=Yt*w):dt*m},Rt}function vt(ot,dt){return[ot*a(dt),dt]}vt.invert=function(ot,dt){return[ot/a(dt),dt]};function Kt(){return S.geoProjection(vt).scale(152.63)}function Qt(ot){if(!ot)return vt;var dt=1/C(ot);function St(Rt,Yt){var Ut=dt+ot-Yt,er=Ut&&Rt*a(Yt)/Ut;return[Ut*g(er),dt-Ut*a(er)]}return St.invert=function(Rt,Yt){var Ut=V(Rt*Rt+(Yt=dt-Yt)*Yt),er=dt+ot-Ut;return[Ut/a(er)*r(Rt,Yt),er]},St}function fr(){return At(Qt).scale(123.082).center([0,26.1441]).parallel(45)}function mr(ot){function dt(St,Rt){var Yt=k-Rt,Ut=Yt&&St*ot*g(Yt)/Yt;return[Yt*g(Ut)/ot,k-Yt*a(Ut)]}return dt.invert=function(St,Rt){var Yt=St*ot,Ut=k-Rt,er=V(Yt*Yt+Ut*Ut),Mr=r(Yt,Ut);return[(er?er/g(er):1)*Mr/ot,k-er]},dt}function Ur(){var ot=.5,dt=S.geoProjectionMutator(mr),St=dt(ot);return St.fraction=function(Rt){return arguments.length?dt(ot=+Rt):ot},St.scale(158.837)}var Br=mt(1,4/A,A);function fn(){return S.geoProjection(Br).scale(152.63)}function Fr(ot,dt,St,Rt,Yt,Ut){var er=a(Ut),Mr;if(L(ot)>1||L(Ut)>1)Mr=U(St*Yt+dt*Rt*er);else{var Nr=g(ot/2),jr=g(Ut/2);Mr=2*z(V(Nr*Nr+dt*Rt*jr*jr))}return L(Mr)>f?[Mr,r(Rt*g(Ut),dt*Yt-St*Rt*er)]:[0,0]}function Qr(ot,dt,St){return U((ot*ot+dt*dt-St*St)/(2*ot*dt))}function Bt(ot){return ot-2*A*i((ot+A)/(2*A))}function et(ot,dt,St){for(var Rt=[[ot[0],ot[1],g(ot[1]),a(ot[1])],[dt[0],dt[1],g(dt[1]),a(dt[1])],[St[0],St[1],g(St[1]),a(St[1])]],Yt=Rt[2],Ut,er=0;er<3;++er,Yt=Ut)Ut=Rt[er],Yt.v=Fr(Ut[1]-Yt[1],Yt[3],Yt[2],Ut[3],Ut[2],Ut[0]-Yt[0]),Yt.point=[0,0];var Mr=Qr(Rt[0].v[0],Rt[2].v[0],Rt[1].v[0]),Nr=Qr(Rt[0].v[0],Rt[1].v[0],Rt[2].v[0]),jr=A-Mr;Rt[2].point[1]=0,Rt[0].point[0]=-(Rt[1].point[0]=Rt[0].v[0]/2);var sn=[Rt[2].point[0]=Rt[0].point[0]+Rt[2].v[0]*a(Mr),2*(Rt[0].point[1]=Rt[1].point[1]=Rt[2].v[0]*g(Mr))];function xn($n,Wn){var ua=g(Wn),Ua=a(Wn),Si=new Array(3),gi;for(gi=0;gi<3;++gi){var Mi=Rt[gi];if(Si[gi]=Fr(Wn-Mi[1],Mi[3],Mi[2],Ua,ua,$n-Mi[0]),!Si[gi][0])return Mi.point;Si[gi][1]=Bt(Si[gi][1]-Mi.v[1])}var Ao=sn.slice();for(gi=0;gi<3;++gi){var qo=gi==2?0:gi+1,Bo=Qr(Rt[gi].v[0],Si[gi][0],Si[qo][0]);Si[gi][1]<0&&(Bo=-Bo),gi?gi==1?(Bo=Nr-Bo,Ao[0]-=Si[gi][0]*a(Bo),Ao[1]-=Si[gi][0]*g(Bo)):(Bo=jr-Bo,Ao[0]+=Si[gi][0]*a(Bo),Ao[1]+=Si[gi][0]*g(Bo)):(Ao[0]+=Si[gi][0]*a(Bo),Ao[1]-=Si[gi][0]*g(Bo))}return Ao[0]/=3,Ao[1]/=3,Ao}return xn}function ut(ot){return ot[0]*=w,ot[1]*=w,ot}function Be(){return Ie([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function Ie(ot,dt,St){var Rt=S.geoCentroid({type:"MultiPoint",coordinates:[ot,dt,St]}),Yt=[-Rt[0],-Rt[1]],Ut=S.geoRotation(Yt),er=et(ut(Ut(ot)),ut(Ut(dt)),ut(Ut(St)));er.invert=Xe(er);var Mr=S.geoProjection(er).rotate(Yt),Nr=Mr.center;return delete Mr.rotate,Mr.center=function(jr){return arguments.length?Nr(Ut(jr)):Ut.invert(Nr())},Mr.clipAngle(90)}function ke(ot,dt){var St=V(1-g(dt));return[2/_*ot*St,_*(1-St)]}ke.invert=function(ot,dt){var St=(St=dt/_-1)*St;return[St>0?ot*V(A/St)/2:0,z(1-St)]};function Fe(){return S.geoProjection(ke).scale(95.6464).center([0,30])}function at(ot){var dt=C(ot);function St(Rt,Yt){return[Rt,(Rt?Rt/g(Rt):1)*(g(Yt)*a(Rt)-dt*a(Yt))]}return St.invert=dt?function(Rt,Yt){Rt&&(Yt*=g(Rt)/Rt);var Ut=a(Rt);return[Rt,2*r(V(Ut*Ut+dt*dt-Yt*Yt)-Ut,dt-Yt)]}:function(Rt,Yt){return[Rt,z(Rt?Yt*C(Rt)/Rt:Yt)]},St}function ct(){return At(at).scale(249.828).clipAngle(90)}var Gt=V(3);function Vt(ot,dt){return[Gt*ot*(2*a(2*dt/3)-1)/_,Gt*_*g(dt/3)]}Vt.invert=function(ot,dt){var St=3*z(dt/(Gt*_));return[_*ot/(Gt*(2*a(2*St/3)-1)),St]};function Zt(){return S.geoProjection(Vt).scale(156.19)}function ur(ot){var dt=a(ot);function St(Rt,Yt){return[Rt*dt,g(Yt)/dt]}return St.invert=function(Rt,Yt){return[Rt/dt,z(Yt*dt)]},St}function Dr(){return At(ur).parallel(38.58).scale(195.044)}function kr(ot){var dt=a(ot);function St(Rt,Yt){return[Rt*dt,(1+dt)*C(Yt/2)]}return St.invert=function(Rt,Yt){return[Rt/dt,t(Yt/(1+dt))*2]},St}function Sr(){return At(kr).scale(124.75)}function Jr(ot,dt){var St=V(8/(3*A));return[St*ot*(1-L(dt)/A),St*dt]}Jr.invert=function(ot,dt){var St=V(8/(3*A)),Rt=dt/St;return[ot/(St*(1-L(Rt)/A)),Rt]};function jn(){return S.geoProjection(Jr).scale(165.664)}function ha(ot,dt){var St=V(4-3*g(L(dt)));return[2/V(6*A)*ot*St,y(dt)*V(2*A/3)*(2-St)]}ha.invert=function(ot,dt){var St=2-L(dt)/V(2*A/3);return[ot*V(6*A)/(2*St),y(dt)*z((4-St*St)/3)]};function oa(){return S.geoProjection(ha).scale(165.664)}function _a(ot,dt){var St=V(A*(4+A));return[2/St*ot*(1+V(1-4*dt*dt/(A*A))),4/St*dt]}_a.invert=function(ot,dt){var St=V(A*(4+A))/2;return[ot*St/(1+V(1-dt*dt*(4+A)/(4*A))),dt*St/2]};function xa(){return S.geoProjection(_a).scale(180.739)}function ra(ot,dt){var St=(2+k)*g(dt);dt/=2;for(var Rt=0,Yt=1/0;Rt<10&&L(Yt)>f;Rt++){var Ut=a(dt);dt-=Yt=(dt+g(dt)*(Ut+2)-St)/(2*Ut*(1+Ut))}return[2/V(A*(4+A))*ot*(1+a(dt)),2*V(A/(4+A))*g(dt)]}ra.invert=function(ot,dt){var St=dt*V((4+A)/A)/2,Rt=z(St),Yt=a(Rt);return[ot/(2/V(A*(4+A))*(1+Yt)),z((Rt+St*(Yt+2))/(2+k))]};function Ha(){return S.geoProjection(ra).scale(180.739)}function ci(ot,dt){return[ot*(1+a(dt))/V(2+A),2*dt/V(2+A)]}ci.invert=function(ot,dt){var St=V(2+A),Rt=dt*St/2;return[St*ot/(1+a(Rt)),Rt]};function _r(){return S.geoProjection(ci).scale(173.044)}function rr(ot,dt){for(var St=(1+k)*g(dt),Rt=0,Yt=1/0;Rt<10&&L(Yt)>f;Rt++)dt-=Yt=(dt+g(dt)-St)/(1+a(dt));return St=V(2+A),[ot*(1+a(dt))/St,2*dt/St]}rr.invert=function(ot,dt){var St=1+k,Rt=V(St/2);return[ot*2*Rt/(1+a(dt*=Rt)),z((dt+g(dt))/St)]};function yr(){return S.geoProjection(rr).scale(173.044)}var br=3+2*E;function an(ot,dt){var St=g(ot/=2),Rt=a(ot),Yt=V(a(dt)),Ut=a(dt/=2),er=g(dt)/(Ut+E*Rt*Yt),Mr=V(2/(1+er*er)),Nr=V((E*Ut+(Rt+St)*Yt)/(E*Ut+(Rt-St)*Yt));return[br*(Mr*(Nr-1/Nr)-2*s(Nr)),br*(Mr*er*(Nr+1/Nr)-2*t(er))]}an.invert=function(ot,dt){if(!(Ut=se.invert(ot/1.2,dt*1.065)))return null;var St=Ut[0],Rt=Ut[1],Yt=20,Ut;ot/=br,dt/=br;do{var er=St/2,Mr=Rt/2,Nr=g(er),jr=a(er),sn=g(Mr),xn=a(Mr),$n=a(Rt),Wn=V($n),ua=sn/(xn+E*jr*Wn),Ua=ua*ua,Si=V(2/(1+Ua)),gi=E*xn+(jr+Nr)*Wn,Mi=E*xn+(jr-Nr)*Wn,Ao=gi/Mi,qo=V(Ao),Bo=qo-1/qo,vs=qo+1/qo,ml=Si*Bo-2*s(qo)-ot,yl=Si*ua*vs-2*t(ua)-dt,Xs=sn&&T*Wn*Nr*Ua/sn,Sl=(E*jr*xn+Wn)/(2*(xn+E*jr*Wn)*(xn+E*jr*Wn)*Wn),Ou=-.5*ua*Si*Si*Si,Su=Ou*Xs,Ys=Ou*Sl,Zs=(Zs=2*xn+E*Wn*(jr-Nr))*Zs*qo,Qu=(E*jr*xn*Wn+$n)/Zs,Pc=-(E*Nr*sn)/(Wn*Zs),mf=Bo*Su-2*Qu/qo+Si*(Qu+Qu/Ao),Ce=Bo*Ys-2*Pc/qo+Si*(Pc+Pc/Ao),Ye=ua*vs*Su-2*Xs/(1+Ua)+Si*vs*Xs+Si*ua*(Qu-Qu/Ao),pt=ua*vs*Ys-2*Sl/(1+Ua)+Si*vs*Sl+Si*ua*(Pc-Pc/Ao),Dt=Ce*Ye-pt*mf;if(!Dt)break;var Ot=(yl*Ce-ml*pt)/Dt,Wt=(ml*Ye-yl*mf)/Dt;St-=Ot,Rt=o(-k,c(k,Rt-Wt))}while((L(Ot)>f||L(Wt)>f)&&--Yt>0);return L(L(Rt)-k)Rt){var xn=V(sn),$n=r(jr,Nr),Wn=St*d($n/St),ua=$n-Wn,Ua=ot*a(ua),Si=(ot*g(ua)-ua*g(Ua))/(k-Ua),gi=Lt(ua,Si),Mi=(A-ot)/$r(gi,Ua,A);Nr=xn;var Ao=50,qo;do Nr-=qo=(ot+$r(gi,Ua,Nr)*Mi-xn)/(gi(Nr)*Mi);while(L(qo)>f&&--Ao>0);jr=ua*g(Nr),NrRt){var Nr=V(Mr),jr=r(er,Ut),sn=St*d(jr/St),xn=jr-sn;Ut=Nr*a(xn),er=Nr*g(xn);for(var $n=Ut-k,Wn=g(Ut),ua=er/Wn,Ua=Utf||L(ua)>f)&&--Ua>0);return[xn,$n]},Nr}var Wr=rn(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function tn(){return S.geoProjection(Wr).scale(149.995)}var wn=rn(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function dn(){return S.geoProjection(wn).scale(153.93)}var Nt=rn(5/6*A,-.62636,-.0344,0,1.3493,-.05524,0,.045);function xr(){return S.geoProjection(Nt).scale(130.945)}function Xr(ot,dt){var St=ot*ot,Rt=dt*dt;return[ot*(1-.162388*Rt)*(.87-952426e-9*St*St),dt*(1+Rt/12)]}Xr.invert=function(ot,dt){var St=ot,Rt=dt,Yt=50,Ut;do{var er=Rt*Rt;Rt-=Ut=(Rt*(1+er/12)-dt)/(1+er/4)}while(L(Ut)>f&&--Yt>0);Yt=50,ot/=1-.162388*er;do{var Mr=(Mr=St*St)*Mr;St-=Ut=(St*(.87-952426e-9*Mr)-ot)/(.87-.00476213*Mr)}while(L(Ut)>f&&--Yt>0);return[St,Rt]};function Tn(){return S.geoProjection(Xr).scale(131.747)}var Xn=rn(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function ia(){return S.geoProjection(Xn).scale(131.087)}function na(ot){var dt=ot(k,0)[0]-ot(-k,0)[0];function St(Rt,Yt){var Ut=Rt>0?-.5:.5,er=ot(Rt+Ut*A,Yt);return er[0]-=Ut*dt,er}return ot.invert&&(St.invert=function(Rt,Yt){var Ut=Rt>0?-.5:.5,er=ot.invert(Rt+Ut*dt,Yt),Mr=er[0]-Ut*A;return Mr<-A?Mr+=2*A:Mr>A&&(Mr-=2*A),er[0]=Mr,er}),St}function An(ot,dt){var St=y(ot),Rt=y(dt),Yt=a(dt),Ut=a(ot)*Yt,er=g(ot)*Yt,Mr=g(Rt*dt);ot=L(r(er,Mr)),dt=z(Ut),L(ot-k)>f&&(ot%=k);var Nr=Yn(ot>A/4?k-ot:ot,dt);return ot>A/4&&(Mr=Nr[0],Nr[0]=-Nr[1],Nr[1]=-Mr),Nr[0]*=St,Nr[1]*=-Rt,Nr}An.invert=function(ot,dt){L(ot)>1&&(ot=y(ot)*2-ot),L(dt)>1&&(dt=y(dt)*2-dt);var St=y(ot),Rt=y(dt),Yt=-St*ot,Ut=-Rt*dt,er=Ut/Yt<1,Mr=qi(er?Ut:Yt,er?Yt:Ut),Nr=Mr[0],jr=Mr[1],sn=a(jr);return er&&(Nr=-k-Nr),[St*(r(g(Nr)*sn,-g(jr))+A),Rt*z(a(Nr)*sn)]};function Yn(ot,dt){if(dt===k)return[0,0];var St=g(dt),Rt=St*St,Yt=Rt*Rt,Ut=1+Yt,er=1+3*Yt,Mr=1-Yt,Nr=z(1/V(Ut)),jr=Mr+Rt*Ut*Nr,sn=(1-St)/jr,xn=V(sn),$n=sn*Ut,Wn=V($n),ua=xn*Mr,Ua,Si;if(ot===0)return[0,-(ua+Rt*Wn)];var gi=a(dt),Mi=1/gi,Ao=2*St*gi,qo=(-3*Rt+Nr*er)*Ao,Bo=(-jr*gi-(1-St)*qo)/(jr*jr),vs=.5*Bo/xn,ml=Mr*vs-2*Rt*xn*Ao,yl=Rt*Ut*Bo+sn*er*Ao,Xs=-Mi*Ao,Sl=-Mi*yl,Ou=-2*Mi*ml,Su=4*ot/A,Ys;if(ot>.222*A||dt.175*A){if(Ua=(ua+Rt*V($n*(1+Yt)-ua*ua))/(1+Yt),ot>A/4)return[Ua,Ua];var Zs=Ua,Qu=.5*Ua;Ua=.5*(Qu+Zs),Si=50;do{var Pc=V($n-Ua*Ua),mf=Ua*(Ou+Xs*Pc)+Sl*z(Ua/Wn)-Su;if(!mf)break;mf<0?Qu=Ua:Zs=Ua,Ua=.5*(Qu+Zs)}while(L(Zs-Qu)>f&&--Si>0)}else{Ua=f,Si=25;do{var Ce=Ua*Ua,Ye=V($n-Ce),pt=Ou+Xs*Ye,Dt=Ua*pt+Sl*z(Ua/Wn)-Su,Ot=pt+(Sl-Xs*Ce)/Ye;Ua-=Ys=Ye?Dt/Ot:0}while(L(Ys)>f&&--Si>0)}return[Ua,-ua-Rt*V($n-Ua*Ua)]}function qi(ot,dt){for(var St=0,Rt=1,Yt=.5,Ut=50;;){var er=Yt*Yt,Mr=V(Yt),Nr=z(1/V(1+er)),jr=1-er+Yt*(1+er)*Nr,sn=(1-Mr)/jr,xn=V(sn),$n=sn*(1+er),Wn=xn*(1-er),ua=$n-ot*ot,Ua=V(ua),Si=dt+Wn+Yt*Ua;if(L(Rt-St)0?St=Yt:Rt=Yt,Yt=.5*(St+Rt)}if(!Ut)return null;var gi=z(Mr),Mi=a(gi),Ao=1/Mi,qo=2*Mr*Mi,Bo=(-3*Yt+Nr*(1+3*er))*qo,vs=(-jr*Mi-(1-Mr)*Bo)/(jr*jr),ml=.5*vs/xn,yl=(1-er)*ml-2*Yt*xn*qo,Xs=-2*Ao*yl,Sl=-Ao*qo,Ou=-Ao*(Yt*(1+er)*vs+sn*(1+3*er)*qo);return[A/4*(ot*(Xs+Sl*Ua)+Ou*z(ot/V($n))),gi]}function Ga(){return S.geoProjection(na(An)).scale(239.75)}function to(ot,dt,St){var Rt,Yt,Ut;return ot?(Rt=_o(ot,St),dt?(Yt=_o(dt,1-St),Ut=Yt[1]*Yt[1]+St*Rt[0]*Rt[0]*Yt[0]*Yt[0],[[Rt[0]*Yt[2]/Ut,Rt[1]*Rt[2]*Yt[0]*Yt[1]/Ut],[Rt[1]*Yt[1]/Ut,-Rt[0]*Rt[2]*Yt[0]*Yt[2]/Ut],[Rt[2]*Yt[1]*Yt[2]/Ut,-St*Rt[0]*Rt[1]*Yt[0]/Ut]]):[[Rt[0],0],[Rt[1],0],[Rt[2],0]]):(Yt=_o(dt,1-St),[[0,Yt[0]/Yt[1]],[1/Yt[1],0],[Yt[2]/Yt[1],0]])}function _o(ot,dt){var St,Rt,Yt,Ut,er;if(dt=1-f)return St=(1-dt)/4,Rt=O(ot),Ut=G(ot),Yt=1/Rt,er=Rt*j(ot),[Ut+St*(er-ot)/(Rt*Rt),Yt-St*Ut*Yt*(er-ot),Yt+St*Ut*Yt*(er+ot),2*t(l(ot))-k+St*(er-ot)/Rt];var Mr=[1,0,0,0,0,0,0,0,0],Nr=[V(dt),0,0,0,0,0,0,0,0],jr=0;for(Rt=V(1-dt),er=1;L(Nr[jr]/Mr[jr])>f&&jr<8;)St=Mr[jr++],Nr[jr]=(St-Rt)/2,Mr[jr]=(St+Rt)/2,Rt=V(St*Rt),er*=2;Yt=er*Mr[jr]*ot;do Ut=Nr[jr]*g(Rt=Yt)/Mr[jr],Yt=(z(Ut)+Yt)/2;while(--jr);return[g(Yt),Ut=a(Yt),Ut/a(Yt-Rt),Yt]}function Po(ot,dt,St){var Rt=L(ot),Yt=L(dt),Ut=j(Yt);if(Rt){var er=1/g(Rt),Mr=1/(C(Rt)*C(Rt)),Nr=-(Mr+St*(Ut*Ut*er*er)-1+St),jr=(St-1)*Mr,sn=(-Nr+V(Nr*Nr-4*jr))/2;return[Ro(t(1/V(sn)),St)*y(ot),Ro(t(V((sn/Mr-1)/St)),1-St)*y(dt)]}return[0,Ro(t(Ut),1-St)*y(dt)]}function Ro(ot,dt){if(!dt)return ot;if(dt===1)return s(C(ot/2+I));for(var St=1,Rt=V(1-dt),Yt=V(dt),Ut=0;L(Yt)>f;Ut++){if(ot%A){var er=t(Rt*C(ot)/St);er<0&&(er+=A),ot+=er+~~(ot/A)*A}else ot+=ot;Yt=(St+Rt)/2,Rt=V(St*Rt),Yt=((St=Yt)-Rt)/2}return ot/(p(2,Ut)*St)}function Xo(ot,dt){var St=(E-1)/(E+1),Rt=V(1-St*St),Yt=Ro(k,Rt*Rt),Ut=-1,er=s(C(A/4+L(dt)/2)),Mr=l(Ut*er)/V(St),Nr=Oi(Mr*a(Ut*ot),Mr*g(Ut*ot)),jr=Po(Nr[0],Nr[1],Rt*Rt);return[-jr[1],(dt>=0?1:-1)*(.5*Yt-jr[0])]}function Oi(ot,dt){var St=ot*ot,Rt=dt+1,Yt=1-St-dt*dt;return[.5*((ot>=0?k:-k)-r(Yt,2*ot)),-.25*s(Yt*Yt+4*St)+.5*s(Rt*Rt+St)]}function bs(ot,dt){var St=dt[0]*dt[0]+dt[1]*dt[1];return[(ot[0]*dt[0]+ot[1]*dt[1])/St,(ot[1]*dt[0]-ot[0]*dt[1])/St]}Xo.invert=function(ot,dt){var St=(E-1)/(E+1),Rt=V(1-St*St),Yt=Ro(k,Rt*Rt),Ut=-1,er=to(.5*Yt-dt,-ot,Rt*Rt),Mr=bs(er[0],er[1]),Nr=r(Mr[1],Mr[0])/Ut;return[Nr,2*t(l(.5/Ut*s(St*Mr[0]*Mr[0]+St*Mr[1]*Mr[1])))-k]};function cs(){return S.geoProjection(na(Xo)).scale(151.496)}function fl(ot){var dt=g(ot),St=a(ot),Rt=Is(ot);Rt.invert=Is(-ot);function Yt(Ut,er){var Mr=Rt(Ut,er);Ut=Mr[0],er=Mr[1];var Nr=g(er),jr=a(er),sn=a(Ut),xn=U(dt*Nr+St*jr*sn),$n=g(xn),Wn=L($n)>f?xn/$n:1;return[Wn*St*g(Ut),(L(Ut)>k?Wn:-Wn)*(dt*jr-St*Nr*sn)]}return Yt.invert=function(Ut,er){var Mr=V(Ut*Ut+er*er),Nr=-g(Mr),jr=a(Mr),sn=Mr*jr,xn=-er*Nr,$n=Mr*dt,Wn=V(sn*sn+xn*xn-$n*$n),ua=r(sn*$n+xn*Wn,xn*$n-sn*Wn),Ua=(Mr>k?-1:1)*r(Ut*Nr,Mr*a(ua)*jr+er*g(ua)*Nr);return Rt.invert(Ua,ua)},Yt}function Is(ot){var dt=g(ot),St=a(ot);return function(Rt,Yt){var Ut=a(Yt),er=a(Rt)*Ut,Mr=g(Rt)*Ut,Nr=g(Yt);return[r(Mr,er*St-Nr*dt),z(Nr*St+er*dt)]}}function ys(){var ot=0,dt=S.geoProjectionMutator(fl),St=dt(ot),Rt=St.rotate,Yt=St.stream,Ut=S.geoCircle();return St.parallel=function(er){if(!arguments.length)return ot*m;var Mr=St.rotate();return dt(ot=er*w).rotate(Mr)},St.rotate=function(er){return arguments.length?(Rt.call(St,[er[0],er[1]-ot*m]),Ut.center([-er[0],-er[1]]),St):(er=Rt.call(St),er[1]+=ot*m,er)},St.stream=function(er){return er=Yt(er),er.sphere=function(){er.polygonStart();var Mr=.01,Nr=Ut.radius(90-Mr)().coordinates[0],jr=Nr.length-1,sn=-1,xn;for(er.lineStart();++sn=0;)er.point((xn=Nr[sn])[0],xn[1]);er.lineEnd(),er.polygonEnd()},er},St.scale(79.4187).parallel(45).clipAngle(180-.001)}var ss=3,hl=z(1-1/ss)*m,ll=ur(0);function Il(ot){var dt=hl*w,St=ke(A,dt)[0]-ke(-A,dt)[0],Rt=ll(0,dt)[1],Yt=ke(0,dt)[1],Ut=_-Yt,er=h/ot,Mr=4/h,Nr=Rt+Ut*Ut*4/h;function jr(sn,xn){var $n,Wn=L(xn);if(Wn>dt){var ua=c(ot-1,o(0,i((sn+A)/er)));sn+=A*(ot-1)/ot-ua*er,$n=ke(sn,Wn),$n[0]=$n[0]*h/St-h*(ot-1)/(2*ot)+ua*h/ot,$n[1]=Rt+($n[1]-Yt)*4*Ut/h,xn<0&&($n[1]=-$n[1])}else $n=ll(sn,xn);return $n[0]*=Mr,$n[1]/=Nr,$n}return jr.invert=function(sn,xn){sn/=Mr,xn*=Nr;var $n=L(xn);if($n>Rt){var Wn=c(ot-1,o(0,i((sn+A)/er)));sn=(sn+A*(ot-1)/ot-Wn*er)*St/h;var ua=ke.invert(sn,.25*($n-Rt)*h/Ut+Yt);return ua[0]-=A*(ot-1)/ot-Wn*er,xn<0&&(ua[1]=-ua[1]),ua}return ll.invert(sn,xn)},jr}function Ls(ot,dt){return[ot,dt&1?90-f:hl]}function ps(ot,dt){return[ot,dt&1?-90+f:-hl]}function Uo(ot){return[ot[0]*(1-f),ot[1]]}function Rs(ot){var dt=[].concat(M.range(-180,180+ot/2,ot).map(Ls),M.range(180,-180-ot/2,-ot).map(ps));return{type:"Polygon",coordinates:[ot===180?dt.map(Uo):dt]}}function Ll(){var ot=4,dt=S.geoProjectionMutator(Il),St=dt(ot),Rt=St.stream;return St.lobes=function(Yt){return arguments.length?dt(ot=+Yt):ot},St.stream=function(Yt){var Ut=St.rotate(),er=Rt(Yt),Mr=(St.rotate([0,0]),Rt(Yt));return St.rotate(Ut),er.sphere=function(){S.geoStream(Rs(180/ot),Mr)},er},St.scale(239.75)}function Kl(ot){var dt=1+ot,St=g(1/dt),Rt=z(St),Yt=2*V(A/(Ut=A+4*Rt*dt)),Ut,er=.5*Yt*(dt+V(ot*(2+ot))),Mr=ot*ot,Nr=dt*dt;function jr(sn,xn){var $n=1-g(xn),Wn,ua;if($n&&$n<2){var Ua=k-xn,Si=25,gi;do{var Mi=g(Ua),Ao=a(Ua),qo=Rt+r(Mi,dt-Ao),Bo=1+Nr-2*dt*Ao;Ua-=gi=(Ua-Mr*Rt-dt*Mi+Bo*qo-.5*$n*Ut)/(2*dt*Mi*qo)}while(L(gi)>x&&--Si>0);Wn=Yt*V(Bo),ua=sn*qo/A}else Wn=Yt*(ot+$n),ua=sn*Rt/A;return[Wn*g(ua),er-Wn*a(ua)]}return jr.invert=function(sn,xn){var $n=sn*sn+(xn-=er)*xn,Wn=(1+Nr-$n/(Yt*Yt))/(2*dt),ua=U(Wn),Ua=g(ua),Si=Rt+r(Ua,dt-Wn);return[z(sn/V($n))*A/Si,z(1-2*(ua-Mr*Rt-dt*Ua+(1+Nr-2*dt*Wn)*Si)/Ut)]},jr}function eu(){var ot=1,dt=S.geoProjectionMutator(Kl),St=dt(ot);return St.ratio=function(Rt){return arguments.length?dt(ot=+Rt):ot},St.scale(167.774).center([0,18.67])}var Ws=.7109889596207567,Bi=.0528035274542;function Mo(ot,dt){return dt>-Ws?(ot=ht(ot,dt),ot[1]+=Bi,ot):vt(ot,dt)}Mo.invert=function(ot,dt){return dt>-Ws?ht.invert(ot,dt-Bi):vt.invert(ot,dt)};function Jl(){return S.geoProjection(Mo).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Qs(ot,dt){return L(dt)>Ws?(ot=ht(ot,dt),ot[1]-=dt>0?Bi:-Bi,ot):vt(ot,dt)}Qs.invert=function(ot,dt){return L(dt)>Ws?ht.invert(ot,dt+(dt>0?Bi:-Bi)):vt.invert(ot,dt)};function as(){return S.geoProjection(Qs).scale(152.63)}function tu(ot,dt,St,Rt){var Yt=V(4*A/(2*St+(1+ot-dt/2)*g(2*St)+(ot+dt)/2*g(4*St)+dt/2*g(6*St))),Ut=V(Rt*g(St)*V((1+ot*a(2*St)+dt*a(4*St))/(1+ot+dt))),er=St*Nr(1);function Mr(xn){return V(1+ot*a(2*xn)+dt*a(4*xn))}function Nr(xn){var $n=xn*St;return(2*$n+(1+ot-dt/2)*g(2*$n)+(ot+dt)/2*g(4*$n)+dt/2*g(6*$n))/St}function jr(xn){return Mr(xn)*g(xn)}var sn=function(xn,$n){var Wn=St*Ze(Nr,er*g($n)/St,$n/A);isNaN(Wn)&&(Wn=St*y($n));var ua=Yt*Mr(Wn);return[ua*Ut*xn/A*a(Wn),ua/Ut*g(Wn)]};return sn.invert=function(xn,$n){var Wn=Ze(jr,$n*Ut/Yt);return[xn*A/(a(Wn)*Yt*Ut*Mr(Wn)),z(St*Nr(Wn/St)/er)]},St===0&&(Yt=V(Rt/A),sn=function(xn,$n){return[xn*Yt,g($n)/Yt]},sn.invert=function(xn,$n){return[xn/Yt,z($n*Yt)]}),sn}function dl(){var ot=1,dt=0,St=45*w,Rt=2,Yt=S.geoProjectionMutator(tu),Ut=Yt(ot,dt,St,Rt);return Ut.a=function(er){return arguments.length?Yt(ot=+er,dt,St,Rt):ot},Ut.b=function(er){return arguments.length?Yt(ot,dt=+er,St,Rt):dt},Ut.psiMax=function(er){return arguments.length?Yt(ot,dt,St=+er*w,Rt):St*m},Ut.ratio=function(er){return arguments.length?Yt(ot,dt,St,Rt=+er):Rt},Ut.scale(180.739)}function Rl(ot,dt,St,Rt,Yt,Ut,er,Mr,Nr,jr,sn){if(sn.nanEncountered)return NaN;var xn,$n,Wn,ua,Ua,Si,gi,Mi,Ao,qo;if(xn=St-dt,$n=ot(dt+xn*.25),Wn=ot(St-xn*.25),isNaN($n)){sn.nanEncountered=!0;return}if(isNaN(Wn)){sn.nanEncountered=!0;return}return ua=xn*(Rt+4*$n+Yt)/12,Ua=xn*(Yt+4*Wn+Ut)/12,Si=ua+Ua,qo=(Si-er)/15,jr>Nr?(sn.maxDepthCount++,Si+qo):Math.abs(qo)>1;do Nr[Si]>Wn?Ua=Si:ua=Si,Si=ua+Ua>>1;while(Si>ua);var gi=Nr[Si+1]-Nr[Si];return gi&&(gi=(Wn-Nr[Si+1])/gi),(Si+1+gi)/er}var xn=2*sn(1)/A*Ut/St,$n=function(Wn,ua){var Ua=sn(L(g(ua))),Si=Rt(Ua)*Wn;return Ua/=xn,[Si,ua>=0?Ua:-Ua]};return $n.invert=function(Wn,ua){var Ua;return ua*=xn,L(ua)<1&&(Ua=y(ua)*z(Yt(L(ua))*Ut)),[Wn/Rt(L(ua)),Ua]},$n}function Os(){var ot=0,dt=2.5,St=1.183136,Rt=S.geoProjectionMutator(Eo),Yt=Rt(ot,dt,St);return Yt.alpha=function(Ut){return arguments.length?Rt(ot=+Ut,dt,St):ot},Yt.k=function(Ut){return arguments.length?Rt(ot,dt=+Ut,St):dt},Yt.gamma=function(Ut){return arguments.length?Rt(ot,dt,St=+Ut):St},Yt.scale(152.63)}function ws(ot,dt){return L(ot[0]-dt[0])=0;--Nr)St=ot[1][Nr],Rt=St[0][0],Yt=St[0][1],Ut=St[1][1],er=St[2][0],Mr=St[2][1],dt.push(pu([[er-f,Mr-f],[er-f,Ut+f],[Rt+f,Ut+f],[Rt+f,Yt-f]],30));return{type:"Polygon",coordinates:[M.merge(dt)]}}function ts(ot,dt,St){var Rt,Yt;function Ut(Nr,jr){for(var sn=jr<0?-1:1,xn=dt[+(jr<0)],$n=0,Wn=xn.length-1;$nxn[$n][2][0];++$n);var ua=ot(Nr-xn[$n][1][0],jr);return ua[0]+=ot(xn[$n][1][0],sn*jr>sn*xn[$n][0][1]?xn[$n][0][1]:jr)[0],ua}St?Ut.invert=St(Ut):ot.invert&&(Ut.invert=function(Nr,jr){for(var sn=Yt[+(jr<0)],xn=dt[+(jr<0)],$n=0,Wn=sn.length;$nua&&(Ua=Wn,Wn=ua,ua=Ua),[[xn,Wn],[$n,ua]]})}),er):dt.map(function(jr){return jr.map(function(sn){return[[sn[0][0]*m,sn[0][1]*m],[sn[1][0]*m,sn[1][1]*m],[sn[2][0]*m,sn[2][1]*m]]})})},dt!=null&&er.lobes(dt),er}var Iu=[[[[-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 zu(){return ts(Je,Iu).scale(160.857)}var nl=[[[[-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 Gl(){return ts(Qs,nl).scale(152.63)}var su=[[[[-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 cu(){return ts(ht,su).scale(169.529)}var vc=[[[[-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 jf(){return ts(ht,vc).scale(169.529).rotate([20,0])}var Tf=[[[[-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 Rf(){return ts(Mo,Tf,Xe).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var _d=[[[[-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 ad(){return ts(vt,_d).scale(152.63).rotate([-20,0])}function ql(ot,dt){return[3/h*ot*V(A*A/3-dt*dt),dt]}ql.invert=function(ot,dt){return[h/3*ot/V(A*A/3-dt*dt),dt]};function cf(){return S.geoProjection(ql).scale(158.837)}function xd(ot){function dt(St,Rt){if(L(L(Rt)-k)2)return null;St/=2,Rt/=2;var Ut=St*St,er=Rt*Rt,Mr=2*Rt/(1+Ut+er);return Mr=p((1+Mr)/(1-Mr),1/ot),[r(2*St,1-Ut-er)/ot,z((Mr-1)/(Mr+1))]},dt}function Lc(){var ot=.5,dt=S.geoProjectionMutator(xd),St=dt(ot);return St.spacing=function(Rt){return arguments.length?dt(ot=+Rt):ot},St.scale(124.75)}var mc=A/E;function Rc(ot,dt){return[ot*(1+V(a(dt)))/2,dt/(a(dt/2)*a(ot/6))]}Rc.invert=function(ot,dt){var St=L(ot),Rt=L(dt),Yt=f,Ut=k;Rtf||L(Si)>f)&&--Yt>0);return Yt&&[St,Rt]};function gc(){return S.geoProjection(xu).scale(139.98)}function ul(ot,dt){return[g(ot)/a(dt),C(dt)*a(ot)]}ul.invert=function(ot,dt){var St=ot*ot,Rt=dt*dt,Yt=Rt+1,Ut=St+Yt,er=ot?T*V((Ut-V(Ut*Ut-4*St))/St):1/V(Yt);return[z(ot*er),y(dt)*U(er)]};function ru(){return S.geoProjection(ul).scale(144.049).clipAngle(90-.001)}function rh(ot){var dt=a(ot),St=C(I+ot/2);function Rt(Yt,Ut){var er=Ut-ot,Mr=L(er)=0;)sn=ot[jr],xn=sn[0]+Mr*(Wn=xn)-Nr*$n,$n=sn[1]+Mr*$n+Nr*Wn;return xn=Mr*(Wn=xn)-Nr*$n,$n=Mr*$n+Nr*Wn,[xn,$n]}return St.invert=function(Rt,Yt){var Ut=20,er=Rt,Mr=Yt;do{for(var Nr=dt,jr=ot[Nr],sn=jr[0],xn=jr[1],$n=0,Wn=0,ua;--Nr>=0;)jr=ot[Nr],$n=sn+er*(ua=$n)-Mr*Wn,Wn=xn+er*Wn+Mr*ua,sn=jr[0]+er*(ua=sn)-Mr*xn,xn=jr[1]+er*xn+Mr*ua;$n=sn+er*(ua=$n)-Mr*Wn,Wn=xn+er*Wn+Mr*ua,sn=er*(ua=sn)-Mr*xn-Rt,xn=er*xn+Mr*ua-Yt;var Ua=$n*$n+Wn*Wn,Si,gi;er-=Si=(sn*$n+xn*Wn)/Ua,Mr-=gi=(xn*$n-sn*Wn)/Ua}while(L(Si)+L(gi)>f*f&&--Ut>0);if(Ut){var Mi=V(er*er+Mr*Mr),Ao=2*t(Mi*.5),qo=g(Ao);return[r(er*qo,Mi*a(Ao)),Mi?z(Mr*qo/Mi):0]}},St}var al=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Np=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Ol=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],ns=[[.9245,0],[0,0],[.01943,0]],zh=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Pf(){return yc(al,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function ic(){return yc(Np,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function bd(){return yc(Ol,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function vh(){return yc(ns,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Wh(){return yc(zh,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function yc(ot,dt){var St=S.geoProjection(yp(ot)).rotate(dt).clipAngle(90),Rt=S.geoRotation(dt),Yt=St.center;return delete St.rotate,St.center=function(Ut){return arguments.length?Yt(Rt(Ut)):Rt.invert(Yt())},St}var Jd=V(6),Ld=V(7);function Xh(ot,dt){var St=z(7*g(dt)/(3*Jd));return[Jd*ot*(2*a(2*St/3)-1)/Ld,9*g(St/3)/Ld]}Xh.invert=function(ot,dt){var St=3*z(dt*Ld/9);return[ot*Ld/(Jd*(2*a(2*St/3)-1)),z(g(St)*3*Jd/7)]};function mh(){return S.geoProjection(Xh).scale(164.859)}function wd(ot,dt){for(var St=(1+T)*g(dt),Rt=dt,Yt=0,Ut;Yt<25&&(Rt-=Ut=(g(Rt/2)+g(Rt)-St)/(.5*a(Rt/2)+a(Rt)),!(L(Ut)x&&--Rt>0);return Ut=St*St,er=Ut*Ut,Mr=Ut*er,[ot/(.84719-.13063*Ut+Mr*Mr*(-.04515+.05494*Ut-.02326*er+.00331*Mr)),St]};function Gf(){return S.geoProjection(nh).scale(175.295)}function _c(ot,dt){return[ot*(1+a(dt))/2,2*(dt-C(dt/2))]}_c.invert=function(ot,dt){for(var St=dt/2,Rt=0,Yt=1/0;Rt<10&&L(Yt)>f;++Rt){var Ut=a(dt/2);dt-=Yt=(dt-C(dt/2)-St)/(1-.5/(Ut*Ut))}return[2*ot/(1+a(dt)),dt]};function Ch(){return S.geoProjection(_c).scale(152.63)}var Ad=[[[[-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 lu(){return ts(Te(1/0),Ad).rotate([20,0]).scale(152.63)}function id(ot,dt){var St=g(dt),Rt=a(dt),Yt=y(ot);if(ot===0||L(dt)===k)return[0,dt];if(dt===0)return[ot,0];if(L(ot)===k)return[ot*Rt,k*St];var Ut=A/(2*ot)-2*ot/A,er=2*dt/A,Mr=(1-er*er)/(St-er),Nr=Ut*Ut,jr=Mr*Mr,sn=1+Nr/jr,xn=1+jr/Nr,$n=(Ut*St/Mr-Ut/2)/sn,Wn=(jr*St/Nr+Mr/2)/xn,ua=$n*$n+Rt*Rt/sn,Ua=Wn*Wn-(jr*St*St/Nr+Mr*St-1)/xn;return[k*($n+V(ua)*Yt),k*(Wn+V(Ua<0?0:Ua)*y(-dt*Ut)*Yt)]}id.invert=function(ot,dt){ot/=k,dt/=k;var St=ot*ot,Rt=dt*dt,Yt=St+Rt,Ut=A*A;return[ot?(Yt-1+V((1-Yt)*(1-Yt)+4*St))/(2*ot)*k:0,Ze(function(er){return Yt*(A*g(er)-2*er)*A+4*er*er*(dt-g(er))+2*A*er-Ut*dt},0)]};function _p(){return S.geoProjection(id).scale(127.267)}var Dd=1.0148,Yh=.23185,Pd=-.14499,ff=.02406,zd=Dd,Vu=5*Yh,hf=7*Pd,gh=9*ff,bu=1.790857183;function ah(ot,dt){var St=dt*dt;return[ot,dt*(Dd+St*St*(Yh+St*(Pd+ff*St)))]}ah.invert=function(ot,dt){dt>bu?dt=bu:dt<-bu&&(dt=-bu);var St=dt,Rt;do{var Yt=St*St;St-=Rt=(St*(Dd+Yt*Yt*(Yh+Yt*(Pd+ff*Yt)))-dt)/(zd+Yt*Yt*(Vu+Yt*(hf+gh*Yt)))}while(L(Rt)>f);return[ot,St]};function Vc(){return S.geoProjection(ah).scale(139.319)}function df(ot,dt){if(L(dt)f&&--Yt>0);return er=C(Rt),[(L(dt)=0;)if(Rt=dt[Mr],St[0]===Rt[0]&&St[1]===Rt[1]){if(Ut)return[Ut,St];Ut=St}}}function Dc(ot){for(var dt=ot.length,St=[],Rt=ot[dt-1],Yt=0;Yt0?[-Rt[0],0]:[180-Rt[0],180])};var dt=Bh.map(function(St){return{face:St,project:ot(St)}});return[-1,0,0,1,0,1,4,5].forEach(function(St,Rt){var Yt=dt[St];Yt&&(Yt.children||(Yt.children=[])).push(dt[Rt])}),Oh(dt[0],function(St,Rt){return dt[St<-A/2?Rt<0?6:4:St<0?Rt<0?2:0:StRt^Wn>Rt&&St<($n-jr)*(Rt-sn)/(Wn-sn)+jr&&(Yt=!Yt)}return Yt}function Oc(ot,dt){var St=dt.stream,Rt;if(!St)throw new Error("invalid projection");switch(ot&&ot.type){case"Feature":Rt=Ef;break;case"FeatureCollection":Rt=Od;break;default:Rt=Wf;break}return Rt(ot,St)}function Od(ot,dt){return{type:"FeatureCollection",features:ot.features.map(function(St){return Ef(St,dt)})}}function Ef(ot,dt){return{type:"Feature",id:ot.id,properties:ot.properties,geometry:Wf(ot.geometry,dt)}}function ih(ot,dt){return{type:"GeometryCollection",geometries:ot.geometries.map(function(St){return Wf(St,dt)})}}function Wf(ot,dt){if(!ot)return null;if(ot.type==="GeometryCollection")return ih(ot,dt);var St;switch(ot.type){case"Point":St=Nu;break;case"MultiPoint":St=Nu;break;case"LineString":St=xh;break;case"MultiLineString":St=xh;break;case"Polygon":St=Xf;break;case"MultiPolygon":St=Xf;break;case"Sphere":St=Xf;break;default:return null}return S.geoStream(ot,dt(St)),St.result()}var qu=[],Yc=[],Nu={point:function(ot,dt){qu.push([ot,dt])},result:function(){var ot=qu.length?qu.length<2?{type:"Point",coordinates:qu[0]}:{type:"MultiPoint",coordinates:qu}:null;return qu=[],ot}},xh={lineStart:Hf,point:function(ot,dt){qu.push([ot,dt])},lineEnd:function(){qu.length&&(Yc.push(qu),qu=[])},result:function(){var ot=Yc.length?Yc.length<2?{type:"LineString",coordinates:Yc[0]}:{type:"MultiLineString",coordinates:Yc}:null;return Yc=[],ot}},Xf={polygonStart:Hf,lineStart:Hf,point:function(ot,dt){qu.push([ot,dt])},lineEnd:function(){var ot=qu.length;if(ot){do qu.push(qu[0].slice());while(++ot<4);Yc.push(qu),qu=[]}},polygonEnd:Hf,result:function(){if(!Yc.length)return null;var ot=[],dt=[];return Yc.forEach(function(St){Jh(St)?ot.push([St]):dt.push(St)}),dt.forEach(function(St){var Rt=St[0];ot.some(function(Yt){if(bp(Yt[0],Rt))return Yt.push(St),!0})||ot.push([St])}),Yc=[],ot.length?ot.length>1?{type:"MultiPolygon",coordinates:ot}:{type:"Polygon",coordinates:ot[0]}:null}};function Ed(ot){var dt=ot(k,0)[0]-ot(-k,0)[0];function St(Rt,Yt){var Ut=L(Rt)0?Rt-A:Rt+A,Yt),Mr=(er[0]-er[1])*T,Nr=(er[0]+er[1])*T;if(Ut)return[Mr,Nr];var jr=dt*T,sn=Mr>0^Nr>0?-1:1;return[sn*Mr-y(Nr)*jr,sn*Nr-y(Mr)*jr]}return ot.invert&&(St.invert=function(Rt,Yt){var Ut=(Rt+Yt)*T,er=(Yt-Rt)*T,Mr=L(Ut)<.5*dt&&L(er)<.5*dt;if(!Mr){var Nr=dt*T,jr=Ut>0^er>0?-1:1,sn=-jr*Rt+(er>0?1:-1)*Nr,xn=-jr*Yt+(Ut>0?1:-1)*Nr;Ut=(-sn-xn)*T,er=(sn-xn)*T}var $n=ot.invert(Ut,er);return Mr||($n[0]+=Ut>0?A:-A),$n}),S.geoProjection(St).rotate([-90,-90,45]).clipAngle(180-.001)}function wr(){return Ed(An).scale(176.423)}function qr(){return Ed(Xo).scale(111.48)}function kn(ot,dt){if(!(0<=(dt=+dt)&&dt<=20))throw new Error("invalid digits");function St(jr){var sn=jr.length,xn=2,$n=new Array(sn);for($n[0]=+jr[0].toFixed(dt),$n[1]=+jr[1].toFixed(dt);xn2||Wn[0]!=sn[0]||Wn[1]!=sn[1])&&(xn.push(Wn),sn=Wn)}return xn.length===1&&jr.length>1&&xn.push(St(jr[jr.length-1])),xn}function Ut(jr){return jr.map(Yt)}function er(jr){if(jr==null)return jr;var sn;switch(jr.type){case"GeometryCollection":sn={type:"GeometryCollection",geometries:jr.geometries.map(er)};break;case"Point":sn={type:"Point",coordinates:St(jr.coordinates)};break;case"MultiPoint":sn={type:jr.type,coordinates:Rt(jr.coordinates)};break;case"LineString":sn={type:jr.type,coordinates:Yt(jr.coordinates)};break;case"MultiLineString":case"Polygon":sn={type:jr.type,coordinates:Ut(jr.coordinates)};break;case"MultiPolygon":sn={type:"MultiPolygon",coordinates:jr.coordinates.map(Ut)};break;default:return jr}return jr.bbox!=null&&(sn.bbox=jr.bbox),sn}function Mr(jr){var sn={type:"Feature",properties:jr.properties,geometry:er(jr.geometry)};return jr.id!=null&&(sn.id=jr.id),jr.bbox!=null&&(sn.bbox=jr.bbox),sn}if(ot!=null)switch(ot.type){case"Feature":return Mr(ot);case"FeatureCollection":{var Nr={type:"FeatureCollection",features:ot.features.map(Mr)};return ot.bbox!=null&&(Nr.bbox=ot.bbox),Nr}default:return er(ot)}return ot}function _n(ot){var dt=g(ot);function St(Rt,Yt){var Ut=dt?C(Rt*dt/2)/dt:Rt/2;if(!Yt)return[2*Ut,-ot];var er=2*t(Ut*g(Yt)),Mr=1/C(Yt);return[g(er)*Mr,Yt+(1-a(er))*Mr-ot]}return St.invert=function(Rt,Yt){if(L(Yt+=ot)f&&--Mr>0);var $n=Rt*(jr=C(er)),Wn=C(L(Yt)0?k:-k)*(Nr+Yt*(sn-er)/2+Yt*Yt*(sn-2*Nr+er)/2)]}Fa.invert=function(ot,dt){var St=dt/k,Rt=St*90,Yt=c(18,L(Rt/5)),Ut=o(0,i(Yt));do{var er=$a[Ut][1],Mr=$a[Ut+1][1],Nr=$a[c(19,Ut+2)][1],jr=Nr-er,sn=Nr-2*Mr+er,xn=2*(L(St)-Mr)/jr,$n=sn/jr,Wn=xn*(1-$n*xn*(1-2*$n*xn));if(Wn>=0||Ut===1){Rt=(dt>=0?5:-5)*(Wn+Yt);var ua=50,Ua;do Yt=c(18,L(Rt)/5),Ut=i(Yt),Wn=Yt-Ut,er=$a[Ut][1],Mr=$a[Ut+1][1],Nr=$a[c(19,Ut+2)][1],Rt-=(Ua=(dt>=0?k:-k)*(Mr+Wn*(Nr-er)/2+Wn*Wn*(Nr-2*Mr+er)/2)-dt)*m;while(L(Ua)>x&&--ua>0);break}}while(--Ut>=0);var Si=$a[Ut][0],gi=$a[Ut+1][0],Mi=$a[c(19,Ut+2)][0];return[ot/(gi+Wn*(Mi-Si)/2+Wn*Wn*(Mi-2*gi+Si)/2),Rt*w]};function Ai(){return S.geoProjection(Fa).scale(152.63)}function Ni(ot){function dt(St,Rt){var Yt=a(Rt),Ut=(ot-1)/(ot-Yt*a(St));return[Ut*Yt*g(St),Ut*g(Rt)]}return dt.invert=function(St,Rt){var Yt=St*St+Rt*Rt,Ut=V(Yt),er=(ot-V(1-Yt*(ot+1)/(ot-1)))/((ot-1)/Ut+Ut/(ot-1));return[r(St*er,Ut*V(1-er*er)),Ut?z(Rt*er/Ut):0]},dt}function ho(ot,dt){var St=Ni(ot);if(!dt)return St;var Rt=a(dt),Yt=g(dt);function Ut(er,Mr){var Nr=St(er,Mr),jr=Nr[1],sn=jr*Yt/(ot-1)+Rt;return[Nr[0]*Rt/sn,jr/sn]}return Ut.invert=function(er,Mr){var Nr=(ot-1)/(ot-1-Mr*Yt);return St.invert(Nr*er,Nr*Mr*Rt)},Ut}function fi(){var ot=2,dt=0,St=S.geoProjectionMutator(ho),Rt=St(ot,dt);return Rt.distance=function(Yt){return arguments.length?St(ot=+Yt,dt):ot},Rt.tilt=function(Yt){return arguments.length?St(ot,dt=Yt*w):dt*m},Rt.scale(432.147).clipAngle(U(1/ot)*m-1e-6)}var Yi=1e-4,bi=1e4,ii=-180,bo=ii+Yi,os=180,rs=os-Yi,fs=-90,ls=fs+Yi,To=90,ro=To-Yi;function Ts(ot){return ot.length>0}function il(ot){return Math.floor(ot*bi)/bi}function Hl(ot){return ot===fs||ot===To?[0,ot]:[ii,il(ot)]}function mu(ot){var dt=ot[0],St=ot[1],Rt=!1;return dt<=bo?(dt=ii,Rt=!0):dt>=rs&&(dt=os,Rt=!0),St<=ls?(St=fs,Rt=!0):St>=ro&&(St=To,Rt=!0),Rt?[dt,St]:ot}function Xl(ot){return ot.map(mu)}function gu(ot,dt,St){for(var Rt=0,Yt=ot.length;Rt=rs||sn<=ls||sn>=ro){Ut[er]=mu(Nr);for(var xn=er+1;xnbo&&Wnls&&ua=Mr)break;St.push({index:-1,polygon:dt,ring:Ut=Ut.slice(xn-1)}),Ut[0]=Hl(Ut[0][1]),er=-1,Mr=Ut.length}}}}function wl(ot){var dt,St=ot.length,Rt={},Yt={},Ut,er,Mr,Nr,jr;for(dt=0;dt0?A-Mr:Mr)*m],jr=S.geoProjection(ot(er)).rotate(Nr),sn=S.geoRotation(Nr),xn=jr.center;return delete jr.rotate,jr.center=function($n){return arguments.length?xn(sn($n)):sn.invert(xn())},jr.clipAngle(90)}function Fl(ot){var dt=a(ot);function St(Rt,Yt){var Ut=S.geoGnomonicRaw(Rt,Yt);return Ut[0]*=dt,Ut}return St.invert=function(Rt,Yt){return S.geoGnomonicRaw.invert(Rt/dt,Yt)},St}function jc(){return Gc([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Gc(ot,dt){return nu(Fl,ot,dt)}function Zc(ot){if(!(ot*=2))return S.geoAzimuthalEquidistantRaw;var dt=-ot/2,St=-dt,Rt=ot*ot,Yt=C(St),Ut=.5/g(St);function er(Mr,Nr){var jr=U(a(Nr)*a(Mr-dt)),sn=U(a(Nr)*a(Mr-St)),xn=Nr<0?-1:1;return jr*=jr,sn*=sn,[(jr-sn)/(2*ot),xn*V(4*Rt*sn-(Rt-jr+sn)*(Rt-jr+sn))/(2*ot)]}return er.invert=function(Mr,Nr){var jr=Nr*Nr,sn=a(V(jr+($n=Mr+dt)*$n)),xn=a(V(jr+($n=Mr+St)*$n)),$n,Wn;return[r(Wn=sn-xn,$n=(sn+xn)*Yt),(Nr<0?-1:1)*U(V($n*$n+Wn*Wn)*Ut)]},er}function kh(){return qc([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function qc(ot,dt){return nu(Zc,ot,dt)}function oh(ot,dt){if(L(dt)f&&--Mr>0);return[y(ot)*(V(Yt*Yt+4)+Yt)*A/4,k*er]};function vf(){return S.geoProjection(Cf).scale(127.16)}function Qe(ot,dt,St,Rt,Yt){function Ut(er,Mr){var Nr=St*g(Rt*Mr),jr=V(1-Nr*Nr),sn=V(2/(1+jr*a(er*=Yt)));return[ot*jr*sn*g(er),dt*Nr*sn]}return Ut.invert=function(er,Mr){var Nr=er/ot,jr=Mr/dt,sn=V(Nr*Nr+jr*jr),xn=2*z(sn/2);return[r(er*C(xn),ot*sn)/Yt,sn&&z(Mr*g(xn)/(dt*St*sn))/Rt]},Ut}function N(ot,dt,St,Rt){var Yt=A/3;ot=o(ot,f),dt=o(dt,f),ot=c(ot,k),dt=c(dt,A-f),St=o(St,0),St=c(St,100-f),Rt=o(Rt,f);var Ut=St/100+1,er=Rt/100,Mr=U(Ut*a(Yt))/Yt,Nr=g(ot)/g(Mr*k),jr=dt/A,sn=V(er*g(ot/2)/g(dt/2)),xn=sn/V(jr*Nr*Mr),$n=1/(sn*V(jr*Nr*Mr));return Qe(xn,$n,Nr,Mr,jr)}function ve(){var ot=65*w,dt=60*w,St=20,Rt=200,Yt=S.geoProjectionMutator(N),Ut=Yt(ot,dt,St,Rt);return Ut.poleline=function(er){return arguments.length?Yt(ot=+er*w,dt,St,Rt):ot*m},Ut.parallels=function(er){return arguments.length?Yt(ot,dt=+er*w,St,Rt):dt*m},Ut.inflation=function(er){return arguments.length?Yt(ot,dt,St=+er,Rt):St},Ut.ratio=function(er){return arguments.length?Yt(ot,dt,St,Rt=+er):Rt},Ut.scale(163.775)}function Oe(){return ve().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Ue=4*A+3*V(3),Ke=2*V(2*A*V(3)/Ue),It=mt(Ke*V(3)/A,Ke,Ue/6);function $t(){return S.geoProjection(It).scale(176.84)}function ir(ot,dt){return[ot*V(1-3*dt*dt/(A*A)),dt]}ir.invert=function(ot,dt){return[ot/V(1-3*dt*dt/(A*A)),dt]};function Tr(){return S.geoProjection(ir).scale(152.63)}function Or(ot,dt){var St=a(dt),Rt=a(ot)*St,Yt=1-Rt,Ut=a(ot=r(g(ot)*St,-g(dt))),er=g(ot);return St=V(1-Rt*Rt),[er*St-Ut*Yt,-Ut*St-er*Yt]}Or.invert=function(ot,dt){var St=(ot*ot+dt*dt)/-2,Rt=V(-St*(2+St)),Yt=dt*St+ot*Rt,Ut=ot*St-dt*Rt,er=V(Ut*Ut+Yt*Yt);return[r(Rt*Yt,er*(1+St)),er?-z(Rt*Ut/er):0]};function Vr(){return S.geoProjection(Or).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function vn(ot,dt){var St=xe(ot,dt);return[(St[0]+ot/k)/2,(St[1]+dt)/2]}vn.invert=function(ot,dt){var St=ot,Rt=dt,Yt=25;do{var Ut=a(Rt),er=g(Rt),Mr=g(2*Rt),Nr=er*er,jr=Ut*Ut,sn=g(St),xn=a(St/2),$n=g(St/2),Wn=$n*$n,ua=1-jr*xn*xn,Ua=ua?U(Ut*xn)*V(Si=1/ua):Si=0,Si,gi=.5*(2*Ua*Ut*$n+St/k)-ot,Mi=.5*(Ua*er+Rt)-dt,Ao=.5*Si*(jr*Wn+Ua*Ut*xn*Nr)+.5/k,qo=Si*(sn*Mr/4-Ua*er*$n),Bo=.125*Si*(Mr*$n-Ua*er*jr*sn),vs=.5*Si*(Nr*xn+Ua*Wn*Ut)+.5,ml=qo*Bo-vs*Ao,yl=(Mi*qo-gi*vs)/ml,Xs=(gi*Bo-Mi*Ao)/ml;St-=yl,Rt-=Xs}while((L(yl)>f||L(Xs)>f)&&--Yt>0);return[St,Rt]};function Dn(){return S.geoProjection(vn).scale(158.837)}v.geoNaturalEarth=S.geoNaturalEarth1,v.geoNaturalEarthRaw=S.geoNaturalEarth1Raw,v.geoAiry=ue,v.geoAiryRaw=ee,v.geoAitoff=ge,v.geoAitoffRaw=xe,v.geoArmadillo=Y,v.geoArmadilloRaw=_e,v.geoAugust=ce,v.geoAugustRaw=se,v.geoBaker=Z,v.geoBakerRaw=le,v.geoBerghaus=pe,v.geoBerghausRaw=de,v.geoBertin1953=yt,v.geoBertin1953Raw=it,v.geoBoggs=_t,v.geoBoggsRaw=Je,v.geoBonne=fr,v.geoBonneRaw=Qt,v.geoBottomley=Ur,v.geoBottomleyRaw=mr,v.geoBromley=fn,v.geoBromleyRaw=Br,v.geoChamberlin=Ie,v.geoChamberlinRaw=et,v.geoChamberlinAfrica=Be,v.geoCollignon=Fe,v.geoCollignonRaw=ke,v.geoCraig=ct,v.geoCraigRaw=at,v.geoCraster=Zt,v.geoCrasterRaw=Vt,v.geoCylindricalEqualArea=Dr,v.geoCylindricalEqualAreaRaw=ur,v.geoCylindricalStereographic=Sr,v.geoCylindricalStereographicRaw=kr,v.geoEckert1=jn,v.geoEckert1Raw=Jr,v.geoEckert2=oa,v.geoEckert2Raw=ha,v.geoEckert3=xa,v.geoEckert3Raw=_a,v.geoEckert4=Ha,v.geoEckert4Raw=ra,v.geoEckert5=_r,v.geoEckert5Raw=ci,v.geoEckert6=yr,v.geoEckert6Raw=rr,v.geoEisenlohr=bn,v.geoEisenlohrRaw=an,v.geoFahey=va,v.geoFaheyRaw=Fn,v.geoFoucaut=La,v.geoFoucautRaw=Pa,v.geoFoucautSinusoidal=Wa,v.geoFoucautSinusoidalRaw=Oa,v.geoGilbert=Qi,v.geoGingery=en,v.geoGingeryRaw=Xt,v.geoGinzburg4=tn,v.geoGinzburg4Raw=Wr,v.geoGinzburg5=dn,v.geoGinzburg5Raw=wn,v.geoGinzburg6=xr,v.geoGinzburg6Raw=Nt,v.geoGinzburg8=Tn,v.geoGinzburg8Raw=Xr,v.geoGinzburg9=ia,v.geoGinzburg9Raw=Xn,v.geoGringorten=Ga,v.geoGringortenRaw=An,v.geoGuyou=cs,v.geoGuyouRaw=Xo,v.geoHammer=$e,v.geoHammerRaw=Te,v.geoHammerRetroazimuthal=ys,v.geoHammerRetroazimuthalRaw=fl,v.geoHealpix=Ll,v.geoHealpixRaw=Il,v.geoHill=eu,v.geoHillRaw=Kl,v.geoHomolosine=as,v.geoHomolosineRaw=Qs,v.geoHufnagel=dl,v.geoHufnagelRaw=tu,v.geoHyperelliptical=Os,v.geoHyperellipticalRaw=Eo,v.geoInterrupt=ts,v.geoInterruptedBoggs=zu,v.geoInterruptedHomolosine=Gl,v.geoInterruptedMollweide=cu,v.geoInterruptedMollweideHemispheres=jf,v.geoInterruptedSinuMollweide=Rf,v.geoInterruptedSinusoidal=ad,v.geoKavrayskiy7=cf,v.geoKavrayskiy7Raw=ql,v.geoLagrange=Lc,v.geoLagrangeRaw=xd,v.geoLarrivee=Df,v.geoLarriveeRaw=Rc,v.geoLaskowski=gc,v.geoLaskowskiRaw=xu,v.geoLittrow=ru,v.geoLittrowRaw=ul,v.geoLoximuthal=Xc,v.geoLoximuthalRaw=rh,v.geoMiller=Lu,v.geoMillerRaw=ph,v.geoModifiedStereographic=yc,v.geoModifiedStereographicRaw=yp,v.geoModifiedStereographicAlaska=Pf,v.geoModifiedStereographicGs48=ic,v.geoModifiedStereographicGs50=bd,v.geoModifiedStereographicMiller=vh,v.geoModifiedStereographicLee=Wh,v.geoMollweide=Ve,v.geoMollweideRaw=ht,v.geoMtFlatPolarParabolic=mh,v.geoMtFlatPolarParabolicRaw=Xh,v.geoMtFlatPolarQuartic=Td,v.geoMtFlatPolarQuarticRaw=wd,v.geoMtFlatPolarSinusoidal=Rd,v.geoMtFlatPolarSinusoidalRaw=zf,v.geoNaturalEarth2=Gf,v.geoNaturalEarth2Raw=nh,v.geoNellHammer=Ch,v.geoNellHammerRaw=_c,v.geoInterruptedQuarticAuthalic=lu,v.geoNicolosi=_p,v.geoNicolosiRaw=id,v.geoPatterson=Vc,v.geoPattersonRaw=ah,v.geoPolyconic=Ru,v.geoPolyconicRaw=df,v.geoPolyhedral=Oh,v.geoPolyhedralButterfly=Au,v.geoPolyhedralCollignon=Sd,v.geoPolyhedralWaterman=ku,v.geoProject=Oc,v.geoGringortenQuincuncial=wr,v.geoPeirceQuincuncial=qr,v.geoPierceQuincuncial=qr,v.geoQuantize=kn,v.geoQuincuncial=Ed,v.geoRectangularPolyconic=Qn,v.geoRectangularPolyconicRaw=_n,v.geoRobinson=Ai,v.geoRobinsonRaw=Fa,v.geoSatellite=fi,v.geoSatelliteRaw=ho,v.geoSinuMollweide=Jl,v.geoSinuMollweideRaw=Mo,v.geoSinusoidal=Kt,v.geoSinusoidalRaw=vt,v.geoStitch=fu,v.geoTimes=Fs,v.geoTimesRaw=Vo,v.geoTwoPointAzimuthal=Gc,v.geoTwoPointAzimuthalRaw=Fl,v.geoTwoPointAzimuthalUsa=jc,v.geoTwoPointEquidistant=qc,v.geoTwoPointEquidistantRaw=Zc,v.geoTwoPointEquidistantUsa=kh,v.geoVanDerGrinten=Ku,v.geoVanDerGrintenRaw=oh,v.geoVanDerGrinten2=hs,v.geoVanDerGrinten2Raw=sh,v.geoVanDerGrinten3=lh,v.geoVanDerGrinten3Raw=Ss,v.geoVanDerGrinten4=vf,v.geoVanDerGrinten4Raw=Cf,v.geoWagner=ve,v.geoWagner7=Oe,v.geoWagnerRaw=N,v.geoWagner4=$t,v.geoWagner4Raw=It,v.geoWagner6=Tr,v.geoWagner6Raw=ir,v.geoWiechel=Vr,v.geoWiechelRaw=Or,v.geoWinkel3=Dn,v.geoWinkel3Raw=vn,Object.defineProperty(v,"__esModule",{value:!0})})}}),mX=Re({"src/plots/geo/zoom.js"(ae,K){var v=un(),S=Rn(),M=es(),L=Math.PI/180,t=180/Math.PI,r={cursor:"pointer"},a={cursor:"auto"};function l(m,w){var F=m.projection,z;return w._isScoped?z=o:w._isClipped?z=p:z=c,z(m,F)}K.exports=l;function i(m,w){return v.behavior.zoom().translate(w.translate()).scale(w.scale())}function s(m,w,F){var z=m.id,U=m.graphDiv,V=U.layout,G=V[z],j=U._fullLayout,O=j[z],H={},W={};function ee(ue,xe){H[z+"."+ue]=S.nestedProperty(G,ue).get(),M.call("_storeDirectGUIEdit",V,j._preGUI,H);var ge=S.nestedProperty(O,ue);ge.get()!==xe&&(ge.set(xe),S.nestedProperty(G,ue).set(xe),W[z+"."+ue]=xe)}F(ee),ee("projection.scale",w.scale()/m.fitScale),ee("fitbounds",!1),U.emit("plotly_relayout",W)}function o(m,w){var F=i(m,w);function z(){v.select(this).style(r)}function U(){w.scale(v.event.scale).translate(v.event.translate),m.render(!0);var j=w.invert(m.midPt);m.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":w.scale()/m.fitScale,"geo.center.lon":j[0],"geo.center.lat":j[1]})}function V(j){var O=w.invert(m.midPt);j("center.lon",O[0]),j("center.lat",O[1])}function G(){v.select(this).style(a),s(m,w,V)}return F.on("zoomstart",z).on("zoom",U).on("zoomend",G),F}function c(m,w){var F=i(m,w),z=2,U,V,G,j,O,H,W,ee,ue;function xe(ne){return w.invert(ne)}function ge(ne){var ye=xe(ne);if(!ye)return!0;var le=w(ye);return Math.abs(le[0]-ne[0])>z||Math.abs(le[1]-ne[1])>z}function _e(){v.select(this).style(r),U=v.mouse(this),V=w.rotate(),G=w.translate(),j=V,O=xe(U)}function Y(){if(H=v.mouse(this),ge(U)){F.scale(w.scale()),F.translate(w.translate());return}w.scale(v.event.scale),w.translate([G[0],v.event.translate[1]]),O?xe(H)&&(ee=xe(H),W=[j[0]+(ee[0]-O[0]),V[1],V[2]],w.rotate(W),j=W):(U=H,O=xe(U)),ue=!0,m.render(!0);var ne=w.rotate(),ye=w.invert(m.midPt);m.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":w.scale()/m.fitScale,"geo.center.lon":ye[0],"geo.center.lat":ye[1],"geo.projection.rotation.lon":-ne[0]})}function se(){v.select(this).style(a),ue&&s(m,w,ce)}function ce(ne){var ye=w.rotate(),le=w.invert(m.midPt);ne("projection.rotation.lon",-ye[0]),ne("center.lon",le[0]),ne("center.lat",le[1])}return F.on("zoomstart",_e).on("zoom",Y).on("zoomend",se),F}function p(m,w){w.rotate(),w.scale();var F=i(m,w),z=h(F,"zoomstart","zoom","zoomend"),U=0,V=F.on,G;F.on("zoomstart",function(){v.select(this).style(r);var ee=v.mouse(this),ue=w.rotate(),xe=ue,ge=w.translate(),_e=y(ue);G=d(w,ee),V.call(F,"zoom",function(){var Y=v.mouse(this);if(w.scale(v.event.scale),!G)ee=Y,G=d(w,ee);else if(d(w,Y)){w.rotate(ue).translate(ge);var se=d(w,Y),ce=C(G,se),ne=I(g(_e,ce)),ye=f(ne,G,xe);(!isFinite(ye[0])||!isFinite(ye[1])||!isFinite(ye[2]))&&(ye=xe),w.rotate(ye),xe=ye}O(z.of(this,arguments))}),j(z.of(this,arguments))}).on("zoomend",function(){v.select(this).style(a),V.call(F,"zoom",null),H(z.of(this,arguments)),s(m,w,W)}).on("zoom.redraw",function(){m.render(!0);var ee=w.rotate();m.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":w.scale()/m.fitScale,"geo.projection.rotation.lon":-ee[0],"geo.projection.rotation.lat":-ee[1]})});function j(ee){U++||ee({type:"zoomstart"})}function O(ee){ee({type:"zoom"})}function H(ee){--U||ee({type:"zoomend"})}function W(ee){var ue=w.rotate();ee("projection.rotation.lon",-ue[0]),ee("projection.rotation.lat",-ue[1])}return v.rebind(F,z,"on")}function d(m,w){var F=m.invert(w);return F&&isFinite(F[0])&&isFinite(F[1])&&T(F)}function y(m){var w=.5*m[0]*L,F=.5*m[1]*L,z=.5*m[2]*L,U=Math.sin(w),V=Math.cos(w),G=Math.sin(F),j=Math.cos(F),O=Math.sin(z),H=Math.cos(z);return[V*j*H+U*G*O,U*j*H-V*G*O,V*G*H+U*j*O,V*j*O-U*G*H]}function g(m,w){var F=m[0],z=m[1],U=m[2],V=m[3],G=w[0],j=w[1],O=w[2],H=w[3];return[F*G-z*j-U*O-V*H,F*j+z*G+U*H-V*O,F*O-z*H+U*G+V*j,F*H+z*O-U*j+V*G]}function C(m,w){if(!(!m||!w)){var F=_(m,w),z=Math.sqrt(E(F,F)),U=.5*Math.acos(Math.max(-1,Math.min(1,E(m,w)))),V=Math.sin(U)/z;return z&&[Math.cos(U),F[2]*V,-F[1]*V,F[0]*V]}}function f(m,w,F){var z=k(w,2,m[0]);z=k(z,1,m[1]),z=k(z,0,m[2]-F[2]);var U=w[0],V=w[1],G=w[2],j=z[0],O=z[1],H=z[2],W=Math.atan2(V,U)*t,ee=Math.sqrt(U*U+V*V),ue,xe;Math.abs(O)>ee?(xe=(O>0?90:-90)-W,ue=0):(xe=Math.asin(O/ee)*t-W,ue=Math.sqrt(ee*ee-O*O));var ge=180-xe-2*W,_e=(Math.atan2(H,j)-Math.atan2(G,ue))*t,Y=(Math.atan2(H,j)-Math.atan2(G,-ue))*t,se=x(F[0],F[1],xe,_e),ce=x(F[0],F[1],ge,Y);return se<=ce?[xe,_e,F[2]]:[ge,Y,F[2]]}function x(m,w,F,z){var U=A(F-m),V=A(z-w);return Math.sqrt(U*U+V*V)}function A(m){return(m%360+540)%360-180}function k(m,w,F){var z=F*L,U=m.slice(),V=w===0?1:0,G=w===2?1:2,j=Math.cos(z),O=Math.sin(z);return U[V]=m[V]*j-m[G]*O,U[G]=m[G]*j+m[V]*O,U}function I(m){return[Math.atan2(2*(m[0]*m[1]+m[2]*m[3]),1-2*(m[1]*m[1]+m[2]*m[2]))*t,Math.asin(Math.max(-1,Math.min(1,2*(m[0]*m[2]-m[3]*m[1]))))*t,Math.atan2(2*(m[0]*m[3]+m[1]*m[2]),1-2*(m[2]*m[2]+m[3]*m[3]))*t]}function T(m){var w=m[0]*L,F=m[1]*L,z=Math.cos(F);return[z*Math.cos(w),z*Math.sin(w),Math.sin(F)]}function E(m,w){for(var F=0,z=0,U=m.length;z0&&O._module.calcGeoJSON(j,z)}if(!U){var H=this.updateProjection(F,z);if(H)return;(!this.viewInitial||this.scope!==V.scope)&&this.saveViewInitial(V)}this.scope=V.scope,this.updateBaseLayers(z,V),this.updateDims(z,V),this.updateFx(z,V),c.generalUpdatePerTraceModule(this.graphDiv,this,F,V);var W=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=W.selectAll(".point"),this.dataPoints.text=W.selectAll("text"),this.dataPaths.line=W.selectAll(".js-line");var ee=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=ee.selectAll("path"),this._render()},_.updateProjection=function(F,z){var U=this.graphDiv,V=z[this.id],G=z._size,j=V.domain,O=V.projection,H=V.lonaxis,W=V.lataxis,ee=H._ax,ue=W._ax,xe=this.projection=h(V),ge=[[G.l+G.w*j.x[0],G.t+G.h*(1-j.y[1])],[G.l+G.w*j.x[1],G.t+G.h*(1-j.y[0])]],_e=V.center||{},Y=O.rotation||{},se=H.range||[],ce=W.range||[];if(V.fitbounds){ee._length=ge[1][0]-ge[0][0],ue._length=ge[1][1]-ge[0][1],ee.range=d(U,ee),ue.range=d(U,ue);var ne=(ee.range[0]+ee.range[1])/2,ye=(ue.range[0]+ue.range[1])/2;if(V._isScoped)_e={lon:ne,lat:ye};else if(V._isClipped){_e={lon:ne,lat:ye},Y={lon:ne,lat:ye,roll:Y.roll};var le=O.type,Z=A.lonaxisSpan[le]/2||180,de=A.lataxisSpan[le]/2||90;se=[ne-Z,ne+Z],ce=[ye-de,ye+de]}else _e={lon:ne,lat:ye},Y={lon:ne,lat:Y.lat,roll:Y.roll}}xe.center([_e.lon-Y.lon,_e.lat-Y.lat]).rotate([-Y.lon,-Y.lat,Y.roll]).parallels(O.parallels);var pe=w(se,ce);xe.fitExtent(ge,pe);var Te=this.bounds=xe.getBounds(pe),Ne=this.fitScale=xe.scale(),$e=xe.translate();if(V.fitbounds){var Ze=xe.getBounds(w(ee.range,ue.range)),Xe=Math.min((Te[1][0]-Te[0][0])/(Ze[1][0]-Ze[0][0]),(Te[1][1]-Te[0][1])/(Ze[1][1]-Ze[0][1]));isFinite(Xe)?xe.scale(Xe*Ne):a.warn("Something went wrong during"+this.id+"fitbounds computations.")}else xe.scale(O.scale*Ne);var it=this.midPt=[(Te[0][0]+Te[1][0])/2,(Te[0][1]+Te[1][1])/2];if(xe.translate([$e[0]+(it[0]-$e[0]),$e[1]+(it[1]-$e[1])]).clipExtent(Te),V._isAlbersUsa){var yt=xe([_e.lon,_e.lat]),bt=xe.translate();xe.translate([bt[0]-(yt[0]-bt[0]),bt[1]-(yt[1]-bt[1])])}},_.updateBaseLayers=function(F,z){var U=this,V=U.topojson,G=U.layers,j=U.basePaths;function O(ge){return ge==="lonaxis"||ge==="lataxis"}function H(ge){return!!A.lineLayers[ge]}function W(ge){return!!A.fillLayers[ge]}var ee=this.hasChoropleth?A.layersForChoropleth:A.layers,ue=ee.filter(function(ge){return H(ge)||W(ge)?z["show"+ge]:O(ge)?z[ge].showgrid:!0}),xe=U.framework.selectAll(".layer").data(ue,String);xe.exit().each(function(ge){delete G[ge],delete j[ge],v.select(this).remove()}),xe.enter().append("g").attr("class",function(ge){return"layer "+ge}).each(function(ge){var _e=G[ge]=v.select(this);ge==="bg"?U.bgRect=_e.append("rect").style("pointer-events","all"):O(ge)?j[ge]=_e.append("path").style("fill","none"):ge==="backplot"?_e.append("g").classed("choroplethlayer",!0):ge==="frontplot"?_e.append("g").classed("scatterlayer",!0):H(ge)?j[ge]=_e.append("path").style("fill","none").style("stroke-miterlimit",2):W(ge)&&(j[ge]=_e.append("path").style("stroke","none"))}),xe.order(),xe.each(function(ge){var _e=j[ge],Y=A.layerNameToAdjective[ge];ge==="frame"?_e.datum(A.sphereSVG):H(ge)||W(ge)?_e.datum(T(V,V.objects[ge])):O(ge)&&_e.datum(m(ge,z,F)).call(i.stroke,z[ge].gridcolor).call(s.dashLine,z[ge].griddash,z[ge].gridwidth),H(ge)?_e.call(i.stroke,z[Y+"color"]).call(s.dashLine,"",z[Y+"width"]):W(ge)&&_e.call(i.fill,z[Y+"color"])})},_.updateDims=function(F,z){var U=this.bounds,V=(z.framewidth||0)/2,G=U[0][0]-V,j=U[0][1]-V,O=U[1][0]-G+V,H=U[1][1]-j+V;s.setRect(this.clipRect,G,j,O,H),this.bgRect.call(s.setRect,G,j,O,H).call(i.fill,z.bgcolor),this.xaxis._offset=G,this.xaxis._length=O,this.yaxis._offset=j,this.yaxis._length=H},_.updateFx=function(F,z){var U=this,V=U.graphDiv,G=U.bgRect,j=F.dragmode,O=F.clickmode;if(U.isStatic)return;function H(){var xe=U.viewInitial,ge={};for(var _e in xe)ge[U.id+"."+_e]=xe[_e];r.call("_guiRelayout",V,ge),V.emit("plotly_doubleclick",null)}function W(xe){return U.projection.invert([xe[0]+U.xaxis._offset,xe[1]+U.yaxis._offset])}var ee=function(xe,ge){if(ge.isRect){var _e=xe.range={};_e[U.id]=[W([ge.xmin,ge.ymin]),W([ge.xmax,ge.ymax])]}else{var Y=xe.lassoPoints={};Y[U.id]=ge.map(W)}},ue={element:U.bgRect.node(),gd:V,plotinfo:{id:U.id,xaxis:U.xaxis,yaxis:U.yaxis,fillRangeItems:ee},xaxes:[U.xaxis],yaxes:[U.yaxis],subplot:U.id,clickFn:function(xe){xe===2&&C(V)}};j==="pan"?(G.node().onmousedown=null,G.call(x(U,z)),G.on("dblclick.zoom",H),V._context._scrollZoom.geo||G.on("wheel.zoom",null)):(j==="select"||j==="lasso")&&(G.on(".zoom",null),ue.prepFn=function(xe,ge,_e){g(xe,ge,_e,ue,j)},y.init(ue)),G.on("mousemove",function(){var xe=U.projection.invert(a.getPositionFromD3Event());if(!xe)return y.unhover(V,v.event);U.xaxis.p2c=function(){return xe[0]},U.yaxis.p2c=function(){return xe[1]},o.hover(V,v.event,U.id)}),G.on("mouseout",function(){V._dragging||y.unhover(V,v.event)}),G.on("click",function(){j!=="select"&&j!=="lasso"&&(O.indexOf("select")>-1&&f(v.event,V,[U.xaxis],[U.yaxis],U.id,ue),O.indexOf("event")>-1&&o.click(V,v.event))})},_.makeFramework=function(){var F=this,z=F.graphDiv,U=z._fullLayout,V="clip"+U._uid+F.id;F.clipDef=U._clips.append("clipPath").attr("id",V),F.clipRect=F.clipDef.append("rect"),F.framework=v.select(F.container).append("g").attr("class","geo "+F.id).call(s.setClipUrl,V,z),F.project=function(G){var j=F.projection(G);return j?[j[0]-F.xaxis._offset,j[1]-F.yaxis._offset]:[null,null]},F.xaxis={_id:"x",c2p:function(G){return F.project(G)[0]}},F.yaxis={_id:"y",c2p:function(G){return F.project(G)[1]}},F.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(F.mockAxis,U)},_.saveViewInitial=function(F){var z=F.center||{},U=F.projection,V=U.rotation||{};this.viewInitial={fitbounds:F.fitbounds,"projection.scale":U.scale};var G;F._isScoped?G={"center.lon":z.lon,"center.lat":z.lat}:F._isClipped?G={"projection.rotation.lon":V.lon,"projection.rotation.lat":V.lat}:G={"center.lon":z.lon,"center.lat":z.lat,"projection.rotation.lon":V.lon},a.extendFlat(this.viewInitial,G)},_.render=function(F){this._hasMarkerAngles&&F?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},_._render=function(){var F=this.projection,z=F.getPath(),U;function V(j){var O=F(j.lonlat);return O?l(O[0],O[1]):null}function G(j){return F.isLonLatOverEdges(j.lonlat)?"none":null}for(U in this.basePaths)this.basePaths[U].attr("d",z);for(U in this.dataPaths)this.dataPaths[U].attr("d",function(j){return z(j.geojson)});for(U in this.dataPoints)this.dataPoints[U].attr("display",G).attr("transform",V)};function h(F){var z=F.projection,U=z.type,V=A.projNames[U];V="geo"+a.titleCase(V);for(var G=S[V]||t[V],j=G(),O=F._isSatellite?Math.acos(1/z.distance)*180/Math.PI:F._isClipped?A.lonaxisSpan[U]/2:null,H=["center","rotate","parallels","clipExtent"],W=function(xe){return xe?j:[]},ee=0;eeY}else return!1},j.getPath=function(){return M().projection(j)},j.getBounds=function(xe){return j.getPath().bounds(xe)},j.precision(A.precision),F._isSatellite&&j.tilt(z.tilt).distance(z.distance),O&&j.clipAngle(O-A.clipPad),j}function m(F,z,U){var V=1e-6,G=2.5,j=z[F],O=A.scopeDefaults[z.scope],H,W,ee;F==="lonaxis"?(H=O.lonaxisRange,W=O.lataxisRange,ee=function(ye,le){return[ye,le]}):F==="lataxis"&&(H=O.lataxisRange,W=O.lonaxisRange,ee=function(ye,le){return[le,ye]});var ue={type:"linear",range:[H[0],H[1]-V],tick0:j.tick0,dtick:j.dtick};p.setConvert(ue,U);var xe=p.calcTicks(ue);!z.isScoped&&F==="lonaxis"&&xe.pop();for(var ge=xe.length,_e=new Array(ge),Y=0;Y0&&G<0&&(G+=360);var H=(G-V)/4;return{type:"Polygon",coordinates:[[[V,j],[V,O],[V+H,O],[V+2*H,O],[V+3*H,O],[G,O],[G,j],[G-H,j],[G-2*H,j],[G-3*H,j],[V,j]]]}}}}),hF=Re({"src/plots/geo/layout_attributes.js"(ae,K){var v=du(),S=af().attributes,M=up().dash,L=jI(),t=bf().overrideAll,r=hg(),a={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:v.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:M},l=K.exports=t({domain:S({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:r(L.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:r(L.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:v.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:L.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:L.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:L.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:L.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:v.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:v.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:v.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:v.background},lonaxis:a,lataxis:a},"plot","from-root");l.uirevision={valType:"any",editType:"none"}}}),yX=Re({"src/plots/geo/layout_defaults.js"(ae,K){var v=Rn(),S=F0(),M=Lp().getSubplotData,L=jI(),t=hF(),r=L.axesNames;K.exports=function(i,s,o){S(i,s,o,{type:"geo",attributes:t,handleDefaults:a,fullData:o,partition:"y"})};function a(l,i,s,o){var c=M(o.fullData,"geo",o.id),p=c.map(function(ce){return ce.index}),d=s("resolution"),y=s("scope"),g=L.scopeDefaults[y],C=s("projection.type",g.projType),f=i._isAlbersUsa=C==="albers usa";f&&(y=i.scope="usa");var x=i._isScoped=y!=="world",A=i._isSatellite=C==="satellite",k=i._isConic=C.indexOf("conic")!==-1||C==="albers",I=i._isClipped=!!L.lonaxisSpan[C];if(l.visible===!1){var T=v.extendDeep({},i._template);T.showcoastlines=!1,T.showcountries=!1,T.showframe=!1,T.showlakes=!1,T.showland=!1,T.showocean=!1,T.showrivers=!1,T.showsubunits=!1,T.lonaxis&&(T.lonaxis.showgrid=!1),T.lataxis&&(T.lataxis.showgrid=!1),i._template=T}for(var E=s("visible"),_,h=0;h0&&W<0&&(W+=360);var ee=(H+W)/2,ue;if(!f){var xe=x?g.projRotate:[ee,0,0];ue=s("projection.rotation.lon",xe[0]),s("projection.rotation.lat",xe[1]),s("projection.rotation.roll",xe[2]),_=s("showcoastlines",!x&&E),_&&(s("coastlinecolor"),s("coastlinewidth")),_=s("showocean",E?void 0:!1),_&&s("oceancolor")}var ge,_e;if(f?(ge=-96.6,_e=38.7):(ge=x?ee:ue,_e=(O[0]+O[1])/2),s("center.lon",ge),s("center.lat",_e),A&&(s("projection.tilt"),s("projection.distance")),k){var Y=g.projParallels||[0,60];s("projection.parallels",Y)}s("projection.scale"),_=s("showland",E?void 0:!1),_&&s("landcolor"),_=s("showlakes",E?void 0:!1),_&&s("lakecolor"),_=s("showrivers",E?void 0:!1),_&&(s("rivercolor"),s("riverwidth")),_=s("showcountries",x&&y!=="usa"&&E),_&&(s("countrycolor"),s("countrywidth")),(y==="usa"||y==="north america"&&d===50)&&(s("showsubunits",E),s("subunitcolor"),s("subunitwidth")),x||(_=s("showframe",E),_&&(s("framecolor"),s("framewidth"))),s("bgcolor");var se=s("fitbounds");se&&(delete i.projection.scale,x?(delete i.center.lon,delete i.center.lat):I?(delete i.center.lon,delete i.center.lat,delete i.projection.rotation.lon,delete i.projection.rotation.lat,delete i.lonaxis.range,delete i.lataxis.range):(delete i.center.lon,delete i.center.lat,delete i.projection.rotation.lon))}}}),dF=Re({"src/plots/geo/index.js"(ae,K){var v=Lp().getSubplotCalcData,S=Rn().counterRegex,M=gX(),L="geo",t=S(L),r={};r[L]={valType:"subplotid",dflt:L,editType:"calc"};function a(s){for(var o=s._fullLayout,c=s.calcdata,p=o._subplots[L],d=0;d")}}}}),DP=Re({"src/traces/choropleth/event_data.js"(ae,K){K.exports=function(S,M,L,t,r){S.location=M.location,S.z=M.z;var a=t[r];return a.fIn&&a.fIn.properties&&(S.properties=a.fIn.properties),S.ct=a.ct,S}}}),PP=Re({"src/traces/choropleth/select.js"(ae,K){K.exports=function(S,M){var L=S.cd,t=S.xaxis,r=S.yaxis,a=[],l,i,s,o,c;if(M===!1)for(l=0;l=Math.min(W,ee)&&C<=Math.max(W,ee)?0:1/0}if(z=Math.min(ue,xe)&&f<=Math.max(ue,xe)?0:1/0}G=Math.sqrt(z*z+U*U),h=A[F]}}}else for(F=A.length-1;F>-1;F--)_=A[F],m=y[_],w=g[_],z=p.c2p(m)-C,U=d.c2p(w)-f,V=Math.sqrt(z*z+U*U),V100},ae.isDotSymbol=function(v){return typeof v=="string"?K.DOT_RE.test(v):v>200}}}),AX=Re({"src/traces/scattergl/defaults.js"(ae,K){var v=Rn(),S=es(),M=NP(),L=qI(),t=Wg(),r=Mu(),a=yg(),l=_g(),i=Yp(),s=xg(),o=Rp(),c=Sm();K.exports=function(d,y,g,C){function f(h,m){return v.coerce(d,y,L,h,m)}var x=d.marker?M.isOpenSymbol(d.marker.symbol):!1,A=r.isBubble(d),k=a(d,y,C,f);if(!k){y.visible=!1;return}l(d,y,C,f),f("xhoverformat"),f("yhoverformat");var I=k>>1,d=a[p],y=i!==void 0?i(d,l):d-l;y>=0?(c=p,o=p-1):s=p+1}return c}function S(a,l,i,s,o){for(var c=o+1;s<=o;){var p=s+o>>>1,d=a[p],y=i!==void 0?i(d,l):d-l;y>0?(c=p,o=p-1):s=p+1}return c}function M(a,l,i,s,o){for(var c=s-1;s<=o;){var p=s+o>>>1,d=a[p],y=i!==void 0?i(d,l):d-l;y<0?(c=p,s=p+1):o=p-1}return c}function L(a,l,i,s,o){for(var c=s-1;s<=o;){var p=s+o>>>1,d=a[p],y=i!==void 0?i(d,l):d-l;y<=0?(c=p,s=p+1):o=p-1}return c}function t(a,l,i,s,o){for(;s<=o;){var c=s+o>>>1,p=a[c],d=i!==void 0?i(p,l):p-l;if(d===0)return c;d<=0?s=c+1:o=c-1}return-1}function r(a,l,i,s,o,c){return typeof i=="function"?c(a,l,i,s===void 0?0:s|0,o===void 0?a.length-1:o|0):c(a,l,void 0,i===void 0?0:i|0,s===void 0?a.length-1:s|0)}K.exports={ge:function(a,l,i,s,o){return r(a,l,i,s,o,v)},gt:function(a,l,i,s,o){return r(a,l,i,s,o,S)},lt:function(a,l,i,s,o){return r(a,l,i,s,o,M)},le:function(a,l,i,s,o){return r(a,l,i,s,o,L)},eq:function(a,l,i,s,o){return r(a,l,i,s,o,t)}}}}),r_=Re({"node_modules/pick-by-alias/index.js"(ae,K){K.exports=function(L,t,r){var a={},l,i;if(typeof t=="string"&&(t=S(t)),Array.isArray(t)){var s={};for(i=0;i1&&(M=arguments),typeof M=="string"?M=M.split(/\s/).map(parseFloat):typeof M=="number"&&(M=[M]),M.length&&typeof M[0]=="number"?M.length===1?L={width:M[0],height:M[0],x:0,y:0}:M.length===2?L={width:M[0],height:M[1],x:0,y:0}:L={x:M[0],y:M[1],width:M[2]-M[0]||0,height:M[3]-M[1]||0}:M&&(M=v(M,{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"}),L={x:M.left||0,y:M.top||0},M.width==null?M.right?L.width=M.right-L.x:L.width=0:L.width=M.width,M.height==null?M.bottom?L.height=M.bottom-L.y:L.height=0:L.height=M.height),L}}}),zT=Re({"node_modules/array-bounds/index.js"(ae,K){K.exports=v;function v(S,M){if(!S||S.length==null)throw Error("Argument should be an array");M==null?M=1:M=Math.floor(M);for(var L=Array(M*2),t=0;tr&&(r=S[l]),S[l]>>1,A;y.dtype||(y.dtype="array"),typeof y.dtype=="string"?A=new(i(y.dtype))(x):y.dtype&&(A=y.dtype,Array.isArray(A)&&(A.length=x));for(let z=0;zg||O>o){for(let ye=0;yepe||ee>Te||ue=ge||Z===de)return;let Ne=k[le];de===void 0&&(de=Ne.length);for(let Ve=Z;Ve=G&&Se<=O&&Je>=j&&Je<=H&&_e.push(ze)}let $e=I[le],Ze=$e[Z*4+0],Xe=$e[Z*4+1],it=$e[Z*4+2],yt=$e[Z*4+3],bt=se($e,Z+1),mt=ye*.5,ht=le+1;Y(ce,ne,mt,ht,Ze,Xe||it||yt||bt),Y(ce,ne+mt,mt,ht,Xe,it||yt||bt),Y(ce+mt,ne,mt,ht,it,yt||bt),Y(ce+mt,ne+mt,mt,ht,yt,bt)}function se(ce,ne){let ye=null,le=0;for(;ye===null;)if(ye=ce[ne*4+le],le++,le>ce.length)return null;return ye}return _e}function w(z,U,V,G,j){let O=[];for(let H=0;H1&&(d=1),d<-1&&(d=-1),p*Math.acos(d)},r=function(i,s,o,c,p,d,y,g,C,f,x,A){var k=Math.pow(p,2),I=Math.pow(d,2),T=Math.pow(x,2),E=Math.pow(A,2),_=k*I-k*E-I*T;_<0&&(_=0),_/=k*E+I*T,_=Math.sqrt(_)*(y===g?-1:1);var h=_*p/d*A,m=_*-d/p*x,w=f*h-C*m+(i+o)/2,F=C*h+f*m+(s+c)/2,z=(x-h)/p,U=(A-m)/d,V=(-x-h)/p,G=(-A-m)/d,j=t(1,0,z,U),O=t(z,U,V,G);return g===0&&O>0&&(O-=S),g===1&&O<0&&(O+=S),[w,F,j,O]},a=function(i){var s=i.px,o=i.py,c=i.cx,p=i.cy,d=i.rx,y=i.ry,g=i.xAxisRotation,C=g===void 0?0:g,f=i.largeArcFlag,x=f===void 0?0:f,A=i.sweepFlag,k=A===void 0?0:A,I=[];if(d===0||y===0)return[];var T=Math.sin(C*S/360),E=Math.cos(C*S/360),_=E*(s-c)/2+T*(o-p)/2,h=-T*(s-c)/2+E*(o-p)/2;if(_===0&&h===0)return[];d=Math.abs(d),y=Math.abs(y);var m=Math.pow(_,2)/Math.pow(d,2)+Math.pow(h,2)/Math.pow(y,2);m>1&&(d*=Math.sqrt(m),y*=Math.sqrt(m));var w=r(s,o,c,p,d,y,x,k,T,E,_,h),F=v(w,4),z=F[0],U=F[1],V=F[2],G=F[3],j=Math.abs(G)/(S/4);Math.abs(1-j)<1e-7&&(j=1);var O=Math.max(Math.ceil(j),1);G/=O;for(var H=0;H4?(l=f[f.length-4],i=f[f.length-3]):(l=d,i=y),a.push(f)}return a}function M(t,r,a,l){return["C",t,r,a,l,a,l]}function L(t,r,a,l,i,s){return["C",t/3+2/3*a,r/3+2/3*l,i/3+2/3*a,s/3+2/3*l,i,s]}}}),mF=Re({"node_modules/is-svg-path/index.js"(ae,K){K.exports=function(S){return typeof S!="string"?!1:(S=S.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(S)&&/[\dz]$/i.test(S)&&S.length>4))}}}),DX=Re({"node_modules/svg-path-bounds/index.js"(ae,K){var v=py(),S=vF(),M=RX(),L=mF(),t=lx();K.exports=r;function r(a){if(Array.isArray(a)&&a.length===1&&typeof a[0]=="string"&&(a=a[0]),typeof a=="string"&&(t(L(a),"String is not an SVG path."),a=v(a)),t(Array.isArray(a),"Argument should be a string or an array of path segments."),a=S(a),a=M(a),!a.length)return[0,0,0,0];for(var l=[1/0,1/0,-1/0,-1/0],i=0,s=a.length;il[2]&&(l[2]=o[c+0]),o[c+1]>l[3]&&(l[3]=o[c+1]);return l}}}),PX=Re({"node_modules/normalize-svg-path/index.js"(ae,K){var v=Math.PI,S=l(120);K.exports=M;function M(i){for(var s,o=[],c=0,p=0,d=0,y=0,g=null,C=null,f=0,x=0,A=0,k=i.length;A7&&(o.push(I.splice(0,7)),I.unshift("C"));break;case"S":var E=f,_=x;(s=="C"||s=="S")&&(E+=E-c,_+=_-p),I=["C",E,_,I[1],I[2],I[3],I[4]];break;case"T":s=="Q"||s=="T"?(g=f*2-g,C=x*2-C):(g=f,C=x),I=t(f,x,g,C,I[1],I[2]);break;case"Q":g=I[1],C=I[2],I=t(f,x,I[1],I[2],I[3],I[4]);break;case"L":I=L(f,x,I[1],I[2]);break;case"H":I=L(f,x,I[1],x);break;case"V":I=L(f,x,f,I[1]);break;case"Z":I=L(f,x,d,y);break}s=T,f=I[I.length-2],x=I[I.length-1],I.length>4?(c=I[I.length-4],p=I[I.length-3]):(c=f,p=x),o.push(I)}return o}function L(i,s,o,c){return["C",i,s,o,c,o,c]}function t(i,s,o,c,p,d){return["C",i/3+2/3*o,s/3+2/3*c,p/3+2/3*o,d/3+2/3*c,p,d]}function r(i,s,o,c,p,d,y,g,C,f){if(f)w=f[0],F=f[1],h=f[2],m=f[3];else{var x=a(i,s,-p);i=x.x,s=x.y,x=a(g,C,-p),g=x.x,C=x.y;var A=(i-g)/2,k=(s-C)/2,I=A*A/(o*o)+k*k/(c*c);I>1&&(I=Math.sqrt(I),o=I*o,c=I*c);var T=o*o,E=c*c,_=(d==y?-1:1)*Math.sqrt(Math.abs((T*E-T*k*k-E*A*A)/(T*k*k+E*A*A)));_==1/0&&(_=1);var h=_*o*k/c+(i+g)/2,m=_*-c*A/o+(s+C)/2,w=Math.asin(((s-m)/c).toFixed(9)),F=Math.asin(((C-m)/c).toFixed(9));w=iF&&(w=w-v*2),!y&&F>w&&(F=F-v*2)}if(Math.abs(F-w)>S){var z=F,U=g,V=C;F=w+S*(y&&F>w?1:-1),g=h+o*Math.cos(F),C=m+c*Math.sin(F);var G=r(g,C,o,c,p,0,y,U,V,[F,z,h,m])}var j=Math.tan((F-w)/4),O=4/3*o*j,H=4/3*c*j,W=[2*i-(i+O*Math.sin(w)),2*s-(s-H*Math.cos(w)),g+O*Math.sin(F),C-H*Math.cos(F),g,C];if(f)return W;G&&(W=W.concat(G));for(var ee=0;ee0?a.strokeStyle="white":a.strokeStyle="black",a.lineWidth=Math.abs(g)),a.translate(p*.5,d*.5),a.scale(x,x),s()){var A=new Path2D(o);a.fill(A),g&&a.stroke(A)}else{var k=S(o);M(a,k),a.fill(),g&&a.stroke()}a.setTransform(1,0,0,1,0,0);var I=t(a,{cutoff:c.cutoff!=null?c.cutoff:.5,radius:c.radius!=null?c.radius:y*.5});return I}var i;function s(){if(i!=null)return i;var o=document.createElement("canvas").getContext("2d");if(o.canvas.width=o.canvas.height=1,!window.Path2D)return i=!1;var c=new Path2D("M0,0h1v1h-1v-1Z");o.fillStyle="black",o.fill(c);var p=o.getImageData(0,0,1,1);return i=p&&p.data&&p.data[3]===255}}}),OT=Re({"src/traces/scattergl/convert.js"(ae,K){var v=da(),S=OX(),M=Uw(),L=es(),t=Rn(),r=t.isArrayOrTypedArray,a=qs(),l=fh(),i=Cx().formatColor,s=Mu(),o=pg(),c=NP(),p=Gw(),d=Ec().DESELECTDIM,y={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},g=Xp().appendArrayPointValue;function C(G,j){var O,H={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},W=G._context.plotGlPixelRatio;if(j.visible!==!0)return H;if(s.hasText(j)&&(H.text=f(G,j),H.textSel=I(G,j,j.selected),H.textUnsel=I(G,j,j.unselected)),s.hasMarkers(j)&&(H.marker=A(G,j),H.markerSel=k(G,j,j.selected),H.markerUnsel=k(G,j,j.unselected),!j.unselected&&r(j.marker.opacity))){var ee=j.marker.opacity;for(H.markerUnsel.opacity=new Array(ee.length),O=0;O500?"bold":"normal":G}function A(G,j){var O=j._length,H=j.marker,W={},ee,ue=r(H.symbol),xe=r(H.angle),ge=r(H.color),_e=r(H.line.color),Y=r(H.opacity),se=r(H.size),ce=r(H.line.width),ne;if(ue||(ne=c.isOpenSymbol(H.symbol)),ue||ge||_e||Y||xe){W.symbols=new Array(O),W.angles=new Array(O),W.colors=new Array(O),W.borderColors=new Array(O);var ye=H.symbol,le=H.angle,Z=i(H,H.opacity,O),de=i(H.line,H.opacity,O);if(!r(de[0])){var pe=de;for(de=Array(O),ee=0;eep.TOO_MANY_POINTS||s.hasMarkers(j)?"rect":"round";if(_e&&j.connectgaps){var se=ee[0],ce=ee[1];for(ue=0;ue1?ge[ue]:ge[0]:ge,ne=r(_e)?_e.length>1?_e[ue]:_e[0]:_e,ye=y[ce],le=y[ne],Z=Y?Y/.8+1:0,de=-le*Z-le*.5;ee.offset[ue]=[ye*Z/se,de/se]}}return ee}K.exports={style:C,markerStyle:A,markerSelection:k,linePositions:z,errorBarPositions:U,textPosition:V}}}),gF=Re({"src/traces/scattergl/scene_update.js"(ae,K){var v=Rn();K.exports=function(M,L){var t=L._scene,r={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},a={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return L._scene||(t=L._scene={},t.init=function(){v.extendFlat(t,a,r)},t.init(),t.update=function(i){var s=v.repeat(i,t.count);if(t.fill2d&&t.fill2d.update(s),t.scatter2d&&t.scatter2d.update(s),t.line2d&&t.line2d.update(s),t.error2d&&t.error2d.update(s.concat(s)),t.select2d&&t.select2d.update(s),t.glText)for(var o=0;o=d,h=E*2,m={},w,F=k.makeCalcdata(x,"x"),z=I.makeCalcdata(x,"y"),U=t(x,k,"x",F),V=t(x,I,"y",z),G=U.vals,j=V.vals;x._x=G,x._y=j,x.xperiodalignment&&(x._origX=F,x._xStarts=U.starts,x._xEnds=U.ends),x.yperiodalignment&&(x._origY=z,x._yStarts=V.starts,x._yEnds=V.ends);var O=new Array(h),H=new Array(E);for(w=0;w1&&S.extendFlat(T.line,o.linePositions(C,x,A)),T.errorX||T.errorY){var E=o.errorBarPositions(C,x,A,k,I);T.errorX&&S.extendFlat(T.errorX,E.x),T.errorY&&S.extendFlat(T.errorY,E.y)}return T.text&&(S.extendFlat(T.text,{positions:A},o.textPosition(C,x,T.text,T.marker)),S.extendFlat(T.textSel,{positions:A},o.textPosition(C,x,T.text,T.markerSel)),S.extendFlat(T.textUnsel,{positions:A},o.textPosition(C,x,T.text,T.markerUnsel))),T}}}),yF=Re({"src/traces/scattergl/edit_style.js"(ae,K){var v=Rn(),S=ko(),M=Ec().DESELECTDIM;function L(t){var r=t[0],a=r.trace,l=r.t,i=l._scene,s=l.index,o=i.selectBatch[s],c=i.unselectBatch[s],p=i.textOptions[s],d=i.textSelectedOptions[s]||{},y=i.textUnselectedOptions[s]||{},g=v.extendFlat({},p),C,f;if(o.length||c.length){var x=d.color,A=y.color,k=p.color,I=v.isArrayOrTypedArray(k);for(g.color=new Array(a._length),C=0;C>>24,a=(L&16711680)>>>16,l=(L&65280)>>>8,i=L&255;return t===!1?[r,a,l,i]:[r/255,a/255,l/255,i/255]}}}),gp=Re({"node_modules/object-assign/index.js"(ae,K){var v=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;function L(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function t(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var a={},l=0;l<10;l++)a["_"+String.fromCharCode(l)]=l;var i=Object.getOwnPropertyNames(a).map(function(o){return a[o]});if(i.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(o){s[o]=o}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}K.exports=t()?Object.assign:function(r,a){for(var l,i=L(r),s,o=1;om.length)&&(w=m.length);for(var F=0,z=new Array(w);F 1.0 + delta) { + discard; + } + + alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius); + + float borderRadius = fragBorderRadius; + float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius); + vec4 color = mix(fragColor, fragBorderColor, ratio); + color.a *= alpha * opacity; + gl_FragColor = color; +} +`]),ge.vert=g([`precision highp float; +#define GLSLIFY 1 + +attribute float x, y, xFract, yFract; +attribute float size, borderSize; +attribute vec4 colorId, borderColorId; +attribute float isActive; + +// \`invariant\` effectively turns off optimizations for the position. +// We need this because -fast-math on M1 Macs is re-ordering +// floating point operations in a way that causes floating point +// precision limits to put points in the wrong locations. +invariant gl_Position; + +uniform bool constPointSize; +uniform float pixelRatio; +uniform vec2 paletteSize, scale, scaleFract, translate, translateFract; +uniform sampler2D paletteTexture; + +const float maxSize = 100.; + +varying vec4 fragColor, fragBorderColor; +varying float fragBorderRadius, fragWidth; + +float pointSizeScale = (constPointSize) ? 2. : pixelRatio; + +bool isDirect = (paletteSize.x < 1.); + +vec4 getColor(vec4 id) { + return isDirect ? id / 255. : texture2D(paletteTexture, + vec2( + (id.x + .5) / paletteSize.x, + (id.y + .5) / paletteSize.y + ) + ); +} + +void main() { + // ignore inactive points + if (isActive == 0.) return; + + vec2 position = vec2(x, y); + vec2 positionFract = vec2(xFract, yFract); + + vec4 color = getColor(colorId); + vec4 borderColor = getColor(borderColorId); + + float size = size * maxSize / 255.; + float borderSize = borderSize * maxSize / 255.; + + gl_PointSize = (size + borderSize) * pointSizeScale; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + gl_Position = vec4(pos * 2. - 1., 0., 1.); + + fragBorderRadius = 1. - 2. * borderSize / (size + borderSize); + fragColor = color; + fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor; + fragWidth = 1. / gl_PointSize; +} +`]),A&&(ge.frag=ge.frag.replace("smoothstep","smoothStep"),xe.frag=xe.frag.replace("smoothstep","smoothStep")),this.drawCircle=m(ge)}E.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},E.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},E.prototype.draw=function(){for(var m=this,w=arguments.length,F=new Array(w),z=0;zze)?ht.tree=d(mt,{bounds:vt}):ze&&ze.length&&(ht.tree=ze),ht.tree){var Kt={primitive:"points",usage:"static",data:ht.tree,type:"uint32"};ht.elements?ht.elements(Kt):ht.elements=G.elements(Kt)}var Qt=k.float32(mt);Se({data:Qt,usage:"dynamic"});var fr=k.fract32(mt,Qt);return Je({data:fr,usage:"dynamic"}),_t({data:new Uint8Array(At),type:"uint8",usage:"stream"}),mt}},{marker:function(mt,ht,Ve){var ze=ht.activation;if(ze.forEach(function(fr){return fr&&fr.destroy&&fr.destroy()}),ze.length=0,!mt||typeof mt[0]=="number"){var Se=m.addMarker(mt);ze[Se]=!0}else{for(var Je=[],_t=0,At=Math.min(mt.length,ht.count);_t=0)return U;var V;if(m instanceof Uint8Array||m instanceof Uint8ClampedArray)V=m;else{V=new Uint8Array(m.length);for(var G=0,j=m.length;Gz*4&&(this.tooManyColors=!0),this.updatePalette(F),U.length===1?U[0]:U},E.prototype.updatePalette=function(m){if(!this.tooManyColors){var w=this.maxColors,F=this.paletteTexture,z=Math.ceil(m.length*.25/w);if(z>1){m=m.slice();for(var U=m.length*.25%w;U80*O){xe=_e=G[0],ge=Y=G[1];for(var ye=O;ye_e&&(_e=se),ce>Y&&(Y=ce);ne=Math.max(_e-xe,Y-ge),ne=ne!==0?32767/ne:0}return L(ee,ue,O,xe,ge,ne,0),ue}function S(G,j,O,H,W){var ee,ue;if(W===V(G,j,O,H)>0)for(ee=j;ee=j;ee-=H)ue=F(ee,G[ee],G[ee+1],ue);return ue&&k(ue,ue.next)&&(z(ue),ue=ue.next),ue}function M(G,j){if(!G)return G;j||(j=G);var O=G,H;do if(H=!1,!O.steiner&&(k(O,O.next)||A(O.prev,O,O.next)===0)){if(z(O),O=j=O.prev,O===O.next)break;H=!0}else O=O.next;while(H||O!==j);return j}function L(G,j,O,H,W,ee,ue){if(G){!ue&&ee&&d(G,H,W,ee);for(var xe=G,ge,_e;G.prev!==G.next;){if(ge=G.prev,_e=G.next,ee?r(G,H,W,ee):t(G)){j.push(ge.i/O|0),j.push(G.i/O|0),j.push(_e.i/O|0),z(G),G=_e.next,xe=_e.next;continue}if(G=_e,G===xe){ue?ue===1?(G=a(M(G),j,O),L(G,j,O,H,W,ee,2)):ue===2&&l(G,j,O,H,W,ee):L(M(G),j,O,H,W,ee,1);break}}}}function t(G){var j=G.prev,O=G,H=G.next;if(A(j,O,H)>=0)return!1;for(var W=j.x,ee=O.x,ue=H.x,xe=j.y,ge=O.y,_e=H.y,Y=Wee?W>ue?W:ue:ee>ue?ee:ue,ne=xe>ge?xe>_e?xe:_e:ge>_e?ge:_e,ye=H.next;ye!==j;){if(ye.x>=Y&&ye.x<=ce&&ye.y>=se&&ye.y<=ne&&f(W,xe,ee,ge,ue,_e,ye.x,ye.y)&&A(ye.prev,ye,ye.next)>=0)return!1;ye=ye.next}return!0}function r(G,j,O,H){var W=G.prev,ee=G,ue=G.next;if(A(W,ee,ue)>=0)return!1;for(var xe=W.x,ge=ee.x,_e=ue.x,Y=W.y,se=ee.y,ce=ue.y,ne=xege?xe>_e?xe:_e:ge>_e?ge:_e,Z=Y>se?Y>ce?Y:ce:se>ce?se:ce,de=g(ne,ye,j,O,H),pe=g(le,Z,j,O,H),Te=G.prevZ,Ne=G.nextZ;Te&&Te.z>=de&&Ne&&Ne.z<=pe;){if(Te.x>=ne&&Te.x<=le&&Te.y>=ye&&Te.y<=Z&&Te!==W&&Te!==ue&&f(xe,Y,ge,se,_e,ce,Te.x,Te.y)&&A(Te.prev,Te,Te.next)>=0||(Te=Te.prevZ,Ne.x>=ne&&Ne.x<=le&&Ne.y>=ye&&Ne.y<=Z&&Ne!==W&&Ne!==ue&&f(xe,Y,ge,se,_e,ce,Ne.x,Ne.y)&&A(Ne.prev,Ne,Ne.next)>=0))return!1;Ne=Ne.nextZ}for(;Te&&Te.z>=de;){if(Te.x>=ne&&Te.x<=le&&Te.y>=ye&&Te.y<=Z&&Te!==W&&Te!==ue&&f(xe,Y,ge,se,_e,ce,Te.x,Te.y)&&A(Te.prev,Te,Te.next)>=0)return!1;Te=Te.prevZ}for(;Ne&&Ne.z<=pe;){if(Ne.x>=ne&&Ne.x<=le&&Ne.y>=ye&&Ne.y<=Z&&Ne!==W&&Ne!==ue&&f(xe,Y,ge,se,_e,ce,Ne.x,Ne.y)&&A(Ne.prev,Ne,Ne.next)>=0)return!1;Ne=Ne.nextZ}return!0}function a(G,j,O){var H=G;do{var W=H.prev,ee=H.next.next;!k(W,ee)&&I(W,H,H.next,ee)&&h(W,ee)&&h(ee,W)&&(j.push(W.i/O|0),j.push(H.i/O|0),j.push(ee.i/O|0),z(H),z(H.next),H=G=ee),H=H.next}while(H!==G);return M(H)}function l(G,j,O,H,W,ee){var ue=G;do{for(var xe=ue.next.next;xe!==ue.prev;){if(ue.i!==xe.i&&x(ue,xe)){var ge=w(ue,xe);ue=M(ue,ue.next),ge=M(ge,ge.next),L(ue,j,O,H,W,ee,0),L(ge,j,O,H,W,ee,0);return}xe=xe.next}ue=ue.next}while(ue!==G)}function i(G,j,O,H){var W=[],ee,ue,xe,ge,_e;for(ee=0,ue=j.length;ee=O.next.y&&O.next.y!==O.y){var xe=O.x+(W-O.y)*(O.next.x-O.x)/(O.next.y-O.y);if(xe<=H&&xe>ee&&(ee=xe,ue=O.x=O.x&&O.x>=_e&&H!==O.x&&f(Wue.x||O.x===ue.x&&p(ue,O)))&&(ue=O,se=ce)),O=O.next;while(O!==ge);return ue}function p(G,j){return A(G.prev,G,j.prev)<0&&A(j.next,G,G.next)<0}function d(G,j,O,H){var W=G;do W.z===0&&(W.z=g(W.x,W.y,j,O,H)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next;while(W!==G);W.prevZ.nextZ=null,W.prevZ=null,y(W)}function y(G){var j,O,H,W,ee,ue,xe,ge,_e=1;do{for(O=G,G=null,ee=null,ue=0;O;){for(ue++,H=O,xe=0,j=0;j<_e&&(xe++,H=H.nextZ,!!H);j++);for(ge=_e;xe>0||ge>0&&H;)xe!==0&&(ge===0||!H||O.z<=H.z)?(W=O,O=O.nextZ,xe--):(W=H,H=H.nextZ,ge--),ee?ee.nextZ=W:G=W,W.prevZ=ee,ee=W;O=H}ee.nextZ=null,_e*=2}while(ue>1);return G}function g(G,j,O,H,W){return G=(G-O)*W|0,j=(j-H)*W|0,G=(G|G<<8)&16711935,G=(G|G<<4)&252645135,G=(G|G<<2)&858993459,G=(G|G<<1)&1431655765,j=(j|j<<8)&16711935,j=(j|j<<4)&252645135,j=(j|j<<2)&858993459,j=(j|j<<1)&1431655765,G|j<<1}function C(G){var j=G,O=G;do(j.x=(G-ue)*(ee-xe)&&(G-ue)*(H-xe)>=(O-ue)*(j-xe)&&(O-ue)*(ee-xe)>=(W-ue)*(H-xe)}function x(G,j){return G.next.i!==j.i&&G.prev.i!==j.i&&!_(G,j)&&(h(G,j)&&h(j,G)&&m(G,j)&&(A(G.prev,G,j.prev)||A(G,j.prev,j))||k(G,j)&&A(G.prev,G,G.next)>0&&A(j.prev,j,j.next)>0)}function A(G,j,O){return(j.y-G.y)*(O.x-j.x)-(j.x-G.x)*(O.y-j.y)}function k(G,j){return G.x===j.x&&G.y===j.y}function I(G,j,O,H){var W=E(A(G,j,O)),ee=E(A(G,j,H)),ue=E(A(O,H,G)),xe=E(A(O,H,j));return!!(W!==ee&&ue!==xe||W===0&&T(G,O,j)||ee===0&&T(G,H,j)||ue===0&&T(O,G,H)||xe===0&&T(O,j,H))}function T(G,j,O){return j.x<=Math.max(G.x,O.x)&&j.x>=Math.min(G.x,O.x)&&j.y<=Math.max(G.y,O.y)&&j.y>=Math.min(G.y,O.y)}function E(G){return G>0?1:G<0?-1:0}function _(G,j){var O=G;do{if(O.i!==G.i&&O.next.i!==G.i&&O.i!==j.i&&O.next.i!==j.i&&I(O,O.next,G,j))return!0;O=O.next}while(O!==G);return!1}function h(G,j){return A(G.prev,G,G.next)<0?A(G,j,G.next)>=0&&A(G,G.prev,j)>=0:A(G,j,G.prev)<0||A(G,G.next,j)<0}function m(G,j){var O=G,H=!1,W=(G.x+j.x)/2,ee=(G.y+j.y)/2;do O.y>ee!=O.next.y>ee&&O.next.y!==O.y&&W<(O.next.x-O.x)*(ee-O.y)/(O.next.y-O.y)+O.x&&(H=!H),O=O.next;while(O!==G);return H}function w(G,j){var O=new U(G.i,G.x,G.y),H=new U(j.i,j.x,j.y),W=G.next,ee=j.prev;return G.next=j,j.prev=G,O.next=W,W.prev=O,H.next=O,O.prev=H,ee.next=H,H.prev=ee,H}function F(G,j,O,H){var W=new U(G,j,O);return H?(W.next=H.next,W.prev=H,H.next.prev=W,H.next=W):(W.prev=W,W.next=W),W}function z(G){G.next.prev=G.prev,G.prev.next=G.next,G.prevZ&&(G.prevZ.nextZ=G.nextZ),G.nextZ&&(G.nextZ.prevZ=G.prevZ)}function U(G,j,O){this.i=G,this.x=j,this.y=O,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}v.deviation=function(G,j,O,H){var W=j&&j.length,ee=W?j[0]*O:G.length,ue=Math.abs(V(G,0,ee,O));if(W)for(var xe=0,ge=j.length;xe0&&(H+=G[W-1].length,O.holes.push(H))}return O}}}),GX=Re({"node_modules/array-normalize/index.js"(ae,K){var v=zT();K.exports=S;function S(M,L,t){if(!M||M.length==null)throw Error("Argument should be an array");L==null&&(L=1),t==null&&(t=v(M,L));for(var r=0;r-1}}}),CF=Re({"node_modules/es5-ext/string/#/contains/index.js"(ae,K){K.exports=nY()()?String.prototype.contains:aY()}}),Mx=Re({"node_modules/d/index.js"(ae,K){var v=FT(),S=SF(),M=$P(),L=EF(),t=CF(),r=K.exports=function(a,l){var i,s,o,c,p;return arguments.length<2||typeof a!="string"?(c=l,l=a,a=null):c=arguments[2],v(a)?(i=t.call(a,"c"),s=t.call(a,"e"),o=t.call(a,"w")):(i=o=!0,s=!1),p={value:l,configurable:i,enumerable:s,writable:o},c?M(L(c),p):p};r.gs=function(a,l,i){var s,o,c,p;return typeof a!="string"?(c=i,i=l,l=a,a=null):c=arguments[3],v(l)?S(l)?v(i)?S(i)||(c=i,i=void 0):i=void 0:(c=l,l=i=void 0):l=void 0,v(a)?(s=t.call(a,"c"),o=t.call(a,"e")):(s=!0,o=!1),p={get:l,set:i,configurable:s,enumerable:o},c?M(L(c),p):p}}}),HI=Re({"node_modules/es5-ext/function/is-arguments.js"(ae,K){var v=Object.prototype.toString,S=v.call((function(){return arguments})());K.exports=function(M){return v.call(M)===S}}}),WI=Re({"node_modules/es5-ext/string/is-string.js"(ae,K){var v=Object.prototype.toString,S=v.call("");K.exports=function(M){return typeof M=="string"||M&&typeof M=="object"&&(M instanceof String||v.call(M)===S)||!1}}}),iY=Re({"node_modules/ext/global-this/is-implemented.js"(ae,K){K.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),oY=Re({"node_modules/ext/global-this/implementation.js"(ae,K){var v=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};K.exports=(function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return v()}try{return __global__||v()}finally{delete Object.prototype.__global__}})()}}),XI=Re({"node_modules/ext/global-this/index.js"(ae,K){K.exports=iY()()?globalThis:oY()}}),sY=Re({"node_modules/es6-symbol/is-implemented.js"(ae,K){var v=XI(),S={object:!0,symbol:!0};K.exports=function(){var M=v.Symbol,L;if(typeof M!="function")return!1;L=M("test symbol");try{String(L)}catch{return!1}return!(!S[typeof M.iterator]||!S[typeof M.toPrimitive]||!S[typeof M.toStringTag])}}}),lY=Re({"node_modules/es6-symbol/is-symbol.js"(ae,K){K.exports=function(v){return v?typeof v=="symbol"?!0:!v.constructor||v.constructor.name!=="Symbol"?!1:v[v.constructor.toStringTag]==="Symbol":!1}}}),kF=Re({"node_modules/es6-symbol/validate-symbol.js"(ae,K){var v=lY();K.exports=function(S){if(!v(S))throw new TypeError(S+" is not a symbol");return S}}}),uY=Re({"node_modules/es6-symbol/lib/private/generate-name.js"(ae,K){var v=Mx(),S=Object.create,M=Object.defineProperty,L=Object.prototype,t=S(null);K.exports=function(r){for(var a=0,l,i;t[r+(a||"")];)++a;return r+=a||"",t[r]=!0,l="@@"+r,M(L,l,v.gs(null,function(s){i||(i=!0,M(this,l,v(s)),i=!1)})),l}}}),cY=Re({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(ae,K){var v=Mx(),S=XI().Symbol;K.exports=function(M){return Object.defineProperties(M,{hasInstance:v("",S&&S.hasInstance||M("hasInstance")),isConcatSpreadable:v("",S&&S.isConcatSpreadable||M("isConcatSpreadable")),iterator:v("",S&&S.iterator||M("iterator")),match:v("",S&&S.match||M("match")),replace:v("",S&&S.replace||M("replace")),search:v("",S&&S.search||M("search")),species:v("",S&&S.species||M("species")),split:v("",S&&S.split||M("split")),toPrimitive:v("",S&&S.toPrimitive||M("toPrimitive")),toStringTag:v("",S&&S.toStringTag||M("toStringTag")),unscopables:v("",S&&S.unscopables||M("unscopables"))})}}}),fY=Re({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(ae,K){var v=Mx(),S=kF(),M=Object.create(null);K.exports=function(L){return Object.defineProperties(L,{for:v(function(t){return M[t]?M[t]:M[t]=L(String(t))}),keyFor:v(function(t){var r;S(t);for(r in M)if(M[r]===t)return r})})}}}),hY=Re({"node_modules/es6-symbol/polyfill.js"(ae,K){var v=Mx(),S=kF(),M=XI().Symbol,L=uY(),t=cY(),r=fY(),a=Object.create,l=Object.defineProperties,i=Object.defineProperty,s,o,c;if(typeof M=="function")try{String(M()),c=!0}catch{}else M=null;o=function(d){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return s(d)},K.exports=s=function p(d){var y;if(this instanceof p)throw new TypeError("Symbol is not a constructor");return c?M(d):(y=a(o.prototype),d=d===void 0?"":String(d),l(y,{__description__:v("",d),__name__:v("",L(d))}))},t(s),r(s),l(o.prototype,{constructor:v(s),toString:v("",function(){return this.__name__})}),l(s.prototype,{toString:v(function(){return"Symbol ("+S(this).__description__+")"}),valueOf:v(function(){return S(this)})}),i(s.prototype,s.toPrimitive,v("",function(){var p=S(this);return typeof p=="symbol"?p:p.toString()})),i(s.prototype,s.toStringTag,v("c","Symbol")),i(o.prototype,s.toStringTag,v("c",s.prototype[s.toStringTag])),i(o.prototype,s.toPrimitive,v("c",s.prototype[s.toPrimitive]))}}),Hw=Re({"node_modules/es6-symbol/index.js"(ae,K){K.exports=sY()()?XI().Symbol:hY()}}),dY=Re({"node_modules/es5-ext/array/#/clear.js"(ae,K){var v=kx();K.exports=function(){return v(this).length=0,this}}}),oE=Re({"node_modules/es5-ext/object/valid-callable.js"(ae,K){K.exports=function(v){if(typeof v!="function")throw new TypeError(v+" is not a function");return v}}}),pY=Re({"node_modules/type/string/coerce.js"(ae,K){var v=FT(),S=UP(),M=Object.prototype.toString;K.exports=function(L){if(!v(L))return null;if(S(L)){var t=L.toString;if(typeof t!="function"||t===M)return null}try{return""+L}catch{return null}}}}),vY=Re({"node_modules/type/lib/safe-to-string.js"(ae,K){K.exports=function(v){try{return v.toString()}catch{try{return String(v)}catch{return null}}}}}),mY=Re({"node_modules/type/lib/to-short-string.js"(ae,K){var v=vY(),S=/[\n\r\u2028\u2029]/g;K.exports=function(M){var L=v(M);return L===null?"":(L.length>100&&(L=L.slice(0,99)+"…"),L=L.replace(S,function(t){switch(t){case` +`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),L)}}}),MF=Re({"node_modules/type/lib/resolve-exception.js"(ae,K){var v=FT(),S=UP(),M=pY(),L=mY(),t=function(r,a){return r.replace("%v",L(a))};K.exports=function(r,a,l){if(!S(l))throw new TypeError(t(a,r));if(!v(r)){if("default"in l)return l.default;if(l.isOptional)return null}var i=M(l.errorMessage);throw v(i)||(i=a),new TypeError(t(i,r))}}}),gY=Re({"node_modules/type/value/ensure.js"(ae,K){var v=MF(),S=FT();K.exports=function(M){return S(M)?M:v(M,"Cannot use %v",arguments[1])}}}),yY=Re({"node_modules/type/plain-function/ensure.js"(ae,K){var v=MF(),S=SF();K.exports=function(M){return S(M)?M:v(M,"%v is not a plain function",arguments[1])}}}),_Y=Re({"node_modules/es5-ext/array/from/is-implemented.js"(ae,K){K.exports=function(){var v=Array.from,S,M;return typeof v!="function"?!1:(S=["raz","dwa"],M=v(S),!!(M&&M!==S&&M[1]==="dwa"))}}}),xY=Re({"node_modules/es5-ext/function/is-function.js"(ae,K){var v=Object.prototype.toString,S=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);K.exports=function(M){return typeof M=="function"&&S(v.call(M))}}}),bY=Re({"node_modules/es5-ext/math/sign/is-implemented.js"(ae,K){K.exports=function(){var v=Math.sign;return typeof v!="function"?!1:v(10)===1&&v(-20)===-1}}}),wY=Re({"node_modules/es5-ext/math/sign/shim.js"(ae,K){K.exports=function(v){return v=Number(v),isNaN(v)||v===0?v:v>0?1:-1}}}),TY=Re({"node_modules/es5-ext/math/sign/index.js"(ae,K){K.exports=bY()()?Math.sign:wY()}}),AY=Re({"node_modules/es5-ext/number/to-integer.js"(ae,K){var v=TY(),S=Math.abs,M=Math.floor;K.exports=function(L){return isNaN(L)?0:(L=Number(L),L===0||!isFinite(L)?L:v(L)*M(S(L)))}}}),SY=Re({"node_modules/es5-ext/number/to-pos-integer.js"(ae,K){var v=AY(),S=Math.max;K.exports=function(M){return S(0,v(M))}}}),EY=Re({"node_modules/es5-ext/array/from/shim.js"(ae,K){var v=Hw().iterator,S=HI(),M=xY(),L=SY(),t=oE(),r=kx(),a=qw(),l=WI(),i=Array.isArray,s=Function.prototype.call,o={configurable:!0,enumerable:!0,writable:!0,value:null},c=Object.defineProperty;K.exports=function(p){var d=arguments[1],y=arguments[2],g,C,f,x,A,k,I,T,E,_;if(p=Object(r(p)),a(d)&&t(d),!this||this===Array||!M(this)){if(!d){if(S(p))return A=p.length,A!==1?Array.apply(null,p):(x=new Array(1),x[0]=p[0],x);if(i(p)){for(x=new Array(A=p.length),C=0;C=55296&&k<=56319&&(_+=p[++C])),_=d?s.call(d,y,_,f):_,g?(o.value=_,c(x,f,o)):x[f]=_,++f;A=f}}if(A===void 0)for(A=L(p.length),g&&(x=new g(A)),C=0;C=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){l(this,"__redo__",t("c",[o]));return}this.__redo__.forEach(function(c,p){c>=o&&(this.__redo__[p]=++c)},this),this.__redo__.push(o)}}),_onDelete:t(function(o){var c;o>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(c=this.__redo__.indexOf(o),c!==-1&&this.__redo__.splice(c,1),this.__redo__.forEach(function(p,d){p>o&&(this.__redo__[d]=--p)},this)))}),_onClear:t(function(){this.__redo__&&v.call(this.__redo__),this.__nextIndex__=0})}))),l(s.prototype,a.iterator,t(function(){return this}))}}),DY=Re({"node_modules/es6-iterator/array.js"(ae,K){var v=BP(),S=CF(),M=Mx(),L=Hw(),t=IF(),r=Object.defineProperty,a;a=K.exports=function(l,i){if(!(this instanceof a))throw new TypeError("Constructor requires 'new'");t.call(this,l),i?S.call(i,"key+value")?i="key+value":S.call(i,"key")?i="key":i="value":i="value",r(this,"__kind__",M("",i))},v&&v(a,t),delete a.prototype.constructor,a.prototype=Object.create(t.prototype,{_resolve:M(function(l){return this.__kind__==="value"?this.__list__[l]:this.__kind__==="key+value"?[l,this.__list__[l]]:l})}),r(a.prototype,L.toStringTag,M("c","Array Iterator"))}}),PY=Re({"node_modules/es6-iterator/string.js"(ae,K){var v=BP(),S=Mx(),M=Hw(),L=IF(),t=Object.defineProperty,r;r=K.exports=function(a){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");a=String(a),L.call(this,a),t(this,"__length__",S("",a.length))},v&&v(r,L),delete r.prototype.constructor,r.prototype=Object.create(L.prototype,{_next:S(function(){if(this.__list__){if(this.__nextIndex__=55296&&i<=56319?l+this.__list__[this.__nextIndex__++]:l)})}),t(r.prototype,M.toStringTag,S("c","String Iterator"))}}),zY=Re({"node_modules/es6-iterator/is-iterable.js"(ae,K){var v=HI(),S=qw(),M=WI(),L=Hw().iterator,t=Array.isArray;K.exports=function(r){return S(r)?t(r)||M(r)||v(r)?!0:typeof r[L]=="function":!1}}}),NY=Re({"node_modules/es6-iterator/valid-iterable.js"(ae,K){var v=zY();K.exports=function(S){if(!v(S))throw new TypeError(S+" is not iterable");return S}}}),LF=Re({"node_modules/es6-iterator/get.js"(ae,K){var v=HI(),S=WI(),M=DY(),L=PY(),t=NY(),r=Hw().iterator;K.exports=function(a){return typeof t(a)[r]=="function"?a[r]():v(a)?new M(a):S(a)?new L(a):new M(a)}}}),OY=Re({"node_modules/es6-iterator/for-of.js"(ae,K){var v=HI(),S=oE(),M=WI(),L=LF(),t=Array.isArray,r=Function.prototype.call,a=Array.prototype.some;K.exports=function(l,i){var s,o=arguments[2],c,p,d,y,g,C,f;if(t(l)||v(l)?s="array":M(l)?s="string":l=L(l),S(i),p=function(){d=!0},s==="array"){a.call(l,function(x){return r.call(i,o,x,p),d});return}if(s==="string"){for(g=l.length,y=0;y=55296&&f<=56319&&(C+=l[++y])),r.call(i,o,C,p),!d);++y);return}for(c=l.next();!c.done;){if(r.call(i,o,c.value,p),d)return;c=l.next()}}}}),FY=Re({"node_modules/es6-weak-map/is-native-implemented.js"(ae,K){K.exports=(function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"})()}}),BY=Re({"node_modules/es6-weak-map/polyfill.js"(ae,K){var v=qw(),S=BP(),M=XX(),L=kx(),t=YX(),r=Mx(),a=LF(),l=OY(),i=Hw().toStringTag,s=FY(),o=Array.isArray,c=Object.defineProperty,p=Object.prototype.hasOwnProperty,d=Object.getPrototypeOf,y;K.exports=y=function(){var g=arguments[0],C;if(!(this instanceof y))throw new TypeError("Constructor requires 'new'");return C=s&&S&&WeakMap!==y?S(new WeakMap,d(this)):this,v(g)&&(o(g)||(g=a(g))),c(C,"__weakMapData__",r("c","$weakMap$"+t())),g&&l(g,function(f){L(f),C.set(f[0],f[1])}),C},s&&(S&&S(y,WeakMap),y.prototype=Object.create(WeakMap.prototype,{constructor:r(y)})),Object.defineProperties(y.prototype,{delete:r(function(g){return p.call(M(g),this.__weakMapData__)?(delete g[this.__weakMapData__],!0):!1}),get:r(function(g){if(p.call(M(g),this.__weakMapData__))return g[this.__weakMapData__]}),has:r(function(g){return p.call(M(g),this.__weakMapData__)}),set:r(function(g,C){return c(M(g),this.__weakMapData__,r("c",C)),this}),toString:r(function(){return"[object WeakMap]"})}),c(y.prototype,i,r("c","WeakMap"))}}),RF=Re({"node_modules/es6-weak-map/index.js"(ae,K){K.exports=qX()()?WeakMap:BY()}}),UY=Re({"node_modules/array-find-index/index.js"(ae,K){K.exports=function(v,S,M){if(typeof Array.prototype.findIndex=="function")return v.findIndex(S,M);if(typeof S!="function")throw new TypeError("predicate must be a function");var L=Object(v),t=L.length;if(t===0)return-1;for(var r=0;r 0. && baClipping < length(normalWidth * endBotJoin)) { + //handle miter clipping + bTopCoord -= normalWidth * endTopJoin; + bTopCoord += normalize(endTopJoin * normalWidth) * baClipping; + } + + if (nextReverse) { + //make join rectangular + vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5; + float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.); + bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5; + bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5; + } + else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) { + //handle miter clipping + aBotCoord -= normalWidth * startBotJoin; + aBotCoord += normalize(startBotJoin * normalWidth) * abClipping; + } + + vec2 aTopPosition = (aTopCoord) * adjustedScale + translate; + vec2 aBotPosition = (aBotCoord) * adjustedScale + translate; + + vec2 bTopPosition = (bTopCoord) * adjustedScale + translate; + vec2 bBotPosition = (bBotCoord) * adjustedScale + translate; + + //position is normalized 0..1 coord on the screen + vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd; + + startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy; + endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2.0 - 1.0, depth, 1); + + enableStartMiter = step(dot(currTangent, prevTangent), .5); + enableEndMiter = step(dot(currTangent, nextTangent), .5); + + //bevel miter cutoffs + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } + + //round miter cutoffs + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } +} +`,f=` +precision highp float; + +uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode; +uniform sampler2D dashTexture; + +varying vec4 fragColor; +varying vec2 tangent; +varying vec4 startCutoff, endCutoff; +varying vec2 startCoord, endCoord; +varying float enableStartMiter, enableEndMiter; + +float distToLine(vec2 p, vec2 a, vec2 b) { + vec2 diff = b - a; + vec2 perp = normalize(vec2(-diff.y, diff.x)); + return dot(p - a, perp); +} + +void main() { + float alpha = 1., distToStart, distToEnd; + float cutoff = thickness * .5; + + //bevel miter + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < -1.) { + discard; + return; + } + alpha *= min(max(distToStart + 1., 0.), 1.); + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < -1.) { + discard; + return; + } + alpha *= min(max(distToEnd + 1., 0.), 1.); + } + } + + // round miter + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < 0.) { + float radius = length(gl_FragCoord.xy - startCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < 0.) { + float radius = length(gl_FragCoord.xy - endCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + } + + float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25; + float dash = texture2D(dashTexture, vec2(t, .5)).r; + + gl_FragColor = fragColor; + gl_FragColor.a *= alpha * opacity * dash; +} +`;K.exports=x;function x(A,k){if(!(this instanceof x))return new x(A,k);if(typeof A=="function"?(k||(k={}),k.regl=A):k=A,k.length&&(k.positions=k),A=k.regl,!A.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=A._gl,this.regl=A,this.passes=[],this.shaders=x.shaders.has(A)?x.shaders.get(A):x.shaders.set(A,x.createShaders(A)).get(A),this.update(k)}x.dashMult=2,x.maxPatternLength=256,x.precisionThreshold=3e6,x.maxPoints=1e4,x.maxLines=2048,x.shaders=new s,x.createShaders=function(A){let k=A.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),I={primitive:"triangle strip",instances:A.prop("count"),count:4,offset:0,uniforms:{miterMode:(h,m)=>m.join==="round"?2:1,miterLimit:A.prop("miterLimit"),scale:A.prop("scale"),scaleFract:A.prop("scaleFract"),translateFract:A.prop("translateFract"),translate:A.prop("translate"),thickness:A.prop("thickness"),dashTexture:A.prop("dashTexture"),opacity:A.prop("opacity"),pixelRatio:A.context("pixelRatio"),id:A.prop("id"),dashLength:A.prop("dashLength"),viewport:(h,m)=>[m.viewport.x,m.viewport.y,h.viewportWidth,h.viewportHeight],depth:A.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(h,m)=>!m.overlay},stencil:{enable:!1},scissor:{enable:!0,box:A.prop("viewport")},viewport:A.prop("viewport")},T=A(M({vert:p,frag:d,attributes:{lineEnd:{buffer:k,divisor:0,stride:8,offset:0},lineTop:{buffer:k,divisor:0,stride:8,offset:4},aCoord:{buffer:A.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:A.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:A.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:A.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:A.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},I)),E;try{E=A(M({cull:{enable:!0,face:"back"},vert:C,frag:f,attributes:{lineEnd:{buffer:k,divisor:0,stride:8,offset:0},lineTop:{buffer:k,divisor:0,stride:8,offset:4},aColor:{buffer:A.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:A.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:A.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:A.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:A.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:A.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},I))}catch{E=T}return{fill:A({primitive:"triangle",elements:(h,m)=>m.triangles,offset:0,vert:y,frag:g,uniforms:{scale:A.prop("scale"),color:A.prop("fill"),scaleFract:A.prop("scaleFract"),translateFract:A.prop("translateFract"),translate:A.prop("translate"),opacity:A.prop("opacity"),pixelRatio:A.context("pixelRatio"),id:A.prop("id"),viewport:(h,m)=>[m.viewport.x,m.viewport.y,h.viewportWidth,h.viewportHeight]},attributes:{position:{buffer:A.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:A.prop("positionFractBuffer"),stride:8,offset:8}},blend:I.blend,depth:{enable:!1},scissor:I.scissor,stencil:I.stencil,viewport:I.viewport}),rect:T,miter:E}},x.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},x.prototype.render=function(...A){A.length&&this.update(...A),this.draw()},x.prototype.draw=function(...A){return(A.length?A:this.passes).forEach((k,I)=>{if(k&&Array.isArray(k))return this.draw(...k);typeof k=="number"&&(k=this.passes[k]),k&&k.count>1&&k.opacity&&(this.regl._refresh(),k.fill&&k.triangles&&k.triangles.length>2&&this.shaders.fill(k),k.thickness&&(k.scale[0]*k.viewport.width>x.precisionThreshold||k.scale[1]*k.viewport.height>x.precisionThreshold?this.shaders.rect(k):k.join==="rect"||!k.join&&(k.thickness<=2||k.count>=x.maxPoints)?this.shaders.rect(k):this.shaders.miter(k)))}),this},x.prototype.update=function(A){if(!A)return;A.length!=null?typeof A[0]=="number"&&(A=[{positions:A}]):Array.isArray(A)||(A=[A]);let{regl:k,gl:I}=this;if(A.forEach((E,_)=>{let h=this.passes[_];if(E!==void 0){if(E===null){this.passes[_]=null;return}if(typeof E[0]=="number"&&(E={positions:E}),E=L(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||(this.passes[_]=h={id:_,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:k.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:k.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:k.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:k.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},E=M({},x.defaults,E)),E.thickness!=null&&(h.thickness=parseFloat(E.thickness)),E.opacity!=null&&(h.opacity=parseFloat(E.opacity)),E.miterLimit!=null&&(h.miterLimit=parseFloat(E.miterLimit)),E.overlay!=null&&(h.overlay=!!E.overlay,_ge-_e),ee=[],ue=0,xe=h.hole!=null?h.hole[0]:null;if(xe!=null){let ge=c(W,_e=>_e>=xe);W=W.slice(0,ge),W.push(xe)}for(let ge=0;gece-xe+(W[ge]-ue)),se=r(_e,Y);se=se.map(ce=>ce+ue+(ce+ue{A.colorBuffer.destroy(),A.positionBuffer.destroy(),A.dashTexture.destroy()}),this.passes.length=0,this}}}),$Y=Re({"node_modules/regl-error2d/index.js"(ae,K){var v=zT(),S=Uw(),M=xF(),L=r_(),t=gp(),r=NT(),{float32:a,fract32:l}=FP();K.exports=s;var i=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function s(o,c){if(typeof o=="function"?(c||(c={}),c.regl=o):c=o,c.length&&(c.positions=c),o=c.regl,!o.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let p=o._gl,d,y,g,C,f,x,A={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},k=[];return C=o.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),y=o.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=o.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),f=o.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),x=o.buffer({usage:"static",type:"float",data:i}),_(c),d=o({vert:` + precision highp float; + + attribute vec2 position, positionFract; + attribute vec4 error; + attribute vec4 color; + + attribute vec2 direction, lineOffset, capOffset; + + uniform vec4 viewport; + uniform float lineWidth, capSize; + uniform vec2 scale, scaleFract, translate, translateFract; + + varying vec4 fragColor; + + void main() { + fragColor = color / 255.; + + vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset; + + vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw; + + vec2 position = position + dxy; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + pos += pixelOffset / viewport.zw; + + gl_Position = vec4(pos * 2. - 1., 0, 1); + } + `,frag:` + precision highp float; + + varying vec4 fragColor; + + uniform float opacity; + + void main() { + gl_FragColor = fragColor; + gl_FragColor.a *= opacity; + } + `,uniforms:{range:o.prop("range"),lineWidth:o.prop("lineWidth"),capSize:o.prop("capSize"),opacity:o.prop("opacity"),scale:o.prop("scale"),translate:o.prop("translate"),scaleFract:o.prop("scaleFract"),translateFract:o.prop("translateFract"),viewport:(m,w)=>[w.viewport.x,w.viewport.y,m.viewportWidth,m.viewportHeight]},attributes:{color:{buffer:C,offset:(m,w)=>w.offset*4,divisor:1},position:{buffer:y,offset:(m,w)=>w.offset*8,divisor:1},positionFract:{buffer:g,offset:(m,w)=>w.offset*8,divisor:1},error:{buffer:f,offset:(m,w)=>w.offset*16,divisor:1},direction:{buffer:x,stride:24,offset:0},lineOffset:{buffer:x,stride:24,offset:8},capOffset:{buffer:x,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:o.prop("viewport")},viewport:o.prop("viewport"),stencil:!1,instances:o.prop("count"),count:i.length}),t(I,{update:_,draw:T,destroy:h,regl:o,gl:p,canvas:p.canvas,groups:k}),I;function I(m){m?_(m):m===null&&h(),T()}function T(m){if(typeof m=="number")return E(m);m&&!Array.isArray(m)&&(m=[m]),o._refresh(),k.forEach((w,F)=>{if(w){if(m&&(m[F]?w.draw=!0:w.draw=!1),!w.draw){w.draw=!0;return}E(F)}})}function E(m){typeof m=="number"&&(m=k[m]),m!=null&&m&&m.count&&m.color&&m.opacity&&m.positions&&m.positions.length>1&&(m.scaleRatio=[m.scale[0]*m.viewport.width,m.scale[1]*m.viewport.height],d(m),m.after&&m.after(m))}function _(m){if(!m)return;m.length!=null?typeof m[0]=="number"&&(m=[{positions:m}]):Array.isArray(m)||(m=[m]);let w=0,F=0;if(I.groups=k=m.map((V,G)=>{let j=k[G];if(V)typeof V=="function"?V={after:V}:typeof V[0]=="number"&&(V={positions:V});else return j;return V=L(V,{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"}),j||(k[G]=j={id:G,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},V=t({},A,V)),M(j,V,[{lineWidth:O=>+O*.5,capSize:O=>+O*.5,opacity:parseFloat,errors:O=>(O=r(O),F+=O.length,O),positions:(O,H)=>(O=r(O,"float64"),H.count=Math.floor(O.length/2),H.bounds=v(O,2),H.offset=w,w+=H.count,O)},{color:(O,H)=>{let W=H.count;if(O||(O="transparent"),!Array.isArray(O)||typeof O[0]=="number"){let ue=O;O=Array(W);for(let xe=0;xe{let ee=H.bounds;return O||(O=ee),H.scale=[1/(O[2]-O[0]),1/(O[3]-O[1])],H.translate=[-O[0],-O[1]],H.scaleFract=l(H.scale),H.translateFract=l(H.translate),O},viewport:O=>{let H;return Array.isArray(O)?H={x:O[0],y:O[1],width:O[2]-O[0],height:O[3]-O[1]}:O?(H={x:O.x||O.left||0,y:O.y||O.top||0},O.right?H.width=O.right-H.x:H.width=O.w||O.width||0,O.bottom?H.height=O.bottom-H.y:H.height=O.h||O.height||0):H={x:0,y:0,width:p.drawingBufferWidth,height:p.drawingBufferHeight},H}}]),j}),w||F){let V=k.reduce((H,W,ee)=>H+(W?W.count:0),0),G=new Float64Array(V*2),j=new Uint8Array(V*4),O=new Float32Array(V*4);k.forEach((H,W)=>{if(!H)return;let{positions:ee,count:ue,offset:xe,color:ge,errors:_e}=H;ue&&(j.set(ge,xe*4),O.set(_e,xe*4),G.set(ee,xe*2))});var z=a(G);y(z);var U=l(G,z);g(U),C(j),f(O)}}function h(){y.destroy(),g.destroy(),C.destroy(),f.destroy(),x.destroy()}}}}),VY=Re({"node_modules/unquote/index.js"(ae,K){var v=/[\'\"]/;K.exports=function(M){return M?(v.test(M.charAt(0))&&(M=M.substr(1)),v.test(M.charAt(M.length-1))&&(M=M.substr(0,M.length-1)),M):""}}}),PF=Re({"node_modules/css-global-keywords/index.json"(ae,K){K.exports=["inherit","initial","unset"]}}),zF=Re({"node_modules/css-system-font-keywords/index.json"(ae,K){K.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),NF=Re({"node_modules/css-font-weight-keywords/index.json"(ae,K){K.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),OF=Re({"node_modules/css-font-style-keywords/index.json"(ae,K){K.exports=["normal","italic","oblique"]}}),FF=Re({"node_modules/css-font-stretch-keywords/index.json"(ae,K){K.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),jY=Re({"node_modules/parenthesis/index.js"(ae,K){function v(L,t){if(typeof L!="string")return[L];var r=[L];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var a=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],l=t.escape||"___",i=!!t.flat;a.forEach(function(c){var p=new RegExp(["\\",c[0],"[^\\",c[0],"\\",c[1],"]*\\",c[1]].join("")),d=[];function y(g,C,f){var x=r.push(g.slice(c[0].length,-c[1].length))-1;return d.push(x),l+x+l}r.forEach(function(g,C){for(var f,x=0;g!=f;)if(f=g,g=g.replace(p,y),x++>1e4)throw Error("References have circular dependency. Please, check them.");r[C]=g}),d=d.reverse(),r=r.map(function(g){return d.forEach(function(C){g=g.replace(new RegExp("(\\"+l+C+"\\"+l+")","g"),c[0]+"$1"+c[1])}),g})});var s=new RegExp("\\"+l+"([0-9]+)\\"+l);function o(c,p,d){for(var y=[],g,C=0;g=s.exec(c);){if(C++>1e4)throw Error("Circular references in parenthesis");y.push(c.slice(0,g.index)),y.push(o(p[g[1]],p)),c=c.slice(g.index+g[0].length)}return y.push(c),y}return i?r:o(r[0],r)}function S(L,t){if(t&&t.flat){var r=t&&t.escape||"___",a=L[0],l;if(!a)return"";for(var i=new RegExp("\\"+r+"([0-9]+)\\"+r),s=0;a!=l;){if(s++>1e4)throw Error("Circular references in "+L);l=a,a=a.replace(i,o)}return a}return L.reduce(function c(p,d){return Array.isArray(d)&&(d=d.reduce(c,"")),p+d},"");function o(c,p){if(L[p]==null)throw Error("Reference "+p+"is undefined");return L[p]}}function M(L,t){return Array.isArray(L)?S(L,t):v(L,t)}M.parse=v,M.stringify=S,K.exports=M}}),GY=Re({"node_modules/string-split-by/index.js"(ae,K){var v=jY();K.exports=function(M,L,t){if(M==null)throw Error("First argument should be a string");if(L==null)throw Error("Separator should be a string or a RegExp");t?(typeof t=="string"||Array.isArray(t))&&(t={ignore:t}):t={},t.escape==null&&(t.escape=!0),t.ignore==null?t.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof t.ignore=="string"&&(t.ignore=[t.ignore]),t.ignore=t.ignore.map(function(p){return p.length===1&&(p=p+p),p}));var r=v.parse(M,{flat:!0,brackets:t.ignore}),a=r[0],l=a.split(L);if(t.escape){for(var i=[],s=0;s1&&Ir===zr&&(Ir==='"'||Ir==="'"))return['"'+a(Ct.substr(1,Ct.length-2))+'"'];var qn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(Ct);if(qn)return l(Ct.substr(0,qn.index)).concat(l(qn[1])).concat(l(Ct.substr(qn.index+qn[0].length)));var Ca=Ct.split(".");if(Ca.length===1)return['"'+a(Ct)+'"'];for(var Ln=[],Mn=0;Mn"u"?1:window.devicePixelRatio,mi=!1,fo={},Hi=function(gn){},hi=function(){};if(typeof Ir=="string"?zr=document.querySelector(Ir):typeof Ir=="object"&&(x(Ir)?zr=Ir:A(Ir)?(Ln=Ir,Ca=Ln.canvas):("gl"in Ir?Ln=Ir.gl:"canvas"in Ir?Ca=I(Ir.canvas):"container"in Ir&&(qn=I(Ir.container)),"attributes"in Ir&&(Mn=Ir.attributes),"extensions"in Ir&&(ei=k(Ir.extensions)),"optionalExtensions"in Ir&&(Ja=k(Ir.optionalExtensions)),"onDone"in Ir&&(Hi=Ir.onDone),"profile"in Ir&&(mi=!!Ir.profile),"pixelRatio"in Ir&&(Qa=+Ir.pixelRatio),"cachedCode"in Ir&&(fo=Ir.cachedCode))),zr&&(zr.nodeName.toLowerCase()==="canvas"?Ca=zr:qn=zr),!Ln){if(!Ca){var za=C(qn||document.body,Hi,Qa);if(!za)return null;Ca=za.canvas,hi=za.onDestroy}Mn.premultipliedAlpha===void 0&&(Mn.premultipliedAlpha=!0),Ln=f(Ca,Mn)}return Ln?{gl:Ln,canvas:Ca,container:qn,extensions:ei,optionalExtensions:Ja,pixelRatio:Qa,profile:mi,cachedCode:fo,onDone:Hi,onDestroy:hi}:(hi(),Hi("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function E(Ct,Ir){var zr={};function qn(Mn){var ei=Mn.toLowerCase(),Ja;try{Ja=zr[ei]=Ct.getExtension(ei)}catch{}return!!Ja}for(var Ca=0;Ca65535)<<4,Ct>>>=Ir,zr=(Ct>255)<<3,Ct>>>=zr,Ir|=zr,zr=(Ct>15)<<2,Ct>>>=zr,Ir|=zr,zr=(Ct>3)<<1,Ct>>>=zr,Ir|=zr,Ir|Ct>>1}function O(){var Ct=_(8,function(){return[]});function Ir(Ln){var Mn=G(Ln),ei=Ct[j(Mn)>>2];return ei.length>0?ei.pop():new ArrayBuffer(Mn)}function zr(Ln){Ct[j(Ln.byteLength)>>2].push(Ln)}function qn(Ln,Mn){var ei=null;switch(Ln){case h:ei=new Int8Array(Ir(Mn),0,Mn);break;case m:ei=new Uint8Array(Ir(Mn),0,Mn);break;case w:ei=new Int16Array(Ir(2*Mn),0,Mn);break;case F:ei=new Uint16Array(Ir(2*Mn),0,Mn);break;case z:ei=new Int32Array(Ir(4*Mn),0,Mn);break;case U:ei=new Uint32Array(Ir(4*Mn),0,Mn);break;case V:ei=new Float32Array(Ir(4*Mn),0,Mn);break;default:return null}return ei.length!==Mn?ei.subarray(0,Mn):ei}function Ca(Ln){zr(Ln.buffer)}return{alloc:Ir,free:zr,allocType:qn,freeType:Ca}}var H=O();H.zero=O();var W=3408,ee=3410,ue=3411,xe=3412,ge=3413,_e=3414,Y=3415,se=33901,ce=33902,ne=3379,ye=3386,le=34921,Z=36347,de=36348,pe=35661,Te=35660,Ne=34930,$e=36349,Ze=34076,Xe=34024,it=7936,yt=7937,bt=7938,mt=35724,ht=34047,Ve=36063,ze=34852,Se=3553,Je=34067,_t=34069,At=33984,vt=6408,Kt=5126,Qt=5121,fr=36160,mr=36053,Ur=36064,Br=16384,fn=function(Ct,Ir){var zr=1;Ir.ext_texture_filter_anisotropic&&(zr=Ct.getParameter(ht));var qn=1,Ca=1;Ir.webgl_draw_buffers&&(qn=Ct.getParameter(ze),Ca=Ct.getParameter(Ve));var Ln=!!Ir.oes_texture_float;if(Ln){var Mn=Ct.createTexture();Ct.bindTexture(Se,Mn),Ct.texImage2D(Se,0,vt,1,1,0,vt,Kt,null);var ei=Ct.createFramebuffer();if(Ct.bindFramebuffer(fr,ei),Ct.framebufferTexture2D(fr,Ur,Se,Mn,0),Ct.bindTexture(Se,null),Ct.checkFramebufferStatus(fr)!==mr)Ln=!1;else{Ct.viewport(0,0,1,1),Ct.clearColor(1,0,0,1),Ct.clear(Br);var Ja=H.allocType(Kt,4);Ct.readPixels(0,0,1,1,vt,Kt,Ja),Ct.getError()?Ln=!1:(Ct.deleteFramebuffer(ei),Ct.deleteTexture(Mn),Ln=Ja[0]===1),H.freeType(Ja)}}var Qa=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),mi=!0;if(!Qa){var fo=Ct.createTexture(),Hi=H.allocType(Qt,36);Ct.activeTexture(At),Ct.bindTexture(Je,fo),Ct.texImage2D(_t,0,vt,3,3,0,vt,Qt,Hi),H.freeType(Hi),Ct.bindTexture(Je,null),Ct.deleteTexture(fo),mi=!Ct.getError()}return{colorBits:[Ct.getParameter(ee),Ct.getParameter(ue),Ct.getParameter(xe),Ct.getParameter(ge)],depthBits:Ct.getParameter(_e),stencilBits:Ct.getParameter(Y),subpixelBits:Ct.getParameter(W),extensions:Object.keys(Ir).filter(function(hi){return!!Ir[hi]}),maxAnisotropic:zr,maxDrawbuffers:qn,maxColorAttachments:Ca,pointSizeDims:Ct.getParameter(se),lineWidthDims:Ct.getParameter(ce),maxViewportDims:Ct.getParameter(ye),maxCombinedTextureUnits:Ct.getParameter(pe),maxCubeMapSize:Ct.getParameter(Ze),maxRenderbufferSize:Ct.getParameter(Xe),maxTextureUnits:Ct.getParameter(Ne),maxTextureSize:Ct.getParameter(ne),maxAttributes:Ct.getParameter(le),maxVertexUniforms:Ct.getParameter(Z),maxVertexTextureUnits:Ct.getParameter(Te),maxVaryingVectors:Ct.getParameter(de),maxFragmentUniforms:Ct.getParameter($e),glsl:Ct.getParameter(mt),renderer:Ct.getParameter(yt),vendor:Ct.getParameter(it),version:Ct.getParameter(bt),readFloat:Ln,npotTextureCube:mi}},Fr=function(Ct){return Ct instanceof Uint8Array||Ct instanceof Uint16Array||Ct instanceof Uint32Array||Ct instanceof Int8Array||Ct instanceof Int16Array||Ct instanceof Int32Array||Ct instanceof Float32Array||Ct instanceof Float64Array||Ct instanceof Uint8ClampedArray};function Qr(Ct){return!!Ct&&typeof Ct=="object"&&Array.isArray(Ct.shape)&&Array.isArray(Ct.stride)&&typeof Ct.offset=="number"&&Ct.shape.length===Ct.stride.length&&(Array.isArray(Ct.data)||Fr(Ct.data))}var Bt=function(Ct){return Object.keys(Ct).map(function(Ir){return Ct[Ir]})},et={shape:at,flatten:Fe};function ut(Ct,Ir,zr){for(var qn=0;qn0){var io;if(Array.isArray(ea[0])){oi=ra(ea);for(var wa=1,ca=1;ca0){if(typeof wa[0]=="number"){var yi=H.allocType(ba.dtype,wa.length);an(yi,wa),oi(yi,Ri),H.freeType(yi)}else if(Array.isArray(wa[0])||Fr(wa[0])){Zn=ra(wa);var ti=xa(wa,Zn,ba.dtype);oi(ti,Ri),H.freeType(ti)}}}else if(Qr(wa)){Zn=wa.shape;var lo=wa.stride,Jo=0,Wi=0,vo=0,vi=0;Zn.length===1?(Jo=Zn[0],Wi=1,vo=lo[0],vi=0):Zn.length===2&&(Jo=Zn[0],Wi=Zn[1],vo=lo[0],vi=lo[1]);var Ho=Array.isArray(wa.data)?ba.dtype:br(wa.data),us=H.allocType(Ho,Jo*Wi);bn(us,wa.data,Jo,Wi,vo,vi,wa.offset),oi(us,Ri),H.freeType(us)}return Fi}return ga||Fi(gn),Fi._reglType="buffer",Fi._buffer=ba,Fi.subdata=io,zr.profile&&(Fi.stats=ba.stats),Fi.destroy=function(){Hi(ba)},Fi}function za(){Bt(Ln).forEach(function(gn){gn.buffer=Ct.createBuffer(),Ct.bindBuffer(gn.type,gn.buffer),Ct.bufferData(gn.type,gn.persistentData||gn.byteLength,gn.usage)})}return zr.profile&&(Ir.getTotalBufferSize=function(){var gn=0;return Object.keys(Ln).forEach(function(ea){gn+=Ln[ea].stats.size}),gn}),{create:hi,createStream:Ja,destroyStream:Qa,clear:function(){Bt(Ln).forEach(Hi),ei.forEach(Hi)},getBuffer:function(gn){return gn&&gn._buffer instanceof Mn?gn._buffer:null},restore:za,_initBuffer:fo}}var Fn=0,va=0,Pa=1,La=1,Oa=4,Wa=4,sa={points:Fn,point:va,lines:Pa,line:La,triangles:Oa,triangle:Wa,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},ji=0,Qi=1,Xt=4,Lt=5120,$r=5121,en=5122,rn=5123,Wr=5124,tn=5125,wn=34963,dn=35040,Nt=35044;function xr(Ct,Ir,zr,qn){var Ca={},Ln=0,Mn={uint8:$r,uint16:rn};Ir.oes_element_index_uint&&(Mn.uint32=tn);function ei(za){this.id=Ln++,Ca[this.id]=this,this.buffer=za,this.primType=Xt,this.vertCount=0,this.type=0}ei.prototype.bind=function(){this.buffer.bind()};var Ja=[];function Qa(za){var gn=Ja.pop();return gn||(gn=new ei(zr.create(null,wn,!0,!1)._buffer)),fo(gn,za,dn,-1,-1,0,0),gn}function mi(za){Ja.push(za)}function fo(za,gn,ea,ga,Na,ba,Fi){za.buffer.bind();var oi;if(gn){var io=Fi;!Fi&&(!Fr(gn)||Qr(gn)&&!Fr(gn.data))&&(io=Ir.oes_element_index_uint?tn:rn),zr._initBuffer(za.buffer,gn,ea,io,3)}else Ct.bufferData(wn,ba,ea),za.buffer.dtype=oi||$r,za.buffer.usage=ea,za.buffer.dimension=3,za.buffer.byteLength=ba;if(oi=Fi,!Fi){switch(za.buffer.dtype){case $r:case Lt:oi=$r;break;case rn:case en:oi=rn;break;case tn:case Wr:oi=tn;break}za.buffer.dtype=oi}za.type=oi;var wa=Na;wa<0&&(wa=za.buffer.byteLength,oi===rn?wa>>=1:oi===tn&&(wa>>=2)),za.vertCount=wa;var ca=ga;if(ga<0){ca=Xt;var Ri=za.buffer.dimension;Ri===1&&(ca=ji),Ri===2&&(ca=Qi),Ri===3&&(ca=Xt)}za.primType=ca}function Hi(za){qn.elementsCount--,delete Ca[za.id],za.buffer.destroy(),za.buffer=null}function hi(za,gn){var ea=zr.create(null,wn,!0),ga=new ei(ea._buffer);qn.elementsCount++;function Na(ba){if(!ba)ea(),ga.primType=Xt,ga.vertCount=0,ga.type=$r;else if(typeof ba=="number")ea(ba),ga.primType=Xt,ga.vertCount=ba|0,ga.type=$r;else{var Fi=null,oi=Nt,io=-1,wa=-1,ca=0,Ri=0;Array.isArray(ba)||Fr(ba)||Qr(ba)?Fi=ba:("data"in ba&&(Fi=ba.data),"usage"in ba&&(oi=_a[ba.usage]),"primitive"in ba&&(io=sa[ba.primitive]),"count"in ba&&(wa=ba.count|0),"type"in ba&&(Ri=Mn[ba.type]),"length"in ba?ca=ba.length|0:(ca=wa,Ri===rn||Ri===en?ca*=2:(Ri===tn||Ri===Wr)&&(ca*=4))),fo(ga,Fi,oi,io,wa,ca,Ri)}return Na}return Na(za),Na._reglType="elements",Na._elements=ga,Na.subdata=function(ba,Fi){return ea.subdata(ba,Fi),Na},Na.destroy=function(){Hi(ga)},Na}return{create:hi,createStream:Qa,destroyStream:mi,getElements:function(za){return typeof za=="function"&&za._elements instanceof ei?za._elements:null},clear:function(){Bt(Ca).forEach(Hi)}}}var Xr=new Float32Array(1),Tn=new Uint32Array(Xr.buffer),Xn=5123;function ia(Ct){for(var Ir=H.allocType(Xn,Ct.length),zr=0;zr>>31<<15,Ln=(qn<<1>>>24)-127,Mn=qn>>13&1023;if(Ln<-24)Ir[zr]=Ca;else if(Ln<-14){var ei=-14-Ln;Ir[zr]=Ca+(Mn+1024>>ei)}else Ln>15?Ir[zr]=Ca+31744:Ir[zr]=Ca+(Ln+15<<10)+Mn}return Ir}function na(Ct){return Array.isArray(Ct)||Fr(Ct)}var An=34467,Yn=3553,qi=34067,Ga=34069,to=6408,_o=6406,Po=6407,Ro=6409,Xo=6410,Oi=32854,bs=32855,cs=36194,fl=32819,Is=32820,ys=33635,ss=34042,hl=6402,ll=34041,Il=35904,Ls=35906,ps=36193,Uo=33776,Rs=33777,Ll=33778,Kl=33779,eu=35986,Ws=35987,Bi=34798,Mo=35840,Jl=35841,Qs=35842,as=35843,tu=36196,dl=5121,Rl=5123,Gu=5125,Eo=5126,Os=10242,ws=10243,pu=10497,vu=33071,ts=33648,Iu=10240,zu=10241,nl=9728,Gl=9729,su=9984,cu=9985,vc=9986,jf=9987,Tf=33170,Rf=4352,_d=4353,ad=4354,ql=34046,cf=3317,xd=37440,Lc=37441,mc=37443,Rc=37444,Df=33984,xu=[su,vc,cu,jf],gc=[0,Ro,Xo,Po,to],ul={};ul[Ro]=ul[_o]=ul[hl]=1,ul[ll]=ul[Xo]=2,ul[Po]=ul[Il]=3,ul[to]=ul[Ls]=4;function ru(Ct){return"[object "+Ct+"]"}var rh=ru("HTMLCanvasElement"),Xc=ru("OffscreenCanvas"),ph=ru("CanvasRenderingContext2D"),Lu=ru("ImageBitmap"),yp=ru("HTMLImageElement"),al=ru("HTMLVideoElement"),Np=Object.keys(ct).concat([rh,Xc,ph,Lu,yp,al]),Ol=[];Ol[dl]=1,Ol[Eo]=4,Ol[ps]=2,Ol[Rl]=2,Ol[Gu]=4;var ns=[];ns[Oi]=2,ns[bs]=2,ns[cs]=2,ns[ll]=4,ns[Uo]=.5,ns[Rs]=.5,ns[Ll]=1,ns[Kl]=1,ns[eu]=.5,ns[Ws]=1,ns[Bi]=1,ns[Mo]=.5,ns[Jl]=.25,ns[Qs]=.5,ns[as]=.25,ns[tu]=.5;function zh(Ct){return Array.isArray(Ct)&&(Ct.length===0||typeof Ct[0]=="number")}function Pf(Ct){if(!Array.isArray(Ct))return!1;var Ir=Ct.length;return!(Ir===0||!na(Ct[0]))}function ic(Ct){return Object.prototype.toString.call(Ct)}function bd(Ct){return ic(Ct)===rh}function vh(Ct){return ic(Ct)===Xc}function Wh(Ct){return ic(Ct)===ph}function yc(Ct){return ic(Ct)===Lu}function Jd(Ct){return ic(Ct)===yp}function Ld(Ct){return ic(Ct)===al}function Xh(Ct){if(!Ct)return!1;var Ir=ic(Ct);return Np.indexOf(Ir)>=0?!0:zh(Ct)||Pf(Ct)||Qr(Ct)}function mh(Ct){return ct[Object.prototype.toString.call(Ct)]|0}function wd(Ct,Ir){var zr=Ir.length;switch(Ct.type){case dl:case Rl:case Gu:case Eo:var qn=H.allocType(Ct.type,zr);qn.set(Ir),Ct.data=qn;break;case ps:Ct.data=ia(Ir);break}}function Td(Ct,Ir){return H.allocType(Ct.type===ps?Eo:Ct.type,Ir)}function zf(Ct,Ir){Ct.type===ps?(Ct.data=ia(Ir),H.freeType(Ir)):Ct.data=Ir}function Rd(Ct,Ir,zr,qn,Ca,Ln){for(var Mn=Ct.width,ei=Ct.height,Ja=Ct.channels,Qa=Mn*ei*Ja,mi=Td(Ct,Qa),fo=0,Hi=0;Hi=1;)ei+=Mn*Ja*Ja,Ja/=2;return ei}else return Mn*zr*qn}function Gf(Ct,Ir,zr,qn,Ca,Ln,Mn){var ei={"don't care":Rf,"dont care":Rf,nice:ad,fast:_d},Ja={repeat:pu,clamp:vu,mirror:ts},Qa={nearest:nl,linear:Gl},mi=v({mipmap:jf,"nearest mipmap nearest":su,"linear mipmap nearest":cu,"nearest mipmap linear":vc,"linear mipmap linear":jf},Qa),fo={none:0,browser:Rc},Hi={uint8:dl,rgba4:fl,rgb565:ys,"rgb5 a1":Is},hi={alpha:_o,luminance:Ro,"luminance alpha":Xo,rgb:Po,rgba:to,rgba4:Oi,"rgb5 a1":bs,rgb565:cs},za={};Ir.ext_srgb&&(hi.srgb=Il,hi.srgba=Ls),Ir.oes_texture_float&&(Hi.float32=Hi.float=Eo),Ir.oes_texture_half_float&&(Hi.float16=Hi["half float"]=ps),Ir.webgl_depth_texture&&(v(hi,{depth:hl,"depth stencil":ll}),v(Hi,{uint16:Rl,uint32:Gu,"depth stencil":ss})),Ir.webgl_compressed_texture_s3tc&&v(za,{"rgb s3tc dxt1":Uo,"rgba s3tc dxt1":Rs,"rgba s3tc dxt3":Ll,"rgba s3tc dxt5":Kl}),Ir.webgl_compressed_texture_atc&&v(za,{"rgb atc":eu,"rgba atc explicit alpha":Ws,"rgba atc interpolated alpha":Bi}),Ir.webgl_compressed_texture_pvrtc&&v(za,{"rgb pvrtc 4bppv1":Mo,"rgb pvrtc 2bppv1":Jl,"rgba pvrtc 4bppv1":Qs,"rgba pvrtc 2bppv1":as}),Ir.webgl_compressed_texture_etc1&&(za["rgb etc1"]=tu);var gn=Array.prototype.slice.call(Ct.getParameter(An));Object.keys(za).forEach(function(X){var we=za[X];gn.indexOf(we)>=0&&(hi[X]=we)});var ea=Object.keys(hi);zr.textureFormats=ea;var ga=[];Object.keys(hi).forEach(function(X){var we=hi[X];ga[we]=X});var Na=[];Object.keys(Hi).forEach(function(X){var we=Hi[X];Na[we]=X});var ba=[];Object.keys(Qa).forEach(function(X){var we=Qa[X];ba[we]=X});var Fi=[];Object.keys(mi).forEach(function(X){var we=mi[X];Fi[we]=X});var oi=[];Object.keys(Ja).forEach(function(X){var we=Ja[X];oi[we]=X});var io=ea.reduce(function(X,we){var ie=hi[we];return ie===Ro||ie===_o||ie===Ro||ie===Xo||ie===hl||ie===ll||Ir.ext_srgb&&(ie===Il||ie===Ls)?X[ie]=ie:ie===bs||we.indexOf("rgba")>=0?X[ie]=to:X[ie]=Po,X},{});function wa(){this.internalformat=to,this.format=to,this.type=dl,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Rc,this.width=0,this.height=0,this.channels=0}function ca(X,we){X.internalformat=we.internalformat,X.format=we.format,X.type=we.type,X.compressed=we.compressed,X.premultiplyAlpha=we.premultiplyAlpha,X.flipY=we.flipY,X.unpackAlignment=we.unpackAlignment,X.colorSpace=we.colorSpace,X.width=we.width,X.height=we.height,X.channels=we.channels}function Ri(X,we){if(!(typeof we!="object"||!we)){if("premultiplyAlpha"in we&&(X.premultiplyAlpha=we.premultiplyAlpha),"flipY"in we&&(X.flipY=we.flipY),"alignment"in we&&(X.unpackAlignment=we.alignment),"colorSpace"in we&&(X.colorSpace=fo[we.colorSpace]),"type"in we){var ie=we.type;X.type=Hi[ie]}var Me=X.width,tt=X.height,wt=X.channels,Et=!1;"shape"in we?(Me=we.shape[0],tt=we.shape[1],we.shape.length===3&&(wt=we.shape[2],Et=!0)):("radius"in we&&(Me=tt=we.radius),"width"in we&&(Me=we.width),"height"in we&&(tt=we.height),"channels"in we&&(wt=we.channels,Et=!0)),X.width=Me|0,X.height=tt|0,X.channels=wt|0;var lt=!1;if("format"in we){var gt=we.format,Pt=X.internalformat=hi[gt];X.format=io[Pt],gt in Hi&&("type"in we||(X.type=Hi[gt])),gt in za&&(X.compressed=!0),lt=!0}!Et&<?X.channels=ul[X.format]:Et&&!lt&&X.channels!==gc[X.format]&&(X.format=X.internalformat=gc[X.channels])}}function Zn(X){Ct.pixelStorei(xd,X.flipY),Ct.pixelStorei(Lc,X.premultiplyAlpha),Ct.pixelStorei(mc,X.colorSpace),Ct.pixelStorei(cf,X.unpackAlignment)}function yi(){wa.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function ti(X,we){var ie=null;if(Xh(we)?ie=we:we&&(Ri(X,we),"x"in we&&(X.xOffset=we.x|0),"y"in we&&(X.yOffset=we.y|0),Xh(we.data)&&(ie=we.data)),we.copy){var Me=Ca.viewportWidth,tt=Ca.viewportHeight;X.width=X.width||Me-X.xOffset,X.height=X.height||tt-X.yOffset,X.needsCopy=!0}else if(!ie)X.width=X.width||1,X.height=X.height||1,X.channels=X.channels||4;else if(Fr(ie))X.channels=X.channels||4,X.data=ie,!("type"in we)&&X.type===dl&&(X.type=mh(ie));else if(zh(ie))X.channels=X.channels||4,wd(X,ie),X.alignment=1,X.needsFree=!0;else if(Qr(ie)){var wt=ie.data;!Array.isArray(wt)&&X.type===dl&&(X.type=mh(wt));var Et=ie.shape,lt=ie.stride,gt,Pt,lr,nr,cr,gr;Et.length===3?(lr=Et[2],gr=lt[2]):(lr=1,gr=1),gt=Et[0],Pt=Et[1],nr=lt[0],cr=lt[1],X.alignment=1,X.width=gt,X.height=Pt,X.channels=lr,X.format=X.internalformat=gc[lr],X.needsFree=!0,Rd(X,wt,nr,cr,gr,ie.offset)}else if(bd(ie)||vh(ie)||Wh(ie))bd(ie)||vh(ie)?X.element=ie:X.element=ie.canvas,X.width=X.element.width,X.height=X.element.height,X.channels=4;else if(yc(ie))X.element=ie,X.width=ie.width,X.height=ie.height,X.channels=4;else if(Jd(ie))X.element=ie,X.width=ie.naturalWidth,X.height=ie.naturalHeight,X.channels=4;else if(Ld(ie))X.element=ie,X.width=ie.videoWidth,X.height=ie.videoHeight,X.channels=4;else if(Pf(ie)){var pr=X.width||ie[0].length,Jt=X.height||ie.length,or=X.channels;na(ie[0][0])?or=or||ie[0][0].length:or=or||1;for(var ar=et.shape(ie),Yr=1,cn=0;cn>=tt,ie.height>>=tt,ti(ie,Me[tt]),X.mipmask|=1<=0&&!("faces"in we)&&(X.genMipmaps=!0)}if("mag"in we){var Me=we.mag;X.magFilter=Qa[Me]}var tt=X.wrapS,wt=X.wrapT;if("wrap"in we){var Et=we.wrap;typeof Et=="string"?tt=wt=Ja[Et]:Array.isArray(Et)&&(tt=Ja[Et[0]],wt=Ja[Et[1]])}else{if("wrapS"in we){var lt=we.wrapS;tt=Ja[lt]}if("wrapT"in we){var gt=we.wrapT;wt=Ja[gt]}}if(X.wrapS=tt,X.wrapT=wt,"anisotropic"in we&&(we.anisotropic,X.anisotropic=we.anisotropic),"mipmap"in we){var Pt=!1;switch(typeof we.mipmap){case"string":X.mipmapHint=ei[we.mipmap],X.genMipmaps=!0,Pt=!0;break;case"boolean":Pt=X.genMipmaps=we.mipmap;break;case"object":X.genMipmaps=!1,Pt=!0;break}Pt&&!("min"in we)&&(X.minFilter=su)}}function xc(X,we){Ct.texParameteri(we,zu,X.minFilter),Ct.texParameteri(we,Iu,X.magFilter),Ct.texParameteri(we,Os,X.wrapS),Ct.texParameteri(we,ws,X.wrapT),Ir.ext_texture_filter_anisotropic&&Ct.texParameteri(we,ql,X.anisotropic),X.genMipmaps&&(Ct.hint(Tf,X.mipmapHint),Ct.generateMipmap(we))}var Yf=0,Tu={},Du=zr.maxTextureUnits,Fo=Array(Du).map(function(){return null});function bc(X){wa.call(this),this.mipmask=0,this.internalformat=to,this.id=Yf++,this.refCount=1,this.target=X,this.texture=Ct.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Fu,Mn.profile&&(this.stats={size:0})}function sl(X){Ct.activeTexture(Df),Ct.bindTexture(X.target,X.texture)}function iu(){var X=Fo[0];X?Ct.bindTexture(X.target,X.texture):Ct.bindTexture(Yn,null)}function Fc(X){var we=X.texture,ie=X.unit,Me=X.target;ie>=0&&(Ct.activeTexture(Df+ie),Ct.bindTexture(Me,null),Fo[ie]=null),Ct.deleteTexture(we),X.texture=null,X.params=null,X.pixels=null,X.refCount=0,delete Tu[X.id],Ln.textureCount--}v(bc.prototype,{bind:function(){var X=this;X.bindCount+=1;var we=X.unit;if(we<0){for(var ie=0;ie0)continue;Me.unit=-1}Fo[ie]=X,we=ie;break}Mn.profile&&Ln.maxTextureUnits>cr)-lr,gr.height=gr.height||(ie.height>>cr)-nr,sl(ie),Jo(gr,Yn,lr,nr,cr),iu(),vi(gr),Me}function wt(Et,lt){var gt=Et|0,Pt=lt|0||gt;if(gt===ie.width&&Pt===ie.height)return Me;Me.width=ie.width=gt,Me.height=ie.height=Pt,sl(ie);for(var lr=0;ie.mipmask>>lr;++lr){var nr=gt>>lr,cr=Pt>>lr;if(!nr||!cr)break;Ct.texImage2D(Yn,lr,ie.format,nr,cr,0,ie.format,ie.type,null)}return iu(),Mn.profile&&(ie.stats.size=nh(ie.internalformat,ie.type,gt,Pt,!1,!1)),Me}return Me(X,we),Me.subimage=tt,Me.resize=wt,Me._reglType="texture2d",Me._texture=ie,Mn.profile&&(Me.stats=ie.stats),Me.destroy=function(){ie.decRef()},Me}function Zo(X,we,ie,Me,tt,wt){var Et=new bc(qi);Tu[Et.id]=Et,Ln.cubeCount++;var lt=new Array(6);function gt(nr,cr,gr,pr,Jt,or){var ar,Yr=Et.texInfo;for(Fu.call(Yr),ar=0;ar<6;++ar)lt[ar]=Wu();if(typeof nr=="number"||!nr){var cn=nr|0||1;for(ar=0;ar<6;++ar)us(lt[ar],cn,cn)}else if(typeof nr=="object")if(cr)_s(lt[0],nr),_s(lt[1],cr),_s(lt[2],gr),_s(lt[3],pr),_s(lt[4],Jt),_s(lt[5],or);else if(oc(Yr,nr),Ri(Et,nr),"faces"in nr){var Sn=nr.faces;for(ar=0;ar<6;++ar)ca(lt[ar],Et),_s(lt[ar],Sn[ar])}else for(ar=0;ar<6;++ar)_s(lt[ar],nr);for(ca(Et,lt[0]),Yr.genMipmaps?Et.mipmask=(lt[0].width<<1)-1:Et.mipmask=lt[0].mipmask,Et.internalformat=lt[0].internalformat,gt.width=lt[0].width,gt.height=lt[0].height,sl(Et),ar=0;ar<6;++ar)Dl(lt[ar],Ga+ar);for(xc(Yr,qi),iu(),Mn.profile&&(Et.stats.size=nh(Et.internalformat,Et.type,gt.width,gt.height,Yr.genMipmaps,!0)),gt.format=ga[Et.internalformat],gt.type=Na[Et.type],gt.mag=ba[Yr.magFilter],gt.min=Fi[Yr.minFilter],gt.wrapS=oi[Yr.wrapS],gt.wrapT=oi[Yr.wrapT],ar=0;ar<6;++ar)xl(lt[ar]);return gt}function Pt(nr,cr,gr,pr,Jt){var or=gr|0,ar=pr|0,Yr=Jt|0,cn=vo();return ca(cn,Et),cn.width=0,cn.height=0,ti(cn,cr),cn.width=cn.width||(Et.width>>Yr)-or,cn.height=cn.height||(Et.height>>Yr)-ar,sl(Et),Jo(cn,Ga+nr,or,ar,Yr),iu(),vi(cn),gt}function lr(nr){var cr=nr|0;if(cr!==Et.width){gt.width=Et.width=cr,gt.height=Et.height=cr,sl(Et);for(var gr=0;gr<6;++gr)for(var pr=0;Et.mipmask>>pr;++pr)Ct.texImage2D(Ga+gr,pr,Et.format,cr>>pr,cr>>pr,0,Et.format,Et.type,null);return iu(),Mn.profile&&(Et.stats.size=nh(Et.internalformat,Et.type,gt.width,gt.height,!1,!0)),gt}}return gt(X,we,ie,Me,tt,wt),gt.subimage=Pt,gt.resize=lr,gt._reglType="textureCube",gt._texture=Et,Mn.profile&&(gt.stats=Et.stats),gt.destroy=function(){Et.decRef()},gt}function Ds(){for(var X=0;X>Me,ie.height>>Me,0,ie.internalformat,ie.type,null);else for(var tt=0;tt<6;++tt)Ct.texImage2D(Ga+tt,Me,ie.internalformat,ie.width>>Me,ie.height>>Me,0,ie.internalformat,ie.type,null);xc(ie.texInfo,ie.target)})}function Le(){for(var X=0;X=0?Wu=!0:Ja.indexOf(xl)>=0&&(Wu=!1))),("depthTexture"in Fo||"depthStencilTexture"in Fo)&&(Du=!!(Fo.depthTexture||Fo.depthStencilTexture)),"depth"in Fo&&(typeof Fo.depth=="boolean"?_s=Fo.depth:(xc=Fo.depth,Dl=!1)),"stencil"in Fo&&(typeof Fo.stencil=="boolean"?Dl=Fo.stencil:(Yf=Fo.stencil,_s=!1)),"depthStencil"in Fo&&(typeof Fo.depthStencil=="boolean"?_s=Dl=Fo.depthStencil:(Tu=Fo.depthStencil,_s=!1,Dl=!1))}var sl=null,iu=null,Fc=null,Bc=null;if(Array.isArray(xs))sl=xs.map(hi);else if(xs)sl=[hi(xs)];else for(sl=new Array(oc),vi=0;vi0&&(vo.depth=yi[0].depth,vo.stencil=yi[0].stencil,vo.depthStencil=yi[0].depthStencil),yi[Wi]?yi[Wi](vo):yi[Wi]=wa(vo)}return v(ti,{width:vi,height:vi,color:xl})}function lo(Jo){var Wi,vo=Jo|0;if(vo===ti.width)return ti;var vi=ti.color;for(Wi=0;Wi=Ho.byteLength?us.subdata(Ho):(us.destroy(),ca.buffers[Wi]=null)),ca.buffers[Wi]||(us=ca.buffers[Wi]=Ca.create(vo,Bh,!1,!0)),vi.buffer=Ca.getBuffer(us),vi.size=vi.buffer.dimension|0,vi.normalized=!1,vi.type=vi.buffer.dtype,vi.offset=0,vi.stride=0,vi.divisor=0,vi.state=1,lo[Wi]=1}else Ca.getBuffer(vo)?(vi.buffer=Ca.getBuffer(vo),vi.size=vi.buffer.dimension|0,vi.normalized=!1,vi.type=vi.buffer.dtype,vi.offset=0,vi.stride=0,vi.divisor=0,vi.state=1):Ca.getBuffer(vo.buffer)?(vi.buffer=Ca.getBuffer(vo.buffer),vi.size=(+vo.size||vi.buffer.dimension)|0,vi.normalized=!!vo.normalized||!1,"type"in vo?vi.type=jn[vo.type]:vi.type=vi.buffer.dtype,vi.offset=(vo.offset||0)|0,vi.stride=(vo.stride||0)|0,vi.divisor=(vo.divisor||0)|0,vi.state=1):"x"in vo&&(vi.x=+vo.x||0,vi.y=+vo.y||0,vi.z=+vo.z||0,vi.w=+vo.w||0,vi.state=2)}for(var _s=0;_s1)for(var Zn=0;Zngn&&(gn=ea.stats.uniformsCount)}),gn},zr.getMaxAttributesCount=function(){var gn=0;return mi.forEach(function(ea){ea.stats.attributesCount>gn&&(gn=ea.stats.attributesCount)}),gn});function za(){Ca={},Ln={};for(var gn=0;gn>>4&15)+Ir.charAt(qn&15);return zr}function Wf(Ct){for(var Ir="",zr=-1,qn,Ca;++zr>>6&31,128|qn&63):qn<=65535?Ir+=String.fromCharCode(224|qn>>>12&15,128|qn>>>6&63,128|qn&63):qn<=2097151&&(Ir+=String.fromCharCode(240|qn>>>18&7,128|qn>>>12&63,128|qn>>>6&63,128|qn&63));return Ir}function qu(Ct){for(var Ir=Array(Ct.length>>2),zr=0;zr>5]|=(Ct.charCodeAt(zr/8)&255)<<24-zr%32;return Ir}function Yc(Ct){for(var Ir="",zr=0;zr>5]>>>24-zr%32&255);return Ir}function Nu(Ct,Ir){return Ct>>>Ir|Ct<<32-Ir}function xh(Ct,Ir){return Ct>>>Ir}function Xf(Ct,Ir,zr){return Ct&Ir^~Ct&zr}function Ed(Ct,Ir,zr){return Ct&Ir^Ct&zr^Ir&zr}function wr(Ct){return Nu(Ct,2)^Nu(Ct,13)^Nu(Ct,22)}function qr(Ct){return Nu(Ct,6)^Nu(Ct,11)^Nu(Ct,25)}function kn(Ct){return Nu(Ct,7)^Nu(Ct,18)^xh(Ct,3)}function _n(Ct){return Nu(Ct,17)^Nu(Ct,19)^xh(Ct,10)}var Qn=new Array(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);function $a(Ct,Ir){var zr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),qn=new Array(64),Ca,Ln,Mn,ei,Ja,Qa,mi,fo,Hi,hi,za,gn;for(Ct[Ir>>5]|=128<<24-Ir%32,Ct[(Ir+64>>9<<4)+15]=Ir,Hi=0;Hi>16)+(Ir>>16)+(zr>>16);return qn<<16|zr&65535}function Ai(Ct){return Array.prototype.slice.call(Ct)}function Ni(Ct){return Ai(Ct).join("")}function ho(Ct){var Ir=Ct&&Ct.cache,zr=0,qn=[],Ca=[],Ln=[];function Mn(za,gn){var ea=gn&&gn.stable;if(!ea){for(var ga=0;ga0&&(za.push(Na,"="),za.push.apply(za,Ai(arguments)),za.push(";")),Na}return v(gn,{def:ga,toString:function(){return Ni([ea.length>0?"var "+ea.join(",")+";":"",Ni(za)])}})}function Ja(){var za=ei(),gn=ei(),ea=za.toString,ga=gn.toString;function Na(ba,Fi){gn(ba,Fi,"=",za.def(ba,Fi),";")}return v(function(){za.apply(za,Ai(arguments))},{def:za.def,entry:za,exit:gn,save:Na,set:function(ba,Fi,oi){Na(ba,Fi),za(ba,Fi,"=",oi,";")},toString:function(){return ea()+ga()}})}function Qa(){var za=Ni(arguments),gn=Ja(),ea=Ja(),ga=gn.toString,Na=ea.toString;return v(gn,{then:function(){return gn.apply(gn,Ai(arguments)),this},else:function(){return ea.apply(ea,Ai(arguments)),this},toString:function(){var ba=Na();return ba&&(ba="else{"+ba+"}"),Ni(["if(",za,"){",ga(),"}",ba])}})}var mi=ei(),fo={};function Hi(za,gn){var ea=[];function ga(){var io="a"+ea.length;return ea.push(io),io}gn=gn||0;for(var Na=0;Na":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Aa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Va={cw:Dt,ccw:Ot};function Za(Ct){return Array.isArray(Ct)||Fr(Ct)||Qr(Ct)}function Ta(Ct){return Ct.sort(function(Ir,zr){return Ir===vf?-1:zr===vf?1:Ir=1,qn>=2,Ir)}else if(zr===ls){var Ca=Ct.data;return new Ii(Ca.thisDep,Ca.contextDep,Ca.propDep,Ir)}else{if(zr===To)return new Ii(!1,!1,!1,Ir);if(zr===ro){for(var Ln=!1,Mn=!1,ei=!1,Ja=0;Ja=1&&(Mn=!0),mi>=2&&(ei=!0)}else Qa.type===ls&&(Ln=Ln||Qa.data.thisDep,Mn=Mn||Qa.data.contextDep,ei=ei||Qa.data.propDep)}return new Ii(Ln,Mn,ei,Ir)}else return new Ii(zr===fs,zr===rs,zr===os,Ir)}}var jo=new Ii(!1,!1,!1,function(){});function Yo(Ct,Ir,zr,qn,Ca,Ln,Mn,ei,Ja,Qa,mi,fo,Hi,hi,za,gn){var ea=Qa.Record,ga={add:32774,subtract:32778,"reverse subtract":32779};zr.ext_blend_minmax&&(ga.min=Wt,ga.max=dr);var Na=zr.angle_instanced_arrays,ba=zr.webgl_draw_buffers,Fi=zr.oes_vertex_array_object,oi={dirty:!0,profile:gn.profile},io={},wa=[],ca={},Ri={};function Zn(lt){return lt.replace(".","_")}function yi(lt,gt,Pt){var lr=Zn(lt);wa.push(lt),io[lr]=oi[lr]=!!Pt,ca[lr]=gt}function ti(lt,gt,Pt){var lr=Zn(lt);wa.push(lt),Array.isArray(Pt)?(oi[lr]=Pt.slice(),io[lr]=Pt.slice()):oi[lr]=io[lr]=Pt,Ri[lr]=gt}function lo(lt){return!!isNaN(lt)}yi(Ts,sn),yi(il,jr),ti(Hl,"blendColor",[0,0,0,0]),ti(mu,"blendEquationSeparate",[En,En]),ti(Xl,"blendFuncSeparate",[on,ln,on,ln]),yi(gu,$n,!0),ti(wl,"depthFunc",Un),ti(Zu,"depthRange",[0,1]),ti(Hu,"depthMask",!0),ti(fu,fu,[!0,!0,!0,!0]),yi(Vo,Nr),ti(Fs,"cullFace",pt),ti(nu,nu,Ot),ti(Fl,Fl,1),yi(jc,ua),ti(Gc,"polygonOffset",[0,0]),yi(Zc,Ua),yi(kh,Si),ti(qc,"sampleCoverage",[1,!1]),yi(oh,xn),ti(Ku,"stencilMask",-1),ti(sh,"stencilFunc",[hr,0,-1]),ti(hs,"stencilOpSeparate",[Ye,Rr,Rr,Rr]),ti(Ss,"stencilOpSeparate",[pt,Rr,Rr,Rr]),yi(lh,Wn),ti(Cf,"scissor",[0,0,Ct.drawingBufferWidth,Ct.drawingBufferHeight]),ti(vf,vf,[0,0,Ct.drawingBufferWidth,Ct.drawingBufferHeight]);var Jo={gl:Ct,context:Hi,strings:Ir,next:io,current:oi,draw:fo,elements:Ln,buffer:Ca,shader:mi,attributes:Qa.state,vao:Qa,uniforms:Ja,framebuffer:ei,extensions:zr,timer:hi,isBufferArgs:Za},Wi={primTypes:sa,compareFuncs:ma,blendFuncs:Kn,blendEquations:ga,stencilOps:Aa,glTypes:jn,orientationType:Va};ba&&(Wi.backBuffer=[pt],Wi.drawBuffer=_(qn.maxDrawbuffers,function(lt){return lt===0?[0]:_(lt,function(gt){return Xa+gt})}));var vo=0;function vi(){var lt=ho({cache:za}),gt=lt.link,Pt=lt.global;lt.id=vo++,lt.batchId="0";var lr=gt(Jo),nr=lt.shared={props:"a0"};Object.keys(Jo).forEach(function(or){nr[or]=Pt.def(lr,".",or)});var cr=lt.next={},gr=lt.current={};Object.keys(Ri).forEach(function(or){Array.isArray(oi[or])&&(cr[or]=Pt.def(nr.next,".",or),gr[or]=Pt.def(nr.current,".",or))});var pr=lt.constants={};Object.keys(Wi).forEach(function(or){pr[or]=Pt.def(JSON.stringify(Wi[or]))}),lt.invoke=function(or,ar){switch(ar.type){case bo:var Yr=["this",nr.context,nr.props,lt.batchId];return or.def(gt(ar.data),".call(",Yr.slice(0,Math.max(ar.data.length+1,4)),")");case os:return or.def(nr.props,ar.data);case rs:return or.def(nr.context,ar.data);case fs:return or.def("this",ar.data);case ls:return ar.data.append(lt,or),ar.data.ref;case To:return ar.data.toString();case ro:return ar.data.map(function(cn){return lt.invoke(or,cn)})}},lt.attribCache={};var Jt={};return lt.scopeAttrib=function(or){var ar=Ir.id(or);if(ar in Jt)return Jt[ar];var Yr=Qa.scope[ar];Yr||(Yr=Qa.scope[ar]=new ea);var cn=Jt[ar]=gt(Yr);return cn},lt}function Ho(lt){var gt=lt.static,Pt=lt.dynamic,lr;if(Qe in gt){var nr=!!gt[Qe];lr=so(function(gr,pr){return nr}),lr.enable=nr}else if(Qe in Pt){var cr=Pt[Qe];lr=yo(cr,function(gr,pr){return gr.invoke(pr,cr)})}return lr}function us(lt,gt){var Pt=lt.static,lr=lt.dynamic;if(N in Pt){var nr=Pt[N];return nr?(nr=ei.getFramebuffer(nr),so(function(gr,pr){var Jt=gr.link(nr),or=gr.shared;pr.set(or.framebuffer,".next",Jt);var ar=or.context;return pr.set(ar,"."+vn,Jt+".width"),pr.set(ar,"."+Dn,Jt+".height"),Jt})):so(function(gr,pr){var Jt=gr.shared;pr.set(Jt.framebuffer,".next","null");var or=Jt.context;return pr.set(or,"."+vn,or+"."+Rt),pr.set(or,"."+Dn,or+"."+Yt),"null"})}else if(N in lr){var cr=lr[N];return yo(cr,function(gr,pr){var Jt=gr.invoke(pr,cr),or=gr.shared,ar=or.framebuffer,Yr=pr.def(ar,".getFramebuffer(",Jt,")");pr.set(ar,".next",Yr);var cn=or.context;return pr.set(cn,"."+vn,Yr+"?"+Yr+".width:"+cn+"."+Rt),pr.set(cn,"."+Dn,Yr+"?"+Yr+".height:"+cn+"."+Yt),Yr})}else return null}function _s(lt,gt,Pt){var lr=lt.static,nr=lt.dynamic;function cr(Jt){if(Jt in lr){var or=lr[Jt],ar=!0,Yr=or.x|0,cn=or.y|0,Sn,Sa;return"width"in or?Sn=or.width|0:ar=!1,"height"in or?Sa=or.height|0:ar=!1,new Ii(!ar&>&>.thisDep,!ar&>&>.contextDep,!ar&>&>.propDep,function(Ea,Ra){var Ya=Ea.shared.context,ka=Sn;"width"in or||(ka=Ra.def(Ya,".",vn,"-",Yr));var ri=Sa;return"height"in or||(ri=Ra.def(Ya,".",Dn,"-",cn)),[Yr,cn,ka,ri]})}else if(Jt in nr){var fa=nr[Jt],la=yo(fa,function(Ea,Ra){var Ya=Ea.invoke(Ra,fa),ka=Ea.shared.context,ri=Ra.def(Ya,".x|0"),_i=Ra.def(Ya,".y|0"),Ki=Ra.def('"width" in ',Ya,"?",Ya,".width|0:","(",ka,".",vn,"-",ri,")"),mo=Ra.def('"height" in ',Ya,"?",Ya,".height|0:","(",ka,".",Dn,"-",_i,")");return[ri,_i,Ki,mo]});return gt&&(la.thisDep=la.thisDep||gt.thisDep,la.contextDep=la.contextDep||gt.contextDep,la.propDep=la.propDep||gt.propDep),la}else return gt?new Ii(gt.thisDep,gt.contextDep,gt.propDep,function(Ea,Ra){var Ya=Ea.shared.context;return[0,0,Ra.def(Ya,".",vn),Ra.def(Ya,".",Dn)]}):null}var gr=cr(vf);if(gr){var pr=gr;gr=new Ii(gr.thisDep,gr.contextDep,gr.propDep,function(Jt,or){var ar=pr.append(Jt,or),Yr=Jt.shared.context;return or.set(Yr,"."+ot,ar[2]),or.set(Yr,"."+dt,ar[3]),ar})}return{viewport:gr,scissor_box:cr(Cf)}}function Dl(lt,gt){var Pt=lt.static,lr=typeof Pt[Oe]=="string"&&typeof Pt[ve]=="string";if(lr){if(Object.keys(gt.dynamic).length>0)return null;var nr=gt.static,cr=Object.keys(nr);if(cr.length>0&&typeof nr[cr[0]]=="number"){for(var gr=[],pr=0;pr"+ri+"?"+ar+".constant["+ri+"]:0;"}).join(""),"}}else{","if(",Sn,"(",ar,".buffer)){",Ea,"=",Sa,".createStream(",er,",",ar,".buffer);","}else{",Ea,"=",Sa,".getBuffer(",ar,".buffer);","}",Ra,'="type" in ',ar,"?",cn.glTypes,"[",ar,".type]:",Ea,".dtype;",fa.normalized,"=!!",ar,".normalized;");function Ya(ka){or(fa[ka],"=",ar,".",ka,"|0;")}return Ya("size"),Ya("offset"),Ya("stride"),Ya("divisor"),or("}}"),or.exit("if(",fa.isStream,"){",Sa,".destroyStream(",Ea,");","}"),fa}nr[cr]=yo(gr,pr)}),nr}function xc(lt){var gt=lt.static,Pt=lt.dynamic,lr={};return Object.keys(gt).forEach(function(nr){var cr=gt[nr];lr[nr]=so(function(gr,pr){return typeof cr=="number"||typeof cr=="boolean"?""+cr:gr.link(cr)})}),Object.keys(Pt).forEach(function(nr){var cr=Pt[nr];lr[nr]=yo(cr,function(gr,pr){return gr.invoke(pr,cr)})}),lr}function Yf(lt,gt,Pt,lr,nr){lt.static,lt.dynamic;var cr=Dl(lt,gt),gr=us(lt),pr=_s(lt,gr),Jt=Wu(lt),or=xl(lt),ar=xs(lt,nr,cr);function Yr(Ea){var Ra=pr[Ea];Ra&&(or[Ea]=Ra)}Yr(vf),Yr(Zn(Cf));var cn=Object.keys(or).length>0,Sn={framebuffer:gr,draw:Jt,shader:ar,state:or,dirty:cn,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Sn.profile=Ho(lt),Sn.uniforms=Fu(Pt),Sn.drawVAO=Sn.scopeVAO=Jt.vao,!Sn.drawVAO&&ar.program&&!cr&&zr.angle_instanced_arrays&&Jt.static.elements){var Sa=!0,fa=ar.program.attributes.map(function(Ea){var Ra=gt.static[Ea];return Sa=Sa&&!!Ra,Ra});if(Sa&&fa.length>0){var la=Qa.getVAO(Qa.createVAO({attributes:fa,elements:Jt.static.elements}));Sn.drawVAO=new Ii(null,null,null,function(Ea,Ra){return Ea.link(la)}),Sn.useVAO=!0}}return cr?Sn.useVAO=!0:Sn.attributes=oc(gt),Sn.context=xc(lr),Sn}function Tu(lt,gt,Pt){var lr=lt.shared,nr=lr.context,cr=lt.scope();Object.keys(Pt).forEach(function(gr){gt.save(nr,"."+gr);var pr=Pt[gr],Jt=pr.append(lt,gt);Array.isArray(Jt)?cr(nr,".",gr,"=[",Jt.join(),"];"):cr(nr,".",gr,"=",Jt,";")}),gt(cr)}function Du(lt,gt,Pt,lr){var nr=lt.shared,cr=nr.gl,gr=nr.framebuffer,pr;ba&&(pr=gt.def(nr.extensions,".webgl_draw_buffers"));var Jt=lt.constants,or=Jt.drawBuffer,ar=Jt.backBuffer,Yr;Pt?Yr=Pt.append(lt,gt):Yr=gt.def(gr,".next"),lr||gt("if(",Yr,"!==",gr,".cur){"),gt("if(",Yr,"){",cr,".bindFramebuffer(",Gn,",",Yr,".framebuffer);"),ba&>(pr,".drawBuffersWEBGL(",or,"[",Yr,".colorAttachments.length]);"),gt("}else{",cr,".bindFramebuffer(",Gn,",null);"),ba&>(pr,".drawBuffersWEBGL(",ar,");"),gt("}",gr,".cur=",Yr,";"),lr||gt("}")}function Fo(lt,gt,Pt){var lr=lt.shared,nr=lr.gl,cr=lt.current,gr=lt.next,pr=lr.current,Jt=lr.next,or=lt.cond(pr,".dirty");wa.forEach(function(ar){var Yr=Zn(ar);if(!(Yr in Pt.state)){var cn,Sn;if(Yr in gr){cn=gr[Yr],Sn=cr[Yr];var Sa=_(oi[Yr].length,function(la){return or.def(cn,"[",la,"]")});or(lt.cond(Sa.map(function(la,Ea){return la+"!=="+Sn+"["+Ea+"]"}).join("||")).then(nr,".",Ri[Yr],"(",Sa,");",Sa.map(function(la,Ea){return Sn+"["+Ea+"]="+la}).join(";"),";"))}else{cn=or.def(Jt,".",Yr);var fa=lt.cond(cn,"!==",pr,".",Yr);or(fa),Yr in ca?fa(lt.cond(cn).then(nr,".enable(",ca[Yr],");").else(nr,".disable(",ca[Yr],");"),pr,".",Yr,"=",cn,";"):fa(nr,".",Ri[Yr],"(",cn,");",pr,".",Yr,"=",cn,";")}}}),Object.keys(Pt.state).length===0&&or(pr,".dirty=false;"),gt(or)}function bc(lt,gt,Pt,lr){var nr=lt.shared,cr=lt.current,gr=nr.current,pr=nr.gl,Jt;Ta(Object.keys(Pt)).forEach(function(or){var ar=Pt[or];if(!(lr&&!lr(ar))){var Yr=ar.append(lt,gt);if(ca[or]){var cn=ca[or];wo(ar)?(Jt=lt.link(Yr,{stable:!0}),gt(lt.cond(Jt).then(pr,".enable(",cn,");").else(pr,".disable(",cn,");")),gt(gr,".",or,"=",Jt,";")):(gt(lt.cond(Yr).then(pr,".enable(",cn,");").else(pr,".disable(",cn,");")),gt(gr,".",or,"=",Yr,";"))}else if(na(Yr)){var Sn=cr[or];gt(pr,".",Ri[or],"(",Yr,");",Yr.map(function(Sa,fa){return Sn+"["+fa+"]="+Sa}).join(";"),";")}else wo(ar)?(Jt=lt.link(Yr,{stable:!0}),gt(pr,".",Ri[or],"(",Jt,");",gr,".",or,"=",Jt,";")):gt(pr,".",Ri[or],"(",Yr,");",gr,".",or,"=",Yr,";")}})}function sl(lt,gt){Na&&(lt.instancing=gt.def(lt.shared.extensions,".angle_instanced_arrays"))}function iu(lt,gt,Pt,lr,nr){var cr=lt.shared,gr=lt.stats,pr=cr.current,Jt=cr.timer,or=Pt.profile;function ar(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Yr,cn;function Sn(Ya){Yr=gt.def(),Ya(Yr,"=",ar(),";"),typeof nr=="string"?Ya(gr,".count+=",nr,";"):Ya(gr,".count++;"),hi&&(lr?(cn=gt.def(),Ya(cn,"=",Jt,".getNumPendingQueries();")):Ya(Jt,".beginQuery(",gr,");"))}function Sa(Ya){Ya(gr,".cpuTime+=",ar(),"-",Yr,";"),hi&&(lr?Ya(Jt,".pushScopeStats(",cn,",",Jt,".getNumPendingQueries(),",gr,");"):Ya(Jt,".endQuery();"))}function fa(Ya){var ka=gt.def(pr,".profile");gt(pr,".profile=",Ya,";"),gt.exit(pr,".profile=",ka,";")}var la;if(or){if(wo(or)){or.enable?(Sn(gt),Sa(gt.exit),fa("true")):fa("false");return}la=or.append(lt,gt),fa(la)}else la=gt.def(pr,".profile");var Ea=lt.block();Sn(Ea),gt("if(",la,"){",Ea,"}");var Ra=lt.block();Sa(Ra),gt.exit("if(",la,"){",Ra,"}")}function Fc(lt,gt,Pt,lr,nr){var cr=lt.shared;function gr(Jt){switch(Jt){case Mi:case vs:case Sl:return 2;case Ao:case ml:case Ou:return 3;case qo:case yl:case Su:return 4;default:return 1}}function pr(Jt,or,ar){var Yr=cr.gl,cn=gt.def(Jt,".location"),Sn=gt.def(cr.attributes,"[",cn,"]"),Sa=ar.state,fa=ar.buffer,la=[ar.x,ar.y,ar.z,ar.w],Ea=["buffer","normalized","offset","stride"];function Ra(){gt("if(!",Sn,".buffer){",Yr,".enableVertexAttribArray(",cn,");}");var ka=ar.type,ri;if(ar.size?ri=gt.def(ar.size,"||",or):ri=or,gt("if(",Sn,".type!==",ka,"||",Sn,".size!==",ri,"||",Ea.map(function(Ki){return Sn+"."+Ki+"!=="+ar[Ki]}).join("||"),"){",Yr,".bindBuffer(",er,",",fa,".buffer);",Yr,".vertexAttribPointer(",[cn,ri,ka,ar.normalized,ar.stride,ar.offset],");",Sn,".type=",ka,";",Sn,".size=",ri,";",Ea.map(function(Ki){return Sn+"."+Ki+"="+ar[Ki]+";"}).join(""),"}"),Na){var _i=ar.divisor;gt("if(",Sn,".divisor!==",_i,"){",lt.instancing,".vertexAttribDivisorANGLE(",[cn,_i],");",Sn,".divisor=",_i,";}")}}function Ya(){gt("if(",Sn,".buffer){",Yr,".disableVertexAttribArray(",cn,");",Sn,".buffer=null;","}if(",fi.map(function(ka,ri){return Sn+"."+ka+"!=="+la[ri]}).join("||"),"){",Yr,".vertexAttrib4f(",cn,",",la,");",fi.map(function(ka,ri){return Sn+"."+ka+"="+la[ri]+";"}).join(""),"}")}Sa===bi?Ra():Sa===ii?Ya():(gt("if(",Sa,"===",bi,"){"),Ra(),gt("}else{"),Ya(),gt("}"))}lr.forEach(function(Jt){var or=Jt.name,ar=Pt.attributes[or],Yr;if(ar){if(!nr(ar))return;Yr=ar.append(lt,gt)}else{if(!nr(jo))return;var cn=lt.scopeAttrib(or);Yr={},Object.keys(new ea).forEach(function(Sn){Yr[Sn]=gt.def(cn,".",Sn)})}pr(lt.link(Jt),gr(Jt.info.type),Yr)})}function Bc(lt,gt,Pt,lr,nr,cr){for(var gr=lt.shared,pr=gr.gl,Jt,or=0;or1){for(var Us=[],zs=[],Bl=0;Bl>1)",fa],");")}function _i(){Pt(la,".drawArraysInstancedANGLE(",[cn,Sn,Sa,fa],");")}ar&&ar!=="null"?Ra?ri():(Pt("if(",ar,"){"),ri(),Pt("}else{"),_i(),Pt("}")):_i()}function ka(){function ri(){Pt(cr+".drawElements("+[cn,Sa,Ea,Sn+"<<(("+Ea+"-"+Yi+")>>1)"]+");")}function _i(){Pt(cr+".drawArrays("+[cn,Sn,Sa]+");")}ar&&ar!=="null"?Ra?ri():(Pt("if(",ar,"){"),ri(),Pt("}else{"),_i(),Pt("}")):_i()}Na&&(typeof fa!="number"||fa>=0)?typeof fa=="string"?(Pt("if(",fa,">0){"),Ya(),Pt("}else if(",fa,"<0){"),ka(),Pt("}")):Ya():ka()}function Ds(lt,gt,Pt,lr,nr){var cr=vi(),gr=cr.proc("body",nr);return Na&&(cr.instancing=gr.def(cr.shared.extensions,".angle_instanced_arrays")),lt(cr,gr,Pt,lr),cr.compile().body}function Bs(lt,gt,Pt,lr){sl(lt,gt),Pt.useVAO?Pt.drawVAO?gt(lt.shared.vao,".setVAO(",Pt.drawVAO.append(lt,gt),");"):gt(lt.shared.vao,".setVAO(",lt.shared.vao,".targetVAO);"):(gt(lt.shared.vao,".setVAO(null);"),Fc(lt,gt,Pt,lr.attributes,function(){return!0})),Bc(lt,gt,Pt,lr.uniforms,function(){return!0},!1),Zo(lt,gt,gt,Pt)}function Le(lt,gt){var Pt=lt.proc("draw",1);sl(lt,Pt),Tu(lt,Pt,gt.context),Du(lt,Pt,gt.framebuffer),Fo(lt,Pt,gt),bc(lt,Pt,gt.state),iu(lt,Pt,gt,!1,!0);var lr=gt.shader.progVar.append(lt,Pt);if(Pt(lt.shared.gl,".useProgram(",lr,".program);"),gt.shader.program)Bs(lt,Pt,gt,gt.shader.program);else{Pt(lt.shared.vao,".setVAO(null);");var nr=lt.global.def("{}"),cr=Pt.def(lr,".id"),gr=Pt.def(nr,"[",cr,"]");Pt(lt.cond(gr).then(gr,".call(this,a0);").else(gr,"=",nr,"[",cr,"]=",lt.link(function(pr){return Ds(Bs,lt,gt,pr,1)}),"(",lr,");",gr,".call(this,a0);"))}Object.keys(gt.state).length>0&&Pt(lt.shared.current,".dirty=true;"),lt.shared.vao&&Pt(lt.shared.vao,".setVAO(null);")}function X(lt,gt,Pt,lr){lt.batchId="a1",sl(lt,gt);function nr(){return!0}Fc(lt,gt,Pt,lr.attributes,nr),Bc(lt,gt,Pt,lr.uniforms,nr,!1),Zo(lt,gt,gt,Pt)}function we(lt,gt,Pt,lr){sl(lt,gt);var nr=Pt.contextDep,cr=gt.def(),gr="a0",pr="a1",Jt=gt.def();lt.shared.props=Jt,lt.batchId=cr;var or=lt.scope(),ar=lt.scope();gt(or.entry,"for(",cr,"=0;",cr,"<",pr,";++",cr,"){",Jt,"=",gr,"[",cr,"];",ar,"}",or.exit);function Yr(Ea){return Ea.contextDep&&nr||Ea.propDep}function cn(Ea){return!Yr(Ea)}if(Pt.needsContext&&Tu(lt,ar,Pt.context),Pt.needsFramebuffer&&Du(lt,ar,Pt.framebuffer),bc(lt,ar,Pt.state,Yr),Pt.profile&&Yr(Pt.profile)&&iu(lt,ar,Pt,!1,!0),lr)Pt.useVAO?Pt.drawVAO?Yr(Pt.drawVAO)?ar(lt.shared.vao,".setVAO(",Pt.drawVAO.append(lt,ar),");"):or(lt.shared.vao,".setVAO(",Pt.drawVAO.append(lt,or),");"):or(lt.shared.vao,".setVAO(",lt.shared.vao,".targetVAO);"):(or(lt.shared.vao,".setVAO(null);"),Fc(lt,or,Pt,lr.attributes,cn),Fc(lt,ar,Pt,lr.attributes,Yr)),Bc(lt,or,Pt,lr.uniforms,cn,!1),Bc(lt,ar,Pt,lr.uniforms,Yr,!0),Zo(lt,or,ar,Pt);else{var Sn=lt.global.def("{}"),Sa=Pt.shader.progVar.append(lt,ar),fa=ar.def(Sa,".id"),la=ar.def(Sn,"[",fa,"]");ar(lt.shared.gl,".useProgram(",Sa,".program);","if(!",la,"){",la,"=",Sn,"[",fa,"]=",lt.link(function(Ea){return Ds(X,lt,Pt,Ea,2)}),"(",Sa,");}",la,".call(this,a0[",cr,"],",cr,");")}}function ie(lt,gt){var Pt=lt.proc("batch",2);lt.batchId="0",sl(lt,Pt);var lr=!1,nr=!0;Object.keys(gt.context).forEach(function(Sn){lr=lr||gt.context[Sn].propDep}),lr||(Tu(lt,Pt,gt.context),nr=!1);var cr=gt.framebuffer,gr=!1;cr?(cr.propDep?lr=gr=!0:cr.contextDep&&lr&&(gr=!0),gr||Du(lt,Pt,cr)):Du(lt,Pt,null),gt.state.viewport&>.state.viewport.propDep&&(lr=!0);function pr(Sn){return Sn.contextDep&&lr||Sn.propDep}Fo(lt,Pt,gt),bc(lt,Pt,gt.state,function(Sn){return!pr(Sn)}),(!gt.profile||!pr(gt.profile))&&iu(lt,Pt,gt,!1,"a1"),gt.contextDep=lr,gt.needsContext=nr,gt.needsFramebuffer=gr;var Jt=gt.shader.progVar;if(Jt.contextDep&&lr||Jt.propDep)we(lt,Pt,gt,null);else{var or=Jt.append(lt,Pt);if(Pt(lt.shared.gl,".useProgram(",or,".program);"),gt.shader.program)we(lt,Pt,gt,gt.shader.program);else{Pt(lt.shared.vao,".setVAO(null);");var ar=lt.global.def("{}"),Yr=Pt.def(or,".id"),cn=Pt.def(ar,"[",Yr,"]");Pt(lt.cond(cn).then(cn,".call(this,a0,a1);").else(cn,"=",ar,"[",Yr,"]=",lt.link(function(Sn){return Ds(we,lt,gt,Sn,2)}),"(",or,");",cn,".call(this,a0,a1);"))}}Object.keys(gt.state).length>0&&Pt(lt.shared.current,".dirty=true;"),lt.shared.vao&&Pt(lt.shared.vao,".setVAO(null);")}function Me(lt,gt){var Pt=lt.proc("scope",3);lt.batchId="a2";var lr=lt.shared,nr=lr.current;if(Tu(lt,Pt,gt.context),gt.framebuffer&>.framebuffer.append(lt,Pt),Ta(Object.keys(gt.state)).forEach(function(pr){var Jt=gt.state[pr],or=Jt.append(lt,Pt);na(or)?or.forEach(function(ar,Yr){lo(ar)?Pt.set(lt.next[pr],"["+Yr+"]",ar):Pt.set(lt.next[pr],"["+Yr+"]",lt.link(ar,{stable:!0}))}):wo(Jt)?Pt.set(lr.next,"."+pr,lt.link(or,{stable:!0})):Pt.set(lr.next,"."+pr,or)}),iu(lt,Pt,gt,!0,!0),[Ue,$t,It,ir,Ke].forEach(function(pr){var Jt=gt.draw[pr];if(Jt){var or=Jt.append(lt,Pt);lo(or)?Pt.set(lr.draw,"."+pr,or):Pt.set(lr.draw,"."+pr,lt.link(or),{stable:!0})}}),Object.keys(gt.uniforms).forEach(function(pr){var Jt=gt.uniforms[pr].append(lt,Pt);Array.isArray(Jt)&&(Jt="["+Jt.map(function(or){return lo(or)?or:lt.link(or,{stable:!0})})+"]"),Pt.set(lr.uniforms,"["+lt.link(Ir.id(pr),{stable:!0})+"]",Jt)}),Object.keys(gt.attributes).forEach(function(pr){var Jt=gt.attributes[pr].append(lt,Pt),or=lt.scopeAttrib(pr);Object.keys(new ea).forEach(function(ar){Pt.set(or,"."+ar,Jt[ar])})}),gt.scopeVAO){var cr=gt.scopeVAO.append(lt,Pt);lo(cr)?Pt.set(lr.vao,".targetVAO",cr):Pt.set(lr.vao,".targetVAO",lt.link(cr,{stable:!0}))}function gr(pr){var Jt=gt.shader[pr];if(Jt){var or=Jt.append(lt,Pt);lo(or)?Pt.set(lr.shader,"."+pr,or):Pt.set(lr.shader,"."+pr,lt.link(or,{stable:!0}))}}gr(ve),gr(Oe),Object.keys(gt.state).length>0&&(Pt(nr,".dirty=true;"),Pt.exit(nr,".dirty=true;")),Pt("a1(",lt.shared.context,",a0,",lt.batchId,");")}function tt(lt){if(!(typeof lt!="object"||na(lt))){for(var gt=Object.keys(lt),Pt=0;Pt=0;--Zo){var Ds=lo[Zo];Ds&&Ds(hi,null,0)}zr.flush(),Qa&&Qa.update()}function us(){!vi&&lo.length>0&&(vi=d.next(Ho))}function _s(){vi&&(d.cancel(Ho),vi=null)}function Dl(Zo){Zo.preventDefault(),_s(),Jo.forEach(function(Ds){Ds()})}function xs(Zo){zr.getError(),Ca.restore(),oi.restore(),ga.restore(),io.restore(),wa.restore(),ca.restore(),ba.restore(),Qa&&Qa.restore(),Ri.procs.refresh(),us(),Wi.forEach(function(Ds){Ds()})}ti&&(ti.addEventListener(yu,Dl,!1),ti.addEventListener(au,xs,!1));function Wu(){lo.length=0,_s(),ti&&(ti.removeEventListener(yu,Dl),ti.removeEventListener(au,xs)),oi.clear(),ca.clear(),wa.clear(),ba.clear(),io.clear(),Na.clear(),ga.clear(),Qa&&Qa.clear(),vo.forEach(function(Zo){Zo()})}function xl(Zo){function Ds(nr){var cr=v({},nr);delete cr.uniforms,delete cr.attributes,delete cr.context,delete cr.vao,"stencil"in cr&&cr.stencil.op&&(cr.stencil.opBack=cr.stencil.opFront=cr.stencil.op,delete cr.stencil.op);function gr(pr){if(pr in cr){var Jt=cr[pr];delete cr[pr],Object.keys(Jt).forEach(function(or){cr[pr+"."+or]=Jt[or]})}}return gr("blend"),gr("depth"),gr("cull"),gr("stencil"),gr("polygonOffset"),gr("scissor"),gr("sample"),"vao"in nr&&(cr.vao=nr.vao),cr}function Bs(nr,cr){var gr={},pr={};return Object.keys(nr).forEach(function(Jt){var or=nr[Jt];if(p.isDynamic(or)){pr[Jt]=p.unbox(or,Jt);return}else if(cr&&Array.isArray(or)){for(var ar=0;ar0)return Et.call(this,Pt(nr|0),nr|0)}else if(Array.isArray(nr)){if(nr.length)return Et.call(this,nr,nr.length)}else return wt.call(this,nr)}return v(lr,{stats:Me,destroy:function(){tt.destroy()}})}var Fu=ca.setFBO=xl({framebuffer:p.define.call(null,Kc,"framebuffer")});function oc(Zo,Ds){var Bs=0;Ri.procs.poll();var Le=Ds.color;Le&&(zr.clearColor(+Le[0]||0,+Le[1]||0,+Le[2]||0,+Le[3]||0),Bs|=wu),"depth"in Ds&&(zr.clearDepth(+Ds.depth),Bs|=zo),"stencil"in Ds&&(zr.clearStencil(Ds.stencil|0),Bs|=Ks),zr.clear(Bs)}function xc(Zo){if("framebuffer"in Zo)if(Zo.framebuffer&&Zo.framebuffer_reglType==="framebufferCube")for(var Ds=0;Ds<6;++Ds)Fu(v({framebuffer:Zo.framebuffer.faces[Ds]},Zo),oc);else Fu(Zo,oc);else oc(null,Zo)}function Yf(Zo){lo.push(Zo);function Ds(){var Bs=kf(lo,Zo);function Le(){var X=kf(lo,Le);lo[X]=lo[lo.length-1],lo.length-=1,lo.length<=0&&_s()}lo[Bs]=Le}return us(),{cancel:Ds}}function Tu(){var Zo=yi.viewport,Ds=yi.scissor_box;Zo[0]=Zo[1]=Ds[0]=Ds[1]=0,hi.viewportWidth=hi.framebufferWidth=hi.drawingBufferWidth=Zo[2]=Ds[2]=zr.drawingBufferWidth,hi.viewportHeight=hi.framebufferHeight=hi.drawingBufferHeight=Zo[3]=Ds[3]=zr.drawingBufferHeight}function Du(){hi.tick+=1,hi.time=bc(),Tu(),Ri.procs.poll()}function Fo(){io.refresh(),Tu(),Ri.procs.refresh(),Qa&&Qa.update()}function bc(){return(y()-mi)/1e3}Fo();function sl(Zo,Ds){var Bs;switch(Zo){case"frame":return Yf(Ds);case"lost":Bs=Jo;break;case"restore":Bs=Wi;break;case"destroy":Bs=vo;break}return Bs.push(Ds),{cancel:function(){for(var Le=0;Le=0},read:Zn,destroy:Wu,_gl:zr,_refresh:Fo,poll:function(){Du(),Qa&&Qa.update()},now:bc,stats:Mn,getCachedCode:iu,preloadCachedCode:Fc});return Ir.onDone(null,Bc),Bc}return Ju})}}),YY=Re({"node_modules/gl-util/context.js"(ae,K){var v=r_();K.exports=function(l){if(l?typeof l=="string"&&(l={container:l}):l={},M(l)?l={container:l}:L(l)?l={container:l}:t(l)?l={gl:l}:l=v(l,{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),l.pixelRatio||(l.pixelRatio=window.pixelRatio||1),l.gl)return l.gl;if(l.canvas&&(l.container=l.canvas.parentNode),l.container){if(typeof l.container=="string"){var i=document.querySelector(l.container);if(!i)throw Error("Element "+l.container+" is not found");l.container=i}M(l.container)?(l.canvas=l.container,l.container=l.canvas.parentNode):l.canvas||(l.canvas=r(),l.container.appendChild(l.canvas),S(l))}else if(!l.canvas)if(typeof document<"u")l.container=document.body||document.documentElement,l.canvas=r(),l.container.appendChild(l.canvas),S(l);else throw Error("Not DOM environment. Use headless-gl.");return l.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(s){try{l.gl=l.canvas.getContext(s,l.attrs)}catch{}return l.gl}),l.gl};function S(a){if(a.container)if(a.container==document.body)document.body.style.width||(a.canvas.width=a.width||a.pixelRatio*window.innerWidth),document.body.style.height||(a.canvas.height=a.height||a.pixelRatio*window.innerHeight);else{var l=a.container.getBoundingClientRect();a.canvas.width=a.width||l.right-l.left,a.canvas.height=a.height||l.bottom-l.top}}function M(a){return typeof a.getContext=="function"&&"width"in a&&"height"in a}function L(a){return typeof a.nodeName=="string"&&typeof a.appendChild=="function"&&typeof a.getBoundingClientRect=="function"}function t(a){return typeof a.drawArrays=="function"||typeof a.drawElements=="function"}function r(){var a=document.createElement("canvas");return a.style.position="absolute",a.style.top=0,a.style.left=0,a}}}),ZY=Re({"node_modules/font-atlas/index.js"(ae,K){var v=UF(),S=[32,126];K.exports=M;function M(L){L=L||{};var t=L.shape?L.shape:L.canvas?[L.canvas.width,L.canvas.height]:[512,512],r=L.canvas||document.createElement("canvas"),a=L.font,l=typeof L.step=="number"?[L.step,L.step]:L.step||[32,32],i=L.chars||S;if(a&&typeof a!="string"&&(a=v(a)),!Array.isArray(i))i=String(i).split("");else if(i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"){for(var s=[],o=i[0],c=0;o<=i[1];o++)s[c++]=String.fromCharCode(o);i=s}t=t.slice(),r.width=t[0],r.height=t[1];var p=r.getContext("2d");p.fillStyle="#000",p.fillRect(0,0,r.width,r.height),p.font=a,p.textAlign="center",p.textBaseline="middle",p.fillStyle="#fff";for(var d=l[0]/2,y=l[1]/2,o=0;ot[0]-l[0]/2&&(d=l[0]/2,y+=l[1]);return r}}}),$F=Re({"node_modules/bit-twiddle/twiddle.js"(ae){"use restrict";var K=32;ae.INT_BITS=K,ae.INT_MAX=2147483647,ae.INT_MIN=-1<0)-(M<0)},ae.abs=function(M){var L=M>>K-1;return(M^L)-L},ae.min=function(M,L){return L^(M^L)&-(M65535)<<4,M>>>=L,t=(M>255)<<3,M>>>=t,L|=t,t=(M>15)<<2,M>>>=t,L|=t,t=(M>3)<<1,M>>>=t,L|=t,L|M>>1},ae.log10=function(M){return M>=1e9?9:M>=1e8?8:M>=1e7?7:M>=1e6?6:M>=1e5?5:M>=1e4?4:M>=1e3?3:M>=100?2:M>=10?1:0},ae.popCount=function(M){return M=M-(M>>>1&1431655765),M=(M&858993459)+(M>>>2&858993459),(M+(M>>>4)&252645135)*16843009>>>24};function v(M){var L=32;return M&=-M,M&&L--,M&65535&&(L-=16),M&16711935&&(L-=8),M&252645135&&(L-=4),M&858993459&&(L-=2),M&1431655765&&(L-=1),L}ae.countTrailingZeros=v,ae.nextPow2=function(M){return M+=M===0,--M,M|=M>>>1,M|=M>>>2,M|=M>>>4,M|=M>>>8,M|=M>>>16,M+1},ae.prevPow2=function(M){return M|=M>>>1,M|=M>>>2,M|=M>>>4,M|=M>>>8,M|=M>>>16,M-(M>>>1)},ae.parity=function(M){return M^=M>>>16,M^=M>>>8,M^=M>>>4,M&=15,27030>>>M&1};var S=new Array(256);(function(M){for(var L=0;L<256;++L){var t=L,r=L,a=7;for(t>>>=1;t;t>>>=1)r<<=1,r|=t&1,--a;M[L]=r<>>8&255]<<16|S[M>>>16&255]<<8|S[M>>>24&255]},ae.interleave2=function(M,L){return M&=65535,M=(M|M<<8)&16711935,M=(M|M<<4)&252645135,M=(M|M<<2)&858993459,M=(M|M<<1)&1431655765,L&=65535,L=(L|L<<8)&16711935,L=(L|L<<4)&252645135,L=(L|L<<2)&858993459,L=(L|L<<1)&1431655765,M|L<<1},ae.deinterleave2=function(M,L){return M=M>>>L&1431655765,M=(M|M>>>1)&858993459,M=(M|M>>>2)&252645135,M=(M|M>>>4)&16711935,M=(M|M>>>16)&65535,M<<16>>16},ae.interleave3=function(M,L,t){return M&=1023,M=(M|M<<16)&4278190335,M=(M|M<<8)&251719695,M=(M|M<<4)&3272356035,M=(M|M<<2)&1227133513,L&=1023,L=(L|L<<16)&4278190335,L=(L|L<<8)&251719695,L=(L|L<<4)&3272356035,L=(L|L<<2)&1227133513,M|=L<<1,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,M|t<<2},ae.deinterleave3=function(M,L){return M=M>>>L&1227133513,M=(M|M>>>2)&3272356035,M=(M|M>>>4)&251719695,M=(M|M>>>8)&4278190335,M=(M|M>>>16)&1023,M<<22>>22},ae.nextCombination=function(M){var L=M|M-1;return L+1|(~L&-~L)-1>>>v(M)+1}}}),KY=Re({"node_modules/dup/dup.js"(ae,K){function v(L,t,r){var a=L[r]|0;if(a<=0)return[];var l=new Array(a),i;if(r===L.length-1)for(i=0;i"u"&&(t=0),typeof L){case"number":if(L>0)return S(L|0,t);break;case"object":if(typeof L.length=="number")return v(L,t,0);break}return[]}K.exports=M}}),JY=Re({"node_modules/typedarray-pool/pool.js"(ae){var K=$F(),v=KY(),S=U1().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:v([32,0]),UINT16:v([32,0]),UINT32:v([32,0]),BIGUINT64:v([32,0]),INT8:v([32,0]),INT16:v([32,0]),INT32:v([32,0]),BIGINT64:v([32,0]),FLOAT:v([32,0]),DOUBLE:v([32,0]),DATA:v([32,0]),UINT8C:v([32,0]),BUFFER:v([32,0])});var M=typeof Uint8ClampedArray<"u",L=typeof BigUint64Array<"u",t=typeof BigInt64Array<"u",r=window.__TYPEDARRAY_POOL;r.UINT8C||(r.UINT8C=v([32,0])),r.BIGUINT64||(r.BIGUINT64=v([32,0])),r.BIGINT64||(r.BIGINT64=v([32,0])),r.BUFFER||(r.BUFFER=v([32,0]));var a=r.DATA,l=r.BUFFER;ae.free=function(h){if(S.isBuffer(h))l[K.log2(h.length)].push(h);else{if(Object.prototype.toString.call(h)!=="[object ArrayBuffer]"&&(h=h.buffer),!h)return;var m=h.length||h.byteLength,w=K.log2(m)|0;a[w].push(h)}};function i(_){if(_){var h=_.length||_.byteLength,m=K.log2(h);a[m].push(_)}}function s(_){i(_.buffer)}ae.freeUint8=ae.freeUint16=ae.freeUint32=ae.freeBigUint64=ae.freeInt8=ae.freeInt16=ae.freeInt32=ae.freeBigInt64=ae.freeFloat32=ae.freeFloat=ae.freeFloat64=ae.freeDouble=ae.freeUint8Clamped=ae.freeDataView=s,ae.freeArrayBuffer=i,ae.freeBuffer=function(h){l[K.log2(h.length)].push(h)},ae.malloc=function(h,m){if(m===void 0||m==="arraybuffer")return o(h);switch(m){case"uint8":return c(h);case"uint16":return p(h);case"uint32":return d(h);case"int8":return y(h);case"int16":return g(h);case"int32":return C(h);case"float":case"float32":return f(h);case"double":case"float64":return x(h);case"uint8_clamped":return A(h);case"bigint64":return I(h);case"biguint64":return k(h);case"buffer":return E(h);case"data":case"dataview":return T(h);default:return null}return null};function o(h){var h=K.nextPow2(h),m=K.log2(h),w=a[m];return w.length>0?w.pop():new ArrayBuffer(h)}ae.mallocArrayBuffer=o;function c(_){return new Uint8Array(o(_),0,_)}ae.mallocUint8=c;function p(_){return new Uint16Array(o(2*_),0,_)}ae.mallocUint16=p;function d(_){return new Uint32Array(o(4*_),0,_)}ae.mallocUint32=d;function y(_){return new Int8Array(o(_),0,_)}ae.mallocInt8=y;function g(_){return new Int16Array(o(2*_),0,_)}ae.mallocInt16=g;function C(_){return new Int32Array(o(4*_),0,_)}ae.mallocInt32=C;function f(_){return new Float32Array(o(4*_),0,_)}ae.mallocFloat32=ae.mallocFloat=f;function x(_){return new Float64Array(o(8*_),0,_)}ae.mallocFloat64=ae.mallocDouble=x;function A(_){return M?new Uint8ClampedArray(o(_),0,_):c(_)}ae.mallocUint8Clamped=A;function k(_){return L?new BigUint64Array(o(8*_),0,_):null}ae.mallocBigUint64=k;function I(_){return t?new BigInt64Array(o(8*_),0,_):null}ae.mallocBigInt64=I;function T(_){return new DataView(o(_),0,_)}ae.mallocDataView=T;function E(_){_=K.nextPow2(_);var h=K.log2(_),m=l[h];return m.length>0?m.pop():new S(_)}ae.mallocBuffer=E,ae.clearCache=function(){for(var h=0;h<32;++h)r.UINT8[h].length=0,r.UINT16[h].length=0,r.UINT32[h].length=0,r.INT8[h].length=0,r.INT16[h].length=0,r.INT32[h].length=0,r.FLOAT[h].length=0,r.DOUBLE[h].length=0,r.BIGUINT64[h].length=0,r.BIGINT64[h].length=0,r.UINT8C[h].length=0,a[h].length=0,l[h].length=0}}}),QY=Re({"node_modules/is-plain-obj/index.js"(ae,K){var v=Object.prototype.toString;K.exports=function(S){var M;return v.call(S)==="[object Object]"&&(M=Object.getPrototypeOf(S),M===null||M===Object.getPrototypeOf({}))}}}),VF=Re({"node_modules/parse-unit/index.js"(ae,K){K.exports=function(S,M){M||(M=[0,""]),S=String(S);var L=parseFloat(S,10);return M[0]=L,M[1]=S.match(/[\d.\-\+]*\s*(.*)/)[1]||"",M}}}),eZ=Re({"node_modules/to-px/topx.js"(ae,K){var v=VF();K.exports=t;var S=96;function M(r,a){var l=v(getComputedStyle(r).getPropertyValue(a));return l[0]*t(l[1],r)}function L(r,a){var l=document.createElement("div");l.style["font-size"]="128"+r,a.appendChild(l);var i=M(l,"font-size")/128;return a.removeChild(l),i}function t(r,a){switch(a=a||document.body,r=(r||"px").trim().toLowerCase(),(a===window||a===document)&&(a=document.body),r){case"%":return a.clientHeight/100;case"ch":case"ex":return L(r,a);case"em":return M(a,"font-size");case"rem":return M(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return S;case"cm":return S/2.54;case"mm":return S/25.4;case"pt":return S/72;case"pc":return S/6}return 1}}}),tZ=Re({"node_modules/detect-kerning/index.js"(ae,K){K.exports=L;var v=L.canvas=document.createElement("canvas"),S=v.getContext("2d"),M=t([32,126]);L.createPairs=t,L.ascii=M;function L(r,a){Array.isArray(r)&&(r=r.join(", "));var l={},i,s=16,o=.05;a&&(a.length===2&&typeof a[0]=="number"?i=t(a):Array.isArray(a)?i=a:(a.o?i=t(a.o):a.pairs&&(i=a.pairs),a.fontSize&&(s=a.fontSize),a.threshold!=null&&(o=a.threshold))),i||(i=M),S.font=s+"px "+r;for(var c=0;cs*o){var g=(y-d)/s;l[p]=g*1e3}}return l}function t(r){for(var a=[],l=r[0];l<=r[1];l++)for(var i=String.fromCharCode(l),s=r[0];s0;l-=4)if(a[l]!==0)return Math.floor((l-3)*.25/r)}}}),nZ=Re({"node_modules/gl-text/dist.js"(ae,K){var v=WY(),S=r_(),M=XY(),L=YY(),t=RF(),r=Uw(),a=ZY(),l=JY(),i=iE(),s=QY(),o=VF(),c=eZ(),p=tZ(),d=gp(),y=rZ(),g=NT(),C=$F(),f=C.nextPow2,x=new t,A=!1;document.body&&(k=document.body.appendChild(document.createElement("div")),k.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(k).fontStretch&&(A=!0),document.body.removeChild(k));var k,I=function(_){T(_)?(_={regl:_},this.gl=_.regl._gl):this.gl=L(_),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=_.regl||M({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(),x.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(s(_)?_:{})};I.prototype.createShader=function(){var _=this.regl,h=_({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:_.prop("count"),offset:_.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:_.this("sizeBuffer")},width:{offset:0,stride:8,buffer:_.this("sizeBuffer")},char:_.this("charBuffer"),position:_.this("position")},uniforms:{atlasSize:function(w,F){return[F.atlas.width,F.atlas.height]},atlasDim:function(w,F){return[F.atlas.cols,F.atlas.rows]},atlas:function(w,F){return F.atlas.texture},charStep:function(w,F){return F.atlas.step},em:function(w,F){return F.atlas.em},color:_.prop("color"),opacity:_.prop("opacity"),viewport:_.this("viewportArray"),scale:_.this("scale"),align:_.prop("align"),baseline:_.prop("baseline"),translate:_.this("translate"),positionOffset:_.prop("positionOffset")},primitive:"points",viewport:_.this("viewport"),vert:` + precision highp float; + attribute float width, charOffset, char; + attribute vec2 position; + uniform float fontSize, charStep, em, align, baseline; + uniform vec4 viewport; + uniform vec4 color; + uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset; + varying vec2 charCoord, charId; + varying float charWidth; + varying vec4 fontColor; + void main () { + vec2 offset = floor(em * (vec2(align + charOffset, baseline) + + vec2(positionOffset.x, -positionOffset.y))) + / (viewport.zw * scale.xy); + + vec2 position = (position + translate) * scale; + position += offset * scale; + + charCoord = position * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2. - 1., 0, 1); + + gl_PointSize = charStep; + + charId.x = mod(char, atlasDim.x); + charId.y = floor(char / atlasDim.x); + + charWidth = width * em; + + fontColor = color / 255.; + }`,frag:` + precision highp float; + uniform float fontSize, charStep, opacity; + uniform vec2 atlasSize; + uniform vec4 viewport; + uniform sampler2D atlas; + varying vec4 fontColor; + varying vec2 charCoord, charId; + varying float charWidth; + + float lightness(vec4 color) { + return color.r * 0.299 + color.g * 0.587 + color.b * 0.114; + } + + void main () { + vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5; + float halfCharStep = floor(charStep * .5 + .5); + + // invert y and shift by 1px (FF expecially needs that) + uv.y = charStep - uv.y; + + // ignore points outside of character bounding box + float halfCharWidth = ceil(charWidth * .5); + if (floor(uv.x) > halfCharStep + halfCharWidth || + floor(uv.x) < halfCharStep - halfCharWidth) return; + + uv += charId * charStep; + uv = uv / atlasSize; + + vec4 color = fontColor; + vec4 mask = texture2D(atlas, uv); + + float maskY = lightness(mask); + // float colorY = lightness(color); + color.a *= maskY; + color.a *= opacity; + + // color.a += .1; + + // antialiasing, see yiq color space y-channel formula + // color.rgb += (1. - color.rgb) * (1. - mask.rgb); + + gl_FragColor = color; + }`}),m={};return{regl:_,draw:h,atlas:m}},I.prototype.update=function(_){var h=this;if(typeof _=="string")_={text:_};else if(!_)return;_=S(_,{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!=null&&(Array.isArray(_.opacity)?this.opacity=_.opacity.map(function(Se){return parseFloat(Se)}):this.opacity=parseFloat(_.opacity)),_.viewport!=null&&(this.viewport=i(_.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(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]),_.kerning!=null&&(this.kerning=_.kerning),_.offset!=null&&(typeof _.offset=="number"&&(_.offset=[_.offset,0]),this.positionOffset=g(_.offset)),_.direction&&(this.direction=_.direction),_.range&&(this.range=_.range,this.scale=[1/(_.range[2]-_.range[0]),1/(_.range[3]-_.range[1])],this.translate=[-_.range[0],-_.range[1]]),_.scale&&(this.scale=_.scale),_.translate&&(this.translate=_.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!_.font&&(_.font=I.baseFontSize+"px sans-serif");var m=!1,w=!1;if(_.font&&(Array.isArray(_.font)?_.font:[_.font]).forEach(function(Se,Je){if(typeof Se=="string")try{Se=v.parse(Se)}catch{Se=v.parse(I.baseFontSize+"px "+Se)}else{var _t=Se.style,At=Se.weight,vt=Se.stretch,Kt=Se.variant;Se=v.parse(v.stringify(Se)),_t&&(Se.style=_t),At&&(Se.weight=At),vt&&(Se.stretch=vt),Kt&&(Se.variant=Kt)}var Qt=v.stringify({size:I.baseFontSize,family:Se.family,stretch:A?Se.stretch:void 0,variant:Se.variant,weight:Se.weight,style:Se.style}),fr=o(Se.size),mr=Math.round(fr[0]*c(fr[1]));if(mr!==h.fontSize[Je]&&(w=!0,h.fontSize[Je]=mr),(!h.font[Je]||Qt!=h.font[Je].baseString)&&(m=!0,h.font[Je]=I.fonts[Qt],!h.font[Je])){var Ur=Se.family.join(", "),Br=[Se.style];Se.style!=Se.variant&&Br.push(Se.variant),Se.variant!=Se.weight&&Br.push(Se.weight),A&&Se.weight!=Se.stretch&&Br.push(Se.stretch),h.font[Je]={baseString:Qt,family:Ur,weight:Se.weight,stretch:Se.stretch,style:Se.style,variant:Se.variant,width:{},kerning:{},metrics:y(Ur,{origin:"top",fontSize:I.baseFontSize,fontStyle:Br.join(" ")})},I.fonts[Qt]=h.font[Je]}}),(m||w)&&this.font.forEach(function(Se,Je){var _t=v.stringify({size:h.fontSize[Je],family:Se.family,stretch:A?Se.stretch:void 0,variant:Se.variant,weight:Se.weight,style:Se.style});if(h.fontAtlas[Je]=h.shader.atlas[_t],!h.fontAtlas[Je]){var At=Se.metrics;h.shader.atlas[_t]=h.fontAtlas[Je]={fontString:_t,step:Math.ceil(h.fontSize[Je]*At.bottom*.5)*2,em:h.fontSize[Je],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:h.regl.texture()}}_.text==null&&(_.text=h.text)}),typeof _.text=="string"&&_.position&&_.position.length>2){for(var F=Array(_.position.length*.5),z=0;z2){for(var G=!_.position[0].length,j=l.mallocFloat(this.count*2),O=0,H=0;O1?h.align[Je]:h.align[0]:h.align;if(typeof _t=="number")return _t;switch(_t){case"right":case"end":return-Se;case"center":case"centre":case"middle":return-Se*.5}return 0})),this.baseline==null&&_.baseline==null&&(_.baseline=0),_.baseline!=null&&(this.baseline=_.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(Se,Je){var _t=(h.font[Je]||h.font[0]).metrics,At=0;return At+=_t.bottom*.5,typeof Se=="number"?At+=Se-_t.baseline:At+=-_t[Se],At*=-1,At})),_.color!=null)if(_.color||(_.color="transparent"),typeof _.color=="string"||!isNaN(_.color))this.color=r(_.color,"uint8");else{var Ze;if(typeof _.color[0]=="number"&&_.color.length>this.counts.length){var Xe=_.color.length;Ze=l.mallocUint8(Xe);for(var it=(_.color.subarray||_.color.slice).bind(_.color),yt=0;yt4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(ht){var Ve=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(Ve);for(var ze=0;ze1?this.counts[ze]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[ze]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(ze*4,ze*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[ze]:this.opacity,baseline:this.baselineOffset[ze]!=null?this.baselineOffset[ze]:this.baselineOffset[0],align:this.align?this.alignOffset[ze]!=null?this.alignOffset[ze]:this.alignOffset[0]:0,atlas:this.fontAtlas[ze]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(ze*2,ze*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=[]}},I.prototype.destroy=function(){},I.prototype.kerning=!0,I.prototype.position={constant:new Float32Array(2)},I.prototype.translate=null,I.prototype.scale=null,I.prototype.font=null,I.prototype.text="",I.prototype.positionOffset=[0,0],I.prototype.opacity=1,I.prototype.color=new Uint8Array([0,0,0,255]),I.prototype.alignOffset=[0,0],I.maxAtlasSize=1024,I.atlasCanvas=document.createElement("canvas"),I.atlasContext=I.atlasCanvas.getContext("2d",{alpha:!1}),I.baseFontSize=64,I.fonts={};function T(E){return typeof E=="function"&&E._gl&&E.prop&&E.texture&&E.buffer}K.exports=I}}),aZ=Re({"node_modules/@plotly/regl/dist/regl.unchecked.js"(ae,K){(function(v,S){typeof ae=="object"&&typeof K<"u"?K.exports=S():v.createREGL=S()})(ae,function(){var v=function(Ct,Ir){for(var zr=Object.keys(Ir),qn=0;qn1&&Ir===zr&&(Ir==='"'||Ir==="'"))return['"'+a(Ct.substr(1,Ct.length-2))+'"'];var qn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(Ct);if(qn)return l(Ct.substr(0,qn.index)).concat(l(qn[1])).concat(l(Ct.substr(qn.index+qn[0].length)));var Ca=Ct.split(".");if(Ca.length===1)return['"'+a(Ct)+'"'];for(var Ln=[],Mn=0;Mn"u"?1:window.devicePixelRatio,mi=!1,fo={},Hi=function(gn){},hi=function(){};if(typeof Ir=="string"?zr=document.querySelector(Ir):typeof Ir=="object"&&(x(Ir)?zr=Ir:A(Ir)?(Ln=Ir,Ca=Ln.canvas):("gl"in Ir?Ln=Ir.gl:"canvas"in Ir?Ca=I(Ir.canvas):"container"in Ir&&(qn=I(Ir.container)),"attributes"in Ir&&(Mn=Ir.attributes),"extensions"in Ir&&(ei=k(Ir.extensions)),"optionalExtensions"in Ir&&(Ja=k(Ir.optionalExtensions)),"onDone"in Ir&&(Hi=Ir.onDone),"profile"in Ir&&(mi=!!Ir.profile),"pixelRatio"in Ir&&(Qa=+Ir.pixelRatio),"cachedCode"in Ir&&(fo=Ir.cachedCode))),zr&&(zr.nodeName.toLowerCase()==="canvas"?Ca=zr:qn=zr),!Ln){if(!Ca){var za=C(qn||document.body,Hi,Qa);if(!za)return null;Ca=za.canvas,hi=za.onDestroy}Mn.premultipliedAlpha===void 0&&(Mn.premultipliedAlpha=!0),Ln=f(Ca,Mn)}return Ln?{gl:Ln,canvas:Ca,container:qn,extensions:ei,optionalExtensions:Ja,pixelRatio:Qa,profile:mi,cachedCode:fo,onDone:Hi,onDestroy:hi}:(hi(),Hi("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function E(Ct,Ir){var zr={};function qn(Mn){var ei=Mn.toLowerCase(),Ja;try{Ja=zr[ei]=Ct.getExtension(ei)}catch{}return!!Ja}for(var Ca=0;Ca65535)<<4,Ct>>>=Ir,zr=(Ct>255)<<3,Ct>>>=zr,Ir|=zr,zr=(Ct>15)<<2,Ct>>>=zr,Ir|=zr,zr=(Ct>3)<<1,Ct>>>=zr,Ir|=zr,Ir|Ct>>1}function O(){var Ct=_(8,function(){return[]});function Ir(Ln){var Mn=G(Ln),ei=Ct[j(Mn)>>2];return ei.length>0?ei.pop():new ArrayBuffer(Mn)}function zr(Ln){Ct[j(Ln.byteLength)>>2].push(Ln)}function qn(Ln,Mn){var ei=null;switch(Ln){case h:ei=new Int8Array(Ir(Mn),0,Mn);break;case m:ei=new Uint8Array(Ir(Mn),0,Mn);break;case w:ei=new Int16Array(Ir(2*Mn),0,Mn);break;case F:ei=new Uint16Array(Ir(2*Mn),0,Mn);break;case z:ei=new Int32Array(Ir(4*Mn),0,Mn);break;case U:ei=new Uint32Array(Ir(4*Mn),0,Mn);break;case V:ei=new Float32Array(Ir(4*Mn),0,Mn);break;default:return null}return ei.length!==Mn?ei.subarray(0,Mn):ei}function Ca(Ln){zr(Ln.buffer)}return{alloc:Ir,free:zr,allocType:qn,freeType:Ca}}var H=O();H.zero=O();var W=3408,ee=3410,ue=3411,xe=3412,ge=3413,_e=3414,Y=3415,se=33901,ce=33902,ne=3379,ye=3386,le=34921,Z=36347,de=36348,pe=35661,Te=35660,Ne=34930,$e=36349,Ze=34076,Xe=34024,it=7936,yt=7937,bt=7938,mt=35724,ht=34047,Ve=36063,ze=34852,Se=3553,Je=34067,_t=34069,At=33984,vt=6408,Kt=5126,Qt=5121,fr=36160,mr=36053,Ur=36064,Br=16384,fn=function(Ct,Ir){var zr=1;Ir.ext_texture_filter_anisotropic&&(zr=Ct.getParameter(ht));var qn=1,Ca=1;Ir.webgl_draw_buffers&&(qn=Ct.getParameter(ze),Ca=Ct.getParameter(Ve));var Ln=!!Ir.oes_texture_float;if(Ln){var Mn=Ct.createTexture();Ct.bindTexture(Se,Mn),Ct.texImage2D(Se,0,vt,1,1,0,vt,Kt,null);var ei=Ct.createFramebuffer();if(Ct.bindFramebuffer(fr,ei),Ct.framebufferTexture2D(fr,Ur,Se,Mn,0),Ct.bindTexture(Se,null),Ct.checkFramebufferStatus(fr)!==mr)Ln=!1;else{Ct.viewport(0,0,1,1),Ct.clearColor(1,0,0,1),Ct.clear(Br);var Ja=H.allocType(Kt,4);Ct.readPixels(0,0,1,1,vt,Kt,Ja),Ct.getError()?Ln=!1:(Ct.deleteFramebuffer(ei),Ct.deleteTexture(Mn),Ln=Ja[0]===1),H.freeType(Ja)}}var Qa=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),mi=!0;if(!Qa){var fo=Ct.createTexture(),Hi=H.allocType(Qt,36);Ct.activeTexture(At),Ct.bindTexture(Je,fo),Ct.texImage2D(_t,0,vt,3,3,0,vt,Qt,Hi),H.freeType(Hi),Ct.bindTexture(Je,null),Ct.deleteTexture(fo),mi=!Ct.getError()}return{colorBits:[Ct.getParameter(ee),Ct.getParameter(ue),Ct.getParameter(xe),Ct.getParameter(ge)],depthBits:Ct.getParameter(_e),stencilBits:Ct.getParameter(Y),subpixelBits:Ct.getParameter(W),extensions:Object.keys(Ir).filter(function(hi){return!!Ir[hi]}),maxAnisotropic:zr,maxDrawbuffers:qn,maxColorAttachments:Ca,pointSizeDims:Ct.getParameter(se),lineWidthDims:Ct.getParameter(ce),maxViewportDims:Ct.getParameter(ye),maxCombinedTextureUnits:Ct.getParameter(pe),maxCubeMapSize:Ct.getParameter(Ze),maxRenderbufferSize:Ct.getParameter(Xe),maxTextureUnits:Ct.getParameter(Ne),maxTextureSize:Ct.getParameter(ne),maxAttributes:Ct.getParameter(le),maxVertexUniforms:Ct.getParameter(Z),maxVertexTextureUnits:Ct.getParameter(Te),maxVaryingVectors:Ct.getParameter(de),maxFragmentUniforms:Ct.getParameter($e),glsl:Ct.getParameter(mt),renderer:Ct.getParameter(yt),vendor:Ct.getParameter(it),version:Ct.getParameter(bt),readFloat:Ln,npotTextureCube:mi}},Fr=function(Ct){return Ct instanceof Uint8Array||Ct instanceof Uint16Array||Ct instanceof Uint32Array||Ct instanceof Int8Array||Ct instanceof Int16Array||Ct instanceof Int32Array||Ct instanceof Float32Array||Ct instanceof Float64Array||Ct instanceof Uint8ClampedArray};function Qr(Ct){return!!Ct&&typeof Ct=="object"&&Array.isArray(Ct.shape)&&Array.isArray(Ct.stride)&&typeof Ct.offset=="number"&&Ct.shape.length===Ct.stride.length&&(Array.isArray(Ct.data)||Fr(Ct.data))}var Bt=function(Ct){return Object.keys(Ct).map(function(Ir){return Ct[Ir]})},et={shape:at,flatten:Fe};function ut(Ct,Ir,zr){for(var qn=0;qn0){var io;if(Array.isArray(ea[0])){oi=ra(ea);for(var wa=1,ca=1;ca0){if(typeof wa[0]=="number"){var yi=H.allocType(ba.dtype,wa.length);an(yi,wa),oi(yi,Ri),H.freeType(yi)}else if(Array.isArray(wa[0])||Fr(wa[0])){Zn=ra(wa);var ti=xa(wa,Zn,ba.dtype);oi(ti,Ri),H.freeType(ti)}}}else if(Qr(wa)){Zn=wa.shape;var lo=wa.stride,Jo=0,Wi=0,vo=0,vi=0;Zn.length===1?(Jo=Zn[0],Wi=1,vo=lo[0],vi=0):Zn.length===2&&(Jo=Zn[0],Wi=Zn[1],vo=lo[0],vi=lo[1]);var Ho=Array.isArray(wa.data)?ba.dtype:br(wa.data),us=H.allocType(Ho,Jo*Wi);bn(us,wa.data,Jo,Wi,vo,vi,wa.offset),oi(us,Ri),H.freeType(us)}return Fi}return ga||Fi(gn),Fi._reglType="buffer",Fi._buffer=ba,Fi.subdata=io,zr.profile&&(Fi.stats=ba.stats),Fi.destroy=function(){Hi(ba)},Fi}function za(){Bt(Ln).forEach(function(gn){gn.buffer=Ct.createBuffer(),Ct.bindBuffer(gn.type,gn.buffer),Ct.bufferData(gn.type,gn.persistentData||gn.byteLength,gn.usage)})}return zr.profile&&(Ir.getTotalBufferSize=function(){var gn=0;return Object.keys(Ln).forEach(function(ea){gn+=Ln[ea].stats.size}),gn}),{create:hi,createStream:Ja,destroyStream:Qa,clear:function(){Bt(Ln).forEach(Hi),ei.forEach(Hi)},getBuffer:function(gn){return gn&&gn._buffer instanceof Mn?gn._buffer:null},restore:za,_initBuffer:fo}}var Fn=0,va=0,Pa=1,La=1,Oa=4,Wa=4,sa={points:Fn,point:va,lines:Pa,line:La,triangles:Oa,triangle:Wa,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},ji=0,Qi=1,Xt=4,Lt=5120,$r=5121,en=5122,rn=5123,Wr=5124,tn=5125,wn=34963,dn=35040,Nt=35044;function xr(Ct,Ir,zr,qn){var Ca={},Ln=0,Mn={uint8:$r,uint16:rn};Ir.oes_element_index_uint&&(Mn.uint32=tn);function ei(za){this.id=Ln++,Ca[this.id]=this,this.buffer=za,this.primType=Xt,this.vertCount=0,this.type=0}ei.prototype.bind=function(){this.buffer.bind()};var Ja=[];function Qa(za){var gn=Ja.pop();return gn||(gn=new ei(zr.create(null,wn,!0,!1)._buffer)),fo(gn,za,dn,-1,-1,0,0),gn}function mi(za){Ja.push(za)}function fo(za,gn,ea,ga,Na,ba,Fi){za.buffer.bind();var oi;if(gn){var io=Fi;!Fi&&(!Fr(gn)||Qr(gn)&&!Fr(gn.data))&&(io=Ir.oes_element_index_uint?tn:rn),zr._initBuffer(za.buffer,gn,ea,io,3)}else Ct.bufferData(wn,ba,ea),za.buffer.dtype=oi||$r,za.buffer.usage=ea,za.buffer.dimension=3,za.buffer.byteLength=ba;if(oi=Fi,!Fi){switch(za.buffer.dtype){case $r:case Lt:oi=$r;break;case rn:case en:oi=rn;break;case tn:case Wr:oi=tn;break}za.buffer.dtype=oi}za.type=oi;var wa=Na;wa<0&&(wa=za.buffer.byteLength,oi===rn?wa>>=1:oi===tn&&(wa>>=2)),za.vertCount=wa;var ca=ga;if(ga<0){ca=Xt;var Ri=za.buffer.dimension;Ri===1&&(ca=ji),Ri===2&&(ca=Qi),Ri===3&&(ca=Xt)}za.primType=ca}function Hi(za){qn.elementsCount--,delete Ca[za.id],za.buffer.destroy(),za.buffer=null}function hi(za,gn){var ea=zr.create(null,wn,!0),ga=new ei(ea._buffer);qn.elementsCount++;function Na(ba){if(!ba)ea(),ga.primType=Xt,ga.vertCount=0,ga.type=$r;else if(typeof ba=="number")ea(ba),ga.primType=Xt,ga.vertCount=ba|0,ga.type=$r;else{var Fi=null,oi=Nt,io=-1,wa=-1,ca=0,Ri=0;Array.isArray(ba)||Fr(ba)||Qr(ba)?Fi=ba:("data"in ba&&(Fi=ba.data),"usage"in ba&&(oi=_a[ba.usage]),"primitive"in ba&&(io=sa[ba.primitive]),"count"in ba&&(wa=ba.count|0),"type"in ba&&(Ri=Mn[ba.type]),"length"in ba?ca=ba.length|0:(ca=wa,Ri===rn||Ri===en?ca*=2:(Ri===tn||Ri===Wr)&&(ca*=4))),fo(ga,Fi,oi,io,wa,ca,Ri)}return Na}return Na(za),Na._reglType="elements",Na._elements=ga,Na.subdata=function(ba,Fi){return ea.subdata(ba,Fi),Na},Na.destroy=function(){Hi(ga)},Na}return{create:hi,createStream:Qa,destroyStream:mi,getElements:function(za){return typeof za=="function"&&za._elements instanceof ei?za._elements:null},clear:function(){Bt(Ca).forEach(Hi)}}}var Xr=new Float32Array(1),Tn=new Uint32Array(Xr.buffer),Xn=5123;function ia(Ct){for(var Ir=H.allocType(Xn,Ct.length),zr=0;zr>>31<<15,Ln=(qn<<1>>>24)-127,Mn=qn>>13&1023;if(Ln<-24)Ir[zr]=Ca;else if(Ln<-14){var ei=-14-Ln;Ir[zr]=Ca+(Mn+1024>>ei)}else Ln>15?Ir[zr]=Ca+31744:Ir[zr]=Ca+(Ln+15<<10)+Mn}return Ir}function na(Ct){return Array.isArray(Ct)||Fr(Ct)}var An=34467,Yn=3553,qi=34067,Ga=34069,to=6408,_o=6406,Po=6407,Ro=6409,Xo=6410,Oi=32854,bs=32855,cs=36194,fl=32819,Is=32820,ys=33635,ss=34042,hl=6402,ll=34041,Il=35904,Ls=35906,ps=36193,Uo=33776,Rs=33777,Ll=33778,Kl=33779,eu=35986,Ws=35987,Bi=34798,Mo=35840,Jl=35841,Qs=35842,as=35843,tu=36196,dl=5121,Rl=5123,Gu=5125,Eo=5126,Os=10242,ws=10243,pu=10497,vu=33071,ts=33648,Iu=10240,zu=10241,nl=9728,Gl=9729,su=9984,cu=9985,vc=9986,jf=9987,Tf=33170,Rf=4352,_d=4353,ad=4354,ql=34046,cf=3317,xd=37440,Lc=37441,mc=37443,Rc=37444,Df=33984,xu=[su,vc,cu,jf],gc=[0,Ro,Xo,Po,to],ul={};ul[Ro]=ul[_o]=ul[hl]=1,ul[ll]=ul[Xo]=2,ul[Po]=ul[Il]=3,ul[to]=ul[Ls]=4;function ru(Ct){return"[object "+Ct+"]"}var rh=ru("HTMLCanvasElement"),Xc=ru("OffscreenCanvas"),ph=ru("CanvasRenderingContext2D"),Lu=ru("ImageBitmap"),yp=ru("HTMLImageElement"),al=ru("HTMLVideoElement"),Np=Object.keys(ct).concat([rh,Xc,ph,Lu,yp,al]),Ol=[];Ol[dl]=1,Ol[Eo]=4,Ol[ps]=2,Ol[Rl]=2,Ol[Gu]=4;var ns=[];ns[Oi]=2,ns[bs]=2,ns[cs]=2,ns[ll]=4,ns[Uo]=.5,ns[Rs]=.5,ns[Ll]=1,ns[Kl]=1,ns[eu]=.5,ns[Ws]=1,ns[Bi]=1,ns[Mo]=.5,ns[Jl]=.25,ns[Qs]=.5,ns[as]=.25,ns[tu]=.5;function zh(Ct){return Array.isArray(Ct)&&(Ct.length===0||typeof Ct[0]=="number")}function Pf(Ct){if(!Array.isArray(Ct))return!1;var Ir=Ct.length;return!(Ir===0||!na(Ct[0]))}function ic(Ct){return Object.prototype.toString.call(Ct)}function bd(Ct){return ic(Ct)===rh}function vh(Ct){return ic(Ct)===Xc}function Wh(Ct){return ic(Ct)===ph}function yc(Ct){return ic(Ct)===Lu}function Jd(Ct){return ic(Ct)===yp}function Ld(Ct){return ic(Ct)===al}function Xh(Ct){if(!Ct)return!1;var Ir=ic(Ct);return Np.indexOf(Ir)>=0?!0:zh(Ct)||Pf(Ct)||Qr(Ct)}function mh(Ct){return ct[Object.prototype.toString.call(Ct)]|0}function wd(Ct,Ir){var zr=Ir.length;switch(Ct.type){case dl:case Rl:case Gu:case Eo:var qn=H.allocType(Ct.type,zr);qn.set(Ir),Ct.data=qn;break;case ps:Ct.data=ia(Ir);break}}function Td(Ct,Ir){return H.allocType(Ct.type===ps?Eo:Ct.type,Ir)}function zf(Ct,Ir){Ct.type===ps?(Ct.data=ia(Ir),H.freeType(Ir)):Ct.data=Ir}function Rd(Ct,Ir,zr,qn,Ca,Ln){for(var Mn=Ct.width,ei=Ct.height,Ja=Ct.channels,Qa=Mn*ei*Ja,mi=Td(Ct,Qa),fo=0,Hi=0;Hi=1;)ei+=Mn*Ja*Ja,Ja/=2;return ei}else return Mn*zr*qn}function Gf(Ct,Ir,zr,qn,Ca,Ln,Mn){var ei={"don't care":Rf,"dont care":Rf,nice:ad,fast:_d},Ja={repeat:pu,clamp:vu,mirror:ts},Qa={nearest:nl,linear:Gl},mi=v({mipmap:jf,"nearest mipmap nearest":su,"linear mipmap nearest":cu,"nearest mipmap linear":vc,"linear mipmap linear":jf},Qa),fo={none:0,browser:Rc},Hi={uint8:dl,rgba4:fl,rgb565:ys,"rgb5 a1":Is},hi={alpha:_o,luminance:Ro,"luminance alpha":Xo,rgb:Po,rgba:to,rgba4:Oi,"rgb5 a1":bs,rgb565:cs},za={};Ir.ext_srgb&&(hi.srgb=Il,hi.srgba=Ls),Ir.oes_texture_float&&(Hi.float32=Hi.float=Eo),Ir.oes_texture_half_float&&(Hi.float16=Hi["half float"]=ps),Ir.webgl_depth_texture&&(v(hi,{depth:hl,"depth stencil":ll}),v(Hi,{uint16:Rl,uint32:Gu,"depth stencil":ss})),Ir.webgl_compressed_texture_s3tc&&v(za,{"rgb s3tc dxt1":Uo,"rgba s3tc dxt1":Rs,"rgba s3tc dxt3":Ll,"rgba s3tc dxt5":Kl}),Ir.webgl_compressed_texture_atc&&v(za,{"rgb atc":eu,"rgba atc explicit alpha":Ws,"rgba atc interpolated alpha":Bi}),Ir.webgl_compressed_texture_pvrtc&&v(za,{"rgb pvrtc 4bppv1":Mo,"rgb pvrtc 2bppv1":Jl,"rgba pvrtc 4bppv1":Qs,"rgba pvrtc 2bppv1":as}),Ir.webgl_compressed_texture_etc1&&(za["rgb etc1"]=tu);var gn=Array.prototype.slice.call(Ct.getParameter(An));Object.keys(za).forEach(function(X){var we=za[X];gn.indexOf(we)>=0&&(hi[X]=we)});var ea=Object.keys(hi);zr.textureFormats=ea;var ga=[];Object.keys(hi).forEach(function(X){var we=hi[X];ga[we]=X});var Na=[];Object.keys(Hi).forEach(function(X){var we=Hi[X];Na[we]=X});var ba=[];Object.keys(Qa).forEach(function(X){var we=Qa[X];ba[we]=X});var Fi=[];Object.keys(mi).forEach(function(X){var we=mi[X];Fi[we]=X});var oi=[];Object.keys(Ja).forEach(function(X){var we=Ja[X];oi[we]=X});var io=ea.reduce(function(X,we){var ie=hi[we];return ie===Ro||ie===_o||ie===Ro||ie===Xo||ie===hl||ie===ll||Ir.ext_srgb&&(ie===Il||ie===Ls)?X[ie]=ie:ie===bs||we.indexOf("rgba")>=0?X[ie]=to:X[ie]=Po,X},{});function wa(){this.internalformat=to,this.format=to,this.type=dl,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Rc,this.width=0,this.height=0,this.channels=0}function ca(X,we){X.internalformat=we.internalformat,X.format=we.format,X.type=we.type,X.compressed=we.compressed,X.premultiplyAlpha=we.premultiplyAlpha,X.flipY=we.flipY,X.unpackAlignment=we.unpackAlignment,X.colorSpace=we.colorSpace,X.width=we.width,X.height=we.height,X.channels=we.channels}function Ri(X,we){if(!(typeof we!="object"||!we)){if("premultiplyAlpha"in we&&(X.premultiplyAlpha=we.premultiplyAlpha),"flipY"in we&&(X.flipY=we.flipY),"alignment"in we&&(X.unpackAlignment=we.alignment),"colorSpace"in we&&(X.colorSpace=fo[we.colorSpace]),"type"in we){var ie=we.type;X.type=Hi[ie]}var Me=X.width,tt=X.height,wt=X.channels,Et=!1;"shape"in we?(Me=we.shape[0],tt=we.shape[1],we.shape.length===3&&(wt=we.shape[2],Et=!0)):("radius"in we&&(Me=tt=we.radius),"width"in we&&(Me=we.width),"height"in we&&(tt=we.height),"channels"in we&&(wt=we.channels,Et=!0)),X.width=Me|0,X.height=tt|0,X.channels=wt|0;var lt=!1;if("format"in we){var gt=we.format,Pt=X.internalformat=hi[gt];X.format=io[Pt],gt in Hi&&("type"in we||(X.type=Hi[gt])),gt in za&&(X.compressed=!0),lt=!0}!Et&<?X.channels=ul[X.format]:Et&&!lt&&X.channels!==gc[X.format]&&(X.format=X.internalformat=gc[X.channels])}}function Zn(X){Ct.pixelStorei(xd,X.flipY),Ct.pixelStorei(Lc,X.premultiplyAlpha),Ct.pixelStorei(mc,X.colorSpace),Ct.pixelStorei(cf,X.unpackAlignment)}function yi(){wa.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function ti(X,we){var ie=null;if(Xh(we)?ie=we:we&&(Ri(X,we),"x"in we&&(X.xOffset=we.x|0),"y"in we&&(X.yOffset=we.y|0),Xh(we.data)&&(ie=we.data)),we.copy){var Me=Ca.viewportWidth,tt=Ca.viewportHeight;X.width=X.width||Me-X.xOffset,X.height=X.height||tt-X.yOffset,X.needsCopy=!0}else if(!ie)X.width=X.width||1,X.height=X.height||1,X.channels=X.channels||4;else if(Fr(ie))X.channels=X.channels||4,X.data=ie,!("type"in we)&&X.type===dl&&(X.type=mh(ie));else if(zh(ie))X.channels=X.channels||4,wd(X,ie),X.alignment=1,X.needsFree=!0;else if(Qr(ie)){var wt=ie.data;!Array.isArray(wt)&&X.type===dl&&(X.type=mh(wt));var Et=ie.shape,lt=ie.stride,gt,Pt,lr,nr,cr,gr;Et.length===3?(lr=Et[2],gr=lt[2]):(lr=1,gr=1),gt=Et[0],Pt=Et[1],nr=lt[0],cr=lt[1],X.alignment=1,X.width=gt,X.height=Pt,X.channels=lr,X.format=X.internalformat=gc[lr],X.needsFree=!0,Rd(X,wt,nr,cr,gr,ie.offset)}else if(bd(ie)||vh(ie)||Wh(ie))bd(ie)||vh(ie)?X.element=ie:X.element=ie.canvas,X.width=X.element.width,X.height=X.element.height,X.channels=4;else if(yc(ie))X.element=ie,X.width=ie.width,X.height=ie.height,X.channels=4;else if(Jd(ie))X.element=ie,X.width=ie.naturalWidth,X.height=ie.naturalHeight,X.channels=4;else if(Ld(ie))X.element=ie,X.width=ie.videoWidth,X.height=ie.videoHeight,X.channels=4;else if(Pf(ie)){var pr=X.width||ie[0].length,Jt=X.height||ie.length,or=X.channels;na(ie[0][0])?or=or||ie[0][0].length:or=or||1;for(var ar=et.shape(ie),Yr=1,cn=0;cn>=tt,ie.height>>=tt,ti(ie,Me[tt]),X.mipmask|=1<=0&&!("faces"in we)&&(X.genMipmaps=!0)}if("mag"in we){var Me=we.mag;X.magFilter=Qa[Me]}var tt=X.wrapS,wt=X.wrapT;if("wrap"in we){var Et=we.wrap;typeof Et=="string"?tt=wt=Ja[Et]:Array.isArray(Et)&&(tt=Ja[Et[0]],wt=Ja[Et[1]])}else{if("wrapS"in we){var lt=we.wrapS;tt=Ja[lt]}if("wrapT"in we){var gt=we.wrapT;wt=Ja[gt]}}if(X.wrapS=tt,X.wrapT=wt,"anisotropic"in we&&(we.anisotropic,X.anisotropic=we.anisotropic),"mipmap"in we){var Pt=!1;switch(typeof we.mipmap){case"string":X.mipmapHint=ei[we.mipmap],X.genMipmaps=!0,Pt=!0;break;case"boolean":Pt=X.genMipmaps=we.mipmap;break;case"object":X.genMipmaps=!1,Pt=!0;break}Pt&&!("min"in we)&&(X.minFilter=su)}}function xc(X,we){Ct.texParameteri(we,zu,X.minFilter),Ct.texParameteri(we,Iu,X.magFilter),Ct.texParameteri(we,Os,X.wrapS),Ct.texParameteri(we,ws,X.wrapT),Ir.ext_texture_filter_anisotropic&&Ct.texParameteri(we,ql,X.anisotropic),X.genMipmaps&&(Ct.hint(Tf,X.mipmapHint),Ct.generateMipmap(we))}var Yf=0,Tu={},Du=zr.maxTextureUnits,Fo=Array(Du).map(function(){return null});function bc(X){wa.call(this),this.mipmask=0,this.internalformat=to,this.id=Yf++,this.refCount=1,this.target=X,this.texture=Ct.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Fu,Mn.profile&&(this.stats={size:0})}function sl(X){Ct.activeTexture(Df),Ct.bindTexture(X.target,X.texture)}function iu(){var X=Fo[0];X?Ct.bindTexture(X.target,X.texture):Ct.bindTexture(Yn,null)}function Fc(X){var we=X.texture,ie=X.unit,Me=X.target;ie>=0&&(Ct.activeTexture(Df+ie),Ct.bindTexture(Me,null),Fo[ie]=null),Ct.deleteTexture(we),X.texture=null,X.params=null,X.pixels=null,X.refCount=0,delete Tu[X.id],Ln.textureCount--}v(bc.prototype,{bind:function(){var X=this;X.bindCount+=1;var we=X.unit;if(we<0){for(var ie=0;ie0)continue;Me.unit=-1}Fo[ie]=X,we=ie;break}Mn.profile&&Ln.maxTextureUnits>cr)-lr,gr.height=gr.height||(ie.height>>cr)-nr,sl(ie),Jo(gr,Yn,lr,nr,cr),iu(),vi(gr),Me}function wt(Et,lt){var gt=Et|0,Pt=lt|0||gt;if(gt===ie.width&&Pt===ie.height)return Me;Me.width=ie.width=gt,Me.height=ie.height=Pt,sl(ie);for(var lr=0;ie.mipmask>>lr;++lr){var nr=gt>>lr,cr=Pt>>lr;if(!nr||!cr)break;Ct.texImage2D(Yn,lr,ie.format,nr,cr,0,ie.format,ie.type,null)}return iu(),Mn.profile&&(ie.stats.size=nh(ie.internalformat,ie.type,gt,Pt,!1,!1)),Me}return Me(X,we),Me.subimage=tt,Me.resize=wt,Me._reglType="texture2d",Me._texture=ie,Mn.profile&&(Me.stats=ie.stats),Me.destroy=function(){ie.decRef()},Me}function Zo(X,we,ie,Me,tt,wt){var Et=new bc(qi);Tu[Et.id]=Et,Ln.cubeCount++;var lt=new Array(6);function gt(nr,cr,gr,pr,Jt,or){var ar,Yr=Et.texInfo;for(Fu.call(Yr),ar=0;ar<6;++ar)lt[ar]=Wu();if(typeof nr=="number"||!nr){var cn=nr|0||1;for(ar=0;ar<6;++ar)us(lt[ar],cn,cn)}else if(typeof nr=="object")if(cr)_s(lt[0],nr),_s(lt[1],cr),_s(lt[2],gr),_s(lt[3],pr),_s(lt[4],Jt),_s(lt[5],or);else if(oc(Yr,nr),Ri(Et,nr),"faces"in nr){var Sn=nr.faces;for(ar=0;ar<6;++ar)ca(lt[ar],Et),_s(lt[ar],Sn[ar])}else for(ar=0;ar<6;++ar)_s(lt[ar],nr);for(ca(Et,lt[0]),Yr.genMipmaps?Et.mipmask=(lt[0].width<<1)-1:Et.mipmask=lt[0].mipmask,Et.internalformat=lt[0].internalformat,gt.width=lt[0].width,gt.height=lt[0].height,sl(Et),ar=0;ar<6;++ar)Dl(lt[ar],Ga+ar);for(xc(Yr,qi),iu(),Mn.profile&&(Et.stats.size=nh(Et.internalformat,Et.type,gt.width,gt.height,Yr.genMipmaps,!0)),gt.format=ga[Et.internalformat],gt.type=Na[Et.type],gt.mag=ba[Yr.magFilter],gt.min=Fi[Yr.minFilter],gt.wrapS=oi[Yr.wrapS],gt.wrapT=oi[Yr.wrapT],ar=0;ar<6;++ar)xl(lt[ar]);return gt}function Pt(nr,cr,gr,pr,Jt){var or=gr|0,ar=pr|0,Yr=Jt|0,cn=vo();return ca(cn,Et),cn.width=0,cn.height=0,ti(cn,cr),cn.width=cn.width||(Et.width>>Yr)-or,cn.height=cn.height||(Et.height>>Yr)-ar,sl(Et),Jo(cn,Ga+nr,or,ar,Yr),iu(),vi(cn),gt}function lr(nr){var cr=nr|0;if(cr!==Et.width){gt.width=Et.width=cr,gt.height=Et.height=cr,sl(Et);for(var gr=0;gr<6;++gr)for(var pr=0;Et.mipmask>>pr;++pr)Ct.texImage2D(Ga+gr,pr,Et.format,cr>>pr,cr>>pr,0,Et.format,Et.type,null);return iu(),Mn.profile&&(Et.stats.size=nh(Et.internalformat,Et.type,gt.width,gt.height,!1,!0)),gt}}return gt(X,we,ie,Me,tt,wt),gt.subimage=Pt,gt.resize=lr,gt._reglType="textureCube",gt._texture=Et,Mn.profile&&(gt.stats=Et.stats),gt.destroy=function(){Et.decRef()},gt}function Ds(){for(var X=0;X>Me,ie.height>>Me,0,ie.internalformat,ie.type,null);else for(var tt=0;tt<6;++tt)Ct.texImage2D(Ga+tt,Me,ie.internalformat,ie.width>>Me,ie.height>>Me,0,ie.internalformat,ie.type,null);xc(ie.texInfo,ie.target)})}function Le(){for(var X=0;X=0?Wu=!0:Ja.indexOf(xl)>=0&&(Wu=!1))),("depthTexture"in Fo||"depthStencilTexture"in Fo)&&(Du=!!(Fo.depthTexture||Fo.depthStencilTexture)),"depth"in Fo&&(typeof Fo.depth=="boolean"?_s=Fo.depth:(xc=Fo.depth,Dl=!1)),"stencil"in Fo&&(typeof Fo.stencil=="boolean"?Dl=Fo.stencil:(Yf=Fo.stencil,_s=!1)),"depthStencil"in Fo&&(typeof Fo.depthStencil=="boolean"?_s=Dl=Fo.depthStencil:(Tu=Fo.depthStencil,_s=!1,Dl=!1))}var sl=null,iu=null,Fc=null,Bc=null;if(Array.isArray(xs))sl=xs.map(hi);else if(xs)sl=[hi(xs)];else for(sl=new Array(oc),vi=0;vi0&&(vo.depth=yi[0].depth,vo.stencil=yi[0].stencil,vo.depthStencil=yi[0].depthStencil),yi[Wi]?yi[Wi](vo):yi[Wi]=wa(vo)}return v(ti,{width:vi,height:vi,color:xl})}function lo(Jo){var Wi,vo=Jo|0;if(vo===ti.width)return ti;var vi=ti.color;for(Wi=0;Wi=Ho.byteLength?us.subdata(Ho):(us.destroy(),ca.buffers[Wi]=null)),ca.buffers[Wi]||(us=ca.buffers[Wi]=Ca.create(vo,Bh,!1,!0)),vi.buffer=Ca.getBuffer(us),vi.size=vi.buffer.dimension|0,vi.normalized=!1,vi.type=vi.buffer.dtype,vi.offset=0,vi.stride=0,vi.divisor=0,vi.state=1,lo[Wi]=1}else Ca.getBuffer(vo)?(vi.buffer=Ca.getBuffer(vo),vi.size=vi.buffer.dimension|0,vi.normalized=!1,vi.type=vi.buffer.dtype,vi.offset=0,vi.stride=0,vi.divisor=0,vi.state=1):Ca.getBuffer(vo.buffer)?(vi.buffer=Ca.getBuffer(vo.buffer),vi.size=(+vo.size||vi.buffer.dimension)|0,vi.normalized=!!vo.normalized||!1,"type"in vo?vi.type=jn[vo.type]:vi.type=vi.buffer.dtype,vi.offset=(vo.offset||0)|0,vi.stride=(vo.stride||0)|0,vi.divisor=(vo.divisor||0)|0,vi.state=1):"x"in vo&&(vi.x=+vo.x||0,vi.y=+vo.y||0,vi.z=+vo.z||0,vi.w=+vo.w||0,vi.state=2)}for(var _s=0;_s1)for(var Zn=0;Zngn&&(gn=ea.stats.uniformsCount)}),gn},zr.getMaxAttributesCount=function(){var gn=0;return mi.forEach(function(ea){ea.stats.attributesCount>gn&&(gn=ea.stats.attributesCount)}),gn});function za(){Ca={},Ln={};for(var gn=0;gn>>4&15)+Ir.charAt(qn&15);return zr}function Wf(Ct){for(var Ir="",zr=-1,qn,Ca;++zr>>6&31,128|qn&63):qn<=65535?Ir+=String.fromCharCode(224|qn>>>12&15,128|qn>>>6&63,128|qn&63):qn<=2097151&&(Ir+=String.fromCharCode(240|qn>>>18&7,128|qn>>>12&63,128|qn>>>6&63,128|qn&63));return Ir}function qu(Ct){for(var Ir=Array(Ct.length>>2),zr=0;zr>5]|=(Ct.charCodeAt(zr/8)&255)<<24-zr%32;return Ir}function Yc(Ct){for(var Ir="",zr=0;zr>5]>>>24-zr%32&255);return Ir}function Nu(Ct,Ir){return Ct>>>Ir|Ct<<32-Ir}function xh(Ct,Ir){return Ct>>>Ir}function Xf(Ct,Ir,zr){return Ct&Ir^~Ct&zr}function Ed(Ct,Ir,zr){return Ct&Ir^Ct&zr^Ir&zr}function wr(Ct){return Nu(Ct,2)^Nu(Ct,13)^Nu(Ct,22)}function qr(Ct){return Nu(Ct,6)^Nu(Ct,11)^Nu(Ct,25)}function kn(Ct){return Nu(Ct,7)^Nu(Ct,18)^xh(Ct,3)}function _n(Ct){return Nu(Ct,17)^Nu(Ct,19)^xh(Ct,10)}var Qn=new Array(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);function $a(Ct,Ir){var zr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),qn=new Array(64),Ca,Ln,Mn,ei,Ja,Qa,mi,fo,Hi,hi,za,gn;for(Ct[Ir>>5]|=128<<24-Ir%32,Ct[(Ir+64>>9<<4)+15]=Ir,Hi=0;Hi>16)+(Ir>>16)+(zr>>16);return qn<<16|zr&65535}function Ai(Ct){return Array.prototype.slice.call(Ct)}function Ni(Ct){return Ai(Ct).join("")}function ho(Ct){var Ir=Ct&&Ct.cache,zr=0,qn=[],Ca=[],Ln=[];function Mn(za,gn){var ea=gn&&gn.stable;if(!ea){for(var ga=0;ga0&&(za.push(Na,"="),za.push.apply(za,Ai(arguments)),za.push(";")),Na}return v(gn,{def:ga,toString:function(){return Ni([ea.length>0?"var "+ea.join(",")+";":"",Ni(za)])}})}function Ja(){var za=ei(),gn=ei(),ea=za.toString,ga=gn.toString;function Na(ba,Fi){gn(ba,Fi,"=",za.def(ba,Fi),";")}return v(function(){za.apply(za,Ai(arguments))},{def:za.def,entry:za,exit:gn,save:Na,set:function(ba,Fi,oi){Na(ba,Fi),za(ba,Fi,"=",oi,";")},toString:function(){return ea()+ga()}})}function Qa(){var za=Ni(arguments),gn=Ja(),ea=Ja(),ga=gn.toString,Na=ea.toString;return v(gn,{then:function(){return gn.apply(gn,Ai(arguments)),this},else:function(){return ea.apply(ea,Ai(arguments)),this},toString:function(){var ba=Na();return ba&&(ba="else{"+ba+"}"),Ni(["if(",za,"){",ga(),"}",ba])}})}var mi=ei(),fo={};function Hi(za,gn){var ea=[];function ga(){var io="a"+ea.length;return ea.push(io),io}gn=gn||0;for(var Na=0;Na":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Aa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Va={cw:Dt,ccw:Ot};function Za(Ct){return Array.isArray(Ct)||Fr(Ct)||Qr(Ct)}function Ta(Ct){return Ct.sort(function(Ir,zr){return Ir===vf?-1:zr===vf?1:Ir=1,qn>=2,Ir)}else if(zr===ls){var Ca=Ct.data;return new Ii(Ca.thisDep,Ca.contextDep,Ca.propDep,Ir)}else{if(zr===To)return new Ii(!1,!1,!1,Ir);if(zr===ro){for(var Ln=!1,Mn=!1,ei=!1,Ja=0;Ja=1&&(Mn=!0),mi>=2&&(ei=!0)}else Qa.type===ls&&(Ln=Ln||Qa.data.thisDep,Mn=Mn||Qa.data.contextDep,ei=ei||Qa.data.propDep)}return new Ii(Ln,Mn,ei,Ir)}else return new Ii(zr===fs,zr===rs,zr===os,Ir)}}var jo=new Ii(!1,!1,!1,function(){});function Yo(Ct,Ir,zr,qn,Ca,Ln,Mn,ei,Ja,Qa,mi,fo,Hi,hi,za,gn){var ea=Qa.Record,ga={add:32774,subtract:32778,"reverse subtract":32779};zr.ext_blend_minmax&&(ga.min=Wt,ga.max=dr);var Na=zr.angle_instanced_arrays,ba=zr.webgl_draw_buffers,Fi=zr.oes_vertex_array_object,oi={dirty:!0,profile:gn.profile},io={},wa=[],ca={},Ri={};function Zn(lt){return lt.replace(".","_")}function yi(lt,gt,Pt){var lr=Zn(lt);wa.push(lt),io[lr]=oi[lr]=!!Pt,ca[lr]=gt}function ti(lt,gt,Pt){var lr=Zn(lt);wa.push(lt),Array.isArray(Pt)?(oi[lr]=Pt.slice(),io[lr]=Pt.slice()):oi[lr]=io[lr]=Pt,Ri[lr]=gt}function lo(lt){return!!isNaN(lt)}yi(Ts,sn),yi(il,jr),ti(Hl,"blendColor",[0,0,0,0]),ti(mu,"blendEquationSeparate",[En,En]),ti(Xl,"blendFuncSeparate",[on,ln,on,ln]),yi(gu,$n,!0),ti(wl,"depthFunc",Un),ti(Zu,"depthRange",[0,1]),ti(Hu,"depthMask",!0),ti(fu,fu,[!0,!0,!0,!0]),yi(Vo,Nr),ti(Fs,"cullFace",pt),ti(nu,nu,Ot),ti(Fl,Fl,1),yi(jc,ua),ti(Gc,"polygonOffset",[0,0]),yi(Zc,Ua),yi(kh,Si),ti(qc,"sampleCoverage",[1,!1]),yi(oh,xn),ti(Ku,"stencilMask",-1),ti(sh,"stencilFunc",[hr,0,-1]),ti(hs,"stencilOpSeparate",[Ye,Rr,Rr,Rr]),ti(Ss,"stencilOpSeparate",[pt,Rr,Rr,Rr]),yi(lh,Wn),ti(Cf,"scissor",[0,0,Ct.drawingBufferWidth,Ct.drawingBufferHeight]),ti(vf,vf,[0,0,Ct.drawingBufferWidth,Ct.drawingBufferHeight]);var Jo={gl:Ct,context:Hi,strings:Ir,next:io,current:oi,draw:fo,elements:Ln,buffer:Ca,shader:mi,attributes:Qa.state,vao:Qa,uniforms:Ja,framebuffer:ei,extensions:zr,timer:hi,isBufferArgs:Za},Wi={primTypes:sa,compareFuncs:ma,blendFuncs:Kn,blendEquations:ga,stencilOps:Aa,glTypes:jn,orientationType:Va};ba&&(Wi.backBuffer=[pt],Wi.drawBuffer=_(qn.maxDrawbuffers,function(lt){return lt===0?[0]:_(lt,function(gt){return Xa+gt})}));var vo=0;function vi(){var lt=ho({cache:za}),gt=lt.link,Pt=lt.global;lt.id=vo++,lt.batchId="0";var lr=gt(Jo),nr=lt.shared={props:"a0"};Object.keys(Jo).forEach(function(or){nr[or]=Pt.def(lr,".",or)});var cr=lt.next={},gr=lt.current={};Object.keys(Ri).forEach(function(or){Array.isArray(oi[or])&&(cr[or]=Pt.def(nr.next,".",or),gr[or]=Pt.def(nr.current,".",or))});var pr=lt.constants={};Object.keys(Wi).forEach(function(or){pr[or]=Pt.def(JSON.stringify(Wi[or]))}),lt.invoke=function(or,ar){switch(ar.type){case bo:var Yr=["this",nr.context,nr.props,lt.batchId];return or.def(gt(ar.data),".call(",Yr.slice(0,Math.max(ar.data.length+1,4)),")");case os:return or.def(nr.props,ar.data);case rs:return or.def(nr.context,ar.data);case fs:return or.def("this",ar.data);case ls:return ar.data.append(lt,or),ar.data.ref;case To:return ar.data.toString();case ro:return ar.data.map(function(cn){return lt.invoke(or,cn)})}},lt.attribCache={};var Jt={};return lt.scopeAttrib=function(or){var ar=Ir.id(or);if(ar in Jt)return Jt[ar];var Yr=Qa.scope[ar];Yr||(Yr=Qa.scope[ar]=new ea);var cn=Jt[ar]=gt(Yr);return cn},lt}function Ho(lt){var gt=lt.static,Pt=lt.dynamic,lr;if(Qe in gt){var nr=!!gt[Qe];lr=so(function(gr,pr){return nr}),lr.enable=nr}else if(Qe in Pt){var cr=Pt[Qe];lr=yo(cr,function(gr,pr){return gr.invoke(pr,cr)})}return lr}function us(lt,gt){var Pt=lt.static,lr=lt.dynamic;if(N in Pt){var nr=Pt[N];return nr?(nr=ei.getFramebuffer(nr),so(function(gr,pr){var Jt=gr.link(nr),or=gr.shared;pr.set(or.framebuffer,".next",Jt);var ar=or.context;return pr.set(ar,"."+vn,Jt+".width"),pr.set(ar,"."+Dn,Jt+".height"),Jt})):so(function(gr,pr){var Jt=gr.shared;pr.set(Jt.framebuffer,".next","null");var or=Jt.context;return pr.set(or,"."+vn,or+"."+Rt),pr.set(or,"."+Dn,or+"."+Yt),"null"})}else if(N in lr){var cr=lr[N];return yo(cr,function(gr,pr){var Jt=gr.invoke(pr,cr),or=gr.shared,ar=or.framebuffer,Yr=pr.def(ar,".getFramebuffer(",Jt,")");pr.set(ar,".next",Yr);var cn=or.context;return pr.set(cn,"."+vn,Yr+"?"+Yr+".width:"+cn+"."+Rt),pr.set(cn,"."+Dn,Yr+"?"+Yr+".height:"+cn+"."+Yt),Yr})}else return null}function _s(lt,gt,Pt){var lr=lt.static,nr=lt.dynamic;function cr(Jt){if(Jt in lr){var or=lr[Jt],ar=!0,Yr=or.x|0,cn=or.y|0,Sn,Sa;return"width"in or?Sn=or.width|0:ar=!1,"height"in or?Sa=or.height|0:ar=!1,new Ii(!ar&>&>.thisDep,!ar&>&>.contextDep,!ar&>&>.propDep,function(Ea,Ra){var Ya=Ea.shared.context,ka=Sn;"width"in or||(ka=Ra.def(Ya,".",vn,"-",Yr));var ri=Sa;return"height"in or||(ri=Ra.def(Ya,".",Dn,"-",cn)),[Yr,cn,ka,ri]})}else if(Jt in nr){var fa=nr[Jt],la=yo(fa,function(Ea,Ra){var Ya=Ea.invoke(Ra,fa),ka=Ea.shared.context,ri=Ra.def(Ya,".x|0"),_i=Ra.def(Ya,".y|0"),Ki=Ra.def('"width" in ',Ya,"?",Ya,".width|0:","(",ka,".",vn,"-",ri,")"),mo=Ra.def('"height" in ',Ya,"?",Ya,".height|0:","(",ka,".",Dn,"-",_i,")");return[ri,_i,Ki,mo]});return gt&&(la.thisDep=la.thisDep||gt.thisDep,la.contextDep=la.contextDep||gt.contextDep,la.propDep=la.propDep||gt.propDep),la}else return gt?new Ii(gt.thisDep,gt.contextDep,gt.propDep,function(Ea,Ra){var Ya=Ea.shared.context;return[0,0,Ra.def(Ya,".",vn),Ra.def(Ya,".",Dn)]}):null}var gr=cr(vf);if(gr){var pr=gr;gr=new Ii(gr.thisDep,gr.contextDep,gr.propDep,function(Jt,or){var ar=pr.append(Jt,or),Yr=Jt.shared.context;return or.set(Yr,"."+ot,ar[2]),or.set(Yr,"."+dt,ar[3]),ar})}return{viewport:gr,scissor_box:cr(Cf)}}function Dl(lt,gt){var Pt=lt.static,lr=typeof Pt[Oe]=="string"&&typeof Pt[ve]=="string";if(lr){if(Object.keys(gt.dynamic).length>0)return null;var nr=gt.static,cr=Object.keys(nr);if(cr.length>0&&typeof nr[cr[0]]=="number"){for(var gr=[],pr=0;pr"+ri+"?"+ar+".constant["+ri+"]:0;"}).join(""),"}}else{","if(",Sn,"(",ar,".buffer)){",Ea,"=",Sa,".createStream(",er,",",ar,".buffer);","}else{",Ea,"=",Sa,".getBuffer(",ar,".buffer);","}",Ra,'="type" in ',ar,"?",cn.glTypes,"[",ar,".type]:",Ea,".dtype;",fa.normalized,"=!!",ar,".normalized;");function Ya(ka){or(fa[ka],"=",ar,".",ka,"|0;")}return Ya("size"),Ya("offset"),Ya("stride"),Ya("divisor"),or("}}"),or.exit("if(",fa.isStream,"){",Sa,".destroyStream(",Ea,");","}"),fa}nr[cr]=yo(gr,pr)}),nr}function xc(lt){var gt=lt.static,Pt=lt.dynamic,lr={};return Object.keys(gt).forEach(function(nr){var cr=gt[nr];lr[nr]=so(function(gr,pr){return typeof cr=="number"||typeof cr=="boolean"?""+cr:gr.link(cr)})}),Object.keys(Pt).forEach(function(nr){var cr=Pt[nr];lr[nr]=yo(cr,function(gr,pr){return gr.invoke(pr,cr)})}),lr}function Yf(lt,gt,Pt,lr,nr){lt.static,lt.dynamic;var cr=Dl(lt,gt),gr=us(lt),pr=_s(lt,gr),Jt=Wu(lt),or=xl(lt),ar=xs(lt,nr,cr);function Yr(Ea){var Ra=pr[Ea];Ra&&(or[Ea]=Ra)}Yr(vf),Yr(Zn(Cf));var cn=Object.keys(or).length>0,Sn={framebuffer:gr,draw:Jt,shader:ar,state:or,dirty:cn,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Sn.profile=Ho(lt),Sn.uniforms=Fu(Pt),Sn.drawVAO=Sn.scopeVAO=Jt.vao,!Sn.drawVAO&&ar.program&&!cr&&zr.angle_instanced_arrays&&Jt.static.elements){var Sa=!0,fa=ar.program.attributes.map(function(Ea){var Ra=gt.static[Ea];return Sa=Sa&&!!Ra,Ra});if(Sa&&fa.length>0){var la=Qa.getVAO(Qa.createVAO({attributes:fa,elements:Jt.static.elements}));Sn.drawVAO=new Ii(null,null,null,function(Ea,Ra){return Ea.link(la)}),Sn.useVAO=!0}}return cr?Sn.useVAO=!0:Sn.attributes=oc(gt),Sn.context=xc(lr),Sn}function Tu(lt,gt,Pt){var lr=lt.shared,nr=lr.context,cr=lt.scope();Object.keys(Pt).forEach(function(gr){gt.save(nr,"."+gr);var pr=Pt[gr],Jt=pr.append(lt,gt);Array.isArray(Jt)?cr(nr,".",gr,"=[",Jt.join(),"];"):cr(nr,".",gr,"=",Jt,";")}),gt(cr)}function Du(lt,gt,Pt,lr){var nr=lt.shared,cr=nr.gl,gr=nr.framebuffer,pr;ba&&(pr=gt.def(nr.extensions,".webgl_draw_buffers"));var Jt=lt.constants,or=Jt.drawBuffer,ar=Jt.backBuffer,Yr;Pt?Yr=Pt.append(lt,gt):Yr=gt.def(gr,".next"),lr||gt("if(",Yr,"!==",gr,".cur){"),gt("if(",Yr,"){",cr,".bindFramebuffer(",Gn,",",Yr,".framebuffer);"),ba&>(pr,".drawBuffersWEBGL(",or,"[",Yr,".colorAttachments.length]);"),gt("}else{",cr,".bindFramebuffer(",Gn,",null);"),ba&>(pr,".drawBuffersWEBGL(",ar,");"),gt("}",gr,".cur=",Yr,";"),lr||gt("}")}function Fo(lt,gt,Pt){var lr=lt.shared,nr=lr.gl,cr=lt.current,gr=lt.next,pr=lr.current,Jt=lr.next,or=lt.cond(pr,".dirty");wa.forEach(function(ar){var Yr=Zn(ar);if(!(Yr in Pt.state)){var cn,Sn;if(Yr in gr){cn=gr[Yr],Sn=cr[Yr];var Sa=_(oi[Yr].length,function(la){return or.def(cn,"[",la,"]")});or(lt.cond(Sa.map(function(la,Ea){return la+"!=="+Sn+"["+Ea+"]"}).join("||")).then(nr,".",Ri[Yr],"(",Sa,");",Sa.map(function(la,Ea){return Sn+"["+Ea+"]="+la}).join(";"),";"))}else{cn=or.def(Jt,".",Yr);var fa=lt.cond(cn,"!==",pr,".",Yr);or(fa),Yr in ca?fa(lt.cond(cn).then(nr,".enable(",ca[Yr],");").else(nr,".disable(",ca[Yr],");"),pr,".",Yr,"=",cn,";"):fa(nr,".",Ri[Yr],"(",cn,");",pr,".",Yr,"=",cn,";")}}}),Object.keys(Pt.state).length===0&&or(pr,".dirty=false;"),gt(or)}function bc(lt,gt,Pt,lr){var nr=lt.shared,cr=lt.current,gr=nr.current,pr=nr.gl,Jt;Ta(Object.keys(Pt)).forEach(function(or){var ar=Pt[or];if(!(lr&&!lr(ar))){var Yr=ar.append(lt,gt);if(ca[or]){var cn=ca[or];wo(ar)?(Jt=lt.link(Yr,{stable:!0}),gt(lt.cond(Jt).then(pr,".enable(",cn,");").else(pr,".disable(",cn,");")),gt(gr,".",or,"=",Jt,";")):(gt(lt.cond(Yr).then(pr,".enable(",cn,");").else(pr,".disable(",cn,");")),gt(gr,".",or,"=",Yr,";"))}else if(na(Yr)){var Sn=cr[or];gt(pr,".",Ri[or],"(",Yr,");",Yr.map(function(Sa,fa){return Sn+"["+fa+"]="+Sa}).join(";"),";")}else wo(ar)?(Jt=lt.link(Yr,{stable:!0}),gt(pr,".",Ri[or],"(",Jt,");",gr,".",or,"=",Jt,";")):gt(pr,".",Ri[or],"(",Yr,");",gr,".",or,"=",Yr,";")}})}function sl(lt,gt){Na&&(lt.instancing=gt.def(lt.shared.extensions,".angle_instanced_arrays"))}function iu(lt,gt,Pt,lr,nr){var cr=lt.shared,gr=lt.stats,pr=cr.current,Jt=cr.timer,or=Pt.profile;function ar(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Yr,cn;function Sn(Ya){Yr=gt.def(),Ya(Yr,"=",ar(),";"),typeof nr=="string"?Ya(gr,".count+=",nr,";"):Ya(gr,".count++;"),hi&&(lr?(cn=gt.def(),Ya(cn,"=",Jt,".getNumPendingQueries();")):Ya(Jt,".beginQuery(",gr,");"))}function Sa(Ya){Ya(gr,".cpuTime+=",ar(),"-",Yr,";"),hi&&(lr?Ya(Jt,".pushScopeStats(",cn,",",Jt,".getNumPendingQueries(),",gr,");"):Ya(Jt,".endQuery();"))}function fa(Ya){var ka=gt.def(pr,".profile");gt(pr,".profile=",Ya,";"),gt.exit(pr,".profile=",ka,";")}var la;if(or){if(wo(or)){or.enable?(Sn(gt),Sa(gt.exit),fa("true")):fa("false");return}la=or.append(lt,gt),fa(la)}else la=gt.def(pr,".profile");var Ea=lt.block();Sn(Ea),gt("if(",la,"){",Ea,"}");var Ra=lt.block();Sa(Ra),gt.exit("if(",la,"){",Ra,"}")}function Fc(lt,gt,Pt,lr,nr){var cr=lt.shared;function gr(Jt){switch(Jt){case Mi:case vs:case Sl:return 2;case Ao:case ml:case Ou:return 3;case qo:case yl:case Su:return 4;default:return 1}}function pr(Jt,or,ar){var Yr=cr.gl,cn=gt.def(Jt,".location"),Sn=gt.def(cr.attributes,"[",cn,"]"),Sa=ar.state,fa=ar.buffer,la=[ar.x,ar.y,ar.z,ar.w],Ea=["buffer","normalized","offset","stride"];function Ra(){gt("if(!",Sn,".buffer){",Yr,".enableVertexAttribArray(",cn,");}");var ka=ar.type,ri;if(ar.size?ri=gt.def(ar.size,"||",or):ri=or,gt("if(",Sn,".type!==",ka,"||",Sn,".size!==",ri,"||",Ea.map(function(Ki){return Sn+"."+Ki+"!=="+ar[Ki]}).join("||"),"){",Yr,".bindBuffer(",er,",",fa,".buffer);",Yr,".vertexAttribPointer(",[cn,ri,ka,ar.normalized,ar.stride,ar.offset],");",Sn,".type=",ka,";",Sn,".size=",ri,";",Ea.map(function(Ki){return Sn+"."+Ki+"="+ar[Ki]+";"}).join(""),"}"),Na){var _i=ar.divisor;gt("if(",Sn,".divisor!==",_i,"){",lt.instancing,".vertexAttribDivisorANGLE(",[cn,_i],");",Sn,".divisor=",_i,";}")}}function Ya(){gt("if(",Sn,".buffer){",Yr,".disableVertexAttribArray(",cn,");",Sn,".buffer=null;","}if(",fi.map(function(ka,ri){return Sn+"."+ka+"!=="+la[ri]}).join("||"),"){",Yr,".vertexAttrib4f(",cn,",",la,");",fi.map(function(ka,ri){return Sn+"."+ka+"="+la[ri]+";"}).join(""),"}")}Sa===bi?Ra():Sa===ii?Ya():(gt("if(",Sa,"===",bi,"){"),Ra(),gt("}else{"),Ya(),gt("}"))}lr.forEach(function(Jt){var or=Jt.name,ar=Pt.attributes[or],Yr;if(ar){if(!nr(ar))return;Yr=ar.append(lt,gt)}else{if(!nr(jo))return;var cn=lt.scopeAttrib(or);Yr={},Object.keys(new ea).forEach(function(Sn){Yr[Sn]=gt.def(cn,".",Sn)})}pr(lt.link(Jt),gr(Jt.info.type),Yr)})}function Bc(lt,gt,Pt,lr,nr,cr){for(var gr=lt.shared,pr=gr.gl,Jt,or=0;or1){for(var Us=[],zs=[],Bl=0;Bl>1)",fa],");")}function _i(){Pt(la,".drawArraysInstancedANGLE(",[cn,Sn,Sa,fa],");")}ar&&ar!=="null"?Ra?ri():(Pt("if(",ar,"){"),ri(),Pt("}else{"),_i(),Pt("}")):_i()}function ka(){function ri(){Pt(cr+".drawElements("+[cn,Sa,Ea,Sn+"<<(("+Ea+"-"+Yi+")>>1)"]+");")}function _i(){Pt(cr+".drawArrays("+[cn,Sn,Sa]+");")}ar&&ar!=="null"?Ra?ri():(Pt("if(",ar,"){"),ri(),Pt("}else{"),_i(),Pt("}")):_i()}Na&&(typeof fa!="number"||fa>=0)?typeof fa=="string"?(Pt("if(",fa,">0){"),Ya(),Pt("}else if(",fa,"<0){"),ka(),Pt("}")):Ya():ka()}function Ds(lt,gt,Pt,lr,nr){var cr=vi(),gr=cr.proc("body",nr);return Na&&(cr.instancing=gr.def(cr.shared.extensions,".angle_instanced_arrays")),lt(cr,gr,Pt,lr),cr.compile().body}function Bs(lt,gt,Pt,lr){sl(lt,gt),Pt.useVAO?Pt.drawVAO?gt(lt.shared.vao,".setVAO(",Pt.drawVAO.append(lt,gt),");"):gt(lt.shared.vao,".setVAO(",lt.shared.vao,".targetVAO);"):(gt(lt.shared.vao,".setVAO(null);"),Fc(lt,gt,Pt,lr.attributes,function(){return!0})),Bc(lt,gt,Pt,lr.uniforms,function(){return!0},!1),Zo(lt,gt,gt,Pt)}function Le(lt,gt){var Pt=lt.proc("draw",1);sl(lt,Pt),Tu(lt,Pt,gt.context),Du(lt,Pt,gt.framebuffer),Fo(lt,Pt,gt),bc(lt,Pt,gt.state),iu(lt,Pt,gt,!1,!0);var lr=gt.shader.progVar.append(lt,Pt);if(Pt(lt.shared.gl,".useProgram(",lr,".program);"),gt.shader.program)Bs(lt,Pt,gt,gt.shader.program);else{Pt(lt.shared.vao,".setVAO(null);");var nr=lt.global.def("{}"),cr=Pt.def(lr,".id"),gr=Pt.def(nr,"[",cr,"]");Pt(lt.cond(gr).then(gr,".call(this,a0);").else(gr,"=",nr,"[",cr,"]=",lt.link(function(pr){return Ds(Bs,lt,gt,pr,1)}),"(",lr,");",gr,".call(this,a0);"))}Object.keys(gt.state).length>0&&Pt(lt.shared.current,".dirty=true;"),lt.shared.vao&&Pt(lt.shared.vao,".setVAO(null);")}function X(lt,gt,Pt,lr){lt.batchId="a1",sl(lt,gt);function nr(){return!0}Fc(lt,gt,Pt,lr.attributes,nr),Bc(lt,gt,Pt,lr.uniforms,nr,!1),Zo(lt,gt,gt,Pt)}function we(lt,gt,Pt,lr){sl(lt,gt);var nr=Pt.contextDep,cr=gt.def(),gr="a0",pr="a1",Jt=gt.def();lt.shared.props=Jt,lt.batchId=cr;var or=lt.scope(),ar=lt.scope();gt(or.entry,"for(",cr,"=0;",cr,"<",pr,";++",cr,"){",Jt,"=",gr,"[",cr,"];",ar,"}",or.exit);function Yr(Ea){return Ea.contextDep&&nr||Ea.propDep}function cn(Ea){return!Yr(Ea)}if(Pt.needsContext&&Tu(lt,ar,Pt.context),Pt.needsFramebuffer&&Du(lt,ar,Pt.framebuffer),bc(lt,ar,Pt.state,Yr),Pt.profile&&Yr(Pt.profile)&&iu(lt,ar,Pt,!1,!0),lr)Pt.useVAO?Pt.drawVAO?Yr(Pt.drawVAO)?ar(lt.shared.vao,".setVAO(",Pt.drawVAO.append(lt,ar),");"):or(lt.shared.vao,".setVAO(",Pt.drawVAO.append(lt,or),");"):or(lt.shared.vao,".setVAO(",lt.shared.vao,".targetVAO);"):(or(lt.shared.vao,".setVAO(null);"),Fc(lt,or,Pt,lr.attributes,cn),Fc(lt,ar,Pt,lr.attributes,Yr)),Bc(lt,or,Pt,lr.uniforms,cn,!1),Bc(lt,ar,Pt,lr.uniforms,Yr,!0),Zo(lt,or,ar,Pt);else{var Sn=lt.global.def("{}"),Sa=Pt.shader.progVar.append(lt,ar),fa=ar.def(Sa,".id"),la=ar.def(Sn,"[",fa,"]");ar(lt.shared.gl,".useProgram(",Sa,".program);","if(!",la,"){",la,"=",Sn,"[",fa,"]=",lt.link(function(Ea){return Ds(X,lt,Pt,Ea,2)}),"(",Sa,");}",la,".call(this,a0[",cr,"],",cr,");")}}function ie(lt,gt){var Pt=lt.proc("batch",2);lt.batchId="0",sl(lt,Pt);var lr=!1,nr=!0;Object.keys(gt.context).forEach(function(Sn){lr=lr||gt.context[Sn].propDep}),lr||(Tu(lt,Pt,gt.context),nr=!1);var cr=gt.framebuffer,gr=!1;cr?(cr.propDep?lr=gr=!0:cr.contextDep&&lr&&(gr=!0),gr||Du(lt,Pt,cr)):Du(lt,Pt,null),gt.state.viewport&>.state.viewport.propDep&&(lr=!0);function pr(Sn){return Sn.contextDep&&lr||Sn.propDep}Fo(lt,Pt,gt),bc(lt,Pt,gt.state,function(Sn){return!pr(Sn)}),(!gt.profile||!pr(gt.profile))&&iu(lt,Pt,gt,!1,"a1"),gt.contextDep=lr,gt.needsContext=nr,gt.needsFramebuffer=gr;var Jt=gt.shader.progVar;if(Jt.contextDep&&lr||Jt.propDep)we(lt,Pt,gt,null);else{var or=Jt.append(lt,Pt);if(Pt(lt.shared.gl,".useProgram(",or,".program);"),gt.shader.program)we(lt,Pt,gt,gt.shader.program);else{Pt(lt.shared.vao,".setVAO(null);");var ar=lt.global.def("{}"),Yr=Pt.def(or,".id"),cn=Pt.def(ar,"[",Yr,"]");Pt(lt.cond(cn).then(cn,".call(this,a0,a1);").else(cn,"=",ar,"[",Yr,"]=",lt.link(function(Sn){return Ds(we,lt,gt,Sn,2)}),"(",or,");",cn,".call(this,a0,a1);"))}}Object.keys(gt.state).length>0&&Pt(lt.shared.current,".dirty=true;"),lt.shared.vao&&Pt(lt.shared.vao,".setVAO(null);")}function Me(lt,gt){var Pt=lt.proc("scope",3);lt.batchId="a2";var lr=lt.shared,nr=lr.current;if(Tu(lt,Pt,gt.context),gt.framebuffer&>.framebuffer.append(lt,Pt),Ta(Object.keys(gt.state)).forEach(function(pr){var Jt=gt.state[pr],or=Jt.append(lt,Pt);na(or)?or.forEach(function(ar,Yr){lo(ar)?Pt.set(lt.next[pr],"["+Yr+"]",ar):Pt.set(lt.next[pr],"["+Yr+"]",lt.link(ar,{stable:!0}))}):wo(Jt)?Pt.set(lr.next,"."+pr,lt.link(or,{stable:!0})):Pt.set(lr.next,"."+pr,or)}),iu(lt,Pt,gt,!0,!0),[Ue,$t,It,ir,Ke].forEach(function(pr){var Jt=gt.draw[pr];if(Jt){var or=Jt.append(lt,Pt);lo(or)?Pt.set(lr.draw,"."+pr,or):Pt.set(lr.draw,"."+pr,lt.link(or),{stable:!0})}}),Object.keys(gt.uniforms).forEach(function(pr){var Jt=gt.uniforms[pr].append(lt,Pt);Array.isArray(Jt)&&(Jt="["+Jt.map(function(or){return lo(or)?or:lt.link(or,{stable:!0})})+"]"),Pt.set(lr.uniforms,"["+lt.link(Ir.id(pr),{stable:!0})+"]",Jt)}),Object.keys(gt.attributes).forEach(function(pr){var Jt=gt.attributes[pr].append(lt,Pt),or=lt.scopeAttrib(pr);Object.keys(new ea).forEach(function(ar){Pt.set(or,"."+ar,Jt[ar])})}),gt.scopeVAO){var cr=gt.scopeVAO.append(lt,Pt);lo(cr)?Pt.set(lr.vao,".targetVAO",cr):Pt.set(lr.vao,".targetVAO",lt.link(cr,{stable:!0}))}function gr(pr){var Jt=gt.shader[pr];if(Jt){var or=Jt.append(lt,Pt);lo(or)?Pt.set(lr.shader,"."+pr,or):Pt.set(lr.shader,"."+pr,lt.link(or,{stable:!0}))}}gr(ve),gr(Oe),Object.keys(gt.state).length>0&&(Pt(nr,".dirty=true;"),Pt.exit(nr,".dirty=true;")),Pt("a1(",lt.shared.context,",a0,",lt.batchId,");")}function tt(lt){if(!(typeof lt!="object"||na(lt))){for(var gt=Object.keys(lt),Pt=0;Pt=0;--Zo){var Ds=lo[Zo];Ds&&Ds(hi,null,0)}zr.flush(),Qa&&Qa.update()}function us(){!vi&&lo.length>0&&(vi=d.next(Ho))}function _s(){vi&&(d.cancel(Ho),vi=null)}function Dl(Zo){Zo.preventDefault(),_s(),Jo.forEach(function(Ds){Ds()})}function xs(Zo){zr.getError(),Ca.restore(),oi.restore(),ga.restore(),io.restore(),wa.restore(),ca.restore(),ba.restore(),Qa&&Qa.restore(),Ri.procs.refresh(),us(),Wi.forEach(function(Ds){Ds()})}ti&&(ti.addEventListener(yu,Dl,!1),ti.addEventListener(au,xs,!1));function Wu(){lo.length=0,_s(),ti&&(ti.removeEventListener(yu,Dl),ti.removeEventListener(au,xs)),oi.clear(),ca.clear(),wa.clear(),ba.clear(),io.clear(),Na.clear(),ga.clear(),Qa&&Qa.clear(),vo.forEach(function(Zo){Zo()})}function xl(Zo){function Ds(nr){var cr=v({},nr);delete cr.uniforms,delete cr.attributes,delete cr.context,delete cr.vao,"stencil"in cr&&cr.stencil.op&&(cr.stencil.opBack=cr.stencil.opFront=cr.stencil.op,delete cr.stencil.op);function gr(pr){if(pr in cr){var Jt=cr[pr];delete cr[pr],Object.keys(Jt).forEach(function(or){cr[pr+"."+or]=Jt[or]})}}return gr("blend"),gr("depth"),gr("cull"),gr("stencil"),gr("polygonOffset"),gr("scissor"),gr("sample"),"vao"in nr&&(cr.vao=nr.vao),cr}function Bs(nr,cr){var gr={},pr={};return Object.keys(nr).forEach(function(Jt){var or=nr[Jt];if(p.isDynamic(or)){pr[Jt]=p.unbox(or,Jt);return}else if(cr&&Array.isArray(or)){for(var ar=0;ar0)return Et.call(this,Pt(nr|0),nr|0)}else if(Array.isArray(nr)){if(nr.length)return Et.call(this,nr,nr.length)}else return wt.call(this,nr)}return v(lr,{stats:Me,destroy:function(){tt.destroy()}})}var Fu=ca.setFBO=xl({framebuffer:p.define.call(null,Kc,"framebuffer")});function oc(Zo,Ds){var Bs=0;Ri.procs.poll();var Le=Ds.color;Le&&(zr.clearColor(+Le[0]||0,+Le[1]||0,+Le[2]||0,+Le[3]||0),Bs|=wu),"depth"in Ds&&(zr.clearDepth(+Ds.depth),Bs|=zo),"stencil"in Ds&&(zr.clearStencil(Ds.stencil|0),Bs|=Ks),zr.clear(Bs)}function xc(Zo){if("framebuffer"in Zo)if(Zo.framebuffer&&Zo.framebuffer_reglType==="framebufferCube")for(var Ds=0;Ds<6;++Ds)Fu(v({framebuffer:Zo.framebuffer.faces[Ds]},Zo),oc);else Fu(Zo,oc);else oc(null,Zo)}function Yf(Zo){lo.push(Zo);function Ds(){var Bs=kf(lo,Zo);function Le(){var X=kf(lo,Le);lo[X]=lo[lo.length-1],lo.length-=1,lo.length<=0&&_s()}lo[Bs]=Le}return us(),{cancel:Ds}}function Tu(){var Zo=yi.viewport,Ds=yi.scissor_box;Zo[0]=Zo[1]=Ds[0]=Ds[1]=0,hi.viewportWidth=hi.framebufferWidth=hi.drawingBufferWidth=Zo[2]=Ds[2]=zr.drawingBufferWidth,hi.viewportHeight=hi.framebufferHeight=hi.drawingBufferHeight=Zo[3]=Ds[3]=zr.drawingBufferHeight}function Du(){hi.tick+=1,hi.time=bc(),Tu(),Ri.procs.poll()}function Fo(){io.refresh(),Tu(),Ri.procs.refresh(),Qa&&Qa.update()}function bc(){return(y()-mi)/1e3}Fo();function sl(Zo,Ds){var Bs;switch(Zo){case"frame":return Yf(Ds);case"lost":Bs=Jo;break;case"restore":Bs=Wi;break;case"destroy":Bs=vo;break}return Bs.push(Ds),{cancel:function(){for(var Le=0;Le=0},read:Zn,destroy:Wu,_gl:zr,_refresh:Fo,poll:function(){Du(),Qa&&Qa.update()},now:bc,stats:Mn,getCachedCode:iu,preloadCachedCode:Fc});return Ir.onDone(null,Bc),Bc}return Ju})}}),VP=Re({"src/lib/prepare_regl.js"(ae,K){var v=QO(),S=aZ();K.exports=function(L,t,r){var a=L._fullLayout,l=!0;return a._glcanvas.each(function(i){if(i.regl){i.regl.preloadCachedCode(r);return}if(!(i.pick&&!a._has("parcoords"))){try{i.regl=S({canvas:this,attributes:{antialias:!i.pick,preserveDrawingBuffer:!0},pixelRatio:L._context.plotGlPixelRatio||window.devicePixelRatio,extensions:t||[],cachedCode:r||{}})}catch{l=!1}i.regl||(l=!1),l&&this.addEventListener("webglcontextlost",function(s){L&&L.emit&&L.emit("plotly_webglcontextlost",{event:s,layer:i.key})},!1)}}),l||v({container:a._glcontainer.node()}),l}}}),jF=Re({"src/traces/scattergl/plot.js"(p,K){var v=bF(),S=DF(),M=$Y(),L=nZ(),t=Rn(),r=gg().selectMode,a=VP(),l=Mu(),i=km(),s=yF().styleTextSelection,o={};function c(d,y,g,C){var f=d._size,x=d.width*C,A=d.height*C,k=f.l*C,I=f.b*C,T=f.r*C,E=f.t*C,_=f.w*C,h=f.h*C;return[k+y.domain[0]*_,I+g.domain[0]*h,x-T-(1-y.domain[1])*_,A-E-(1-g.domain[1])*h]}var p=K.exports=function(y,g,C){if(C.length){var f=y._fullLayout,x=g._scene,A=g.xaxis,k=g.yaxis,I,T;if(x){var E=a(y,["ANGLE_instanced_arrays","OES_element_index_uint"],o);if(!E){x.init();return}var _=x.count,h=f._glcanvas.data()[0].regl;if(i(y,g,C),x.dirty){if((x.line2d||x.error2d)&&!(x.scatter2d||x.fill2d||x.glText)&&h.clear({color:!0,depth:!0}),x.error2d===!0&&(x.error2d=M(h)),x.line2d===!0&&(x.line2d=S(h)),x.scatter2d===!0&&(x.scatter2d=v(h)),x.fill2d===!0&&(x.fill2d=S(h)),x.glText===!0)for(x.glText=new Array(_),I=0;I<_;I++)x.glText[I]=new L(h);if(x.glText){if(_>x.glText.length){var m=_-x.glText.length;for(I=0;Ipe&&(isNaN(de[Te])||isNaN(de[Te+1]));)Te-=2;Z.positions=de.slice(pe,Te+2)}return Z}),x.line2d.update(x.lineOptions)),x.error2d){var z=(x.errorXOptions||[]).concat(x.errorYOptions||[]);x.error2d.update(z)}x.scatter2d&&x.scatter2d.update(x.markerOptions),x.fillOrder=t.repeat(null,_),x.fill2d&&(x.fillOptions=x.fillOptions.map(function(Z,de){var pe=C[de];if(!(!Z||!pe||!pe[0]||!pe[0].trace)){var Te=pe[0],Ne=Te.trace,$e=Te.t,Ze=x.lineOptions[de],Xe,it,yt=[];Ne._ownfill&&yt.push(de),Ne._nexttrace&&yt.push(de+1),yt.length&&(x.fillOrder[de]=yt);var bt=[],mt=Ze&&Ze.positions||$e.positions,ht,Ve;if(Ne.fill==="tozeroy"){for(ht=0;htht&&isNaN(mt[Ve+1]);)Ve-=2;mt[ht+1]!==0&&(bt=[mt[ht],0]),bt=bt.concat(mt.slice(ht,Ve+2)),mt[Ve+1]!==0&&(bt=bt.concat([mt[Ve],0]))}else if(Ne.fill==="tozerox"){for(ht=0;htht&&isNaN(mt[Ve]);)Ve-=2;mt[ht]!==0&&(bt=[0,mt[ht+1]]),bt=bt.concat(mt.slice(ht,Ve+2)),mt[Ve]!==0&&(bt=bt.concat([0,mt[Ve+1]]))}else if(Ne.fill==="toself"||Ne.fill==="tonext"){for(bt=[],Xe=0,Z.splitNull=!0,it=0;it-1;for(I=0;I<_;I++){var j=C[I][0],O=j.trace,H=j.t,W=H.index,ee=O._length,ue=H.x,xe=H.y;if(O.selectedpoints||V||G){if(V||(V=!0),O.selectedpoints){var ge=x.selectBatch[W]=t.selIndices2selPoints(O),_e={};for(T=0;TA&&g||xs,w;for(m?w=g.sizeAvg||Math.max(g.size,3):w=M(p,y),k=0;k{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,L(()=>{this.dirty=!1})),this)},l.prototype.update=function(...c){if(!c.length)return;for(let y=0;yw||!g.lower&&m{p[C+x]=y})}this.scatter.draw(...p)}return this},l.prototype.destroy=function(){return this.traces.forEach(c=>{c.buffer&&c.buffer.destroy&&c.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function i(c,p,d){let y=c.id!=null?c.id:c,g=p,C=d;return y<<16|(g&255)<<8|C&255}function s(c,p,d){let y,g,C,f,x=c[p],A=c[d];return x.length>2?(x[0],x[2],y=x[1],g=x[3]):x.length?(y=x[0],g=x[1]):(x.x,y=x.y,x.x+x.width,g=x.y+x.height),A.length>2?(C=A[0],f=A[2],A[1],A[3]):A.length?(C=A[0],f=A[1]):(C=A.x,A.y,f=A.x+A.width,A.y+A.height),[C,y,f,g]}function o(c){if(typeof c=="number")return[c,c,c,c];if(c.length===2)return[c[0],c[1],c[0],c[1]];{let p=r(c);return[p.x,p.y,p.x+p.width,p.y+p.height]}}}}),pZ=Re({"src/traces/splom/plot.js"(ae,K){var v=dZ(),S=Rn(),M=fh(),L=gg().selectMode;K.exports=function(a,l,i){if(i.length)for(var s=0;s-1,G=L(g)||!!s.selectedpoints||V,j=!0;if(G){var O=s._length;if(s.selectedpoints){c.selectBatch=s.selectedpoints;var H=s.selectedpoints,W={};for(x=0;x=ee[ue][0]&&W<=ee[ue][1])return!0;return!1}function p(W){W.attr("x",-v.bar.captureWidth/2).attr("width",v.bar.captureWidth)}function d(W){W.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function y(W){if(!W.brush.filterSpecified)return"0,"+W.height;for(var ee=g(W.brush.filter.getConsolidated(),W.height),ue=[0],xe,ge,_e,Y=ee.length?ee[0][0]:null,se=0;seW[1]+ue||ee=.9*W[1]+.1*W[0]?"n":ee<=.9*W[0]+.1*W[1]?"s":"ns"}function f(){S.select(document.body).style("cursor",null)}function x(W){W.attr("stroke-dasharray",y)}function A(W,ee){var ue=S.select(W).selectAll(".highlight, .highlight-shadow"),xe=ee?ue.transition().duration(v.bar.snapDuration).each("end",ee):ue;x(xe)}function k(W,ee){var ue=W.brush,xe=ue.filterSpecified,ge=NaN,_e={},Y;if(xe){var se=W.height,ce=ue.filter.getConsolidated(),ne=g(ce,se),ye=NaN,le=NaN,Z=NaN;for(Y=0;Y<=ne.length;Y++){var de=ne[Y];if(de&&de[0]<=ee&&ee<=de[1]){ye=Y;break}else if(le=Y?Y-1:NaN,de&&de[0]>ee){Z=Y;break}}if(ge=ye,isNaN(ge)&&(isNaN(le)||isNaN(Z)?ge=isNaN(le)?Z:le:ge=ee-ne[le][1]=Ze[0]&&$e<=Ze[1]){_e.clickableOrdinalRange=Ze;break}}}return _e}function I(W,ee){S.event.sourceEvent.stopPropagation();var ue=ee.height-S.mouse(W)[1]-2*v.verticalPadding,xe=ee.unitToPaddedPx.invert(ue),ge=ee.brush,_e=k(ee,ue),Y=_e.interval,se=ge.svgBrush;if(se.wasDragged=!1,se.grabbingBar=_e.region==="ns",se.grabbingBar){var ce=Y.map(ee.unitToPaddedPx);se.grabPoint=ue-ce[0]-v.verticalPadding,se.barLength=ce[1]-ce[0]}se.clickableOrdinalRange=_e.clickableOrdinalRange,se.stayingIntervals=ee.multiselect&&ge.filterSpecified?ge.filter.getConsolidated():[],Y&&(se.stayingIntervals=se.stayingIntervals.filter(function(ne){return ne[0]!==Y[0]&&ne[1]!==Y[1]})),se.startExtent=_e.region?Y[_e.region==="s"?1:0]:xe,ee.parent.inBrushDrag=!0,se.brushStartCallback()}function T(W,ee){S.event.sourceEvent.stopPropagation();var ue=ee.height-S.mouse(W)[1]-2*v.verticalPadding,xe=ee.brush.svgBrush;xe.wasDragged=!0,xe._dragging=!0,xe.grabbingBar?xe.newExtent=[ue-xe.grabPoint,ue+xe.barLength-xe.grabPoint].map(ee.unitToPaddedPx.invert):xe.newExtent=[xe.startExtent,ee.unitToPaddedPx.invert(ue)].sort(t),ee.brush.filterSpecified=!0,xe.extent=xe.stayingIntervals.concat([xe.newExtent]),xe.brushCallback(ee),A(W.parentNode)}function E(W,ee){var ue=ee.brush,xe=ue.filter,ge=ue.svgBrush;ge._dragging||(_(W,ee),T(W,ee),ee.brush.svgBrush.wasDragged=!1),ge._dragging=!1;var _e=S.event;_e.sourceEvent.stopPropagation();var Y=ge.grabbingBar;if(ge.grabbingBar=!1,ge.grabLocation=void 0,ee.parent.inBrushDrag=!1,f(),!ge.wasDragged){ge.wasDragged=void 0,ge.clickableOrdinalRange?ue.filterSpecified&&ee.multiselect?ge.extent.push(ge.clickableOrdinalRange):(ge.extent=[ge.clickableOrdinalRange],ue.filterSpecified=!0):Y?(ge.extent=ge.stayingIntervals,ge.extent.length===0&&U(ue)):U(ue),ge.brushCallback(ee),A(W.parentNode),ge.brushEndCallback(ue.filterSpecified?xe.getConsolidated():[]);return}var se=function(){xe.set(xe.getConsolidated())};if(ee.ordinal){var ce=ee.unitTickvals;ce[ce.length-1]ge.newExtent[0];ge.extent=ge.stayingIntervals.concat(ne?[ge.newExtent]:[]),ge.extent.length||U(ue),ge.brushCallback(ee),ne?A(W.parentNode,se):(se(),A(W.parentNode))}else se();ge.brushEndCallback(ue.filterSpecified?xe.getConsolidated():[])}function _(W,ee){var ue=ee.height-S.mouse(W)[1]-2*v.verticalPadding,xe=k(ee,ue),ge="crosshair";xe.clickableOrdinalRange?ge="pointer":xe.region&&(ge=xe.region+"-resize"),S.select(document.body).style("cursor",ge)}function h(W){W.on("mousemove",function(ee){S.event.preventDefault(),ee.parent.inBrushDrag||_(this,ee)}).on("mouseleave",function(ee){ee.parent.inBrushDrag||f()}).call(S.behavior.drag().on("dragstart",function(ee){I(this,ee)}).on("drag",function(ee){T(this,ee)}).on("dragend",function(ee){E(this,ee)}))}function m(W,ee){return W[0]-ee[0]}function w(W,ee,ue){var xe=ue._context.staticPlot,ge=W.selectAll(".background").data(L);ge.enter().append("rect").classed("background",!0).call(p).call(d).style("pointer-events",xe?"none":"auto").attr("transform",r(0,v.verticalPadding)),ge.call(h).attr("height",function(se){return se.height-v.verticalPadding});var _e=W.selectAll(".highlight-shadow").data(L);_e.enter().append("line").classed("highlight-shadow",!0).attr("x",-v.bar.width/2).attr("stroke-width",v.bar.width+v.bar.strokeWidth).attr("stroke",ee).attr("opacity",v.bar.strokeOpacity).attr("stroke-linecap","butt"),_e.attr("y1",function(se){return se.height}).call(x);var Y=W.selectAll(".highlight").data(L);Y.enter().append("line").classed("highlight",!0).attr("x",-v.bar.width/2).attr("stroke-width",v.bar.width-v.bar.strokeWidth).attr("stroke",v.bar.fillColor).attr("opacity",v.bar.fillOpacity).attr("stroke-linecap","butt"),Y.attr("y1",function(se){return se.height}).call(x)}function F(W,ee,ue){var xe=W.selectAll("."+v.cn.axisBrush).data(L,M);xe.enter().append("g").classed(v.cn.axisBrush,!0),w(xe,ee,ue)}function z(W){return W.svgBrush.extent.map(function(ee){return ee.slice()})}function U(W){W.filterSpecified=!1,W.svgBrush.extent=[[-1/0,1/0]]}function V(W){return function(ue){var xe=ue.brush,ge=z(xe),_e=ge.slice();xe.filter.set(_e),W()}}function G(W){for(var ee=W.slice(),ue=[],xe,ge=ee.shift();ge;){for(xe=ge.slice();(ge=ee.shift())&&ge[0]<=xe[1];)xe[1]=Math.max(xe[1],ge[1]);ue.push(xe)}return ue.length===1&&ue[0][0]>ue[0][1]&&(ue=[]),ue}function j(){var W=[],ee,ue;return{set:function(xe){W=xe.map(function(ge){return ge.slice().sort(t)}).sort(m),W.length===1&&W[0][0]===-1/0&&W[0][1]===1/0&&(W=[[0,-1]]),ee=G(W),ue=W.reduce(function(ge,_e){return[Math.min(ge[0],_e[0]),Math.max(ge[1],_e[1])]},[1/0,-1/0])},get:function(){return W.slice()},getConsolidated:function(){return ee},getBounds:function(){return ue}}}function O(W,ee,ue,xe,ge,_e){var Y=j();return Y.set(ue),{filter:Y,filterSpecified:ee,svgBrush:{extent:[],brushStartCallback:xe,brushCallback:V(ge),brushEndCallback:_e}}}function H(W,ee){if(Array.isArray(W[0])?(W=W.map(function(xe){return xe.sort(t)}),ee.multiselect?W=G(W.sort(m)):W=[W[0]]):W=[W.sort(t)],ee.tickvals){var ue=ee.tickvals.slice().sort(t);if(W=W.map(function(xe){var ge=[o(0,ue,xe[0],[]),o(1,ue,xe[1],[])];if(ge[1]>ge[0])return ge}).filter(function(xe){return xe}),!W.length)return}return W.length>1?W:W[0]}K.exports={makeBrush:O,ensureAxisBrush:F,cleanRanges:H}}}),wZ=Re({"src/traces/parcoords/defaults.js"(ae,K){var v=Rn(),S=cp().hasColorscale,M=ed(),L=af().defaults,t=fp(),r=js(),a=HF(),l=WF(),i=YI().maxDimensionCount,s=jP();function o(p,d,y,g,C){var f=C("line.color",y);if(S(p,"line")&&v.isArrayOrTypedArray(f)){if(f.length)return C("line.colorscale"),M(p,d,g,C,{prefix:"line.",cLetter:"c"}),f.length;d.line.color=y}return 1/0}function c(p,d,y,g){function C(I,T){return v.coerce(p,d,a.dimensions,I,T)}var f=C("values"),x=C("visible");if(f&&f.length||(x=d.visible=!1),x){C("label"),C("tickvals"),C("ticktext"),C("tickformat");var A=C("range");d._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:A},r.setConvert(d._ax,g.layout),C("multiselect");var k=C("constraintrange");k&&(d.constraintrange=l.cleanRanges(k,d))}}K.exports=function(d,y,g,C){function f(T,E){return v.coerce(d,y,a,T,E)}var x=d.dimensions;Array.isArray(x)&&x.length>i&&(v.log("parcoords traces support up to "+i+" dimensions at the moment"),x.splice(i));var A=t(d,y,{name:"dimensions",layout:C,handleItemDefaults:c}),k=o(d,y,g,C,f);L(y,C,f),(!Array.isArray(A)||!A.length)&&(y.visible=!1),s(y,A,"values",k);var I=v.extendFlat({},C.font,{size:Math.round(C.font.size/1.2)});v.coerceFont(f,"labelfont",I),v.coerceFont(f,"tickfont",I,{autoShadowDflt:!0}),v.coerceFont(f,"rangefont",I),f("labelangle"),f("labelside"),f("unselected.line.color"),f("unselected.line.opacity")}}}),TZ=Re({"src/traces/parcoords/calc.js"(ae,K){var v=Rn().isArrayOrTypedArray,S=nf(),M=n_().wrap;K.exports=function(r,a){var l,i;return S.hasColorscale(a,"line")&&v(a.line.color)?(l=a.line.color,i=S.extractOpts(a.line).colorscale,S.calc(r,a,{vals:l,containerStr:"line",cLetter:"c"})):(l=L(a._length),i=[[0,a.line.color],[1,a.line.color]]),M({lineColor:l,cscale:i})};function L(t){for(var r=new Array(t),a=0;a>>16,(ae&65280)>>>8,ae&255],alpha:1};if(typeof ae=="number")return{space:"rgb",values:[ae>>>16,(ae&65280)>>>8,ae&255],alpha:1};if(ae=String(ae).toLowerCase(),GP.default[ae])M=GP.default[ae].slice(),t="rgb";else if(ae==="transparent")L=0,t="rgb",M=[0,0,0];else if(ae[0]==="#"){var r=ae.slice(1),a=r.length,l=a<=4;L=1,l?(M=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],a===4&&(L=parseInt(r[3]+r[3],16)/255)):(M=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],a===8&&(L=parseInt(r[6]+r[7],16)/255)),M[0]||(M[0]=0),M[1]||(M[1]=0),M[2]||(M[2]=0),t="rgb"}else if(S=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(ae)){var i=S[1];t=i.replace(/a$/,"");var s=t==="cmyk"?4:t==="gray"?1:3;M=S[2].trim().split(/\s*[,\/]\s*|\s+/),t==="color"&&(t=M.shift()),M=M.map(function(o,c){if(o[o.length-1]==="%")return o=parseFloat(o)/100,c===3?o:t==="rgb"?o*255:t[0]==="h"||t[0]==="l"&&!c?o*100:t==="lab"?o*125:t==="lch"?c<2?o*150:o*360:t[0]==="o"&&!c?o:t==="oklab"?o*.4:t==="oklch"?c<2?o*.4:o*360:o;if(t[c]==="h"||c===2&&t[t.length-1]==="h"){if(qP[o]!==void 0)return qP[o];if(o.endsWith("deg"))return parseFloat(o);if(o.endsWith("turn"))return parseFloat(o)*360;if(o.endsWith("grad"))return parseFloat(o)*360/400;if(o.endsWith("rad"))return parseFloat(o)*180/Math.PI}return o==="none"?0:parseFloat(o)}),L=M.length>s?M.pop():1}else/[0-9](?:\s|\/|,)/.test(ae)&&(M=ae.match(/([0-9]+)/g).map(function(o){return parseFloat(o)}),t=((v=(K=ae.match(/([a-z])/ig))==null?void 0:K.join(""))==null?void 0:v.toLowerCase())||"rgb");return{space:t,values:M,alpha:L}}var GP,XF,qP,SZ=jt({"node_modules/color-parse/index.js"(){GP=Gr(ZO()),XF=AZ,qP={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),ZI,YF=jt({"node_modules/color-space/rgb.js"(){ZI={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),KI,EZ=jt({"node_modules/color-space/hsl.js"(){YF(),KI={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(ae){var K=ae[0]/360,v=ae[1]/100,S=ae[2]/100,M,L,t,r,a,l=0;if(v===0)return a=S*255,[a,a,a];for(L=S<.5?S*(1+v):S+v-S*v,M=2*S-L,r=[0,0,0];l<3;)t=K+1/3*-(l-1),t<0?t++:t>1&&t--,a=6*t<1?M+(L-M)*6*t:2*t<1?L:3*t<2?M+(L-M)*(2/3-t)*6:M,r[l++]=a*255;return r}},ZI.hsl=function(ae){var K=ae[0]/255,v=ae[1]/255,S=ae[2]/255,M=Math.min(K,v,S),L=Math.max(K,v,S),t=L-M,r,a,l;return L===M?r=0:K===L?r=(v-S)/t:v===L?r=2+(S-K)/t:S===L&&(r=4+(K-v)/t),r=Math.min(r*60,360),r<0&&(r+=360),l=(M+L)/2,L===M?a=0:l<=.5?a=t/(L+M):a=t/(2-L-M),[r,a*100,l*100]}}}),ZF={};Lr(ZF,{default:()=>CZ});function CZ(ae){Array.isArray(ae)&&ae.raw&&(ae=String.raw(...arguments)),ae instanceof Number&&(ae=+ae);var K,v=XF(ae);if(!v.space)return[];const S=v.space[0]==="h"?KI.min:ZI.min,M=v.space[0]==="h"?KI.max:ZI.max;return K=Array(3),K[0]=Math.min(Math.max(v.values[0],S[0]),M[0]),K[1]=Math.min(Math.max(v.values[1],S[1]),M[1]),K[2]=Math.min(Math.max(v.values[2],S[2]),M[2]),v.space[0]==="h"&&(K=KI.rgb(K)),K.push(Math.min(Math.max(v.alpha,0),1)),K}var kZ=jt({"node_modules/color-rgba/index.js"(){SZ(),YF(),EZ()}}),KF=Re({"src/traces/parcoords/helpers.js"(ae){var K=Rn().isTypedArray;ae.convertTypedArray=function(v){return K(v)?Array.prototype.slice.call(v):v},ae.isOrdinal=function(v){return!!v.tickvals},ae.isVisible=function(v){return v.visible||!("visible"in v)}}}),MZ=Re({"src/traces/parcoords/lines.js"(ae,K){var v=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` +`),S=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` +`),M=YI().maxDimensionCount,L=Rn(),t=1e-6,r=2048,a=new Uint8Array(4),l=new Uint8Array(4),i={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function s(E){E.read({x:0,y:0,width:1,height:1,data:a})}function o(E,_,h,m,w){var F=E._gl;F.enable(F.SCISSOR_TEST),F.scissor(_,h,m,w),E.clear({color:[0,0,0,0],depth:1})}function c(E,_,h,m,w,F){var z=F.key;function U(V){var G=Math.min(m,w-V*m);V===0&&(window.cancelAnimationFrame(h.currentRafs[z]),delete h.currentRafs[z],o(E,F.scissorX,F.scissorY,F.scissorWidth,F.viewBoxSize[1])),!h.clearOnly&&(F.count=2*G,F.offset=2*V*m,_(F),V*m+G>>8*_)%256/255}function g(E,_,h){for(var m=new Array(E*(M+4)),w=0,F=0;FXe&&(Xe=le[Te].dim1.canvasX,$e=Te);pe===0&&o(w,0,0,G.canvasWidth,G.canvasHeight);var it=Y(h);for(Te=0;TeTe._length&&(ht=ht.slice(0,Te._length));var Ve=Te.tickvals,ze;function Se(Kt,Qt){return{val:Kt,text:ze[Qt]}}function Je(Kt,Qt){return Kt.val-Qt.val}if(M(Ve)&&Ve.length){S.isTypedArray(Ve)&&(Ve=Array.from(Ve)),ze=Te.ticktext,!M(ze)||!ze.length?ze=Ve.map(L(Te.tickformat)):ze.length>Ve.length?ze=ze.slice(0,Ve.length):Ve.length>ze.length&&(Ve=Ve.slice(0,ze.length));for(var _t=1;_t=Qt||Br>=fr)return;var fn=vt.lineLayer.readPixel(Ur,fr-1-Br),Fr=fn[3]!==0,Qr=Fr?fn[2]+256*(fn[1]+256*fn[0]):null,Bt={x:Ur,y:Br,clientX:Kt.clientX,clientY:Kt.clientY,dataIndex:vt.model.key,curveNumber:Qr};Qr!==$e&&(Fr?se.hover(Bt):se.unhover&&se.unhover(Bt),$e=Qr)}}),Ne.style("opacity",function(vt){return vt.pick?0:1}),ye.style("background","rgba(255, 255, 255, 0)");var Xe=ye.selectAll("."+C.cn.parcoords).data(Te,p);Xe.exit().remove(),Xe.enter().append("g").classed(C.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Xe.attr("transform",function(vt){return l(vt.model.translateX,vt.model.translateY)});var it=Xe.selectAll("."+C.cn.parcoordsControlView).data(d,p);it.enter().append("g").classed(C.cn.parcoordsControlView,!0),it.attr("transform",function(vt){return l(vt.model.pad.l,vt.model.pad.t)});var yt=it.selectAll("."+C.cn.yAxis).data(function(vt){return vt.dimensions},p);yt.enter().append("g").classed(C.cn.yAxis,!0),it.each(function(vt){H(yt,vt,Z)}),Ne.each(function(vt){if(vt.viewModel){!vt.lineLayer||se?vt.lineLayer=x(this,vt):vt.lineLayer.update(vt),(vt.key||vt.key===0)&&(vt.viewModel[vt.key]=vt.lineLayer);var Kt=!vt.context||se;vt.lineLayer.render(vt.viewModel.panels,Kt)}}),yt.attr("transform",function(vt){return l(vt.xScale(vt.xIndex),0)}),yt.call(v.behavior.drag().origin(function(vt){return vt}).on("drag",function(vt){var Kt=vt.parent;pe.linePickActive(!1),vt.x=Math.max(-C.overdrag,Math.min(vt.model.width+C.overdrag,v.event.x)),vt.canvasX=vt.x*vt.model.canvasPixelRatio,yt.sort(function(Qt,fr){return Qt.x-fr.x}).each(function(Qt,fr){Qt.xIndex=fr,Qt.x=vt===Qt?Qt.x:Qt.xScale(Qt.xIndex),Qt.canvasX=Qt.x*Qt.model.canvasPixelRatio}),H(yt,Kt,Z),yt.filter(function(Qt){return Math.abs(vt.xIndex-Qt.xIndex)!==0}).attr("transform",function(Qt){return l(Qt.xScale(Qt.xIndex),0)}),v.select(this).attr("transform",l(vt.x,0)),yt.each(function(Qt,fr,mr){mr===vt.parent.key&&(Kt.dimensions[fr]=Qt)}),Kt.contextLayer&&Kt.contextLayer.render(Kt.panels,!1,!z(Kt)),Kt.focusLayer.render&&Kt.focusLayer.render(Kt.panels)}).on("dragend",function(vt){var Kt=vt.parent;vt.x=vt.xScale(vt.xIndex),vt.canvasX=vt.x*vt.model.canvasPixelRatio,H(yt,Kt,Z),v.select(this).attr("transform",function(Qt){return l(Qt.x,0)}),Kt.contextLayer&&Kt.contextLayer.render(Kt.panels,!1,!z(Kt)),Kt.focusLayer&&Kt.focusLayer.render(Kt.panels),Kt.pickLayer&&Kt.pickLayer.render(Kt.panels,!0),pe.linePickActive(!0),se&&se.axesMoved&&se.axesMoved(Kt.key,Kt.dimensions.map(function(Qt){return Qt.crossfilterDimensionIndex}))})),yt.exit().remove();var bt=yt.selectAll("."+C.cn.axisOverlays).data(d,p);bt.enter().append("g").classed(C.cn.axisOverlays,!0),bt.selectAll("."+C.cn.axis).remove();var mt=bt.selectAll("."+C.cn.axis).data(d,p);mt.enter().append("g").classed(C.cn.axis,!0),mt.each(function(vt){var Kt=vt.model.height/vt.model.tickDistance,Qt=vt.domainScale,fr=Qt.domain();v.select(this).call(v.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Kt,vt.tickFormat).tickValues(vt.ordinal?fr:null).tickFormat(function(mr){return g.isOrdinal(vt)?mr:ee(vt.model.dimensions[vt.visibleIndex],mr)}).scale(Qt)),s.font(mt.selectAll("text"),vt.model.tickFont)}),mt.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),mt.selectAll("text").style("cursor","default");var ht=bt.selectAll("."+C.cn.axisHeading).data(d,p);ht.enter().append("g").classed(C.cn.axisHeading,!0);var Ve=ht.selectAll("."+C.cn.axisTitle).data(d,p);Ve.enter().append("text").classed(C.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",ce?"none":"auto"),Ve.text(function(vt){return vt.label}).each(function(vt){var Kt=v.select(this);s.font(Kt,vt.model.labelFont),i.convertToTspans(Kt,ge)}).attr("transform",function(vt){var Kt=O(vt.model.labelAngle,vt.model.labelSide),Qt=C.axisTitleOffset;return(Kt.dir>0?"":l(0,2*Qt+vt.model.height))+a(Kt.degrees)+l(-Qt*Kt.dx,-Qt*Kt.dy)}).attr("text-anchor",function(vt){var Kt=O(vt.model.labelAngle,vt.model.labelSide),Qt=Math.abs(Kt.dx),fr=Math.abs(Kt.dy);return 2*Qt>fr?Kt.dir*Kt.dx<0?"start":"end":"middle"});var ze=bt.selectAll("."+C.cn.axisExtent).data(d,p);ze.enter().append("g").classed(C.cn.axisExtent,!0);var Se=ze.selectAll("."+C.cn.axisExtentTop).data(d,p);Se.enter().append("g").classed(C.cn.axisExtentTop,!0),Se.attr("transform",l(0,-C.axisExtentOffset));var Je=Se.selectAll("."+C.cn.axisExtentTopText).data(d,p);Je.enter().append("text").classed(C.cn.axisExtentTopText,!0).call(G),Je.text(function(vt){return ue(vt,!0)}).each(function(vt){s.font(v.select(this),vt.model.rangeFont)});var _t=ze.selectAll("."+C.cn.axisExtentBottom).data(d,p);_t.enter().append("g").classed(C.cn.axisExtentBottom,!0),_t.attr("transform",function(vt){return l(0,vt.model.height+C.axisExtentOffset)});var At=_t.selectAll("."+C.cn.axisExtentBottomText).data(d,p);At.enter().append("text").classed(C.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(G),At.text(function(vt){return ue(vt,!1)}).each(function(vt){s.font(v.select(this),vt.model.rangeFont)}),f.ensureAxisBrush(bt,de,ge)}}}),JF=Re({"src/traces/parcoords/plot.js"(a,K){var v=IZ(),S=VP(),M=KF().isVisible,L={};function t(l,i,s){var o=i.indexOf(s),c=l.indexOf(o);return c===-1&&(c+=i.length),c}function r(l,i){return function(o,c){return t(l,i,o)-t(l,i,c)}}var a=K.exports=function(i,s){var o=i._fullLayout,c=S(i,[],L);if(c){var p={},d={},y={},g={},C=o._size;s.forEach(function(I,T){var E=I[0].trace;y[T]=E.index;var _=g[T]=E.index;p[T]=i.data[_].dimensions,d[T]=i.data[_].dimensions.slice()});var f=function(I,T,E){var _=d[I][T],h=E.map(function(V){return V.slice()}),m="dimensions["+T+"].constraintrange",w=o._tracePreGUI[i._fullData[y[I]]._fullInput.uid];if(w[m]===void 0){var F=_.constraintrange;w[m]=F||null}var z=i._fullData[y[I]].dimensions[T];h.length?(h.length===1&&(h=h[0]),_.constraintrange=h,z.constraintrange=h.slice(),h=[h]):(delete _.constraintrange,delete z.constraintrange,h=null);var U={};U[m]=h,i.emit("plotly_restyle",[U,[g[I]]])},x=function(I){i.emit("plotly_hover",I)},A=function(I){i.emit("plotly_unhover",I)},k=function(I,T){var E=r(T,d[I].filter(M));p[I].sort(E),d[I].filter(function(_){return!M(_)}).sort(function(_){return d[I].indexOf(_)}).forEach(function(_){p[I].splice(p[I].indexOf(_),1),p[I].splice(d[I].indexOf(_),0,_)}),i.emit("plotly_restyle",[{dimensions:[p[I]]},[g[I]]])};v(i,s,{width:C.w,height:C.h,margin:{t:C.t,r:C.r,b:C.b,l:C.l}},{filterChanged:f,hover:x,unhover:A,axesMoved:k})}};a.reglPrecompiled=L}}),LZ=Re({"src/traces/parcoords/base_plot.js"(ae){var K=un(),v=Lp().getModuleCalcData,S=JF(),M=jv();ae.name="parcoords",ae.plot=function(L){var t=v(L.calcdata,"parcoords")[0];t.length&&S(L,t)},ae.clean=function(L,t,r,a){var l=a._has&&a._has("parcoords"),i=t._has&&t._has("parcoords");l&&!i&&(a._paperdiv.selectAll(".parcoords").remove(),a._glimages.selectAll("*").remove())},ae.toSVG=function(L){var t=L._fullLayout._glimages,r=K.select(L).selectAll(".svg-container"),a=r.filter(function(i,s){return s===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function l(){var i=this,s=i.toDataURL("image/png"),o=t.append("svg:image");o.attr({xmlns:M.svg,"xlink:href":s,preserveAspectRatio:"none",x:0,y:0,width:i.style.width,height:i.style.height})}a.each(l),window.setTimeout(function(){K.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),RZ=Re({"src/traces/parcoords/base_index.js"(ae,K){K.exports={attributes:HF(),supplyDefaults:wZ(),calc:TZ(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:LZ(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),DZ=Re({"src/traces/parcoords/index.js"(ae,K){var v=RZ();v.plot=JF(),K.exports=v}}),PZ=Re({"lib/parcoords.js"(ae,K){K.exports=DZ()}}),QF=Re({"src/traces/parcats/attributes.js"(ae,K){var v=Li().extendFlat,S=As(),M=Do(),L=ac(),{hovertemplateAttrs:t,templatefallbackAttrs:r}=Wl(),a=af().attributes,l=v({editType:"calc"},L("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:t({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:r({editType:"plot"})});K.exports={domain:a({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:v({},S.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:t({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:r({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:M({editType:"calc"}),tickfont:M({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:l,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),zZ=Re({"src/traces/parcats/defaults.js"(ae,K){var v=Rn(),S=cp().hasColorscale,M=ed(),L=af().defaults,t=fp(),r=QF(),a=jP(),l=ai().isTypedArraySpec;function i(o,c,p,d,y){y("line.shape"),y("line.hovertemplate"),y("line.hovertemplatefallback");var g=y("line.color",d.colorway[0]);if(S(o,"line")&&v.isArrayOrTypedArray(g)){if(g.length)return y("line.colorscale"),M(o,c,d,y,{prefix:"line.",cLetter:"c"}),g.length;c.line.color=p}return 1/0}function s(o,c){function p(A,k){return v.coerce(o,c,r.dimensions,A,k)}var d=p("values"),y=p("visible");if(d&&d.length||(y=c.visible=!1),y){p("label"),p("displayindex",c._index);var g=o.categoryarray,C=v.isArrayOrTypedArray(g)&&g.length>0||l(g),f;C&&(f="array");var x=p("categoryorder",f);x==="array"?(p("categoryarray"),p("ticktext")):(delete o.categoryarray,delete o.ticktext),!C&&x==="array"&&(c.categoryorder="trace")}}K.exports=function(c,p,d,y){function g(A,k){return v.coerce(c,p,r,A,k)}var C=t(c,p,{name:"dimensions",handleItemDefaults:s}),f=i(c,p,d,y,g);L(p,y,g),(!Array.isArray(C)||!C.length)&&(p.visible=!1),a(p,C,"values",f),g("hoveron"),g("hovertemplate"),g("hovertemplatefallback"),g("arrangement"),g("bundlecolors"),g("sortpaths"),g("counts");var x=y.font;v.coerceFont(g,"labelfont",x,{overrideDflt:{size:Math.round(x.size)}}),v.coerceFont(g,"tickfont",x,{autoShadowDflt:!0,overrideDflt:{size:Math.round(x.size/1.2)}})}}}),NZ=Re({"src/traces/parcats/calc.js"(ae,K){var v=n_().wrap,S=cp().hasColorscale,M=hp(),L=Mb(),t=qs(),r=Rn(),a=da();K.exports=function(x,A){var k=r.filterVisible(A.dimensions);if(k.length===0)return[];var I=k.map(function(Y){var se;if(Y.categoryorder==="trace")se=null;else if(Y.categoryorder==="array")se=Y.categoryarray;else{se=L(Y.values);for(var ce=!0,ne=0;ne=f.length||x[f[A]]!==void 0)return!1;x[f[A]]=!0}return!0}}}),OZ=Re({"src/traces/parcats/parcats.js"(ae,K){var v=un(),S=(Lo(),yn(Xi)).interpolateNumber,M=s3(),L=Sh(),t=Rn(),r=t.strTranslate,a=qs(),l=oo(),i=kc();function s(ne,ye,le,Z){var de=ye._context.staticPlot,pe=ne.map(ge.bind(0,ye,le)),Te=Z.selectAll("g.parcatslayer").data([null]);Te.enter().append("g").attr("class","parcatslayer").style("pointer-events",de?"none":"all");var Ne=Te.selectAll("g.trace.parcats").data(pe,o),$e=Ne.enter().append("g").attr("class","trace parcats");Ne.attr("transform",function(Se){return r(Se.x,Se.y)}),$e.append("g").attr("class","paths");var Ze=Ne.select("g.paths"),Xe=Ze.selectAll("path.path").data(function(Se){return Se.paths},o);Xe.attr("fill",function(Se){return Se.model.color});var it=Xe.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(Se){return Se.model.color}).attr("fill-opacity",0);x(it),Xe.attr("d",function(Se){return Se.svgD}),it.empty()||Xe.sort(p),Xe.exit().remove(),Xe.on("mouseover",d).on("mouseout",y).on("click",f),$e.append("g").attr("class","dimensions");var yt=Ne.select("g.dimensions"),bt=yt.selectAll("g.dimension").data(function(Se){return Se.dimensions},o);bt.enter().append("g").attr("class","dimension"),bt.attr("transform",function(Se){return r(Se.x,0)}),bt.exit().remove();var mt=bt.selectAll("g.category").data(function(Se){return Se.categories},o),ht=mt.enter().append("g").attr("class","category");mt.attr("transform",function(Se){return r(0,Se.y)}),ht.append("rect").attr("class","catrect").attr("pointer-events","none"),mt.select("rect.catrect").attr("fill","none").attr("width",function(Se){return Se.width}).attr("height",function(Se){return Se.height}),I(ht);var Ve=mt.selectAll("rect.bandrect").data(function(Se){return Se.bands},o);Ve.each(function(){t.raiseToTop(this)}),Ve.attr("fill",function(Se){return Se.color});var ze=Ve.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(Se){return Se.color}).attr("fill-opacity",0);Ve.attr("fill",function(Se){return Se.color}).attr("width",function(Se){return Se.width}).attr("height",function(Se){return Se.height}).attr("y",function(Se){return Se.y}).attr("cursor",function(Se){return Se.parcatsViewModel.arrangement==="fixed"?"default":Se.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),E(ze),Ve.exit().remove(),ht.append("text").attr("class","catlabel").attr("pointer-events","none"),mt.select("text.catlabel").attr("text-anchor",function(Se){return c(Se)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(Se){return c(Se)?Se.width+5:-5}).attr("y",function(Se){return Se.height/2}).text(function(Se){return Se.model.categoryLabel}).each(function(Se){a.font(v.select(this),Se.parcatsViewModel.categorylabelfont),i.convertToTspans(v.select(this),ye)}),ht.append("text").attr("class","dimlabel"),mt.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(Se){return Se.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(Se){return Se.width/2}).attr("y",-5).text(function(Se,Je){return Je===0?Se.parcatsViewModel.model.dimensions[Se.model.dimensionInd].dimensionLabel:null}).each(function(Se){a.font(v.select(this),Se.parcatsViewModel.labelfont)}),mt.selectAll("rect.bandrect").on("mouseover",G).on("mouseout",j),mt.exit().remove(),bt.call(v.behavior.drag().origin(function(Se){return{x:Se.x,y:0}}).on("dragstart",O).on("drag",H).on("dragend",W)),Ne.each(function(Se){Se.traceSelection=v.select(this),Se.pathSelection=v.select(this).selectAll("g.paths").selectAll("path.path"),Se.dimensionSelection=v.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),Ne.exit().remove()}K.exports=function(ne,ye,le,Z){s(le,ne,Z,ye)};function o(ne){return ne.key}function c(ne){var ye=ne.parcatsViewModel.dimensions.length,le=ne.parcatsViewModel.dimensions[ye-1].model.dimensionInd;return ne.model.dimensionInd===le}function p(ne,ye){return ne.model.rawColor>ye.model.rawColor?1:ne.model.rawColor"),vt=v.mouse(de)[0];L.loneHover({trace:pe,x:mt-Ne.left+$e.left,y:ht-Ne.top+$e.top,text:At,color:ne.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Ve,idealAlign:vt1&&Ze.displayInd===$e.dimensions.length-1?(yt=Te.left,bt="left"):(yt=Te.left+Te.width,bt="right");var mt=Ne.model.count,ht=Ne.model.categoryLabel,Ve=mt/Ne.parcatsViewModel.model.count,ze={countLabel:mt,categoryLabel:ht,probabilityLabel:Ve.toFixed(3)},Se=[];Ne.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Se.push(["Count:",ze.countLabel].join(" ")),Ne.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&Se.push(["P("+ze.categoryLabel+"):",ze.probabilityLabel].join(" "));var Je=Se.join("
");return{trace:Xe,x:Z*(yt-ye.left),y:de*(it-ye.top),text:Je,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:bt,hovertemplate:Xe.hovertemplate,hovertemplateLabels:ze,eventData:[{data:Xe._input,fullData:Xe,count:mt,category:ht,probability:Ve}]}}function U(ne,ye,le){var Z=[];return v.select(le.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var de=this;Z.push(z(ne,ye,de))}),Z}function V(ne,ye,le){ne._fullLayout._calcInverseTransform(ne);var Z=ne._fullLayout._invScaleX,de=ne._fullLayout._invScaleY,pe=le.getBoundingClientRect(),Te=v.select(le).datum(),Ne=Te.categoryViewModel,$e=Ne.parcatsViewModel,Ze=$e.model.dimensions[Ne.model.dimensionInd],Xe=$e.trace,it=pe.y+pe.height/2,yt,bt;$e.dimensions.length>1&&Ze.displayInd===$e.dimensions.length-1?(yt=pe.left,bt="left"):(yt=pe.left+pe.width,bt="right");var mt=Ne.model.categoryLabel,ht=Te.parcatsViewModel.model.count,Ve=0;Te.categoryViewModel.bands.forEach(function(mr){mr.color===Te.color&&(Ve+=mr.count)});var ze=Ne.model.count,Se=0;$e.pathSelection.each(function(mr){mr.model.color===Te.color&&(Se+=mr.model.count)});var Je=Ve/ht,_t=Ve/Se,At=Ve/ze,vt={countLabel:Ve,categoryLabel:mt,probabilityLabel:Je.toFixed(3)},Kt=[];Ne.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Kt.push(["Count:",vt.countLabel].join(" ")),Ne.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Kt.push("P(color ∩ "+mt+"): "+vt.probabilityLabel),Kt.push("P("+mt+" | color): "+_t.toFixed(3)),Kt.push("P(color | "+mt+"): "+At.toFixed(3)));var Qt=Kt.join("
"),fr=l.mostReadable(Te.color,["black","white"]);return{trace:Xe,x:Z*(yt-ye.left),y:de*(it-ye.top),text:Qt,color:Te.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:fr,fontSize:10,idealAlign:bt,hovertemplate:Xe.hovertemplate,hovertemplateLabels:vt,eventData:[{data:Xe._input,fullData:Xe,category:mt,count:ht,probability:Je,categorycount:ze,colorcount:Se,bandcolorcount:Ve}]}}function G(ne){if(!ne.parcatsViewModel.dragDimension&&ne.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var ye=v.mouse(this)[1];if(ye<-1)return;var le=ne.parcatsViewModel.graphDiv,Z=le._fullLayout,de=Z._paperdiv.node().getBoundingClientRect(),pe=ne.parcatsViewModel.hoveron,Te=this;if(pe==="color"?(m(Te),F(Te,"plotly_hover",v.event)):(h(Te),w(Te,"plotly_hover",v.event)),ne.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Ne;pe==="category"?Ne=z(le,de,Te):pe==="color"?Ne=V(le,de,Te):pe==="dimension"&&(Ne=U(le,de,Te)),Ne&&L.loneHover(Ne,{container:Z._hoverlayer.node(),outerContainer:Z._paper.node(),gd:le})}}}function j(ne){var ye=ne.parcatsViewModel;if(!ye.dragDimension&&(x(ye.pathSelection),I(ye.dimensionSelection.selectAll("g.category")),E(ye.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),L.loneUnhover(ye.graphDiv._fullLayout._hoverlayer.node()),ye.pathSelection.sort(p),ye.hoverinfoItems.indexOf("skip")===-1)){var le=ne.parcatsViewModel.hoveron,Z=this;le==="color"?F(Z,"plotly_unhover",v.event):w(Z,"plotly_unhover",v.event)}}function O(ne){ne.parcatsViewModel.arrangement!=="fixed"&&(ne.dragDimensionDisplayInd=ne.model.displayInd,ne.initialDragDimensionDisplayInds=ne.parcatsViewModel.model.dimensions.map(function(ye){return ye.displayInd}),ne.dragHasMoved=!1,ne.dragCategoryDisplayInd=null,v.select(this).selectAll("g.category").select("rect.catrect").each(function(ye){var le=v.mouse(this)[0],Z=v.mouse(this)[1];-2<=le&&le<=ye.width+2&&-2<=Z&&Z<=ye.height+2&&(ne.dragCategoryDisplayInd=ye.model.displayInd,ne.initialDragCategoryDisplayInds=ne.model.categories.map(function(de){return de.displayInd}),ye.model.dragY=ye.y,t.raiseToTop(this.parentNode),v.select(this.parentNode).selectAll("rect.bandrect").each(function(de){de.yXe.y+Xe.height/2&&(pe.model.displayInd=Xe.model.displayInd,Xe.model.displayInd=Ne),ne.dragCategoryDisplayInd=pe.model.displayInd}if(ne.dragCategoryDisplayInd===null||ne.parcatsViewModel.arrangement==="freeform"){de.model.dragX=v.event.x;var it=ne.parcatsViewModel.dimensions[le],yt=ne.parcatsViewModel.dimensions[Z];it!==void 0&&de.model.dragXyt.x&&(de.model.displayInd=yt.model.displayInd,yt.model.displayInd=ne.dragDimensionDisplayInd),ne.dragDimensionDisplayInd=de.model.displayInd}se(ne.parcatsViewModel),Y(ne.parcatsViewModel),xe(ne.parcatsViewModel),ue(ne.parcatsViewModel)}}function W(ne){if(ne.parcatsViewModel.arrangement!=="fixed"&&ne.dragDimensionDisplayInd!==null){v.select(this).selectAll("text").attr("font-weight","normal");var ye={},le=ee(ne.parcatsViewModel),Z=ne.parcatsViewModel.model.dimensions.map(function(yt){return yt.displayInd}),de=ne.initialDragDimensionDisplayInds.some(function(yt,bt){return yt!==Z[bt]});de&&Z.forEach(function(yt,bt){var mt=ne.parcatsViewModel.model.dimensions[bt].containerInd;ye["dimensions["+mt+"].displayindex"]=yt});var pe=!1;if(ne.dragCategoryDisplayInd!==null){var Te=ne.model.categories.map(function(yt){return yt.displayInd});if(pe=ne.initialDragCategoryDisplayInds.some(function(yt,bt){return yt!==Te[bt]}),pe){var Ne=ne.model.categories.slice().sort(function(yt,bt){return yt.displayInd-bt.displayInd}),$e=Ne.map(function(yt){return yt.categoryValue}),Ze=Ne.map(function(yt){return yt.categoryLabel});ye["dimensions["+ne.model.containerInd+"].categoryarray"]=[$e],ye["dimensions["+ne.model.containerInd+"].ticktext"]=[Ze],ye["dimensions["+ne.model.containerInd+"].categoryorder"]="array"}}if(ne.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!ne.dragHasMoved&&ne.potentialClickBand&&(ne.parcatsViewModel.hoveron==="color"?F(ne.potentialClickBand,"plotly_click",v.event.sourceEvent):w(ne.potentialClickBand,"plotly_click",v.event.sourceEvent)),ne.model.dragX=null,ne.dragCategoryDisplayInd!==null){var Xe=ne.parcatsViewModel.dimensions[ne.dragDimensionDisplayInd].categories[ne.dragCategoryDisplayInd];Xe.model.dragY=null,ne.dragCategoryDisplayInd=null}ne.dragDimensionDisplayInd=null,ne.parcatsViewModel.dragDimension=null,ne.dragHasMoved=null,ne.potentialClickBand=null,se(ne.parcatsViewModel),Y(ne.parcatsViewModel);var it=v.transition().duration(300).ease("cubic-in-out");it.each(function(){xe(ne.parcatsViewModel,!0),ue(ne.parcatsViewModel,!0)}).each("end",function(){(de||pe)&&M.restyle(ne.parcatsViewModel.graphDiv,ye,[le])})}}function ee(ne){for(var ye,le=ne.graphDiv._fullData,Z=0;Z=0;$e--)Ze+="C"+Te[$e]+","+(ye[$e+1]+Z)+" "+pe[$e]+","+(ye[$e]+Z)+" "+(ne[$e]+le[$e])+","+(ye[$e]+Z),Ze+="l-"+le[$e]+",0 ";return Ze+="Z",Ze}function Y(ne){var ye=ne.dimensions,le=ne.model,Z=ye.map(function(fn){return fn.categories.map(function(Fr){return Fr.y})}),de=ne.model.dimensions.map(function(fn){return fn.categories.map(function(Fr){return Fr.displayInd})}),pe=ne.model.dimensions.map(function(fn){return fn.displayInd}),Te=ne.dimensions.map(function(fn){return fn.model.dimensionInd}),Ne=ye.map(function(fn){return fn.x}),$e=ye.map(function(fn){return fn.width}),Ze=[];for(var Xe in le.paths)le.paths.hasOwnProperty(Xe)&&Ze.push(le.paths[Xe]);function it(fn){var Fr=fn.categoryInds.map(function(Bt,et){return de[et][Bt]}),Qr=Te.map(function(Bt){return Fr[Bt]});return Qr}Ze.sort(function(fn,Fr){var Qr=it(fn),Bt=it(Fr);return ne.sortpaths==="backward"&&(Qr.reverse(),Bt.reverse()),Qr.push(fn.valueInds[0]),Bt.push(Fr.valueInds[0]),ne.bundlecolors&&(Qr.unshift(fn.rawColor),Bt.unshift(Fr.rawColor)),QrBt?1:0});for(var yt=new Array(Ze.length),bt=ye[0].model.count,mt=ye[0].categories.map(function(fn){return fn.height}).reduce(function(fn,Fr){return fn+Fr}),ht=0;ht0?ze=mt*(Ve.count/bt):ze=0;for(var Se=new Array(Z.length),Je=0;Je1?Te=(ne.width-2*le-Z)/(de-1):Te=0,Ne=le,$e=Ne+Te*pe;var Ze=[],Xe=ne.model.maxCats,it=ye.categories.length,yt=8,bt=ye.count,mt=ne.height-yt*(Xe-1),ht,Ve,ze,Se,Je,_t=(Xe-it)*yt/2,At=ye.categories.map(function(vt){return{displayInd:vt.displayInd,categoryInd:vt.categoryInd}});for(At.sort(function(vt,Kt){return vt.displayInd-Kt.displayInd}),Je=0;Je0?ht=Ve.count/bt*mt:ht=0,ze={key:Ve.valueInds[0],model:Ve,width:Z,height:ht,y:Ve.dragY!==null?Ve.dragY:_t,bands:[],parcatsViewModel:ne},_t=_t+ht+yt,Ze.push(ze);return{key:ye.dimensionInd,x:ye.dragX!==null?ye.dragX:$e,y:0,width:Z,model:ye,categories:Ze,parcatsViewModel:ne,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),e7=Re({"src/traces/parcats/plot.js"(ae,K){var v=OZ();K.exports=function(M,L,t,r){var a=M._fullLayout,l=a._paper,i=a._size;v(M,l,L,{width:i.w,height:i.h,margin:{t:i.t,r:i.r,b:i.b,l:i.l}},t,r)}}}),FZ=Re({"src/traces/parcats/base_plot.js"(ae){var K=Lp().getModuleCalcData,v=e7(),S="parcats";ae.name=S,ae.plot=function(M,L,t,r){var a=K(M.calcdata,S);if(a.length){var l=a[0];v(M,l,t,r)}},ae.clean=function(M,L,t,r){var a=r._has&&r._has("parcats"),l=L._has&&L._has("parcats");a&&!l&&r._paperdiv.selectAll(".parcats").remove()}}}),BZ=Re({"src/traces/parcats/index.js"(ae,K){K.exports={attributes:QF(),supplyDefaults:zZ(),calc:NZ(),plot:e7(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:FZ(),categories:["noOpacity"],meta:{}}}}),UZ=Re({"lib/parcats.js"(ae,K){K.exports=BZ()}}),Ix=Re({"src/plots/mapbox/constants.js"(ae,K){var v=hg(),S="1.13.4",M='©
OpenStreetMap contributors',L=['© Carto',M].join(" "),t=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),r=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),a={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:M,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:L,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:L,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:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],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:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],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:r,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],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"}},l=v(a);K.exports={requiredVersion:S,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:a,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+S+"."].join(` +`),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(` +`),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(` +`),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(` +`),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')`}}}}),JI=Re({"src/plots/mapbox/layout_attributes.js"(ae,K){var v=Rn(),S=ko().defaultLine,M=af().attributes,L=Do(),t=wf().textposition,r=bf().overrideAll,a=Bu().templatedArray,l=Ix(),i=L({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});i.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var s=K.exports=r({_arrayAttrRegexps:[v.counterRegex("mapbox",".layers",!0)],domain:M({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:l.styleValuesMapbox.concat(l.styleValuesNonMapbox),dflt:l.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:a("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:S},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:S}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:i,textposition:v.extendFlat({},t,{arrayOk:!1})}})},"plot","from-root");s.uirevision={valType:"any",editType:"none"}}}),HP=Re({"src/traces/scattermapbox/attributes.js"(ae,K){var{hovertemplateAttrs:v,texttemplateAttrs:S,templatefallbackAttrs:M}=Wl(),L=hv(),t=PT(),r=wf(),a=JI(),l=As(),i=ac(),s=Li().extendFlat,o=bf().overrideAll,c=JI(),p=t.line,d=t.marker;K.exports=o({lon:t.lon,lat:t.lat,cluster:{enabled:{valType:"boolean"},maxzoom:s({},c.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:s({},d.opacity,{dflt:1})},mode:s({},r.mode,{dflt:"markers"}),text:s({},r.text,{}),texttemplate:S({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:M({editType:"plot"}),hovertext:s({},r.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:r.connectgaps,marker:s({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},i("marker")),fill:t.fill,fillcolor:L(),textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,below:{valType:"string"},selected:{marker:r.selected.marker},unselected:{marker:r.unselected.marker},hoverinfo:s({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:v(),hovertemplatefallback:M()},"calc","nested")}}),t7=Re({"src/traces/scattermapbox/constants.js"(ae,K){var v=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];K.exports={isSupportedFont:function(S){return v.indexOf(S)!==-1}}}}),$Z=Re({"src/traces/scattermapbox/defaults.js"(ae,K){var v=Rn(),S=Mu(),M=Yp(),L=xg(),t=Sm(),r=Rp(),a=HP(),l=t7().isSupportedFont;K.exports=function(o,c,p,d){function y(m,w){return v.coerce(o,c,a,m,w)}function g(m,w){return v.coerce2(o,c,a,m,w)}var C=i(o,c,y);if(!C){c.visible=!1;return}if(y("text"),y("texttemplate"),y("texttemplatefallback"),y("hovertext"),y("hovertemplate"),y("hovertemplatefallback"),y("mode"),y("below"),S.hasMarkers(c)){M(o,c,p,d,y,{noLine:!0,noAngle:!0}),y("marker.allowoverlap"),y("marker.angle");var f=c.marker;f.symbol!=="circle"&&(v.isArrayOrTypedArray(f.size)&&(f.size=f.size[0]),v.isArrayOrTypedArray(f.color)&&(f.color=f.color[0]))}S.hasLines(c)&&(L(o,c,p,d,y,{noDash:!0}),y("connectgaps"));var x=g("cluster.maxzoom"),A=g("cluster.step"),k=g("cluster.color",c.marker&&c.marker.color||p),I=g("cluster.size"),T=g("cluster.opacity"),E=x!==!1||A!==!1||k!==!1||I!==!1||T!==!1,_=y("cluster.enabled",E);if(_||S.hasText(c)){var h=d.font.family;t(o,c,d,y,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(h)?h:"Open Sans Regular",weight:d.font.weight,style:d.font.style,size:d.font.size,color:d.font.color}})}y("fill"),c.fill!=="none"&&r(o,c,p,y),v.coerceSelectionMarkerOpacity(c,y)};function i(s,o,c){var p=c("lon")||[],d=c("lat")||[],y=Math.min(p.length,d.length);return o._length=y,y}}}),r7=Re({"src/traces/scattermapbox/format_labels.js"(ae,K){var v=js();K.exports=function(M,L,t){var r={},a=t[L.subplot]._subplot,l=a.mockAxis,i=M.lonlat;return r.lonLabel=v.tickText(l,l.c2l(i[0]),!0).text,r.latLabel=v.tickText(l,l.c2l(i[1]),!0).text,r}}}),n7=Re({"src/plots/mapbox/convert_text_opts.js"(ae,K){var v=Rn();K.exports=function(M,L){var t=M.split(" "),r=t[0],a=t[1],l=v.isArrayOrTypedArray(L)?v.mean(L):L,i=.5+l/100,s=1.5+l/100,o=["",""],c=[0,0];switch(r){case"top":o[0]="top",c[1]=-s;break;case"bottom":o[0]="bottom",c[1]=s;break}switch(a){case"left":o[1]="right",c[0]=-i;break;case"right":o[1]="left",c[0]=i;break}var p;return o[0]&&o[1]?p=o.join("-"):o[0]?p=o[0]:o[1]?p=o[1]:p="center",{anchor:p,offset:c}}}}),VZ=Re({"src/traces/scattermapbox/convert.js"(ae,K){var v=da(),S=Rn(),M=Ia().BADNUM,L=Vw(),t=nf(),r=qs(),a=pg(),l=Mu(),i=t7().isSupportedFont,s=n7(),o=Xp().appendArrayPointValue,c=kc().NEWLINES,p=kc().BR_TAG_ALL;K.exports=function(T,E){var _=E[0].trace,h=_.visible===!0&&_._length!==0,m=_.fill!=="none",w=l.hasLines(_),F=l.hasMarkers(_),z=l.hasText(_),U=F&&_.marker.symbol==="circle",V=F&&_.marker.symbol!=="circle",G=_.cluster&&_.cluster.enabled,j=d("fill"),O=d("line"),H=d("circle"),W=d("symbol"),ee={fill:j,line:O,circle:H,symbol:W};if(!h)return ee;var ue;if((m||w)&&(ue=L.calcTraceToLineCoords(E)),m&&(j.geojson=L.makePolygon(ue),j.layout.visibility="visible",S.extendFlat(j.paint,{"fill-color":_.fillcolor})),w&&(O.geojson=L.makeLine(ue),O.layout.visibility="visible",S.extendFlat(O.paint,{"line-width":_.line.width,"line-color":_.line.color,"line-opacity":_.opacity})),U){var xe=y(E);H.geojson=xe.geojson,H.layout.visibility="visible",G&&(H.filter=["!",["has","point_count"]],ee.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":A(_.cluster.color,_.cluster.step),"circle-radius":A(_.cluster.size,_.cluster.step),"circle-opacity":A(_.cluster.opacity,_.cluster.step)}},ee.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":k(_),"text-size":12}}),S.extendFlat(H.paint,{"circle-color":xe.mcc,"circle-radius":xe.mrc,"circle-opacity":xe.mo})}if(U&&G&&(H.filter=["!",["has","point_count"]]),(V||z)&&(W.geojson=g(E,T),S.extendFlat(W.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),V&&(S.extendFlat(W.layout,{"icon-size":_.marker.size/10}),"angle"in _.marker&&_.marker.angle!=="auto"&&S.extendFlat(W.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),W.layout["icon-allow-overlap"]=_.marker.allowoverlap,S.extendFlat(W.paint,{"icon-opacity":_.opacity*_.marker.opacity,"icon-color":_.marker.color})),z)){var ge=(_.marker||{}).size,_e=s(_.textposition,ge);S.extendFlat(W.layout,{"text-size":_.textfont.size,"text-anchor":_e.anchor,"text-offset":_e.offset,"text-font":k(_)}),S.extendFlat(W.paint,{"text-color":_.textfont.color,"text-opacity":_.opacity})}return ee};function d(I){return{type:I,geojson:L.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function y(I){var T=I[0].trace,E=T.marker,_=T.selectedpoints,h=S.isArrayOrTypedArray(E.color),m=S.isArrayOrTypedArray(E.size),w=S.isArrayOrTypedArray(E.opacity),F;function z(ge){return T.opacity*ge}function U(ge){return ge/2}var V;h&&(t.hasColorscale(T,"marker")?V=t.makeColorScaleFuncFromTrace(E):V=S.identity);var G;m&&(G=a(T));var j;w&&(j=function(ge){var _e=v(ge)?+S.constrain(ge,0,1):0;return z(_e)});var O=[];for(F=0;F850?F+=" Black":h>750?F+=" Extra Bold":h>650?F+=" Bold":h>550?F+=" Semi Bold":h>450?F+=" Medium":h>350?F+=" Regular":h>250?F+=" Light":h>150?F+=" Extra Light":F+=" Thin"):m.slice(0,2).join(" ")==="Open Sans"?(F="Open Sans",h>750?F+=" Extrabold":h>650?F+=" Bold":h>550?F+=" Semibold":h>350?F+=" Regular":F+=" Light"):m.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(F="Klokantech Noto Sans",m[3]==="CJK"&&(F+=" CJK"),F+=h>500?" Bold":" Regular")),w&&(F+=" Italic"),F==="Open Sans Regular Italic"?F="Open Sans Italic":F==="Open Sans Regular Bold"?F="Open Sans Bold":F==="Open Sans Regular Bold Italic"?F="Open Sans Bold Italic":F==="Klokantech Noto Sans Regular Italic"&&(F="Klokantech Noto Sans Italic"),i(F)||(F=E);var z=F.split(", ");return z}}}),jZ=Re({"src/traces/scattermapbox/plot.js"(ae,K){var v=Rn(),S=VZ(),M=Ix().traceLayerPrefix,L={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function t(a,l,i,s){this.type="scattermapbox",this.subplot=a,this.uid=l,this.clusterEnabled=i,this.isHidden=s,this.sourceIds={fill:"source-"+l+"-fill",line:"source-"+l+"-line",circle:"source-"+l+"-circle",symbol:"source-"+l+"-symbol",cluster:"source-"+l+"-circle",clusterCount:"source-"+l+"-circle"},this.layerIds={fill:M+l+"-fill",line:M+l+"-line",circle:M+l+"-circle",symbol:M+l+"-symbol",cluster:M+l+"-cluster",clusterCount:M+l+"-cluster-count"},this.below=null}var r=t.prototype;r.addSource=function(a,l,i){var s={type:"geojson",data:l.geojson};i&&i.enabled&&v.extendFlat(s,{cluster:!0,clusterMaxZoom:i.maxzoom});var o=this.subplot.map.getSource(this.sourceIds[a]);o?o.setData(l.geojson):this.subplot.map.addSource(this.sourceIds[a],s)},r.setSourceData=function(a,l){this.subplot.map.getSource(this.sourceIds[a]).setData(l.geojson)},r.addLayer=function(a,l,i){var s={type:l.type,id:this.layerIds[a],source:this.sourceIds[a],layout:l.layout,paint:l.paint};l.filter&&(s.filter=l.filter);for(var o=this.layerIds[a],c,p=this.subplot.getMapLayers(),d=0;d=0;w--){var F=m[w];o.removeLayer(g.layerIds[F])}h||o.removeSource(g.sourceIds.circle)}function x(h){for(var m=L.nonCluster,w=0;w=0;w--){var F=m[w];o.removeLayer(g.layerIds[F]),h||o.removeSource(g.sourceIds[F])}}function k(h){y?f(h):A(h)}function I(h){d?C(h):x(h)}function T(){for(var h=d?L.cluster:L.nonCluster,m=0;m=0;s--){var o=i[s];l.removeLayer(this.layerIds[o]),l.removeSource(this.sourceIds[o])}},K.exports=function(l,i){var s=i[0].trace,o=s.cluster&&s.cluster.enabled,c=s.visible!==!0,p=new t(l,s.uid,o,c),d=S(l.gd,i),y=p.below=l.belowLookup["trace-"+s.uid],g,C,f;if(o)for(p.addSource("circle",d.circle,s.cluster),g=0;g=0?Math.floor((s+180)/360):Math.ceil((s-180)/360),I=k*360,T=s-I;function E(G){var j=G.lonlat;if(j[0]===t||x&&C.indexOf(G.i+1)===-1)return 1/0;var O=S.modHalf(j[0],360),H=j[1],W=g.project([O,H]),ee=W.x-d.c2p([T,H]),ue=W.y-y.c2p([O,o]),xe=Math.max(3,G.mrc||0);return Math.max(Math.sqrt(ee*ee+ue*ue)-xe,1-3/xe)}if(v.getClosest(c,E,i),i.index!==!1){var _=c[i.index],h=_.lonlat,m=[S.modHalf(h[0],360)+I,h[1]],w=d.c2p(m),F=y.c2p(m),z=_.mrc||1;i.x0=w-z,i.x1=w+z,i.y0=F-z,i.y1=F+z;var U={};U[p.subplot]={_subplot:g};var V=p._module.formatLabels(_,p,U);return i.lonLabel=V.lonLabel,i.latLabel=V.latLabel,i.color=M(p,_),i.extraText=l(p,_,c[0].t.labels),i.hovertemplate=p.hovertemplate,[i]}}function l(i,s,o){if(i.hovertemplate)return;var c=s.hi||i.hoverinfo,p=c.split("+"),d=p.indexOf("all")!==-1,y=p.indexOf("lon")!==-1,g=p.indexOf("lat")!==-1,C=s.lonlat,f=[];function x(A){return A+"°"}return d||y&&g?f.push("("+x(C[1])+", "+x(C[0])+")"):y?f.push(o.lon+x(C[0])):g&&f.push(o.lat+x(C[1])),(d||p.indexOf("text")!==-1)&&L(s,i,f),f.join("
")}K.exports={hoverPoints:a,getExtraText:l}}}),GZ=Re({"src/traces/scattermapbox/event_data.js"(ae,K){K.exports=function(S,M){return S.lon=M.lon,S.lat=M.lat,S}}}),qZ=Re({"src/traces/scattermapbox/select.js"(ae,K){var v=Rn(),S=Mu(),M=Ia().BADNUM;K.exports=function(t,r){var a=t.cd,l=t.xaxis,i=t.yaxis,s=[],o=a[0].trace,c;if(!S.hasMarkers(o))return[];if(r===!1)for(c=0;c"u"&&(P=1e-6);var J,me,De,He,nt;for(De=D,nt=0;nt<8;nt++){if(He=this.sampleCurveX(De)-D,Math.abs(He)me)return me;for(;JHe?J=De:me=De,De=(me-J)*.5+J}return De},i.prototype.solve=function(D,P){return this.sampleCurveY(this.solveCurveX(D,P))};var s=o;function o(D,P){this.x=D,this.y=P}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(D){return this.clone()._add(D)},sub:function(D){return this.clone()._sub(D)},multByPoint:function(D){return this.clone()._multByPoint(D)},divByPoint:function(D){return this.clone()._divByPoint(D)},mult:function(D){return this.clone()._mult(D)},div:function(D){return this.clone()._div(D)},rotate:function(D){return this.clone()._rotate(D)},rotateAround:function(D,P){return this.clone()._rotateAround(D,P)},matMult:function(D){return this.clone()._matMult(D)},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(D){return this.x===D.x&&this.y===D.y},dist:function(D){return Math.sqrt(this.distSqr(D))},distSqr:function(D){var P=D.x-this.x,J=D.y-this.y;return P*P+J*J},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(D){return Math.atan2(this.y-D.y,this.x-D.x)},angleWith:function(D){return this.angleWithSep(D.x,D.y)},angleWithSep:function(D,P){return Math.atan2(this.x*P-this.y*D,this.x*D+this.y*P)},_matMult:function(D){var P=D[0]*this.x+D[1]*this.y,J=D[2]*this.x+D[3]*this.y;return this.x=P,this.y=J,this},_add:function(D){return this.x+=D.x,this.y+=D.y,this},_sub:function(D){return this.x-=D.x,this.y-=D.y,this},_mult:function(D){return this.x*=D,this.y*=D,this},_div:function(D){return this.x/=D,this.y/=D,this},_multByPoint:function(D){return this.x*=D.x,this.y*=D.y,this},_divByPoint:function(D){return this.x/=D.x,this.y/=D.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var D=this.y;return this.y=this.x,this.x=-D,this},_rotate:function(D){var P=Math.cos(D),J=Math.sin(D),me=P*this.x-J*this.y,De=J*this.x+P*this.y;return this.x=me,this.y=De,this},_rotateAround:function(D,P){var J=Math.cos(D),me=Math.sin(D),De=P.x+J*(this.x-P.x)-me*(this.y-P.y),He=P.y+me*(this.x-P.x)+J*(this.y-P.y);return this.x=De,this.y=He,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(D){return D instanceof o?D:Array.isArray(D)?new o(D[0],D[1]):D};var c=typeof self<"u"?self:{};function p(D,P){if(Array.isArray(D)){if(!Array.isArray(P)||D.length!==P.length)return!1;for(var J=0;J=1)return 1;var P=D*D,J=P*D;return 4*(D<.5?J:3*(D-P)+J-.75)}function g(D,P,J,me){var De=new l(D,P,J,me);return function(He){return De.solve(He)}}var C=g(.25,.1,.25,1);function f(D,P,J){return Math.min(J,Math.max(P,D))}function x(D,P,J){var me=J-P,De=((D-P)%me+me)%me+P;return De===P?J:De}function A(D,P,J){if(!D.length)return J(null,[]);var me=D.length,De=new Array(D.length),He=null;D.forEach(function(nt,Mt){P(nt,function(tr,vr){tr&&(He=tr),De[Mt]=vr,--me===0&&J(He,De)})})}function k(D){var P=[];for(var J in D)P.push(D[J]);return P}function I(D,P){var J=[];for(var me in D)me in P||J.push(me);return J}function T(D){for(var P=[],J=arguments.length-1;J-- >0;)P[J]=arguments[J+1];for(var me=0,De=P;me>P/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,D)}return D()}function w(D){return D<=1?1:Math.pow(2,Math.ceil(Math.log(D)/Math.LN2))}function F(D){return D?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(D):!1}function z(D,P){D.forEach(function(J){P[J]&&(P[J]=P[J].bind(P))})}function U(D,P){return D.indexOf(P,D.length-P.length)!==-1}function V(D,P,J){var me={};for(var De in D)me[De]=P.call(J||this,D[De],De,D);return me}function G(D,P,J){var me={};for(var De in D)P.call(J||this,D[De],De,D)&&(me[De]=D[De]);return me}function j(D){return Array.isArray(D)?D.map(j):typeof D=="object"&&D?V(D,j):D}function O(D,P){for(var J=0;J=0)return!0;return!1}var H={};function W(D){H[D]||(typeof console<"u"&&console.warn(D),H[D]=!0)}function ee(D,P,J){return(J.y-D.y)*(P.x-D.x)>(P.y-D.y)*(J.x-D.x)}function ue(D){for(var P=0,J=0,me=D.length,De=me-1,He=void 0,nt=void 0;J@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,J={};if(D.replace(P,function(De,He,nt,Mt){var tr=nt||Mt;return J[He]=tr?tr.toLowerCase():!0,""}),J["max-age"]){var me=parseInt(J["max-age"],10);isNaN(me)?delete J["max-age"]:J["max-age"]=me}return J}var Y=null;function se(D){if(Y==null){var P=D.navigator?D.navigator.userAgent:null;Y=!!D.safari||!!(P&&(/\b(iPad|iPhone|iPod)\b/.test(P)||P.match("Safari")&&!P.match("Chrome")))}return Y}function ce(D){try{var P=c[D];return P.setItem("_mapbox_test_",1),P.removeItem("_mapbox_test_"),!0}catch{return!1}}function ne(D){return c.btoa(encodeURIComponent(D).replace(/%([0-9A-F]{2})/g,function(P,J){return String.fromCharCode(+("0x"+J))}))}function ye(D){return decodeURIComponent(c.atob(D).split("").map(function(P){return"%"+("00"+P.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var le=c.performance&&c.performance.now?c.performance.now.bind(c.performance):Date.now.bind(Date),Z=c.requestAnimationFrame||c.mozRequestAnimationFrame||c.webkitRequestAnimationFrame||c.msRequestAnimationFrame,de=c.cancelAnimationFrame||c.mozCancelAnimationFrame||c.webkitCancelAnimationFrame||c.msCancelAnimationFrame,pe,Te,Ne={now:le,frame:function(P){var J=Z(P);return{cancel:function(){return de(J)}}},getImageData:function(P,J){J===void 0&&(J=0);var me=c.document.createElement("canvas"),De=me.getContext("2d");if(!De)throw new Error("failed to create canvas 2d context");return me.width=P.width,me.height=P.height,De.drawImage(P,0,0,P.width,P.height),De.getImageData(-J,-J,P.width+2*J,P.height+2*J)},resolveURL:function(P){return pe||(pe=c.document.createElement("a")),pe.href=P,pe.href},hardwareConcurrency:c.navigator&&c.navigator.hardwareConcurrency||4,get devicePixelRatio(){return c.devicePixelRatio},get prefersReducedMotion(){return c.matchMedia?(Te==null&&(Te=c.matchMedia("(prefers-reduced-motion: reduce)")),Te.matches):!1}},$e={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"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},Ze={supported:!1,testSupport:mt},Xe,it=!1,yt,bt=!1;c.document&&(yt=c.document.createElement("img"),yt.onload=function(){Xe&&ht(Xe),Xe=null,bt=!0},yt.onerror=function(){it=!0,Xe=null},yt.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function mt(D){it||!yt||(bt?ht(D):Xe=D)}function ht(D){var P=D.createTexture();D.bindTexture(D.TEXTURE_2D,P);try{if(D.texImage2D(D.TEXTURE_2D,0,D.RGBA,D.RGBA,D.UNSIGNED_BYTE,yt),D.isContextLost())return;Ze.supported=!0}catch{}D.deleteTexture(P),it=!0}var Ve="01";function ze(){for(var D="1",P="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",J="",me=0;me<10;me++)J+=P[Math.floor(Math.random()*62)];var De=720*60*1e3,He=[D,Ve,J].join(""),nt=Date.now()+De;return{token:He,tokenExpiresAt:nt}}var Se=function(P,J){this._transformRequestFn=P,this._customAccessToken=J,this._createSkuToken()};Se.prototype._createSkuToken=function(){var P=ze();this._skuToken=P.token,this._skuTokenExpiresAt=P.tokenExpiresAt},Se.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Se.prototype.transformRequest=function(P,J){return this._transformRequestFn?this._transformRequestFn(P,J)||{url:P}:{url:P}},Se.prototype.normalizeStyleURL=function(P,J){if(!Je(P))return P;var me=fr(P);return me.path="/styles/v1"+me.path,this._makeAPIURL(me,this._customAccessToken||J)},Se.prototype.normalizeGlyphsURL=function(P,J){if(!Je(P))return P;var me=fr(P);return me.path="/fonts/v1"+me.path,this._makeAPIURL(me,this._customAccessToken||J)},Se.prototype.normalizeSourceURL=function(P,J){if(!Je(P))return P;var me=fr(P);return me.path="/v4/"+me.authority+".json",me.params.push("secure"),this._makeAPIURL(me,this._customAccessToken||J)},Se.prototype.normalizeSpriteURL=function(P,J,me,De){var He=fr(P);return Je(P)?(He.path="/styles/v1"+He.path+"/sprite"+J+me,this._makeAPIURL(He,this._customAccessToken||De)):(He.path+=""+J+me,mr(He))},Se.prototype.normalizeTileURL=function(P,J){if(this._isSkuTokenExpired()&&this._createSkuToken(),P&&!Je(P))return P;var me=fr(P),De=/(\.(png|jpg)\d*)(?=$)/,He=/^.+\/v4\//,nt=Ne.devicePixelRatio>=2||J===512?"@2x":"",Mt=Ze.supported?".webp":"$1";me.path=me.path.replace(De,""+nt+Mt),me.path=me.path.replace(He,"/"),me.path="/v4"+me.path;var tr=this._customAccessToken||Kt(me.params)||$e.ACCESS_TOKEN;return $e.REQUIRE_ACCESS_TOKEN&&tr&&this._skuToken&&me.params.push("sku="+this._skuToken),this._makeAPIURL(me,tr)},Se.prototype.canonicalizeTileURL=function(P,J){var me="/v4/",De=/\.[\w]+$/,He=fr(P);if(!He.path.match(/(^\/v4\/)/)||!He.path.match(De))return P;var nt="mapbox://tiles/";nt+=He.path.replace(me,"");var Mt=He.params;return J&&(Mt=Mt.filter(function(tr){return!tr.match(/^access_token=/)})),Mt.length&&(nt+="?"+Mt.join("&")),nt},Se.prototype.canonicalizeTileset=function(P,J){for(var me=J?Je(J):!1,De=[],He=0,nt=P.tiles||[];He=0&&P.params.splice(He,1)}if(De.path!=="/"&&(P.path=""+De.path+P.path),!$e.REQUIRE_ACCESS_TOKEN)return mr(P);if(J=J||$e.ACCESS_TOKEN,!J)throw new Error("An API access token is required to use Mapbox GL. "+me);if(J[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+me);return P.params=P.params.filter(function(nt){return nt.indexOf("access_token")===-1}),P.params.push("access_token="+J),mr(P)};function Je(D){return D.indexOf("mapbox:")===0}var _t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function At(D){return _t.test(D)}function vt(D){return D.indexOf("sku=")>0&&At(D)}function Kt(D){for(var P=0,J=D;P=1&&c.localStorage.setItem(J,JSON.stringify(this.eventData))}catch{W("Unable to write to LocalStorage")}},fn.prototype.processRequests=function(P){},fn.prototype.postEvent=function(P,J,me,De){var He=this;if($e.EVENTS_URL){var nt=fr($e.EVENTS_URL);nt.params.push("access_token="+(De||$e.ACCESS_TOKEN||""));var Mt={event:this.type,created:new Date(P).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:a,skuId:Ve,userId:this.anonId},tr=J?T(Mt,J):Mt,vr={url:mr(nt),headers:{"Content-Type":"text/plain"},body:JSON.stringify([tr])};this.pendingRequest=Fn(vr,function(Ar){He.pendingRequest=null,me(Ar),He.saveEventData(),He.processRequests(De)})}},fn.prototype.queueRequest=function(P,J){this.queue.push(P),this.processRequests(J)};var Fr=(function(D){function P(){D.call(this,"map.load"),this.success={},this.skuToken=""}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.postMapLoadEvent=function(me,De,He,nt){this.skuToken=He,($e.EVENTS_URL&&nt||$e.ACCESS_TOKEN&&Array.isArray(me)&&me.some(function(Mt){return Je(Mt)||At(Mt)}))&&this.queueRequest({id:De,timestamp:Date.now()},nt)},P.prototype.processRequests=function(me){var De=this;if(!(this.pendingRequest||this.queue.length===0)){var He=this.queue.shift(),nt=He.id,Mt=He.timestamp;nt&&this.success[nt]||(this.anonId||this.fetchEventData(),F(this.anonId)||(this.anonId=m()),this.postEvent(Mt,{skuToken:this.skuToken},function(tr){tr||nt&&(De.success[nt]=!0)},me))}},P})(fn),Qr=(function(D){function P(J){D.call(this,"appUserTurnstile"),this._customAccessToken=J}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.postTurnstileEvent=function(me,De){$e.EVENTS_URL&&$e.ACCESS_TOKEN&&Array.isArray(me)&&me.some(function(He){return Je(He)||At(He)})&&this.queueRequest(Date.now(),De)},P.prototype.processRequests=function(me){var De=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var He=Br($e.ACCESS_TOKEN),nt=He?He.u:$e.ACCESS_TOKEN,Mt=nt!==this.eventData.tokenU;F(this.anonId)||(this.anonId=m(),Mt=!0);var tr=this.queue.shift();if(this.eventData.lastSuccess){var vr=new Date(this.eventData.lastSuccess),Ar=new Date(tr),Zr=(tr-this.eventData.lastSuccess)/(1440*60*1e3);Mt=Mt||Zr>=1||Zr<-1||vr.getDate()!==Ar.getDate()}else Mt=!0;if(!Mt)return this.processRequests();this.postEvent(tr,{"enabled.telemetry":!1},function(mn){mn||(De.eventData.lastSuccess=tr,De.eventData.tokenU=nt)},me)}},P})(fn),Bt=new Qr,et=Bt.postTurnstileEvent.bind(Bt),ut=new Fr,Be=ut.postMapLoadEvent.bind(ut),Ie="mapbox-tiles",ke=500,Fe=50,at=1e3*60*7,ct;function Gt(){c.caches&&!ct&&(ct=c.caches.open(Ie))}var Vt;function Zt(D,P){if(Vt===void 0)try{new Response(new ReadableStream),Vt=!0}catch{Vt=!1}Vt?P(D.body):D.blob().then(P)}function ur(D,P,J){if(Gt(),!!ct){var me={status:P.status,statusText:P.statusText,headers:new c.Headers};P.headers.forEach(function(nt,Mt){return me.headers.set(Mt,nt)});var De=_e(P.headers.get("Cache-Control")||"");if(!De["no-store"]){De["max-age"]&&me.headers.set("Expires",new Date(J+De["max-age"]*1e3).toUTCString());var He=new Date(me.headers.get("Expires")).getTime()-J;HeDate.now()&&!J["no-cache"]}var Jr=1/0;function jn(D){Jr++,Jr>Fe&&(D.getActor().send("enforceCacheSizeLimit",ke),Jr=0)}function ha(D){Gt(),ct&&ct.then(function(P){P.keys().then(function(J){for(var me=0;me=200&&J.status<300||J.status===0)&&J.response!==null){var De=J.response;if(D.type==="json")try{De=JSON.parse(J.response)}catch(He){return P(He)}P(null,De,J.getResponseHeader("Cache-Control"),J.getResponseHeader("Expires"))}else P(new ci(J.statusText,J.status,D.url))},J.send(D.body),{cancel:function(){return J.abort()}}}var an=function(D,P){if(!rr(D.url)){if(c.fetch&&c.Request&&c.AbortController&&c.Request.prototype.hasOwnProperty("signal"))return yr(D,P);if(ge()&&self.worker&&self.worker.actor){var J=!0;return self.worker.actor.send("getResource",D,P,void 0,J)}}return br(D,P)},bn=function(D,P){return an(T(D,{type:"json"}),P)},In=function(D,P){return an(T(D,{type:"arrayBuffer"}),P)},Fn=function(D,P){return an(T(D,{method:"POST"}),P)};function va(D){var P=c.document.createElement("a");return P.href=D,P.protocol===c.document.location.protocol&&P.host===c.document.location.host}var Pa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function La(D,P,J,me){var De=new c.Image,He=c.URL;De.onload=function(){P(null,De),He.revokeObjectURL(De.src),De.onload=null,c.requestAnimationFrame(function(){De.src=Pa})},De.onerror=function(){return P(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 nt=new c.Blob([new Uint8Array(D)],{type:"image/png"});De.cacheControl=J,De.expires=me,De.src=D.byteLength?He.createObjectURL(nt):Pa}function Oa(D,P){var J=new c.Blob([new Uint8Array(D)],{type:"image/png"});c.createImageBitmap(J).then(function(me){P(null,me)}).catch(function(me){P(new Error("Could not load image because of "+me.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var Wa,sa,ji=function(){Wa=[],sa=0};ji();var Qi=function(D,P){if(Ze.supported&&(D.headers||(D.headers={}),D.headers.accept="image/webp,*/*"),sa>=$e.MAX_PARALLEL_IMAGE_REQUESTS){var J={requestParameters:D,callback:P,cancelled:!1,cancel:function(){this.cancelled=!0}};return Wa.push(J),J}sa++;var me=!1,De=function(){if(!me)for(me=!0,sa--;Wa.length&&sa<$e.MAX_PARALLEL_IMAGE_REQUESTS;){var nt=Wa.shift(),Mt=nt.requestParameters,tr=nt.callback,vr=nt.cancelled;vr||(nt.cancel=Qi(Mt,tr).cancel)}},He=In(D,function(nt,Mt,tr,vr){De(),nt?P(nt):Mt&&(ra()?Oa(Mt,P):La(Mt,P,tr,vr))});return{cancel:function(){He.cancel(),De()}}},Xt=function(D,P){var J=c.document.createElement("video");J.muted=!0,J.onloadstart=function(){P(null,J)};for(var me=0;me0||this._oneTimeListeners&&this._oneTimeListeners[P]&&this._oneTimeListeners[P].length>0||this._eventedParent&&this._eventedParent.listens(P)},Wr.prototype.setEventedParent=function(P,J){return this._eventedParent=P,this._eventedParentData=J,this};var tn=8,wn={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"}},dn={"*":{type:"source"}},Nt=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],xr={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"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Xr={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"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Tn={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"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Xn={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},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},ia={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"}}},na={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"}}},An={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"}},Yn=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],qi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ga={"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"}},to={"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"}},_o={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Po={"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"}},Ro={"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"}},Xo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Oi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},bs={type:"array",value:"*"},cs={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},fl={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Is={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},ys={type:"array",value:"*",minimum:1},ss={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}},hl=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],ll={"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"}},Il={"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"}},Ls={"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"}},ps={"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"}},Uo={"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"}},Rs={"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"}},Ll={"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"}},Kl={"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"}},eu={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Ws={"*":{type:"string"}},Bi={$version:tn,$root:wn,sources:dn,source:Nt,source_vector:xr,source_raster:Xr,source_raster_dem:Tn,source_geojson:Xn,source_video:ia,source_image:na,layer:An,layout:Yn,layout_background:qi,layout_fill:Ga,layout_circle:to,layout_heatmap:_o,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Po,layout_symbol:Ro,layout_raster:Xo,layout_hillshade:Oi,filter:bs,filter_operator:cs,geometry_type:fl,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:Is,expression:ys,light:ss,paint:hl,paint_fill:ll,"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:Il,paint_circle:Ls,paint_heatmap:ps,paint_symbol:Uo,paint_raster:Rs,paint_hillshade:Ll,paint_background:Kl,transition:eu,"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:Ws},Mo=function(P,J,me,De){this.message=(P?P+": ":"")+me,De&&(this.identifier=De),J!=null&&J.__line__&&(this.line=J.__line__)};function Jl(D){var P=D.key,J=D.value;return J?[new Mo(P,J,"constants have been deprecated as of v8")]:[]}function Qs(D){for(var P=[],J=arguments.length-1;J-- >0;)P[J]=arguments[J+1];for(var me=0,De=P;me":D.itemType.kind==="value"?"array":"array<"+P+">"}else return D.kind}var vc=[Gu,Eo,Os,ws,pu,nl,vu,su(ts),Gl];function jf(D,P){if(P.kind==="error")return null;if(D.kind==="array"){if(P.kind==="array"&&(P.N===0&&P.itemType.kind==="value"||!jf(D.itemType,P.itemType))&&(typeof D.N!="number"||D.N===P.N))return null}else{if(D.kind===P.kind)return null;if(D.kind==="value")for(var J=0,me=vc;J255?255:vr}function De(vr){return vr<0?0:vr>1?1:vr}function He(vr){return vr[vr.length-1]==="%"?me(parseFloat(vr)/100*255):me(parseInt(vr))}function nt(vr){return vr[vr.length-1]==="%"?De(parseFloat(vr)/100):De(parseFloat(vr))}function Mt(vr,Ar,Zr){return Zr<0?Zr+=1:Zr>1&&(Zr-=1),Zr*6<1?vr+(Ar-vr)*Zr*6:Zr*2<1?Ar:Zr*3<2?vr+(Ar-vr)*(2/3-Zr)*6:vr}function tr(vr){var Ar=vr.replace(/ /g,"").toLowerCase();if(Ar in J)return J[Ar].slice();if(Ar[0]==="#"){if(Ar.length===4){var Zr=parseInt(Ar.substr(1),16);return Zr>=0&&Zr<=4095?[(Zr&3840)>>4|(Zr&3840)>>8,Zr&240|(Zr&240)>>4,Zr&15|(Zr&15)<<4,1]:null}else if(Ar.length===7){var Zr=parseInt(Ar.substr(1),16);return Zr>=0&&Zr<=16777215?[(Zr&16711680)>>16,(Zr&65280)>>8,Zr&255,1]:null}return null}var mn=Ar.indexOf("("),hn=Ar.indexOf(")");if(mn!==-1&&hn+1===Ar.length){var zn=Ar.substr(0,mn),pa=Ar.substr(mn+1,hn-(mn+1)).split(","),li=1;switch(zn){case"rgba":if(pa.length!==4)return null;li=nt(pa.pop());case"rgb":return pa.length!==3?null:[He(pa[0]),He(pa[1]),He(pa[2]),li];case"hsla":if(pa.length!==4)return null;li=nt(pa.pop());case"hsl":if(pa.length!==3)return null;var Ba=(parseFloat(pa[0])%360+360)%360/360,Gi=nt(pa[1]),xi=nt(pa[2]),Vi=xi<=.5?xi*(Gi+1):xi+Gi-xi*Gi,eo=xi*2-Vi;return[me(Mt(eo,Vi,Ba+1/3)*255),me(Mt(eo,Vi,Ba)*255),me(Mt(eo,Vi,Ba-1/3)*255),li];default:return null}}return null}try{P.parseCSSColor=tr}catch{}}),ad=_d.parseCSSColor,ql=function(P,J,me,De){De===void 0&&(De=1),this.r=P,this.g=J,this.b=me,this.a=De};ql.parse=function(P){if(P){if(P instanceof ql)return P;if(typeof P=="string"){var J=ad(P);if(J)return new ql(J[0]/255*J[3],J[1]/255*J[3],J[2]/255*J[3],J[3])}}},ql.prototype.toString=function(){var P=this.toArray(),J=P[0],me=P[1],De=P[2],He=P[3];return"rgba("+Math.round(J)+","+Math.round(me)+","+Math.round(De)+","+He+")"},ql.prototype.toArray=function(){var P=this,J=P.r,me=P.g,De=P.b,He=P.a;return He===0?[0,0,0,0]:[J*255/He,me*255/He,De*255/He,He]},ql.black=new ql(0,0,0,1),ql.white=new ql(1,1,1,1),ql.transparent=new ql(0,0,0,0),ql.red=new ql(1,0,0,1);var cf=function(P,J,me){P?this.sensitivity=J?"variant":"case":this.sensitivity=J?"accent":"base",this.locale=me,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};cf.prototype.compare=function(P,J){return this.collator.compare(P,J)},cf.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var xd=function(P,J,me,De,He){this.text=P,this.image=J,this.scale=me,this.fontStack=De,this.textColor=He},Lc=function(P){this.sections=P};Lc.fromString=function(P){return new Lc([new xd(P,null,null,null,null)])},Lc.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(P){return P.text.length!==0||P.image&&P.image.name.length!==0})},Lc.factory=function(P){return P instanceof Lc?P:Lc.fromString(P)},Lc.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(P){return P.text}).join("")},Lc.prototype.serialize=function(){for(var P=["format"],J=0,me=this.sections;J=0&&D<=255&&typeof P=="number"&&P>=0&&P<=255&&typeof J=="number"&&J>=0&&J<=255)){var De=typeof me=="number"?[D,P,J,me]:[D,P,J];return"Invalid rgba value ["+De.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof me>"u"||typeof me=="number"&&me>=0&&me<=1?null:"Invalid rgba value ["+[D,P,J,me].join(", ")+"]: 'a' must be between 0 and 1."}function Df(D){if(D===null)return!0;if(typeof D=="string")return!0;if(typeof D=="boolean")return!0;if(typeof D=="number")return!0;if(D instanceof ql)return!0;if(D instanceof cf)return!0;if(D instanceof Lc)return!0;if(D instanceof mc)return!0;if(Array.isArray(D)){for(var P=0,J=D;P2){var Mt=P[1];if(typeof Mt!="string"||!(Mt in rh)||Mt==="object")return J.error('The item type argument of "array" must be one of string, number, boolean',1);nt=rh[Mt],me++}else nt=ts;var tr;if(P.length>3){if(P[2]!==null&&(typeof P[2]!="number"||P[2]<0||P[2]!==Math.floor(P[2])))return J.error('The length argument to "array" must be a positive integer literal',2);tr=P[2],me++}De=su(nt,tr)}else De=rh[He];for(var vr=[];me1)&&J.push(De)}}return J.concat(this.args.map(function(He){return He.serialize()}))};var ph=function(P){this.type=nl,this.sections=P};ph.parse=function(P,J){if(P.length<2)return J.error("Expected at least one argument.");var me=P[1];if(!Array.isArray(me)&&typeof me=="object")return J.error("First argument must be an image or text section.");for(var De=[],He=!1,nt=1;nt<=P.length-1;++nt){var Mt=P[nt];if(He&&typeof Mt=="object"&&!Array.isArray(Mt)){He=!1;var tr=null;if(Mt["font-scale"]&&(tr=J.parse(Mt["font-scale"],1,Eo),!tr))return null;var vr=null;if(Mt["text-font"]&&(vr=J.parse(Mt["text-font"],1,su(Os)),!vr))return null;var Ar=null;if(Mt["text-color"]&&(Ar=J.parse(Mt["text-color"],1,pu),!Ar))return null;var Zr=De[De.length-1];Zr.scale=tr,Zr.font=vr,Zr.textColor=Ar}else{var mn=J.parse(P[nt],1,ts);if(!mn)return null;var hn=mn.type.kind;if(hn!=="string"&&hn!=="value"&&hn!=="null"&&hn!=="resolvedImage")return J.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");He=!0,De.push({content:mn,scale:null,font:null,textColor:null})}}return new ph(De)},ph.prototype.evaluate=function(P){var J=function(me){var De=me.content.evaluate(P);return xu(De)===Gl?new xd("",De,null,null,null):new xd(gc(De),null,me.scale?me.scale.evaluate(P):null,me.font?me.font.evaluate(P).join(","):null,me.textColor?me.textColor.evaluate(P):null)};return new Lc(this.sections.map(J))},ph.prototype.eachChild=function(P){for(var J=0,me=this.sections;J-1),me},Lu.prototype.eachChild=function(P){P(this.input)},Lu.prototype.outputDefined=function(){return!1},Lu.prototype.serialize=function(){return["image",this.input.serialize()]};var yp={"to-boolean":ws,"to-color":pu,"to-number":Eo,"to-string":Os},al=function(P,J){this.type=P,this.args=J};al.parse=function(P,J){if(P.length<2)return J.error("Expected at least one argument.");var me=P[0];if((me==="to-boolean"||me==="to-string")&&P.length!==2)return J.error("Expected one argument.");for(var De=yp[me],He=[],nt=1;nt4?me="Invalid rbga value "+JSON.stringify(J)+": expected an array containing either three or four numeric values.":me=Rc(J[0],J[1],J[2],J[3]),!me))return new ql(J[0]/255,J[1]/255,J[2]/255,J[3])}throw new ru(me||"Could not parse color from value '"+(typeof J=="string"?J:String(JSON.stringify(J)))+"'")}else if(this.type.kind==="number"){for(var tr=null,vr=0,Ar=this.args;vr=P[2]||D[1]<=P[1]||D[3]>=P[3])}function Jd(D,P){var J=vh(D[0]),me=Wh(D[1]),De=Math.pow(2,P.z);return[Math.round(J*De*ic),Math.round(me*De*ic)]}function Ld(D,P,J){var me=D[0]-P[0],De=D[1]-P[1],He=D[0]-J[0],nt=D[1]-J[1];return me*nt-He*De===0&&me*He<=0&&De*nt<=0}function Xh(D,P,J){return P[1]>D[1]!=J[1]>D[1]&&D[0]<(J[0]-P[0])*(D[1]-P[1])/(J[1]-P[1])+P[0]}function mh(D,P){for(var J=!1,me=0,De=P.length;me0&&Zr<0||Ar<0&&Zr>0}function Rd(D,P,J,me){var De=[P[0]-D[0],P[1]-D[1]],He=[me[0]-J[0],me[1]-J[1]];return Td(He,De)===0?!1:!!(zf(D,P,J,me)&&zf(J,me,D,P))}function nh(D,P,J){for(var me=0,De=J;meJ[2]){var De=me*.5,He=D[0]-J[0]>De?-me:J[0]-D[0]>De?me:0;He===0&&(He=D[0]-J[2]>De?-me:J[2]-D[0]>De?me:0),D[0]+=He}bd(P,D)}function id(D){D[0]=D[1]=1/0,D[2]=D[3]=-1/0}function _p(D,P,J,me){for(var De=Math.pow(2,me.z)*ic,He=[me.x*ic,me.y*ic],nt=[],Mt=0,tr=D;Mt=0)return!1;var J=!0;return D.eachChild(function(me){J&&!hf(me,P)&&(J=!1)}),J}var gh=function(P,J){this.type=J.type,this.name=P,this.boundExpression=J};gh.parse=function(P,J){if(P.length!==2||typeof P[1]!="string")return J.error("'var' expression requires exactly one string literal argument.");var me=P[1];return J.scope.has(me)?new gh(me,J.scope.get(me)):J.error('Unknown variable "'+me+'". Make sure "'+me+'" has been bound in an enclosing "let" expression before using it.',1)},gh.prototype.evaluate=function(P){return this.boundExpression.evaluate(P)},gh.prototype.eachChild=function(){},gh.prototype.outputDefined=function(){return!1},gh.prototype.serialize=function(){return["var",this.name]};var bu=function(P,J,me,De,He){J===void 0&&(J=[]),De===void 0&&(De=new Rl),He===void 0&&(He=[]),this.registry=P,this.path=J,this.key=J.map(function(nt){return"["+nt+"]"}).join(""),this.scope=De,this.errors=He,this.expectedType=me};bu.prototype.parse=function(P,J,me,De,He){return He===void 0&&(He={}),J?this.concat(J,me,De)._parse(P,He):this._parse(P,He)},bu.prototype._parse=function(P,J){(P===null||typeof P=="string"||typeof P=="boolean"||typeof P=="number")&&(P=["literal",P]);function me(Ar,Zr,mn){return mn==="assert"?new Xc(Zr,[Ar]):mn==="coerce"?new al(Zr,[Ar]):Ar}if(Array.isArray(P)){if(P.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var De=P[0];if(typeof De!="string")return this.error("Expression name must be a string, but found "+typeof De+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var He=this.registry[De];if(He){var nt=He.parse(P,this);if(!nt)return null;if(this.expectedType){var Mt=this.expectedType,tr=nt.type;if((Mt.kind==="string"||Mt.kind==="number"||Mt.kind==="boolean"||Mt.kind==="object"||Mt.kind==="array")&&tr.kind==="value")nt=me(nt,Mt,J.typeAnnotation||"assert");else if((Mt.kind==="color"||Mt.kind==="formatted"||Mt.kind==="resolvedImage")&&(tr.kind==="value"||tr.kind==="string"))nt=me(nt,Mt,J.typeAnnotation||"coerce");else if(this.checkSubtype(Mt,tr))return null}if(!(nt instanceof ul)&&nt.type.kind!=="resolvedImage"&&ah(nt)){var vr=new Ol;try{nt=new ul(nt.type,nt.evaluate(vr))}catch(Ar){return this.error(Ar.message),null}}return nt}return this.error('Unknown expression "'+De+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof P>"u"?this.error("'undefined' value invalid. Use null instead."):typeof P=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof P+" instead.")},bu.prototype.concat=function(P,J,me){var De=typeof P=="number"?this.path.concat(P):this.path,He=me?this.scope.concat(me):this.scope;return new bu(this.registry,De,J||null,He,this.errors)},bu.prototype.error=function(P){for(var J=[],me=arguments.length-1;me-- >0;)J[me]=arguments[me+1];var De=""+this.key+J.map(function(He){return"["+He+"]"}).join("");this.errors.push(new dl(De,P))},bu.prototype.checkSubtype=function(P,J){var me=jf(P,J);return me&&this.error(me),me};function ah(D){if(D instanceof gh)return ah(D.boundExpression);if(D instanceof ns&&D.name==="error")return!1;if(D instanceof Pf)return!1;if(D instanceof ff)return!1;var P=D instanceof al||D instanceof Xc,J=!0;return D.eachChild(function(me){P?J=J&&ah(me):J=J&&me instanceof ul}),J?zd(D)&&hf(D,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Vc(D,P){for(var J=D.length-1,me=0,De=J,He=0,nt,Mt;me<=De;)if(He=Math.floor((me+De)/2),nt=D[He],Mt=D[He+1],nt<=P){if(He===J||PP)De=He-1;else throw new ru("Input is not a number.");return 0}var df=function(P,J,me){this.type=P,this.input=J,this.labels=[],this.outputs=[];for(var De=0,He=me;De=Mt)return J.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',vr);var Zr=J.parse(tr,Ar,He);if(!Zr)return null;He=He||Zr.type,De.push([Mt,Zr])}return new df(He,me,De)},df.prototype.evaluate=function(P){var J=this.labels,me=this.outputs;if(J.length===1)return me[0].evaluate(P);var De=this.input.evaluate(P);if(De<=J[0])return me[0].evaluate(P);var He=J.length;if(De>=J[He-1])return me[He-1].evaluate(P);var nt=Vc(J,De);return me[nt].evaluate(P)},df.prototype.eachChild=function(P){P(this.input);for(var J=0,me=this.outputs;J0&&P.push(this.labels[J]),P.push(this.outputs[J].serialize());return P};function Ru(D,P,J){return D*(1-J)+P*J}function Nh(D,P,J){return new ql(Ru(D.r,P.r,J),Ru(D.g,P.g,J),Ru(D.b,P.b,J),Ru(D.a,P.a,J))}function qf(D,P,J){return D.map(function(me,De){return Ru(me,P[De],J)})}var yh=Object.freeze({__proto__:null,number:Ru,color:Nh,array:qf}),od=.95047,xp=1,Jp=1.08883,Oh=4/29,sd=6/29,Af=3*sd*sd,ld=sd*sd*sd,Dc=Math.PI/180,Fh=180/Math.PI;function Nd(D){return D>ld?Math.pow(D,1/3):D/Af+Oh}function Bh(D){return D>sd?D*D*D:Af*(D-Oh)}function Au(D){return 255*(D<=.0031308?12.92*D:1.055*Math.pow(D,1/2.4)-.055)}function pf(D){return D/=255,D<=.04045?D/12.92:Math.pow((D+.055)/1.055,2.4)}function Nf(D){var P=pf(D.r),J=pf(D.g),me=pf(D.b),De=Nd((.4124564*P+.3575761*J+.1804375*me)/od),He=Nd((.2126729*P+.7151522*J+.072175*me)/xp),nt=Nd((.0193339*P+.119192*J+.9503041*me)/Jp);return{l:116*He-16,a:500*(De-He),b:200*(He-nt),alpha:D.a}}function Sd(D){var P=(D.l+16)/116,J=isNaN(D.a)?P:P+D.a/500,me=isNaN(D.b)?P:P-D.b/200;return P=xp*Bh(P),J=od*Bh(J),me=Jp*Bh(me),new ql(Au(3.2404542*J-1.5371385*P-.4985314*me),Au(-.969266*J+1.8760108*P+.041556*me),Au(.0556434*J-.2040259*P+1.0572252*me),D.alpha)}function ku(D,P,J){return{l:Ru(D.l,P.l,J),a:Ru(D.a,P.a,J),b:Ru(D.b,P.b,J),alpha:Ru(D.alpha,P.alpha,J)}}function Zh(D){var P=Nf(D),J=P.l,me=P.a,De=P.b,He=Math.atan2(De,me)*Fh;return{h:He<0?He+360:He,c:Math.sqrt(me*me+De*De),l:J,alpha:D.a}}function _h(D){var P=D.h*Dc,J=D.c,me=D.l;return Sd({l:me,a:Math.cos(P)*J,b:Math.sin(P)*J,alpha:D.alpha})}function Sf(D,P,J){var me=P-D;return D+J*(me>180||me<-180?me-360*Math.round(me/360):me)}function Kh(D,P,J){return{h:Sf(D.h,P.h,J),c:Ru(D.c,P.c,J),l:Ru(D.l,P.l,J),alpha:Ru(D.alpha,P.alpha,J)}}var Hf={forward:Nf,reverse:Sd,interpolate:ku},Jh={forward:Zh,reverse:_h,interpolate:Kh},bp=Object.freeze({__proto__:null,lab:Hf,hcl:Jh}),Oc=function(P,J,me,De,He){this.type=P,this.operator=J,this.interpolation=me,this.input=De,this.labels=[],this.outputs=[];for(var nt=0,Mt=He;nt1}))return J.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);De={name:"cubic-bezier",controlPoints:tr}}else return J.error("Unknown interpolation type "+String(De[0]),1,0);if(P.length-1<4)return J.error("Expected at least 4 arguments, but found only "+(P.length-1)+".");if((P.length-1)%2!==0)return J.error("Expected an even number of arguments.");if(He=J.parse(He,2,Eo),!He)return null;var vr=[],Ar=null;me==="interpolate-hcl"||me==="interpolate-lab"?Ar=pu:J.expectedType&&J.expectedType.kind!=="value"&&(Ar=J.expectedType);for(var Zr=0;Zr=mn)return J.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',zn);var li=J.parse(hn,pa,Ar);if(!li)return null;Ar=Ar||li.type,vr.push([mn,li])}return Ar.kind!=="number"&&Ar.kind!=="color"&&!(Ar.kind==="array"&&Ar.itemType.kind==="number"&&typeof Ar.N=="number")?J.error("Type "+cu(Ar)+" is not interpolatable."):new Oc(Ar,me,De,He,vr)},Oc.prototype.evaluate=function(P){var J=this.labels,me=this.outputs;if(J.length===1)return me[0].evaluate(P);var De=this.input.evaluate(P);if(De<=J[0])return me[0].evaluate(P);var He=J.length;if(De>=J[He-1])return me[He-1].evaluate(P);var nt=Vc(J,De),Mt=J[nt],tr=J[nt+1],vr=Oc.interpolationFactor(this.interpolation,De,Mt,tr),Ar=me[nt].evaluate(P),Zr=me[nt+1].evaluate(P);return this.operator==="interpolate"?yh[this.type.kind.toLowerCase()](Ar,Zr,vr):this.operator==="interpolate-hcl"?Jh.reverse(Jh.interpolate(Jh.forward(Ar),Jh.forward(Zr),vr)):Hf.reverse(Hf.interpolate(Hf.forward(Ar),Hf.forward(Zr),vr))},Oc.prototype.eachChild=function(P){P(this.input);for(var J=0,me=this.outputs;J=me.length)throw new ru("Array index out of bounds: "+J+" > "+(me.length-1)+".");if(J!==Math.floor(J))throw new ru("Array index must be an integer, but found "+J+" instead.");return me[J]},Wf.prototype.eachChild=function(P){P(this.index),P(this.input)},Wf.prototype.outputDefined=function(){return!1},Wf.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var qu=function(P,J){this.type=ws,this.needle=P,this.haystack=J};qu.parse=function(P,J){if(P.length!==3)return J.error("Expected 2 arguments, but found "+(P.length-1)+" instead.");var me=J.parse(P[1],1,ts),De=J.parse(P[2],2,ts);return!me||!De?null:Tf(me.type,[ws,Os,Eo,Gu,ts])?new qu(me,De):J.error("Expected first argument to be of type boolean, string, number or null, but found "+cu(me.type)+" instead")},qu.prototype.evaluate=function(P){var J=this.needle.evaluate(P),me=this.haystack.evaluate(P);if(!me)return!1;if(!Rf(J,["boolean","string","number","null"]))throw new ru("Expected first argument to be of type boolean, string, number or null, but found "+cu(xu(J))+" instead.");if(!Rf(me,["string","array"]))throw new ru("Expected second argument to be of type array or string, but found "+cu(xu(me))+" instead.");return me.indexOf(J)>=0},qu.prototype.eachChild=function(P){P(this.needle),P(this.haystack)},qu.prototype.outputDefined=function(){return!0},qu.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Yc=function(P,J,me){this.type=Eo,this.needle=P,this.haystack=J,this.fromIndex=me};Yc.parse=function(P,J){if(P.length<=2||P.length>=5)return J.error("Expected 3 or 4 arguments, but found "+(P.length-1)+" instead.");var me=J.parse(P[1],1,ts),De=J.parse(P[2],2,ts);if(!me||!De)return null;if(!Tf(me.type,[ws,Os,Eo,Gu,ts]))return J.error("Expected first argument to be of type boolean, string, number or null, but found "+cu(me.type)+" instead");if(P.length===4){var He=J.parse(P[3],3,Eo);return He?new Yc(me,De,He):null}else return new Yc(me,De)},Yc.prototype.evaluate=function(P){var J=this.needle.evaluate(P),me=this.haystack.evaluate(P);if(!Rf(J,["boolean","string","number","null"]))throw new ru("Expected first argument to be of type boolean, string, number or null, but found "+cu(xu(J))+" instead.");if(!Rf(me,["string","array"]))throw new ru("Expected second argument to be of type array or string, but found "+cu(xu(me))+" instead.");if(this.fromIndex){var De=this.fromIndex.evaluate(P);return me.indexOf(J,De)}return me.indexOf(J)},Yc.prototype.eachChild=function(P){P(this.needle),P(this.haystack),this.fromIndex&&P(this.fromIndex)},Yc.prototype.outputDefined=function(){return!1},Yc.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var P=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),P]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Nu=function(P,J,me,De,He,nt){this.inputType=P,this.type=J,this.input=me,this.cases=De,this.outputs=He,this.otherwise=nt};Nu.parse=function(P,J){if(P.length<5)return J.error("Expected at least 4 arguments, but found only "+(P.length-1)+".");if(P.length%2!==1)return J.error("Expected an even number of arguments.");var me,De;J.expectedType&&J.expectedType.kind!=="value"&&(De=J.expectedType);for(var He={},nt=[],Mt=2;MtNumber.MAX_SAFE_INTEGER)return Ar.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof hn=="number"&&Math.floor(hn)!==hn)return Ar.error("Numeric branch labels must be integer values.");if(!me)me=xu(hn);else if(Ar.checkSubtype(me,xu(hn)))return null;if(typeof He[String(hn)]<"u")return Ar.error("Branch labels must be unique.");He[String(hn)]=nt.length}var zn=J.parse(vr,Mt,De);if(!zn)return null;De=De||zn.type,nt.push(zn)}var pa=J.parse(P[1],1,ts);if(!pa)return null;var li=J.parse(P[P.length-1],P.length-1,De);return!li||pa.type.kind!=="value"&&J.concat(1).checkSubtype(me,pa.type)?null:new Nu(me,De,pa,He,nt,li)},Nu.prototype.evaluate=function(P){var J=this.input.evaluate(P),me=xu(J)===this.inputType&&this.outputs[this.cases[J]]||this.otherwise;return me.evaluate(P)},Nu.prototype.eachChild=function(P){P(this.input),this.outputs.forEach(P),P(this.otherwise)},Nu.prototype.outputDefined=function(){return this.outputs.every(function(P){return P.outputDefined()})&&this.otherwise.outputDefined()},Nu.prototype.serialize=function(){for(var P=this,J=["match",this.input.serialize()],me=Object.keys(this.cases).sort(),De=[],He={},nt=0,Mt=me;nt=5)return J.error("Expected 3 or 4 arguments, but found "+(P.length-1)+" instead.");var me=J.parse(P[1],1,ts),De=J.parse(P[2],2,Eo);if(!me||!De)return null;if(!Tf(me.type,[su(ts),Os,ts]))return J.error("Expected first argument to be of type array or string, but found "+cu(me.type)+" instead");if(P.length===4){var He=J.parse(P[3],3,Eo);return He?new Xf(me.type,me,De,He):null}else return new Xf(me.type,me,De)},Xf.prototype.evaluate=function(P){var J=this.input.evaluate(P),me=this.beginIndex.evaluate(P);if(!Rf(J,["string","array"]))throw new ru("Expected first argument to be of type array or string, but found "+cu(xu(J))+" instead.");if(this.endIndex){var De=this.endIndex.evaluate(P);return J.slice(me,De)}return J.slice(me)},Xf.prototype.eachChild=function(P){P(this.input),P(this.beginIndex),this.endIndex&&P(this.endIndex)},Xf.prototype.outputDefined=function(){return!1},Xf.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var P=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),P]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function Ed(D,P){return D==="=="||D==="!="?P.kind==="boolean"||P.kind==="string"||P.kind==="number"||P.kind==="null"||P.kind==="value":P.kind==="string"||P.kind==="number"||P.kind==="value"}function wr(D,P,J){return P===J}function qr(D,P,J){return P!==J}function kn(D,P,J){return PJ}function Qn(D,P,J){return P<=J}function $a(D,P,J){return P>=J}function Fa(D,P,J,me){return me.compare(P,J)===0}function Ai(D,P,J,me){return!Fa(D,P,J,me)}function Ni(D,P,J,me){return me.compare(P,J)<0}function ho(D,P,J,me){return me.compare(P,J)>0}function fi(D,P,J,me){return me.compare(P,J)<=0}function Yi(D,P,J,me){return me.compare(P,J)>=0}function bi(D,P,J){var me=D!=="=="&&D!=="!=";return(function(){function De(He,nt,Mt){this.type=ws,this.lhs=He,this.rhs=nt,this.collator=Mt,this.hasUntypedArgument=He.type.kind==="value"||nt.type.kind==="value"}return De.parse=function(nt,Mt){if(nt.length!==3&&nt.length!==4)return Mt.error("Expected two or three arguments.");var tr=nt[0],vr=Mt.parse(nt[1],1,ts);if(!vr)return null;if(!Ed(tr,vr.type))return Mt.concat(1).error('"'+tr+`" comparisons are not supported for type '`+cu(vr.type)+"'.");var Ar=Mt.parse(nt[2],2,ts);if(!Ar)return null;if(!Ed(tr,Ar.type))return Mt.concat(2).error('"'+tr+`" comparisons are not supported for type '`+cu(Ar.type)+"'.");if(vr.type.kind!==Ar.type.kind&&vr.type.kind!=="value"&&Ar.type.kind!=="value")return Mt.error("Cannot compare types '"+cu(vr.type)+"' and '"+cu(Ar.type)+"'.");me&&(vr.type.kind==="value"&&Ar.type.kind!=="value"?vr=new Xc(Ar.type,[vr]):vr.type.kind!=="value"&&Ar.type.kind==="value"&&(Ar=new Xc(vr.type,[Ar])));var Zr=null;if(nt.length===4){if(vr.type.kind!=="string"&&Ar.type.kind!=="string"&&vr.type.kind!=="value"&&Ar.type.kind!=="value")return Mt.error("Cannot use collator to compare non-string types.");if(Zr=Mt.parse(nt[3],3,zu),!Zr)return null}return new De(vr,Ar,Zr)},De.prototype.evaluate=function(nt){var Mt=this.lhs.evaluate(nt),tr=this.rhs.evaluate(nt);if(me&&this.hasUntypedArgument){var vr=xu(Mt),Ar=xu(tr);if(vr.kind!==Ar.kind||!(vr.kind==="string"||vr.kind==="number"))throw new ru('Expected arguments for "'+D+'" to be (string, string) or (number, number), but found ('+vr.kind+", "+Ar.kind+") instead.")}if(this.collator&&!me&&this.hasUntypedArgument){var Zr=xu(Mt),mn=xu(tr);if(Zr.kind!=="string"||mn.kind!=="string")return P(nt,Mt,tr)}return this.collator?J(nt,Mt,tr,this.collator.evaluate(nt)):P(nt,Mt,tr)},De.prototype.eachChild=function(nt){nt(this.lhs),nt(this.rhs),this.collator&&nt(this.collator)},De.prototype.outputDefined=function(){return!0},De.prototype.serialize=function(){var nt=[D];return this.eachChild(function(Mt){nt.push(Mt.serialize())}),nt},De})()}var ii=bi("==",wr,Fa),bo=bi("!=",qr,Ai),os=bi("<",kn,Ni),rs=bi(">",_n,ho),fs=bi("<=",Qn,fi),ls=bi(">=",$a,Yi),To=function(P,J,me,De,He){this.type=Os,this.number=P,this.locale=J,this.currency=me,this.minFractionDigits=De,this.maxFractionDigits=He};To.parse=function(P,J){if(P.length!==3)return J.error("Expected two arguments.");var me=J.parse(P[1],1,Eo);if(!me)return null;var De=P[2];if(typeof De!="object"||Array.isArray(De))return J.error("NumberFormat options argument must be an object.");var He=null;if(De.locale&&(He=J.parse(De.locale,1,Os),!He))return null;var nt=null;if(De.currency&&(nt=J.parse(De.currency,1,Os),!nt))return null;var Mt=null;if(De["min-fraction-digits"]&&(Mt=J.parse(De["min-fraction-digits"],1,Eo),!Mt))return null;var tr=null;return De["max-fraction-digits"]&&(tr=J.parse(De["max-fraction-digits"],1,Eo),!tr)?null:new To(me,He,nt,Mt,tr)},To.prototype.evaluate=function(P){return new Intl.NumberFormat(this.locale?this.locale.evaluate(P):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(P):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(P):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(P):void 0}).format(this.number.evaluate(P))},To.prototype.eachChild=function(P){P(this.number),this.locale&&P(this.locale),this.currency&&P(this.currency),this.minFractionDigits&&P(this.minFractionDigits),this.maxFractionDigits&&P(this.maxFractionDigits)},To.prototype.outputDefined=function(){return!1},To.prototype.serialize=function(){var P={};return this.locale&&(P.locale=this.locale.serialize()),this.currency&&(P.currency=this.currency.serialize()),this.minFractionDigits&&(P["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(P["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),P]};var ro=function(P){this.type=Eo,this.input=P};ro.parse=function(P,J){if(P.length!==2)return J.error("Expected 1 argument, but found "+(P.length-1)+" instead.");var me=J.parse(P[1],1);return me?me.type.kind!=="array"&&me.type.kind!=="string"&&me.type.kind!=="value"?J.error("Expected argument of type string or array, but found "+cu(me.type)+" instead."):new ro(me):null},ro.prototype.evaluate=function(P){var J=this.input.evaluate(P);if(typeof J=="string")return J.length;if(Array.isArray(J))return J.length;throw new ru("Expected value to be of type string or array, but found "+cu(xu(J))+" instead.")},ro.prototype.eachChild=function(P){P(this.input)},ro.prototype.outputDefined=function(){return!1},ro.prototype.serialize=function(){var P=["length"];return this.eachChild(function(J){P.push(J.serialize())}),P};var Ts={"==":ii,"!=":bo,">":rs,"<":os,">=":ls,"<=":fs,array:Xc,at:Wf,boolean:Xc,case:xh,coalesce:Ef,collator:Pf,format:ph,image:Lu,in:qu,"index-of":Yc,interpolate:Oc,"interpolate-hcl":Oc,"interpolate-lab":Oc,length:ro,let:ih,literal:ul,match:Nu,number:Xc,"number-format":To,object:Xc,slice:Xf,step:df,string:Xc,"to-boolean":al,"to-color":al,"to-number":al,"to-string":al,var:gh,within:ff};function il(D,P){var J=P[0],me=P[1],De=P[2],He=P[3];J=J.evaluate(D),me=me.evaluate(D),De=De.evaluate(D);var nt=He?He.evaluate(D):1,Mt=Rc(J,me,De,nt);if(Mt)throw new ru(Mt);return new ql(J/255*nt,me/255*nt,De/255*nt,nt)}function Hl(D,P){return D in P}function mu(D,P){var J=P[D];return typeof J>"u"?null:J}function Xl(D,P,J,me){for(;J<=me;){var De=J+me>>1;if(P[De]===D)return!0;P[De]>D?me=De-1:J=De+1}return!1}function gu(D){return{type:D}}ns.register(Ts,{error:[Iu,[Os],function(D,P){var J=P[0];throw new ru(J.evaluate(D))}],typeof:[Os,[ts],function(D,P){var J=P[0];return cu(xu(J.evaluate(D)))}],"to-rgba":[su(Eo,4),[pu],function(D,P){var J=P[0];return J.evaluate(D).toArray()}],rgb:[pu,[Eo,Eo,Eo],il],rgba:[pu,[Eo,Eo,Eo,Eo],il],has:{type:ws,overloads:[[[Os],function(D,P){var J=P[0];return Hl(J.evaluate(D),D.properties())}],[[Os,vu],function(D,P){var J=P[0],me=P[1];return Hl(J.evaluate(D),me.evaluate(D))}]]},get:{type:ts,overloads:[[[Os],function(D,P){var J=P[0];return mu(J.evaluate(D),D.properties())}],[[Os,vu],function(D,P){var J=P[0],me=P[1];return mu(J.evaluate(D),me.evaluate(D))}]]},"feature-state":[ts,[Os],function(D,P){var J=P[0];return mu(J.evaluate(D),D.featureState||{})}],properties:[vu,[],function(D){return D.properties()}],"geometry-type":[Os,[],function(D){return D.geometryType()}],id:[ts,[],function(D){return D.id()}],zoom:[Eo,[],function(D){return D.globals.zoom}],"heatmap-density":[Eo,[],function(D){return D.globals.heatmapDensity||0}],"line-progress":[Eo,[],function(D){return D.globals.lineProgress||0}],accumulated:[ts,[],function(D){return D.globals.accumulated===void 0?null:D.globals.accumulated}],"+":[Eo,gu(Eo),function(D,P){for(var J=0,me=0,De=P;me":[ws,[Os,ts],function(D,P){var J=P[0],me=P[1],De=D.properties()[J.value],He=me.value;return typeof De==typeof He&&De>He}],"filter-id->":[ws,[ts],function(D,P){var J=P[0],me=D.id(),De=J.value;return typeof me==typeof De&&me>De}],"filter-<=":[ws,[Os,ts],function(D,P){var J=P[0],me=P[1],De=D.properties()[J.value],He=me.value;return typeof De==typeof He&&De<=He}],"filter-id-<=":[ws,[ts],function(D,P){var J=P[0],me=D.id(),De=J.value;return typeof me==typeof De&&me<=De}],"filter->=":[ws,[Os,ts],function(D,P){var J=P[0],me=P[1],De=D.properties()[J.value],He=me.value;return typeof De==typeof He&&De>=He}],"filter-id->=":[ws,[ts],function(D,P){var J=P[0],me=D.id(),De=J.value;return typeof me==typeof De&&me>=De}],"filter-has":[ws,[ts],function(D,P){var J=P[0];return J.value in D.properties()}],"filter-has-id":[ws,[],function(D){return D.id()!==null&&D.id()!==void 0}],"filter-type-in":[ws,[su(Os)],function(D,P){var J=P[0];return J.value.indexOf(D.geometryType())>=0}],"filter-id-in":[ws,[su(ts)],function(D,P){var J=P[0];return J.value.indexOf(D.id())>=0}],"filter-in-small":[ws,[Os,su(ts)],function(D,P){var J=P[0],me=P[1];return me.value.indexOf(D.properties()[J.value])>=0}],"filter-in-large":[ws,[Os,su(ts)],function(D,P){var J=P[0],me=P[1];return Xl(D.properties()[J.value],me.value,0,me.value.length-1)}],all:{type:ws,overloads:[[[ws,ws],function(D,P){var J=P[0],me=P[1];return J.evaluate(D)&&me.evaluate(D)}],[gu(ws),function(D,P){for(var J=0,me=P;J-1}function Vo(D){return!!D.expression&&D.expression.interpolated}function Fs(D){return D instanceof Number?"number":D instanceof String?"string":D instanceof Boolean?"boolean":Array.isArray(D)?"array":D===null?"null":typeof D}function nu(D){return typeof D=="object"&&D!==null&&!Array.isArray(D)}function Fl(D){return D}function jc(D,P){var J=P.type==="color",me=D.stops&&typeof D.stops[0][0]=="object",De=me||D.property!==void 0,He=me||!De,nt=D.type||(Vo(P)?"exponential":"interval");if(J&&(D=Qs({},D),D.stops&&(D.stops=D.stops.map(function($o){return[$o[0],ql.parse($o[1])]})),D.default?D.default=ql.parse(D.default):D.default=ql.parse(P.default)),D.colorSpace&&D.colorSpace!=="rgb"&&!bp[D.colorSpace])throw new Error("Unknown color space: "+D.colorSpace);var Mt,tr,vr;if(nt==="exponential")Mt=qc;else if(nt==="interval")Mt=kh;else if(nt==="categorical"){Mt=Zc,tr=Object.create(null);for(var Ar=0,Zr=D.stops;Ar=D.stops[me-1][0])return D.stops[me-1][1];var De=Vc(D.stops.map(function(He){return He[0]}),J);return D.stops[De][1]}function qc(D,P,J){var me=D.base!==void 0?D.base:1;if(Fs(J)!=="number")return Gc(D.default,P.default);var De=D.stops.length;if(De===1||J<=D.stops[0][0])return D.stops[0][1];if(J>=D.stops[De-1][0])return D.stops[De-1][1];var He=Vc(D.stops.map(function(Zr){return Zr[0]}),J),nt=Ku(J,me,D.stops[He][0],D.stops[He+1][0]),Mt=D.stops[He][1],tr=D.stops[He+1][1],vr=yh[P.type]||Fl;if(D.colorSpace&&D.colorSpace!=="rgb"){var Ar=bp[D.colorSpace];vr=function(Zr,mn){return Ar.reverse(Ar.interpolate(Ar.forward(Zr),Ar.forward(mn),nt))}}return typeof Mt.evaluate=="function"?{evaluate:function(){for(var mn=[],hn=arguments.length;hn--;)mn[hn]=arguments[hn];var zn=Mt.evaluate.apply(void 0,mn),pa=tr.evaluate.apply(void 0,mn);if(!(zn===void 0||pa===void 0))return vr(zn,pa,nt)}}:vr(Mt,tr,nt)}function oh(D,P,J){return P.type==="color"?J=ql.parse(J):P.type==="formatted"?J=Lc.fromString(J.toString()):P.type==="resolvedImage"?J=mc.fromString(J.toString()):Fs(J)!==P.type&&(P.type!=="enum"||!P.values[J])&&(J=void 0),Gc(J,D.default,P.default)}function Ku(D,P,J,me){var De=me-J,He=D-J;return De===0?0:P===1?He/De:(Math.pow(P,He)-1)/(Math.pow(P,De)-1)}var sh=function(P,J){this.expression=P,this._warningHistory={},this._evaluator=new Ol,this._defaultValue=J?Ue(J):null,this._enumValues=J&&J.type==="enum"?J.values:null};sh.prototype.evaluateWithoutErrorHandling=function(P,J,me,De,He,nt){return this._evaluator.globals=P,this._evaluator.feature=J,this._evaluator.featureState=me,this._evaluator.canonical=De,this._evaluator.availableImages=He||null,this._evaluator.formattedSection=nt,this.expression.evaluate(this._evaluator)},sh.prototype.evaluate=function(P,J,me,De,He,nt){this._evaluator.globals=P,this._evaluator.feature=J||null,this._evaluator.featureState=me||null,this._evaluator.canonical=De,this._evaluator.availableImages=He||null,this._evaluator.formattedSection=nt||null;try{var Mt=this.expression.evaluate(this._evaluator);if(Mt==null||typeof Mt=="number"&&Mt!==Mt)return this._defaultValue;if(this._enumValues&&!(Mt in this._enumValues))throw new ru("Expected value to be one of "+Object.keys(this._enumValues).map(function(tr){return JSON.stringify(tr)}).join(", ")+", but found "+JSON.stringify(Mt)+" instead.");return Mt}catch(tr){return this._warningHistory[tr.message]||(this._warningHistory[tr.message]=!0,typeof console<"u"&&console.warn(tr.message)),this._defaultValue}};function hs(D){return Array.isArray(D)&&D.length>0&&typeof D[0]=="string"&&D[0]in Ts}function Ss(D,P){var J=new bu(Ts,[],P?Oe(P):void 0),me=J.parse(D,void 0,void 0,void 0,P&&P.type==="string"?{typeAnnotation:"coerce"}:void 0);return me?wl(new sh(me,P)):Zu(J.errors)}var lh=function(P,J){this.kind=P,this._styleExpression=J,this.isStateDependent=P!=="constant"&&!Vu(J.expression)};lh.prototype.evaluateWithoutErrorHandling=function(P,J,me,De,He,nt){return this._styleExpression.evaluateWithoutErrorHandling(P,J,me,De,He,nt)},lh.prototype.evaluate=function(P,J,me,De,He,nt){return this._styleExpression.evaluate(P,J,me,De,He,nt)};var Cf=function(P,J,me,De){this.kind=P,this.zoomStops=me,this._styleExpression=J,this.isStateDependent=P!=="camera"&&!Vu(J.expression),this.interpolationType=De};Cf.prototype.evaluateWithoutErrorHandling=function(P,J,me,De,He,nt){return this._styleExpression.evaluateWithoutErrorHandling(P,J,me,De,He,nt)},Cf.prototype.evaluate=function(P,J,me,De,He,nt){return this._styleExpression.evaluate(P,J,me,De,He,nt)},Cf.prototype.interpolationFactor=function(P,J,me){return this.interpolationType?Oc.interpolationFactor(this.interpolationType,P,J,me):0};function vf(D,P){if(D=Ss(D,P),D.result==="error")return D;var J=D.value.expression,me=zd(J);if(!me&&!Hu(P))return Zu([new dl("","data expressions not supported")]);var De=hf(J,["zoom"]);if(!De&&!fu(P))return Zu([new dl("","zoom expressions not supported")]);var He=ve(J);if(!He&&!De)return Zu([new dl("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(He instanceof dl)return Zu([He]);if(He instanceof Oc&&!Vo(P))return Zu([new dl("",'"interpolate" expressions cannot be used with this property')]);if(!He)return wl(me?new lh("constant",D.value):new lh("source",D.value));var nt=He instanceof Oc?He.interpolation:void 0;return wl(me?new Cf("camera",D.value,He.labels,nt):new Cf("composite",D.value,He.labels,nt))}var Qe=function(P,J){this._parameters=P,this._specification=J,Qs(this,jc(this._parameters,this._specification))};Qe.deserialize=function(P){return new Qe(P._parameters,P._specification)},Qe.serialize=function(P){return{_parameters:P._parameters,_specification:P._specification}};function N(D,P){if(nu(D))return new Qe(D,P);if(hs(D)){var J=vf(D,P);if(J.result==="error")throw new Error(J.value.map(function(De){return De.key+": "+De.message}).join(", "));return J.value}else{var me=D;return typeof D=="string"&&P.type==="color"&&(me=ql.parse(D)),{kind:"constant",evaluate:function(){return me}}}}function ve(D){var P=null;if(D instanceof ih)P=ve(D.result);else if(D instanceof Ef)for(var J=0,me=D.args;Jme.maximum?[new Mo(P,J,J+" is greater than the maximum value "+me.maximum)]:[]}function ir(D){var P=D.valueSpec,J=as(D.value.type),me,De={},He,nt,Mt=J!=="categorical"&&D.value.property===void 0,tr=!Mt,vr=Fs(D.value.stops)==="array"&&Fs(D.value.stops[0])==="array"&&Fs(D.value.stops[0][0])==="object",Ar=Ke({key:D.key,value:D.value,valueSpec:D.styleSpec.function,style:D.style,styleSpec:D.styleSpec,objectElementValidators:{stops:Zr,default:zn}});return J==="identity"&&Mt&&Ar.push(new Mo(D.key,D.value,'missing required property "property"')),J!=="identity"&&!D.value.stops&&Ar.push(new Mo(D.key,D.value,'missing required property "stops"')),J==="exponential"&&D.valueSpec.expression&&!Vo(D.valueSpec)&&Ar.push(new Mo(D.key,D.value,"exponential functions not supported")),D.styleSpec.$version>=8&&(tr&&!Hu(D.valueSpec)?Ar.push(new Mo(D.key,D.value,"property functions not supported")):Mt&&!fu(D.valueSpec)&&Ar.push(new Mo(D.key,D.value,"zoom functions not supported"))),(J==="categorical"||vr)&&D.value.property===void 0&&Ar.push(new Mo(D.key,D.value,'"property" property is required')),Ar;function Zr(pa){if(J==="identity")return[new Mo(pa.key,pa.value,'identity function may not have a "stops" property')];var li=[],Ba=pa.value;return li=li.concat(It({key:pa.key,value:Ba,valueSpec:pa.valueSpec,style:pa.style,styleSpec:pa.styleSpec,arrayElementValidator:mn})),Fs(Ba)==="array"&&Ba.length===0&&li.push(new Mo(pa.key,Ba,"array must have at least one stop")),li}function mn(pa){var li=[],Ba=pa.value,Gi=pa.key;if(Fs(Ba)!=="array")return[new Mo(Gi,Ba,"array expected, "+Fs(Ba)+" found")];if(Ba.length!==2)return[new Mo(Gi,Ba,"array length 2 expected, length "+Ba.length+" found")];if(vr){if(Fs(Ba[0])!=="object")return[new Mo(Gi,Ba,"object expected, "+Fs(Ba[0])+" found")];if(Ba[0].zoom===void 0)return[new Mo(Gi,Ba,"object stop key must have zoom")];if(Ba[0].value===void 0)return[new Mo(Gi,Ba,"object stop key must have value")];if(nt&&nt>as(Ba[0].zoom))return[new Mo(Gi,Ba[0].zoom,"stop zoom values must appear in ascending order")];as(Ba[0].zoom)!==nt&&(nt=as(Ba[0].zoom),He=void 0,De={}),li=li.concat(Ke({key:Gi+"[0]",value:Ba[0],valueSpec:{zoom:{}},style:pa.style,styleSpec:pa.styleSpec,objectElementValidators:{zoom:$t,value:hn}}))}else li=li.concat(hn({key:Gi+"[0]",value:Ba[0],style:pa.style,styleSpec:pa.styleSpec},Ba));return hs(tu(Ba[1]))?li.concat([new Mo(Gi+"[1]",Ba[1],"expressions are not allowed in function stops.")]):li.concat(yl({key:Gi+"[1]",value:Ba[1],valueSpec:P,style:pa.style,styleSpec:pa.styleSpec}))}function hn(pa,li){var Ba=Fs(pa.value),Gi=as(pa.value),xi=pa.value!==null?pa.value:li;if(!me)me=Ba;else if(Ba!==me)return[new Mo(pa.key,xi,Ba+" stop domain type must match previous stop domain type "+me)];if(Ba!=="number"&&Ba!=="string"&&Ba!=="boolean")return[new Mo(pa.key,xi,"stop domain value must be a number, string, or boolean")];if(Ba!=="number"&&J!=="categorical"){var Vi="number expected, "+Ba+" found";return Hu(P)&&J===void 0&&(Vi+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Mo(pa.key,xi,Vi)]}return J==="categorical"&&Ba==="number"&&(!isFinite(Gi)||Math.floor(Gi)!==Gi)?[new Mo(pa.key,xi,"integer expected, found "+Gi)]:J!=="categorical"&&Ba==="number"&&He!==void 0&&Gi=2&&D[1]!=="$id"&&D[1]!=="$type";case"in":return D.length>=3&&(typeof D[1]!="string"||Array.isArray(D[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return D.length!==3||Array.isArray(D[1])||Array.isArray(D[2]);case"any":case"all":for(var P=0,J=D.slice(1);PP?1:0}function Rt(D){if(!Array.isArray(D))return!1;if(D[0]==="within")return!0;for(var P=1;P"||P==="<="||P===">="?Ut(D[1],D[2],P):P==="any"?er(D.slice(1)):P==="all"?["all"].concat(D.slice(1).map(Yt)):P==="none"?["all"].concat(D.slice(1).map(Yt).map(jr)):P==="in"?Mr(D[1],D.slice(2)):P==="!in"?jr(Mr(D[1],D.slice(2))):P==="has"?Nr(D[1]):P==="!has"?jr(Nr(D[1])):P==="within"?D:!0;return J}function Ut(D,P,J){switch(D){case"$type":return["filter-type-"+J,P];case"$id":return["filter-id-"+J,P];default:return["filter-"+J,D,P]}}function er(D){return["any"].concat(D.map(Yt))}function Mr(D,P){if(P.length===0)return!1;switch(D){case"$type":return["filter-type-in",["literal",P]];case"$id":return["filter-id-in",["literal",P]];default:return P.length>200&&!P.some(function(J){return typeof J!=typeof P[0]})?["filter-in-large",D,["literal",P.sort(St)]]:["filter-in-small",D,["literal",P]]}}function Nr(D){switch(D){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",D]}}function jr(D){return["!",D]}function sn(D){return Dn(tu(D.value))?Tr(Qs({},D,{expressionContext:"filter",valueSpec:{value:"boolean"}})):xn(D)}function xn(D){var P=D.value,J=D.key;if(Fs(P)!=="array")return[new Mo(J,P,"array expected, "+Fs(P)+" found")];var me=D.styleSpec,De,He=[];if(P.length<1)return[new Mo(J,P,"filter array must have at least 1 element")];switch(He=He.concat(vn({key:J+"[0]",value:P[0],valueSpec:me.filter_operator,style:D.style,styleSpec:D.styleSpec})),as(P[0])){case"<":case"<=":case">":case">=":P.length>=2&&as(P[1])==="$type"&&He.push(new Mo(J,P,'"$type" cannot be use with operator "'+P[0]+'"'));case"==":case"!=":P.length!==3&&He.push(new Mo(J,P,'filter array for operator "'+P[0]+'" must have 3 elements'));case"in":case"!in":P.length>=2&&(De=Fs(P[1]),De!=="string"&&He.push(new Mo(J+"[1]",P[1],"string expected, "+De+" found")));for(var nt=2;nt=Ar[hn+0]&&me>=Ar[hn+1])?(nt[mn]=!0,He.push(vr[mn])):nt[mn]=!1}}},pt.prototype._forEachCell=function(D,P,J,me,De,He,nt,Mt){for(var tr=this._convertToCellCoord(D),vr=this._convertToCellCoord(P),Ar=this._convertToCellCoord(J),Zr=this._convertToCellCoord(me),mn=tr;mn<=Ar;mn++)for(var hn=vr;hn<=Zr;hn++){var zn=this.d*hn+mn;if(!(Mt&&!Mt(this._convertFromCellCoord(mn),this._convertFromCellCoord(hn),this._convertFromCellCoord(mn+1),this._convertFromCellCoord(hn+1)))&&De.call(this,D,P,J,me,zn,He,nt,Mt))return}},pt.prototype._convertFromCellCoord=function(D){return(D-this.padding)/this.scale},pt.prototype._convertToCellCoord=function(D){return Math.max(0,Math.min(this.d-1,Math.floor(D*this.scale)+this.padding))},pt.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var D=this.cells,P=Ye+this.cells.length+1+1,J=0,me=0;me=0)){var Zr=D[Ar];vr[Ar]=Wt[tr].shallow.indexOf(Ar)>=0?Zr:on(Zr,P)}D instanceof Error&&(vr.message=D.message)}if(vr.$name)throw new Error("$name property is reserved for worker serialization logic.");return tr!=="Object"&&(vr.$name=tr),vr}throw new Error("can't serialize object of type "+typeof D)}function En(D){if(D==null||typeof D=="boolean"||typeof D=="number"||typeof D=="string"||D instanceof Boolean||D instanceof Number||D instanceof String||D instanceof Date||D instanceof RegExp||Rr(D)||ln(D)||ArrayBuffer.isView(D)||D instanceof Dt)return D;if(Array.isArray(D))return D.map(En);if(typeof D=="object"){var P=D.$name||"Object",J=Wt[P],me=J.klass;if(!me)throw new Error("can't deserialize unregistered class "+P);if(me.deserialize)return me.deserialize(D);for(var De=Object.create(me.prototype),He=0,nt=Object.keys(D);He=0?tr:En(tr)}}return De}throw new Error("can't deserialize object of type "+typeof D)}var Un=function(){this.first=!0};Un.prototype.update=function(P,J){var me=Math.floor(P);return this.first?(this.first=!1,this.lastIntegerZoom=me,this.lastIntegerZoomTime=0,this.lastZoom=P,this.lastFloorZoom=me,!0):(this.lastFloorZoom>me?(this.lastIntegerZoom=me+1,this.lastIntegerZoomTime=J):this.lastFloorZoom=128&&D<=255},Arabic:function(D){return D>=1536&&D<=1791},"Arabic Supplement":function(D){return D>=1872&&D<=1919},"Arabic Extended-A":function(D){return D>=2208&&D<=2303},"Hangul Jamo":function(D){return D>=4352&&D<=4607},"Unified Canadian Aboriginal Syllabics":function(D){return D>=5120&&D<=5759},Khmer:function(D){return D>=6016&&D<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(D){return D>=6320&&D<=6399},"General Punctuation":function(D){return D>=8192&&D<=8303},"Letterlike Symbols":function(D){return D>=8448&&D<=8527},"Number Forms":function(D){return D>=8528&&D<=8591},"Miscellaneous Technical":function(D){return D>=8960&&D<=9215},"Control Pictures":function(D){return D>=9216&&D<=9279},"Optical Character Recognition":function(D){return D>=9280&&D<=9311},"Enclosed Alphanumerics":function(D){return D>=9312&&D<=9471},"Geometric Shapes":function(D){return D>=9632&&D<=9727},"Miscellaneous Symbols":function(D){return D>=9728&&D<=9983},"Miscellaneous Symbols and Arrows":function(D){return D>=11008&&D<=11263},"CJK Radicals Supplement":function(D){return D>=11904&&D<=12031},"Kangxi Radicals":function(D){return D>=12032&&D<=12255},"Ideographic Description Characters":function(D){return D>=12272&&D<=12287},"CJK Symbols and Punctuation":function(D){return D>=12288&&D<=12351},Hiragana:function(D){return D>=12352&&D<=12447},Katakana:function(D){return D>=12448&&D<=12543},Bopomofo:function(D){return D>=12544&&D<=12591},"Hangul Compatibility Jamo":function(D){return D>=12592&&D<=12687},Kanbun:function(D){return D>=12688&&D<=12703},"Bopomofo Extended":function(D){return D>=12704&&D<=12735},"CJK Strokes":function(D){return D>=12736&&D<=12783},"Katakana Phonetic Extensions":function(D){return D>=12784&&D<=12799},"Enclosed CJK Letters and Months":function(D){return D>=12800&&D<=13055},"CJK Compatibility":function(D){return D>=13056&&D<=13311},"CJK Unified Ideographs Extension A":function(D){return D>=13312&&D<=19903},"Yijing Hexagram Symbols":function(D){return D>=19904&&D<=19967},"CJK Unified Ideographs":function(D){return D>=19968&&D<=40959},"Yi Syllables":function(D){return D>=40960&&D<=42127},"Yi Radicals":function(D){return D>=42128&&D<=42191},"Hangul Jamo Extended-A":function(D){return D>=43360&&D<=43391},"Hangul Syllables":function(D){return D>=44032&&D<=55215},"Hangul Jamo Extended-B":function(D){return D>=55216&&D<=55295},"Private Use Area":function(D){return D>=57344&&D<=63743},"CJK Compatibility Ideographs":function(D){return D>=63744&&D<=64255},"Arabic Presentation Forms-A":function(D){return D>=64336&&D<=65023},"Vertical Forms":function(D){return D>=65040&&D<=65055},"CJK Compatibility Forms":function(D){return D>=65072&&D<=65103},"Small Form Variants":function(D){return D>=65104&&D<=65135},"Arabic Presentation Forms-B":function(D){return D>=65136&&D<=65279},"Halfwidth and Fullwidth Forms":function(D){return D>=65280&&D<=65519}};function Xa(D){for(var P=0,J=D;P=65097&&D<=65103)||Gn["CJK Compatibility Ideographs"](D)||Gn["CJK Compatibility"](D)||Gn["CJK Radicals Supplement"](D)||Gn["CJK Strokes"](D)||Gn["CJK Symbols and Punctuation"](D)&&!(D>=12296&&D<=12305)&&!(D>=12308&&D<=12319)&&D!==12336||Gn["CJK Unified Ideographs Extension A"](D)||Gn["CJK Unified Ideographs"](D)||Gn["Enclosed CJK Letters and Months"](D)||Gn["Hangul Compatibility Jamo"](D)||Gn["Hangul Jamo Extended-A"](D)||Gn["Hangul Jamo Extended-B"](D)||Gn["Hangul Jamo"](D)||Gn["Hangul Syllables"](D)||Gn.Hiragana(D)||Gn["Ideographic Description Characters"](D)||Gn.Kanbun(D)||Gn["Kangxi Radicals"](D)||Gn["Katakana Phonetic Extensions"](D)||Gn.Katakana(D)&&D!==12540||Gn["Halfwidth and Fullwidth Forms"](D)&&D!==65288&&D!==65289&&D!==65293&&!(D>=65306&&D<=65310)&&D!==65339&&D!==65341&&D!==65343&&!(D>=65371&&D<=65503)&&D!==65507&&!(D>=65512&&D<=65519)||Gn["Small Form Variants"](D)&&!(D>=65112&&D<=65118)&&!(D>=65123&&D<=65126)||Gn["Unified Canadian Aboriginal Syllabics"](D)||Gn["Unified Canadian Aboriginal Syllabics Extended"](D)||Gn["Vertical Forms"](D)||Gn["Yijing Hexagram Symbols"](D)||Gn["Yi Syllables"](D)||Gn["Yi Radicals"](D))}function Za(D){return!!(Gn["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||Gn["General Punctuation"](D)&&(D===8214||D===8224||D===8225||D===8240||D===8241||D===8251||D===8252||D===8258||D===8263||D===8264||D===8265||D===8273)||Gn["Letterlike Symbols"](D)||Gn["Number Forms"](D)||Gn["Miscellaneous Technical"](D)&&(D>=8960&&D<=8967||D>=8972&&D<=8991||D>=8996&&D<=9e3||D===9003||D>=9085&&D<=9114||D>=9150&&D<=9165||D===9167||D>=9169&&D<=9179||D>=9186&&D<=9215)||Gn["Control Pictures"](D)&&D!==9251||Gn["Optical Character Recognition"](D)||Gn["Enclosed Alphanumerics"](D)||Gn["Geometric Shapes"](D)||Gn["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||Gn["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||Gn["CJK Symbols and Punctuation"](D)||Gn.Katakana(D)||Gn["Private Use Area"](D)||Gn["CJK Compatibility Forms"](D)||Gn["Small Form Variants"](D)||Gn["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)}function Ta(D){return!(Va(D)||Za(D))}function Ii(D){return Gn.Arabic(D)||Gn["Arabic Supplement"](D)||Gn["Arabic Extended-A"](D)||Gn["Arabic Presentation Forms-A"](D)||Gn["Arabic Presentation Forms-B"](D)}function wo(D){return D>=1424&&D<=2303||Gn["Arabic Presentation Forms-A"](D)||Gn["Arabic Presentation Forms-B"](D)}function so(D,P){return!(!P&&wo(D)||D>=2304&&D<=3583||D>=3840&&D<=4255||Gn.Khmer(D))}function yo(D){for(var P=0,J=D;P-1&&(Qo=Yo.error),pl&&pl(D)};function ec(){wu.fire(new en("pluginStateChange",{pluginStatus:Qo,pluginURL:Cs}))}var wu=new Wr,zo=function(){return Qo},Ks=function(D){return D({pluginStatus:Qo,pluginURL:Cs}),wu.on("pluginStateChange",D),D},_l=function(D,P,J){if(J===void 0&&(J=!1),Qo===Yo.deferred||Qo===Yo.loading||Qo===Yo.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Cs=Ne.resolveURL(D),Qo=Yo.deferred,pl=P,ec(),J||yu()},yu=function(){if(Qo!==Yo.deferred||!Cs)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Qo=Yo.loading,ec(),Cs&&In({url:Cs},function(D){D?Tl(D):(Qo=Yo.loaded,ec())})},au={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Qo===Yo.loaded||au.applyArabicShaping!=null},isLoading:function(){return Qo===Yo.loading},setState:function(P){Qo=P.pluginStatus,Cs=P.pluginURL},isParsed:function(){return au.applyArabicShaping!=null&&au.processBidirectionalText!=null&&au.processStyledBidirectionalText!=null},getPluginURL:function(){return Cs}},Kc=function(){!au.isLoading()&&!au.isLoaded()&&zo()==="deferred"&&yu()},Yl=function(P,J){this.zoom=P,J?(this.now=J.now,this.fadeDuration=J.fadeDuration,this.zoomHistory=J.zoomHistory,this.transition=J.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Un,this.transition={})};Yl.prototype.isSupportedScript=function(P){return jo(P,au.isLoaded())},Yl.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Yl.prototype.getCrossfadeParameters=function(){var P=this.zoom,J=P-Math.floor(P),me=this.crossFadingFactor();return P>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:J+(1-J)*me}:{fromScale:.5,toScale:1,t:1-(1-me)*J}};var _u=function(P,J){this.property=P,this.value=J,this.expression=N(J===void 0?P.specification.default:J,P.specification)};_u.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},_u.prototype.possiblyEvaluate=function(P,J,me){return this.property.possiblyEvaluate(this,P,J,me)};var kf=function(P){this.property=P,this.value=new _u(P,void 0)};kf.prototype.transitioned=function(P,J){return new Ct(this.property,this.value,J,T({},P.transition,this.transition),P.now)},kf.prototype.untransitioned=function(){return new Ct(this.property,this.value,null,{},0)};var Ju=function(P){this._properties=P,this._values=Object.create(P.defaultTransitionablePropertyValues)};Ju.prototype.getValue=function(P){return j(this._values[P].value.value)},Ju.prototype.setValue=function(P,J){this._values.hasOwnProperty(P)||(this._values[P]=new kf(this._values[P].property)),this._values[P].value=new _u(this._values[P].property,J===null?void 0:j(J))},Ju.prototype.getTransition=function(P){return j(this._values[P].transition)},Ju.prototype.setTransition=function(P,J){this._values.hasOwnProperty(P)||(this._values[P]=new kf(this._values[P].property)),this._values[P].transition=j(J)||void 0},Ju.prototype.serialize=function(){for(var P={},J=0,me=Object.keys(this._values);Jthis.end)return this.prior=null,He;if(this.value.isDataDriven())return this.prior=null,He;if(Dent.zoomHistory.lastIntegerZoom?{from:me,to:De}:{from:He,to:De}},P.prototype.interpolate=function(me){return me},P})(Mn),Ja=function(P){this.specification=P};Ja.prototype.possiblyEvaluate=function(P,J,me,De){if(P.value!==void 0)if(P.expression.kind==="constant"){var He=P.expression.evaluate(J,null,{},me,De);return this._calculate(He,He,He,J)}else return this._calculate(P.expression.evaluate(new Yl(Math.floor(J.zoom-1),J)),P.expression.evaluate(new Yl(Math.floor(J.zoom),J)),P.expression.evaluate(new Yl(Math.floor(J.zoom+1),J)),J)},Ja.prototype._calculate=function(P,J,me,De){var He=De.zoom;return He>De.zoomHistory.lastIntegerZoom?{from:P,to:J}:{from:me,to:J}},Ja.prototype.interpolate=function(P){return P};var Qa=function(P){this.specification=P};Qa.prototype.possiblyEvaluate=function(P,J,me,De){return!!P.expression.evaluate(J,null,{},me,De)},Qa.prototype.interpolate=function(){return!1};var mi=function(P){this.properties=P,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var J in P){var me=P[J];me.specification.overridable&&this.overridableProperties.push(J);var De=this.defaultPropertyValues[J]=new _u(me,void 0),He=this.defaultTransitionablePropertyValues[J]=new kf(me);this.defaultTransitioningPropertyValues[J]=He.untransitioned(),this.defaultPossiblyEvaluatedValues[J]=De.possiblyEvaluate({})}};dr("DataDrivenProperty",Mn),dr("DataConstantProperty",Ln),dr("CrossFadedDataDrivenProperty",ei),dr("CrossFadedProperty",Ja),dr("ColorRampProperty",Qa);var fo="-transition",Hi=(function(D){function P(J,me){if(D.call(this),this.id=J.id,this.type=J.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},J.type!=="custom"&&(J=J,this.metadata=J.metadata,this.minzoom=J.minzoom,this.maxzoom=J.maxzoom,J.type!=="background"&&(this.source=J.source,this.sourceLayer=J["source-layer"],this.filter=J.filter),me.layout&&(this._unevaluatedLayout=new zr(me.layout)),me.paint)){this._transitionablePaint=new Ju(me.paint);for(var De in J.paint)this.setPaintProperty(De,J.paint[De],{validate:!1});for(var He in J.layout)this.setLayoutProperty(He,J.layout[He],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ca(me.paint)}}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},P.prototype.getLayoutProperty=function(me){return me==="visibility"?this.visibility:this._unevaluatedLayout.getValue(me)},P.prototype.setLayoutProperty=function(me,De,He){if(He===void 0&&(He={}),De!=null){var nt="layers."+this.id+".layout."+me;if(this._validate(Pc,nt,me,De,He))return}if(me==="visibility"){this.visibility=De;return}this._unevaluatedLayout.setValue(me,De)},P.prototype.getPaintProperty=function(me){return U(me,fo)?this._transitionablePaint.getTransition(me.slice(0,-fo.length)):this._transitionablePaint.getValue(me)},P.prototype.setPaintProperty=function(me,De,He){if(He===void 0&&(He={}),De!=null){var nt="layers."+this.id+".paint."+me;if(this._validate(Qu,nt,me,De,He))return!1}if(U(me,fo))return this._transitionablePaint.setTransition(me.slice(0,-fo.length),De||void 0),!1;var Mt=this._transitionablePaint._values[me],tr=Mt.property.specification["property-type"]==="cross-faded-data-driven",vr=Mt.value.isDataDriven(),Ar=Mt.value;this._transitionablePaint.setValue(me,De),this._handleSpecialPaintPropertyUpdate(me);var Zr=this._transitionablePaint._values[me].value,mn=Zr.isDataDriven();return mn||vr||tr||this._handleOverridablePaintPropertyUpdate(me,Ar,Zr)},P.prototype._handleSpecialPaintPropertyUpdate=function(me){},P.prototype._handleOverridablePaintPropertyUpdate=function(me,De,He){return!1},P.prototype.isHidden=function(me){return this.minzoom&&me=this.maxzoom?!0:this.visibility==="none"},P.prototype.updateTransitions=function(me){this._transitioningPaint=this._transitionablePaint.transitioned(me,this._transitioningPaint)},P.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},P.prototype.recalculate=function(me,De){me.getCrossfadeParameters&&(this._crossfadeParameters=me.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(me,void 0,De)),this.paint=this._transitioningPaint.possiblyEvaluate(me,void 0,De)},P.prototype.serialize=function(){var me={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&&(me.layout=me.layout||{},me.layout.visibility=this.visibility),G(me,function(De,He){return De!==void 0&&!(He==="layout"&&!Object.keys(De).length)&&!(He==="paint"&&!Object.keys(De).length)})},P.prototype._validate=function(me,De,He,nt,Mt){return Mt===void 0&&(Mt={}),Mt&&Mt.validate===!1?!1:mf(this,me.call(Ys,{key:De,layerType:this.type,objectKey:He,value:nt,styleSpec:Bi,style:{glyphs:!0,sprite:!0}}))},P.prototype.is3D=function(){return!1},P.prototype.isTileClipped=function(){return!1},P.prototype.hasOffscreenPass=function(){return!1},P.prototype.resize=function(){},P.prototype.isStateDependent=function(){for(var me in this.paint._values){var De=this.paint.get(me);if(!(!(De instanceof qn)||!Hu(De.property.specification))&&(De.value.kind==="source"||De.value.kind==="composite")&&De.value.isStateDependent)return!0}return!1},P})(Wr),hi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},za=function(P,J){this._structArray=P,this._pos1=J*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},gn=128,ea=5,ga=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};ga.serialize=function(P,J){return P._trim(),J&&(P.isTransferred=!0,J.push(P.arrayBuffer)),{length:P.length,arrayBuffer:P.arrayBuffer}},ga.deserialize=function(P){var J=Object.create(this.prototype);return J.arrayBuffer=P.arrayBuffer,J.length=P.length,J.capacity=P.arrayBuffer.byteLength/J.bytesPerElement,J._refreshViews(),J},ga.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ga.prototype.clear=function(){this.length=0},ga.prototype.resize=function(P){this.reserve(P),this.length=P},ga.prototype.reserve=function(P){if(P>this.capacity){this.capacity=Math.max(P,Math.floor(this.capacity*ea),gn),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var J=this.uint8;this._refreshViews(),J&&this.uint8.set(J)}},ga.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function Na(D,P){P===void 0&&(P=1);var J=0,me=0,De=D.map(function(nt){var Mt=ba(nt.type),tr=J=Fi(J,Math.max(P,Mt)),vr=nt.components||1;return me=Math.max(me,Mt),J+=Mt*vr,{name:nt.name,type:nt.type,components:vr,offset:tr}}),He=Fi(J,Math.max(me,P));return{members:De,size:He,alignment:P}}function ba(D){return hi[D].BYTES_PER_ELEMENT}function Fi(D,P){return Math.ceil(D/P)*P}var oi=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De){var He=this.length;return this.resize(He+1),this.emplace(He,me,De)},P.prototype.emplace=function(me,De,He){var nt=me*2;return this.int16[nt+0]=De,this.int16[nt+1]=He,me},P})(ga);oi.prototype.bytesPerElement=4,dr("StructArrayLayout2i4",oi);var io=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He,nt){var Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,me,De,He,nt)},P.prototype.emplace=function(me,De,He,nt,Mt){var tr=me*4;return this.int16[tr+0]=De,this.int16[tr+1]=He,this.int16[tr+2]=nt,this.int16[tr+3]=Mt,me},P})(ga);io.prototype.bytesPerElement=8,dr("StructArrayLayout4i8",io);var wa=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He,nt,Mt,tr){var vr=this.length;return this.resize(vr+1),this.emplace(vr,me,De,He,nt,Mt,tr)},P.prototype.emplace=function(me,De,He,nt,Mt,tr,vr){var Ar=me*6;return this.int16[Ar+0]=De,this.int16[Ar+1]=He,this.int16[Ar+2]=nt,this.int16[Ar+3]=Mt,this.int16[Ar+4]=tr,this.int16[Ar+5]=vr,me},P})(ga);wa.prototype.bytesPerElement=12,dr("StructArrayLayout2i4i12",wa);var ca=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He,nt,Mt,tr){var vr=this.length;return this.resize(vr+1),this.emplace(vr,me,De,He,nt,Mt,tr)},P.prototype.emplace=function(me,De,He,nt,Mt,tr,vr){var Ar=me*4,Zr=me*8;return this.int16[Ar+0]=De,this.int16[Ar+1]=He,this.uint8[Zr+4]=nt,this.uint8[Zr+5]=Mt,this.uint8[Zr+6]=tr,this.uint8[Zr+7]=vr,me},P})(ga);ca.prototype.bytesPerElement=8,dr("StructArrayLayout2i4ub8",ca);var Ri=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De){var He=this.length;return this.resize(He+1),this.emplace(He,me,De)},P.prototype.emplace=function(me,De,He){var nt=me*2;return this.float32[nt+0]=De,this.float32[nt+1]=He,me},P})(ga);Ri.prototype.bytesPerElement=8,dr("StructArrayLayout2f8",Ri);var Zn=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He,nt,Mt,tr,vr,Ar,Zr,mn){var hn=this.length;return this.resize(hn+1),this.emplace(hn,me,De,He,nt,Mt,tr,vr,Ar,Zr,mn)},P.prototype.emplace=function(me,De,He,nt,Mt,tr,vr,Ar,Zr,mn,hn){var zn=me*10;return this.uint16[zn+0]=De,this.uint16[zn+1]=He,this.uint16[zn+2]=nt,this.uint16[zn+3]=Mt,this.uint16[zn+4]=tr,this.uint16[zn+5]=vr,this.uint16[zn+6]=Ar,this.uint16[zn+7]=Zr,this.uint16[zn+8]=mn,this.uint16[zn+9]=hn,me},P})(ga);Zn.prototype.bytesPerElement=20,dr("StructArrayLayout10ui20",Zn);var yi=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He,nt,Mt,tr,vr,Ar,Zr,mn,hn,zn){var pa=this.length;return this.resize(pa+1),this.emplace(pa,me,De,He,nt,Mt,tr,vr,Ar,Zr,mn,hn,zn)},P.prototype.emplace=function(me,De,He,nt,Mt,tr,vr,Ar,Zr,mn,hn,zn,pa){var li=me*12;return this.int16[li+0]=De,this.int16[li+1]=He,this.int16[li+2]=nt,this.int16[li+3]=Mt,this.uint16[li+4]=tr,this.uint16[li+5]=vr,this.uint16[li+6]=Ar,this.uint16[li+7]=Zr,this.int16[li+8]=mn,this.int16[li+9]=hn,this.int16[li+10]=zn,this.int16[li+11]=pa,me},P})(ga);yi.prototype.bytesPerElement=24,dr("StructArrayLayout4i4ui4i24",yi);var ti=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He){var nt=this.length;return this.resize(nt+1),this.emplace(nt,me,De,He)},P.prototype.emplace=function(me,De,He,nt){var Mt=me*3;return this.float32[Mt+0]=De,this.float32[Mt+1]=He,this.float32[Mt+2]=nt,me},P})(ga);ti.prototype.bytesPerElement=12,dr("StructArrayLayout3f12",ti);var lo=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me){var De=this.length;return this.resize(De+1),this.emplace(De,me)},P.prototype.emplace=function(me,De){var He=me*1;return this.uint32[He+0]=De,me},P})(ga);lo.prototype.bytesPerElement=4,dr("StructArrayLayout1ul4",lo);var Jo=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.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)},P.prototype.emplaceBack=function(me,De,He,nt,Mt,tr,vr,Ar,Zr){var mn=this.length;return this.resize(mn+1),this.emplace(mn,me,De,He,nt,Mt,tr,vr,Ar,Zr)},P.prototype.emplace=function(me,De,He,nt,Mt,tr,vr,Ar,Zr,mn){var hn=me*10,zn=me*5;return this.int16[hn+0]=De,this.int16[hn+1]=He,this.int16[hn+2]=nt,this.int16[hn+3]=Mt,this.int16[hn+4]=tr,this.int16[hn+5]=vr,this.uint32[zn+3]=Ar,this.uint16[hn+8]=Zr,this.uint16[hn+9]=mn,me},P})(ga);Jo.prototype.bytesPerElement=20,dr("StructArrayLayout6i1ul2ui20",Jo);var Wi=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He,nt,Mt,tr){var vr=this.length;return this.resize(vr+1),this.emplace(vr,me,De,He,nt,Mt,tr)},P.prototype.emplace=function(me,De,He,nt,Mt,tr,vr){var Ar=me*6;return this.int16[Ar+0]=De,this.int16[Ar+1]=He,this.int16[Ar+2]=nt,this.int16[Ar+3]=Mt,this.int16[Ar+4]=tr,this.int16[Ar+5]=vr,me},P})(ga);Wi.prototype.bytesPerElement=12,dr("StructArrayLayout2i2i2i12",Wi);var vo=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He,nt,Mt){var tr=this.length;return this.resize(tr+1),this.emplace(tr,me,De,He,nt,Mt)},P.prototype.emplace=function(me,De,He,nt,Mt,tr){var vr=me*4,Ar=me*8;return this.float32[vr+0]=De,this.float32[vr+1]=He,this.float32[vr+2]=nt,this.int16[Ar+6]=Mt,this.int16[Ar+7]=tr,me},P})(ga);vo.prototype.bytesPerElement=16,dr("StructArrayLayout2f1f2i16",vo);var vi=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He,nt){var Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,me,De,He,nt)},P.prototype.emplace=function(me,De,He,nt,Mt){var tr=me*12,vr=me*3;return this.uint8[tr+0]=De,this.uint8[tr+1]=He,this.float32[vr+1]=nt,this.float32[vr+2]=Mt,me},P})(ga);vi.prototype.bytesPerElement=12,dr("StructArrayLayout2ub2f12",vi);var Ho=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He){var nt=this.length;return this.resize(nt+1),this.emplace(nt,me,De,He)},P.prototype.emplace=function(me,De,He,nt){var Mt=me*3;return this.uint16[Mt+0]=De,this.uint16[Mt+1]=He,this.uint16[Mt+2]=nt,me},P})(ga);Ho.prototype.bytesPerElement=6,dr("StructArrayLayout3ui6",Ho);var us=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.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)},P.prototype.emplaceBack=function(me,De,He,nt,Mt,tr,vr,Ar,Zr,mn,hn,zn,pa,li,Ba,Gi,xi){var Vi=this.length;return this.resize(Vi+1),this.emplace(Vi,me,De,He,nt,Mt,tr,vr,Ar,Zr,mn,hn,zn,pa,li,Ba,Gi,xi)},P.prototype.emplace=function(me,De,He,nt,Mt,tr,vr,Ar,Zr,mn,hn,zn,pa,li,Ba,Gi,xi,Vi){var eo=me*24,So=me*12,Go=me*48;return this.int16[eo+0]=De,this.int16[eo+1]=He,this.uint16[eo+2]=nt,this.uint16[eo+3]=Mt,this.uint32[So+2]=tr,this.uint32[So+3]=vr,this.uint32[So+4]=Ar,this.uint16[eo+10]=Zr,this.uint16[eo+11]=mn,this.uint16[eo+12]=hn,this.float32[So+7]=zn,this.float32[So+8]=pa,this.uint8[Go+36]=li,this.uint8[Go+37]=Ba,this.uint8[Go+38]=Gi,this.uint32[So+10]=xi,this.int16[eo+22]=Vi,me},P})(ga);us.prototype.bytesPerElement=48,dr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",us);var _s=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.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)},P.prototype.emplaceBack=function(me,De,He,nt,Mt,tr,vr,Ar,Zr,mn,hn,zn,pa,li,Ba,Gi,xi,Vi,eo,So,Go,$o,ks,is,gs,Nl,Ms,Ns){var hu=this.length;return this.resize(hu+1),this.emplace(hu,me,De,He,nt,Mt,tr,vr,Ar,Zr,mn,hn,zn,pa,li,Ba,Gi,xi,Vi,eo,So,Go,$o,ks,is,gs,Nl,Ms,Ns)},P.prototype.emplace=function(me,De,He,nt,Mt,tr,vr,Ar,Zr,mn,hn,zn,pa,li,Ba,Gi,xi,Vi,eo,So,Go,$o,ks,is,gs,Nl,Ms,Ns,hu){var El=me*34,lc=me*17;return this.int16[El+0]=De,this.int16[El+1]=He,this.int16[El+2]=nt,this.int16[El+3]=Mt,this.int16[El+4]=tr,this.int16[El+5]=vr,this.int16[El+6]=Ar,this.int16[El+7]=Zr,this.uint16[El+8]=mn,this.uint16[El+9]=hn,this.uint16[El+10]=zn,this.uint16[El+11]=pa,this.uint16[El+12]=li,this.uint16[El+13]=Ba,this.uint16[El+14]=Gi,this.uint16[El+15]=xi,this.uint16[El+16]=Vi,this.uint16[El+17]=eo,this.uint16[El+18]=So,this.uint16[El+19]=Go,this.uint16[El+20]=$o,this.uint16[El+21]=ks,this.uint16[El+22]=is,this.uint32[lc+12]=gs,this.float32[lc+13]=Nl,this.float32[lc+14]=Ms,this.float32[lc+15]=Ns,this.float32[lc+16]=hu,me},P})(ga);_s.prototype.bytesPerElement=68,dr("StructArrayLayout8i15ui1ul4f68",_s);var Dl=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me){var De=this.length;return this.resize(De+1),this.emplace(De,me)},P.prototype.emplace=function(me,De){var He=me*1;return this.float32[He+0]=De,me},P})(ga);Dl.prototype.bytesPerElement=4,dr("StructArrayLayout1f4",Dl);var xs=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He){var nt=this.length;return this.resize(nt+1),this.emplace(nt,me,De,He)},P.prototype.emplace=function(me,De,He,nt){var Mt=me*3;return this.int16[Mt+0]=De,this.int16[Mt+1]=He,this.int16[Mt+2]=nt,me},P})(ga);xs.prototype.bytesPerElement=6,dr("StructArrayLayout3i6",xs);var Wu=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He){var nt=this.length;return this.resize(nt+1),this.emplace(nt,me,De,He)},P.prototype.emplace=function(me,De,He,nt){var Mt=me*2,tr=me*4;return this.uint32[Mt+0]=De,this.uint16[tr+2]=He,this.uint16[tr+3]=nt,me},P})(ga);Wu.prototype.bytesPerElement=8,dr("StructArrayLayout1ul2ui8",Wu);var xl=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De){var He=this.length;return this.resize(He+1),this.emplace(He,me,De)},P.prototype.emplace=function(me,De,He){var nt=me*2;return this.uint16[nt+0]=De,this.uint16[nt+1]=He,me},P})(ga);xl.prototype.bytesPerElement=4,dr("StructArrayLayout2ui4",xl);var Fu=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me){var De=this.length;return this.resize(De+1),this.emplace(De,me)},P.prototype.emplace=function(me,De){var He=me*1;return this.uint16[He+0]=De,me},P})(ga);Fu.prototype.bytesPerElement=2,dr("StructArrayLayout1ui2",Fu);var oc=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(me,De,He,nt){var Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,me,De,He,nt)},P.prototype.emplace=function(me,De,He,nt,Mt){var tr=me*4;return this.float32[tr+0]=De,this.float32[tr+1]=He,this.float32[tr+2]=nt,this.float32[tr+3]=Mt,me},P})(ga);oc.prototype.bytesPerElement=16,dr("StructArrayLayout4f16",oc);var xc=(function(D){function P(){D.apply(this,arguments)}D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P;var J={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 J.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},J.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},J.x1.get=function(){return this._structArray.int16[this._pos2+2]},J.y1.get=function(){return this._structArray.int16[this._pos2+3]},J.x2.get=function(){return this._structArray.int16[this._pos2+4]},J.y2.get=function(){return this._structArray.int16[this._pos2+5]},J.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},J.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},J.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},J.anchorPoint.get=function(){return new s(this.anchorPointX,this.anchorPointY)},Object.defineProperties(P.prototype,J),P})(za);xc.prototype.size=20;var Yf=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.get=function(me){return new xc(this,me)},P})(Jo);dr("CollisionBoxArray",Yf);var Tu=(function(D){function P(){D.apply(this,arguments)}D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P;var J={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 J.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},J.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},J.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},J.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},J.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},J.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},J.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},J.segment.get=function(){return this._structArray.uint16[this._pos2+10]},J.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},J.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},J.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},J.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},J.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},J.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},J.placedOrientation.set=function(me){this._structArray.uint8[this._pos1+37]=me},J.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},J.hidden.set=function(me){this._structArray.uint8[this._pos1+38]=me},J.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},J.crossTileID.set=function(me){this._structArray.uint32[this._pos4+10]=me},J.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(P.prototype,J),P})(za);Tu.prototype.size=48;var Du=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.get=function(me){return new Tu(this,me)},P})(us);dr("PlacedSymbolArray",Du);var Fo=(function(D){function P(){D.apply(this,arguments)}D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P;var J={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 J.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},J.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},J.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},J.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},J.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},J.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},J.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},J.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},J.key.get=function(){return this._structArray.uint16[this._pos2+8]},J.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},J.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},J.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},J.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},J.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},J.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},J.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},J.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},J.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},J.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},J.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},J.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},J.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},J.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},J.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},J.crossTileID.set=function(me){this._structArray.uint32[this._pos4+12]=me},J.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},J.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},J.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},J.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(P.prototype,J),P})(za);Fo.prototype.size=68;var bc=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.get=function(me){return new Fo(this,me)},P})(_s);dr("SymbolInstanceArray",bc);var sl=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.getoffsetX=function(me){return this.float32[me*1+0]},P})(Dl);dr("GlyphOffsetArray",sl);var iu=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.getx=function(me){return this.int16[me*3+0]},P.prototype.gety=function(me){return this.int16[me*3+1]},P.prototype.gettileUnitDistanceFromAnchor=function(me){return this.int16[me*3+2]},P})(xs);dr("SymbolLineVertexArray",iu);var Fc=(function(D){function P(){D.apply(this,arguments)}D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P;var J={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return J.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},J.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},J.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(P.prototype,J),P})(za);Fc.prototype.size=8;var Bc=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.get=function(me){return new Fc(this,me)},P})(Wu);dr("FeatureIndexArray",Bc);var Zo=Na([{name:"a_pos",components:2,type:"Int16"}],4),Ds=Zo.members,Bs=function(P){P===void 0&&(P=[]),this.segments=P};Bs.prototype.prepareSegment=function(P,J,me,De){var He=this.segments[this.segments.length-1];return P>Bs.MAX_VERTEX_ARRAY_LENGTH&&W("Max vertices per segment is "+Bs.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+P),(!He||He.vertexLength+P>Bs.MAX_VERTEX_ARRAY_LENGTH||He.sortKey!==De)&&(He={vertexOffset:J.length,primitiveOffset:me.length,vertexLength:0,primitiveLength:0},De!==void 0&&(He.sortKey=De),this.segments.push(He)),He},Bs.prototype.get=function(){return this.segments},Bs.prototype.destroy=function(){for(var P=0,J=this.segments;P>>16)*tr&65535)<<16)&4294967295,Ar=Ar<<15|Ar>>>17,Ar=(Ar&65535)*vr+(((Ar>>>16)*vr&65535)<<16)&4294967295,nt^=Ar,nt=nt<<13|nt>>>19,Mt=(nt&65535)*5+(((nt>>>16)*5&65535)<<16)&4294967295,nt=(Mt&65535)+27492+(((Mt>>>16)+58964&65535)<<16);switch(Ar=0,De){case 3:Ar^=(J.charCodeAt(Zr+2)&255)<<16;case 2:Ar^=(J.charCodeAt(Zr+1)&255)<<8;case 1:Ar^=J.charCodeAt(Zr)&255,Ar=(Ar&65535)*tr+(((Ar>>>16)*tr&65535)<<16)&4294967295,Ar=Ar<<15|Ar>>>17,Ar=(Ar&65535)*vr+(((Ar>>>16)*vr&65535)<<16)&4294967295,nt^=Ar}return nt^=J.length,nt^=nt>>>16,nt=(nt&65535)*2246822507+(((nt>>>16)*2246822507&65535)<<16)&4294967295,nt^=nt>>>13,nt=(nt&65535)*3266489909+(((nt>>>16)*3266489909&65535)<<16)&4294967295,nt^=nt>>>16,nt>>>0}D.exports=P}),ie=r(function(D){function P(J,me){for(var De=J.length,He=me^De,nt=0,Mt;De>=4;)Mt=J.charCodeAt(nt)&255|(J.charCodeAt(++nt)&255)<<8|(J.charCodeAt(++nt)&255)<<16|(J.charCodeAt(++nt)&255)<<24,Mt=(Mt&65535)*1540483477+(((Mt>>>16)*1540483477&65535)<<16),Mt^=Mt>>>24,Mt=(Mt&65535)*1540483477+(((Mt>>>16)*1540483477&65535)<<16),He=(He&65535)*1540483477+(((He>>>16)*1540483477&65535)<<16)^Mt,De-=4,++nt;switch(De){case 3:He^=(J.charCodeAt(nt+2)&255)<<16;case 2:He^=(J.charCodeAt(nt+1)&255)<<8;case 1:He^=J.charCodeAt(nt)&255,He=(He&65535)*1540483477+(((He>>>16)*1540483477&65535)<<16)}return He^=He>>>13,He=(He&65535)*1540483477+(((He>>>16)*1540483477&65535)<<16),He^=He>>>15,He>>>0}D.exports=P}),Me=we,tt=we,wt=ie;Me.murmur3=tt,Me.murmur2=wt;var Et=function(){this.ids=[],this.positions=[],this.indexed=!1};Et.prototype.add=function(P,J,me,De){this.ids.push(gt(P)),this.positions.push(J,me,De)},Et.prototype.getPositions=function(P){for(var J=gt(P),me=0,De=this.ids.length-1;me>1;this.ids[He]>=J?De=He:me=He+1}for(var nt=[];this.ids[me]===J;){var Mt=this.positions[3*me],tr=this.positions[3*me+1],vr=this.positions[3*me+2];nt.push({index:Mt,start:tr,end:vr}),me++}return nt},Et.serialize=function(P,J){var me=new Float64Array(P.ids),De=new Uint32Array(P.positions);return Pt(me,De,0,me.length-1),J&&J.push(me.buffer,De.buffer),{ids:me,positions:De}},Et.deserialize=function(P){var J=new Et;return J.ids=P.ids,J.positions=P.positions,J.indexed=!0,J};var lt=Math.pow(2,53)-1;function gt(D){var P=+D;return!isNaN(P)&&P<=lt?P:Me(String(D))}function Pt(D,P,J,me){for(;J>1],He=J-1,nt=me+1;;){do He++;while(D[He]De);if(He>=nt)break;lr(D,He,nt),lr(P,3*He,3*nt),lr(P,3*He+1,3*nt+1),lr(P,3*He+2,3*nt+2)}nt-Jnt.x+1||trnt.y+1)&&W("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return J}function $l(D,P){return{type:D.type,id:D.id,properties:D.properties,geometry:P?Pl(D):[]}}function Ul(D,P,J,me,De){D.emplaceBack(P*2+(me+1)/2,J*2+(De+1)/2)}var wc=function(P){this.zoom=P.zoom,this.overscaling=P.overscaling,this.layers=P.layers,this.layerIds=this.layers.map(function(J){return J.id}),this.index=P.index,this.hasPattern=!1,this.layoutVertexArray=new oi,this.indexArray=new Ho,this.segments=new Bs,this.programConfigurations=new ka(P.layers,P.zoom),this.stateDependentLayerIds=this.layers.filter(function(J){return J.isStateDependent()}).map(function(J){return J.id})};wc.prototype.populate=function(P,J,me){var De=this.layers[0],He=[],nt=null;De.type==="circle"&&(nt=De.layout.get("circle-sort-key"));for(var Mt=0,tr=P;Mt=mo||mn<0||mn>=mo)){var hn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,P.sortKey),zn=hn.vertexLength;Ul(this.layoutVertexArray,Zr,mn,-1,-1),Ul(this.layoutVertexArray,Zr,mn,1,-1),Ul(this.layoutVertexArray,Zr,mn,1,1),Ul(this.layoutVertexArray,Zr,mn,-1,1),this.indexArray.emplaceBack(zn,zn+1,zn+2),this.indexArray.emplaceBack(zn,zn+3,zn+2),hn.vertexLength+=4,hn.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,P,me,{},De)},dr("CircleBucket",wc,{omit:["layers"]});function Ml(D,P){for(var J=0;J=3){for(var He=0;He1){if(am(D,P))return!0;for(var me=0;me1?D.distSqr(J):D.distSqr(J.sub(P)._mult(De)._add(P))}function Jm(D,P){for(var J=!1,me,De,He,nt=0;ntP.y!=He.y>P.y&&P.x<(He.x-De.x)*(P.y-De.y)/(He.y-De.y)+De.x&&(J=!J)}return J}function ev(D,P){for(var J=!1,me=0,De=D.length-1;meP.y!=nt.y>P.y&&P.x<(nt.x-He.x)*(P.y-He.y)/(nt.y-He.y)+He.x&&(J=!J)}return J}function Qm(D,P,J,me,De){for(var He=0,nt=D;He=Mt.x&&De>=Mt.y)return!0}var tr=[new s(P,J),new s(P,De),new s(me,De),new s(me,J)];if(D.length>2)for(var vr=0,Ar=tr;vrDe.x&&P.x>De.x||D.yDe.y&&P.y>De.y)return!1;var He=ee(D,P,J[0]);return He!==ee(D,P,J[1])||He!==ee(D,P,J[2])||He!==ee(D,P,J[3])}function tv(D,P,J){var me=P.paint.get(D).value;return me.kind==="constant"?me.value:J.programConfigurations.get(P.id).getMaxValue(D)}function im(D){return Math.sqrt(D[0]*D[0]+D[1]*D[1])}function Rm(D,P,J,me,De){if(!P[0]&&!P[1])return D;var He=s.convert(P)._mult(De);J==="viewport"&&He._rotate(-me);for(var nt=[],Mt=0;Mt0&&(He=1/Math.sqrt(He)),D[0]=P[0]*He,D[1]=P[1]*He,D[2]=P[2]*He,D}function l4(D,P){return D[0]*P[0]+D[1]*P[1]+D[2]*P[2]}function u4(D,P,J){var me=P[0],De=P[1],He=P[2],nt=J[0],Mt=J[1],tr=J[2];return D[0]=De*tr-He*Mt,D[1]=He*nt-me*tr,D[2]=me*Mt-De*nt,D}function c4(D,P,J){var me=P[0],De=P[1],He=P[2];return D[0]=me*J[0]+De*J[3]+He*J[6],D[1]=me*J[1]+De*J[4]+He*J[7],D[2]=me*J[2]+De*J[5]+He*J[8],D}var f4=Zy;(function(){var D=Yy();return function(P,J,me,De,He,nt){var Mt,tr;for(J||(J=3),me||(me=0),De?tr=Math.min(De*J+me,P.length):tr=P.length,Mt=me;MtD.width||De.height>D.height||J.x>D.width-De.width||J.y>D.height-De.height)throw new RangeError("out of range source coordinates for image copy");if(De.width>P.width||De.height>P.height||me.x>P.width-De.width||me.y>P.height-De.height)throw new RangeError("out of range destination coordinates for image copy");for(var nt=D.data,Mt=P.data,tr=0;tr80*J){Mt=vr=D[0],tr=Ar=D[1];for(var zn=J;znvr&&(vr=Zr),mn>Ar&&(Ar=mn);hn=Math.max(vr-Mt,Ar-tr),hn=hn!==0?1/hn:0}return l_(He,nt,J,Mt,tr,hn),nt}function cE(D,P,J,me,De){var He,nt;if(De===mE(D,P,J,me)>0)for(He=P;He=P;He-=me)nt=l6(He,D[He],D[He+1],nt);return nt&&Ox(nt,nt.next)&&(e2(nt),nt=nt.next),nt}function K0(D,P){if(!D)return D;P||(P=D);var J=D,me;do if(me=!1,!J.steiner&&(Ox(J,J.next)||Uh(J.prev,J,J.next)===0)){if(e2(J),J=P=J.prev,J===J.next)break;me=!0}else J=J.next;while(me||J!==P);return P}function l_(D,P,J,me,De,He,nt){if(D){!nt&&He&&hE(D,me,De,He);for(var Mt=D,tr,vr;D.prev!==D.next;){if(tr=D.prev,vr=D.next,He?y4(D,me,De,He):fE(D)){P.push(tr.i/J),P.push(D.i/J),P.push(vr.i/J),e2(D),D=vr.next,Mt=vr.next;continue}if(D=vr,D===Mt){nt?nt===1?(D=_4(K0(D),P,J),l_(D,P,J,me,De,He,2)):nt===2&&i6(D,P,J,me,De,He):l_(K0(D),P,J,me,De,He,1);break}}}}function fE(D){var P=D.prev,J=D,me=D.next;if(Uh(P,J,me)>=0)return!1;for(var De=D.next.next;De!==D.prev;){if(Qy(P.x,P.y,J.x,J.y,me.x,me.y,De.x,De.y)&&Uh(De.prev,De,De.next)>=0)return!1;De=De.next}return!0}function y4(D,P,J,me){var De=D.prev,He=D,nt=D.next;if(Uh(De,He,nt)>=0)return!1;for(var Mt=De.xHe.x?De.x>nt.x?De.x:nt.x:He.x>nt.x?He.x:nt.x,Ar=De.y>He.y?De.y>nt.y?De.y:nt.y:He.y>nt.y?He.y:nt.y,Zr=dE(Mt,tr,P,J,me),mn=dE(vr,Ar,P,J,me),hn=D.prevZ,zn=D.nextZ;hn&&hn.z>=Zr&&zn&&zn.z<=mn;){if(hn!==D.prev&&hn!==D.next&&Qy(De.x,De.y,He.x,He.y,nt.x,nt.y,hn.x,hn.y)&&Uh(hn.prev,hn,hn.next)>=0||(hn=hn.prevZ,zn!==D.prev&&zn!==D.next&&Qy(De.x,De.y,He.x,He.y,nt.x,nt.y,zn.x,zn.y)&&Uh(zn.prev,zn,zn.next)>=0))return!1;zn=zn.nextZ}for(;hn&&hn.z>=Zr;){if(hn!==D.prev&&hn!==D.next&&Qy(De.x,De.y,He.x,He.y,nt.x,nt.y,hn.x,hn.y)&&Uh(hn.prev,hn,hn.next)>=0)return!1;hn=hn.prevZ}for(;zn&&zn.z<=mn;){if(zn!==D.prev&&zn!==D.next&&Qy(De.x,De.y,He.x,He.y,nt.x,nt.y,zn.x,zn.y)&&Uh(zn.prev,zn,zn.next)>=0)return!1;zn=zn.nextZ}return!0}function _4(D,P,J){var me=D;do{var De=me.prev,He=me.next.next;!Ox(De,He)&&u_(De,me,me.next,He)&&Fx(De,He)&&Fx(He,De)&&(P.push(De.i/J),P.push(me.i/J),P.push(He.i/J),e2(me),e2(me.next),me=D=He),me=me.next}while(me!==D);return K0(me)}function i6(D,P,J,me,De,He){var nt=D;do{for(var Mt=nt.next.next;Mt!==nt.prev;){if(nt.i!==Mt.i&&b4(nt,Mt)){var tr=vE(nt,Mt);nt=K0(nt,nt.next),tr=K0(tr,tr.next),l_(nt,P,J,me,De,He),l_(tr,P,J,me,De,He);return}Mt=Mt.next}nt=nt.next}while(nt!==D)}function o6(D,P,J,me){var De=[],He,nt,Mt,tr,vr;for(He=0,nt=P.length;He=J.next.y&&J.next.y!==J.y){var Mt=J.x+(De-J.y)*(J.next.x-J.x)/(J.next.y-J.y);if(Mt<=me&&Mt>He){if(He=Mt,Mt===me){if(De===J.y)return J;if(De===J.next.y)return J.next}nt=J.x=J.x&&J.x>=vr&&me!==J.x&&Qy(Dent.x||J.x===nt.x&&s6(nt,J)))&&(nt=J,Zr=mn)),J=J.next;while(J!==tr);return nt}function s6(D,P){return Uh(D.prev,D,P.prev)<0&&Uh(P.next,D,D.next)<0}function hE(D,P,J,me){var De=D;do De.z===null&&(De.z=dE(De.x,De.y,P,J,me)),De.prevZ=De.prev,De.nextZ=De.next,De=De.next;while(De!==D);De.prevZ.nextZ=null,De.prevZ=null,x4(De)}function x4(D){var P,J,me,De,He,nt,Mt,tr,vr=1;do{for(J=D,D=null,He=null,nt=0;J;){for(nt++,me=J,Mt=0,P=0;P0||tr>0&&me;)Mt!==0&&(tr===0||!me||J.z<=me.z)?(De=J,J=J.nextZ,Mt--):(De=me,me=me.nextZ,tr--),He?He.nextZ=De:D=De,De.prevZ=He,He=De;J=me}He.nextZ=null,vr*=2}while(nt>1);return D}function dE(D,P,J,me,De){return D=32767*(D-J)*De,P=32767*(P-me)*De,D=(D|D<<8)&16711935,D=(D|D<<4)&252645135,D=(D|D<<2)&858993459,D=(D|D<<1)&1431655765,P=(P|P<<8)&16711935,P=(P|P<<4)&252645135,P=(P|P<<2)&858993459,P=(P|P<<1)&1431655765,D|P<<1}function YT(D){var P=D,J=D;do(P.x=0&&(D-nt)*(me-Mt)-(J-nt)*(P-Mt)>=0&&(J-nt)*(He-Mt)-(De-nt)*(me-Mt)>=0}function b4(D,P){return D.next.i!==P.i&&D.prev.i!==P.i&&!pE(D,P)&&(Fx(D,P)&&Fx(P,D)&&ZT(D,P)&&(Uh(D.prev,D,P.prev)||Uh(D,P.prev,P))||Ox(D,P)&&Uh(D.prev,D,D.next)>0&&Uh(P.prev,P,P.next)>0)}function Uh(D,P,J){return(P.y-D.y)*(J.x-P.x)-(P.x-D.x)*(J.y-P.y)}function Ox(D,P){return D.x===P.x&&D.y===P.y}function u_(D,P,J,me){var De=Qw(Uh(D,P,J)),He=Qw(Uh(D,P,me)),nt=Qw(Uh(J,me,D)),Mt=Qw(Uh(J,me,P));return!!(De!==He&&nt!==Mt||De===0&&Jw(D,J,P)||He===0&&Jw(D,me,P)||nt===0&&Jw(J,D,me)||Mt===0&&Jw(J,P,me))}function Jw(D,P,J){return P.x<=Math.max(D.x,J.x)&&P.x>=Math.min(D.x,J.x)&&P.y<=Math.max(D.y,J.y)&&P.y>=Math.min(D.y,J.y)}function Qw(D){return D>0?1:D<0?-1:0}function pE(D,P){var J=D;do{if(J.i!==D.i&&J.next.i!==D.i&&J.i!==P.i&&J.next.i!==P.i&&u_(J,J.next,D,P))return!0;J=J.next}while(J!==D);return!1}function Fx(D,P){return Uh(D.prev,D,D.next)<0?Uh(D,P,D.next)>=0&&Uh(D,D.prev,P)>=0:Uh(D,P,D.prev)<0||Uh(D,D.next,P)<0}function ZT(D,P){var J=D,me=!1,De=(D.x+P.x)/2,He=(D.y+P.y)/2;do J.y>He!=J.next.y>He&&J.next.y!==J.y&&De<(J.next.x-J.x)*(He-J.y)/(J.next.y-J.y)+J.x&&(me=!me),J=J.next;while(J!==D);return me}function vE(D,P){var J=new KT(D.i,D.x,D.y),me=new KT(P.i,P.x,P.y),De=D.next,He=P.prev;return D.next=P,P.prev=D,J.next=De,De.prev=J,me.next=J,J.prev=me,He.next=me,me.prev=He,me}function l6(D,P,J,me){var De=new KT(D,P,J);return me?(De.next=me.next,De.prev=me,me.next.prev=De,me.next=De):(De.prev=De,De.next=De),De}function e2(D){D.next.prev=D.prev,D.prev.next=D.next,D.prevZ&&(D.prevZ.nextZ=D.nextZ),D.nextZ&&(D.nextZ.prevZ=D.prevZ)}function KT(D,P,J){this.i=D,this.x=P,this.y=J,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}XT.deviation=function(D,P,J,me){var De=P&&P.length,He=De?P[0]*J:D.length,nt=Math.abs(mE(D,0,He,J));if(De)for(var Mt=0,tr=P.length;Mt0&&(me+=D[De-1].length,J.holes.push(me))}return J},WT.default=a6;function w4(D,P,J,me,De){u6(D,P,J,me||D.length-1,De||gE)}function u6(D,P,J,me,De){for(;me>J;){if(me-J>600){var He=me-J+1,nt=P-J+1,Mt=Math.log(He),tr=.5*Math.exp(2*Mt/3),vr=.5*Math.sqrt(Mt*tr*(He-tr)/He)*(nt-He/2<0?-1:1),Ar=Math.max(J,Math.floor(P-nt*tr/He+vr)),Zr=Math.min(me,Math.floor(P+(He-nt)*tr/He+vr));u6(D,P,Ar,Zr,De)}var mn=D[P],hn=J,zn=me;for(t2(D,J,P),De(D[me],mn)>0&&t2(D,J,me);hn0;)zn--}De(D[J],mn)===0?t2(D,J,zn):(zn++,t2(D,zn,me)),zn<=P&&(J=zn+1),P<=zn&&(me=zn-1)}}function t2(D,P,J){var me=D[P];D[P]=D[J],D[J]=me}function gE(D,P){return DP?1:0}function l0(D,P){var J=D.length;if(J<=1)return[D];for(var me=[],De,He,nt=0;nt1)for(var tr=0;tr>3}if(me--,J===1||J===2)De+=D.readSVarint(),He+=D.readSVarint(),J===1&&(Mt&&nt.push(Mt),Mt=[]),Mt.push(new s(De,He));else if(J===7)Mt&&Mt.push(Mt[0].clone());else throw new Error("unknown command "+J)}return Mt&&nt.push(Mt),nt},c_.prototype.bbox=function(){var D=this._pbf;D.pos=this._geometry;for(var P=D.readVarint()+D.pos,J=1,me=0,De=0,He=0,nt=1/0,Mt=-1/0,tr=1/0,vr=-1/0;D.pos>3}if(me--,J===1||J===2)De+=D.readSVarint(),He+=D.readSVarint(),DeMt&&(Mt=De),Hevr&&(vr=He);else if(J!==7)throw new Error("unknown command "+J)}return[nt,tr,Mt,vr]},c_.prototype.toGeoJSON=function(D,P,J){var me=this.extent*Math.pow(2,J),De=this.extent*D,He=this.extent*P,nt=this.loadGeometry(),Mt=c_.types[this.type],tr,vr;function Ar(hn){for(var zn=0;zn>3;P=me===1?D.readString():me===2?D.readFloat():me===3?D.readDouble():me===4?D.readVarint64():me===5?D.readVarint():me===6?D.readSVarint():me===7?D.readBoolean():null}return P}y6.prototype.feature=function(D){if(D<0||D>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[D];var P=this._pbf.readVarint()+this._pbf.pos;return new Bx(this._pbf,P,this.extent,this._keys,this._values)};var x6=b6;function b6(D,P){this.layers=D.readFields(w6,{},P)}function w6(D,P,J){if(D===3){var me=new xE(J,J.readVarint()+J.pos);me.length&&(P[me.name]=me)}}var T6=x6,T4=Bx,A4=xE,f_={VectorTile:T6,VectorTileFeature:T4,VectorTileLayer:A4},Ux=f_.VectorTileFeature.types,A6=500,$x=Math.pow(2,13);function Vx(D,P,J,me,De,He,nt,Mt){D.emplaceBack(P,J,Math.floor(me*$x)*2+nt,De*$x*2,He*$x*2,Math.round(Mt))}var lm=function(P){this.zoom=P.zoom,this.overscaling=P.overscaling,this.layers=P.layers,this.layerIds=this.layers.map(function(J){return J.id}),this.index=P.index,this.hasPattern=!1,this.layoutVertexArray=new wa,this.indexArray=new Ho,this.programConfigurations=new ka(P.layers,P.zoom),this.segments=new Bs,this.stateDependentLayerIds=this.layers.filter(function(J){return J.isStateDependent()}).map(function(J){return J.id})};lm.prototype.populate=function(P,J,me){this.features=[],this.hasPattern=JT("fill-extrusion",this.layers,J);for(var De=0,He=P;De=1){var Vi=li[Gi-1];if(!eA(xi,Vi)){hn.vertexLength+4>Bs.MAX_VERTEX_ARRAY_LENGTH&&(hn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var eo=xi.sub(Vi)._perp()._unit(),So=Vi.dist(xi);Ba+So>32768&&(Ba=0),Vx(this.layoutVertexArray,xi.x,xi.y,eo.x,eo.y,0,0,Ba),Vx(this.layoutVertexArray,xi.x,xi.y,eo.x,eo.y,0,1,Ba),Ba+=So,Vx(this.layoutVertexArray,Vi.x,Vi.y,eo.x,eo.y,0,0,Ba),Vx(this.layoutVertexArray,Vi.x,Vi.y,eo.x,eo.y,0,1,Ba);var Go=hn.vertexLength;this.indexArray.emplaceBack(Go,Go+2,Go+1),this.indexArray.emplaceBack(Go+1,Go+2,Go+3),hn.vertexLength+=4,hn.primitiveLength+=2}}}}if(hn.vertexLength+vr>Bs.MAX_VERTEX_ARRAY_LENGTH&&(hn=this.segments.prepareSegment(vr,this.layoutVertexArray,this.indexArray)),Ux[P.type]==="Polygon"){for(var $o=[],ks=[],is=hn.vertexLength,gs=0,Nl=tr;gsmo)||D.y===P.y&&(D.y<0||D.y>mo)}function tA(D){return D.every(function(P){return P.x<0})||D.every(function(P){return P.x>mo})||D.every(function(P){return P.y<0})||D.every(function(P){return P.y>mo})}var S4=new mi({"fill-extrusion-opacity":new Ln(Bi["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Mn(Bi["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ln(Bi["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ln(Bi["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ei(Bi["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Mn(Bi["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Mn(Bi["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ln(Bi["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),E4={paint:S4},C4=(function(D){function P(J){D.call(this,J,E4)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.createBucket=function(me){return new lm(me)},P.prototype.queryRadius=function(){return im(this.paint.get("fill-extrusion-translate"))},P.prototype.is3D=function(){return!0},P.prototype.queryIntersectsFeature=function(me,De,He,nt,Mt,tr,vr,Ar){var Zr=Rm(me,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),tr.angle,vr),mn=this.paint.get("fill-extrusion-height").evaluate(De,He),hn=this.paint.get("fill-extrusion-base").evaluate(De,He),zn=S6(Zr,Ar,tr,0),pa=bE(nt,hn,mn,Ar),li=pa[0],Ba=pa[1];return t1(li,Ba,zn)},P})(Hi);function u0(D,P){return D.x*P.x+D.y*P.y}function Tp(D,P){if(D.length===1){for(var J=0,me=P[J++],De;!De||me.equals(De);)if(De=P[J++],!De)return 1/0;for(;J=2&&P[vr-1].equals(P[vr-2]);)vr--;for(var Ar=0;Ar0;if($o&&Gi>Ar){var is=hn.dist(zn);if(is>2*Zr){var gs=hn.sub(hn.sub(zn)._mult(Zr/is)._round());this.updateDistance(zn,gs),this.addCurrentVertex(gs,li,0,0,mn),zn=gs}}var Nl=zn&&pa,Ms=Nl?me:tr?"butt":De;if(Nl&&Ms==="round"&&(SoHe&&(Ms="bevel"),Ms==="bevel"&&(So>2&&(Ms="flipbevel"),So100)xi=Ba.mult(-1);else{var Ns=So*li.add(Ba).mag()/li.sub(Ba).mag();xi._perp()._mult(Ns*(ks?-1:1))}this.addCurrentVertex(hn,xi,0,0,mn),this.addCurrentVertex(hn,xi.mult(-1),0,0,mn)}else if(Ms==="bevel"||Ms==="fakeround"){var hu=-Math.sqrt(So*So-1),El=ks?hu:0,lc=ks?0:hu;if(zn&&this.addCurrentVertex(hn,li,El,lc,mn),Ms==="fakeround")for(var _f=Math.round(Go*180/Math.PI/AE),uc=1;uc<_f;uc++){var cc=uc/_f;if(cc!==.5){var tc=cc-.5,Bf=1.0904+Vi*(-3.2452+Vi*(3.55645-Vi*1.43519)),Qf=.848013+Vi*(-1.06021+Vi*.215638);cc=cc+cc*tc*(cc-1)*(Bf*tc*tc+Qf)}var Qh=Ba.sub(li)._mult(cc)._add(li)._unit()._mult(ks?-1:1);this.addHalfVertex(hn,Qh.x,Qh.y,!1,ks,0,mn)}pa&&this.addCurrentVertex(hn,Ba,-El,-lc,mn)}else if(Ms==="butt")this.addCurrentVertex(hn,xi,0,0,mn);else if(Ms==="square"){var fd=zn?1:-1;this.addCurrentVertex(hn,xi,fd,fd,mn)}else Ms==="round"&&(zn&&(this.addCurrentVertex(hn,li,0,0,mn),this.addCurrentVertex(hn,li,1,1,mn,!0)),pa&&(this.addCurrentVertex(hn,Ba,-1,-1,mn,!0),this.addCurrentVertex(hn,Ba,0,0,mn)));if($o&&Gi2*Zr){var Gd=hn.add(pa.sub(hn)._mult(Zr/Cp)._round());this.updateDistance(hn,Gd),this.addCurrentVertex(Gd,Ba,0,0,mn),hn=Gd}}}}},Fp.prototype.addCurrentVertex=function(P,J,me,De,He,nt){nt===void 0&&(nt=!1);var Mt=J.x+J.y*me,tr=J.y-J.x*me,vr=-J.x+J.y*De,Ar=-J.y-J.x*De;this.addHalfVertex(P,Mt,tr,nt,!1,me,He),this.addHalfVertex(P,vr,Ar,nt,!0,-De,He),this.distance>rA/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(P,J,me,De,He,nt))},Fp.prototype.addHalfVertex=function(P,J,me,De,He,nt,Mt){var tr=P.x,vr=P.y,Ar=this.lineClips?this.scaledDistance*(rA-1):this.scaledDistance,Zr=Ar*jx;if(this.layoutVertexArray.emplaceBack((tr<<1)+(De?1:0),(vr<<1)+(He?1:0),Math.round(M6*J)+128,Math.round(M6*me)+128,(nt===0?0:nt<0?-1:1)+1|(Zr&63)<<2,Zr>>6),this.lineClips){var mn=this.scaledDistance-this.lineClips.start,hn=this.lineClips.end-this.lineClips.start,zn=mn/hn;this.layoutVertexArray2.emplaceBack(zn,this.lineClipsArray.length)}var pa=Mt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,pa),Mt.primitiveLength++),He?this.e2=pa:this.e1=pa},Fp.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Fp.prototype.updateDistance=function(P,J){this.distance+=P.dist(J),this.updateScaledDistance()},dr("LineBucket",Fp,{omit:["layers","patternFeatures"]});var SE=new mi({"line-cap":new Ln(Bi.layout_line["line-cap"]),"line-join":new Mn(Bi.layout_line["line-join"]),"line-miter-limit":new Ln(Bi.layout_line["line-miter-limit"]),"line-round-limit":new Ln(Bi.layout_line["line-round-limit"]),"line-sort-key":new Mn(Bi.layout_line["line-sort-key"])}),nA=new mi({"line-opacity":new Mn(Bi.paint_line["line-opacity"]),"line-color":new Mn(Bi.paint_line["line-color"]),"line-translate":new Ln(Bi.paint_line["line-translate"]),"line-translate-anchor":new Ln(Bi.paint_line["line-translate-anchor"]),"line-width":new Mn(Bi.paint_line["line-width"]),"line-gap-width":new Mn(Bi.paint_line["line-gap-width"]),"line-offset":new Mn(Bi.paint_line["line-offset"]),"line-blur":new Mn(Bi.paint_line["line-blur"]),"line-dasharray":new Ja(Bi.paint_line["line-dasharray"]),"line-pattern":new ei(Bi.paint_line["line-pattern"]),"line-gradient":new Qa(Bi.paint_line["line-gradient"])}),Gx={paint:nA,layout:SE},EE=(function(D){function P(){D.apply(this,arguments)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.possiblyEvaluate=function(me,De){return De=new Yl(Math.floor(De.zoom),{now:De.now,fadeDuration:De.fadeDuration,zoomHistory:De.zoomHistory,transition:De.transition}),D.prototype.possiblyEvaluate.call(this,me,De)},P.prototype.evaluate=function(me,De,He,nt){return De=T({},De,{zoom:Math.floor(De.zoom)}),D.prototype.evaluate.call(this,me,De,He,nt)},P})(Mn),aA=new EE(Gx.paint.properties["line-width"].specification);aA.useIntegerZoom=!0;var CE=(function(D){function P(J){D.call(this,J,Gx),this.gradientVersion=0}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype._handleSpecialPaintPropertyUpdate=function(me){if(me==="line-gradient"){var De=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=De._styleExpression.expression instanceof df,this.gradientVersion=(this.gradientVersion+1)%d}},P.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},P.prototype.recalculate=function(me,De){D.prototype.recalculate.call(this,me,De),this.paint._values["line-floorwidth"]=aA.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,me)},P.prototype.createBucket=function(me){return new Fp(me)},P.prototype.queryRadius=function(me){var De=me,He=R6(tv("line-width",this,De),tv("line-gap-width",this,De)),nt=tv("line-offset",this,De);return He/2+Math.abs(nt)+im(this.paint.get("line-translate"))},P.prototype.queryIntersectsFeature=function(me,De,He,nt,Mt,tr,vr){var Ar=Rm(me,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),tr.angle,vr),Zr=vr/2*R6(this.paint.get("line-width").evaluate(De,He),this.paint.get("line-gap-width").evaluate(De,He)),mn=this.paint.get("line-offset").evaluate(De,He);return mn&&(nt=Q(nt,mn*vr)),ud(Ar,nt,Zr)},P.prototype.isTileClipped=function(){return!0},P})(Hi);function R6(D,P){return P>0?P+2*D:D}function Q(D,P){for(var J=[],me=new s(0,0),De=0;De":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Er(D){for(var P="",J=0;J>1,Ar=-7,Zr=J?De-1:0,mn=J?-1:1,hn=D[P+Zr];for(Zr+=mn,He=hn&(1<<-Ar)-1,hn>>=-Ar,Ar+=Mt;Ar>0;He=He*256+D[P+Zr],Zr+=mn,Ar-=8);for(nt=He&(1<<-Ar)-1,He>>=-Ar,Ar+=me;Ar>0;nt=nt*256+D[P+Zr],Zr+=mn,Ar-=8);if(He===0)He=1-vr;else{if(He===tr)return nt?NaN:(hn?-1:1)*(1/0);nt=nt+Math.pow(2,me),He=He-vr}return(hn?-1:1)*nt*Math.pow(2,He-me)},pn=function(D,P,J,me,De,He){var nt,Mt,tr,vr=He*8-De-1,Ar=(1<>1,mn=De===23?Math.pow(2,-24)-Math.pow(2,-77):0,hn=me?0:He-1,zn=me?1:-1,pa=P<0||P===0&&1/P<0?1:0;for(P=Math.abs(P),isNaN(P)||P===1/0?(Mt=isNaN(P)?1:0,nt=Ar):(nt=Math.floor(Math.log(P)/Math.LN2),P*(tr=Math.pow(2,-nt))<1&&(nt--,tr*=2),nt+Zr>=1?P+=mn/tr:P+=mn*Math.pow(2,1-Zr),P*tr>=2&&(nt++,tr/=2),nt+Zr>=Ar?(Mt=0,nt=Ar):nt+Zr>=1?(Mt=(P*tr-1)*Math.pow(2,De),nt=nt+Zr):(Mt=P*Math.pow(2,Zr-1)*Math.pow(2,De),nt=0));De>=8;D[J+hn]=Mt&255,hn+=zn,Mt/=256,De-=8);for(nt=nt<0;D[J+hn]=nt&255,hn+=zn,nt/=256,vr-=8);D[J+hn-zn]|=pa*128},Cn={read:nn,write:pn},Bn=ta;function ta(D){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(D)?D:new Uint8Array(D||0),this.pos=0,this.type=0,this.length=this.buf.length}ta.Varint=0,ta.Fixed64=1,ta.Bytes=2,ta.Fixed32=5;var Da=65536*65536,Di=1/Da,ni=12,Ti=typeof TextDecoder>"u"?null:new TextDecoder("utf8");ta.prototype={destroy:function(){this.buf=null},readFields:function(D,P,J){for(J=J||this.length;this.pos>3,He=this.pos;this.type=me&7,D(De,P,this),this.pos===He&&this.skip(me)}return P},readMessage:function(D,P){return this.readFields(D,P,this.readVarint()+this.pos)},readFixed32:function(){var D=Lv(this.buf,this.pos);return this.pos+=4,D},readSFixed32:function(){var D=Ud(this.buf,this.pos);return this.pos+=4,D},readFixed64:function(){var D=Lv(this.buf,this.pos)+Lv(this.buf,this.pos+4)*Da;return this.pos+=8,D},readSFixed64:function(){var D=Lv(this.buf,this.pos)+Ud(this.buf,this.pos+4)*Da;return this.pos+=8,D},readFloat:function(){var D=Cn.read(this.buf,this.pos,!0,23,4);return this.pos+=4,D},readDouble:function(){var D=Cn.read(this.buf,this.pos,!0,52,8);return this.pos+=8,D},readVarint:function(D){var P=this.buf,J,me;return me=P[this.pos++],J=me&127,me<128||(me=P[this.pos++],J|=(me&127)<<7,me<128)||(me=P[this.pos++],J|=(me&127)<<14,me<128)||(me=P[this.pos++],J|=(me&127)<<21,me<128)?J:(me=P[this.pos],J|=(me&15)<<28,uo(J,D,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var D=this.readVarint();return D%2===1?(D+1)/-2:D/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var D=this.readVarint()+this.pos,P=this.pos;return this.pos=D,D-P>=ni&&Ti?yv(this.buf,P,D):gv(this.buf,P,D)},readBytes:function(){var D=this.readVarint()+this.pos,P=this.buf.subarray(this.pos,D);return this.pos=D,P},readPackedVarint:function(D,P){if(this.type!==ta.Bytes)return D.push(this.readVarint(P));var J=Oo(this);for(D=D||[];this.pos127;);else if(P===ta.Bytes)this.pos=this.readVarint()+this.pos;else if(P===ta.Fixed32)this.pos+=4;else if(P===ta.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+P)},writeTag:function(D,P){this.writeVarint(D<<3|P)},realloc:function(D){for(var P=this.length||16;P268435455||D<0){zl(D,this);return}this.realloc(4),this.buf[this.pos++]=D&127|(D>127?128:0),!(D<=127)&&(this.buf[this.pos++]=(D>>>=7)&127|(D>127?128:0),!(D<=127)&&(this.buf[this.pos++]=(D>>>=7)&127|(D>127?128:0),!(D<=127)&&(this.buf[this.pos++]=D>>>7&127)))},writeSVarint:function(D){this.writeVarint(D<0?-D*2-1:D*2)},writeBoolean:function(D){this.writeVarint(!!D)},writeString:function(D){D=String(D),this.realloc(D.length*4),this.pos++;var P=this.pos;this.pos=_v(this.buf,D,this.pos);var J=this.pos-P;J>=128&&tl(P,J,this),this.pos=P-1,this.writeVarint(J),this.pos+=J},writeFloat:function(D){this.realloc(4),Cn.write(this.buf,D,this.pos,!0,23,4),this.pos+=4},writeDouble:function(D){this.realloc(8),Cn.write(this.buf,D,this.pos,!0,52,8),this.pos+=8},writeBytes:function(D){var P=D.length;this.writeVarint(P),this.realloc(P);for(var J=0;J=128&&tl(J,me,this),this.pos=J-1,this.writeVarint(me),this.pos+=me},writeMessage:function(D,P,J){this.writeTag(D,ta.Bytes),this.writeRawMessage(P,J)},writePackedVarint:function(D,P){P.length&&this.writeMessage(D,Hs,P)},writePackedSVarint:function(D,P){P.length&&this.writeMessage(D,Vs,P)},writePackedBoolean:function(D,P){P.length&&this.writeMessage(D,rl,P)},writePackedFloat:function(D,P){P.length&&this.writeMessage(D,Co,P)},writePackedDouble:function(D,P){P.length&&this.writeMessage(D,cl,P)},writePackedFixed32:function(D,P){P.length&&this.writeMessage(D,Ql,P)},writePackedSFixed32:function(D,P){P.length&&this.writeMessage(D,Of,P)},writePackedFixed64:function(D,P){P.length&&this.writeMessage(D,Mf,P)},writePackedSFixed64:function(D,P){P.length&&this.writeMessage(D,Qd,P)},writeBytesField:function(D,P){this.writeTag(D,ta.Bytes),this.writeBytes(P)},writeFixed32Field:function(D,P){this.writeTag(D,ta.Fixed32),this.writeFixed32(P)},writeSFixed32Field:function(D,P){this.writeTag(D,ta.Fixed32),this.writeSFixed32(P)},writeFixed64Field:function(D,P){this.writeTag(D,ta.Fixed64),this.writeFixed64(P)},writeSFixed64Field:function(D,P){this.writeTag(D,ta.Fixed64),this.writeSFixed64(P)},writeVarintField:function(D,P){this.writeTag(D,ta.Varint),this.writeVarint(P)},writeSVarintField:function(D,P){this.writeTag(D,ta.Varint),this.writeSVarint(P)},writeStringField:function(D,P){this.writeTag(D,ta.Bytes),this.writeString(P)},writeFloatField:function(D,P){this.writeTag(D,ta.Fixed32),this.writeFloat(P)},writeDoubleField:function(D,P){this.writeTag(D,ta.Fixed64),this.writeDouble(P)},writeBooleanField:function(D,P){this.writeVarintField(D,!!P)}};function uo(D,P,J){var me=J.buf,De,He;if(He=me[J.pos++],De=(He&112)>>4,He<128||(He=me[J.pos++],De|=(He&127)<<3,He<128)||(He=me[J.pos++],De|=(He&127)<<10,He<128)||(He=me[J.pos++],De|=(He&127)<<17,He<128)||(He=me[J.pos++],De|=(He&127)<<24,He<128)||(He=me[J.pos++],De|=(He&1)<<31,He<128))return ms(D,De,P);throw new Error("Expected varint not more than 10 bytes")}function Oo(D){return D.type===ta.Bytes?D.readVarint()+D.pos:D.pos+1}function ms(D,P,J){return J?P*4294967296+(D>>>0):(P>>>0)*4294967296+(D>>>0)}function zl(D,P){var J,me;if(D>=0?(J=D%4294967296|0,me=D/4294967296|0):(J=~(-D%4294967296),me=~(-D/4294967296),J^4294967295?J=J+1|0:(J=0,me=me+1|0)),D>=18446744073709552e3||D<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");P.realloc(10),Es(J,me,P),ds(me,P)}function Es(D,P,J){J.buf[J.pos++]=D&127|128,D>>>=7,J.buf[J.pos++]=D&127|128,D>>>=7,J.buf[J.pos++]=D&127|128,D>>>=7,J.buf[J.pos++]=D&127|128,D>>>=7,J.buf[J.pos]=D&127}function ds(D,P){var J=(D&7)<<4;P.buf[P.pos++]|=J|((D>>>=3)?128:0),D&&(P.buf[P.pos++]=D&127|((D>>>=7)?128:0),D&&(P.buf[P.pos++]=D&127|((D>>>=7)?128:0),D&&(P.buf[P.pos++]=D&127|((D>>>=7)?128:0),D&&(P.buf[P.pos++]=D&127|((D>>>=7)?128:0),D&&(P.buf[P.pos++]=D&127)))))}function tl(D,P,J){var me=P<=16383?1:P<=2097151?2:P<=268435455?3:Math.floor(Math.log(P)/(Math.LN2*7));J.realloc(me);for(var De=J.pos-1;De>=D;De--)J.buf[De+me]=J.buf[De]}function Hs(D,P){for(var J=0;J>>8,D[J+2]=P>>>16,D[J+3]=P>>>24}function Ud(D,P){return(D[P]|D[P+1]<<8|D[P+2]<<16)+(D[P+3]<<24)}function gv(D,P,J){for(var me="",De=P;De239?4:He>223?3:He>191?2:1;if(De+Mt>J)break;var tr,vr,Ar;Mt===1?He<128&&(nt=He):Mt===2?(tr=D[De+1],(tr&192)===128&&(nt=(He&31)<<6|tr&63,nt<=127&&(nt=null))):Mt===3?(tr=D[De+1],vr=D[De+2],(tr&192)===128&&(vr&192)===128&&(nt=(He&15)<<12|(tr&63)<<6|vr&63,(nt<=2047||nt>=55296&&nt<=57343)&&(nt=null))):Mt===4&&(tr=D[De+1],vr=D[De+2],Ar=D[De+3],(tr&192)===128&&(vr&192)===128&&(Ar&192)===128&&(nt=(He&15)<<18|(tr&63)<<12|(vr&63)<<6|Ar&63,(nt<=65535||nt>=1114112)&&(nt=null))),nt===null?(nt=65533,Mt=1):nt>65535&&(nt-=65536,me+=String.fromCharCode(nt>>>10&1023|55296),nt=56320|nt&1023),me+=String.fromCharCode(nt),De+=Mt}return me}function yv(D,P,J){return Ti.decode(D.subarray(P,J))}function _v(D,P,J){for(var me=0,De,He;me55295&&De<57344)if(He)if(De<56320){D[J++]=239,D[J++]=191,D[J++]=189,He=De;continue}else De=He-55296<<10|De-56320|65536,He=null;else{De>56319||me+1===P.length?(D[J++]=239,D[J++]=191,D[J++]=189):He=De;continue}else He&&(D[J++]=239,D[J++]=191,D[J++]=189,He=null);De<128?D[J++]=De:(De<2048?D[J++]=De>>6|192:(De<65536?D[J++]=De>>12|224:(D[J++]=De>>18|240,D[J++]=De>>12&63|128),D[J++]=De>>6&63|128),D[J++]=De&63|128)}return J}var Ih=3;function ep(D,P,J){D===1&&J.readMessage(nv,P)}function nv(D,P,J){if(D===3){var me=J.readMessage(Bp,{}),De=me.id,He=me.bitmap,nt=me.width,Mt=me.height,tr=me.left,vr=me.top,Ar=me.advance;P.push({id:De,bitmap:new Bd({width:nt+2*Ih,height:Mt+2*Ih},He),metrics:{width:nt,height:Mt,left:tr,top:vr,advance:Ar}})}}function Bp(D,P,J){D===1?P.id=J.readVarint():D===2?P.bitmap=J.readBytes():D===3?P.width=J.readVarint():D===4?P.height=J.readVarint():D===5?P.left=J.readSVarint():D===6?P.top=J.readSVarint():D===7&&(P.advance=J.readVarint())}function xv(D){return new Bn(D).readFields(ep,[])}var Ap=Ih;function um(D){for(var P=0,J=0,me=0,De=D;me=0;hn--){var zn=Mt[hn];if(!(mn.w>zn.w||mn.h>zn.h)){if(mn.x=zn.x,mn.y=zn.y,vr=Math.max(vr,mn.y+mn.h),tr=Math.max(tr,mn.x+mn.w),mn.w===zn.w&&mn.h===zn.h){var pa=Mt.pop();hn=0&&De>=P&&cm[this.text.charCodeAt(De)];De--)me--;this.text=this.text.substring(P,me),this.sectionIndex=this.sectionIndex.slice(P,me)},Ff.prototype.substring=function(P,J){var me=new Ff;return me.text=this.text.substring(P,J),me.sectionIndex=this.sectionIndex.slice(P,J),me.sections=this.sections,me},Ff.prototype.toString=function(){return this.text},Ff.prototype.getMaxScale=function(){var P=this;return this.sectionIndex.reduce(function(J,me){return Math.max(J,P.sections[me].scale)},0)},Ff.prototype.addTextSection=function(P,J){this.text+=P.text,this.sections.push(av.forText(P.scale,P.fontStack||J));for(var me=this.sections.length-1,De=0;De=Dg?null:++this.imageSectionID:(this.imageSectionID=Rg,this.imageSectionID)};function Sp(D,P){for(var J=[],me=D.text,De=0,He=0,nt=P;He=0,Ar=0,Zr=0;Zr0&&Gd>ks&&(ks=Gd)}else{var cc=J[gs.fontStack],tc=cc&&cc[Ms];if(tc&&tc.rect)El=tc.rect,hu=tc.metrics;else{var Bf=P[gs.fontStack],Qf=Bf&&Bf[Ms];if(!Qf)continue;hu=Qf.metrics}Ns=(eo-gs.scale)*Pr}uc?(D.verticalizable=!0,$o.push({glyph:Ms,imageName:lc,x:mn,y:hn+Ns,vertical:uc,scale:gs.scale,fontStack:gs.fontStack,sectionIndex:Nl,metrics:hu,rect:El}),mn+=_f*gs.scale+vr):($o.push({glyph:Ms,imageName:lc,x:mn,y:hn+Ns,vertical:uc,scale:gs.scale,fontStack:gs.fontStack,sectionIndex:Nl,metrics:hu,rect:El}),mn+=hu.advance*gs.scale+vr)}if($o.length!==0){var wv=mn-vr;zn=Math.max(wv,zn),I4($o,0,$o.length-1,li,ks)}mn=0;var Tv=He*eo+ks;Go.lineOffset=Math.max(ks,So),hn+=Tv,pa=Math.max(Tv,pa),++Ba}var kp=hn-Jf,Rv=DE(nt),Dv=Rv.horizontalAlign,tp=Rv.verticalAlign;L4(D.positionedLines,li,Dv,tp,zn,pa,He,kp,De.length),D.top+=-tp*kp,D.bottom=D.top+kp,D.left+=-Dv*zn,D.right=D.left+zn}function I4(D,P,J,me,De){if(!(!me&&!De))for(var He=D[J],nt=He.metrics.advance*He.scale,Mt=(D[J].x+nt)*me,tr=P;tr<=J;tr++)D[tr].x-=Mt,D[tr].y+=De}function L4(D,P,J,me,De,He,nt,Mt,tr){var vr=(P-J)*De,Ar=0;He!==nt?Ar=-Mt*me-Jf:Ar=(-me*tr+.5)*nt;for(var Zr=0,mn=D;Zr-J/2;){if(nt--,nt<0)return!1;Mt-=D[nt].dist(He),He=D[nt]}Mt+=D[nt].dist(D[nt+1]),nt++;for(var tr=[],vr=0;Mtme;)vr-=tr.shift().angleDelta;if(vr>De)return!1;nt++,Mt+=Zr.dist(mn)}return!0}function Up(D){for(var P=0,J=0;Jvr){var zn=(vr-tr)/hn,pa=Ru(Zr.x,mn.x,zn),li=Ru(Zr.y,mn.y,zn),Ba=new Hx(pa,li,mn.angleTo(Zr),Ar);return Ba._round(),!nt||z6(D,Ba,Mt,nt,P)?Ba:void 0}tr+=hn}}function h_(D,P,J,me,De,He,nt,Mt,tr){var vr=fm(me,He,nt),Ar=r1(me,De),Zr=Ar*nt,mn=D[0].x===0||D[0].x===tr||D[0].y===0||D[0].y===tr;P-Zr

=0&&Vi=0&&eo=0&&mn+vr<=Ar){var So=new Hx(Vi,eo,Gi,zn);So._round(),(!me||z6(D,So,He,me,De))&&hn.push(So)}}Zr+=Ba}return!Mt&&!hn.length&&!nt&&(hn=zg(D,Zr/2,J,me,De,He,nt,!0,tr)),hn}function q7(D,P,J,me,De){for(var He=[],nt=0;nt=me&&Zr.x>=me)&&(Ar.x>=me?Ar=new s(me,Ar.y+(Zr.y-Ar.y)*((me-Ar.x)/(Zr.x-Ar.x)))._round():Zr.x>=me&&(Zr=new s(me,Ar.y+(Zr.y-Ar.y)*((me-Ar.x)/(Zr.x-Ar.x)))._round()),!(Ar.y>=De&&Zr.y>=De)&&(Ar.y>=De?Ar=new s(Ar.x+(Zr.x-Ar.x)*((De-Ar.y)/(Zr.y-Ar.y)),De)._round():Zr.y>=De&&(Zr=new s(Ar.x+(Zr.x-Ar.x)*((De-Ar.y)/(Zr.y-Ar.y)),De)._round()),(!tr||!Ar.equals(tr[tr.length-1]))&&(tr=[Ar],He.push(tr)),tr.push(Zr)))))}return He}var oA=Kf;function H7(D,P,J,me){var De=[],He=D.image,nt=He.pixelRatio,Mt=He.paddedRect.w-2*oA,tr=He.paddedRect.h-2*oA,vr=D.right-D.left,Ar=D.bottom-D.top,Zr=He.stretchX||[[0,Mt]],mn=He.stretchY||[[0,tr]],hn=function(cc,tc){return cc+tc[1]-tc[0]},zn=Zr.reduce(hn,0),pa=mn.reduce(hn,0),li=Mt-zn,Ba=tr-pa,Gi=0,xi=zn,Vi=0,eo=pa,So=0,Go=li,$o=0,ks=Ba;if(He.content&&me){var is=He.content;Gi=N6(Zr,0,is[0]),Vi=N6(mn,0,is[1]),xi=N6(Zr,is[0],is[2]),eo=N6(mn,is[1],is[3]),So=is[0]-Gi,$o=is[1]-Vi,Go=is[2]-is[0]-xi,ks=is[3]-is[1]-eo}var gs=function(cc,tc,Bf,Qf){var Qh=O6(cc.stretch-Gi,xi,vr,D.left),fd=F6(cc.fixed-So,Go,cc.stretch,zn),Cp=O6(tc.stretch-Vi,eo,Ar,D.top),Gd=F6(tc.fixed-$o,ks,tc.stretch,pa),wv=O6(Bf.stretch-Gi,xi,vr,D.left),Tv=F6(Bf.fixed-So,Go,Bf.stretch,zn),kp=O6(Qf.stretch-Vi,eo,Ar,D.top),Rv=F6(Qf.fixed-$o,ks,Qf.stretch,pa),Dv=new s(Qh,Cp),tp=new s(wv,Cp),Pv=new s(wv,kp),rg=new s(Qh,kp),v_=new s(fd/nt,Gd/nt),Zx=new s(Tv/nt,Rv/nt),Kx=P*Math.PI/180;if(Kx){var Jx=Math.sin(Kx),pA=Math.cos(Kx),c0=[pA,-Jx,Jx,pA];Dv._matMult(c0),tp._matMult(c0),rg._matMult(c0),Pv._matMult(c0)}var G6=cc.stretch+cc.fixed,$4=Bf.stretch+Bf.fixed,q6=tc.stretch+tc.fixed,V4=Qf.stretch+Qf.fixed,Ng={x:He.paddedRect.x+oA+G6,y:He.paddedRect.y+oA+q6,w:$4-G6,h:V4-q6},vA=Go/nt/vr,H6=ks/nt/Ar;return{tl:Dv,tr:tp,bl:rg,br:Pv,tex:Ng,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:v_,pixelOffsetBR:Zx,minFontScaleX:vA,minFontScaleY:H6,isSDF:J}};if(!me||!He.stretchX&&!He.stretchY)De.push(gs({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:Mt+1},{fixed:0,stretch:tr+1}));else for(var Nl=W7(Zr,li,zn),Ms=W7(mn,Ba,pa),Ns=0;Ns0&&(zn=Math.max(10,zn),this.circleDiameter=zn)}else{var pa=nt.top*Mt-tr,li=nt.bottom*Mt+tr,Ba=nt.left*Mt-tr,Gi=nt.right*Mt+tr,xi=nt.collisionPadding;if(xi&&(Ba-=xi[0]*Mt,pa-=xi[1]*Mt,Gi+=xi[2]*Mt,li+=xi[3]*Mt),Ar){var Vi=new s(Ba,pa),eo=new s(Gi,pa),So=new s(Ba,li),Go=new s(Gi,li),$o=Ar*Math.PI/180;Vi._rotate($o),eo._rotate($o),So._rotate($o),Go._rotate($o),Ba=Math.min(Vi.x,eo.x,So.x,Go.x),Gi=Math.max(Vi.x,eo.x,So.x,Go.x),pa=Math.min(Vi.y,eo.y,So.y,Go.y),li=Math.max(Vi.y,eo.y,So.y,Go.y)}P.emplaceBack(J.x,J.y,Ba,pa,Gi,li,me,De,He)}this.boxEndIndex=P.length},sA=function(P,J){if(P===void 0&&(P=[]),J===void 0&&(J=WQ),this.data=P,this.length=this.data.length,this.compare=J,this.length>0)for(var me=(this.length>>1)-1;me>=0;me--)this._down(me)};sA.prototype.push=function(P){this.data.push(P),this.length++,this._up(this.length-1)},sA.prototype.pop=function(){if(this.length!==0){var P=this.data[0],J=this.data.pop();return this.length--,this.length>0&&(this.data[0]=J,this._down(0)),P}},sA.prototype.peek=function(){return this.data[0]},sA.prototype._up=function(P){for(var J=this,me=J.data,De=J.compare,He=me[P];P>0;){var nt=P-1>>1,Mt=me[nt];if(De(He,Mt)>=0)break;me[P]=Mt,P=nt}me[P]=He},sA.prototype._down=function(P){for(var J=this,me=J.data,De=J.compare,He=this.length>>1,nt=me[P];P=0)break;me[P]=tr,P=Mt}me[P]=nt};function WQ(D,P){return DP?1:0}function XQ(D,P,J){J===void 0&&(J=!1);for(var me=1/0,De=1/0,He=-1/0,nt=-1/0,Mt=D[0],tr=0;trHe)&&(He=vr.x),(!tr||vr.y>nt)&&(nt=vr.y)}var Ar=He-me,Zr=nt-De,mn=Math.min(Ar,Zr),hn=mn/2,zn=new sA([],YQ);if(mn===0)return new s(me,De);for(var pa=me;paBa.d||!Ba.d)&&(Ba=xi,J&&console.log("found best %d after %d probes",Math.round(1e4*xi.d)/1e4,Gi)),!(xi.max-Ba.d<=P)&&(hn=xi.h/2,zn.push(new lA(xi.p.x-hn,xi.p.y-hn,hn,D)),zn.push(new lA(xi.p.x+hn,xi.p.y-hn,hn,D)),zn.push(new lA(xi.p.x-hn,xi.p.y+hn,hn,D)),zn.push(new lA(xi.p.x+hn,xi.p.y+hn,hn,D)),Gi+=4)}return J&&(console.log("num probes: "+Gi),console.log("best distance: "+Ba.d)),Ba.p}function YQ(D,P){return P.max-D.max}function lA(D,P,J,me){this.p=new s(D,P),this.h=J,this.d=ZQ(this.p,me),this.max=this.d+this.h*Math.SQRT2}function ZQ(D,P){for(var J=!1,me=1/0,De=0;DeD.y!=Ar.y>D.y&&D.x<(Ar.x-vr.x)*(D.y-vr.y)/(Ar.y-vr.y)+vr.x&&(J=!J),me=Math.min(me,X0(D,vr,Ar))}return(J?1:-1)*Math.sqrt(me)}function KQ(D){for(var P=0,J=0,me=0,De=D[0],He=0,nt=De.length,Mt=nt-1;He=mo||c0.y<0||c0.y>=mo||eee(D,c0,pA,J,me,De,Ms,D.layers[0],D.collisionBoxArray,P.index,P.sourceLayerIndex,D.index,Ba,eo,$o,tr,xi,So,ks,hn,P,He,vr,Ar,nt)};if(is==="line")for(var hu=0,El=q7(P.geometry,0,0,mo,mo);hu1){var Cp=Pg(fd,Go,J.vertical||zn,me,pa,Gi);Cp&&Ns(fd,Cp)}}else if(P.type==="Polygon")for(var Gd=0,wv=l0(P.geometry,0);GdXx&&W(D.layerIds[0]+': Value for "text-size" is >= '+zE+'. Reduce your "text-size".')):li.kind==="composite"&&(Ba=[$d*hn.compositeTextSizes[0].evaluate(nt,{},zn),$d*hn.compositeTextSizes[1].evaluate(nt,{},zn)],(Ba[0]>Xx||Ba[1]>Xx)&&W(D.layerIds[0]+': Value for "text-size" is >= '+zE+'. Reduce your "text-size".')),D.addSymbols(D.text,pa,Ba,Mt,He,nt,vr,P,tr.lineStartIndex,tr.lineLength,mn,zn);for(var Gi=0,xi=Ar;GiXx&&W(D.layerIds[0]+': Value for "icon-size" is >= '+zE+'. Reduce your "icon-size".')):Dv.kind==="composite"&&(tp=[$d*eo.compositeIconSizes[0].evaluate(Vi,{},Go),$d*eo.compositeIconSizes[1].evaluate(Vi,{},Go)],(tp[0]>Xx||tp[1]>Xx)&&W(D.layerIds[0]+': Value for "icon-size" is >= '+zE+'. Reduce your "icon-size".')),D.addSymbols(D.icon,kp,tp,xi,Gi,Vi,!1,P,is.lineStartIndex,is.lineLength,-1,Go),uc=D.icon.placedSymbolArray.length-1,Rv&&(El=Rv.length*4,D.addSymbols(D.icon,Rv,tp,xi,Gi,Vi,bh.vertical,P,is.lineStartIndex,is.lineLength,-1,Go),cc=D.icon.placedSymbolArray.length-1)}for(var Pv in me.horizontal){var rg=me.horizontal[Pv];if(!gs){Bf=Me(rg.text);var v_=Mt.layout.get("text-rotate").evaluate(Vi,{},Go);gs=new B6(tr,P,vr,Ar,Zr,rg,mn,hn,zn,v_)}var Zx=rg.positionedLines.length===1;if(lc+=Y7(D,P,rg,He,Mt,zn,Vi,pa,is,me.vertical?bh.horizontal:bh.horizontalOnly,Zx?Object.keys(me.horizontal):[Pv],tc,uc,eo,Go),Zx)break}me.vertical&&(_f+=Y7(D,P,me.vertical,He,Mt,zn,Vi,pa,is,bh.vertical,["vertical"],tc,cc,eo,Go));var Kx=gs?gs.boxStartIndex:D.collisionBoxArray.length,Jx=gs?gs.boxEndIndex:D.collisionBoxArray.length,pA=Ms?Ms.boxStartIndex:D.collisionBoxArray.length,c0=Ms?Ms.boxEndIndex:D.collisionBoxArray.length,G6=Nl?Nl.boxStartIndex:D.collisionBoxArray.length,$4=Nl?Nl.boxEndIndex:D.collisionBoxArray.length,q6=Ns?Ns.boxStartIndex:D.collisionBoxArray.length,V4=Ns?Ns.boxEndIndex:D.collisionBoxArray.length,Ng=-1,vA=function(FE,h9){return FE&&FE.circleDiameter?Math.max(FE.circleDiameter,h9):h9};Ng=vA(gs,Ng),Ng=vA(Ms,Ng),Ng=vA(Nl,Ng),Ng=vA(Ns,Ng);var H6=Ng>-1?1:0;H6&&(Ng*=$o/Pr),D.glyphOffsetArray.length>=yf.MAX_GLYPHS&&W("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Vi.sortKey!==void 0&&D.addToSortKeyRanges(D.symbolInstances.length,Vi.sortKey),D.symbolInstances.emplaceBack(P.x,P.y,tc.right>=0?tc.right:-1,tc.center>=0?tc.center:-1,tc.left>=0?tc.left:-1,tc.vertical||-1,uc,cc,Bf,Kx,Jx,pA,c0,G6,$4,q6,V4,vr,lc,_f,hu,El,H6,0,mn,Qf,Qh,Ng)}function tee(D,P,J,me){var De=D.compareText;if(!(P in De))De[P]=[];else for(var He=De[P],nt=He.length-1;nt>=0;nt--)if(me.dist(He[nt])0)&&(nt.value.kind!=="constant"||nt.value.value.length>0),Ar=tr.value.kind!=="constant"||!!tr.value.value||Object.keys(tr.parameters).length>0,Zr=He.get("symbol-sort-key");if(this.features=[],!(!vr&&!Ar)){for(var mn=J.iconDependencies,hn=J.glyphDependencies,zn=J.availableImages,pa=new Yl(this.zoom),li=0,Ba=P;li=0;for(var _f=0,uc=ks.sections;_f=0;tr--)nt[tr]={x:J[tr].x,y:J[tr].y,tileUnitDistanceFromAnchor:He},tr>0&&(He+=J[tr-1].dist(J[tr]));for(var vr=0;vr0},yf.prototype.hasIconData=function(){return this.icon.segments.get().length>0},yf.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},yf.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},yf.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},yf.prototype.addIndicesForPlacedSymbol=function(P,J){for(var me=P.placedSymbolArray.get(J),De=me.vertexStartIndex+me.numGlyphs*4,He=me.vertexStartIndex;He1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(P),this.sortedAngle=P,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var me=0,De=this.symbolInstanceIndexes;me=0&&vr.indexOf(Mt)===tr&&J.addIndicesForPlacedSymbol(J.text,Mt)}),nt.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,nt.verticalPlacedTextSymbolIndex),nt.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,nt.placedIconSymbolIndex),nt.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,nt.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},dr("SymbolBucket",yf,{omit:["layers","collisionBoxArray","features","compareText"]}),yf.MAX_GLYPHS=65535,yf.addDynamicAttributes=N4;function iee(D,P){return P.replace(/{([^{}]+)}/g,function(J,me){return me in D?String(D[me]):""})}var oee=new mi({"symbol-placement":new Ln(Bi.layout_symbol["symbol-placement"]),"symbol-spacing":new Ln(Bi.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ln(Bi.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Mn(Bi.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ln(Bi.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ln(Bi.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Ln(Bi.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ln(Bi.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ln(Bi.layout_symbol["icon-rotation-alignment"]),"icon-size":new Mn(Bi.layout_symbol["icon-size"]),"icon-text-fit":new Ln(Bi.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ln(Bi.layout_symbol["icon-text-fit-padding"]),"icon-image":new Mn(Bi.layout_symbol["icon-image"]),"icon-rotate":new Mn(Bi.layout_symbol["icon-rotate"]),"icon-padding":new Ln(Bi.layout_symbol["icon-padding"]),"icon-keep-upright":new Ln(Bi.layout_symbol["icon-keep-upright"]),"icon-offset":new Mn(Bi.layout_symbol["icon-offset"]),"icon-anchor":new Mn(Bi.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ln(Bi.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ln(Bi.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ln(Bi.layout_symbol["text-rotation-alignment"]),"text-field":new Mn(Bi.layout_symbol["text-field"]),"text-font":new Mn(Bi.layout_symbol["text-font"]),"text-size":new Mn(Bi.layout_symbol["text-size"]),"text-max-width":new Mn(Bi.layout_symbol["text-max-width"]),"text-line-height":new Ln(Bi.layout_symbol["text-line-height"]),"text-letter-spacing":new Mn(Bi.layout_symbol["text-letter-spacing"]),"text-justify":new Mn(Bi.layout_symbol["text-justify"]),"text-radial-offset":new Mn(Bi.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ln(Bi.layout_symbol["text-variable-anchor"]),"text-anchor":new Mn(Bi.layout_symbol["text-anchor"]),"text-max-angle":new Ln(Bi.layout_symbol["text-max-angle"]),"text-writing-mode":new Ln(Bi.layout_symbol["text-writing-mode"]),"text-rotate":new Mn(Bi.layout_symbol["text-rotate"]),"text-padding":new Ln(Bi.layout_symbol["text-padding"]),"text-keep-upright":new Ln(Bi.layout_symbol["text-keep-upright"]),"text-transform":new Mn(Bi.layout_symbol["text-transform"]),"text-offset":new Mn(Bi.layout_symbol["text-offset"]),"text-allow-overlap":new Ln(Bi.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Ln(Bi.layout_symbol["text-ignore-placement"]),"text-optional":new Ln(Bi.layout_symbol["text-optional"])}),see=new mi({"icon-opacity":new Mn(Bi.paint_symbol["icon-opacity"]),"icon-color":new Mn(Bi.paint_symbol["icon-color"]),"icon-halo-color":new Mn(Bi.paint_symbol["icon-halo-color"]),"icon-halo-width":new Mn(Bi.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Mn(Bi.paint_symbol["icon-halo-blur"]),"icon-translate":new Ln(Bi.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ln(Bi.paint_symbol["icon-translate-anchor"]),"text-opacity":new Mn(Bi.paint_symbol["text-opacity"]),"text-color":new Mn(Bi.paint_symbol["text-color"],{runtimeType:pu,getOverride:function(D){return D.textColor},hasOverride:function(D){return!!D.textColor}}),"text-halo-color":new Mn(Bi.paint_symbol["text-halo-color"]),"text-halo-width":new Mn(Bi.paint_symbol["text-halo-width"]),"text-halo-blur":new Mn(Bi.paint_symbol["text-halo-blur"]),"text-translate":new Ln(Bi.paint_symbol["text-translate"]),"text-translate-anchor":new Ln(Bi.paint_symbol["text-translate-anchor"])}),O4={paint:see,layout:oee},fA=function(P){this.type=P.property.overrides?P.property.overrides.runtimeType:Gu,this.defaultValue=P};fA.prototype.evaluate=function(P){if(P.formattedSection){var J=this.defaultValue.property.overrides;if(J&&J.hasOverride(P.formattedSection))return J.getOverride(P.formattedSection)}return P.feature&&P.featureState?this.defaultValue.evaluate(P.feature,P.featureState):this.defaultValue.property.specification.default},fA.prototype.eachChild=function(P){if(!this.defaultValue.isConstant()){var J=this.defaultValue.value;P(J._styleExpression.expression)}},fA.prototype.outputDefined=function(){return!1},fA.prototype.serialize=function(){return null},dr("FormatSectionOverride",fA,{omit:["defaultValue"]});var lee=(function(D){function P(J){D.call(this,J,O4)}return D&&(P.__proto__=D),P.prototype=Object.create(D&&D.prototype),P.prototype.constructor=P,P.prototype.recalculate=function(me,De){if(D.prototype.recalculate.call(this,me,De),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var He=this.layout.get("text-writing-mode");if(He){for(var nt=[],Mt=0,tr=He;Mt",targetMapId:De,sourceMapId:nt.mapId})}}},hA.prototype.receive=function(P){var J=P.data,me=J.id;if(me&&!(J.targetMapId&&this.mapId!==J.targetMapId))if(J.type===""){delete this.tasks[me];var De=this.cancelCallbacks[me];delete this.cancelCallbacks[me],De&&De()}else ge()||J.mustQueue?(this.tasks[me]=J,this.taskQueue.push(me),this.invoker.trigger()):this.processTask(me,J)},hA.prototype.process=function(){if(this.taskQueue.length){var P=this.taskQueue.shift(),J=this.tasks[P];delete this.tasks[P],this.taskQueue.length&&this.invoker.trigger(),J&&this.processTask(P,J)}},hA.prototype.processTask=function(P,J){var me=this;if(J.type===""){var De=this.callbacks[P];delete this.callbacks[P],De&&(J.error?De(En(J.error)):De(null,En(J.data)))}else{var He=!1,nt=se(this.globalScope)?void 0:[],Mt=J.hasCallback?function(mn,hn){He=!0,delete me.cancelCallbacks[P],me.target.postMessage({id:P,type:"",sourceMapId:me.mapId,error:mn?on(mn):null,data:on(hn,nt)},nt)}:function(mn){He=!0},tr=null,vr=En(J.data);if(this.parent[J.type])tr=this.parent[J.type](J.sourceMapId,vr,Mt);else if(this.parent.getWorkerSource){var Ar=J.type.split("."),Zr=this.parent.getWorkerSource(J.sourceMapId,Ar[0],vr.source);tr=Zr[Ar[1]](vr,Mt)}else Mt(new Error("Could not find function "+J.type));!He&&tr&&tr.cancel&&(this.cancelCallbacks[P]=tr.cancel)}},hA.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function _ee(D,P,J){P=Math.pow(2,J)-P-1;var me=t9(D*256,P*256,J),De=t9((D+1)*256,(P+1)*256,J);return me[0]+","+me[1]+","+De[0]+","+De[1]}function t9(D,P,J){var me=2*Math.PI*6378137/256/Math.pow(2,J),De=D*me-2*Math.PI*6378137/2,He=P*me-2*Math.PI*6378137/2;return[De,He]}var Vd=function(P,J){P&&(J?this.setSouthWest(P).setNorthEast(J):P.length===4?this.setSouthWest([P[0],P[1]]).setNorthEast([P[2],P[3]]):this.setSouthWest(P[0]).setNorthEast(P[1]))};Vd.prototype.setNorthEast=function(P){return this._ne=P instanceof wh?new wh(P.lng,P.lat):wh.convert(P),this},Vd.prototype.setSouthWest=function(P){return this._sw=P instanceof wh?new wh(P.lng,P.lat):wh.convert(P),this},Vd.prototype.extend=function(P){var J=this._sw,me=this._ne,De,He;if(P instanceof wh)De=P,He=P;else if(P instanceof Vd){if(De=P._sw,He=P._ne,!De||!He)return this}else{if(Array.isArray(P))if(P.length===4||P.every(Array.isArray)){var nt=P;return this.extend(Vd.convert(nt))}else{var Mt=P;return this.extend(wh.convert(Mt))}return this}return!J&&!me?(this._sw=new wh(De.lng,De.lat),this._ne=new wh(He.lng,He.lat)):(J.lng=Math.min(De.lng,J.lng),J.lat=Math.min(De.lat,J.lat),me.lng=Math.max(He.lng,me.lng),me.lat=Math.max(He.lat,me.lat)),this},Vd.prototype.getCenter=function(){return new wh((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Vd.prototype.getSouthWest=function(){return this._sw},Vd.prototype.getNorthEast=function(){return this._ne},Vd.prototype.getNorthWest=function(){return new wh(this.getWest(),this.getNorth())},Vd.prototype.getSouthEast=function(){return new wh(this.getEast(),this.getSouth())},Vd.prototype.getWest=function(){return this._sw.lng},Vd.prototype.getSouth=function(){return this._sw.lat},Vd.prototype.getEast=function(){return this._ne.lng},Vd.prototype.getNorth=function(){return this._ne.lat},Vd.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Vd.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Vd.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Vd.prototype.contains=function(P){var J=wh.convert(P),me=J.lng,De=J.lat,He=this._sw.lat<=De&&De<=this._ne.lat,nt=this._sw.lng<=me&&me<=this._ne.lng;return this._sw.lng>this._ne.lng&&(nt=this._sw.lng>=me&&me>=this._ne.lng),He&&nt},Vd.convert=function(P){return!P||P instanceof Vd?P:new Vd(P)};var r9=63710088e-1,wh=function(P,J){if(isNaN(P)||isNaN(J))throw new Error("Invalid LngLat object: ("+P+", "+J+")");if(this.lng=+P,this.lat=+J,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};wh.prototype.wrap=function(){return new wh(x(this.lng,-180,180),this.lat)},wh.prototype.toArray=function(){return[this.lng,this.lat]},wh.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},wh.prototype.distanceTo=function(P){var J=Math.PI/180,me=this.lat*J,De=P.lat*J,He=Math.sin(me)*Math.sin(De)+Math.cos(me)*Math.cos(De)*Math.cos((P.lng-this.lng)*J),nt=r9*Math.acos(Math.min(He,1));return nt},wh.prototype.toBounds=function(P){P===void 0&&(P=0);var J=40075017,me=360*P/J,De=me/Math.cos(Math.PI/180*this.lat);return new Vd(new wh(this.lng-De,this.lat-me),new wh(this.lng+De,this.lat+me))},wh.convert=function(P){if(P instanceof wh)return P;if(Array.isArray(P)&&(P.length===2||P.length===3))return new wh(Number(P[0]),Number(P[1]));if(!Array.isArray(P)&&typeof P=="object"&&P!==null)return new wh(Number("lng"in P?P.lng:P.lon),Number(P.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 n9=2*Math.PI*r9;function a9(D){return n9*Math.cos(D*Math.PI/180)}function i9(D){return(180+D)/360}function o9(D){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+D*Math.PI/360)))/360}function s9(D,P){return D/a9(P)}function xee(D){return D*360-180}function B4(D){var P=180-D*360;return 360/Math.PI*Math.atan(Math.exp(P*Math.PI/180))-90}function bee(D,P){return D*a9(B4(P))}function wee(D){return 1/Math.cos(D*Math.PI/180)}var a2=function(P,J,me){me===void 0&&(me=0),this.x=+P,this.y=+J,this.z=+me};a2.fromLngLat=function(P,J){J===void 0&&(J=0);var me=wh.convert(P);return new a2(i9(me.lng),o9(me.lat),s9(J,me.lat))},a2.prototype.toLngLat=function(){return new wh(xee(this.x),B4(this.y))},a2.prototype.toAltitude=function(){return bee(this.z,this.y)},a2.prototype.meterInMercatorCoordinateUnits=function(){return 1/n9*wee(B4(this.y))};var i2=function(P,J,me){this.z=P,this.x=J,this.y=me,this.key=OE(0,P,P,J,me)};i2.prototype.equals=function(P){return this.z===P.z&&this.x===P.x&&this.y===P.y},i2.prototype.url=function(P,J){var me=_ee(this.x,this.y,this.z),De=Tee(this.z,this.x,this.y);return P[(this.x+this.y)%P.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(J==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",De).replace("{bbox-epsg-3857}",me)},i2.prototype.getTilePoint=function(P){var J=Math.pow(2,this.z);return new s((P.x*J-this.x)*mo,(P.y*J-this.y)*mo)},i2.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var l9=function(P,J){this.wrap=P,this.canonical=J,this.key=OE(P,J.z,J.z,J.x,J.y)},jd=function(P,J,me,De,He){this.overscaledZ=P,this.wrap=J,this.canonical=new i2(me,+De,+He),this.key=OE(J,P,me,De,He)};jd.prototype.equals=function(P){return this.overscaledZ===P.overscaledZ&&this.wrap===P.wrap&&this.canonical.equals(P.canonical)},jd.prototype.scaledTo=function(P){var J=this.canonical.z-P;return P>this.canonical.z?new jd(P,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new jd(P,this.wrap,P,this.canonical.x>>J,this.canonical.y>>J)},jd.prototype.calculateScaledKey=function(P,J){var me=this.canonical.z-P;return P>this.canonical.z?OE(this.wrap*+J,P,this.canonical.z,this.canonical.x,this.canonical.y):OE(this.wrap*+J,P,P,this.canonical.x>>me,this.canonical.y>>me)},jd.prototype.isChildOf=function(P){if(P.wrap!==this.wrap)return!1;var J=this.canonical.z-P.canonical.z;return P.overscaledZ===0||P.overscaledZ>J&&P.canonical.y===this.canonical.y>>J},jd.prototype.children=function(P){if(this.overscaledZ>=P)return[new jd(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var J=this.canonical.z+1,me=this.canonical.x*2,De=this.canonical.y*2;return[new jd(J,this.wrap,J,me,De),new jd(J,this.wrap,J,me+1,De),new jd(J,this.wrap,J,me,De+1),new jd(J,this.wrap,J,me+1,De+1)]},jd.prototype.isLessThan=function(P){return this.wrapP.wrap?!1:this.overscaledZP.overscaledZ?!1:this.canonical.xP.canonical.x?!1:this.canonical.y0;He--)De=1<=this.dim+1||J<-1||J>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(J+1)*this.stride+(P+1)},d_.prototype._unpackMapbox=function(P,J,me){return(P*256*256+J*256+me)/10-1e4},d_.prototype._unpackTerrarium=function(P,J,me){return P*256+J+me/256-32768},d_.prototype.getPixels=function(){return new Op({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},d_.prototype.backfillBorder=function(P,J,me){if(this.dim!==P.dim)throw new Error("dem dimension mismatch");var De=J*this.dim,He=J*this.dim+this.dim,nt=me*this.dim,Mt=me*this.dim+this.dim;switch(J){case-1:De=He-1;break;case 1:He=De+1;break}switch(me){case-1:nt=Mt-1;break;case 1:Mt=nt+1;break}for(var tr=-J*this.dim,vr=-me*this.dim,Ar=nt;Ar=0&&Zr[3]>=0&&tr.insert(Mt,Zr[0],Zr[1],Zr[2],Zr[3])}},p_.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new f_.VectorTile(new Bn(this.rawTileData)).layers,this.sourceLayerCoder=new V6(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},p_.prototype.query=function(P,J,me,De){var He=this;this.loadVTLayers();for(var nt=P.params||{},Mt=mo/P.tileSize/P.scale,tr=dt(nt.filter),vr=P.queryGeometry,Ar=P.queryPadding*Mt,Zr=c9(vr),mn=this.grid.query(Zr.minX-Ar,Zr.minY-Ar,Zr.maxX+Ar,Zr.maxY+Ar),hn=c9(P.cameraQueryGeometry),zn=this.grid3D.query(hn.minX-Ar,hn.minY-Ar,hn.maxX+Ar,hn.maxY+Ar,function(So,Go,$o,ks){return Qm(P.cameraQueryGeometry,So-Ar,Go-Ar,$o+Ar,ks+Ar)}),pa=0,li=zn;paDe)He=!1;else if(!J)He=!0;else if(this.expirationTime=tn.maxzoom)&&tn.visibility!=="none"){p(Wr,this.zoom,br);var wn=Pa[tn.id]=tn.createBucket({index:va.bucketLayerIDs.length,layers:Wr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ji,sourceID:this.source});wn.populate(Qi,La,this.tileID.canonical),va.bucketLayerIDs.push(Wr.map(function(An){return An.id}))}}}}var dn,Nt,xr,Xr,Tn=t.mapObject(La.glyphDependencies,function(An){return Object.keys(An).map(Number)});Object.keys(Tn).length?an.send("getGlyphs",{uid:this.uid,stacks:Tn},function(An,Yn){dn||(dn=An,Nt=Yn,na.call(In))}):Nt={};var Xn=Object.keys(La.iconDependencies);Xn.length?an.send("getImages",{icons:Xn,source:this.source,tileID:this.tileID,type:"icons"},function(An,Yn){dn||(dn=An,xr=Yn,na.call(In))}):xr={};var ia=Object.keys(La.patternDependencies);ia.length?an.send("getImages",{icons:ia,source:this.source,tileID:this.tileID,type:"patterns"},function(An,Yn){dn||(dn=An,Xr=Yn,na.call(In))}):Xr={},na.call(this);function na(){if(dn)return bn(dn);if(Nt&&xr&&Xr){var An=new o(Nt),Yn=new t.ImageAtlas(xr,Xr);for(var qi in Pa){var Ga=Pa[qi];Ga instanceof t.SymbolBucket?(p(Ga.layers,this.zoom,br),t.performSymbolLayout(Ga,Nt,An.positions,xr,Yn.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ga.hasPattern&&(Ga instanceof t.LineBucket||Ga instanceof t.FillBucket||Ga instanceof t.FillExtrusionBucket)&&(p(Ga.layers,this.zoom,br),Ga.addFeatures(La,this.tileID.canonical,Yn.patternPositions))}this.status="done",bn(null,{buckets:t.values(Pa).filter(function(to){return!to.isEmpty()}),featureIndex:va,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:An.image,imageAtlas:Yn,glyphMap:this.returnDependencies?Nt:null,iconMap:this.returnDependencies?xr:null,glyphPositions:this.returnDependencies?An.positions:null})}}};function p(_r,rr,yr){for(var br=new t.EvaluationParameters(rr),an=0,bn=_r;an=0!=!!rr&&_r.reverse()}var I=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,T=function(rr){this._feature=rr,this.extent=t.EXTENT,this.type=rr.type,this.properties=rr.tags,"id"in rr&&!isNaN(rr.id)&&(this.id=parseInt(rr.id,10))};T.prototype.loadGeometry=function(){if(this._feature.type===1){for(var rr=[],yr=0,br=this._feature.geometry;yr"u"&&(br.push(Fn),va=br.length-1,bn[Fn]=va),rr.writeVarint(va);var Pa=yr.properties[Fn],La=typeof Pa;La!=="string"&&La!=="boolean"&&La!=="number"&&(Pa=JSON.stringify(Pa));var Oa=La+":"+Pa,Wa=In[Oa];typeof Wa>"u"&&(an.push(Pa),Wa=an.length-1,In[Oa]=Wa),rr.writeVarint(Wa)}}function ue(_r,rr){return(rr<<3)+(_r&7)}function xe(_r){return _r<<1^_r>>31}function ge(_r,rr){for(var yr=_r.loadGeometry(),br=_r.type,an=0,bn=0,In=yr.length,Fn=0;Fn>1;se(_r,rr,In,br,an,bn%2),Y(_r,rr,yr,br,In-1,bn+1),Y(_r,rr,yr,In+1,an,bn+1)}}function se(_r,rr,yr,br,an,bn){for(;an>br;){if(an-br>600){var In=an-br+1,Fn=yr-br+1,va=Math.log(In),Pa=.5*Math.exp(2*va/3),La=.5*Math.sqrt(va*Pa*(In-Pa)/In)*(Fn-In/2<0?-1:1),Oa=Math.max(br,Math.floor(yr-Fn*Pa/In+La)),Wa=Math.min(an,Math.floor(yr+(In-Fn)*Pa/In+La));se(_r,rr,yr,Oa,Wa,bn)}var sa=rr[2*yr+bn],ji=br,Qi=an;for(ce(_r,rr,br,yr),rr[2*an+bn]>sa&&ce(_r,rr,br,an);jisa;)Qi--}rr[2*br+bn]===sa?ce(_r,rr,br,Qi):(Qi++,ce(_r,rr,Qi,an)),Qi<=yr&&(br=Qi+1),yr<=Qi&&(an=Qi-1)}}function ce(_r,rr,yr,br){ne(_r,yr,br),ne(rr,2*yr,2*br),ne(rr,2*yr+1,2*br+1)}function ne(_r,rr,yr){var br=_r[rr];_r[rr]=_r[yr],_r[yr]=br}function ye(_r,rr,yr,br,an,bn,In){for(var Fn=[0,_r.length-1,0],va=[],Pa,La;Fn.length;){var Oa=Fn.pop(),Wa=Fn.pop(),sa=Fn.pop();if(Wa-sa<=In){for(var ji=sa;ji<=Wa;ji++)Pa=rr[2*ji],La=rr[2*ji+1],Pa>=yr&&Pa<=an&&La>=br&&La<=bn&&va.push(_r[ji]);continue}var Qi=Math.floor((sa+Wa)/2);Pa=rr[2*Qi],La=rr[2*Qi+1],Pa>=yr&&Pa<=an&&La>=br&&La<=bn&&va.push(_r[Qi]);var Xt=(Oa+1)%2;(Oa===0?yr<=Pa:br<=La)&&(Fn.push(sa),Fn.push(Qi-1),Fn.push(Xt)),(Oa===0?an>=Pa:bn>=La)&&(Fn.push(Qi+1),Fn.push(Wa),Fn.push(Xt))}return va}function le(_r,rr,yr,br,an,bn){for(var In=[0,_r.length-1,0],Fn=[],va=an*an;In.length;){var Pa=In.pop(),La=In.pop(),Oa=In.pop();if(La-Oa<=bn){for(var Wa=Oa;Wa<=La;Wa++)Z(rr[2*Wa],rr[2*Wa+1],yr,br)<=va&&Fn.push(_r[Wa]);continue}var sa=Math.floor((Oa+La)/2),ji=rr[2*sa],Qi=rr[2*sa+1];Z(ji,Qi,yr,br)<=va&&Fn.push(_r[sa]);var Xt=(Pa+1)%2;(Pa===0?yr-an<=ji:br-an<=Qi)&&(In.push(Oa),In.push(sa-1),In.push(Xt)),(Pa===0?yr+an>=ji:br+an>=Qi)&&(In.push(sa+1),In.push(La),In.push(Xt))}return Fn}function Z(_r,rr,yr,br){var an=_r-yr,bn=rr-br;return an*an+bn*bn}var de=function(_r){return _r[0]},pe=function(_r){return _r[1]},Te=function(rr,yr,br,an,bn){yr===void 0&&(yr=de),br===void 0&&(br=pe),an===void 0&&(an=64),bn===void 0&&(bn=Float64Array),this.nodeSize=an,this.points=rr;for(var In=rr.length<65536?Uint16Array:Uint32Array,Fn=this.ids=new In(rr.length),va=this.coords=new bn(rr.length*2),Pa=0;Pa=an;La--){var Oa=+Date.now();va=this._cluster(va,La),this.trees[La]=new Te(va,Se,Je,In,Float32Array),br&&console.log("z%d: %d clusters in %dms",La,va.length,+Date.now()-Oa)}return br&&console.timeEnd("total time"),this},$e.prototype.getClusters=function(rr,yr){var br=((rr[0]+180)%360+360)%360-180,an=Math.max(-90,Math.min(90,rr[1])),bn=rr[2]===180?180:((rr[2]+180)%360+360)%360-180,In=Math.max(-90,Math.min(90,rr[3]));if(rr[2]-rr[0]>=360)br=-180,bn=180;else if(br>bn){var Fn=this.getClusters([br,an,180,In],yr),va=this.getClusters([-180,an,bn,In],yr);return Fn.concat(va)}for(var Pa=this.trees[this._limitZoom(yr)],La=Pa.range(bt(br),mt(In),bt(bn),mt(an)),Oa=[],Wa=0,sa=La;Wayr&&(Qi+=en.numPoints||1)}if(Qi>=va){for(var rn=Oa.x*ji,Wr=Oa.y*ji,tn=Fn&&ji>1?this._map(Oa,!0):null,wn=(La<<5)+(yr+1)+this.points.length,dn=0,Nt=sa;dn1)for(var Xn=0,ia=sa;Xn>5},$e.prototype._getOriginZoom=function(rr){return(rr-this.points.length)%32},$e.prototype._map=function(rr,yr){if(rr.numPoints)return yr?ze({},rr.properties):rr.properties;var br=this.points[rr.index].properties,an=this.options.map(br);return yr&&an===br?ze({},an):an};function Ze(_r,rr,yr,br,an){return{x:_r,y:rr,zoom:1/0,id:yr,parentId:-1,numPoints:br,properties:an}}function Xe(_r,rr){var yr=_r.geometry.coordinates,br=yr[0],an=yr[1];return{x:bt(br),y:mt(an),zoom:1/0,index:rr,parentId:-1}}function it(_r){return{type:"Feature",id:_r.id,properties:yt(_r),geometry:{type:"Point",coordinates:[ht(_r.x),Ve(_r.y)]}}}function yt(_r){var rr=_r.numPoints,yr=rr>=1e4?Math.round(rr/1e3)+"k":rr>=1e3?Math.round(rr/100)/10+"k":rr;return ze(ze({},_r.properties),{cluster:!0,cluster_id:_r.id,point_count:rr,point_count_abbreviated:yr})}function bt(_r){return _r/360+.5}function mt(_r){var rr=Math.sin(_r*Math.PI/180),yr=.5-.25*Math.log((1+rr)/(1-rr))/Math.PI;return yr<0?0:yr>1?1:yr}function ht(_r){return(_r-.5)*360}function Ve(_r){var rr=(180-_r*360)*Math.PI/180;return 360*Math.atan(Math.exp(rr))/Math.PI-90}function ze(_r,rr){for(var yr in rr)_r[yr]=rr[yr];return _r}function Se(_r){return _r.x}function Je(_r){return _r.y}function _t(_r,rr,yr,br){for(var an=br,bn=yr-rr>>1,In=yr-rr,Fn,va=_r[rr],Pa=_r[rr+1],La=_r[yr],Oa=_r[yr+1],Wa=rr+3;Waan)Fn=Wa,an=sa;else if(sa===an){var ji=Math.abs(Wa-bn);jibr&&(Fn-rr>3&&_t(_r,rr,Fn,br),_r[Fn+2]=an,yr-Fn>3&&_t(_r,Fn,yr,br))}function At(_r,rr,yr,br,an,bn){var In=an-yr,Fn=bn-br;if(In!==0||Fn!==0){var va=((_r-yr)*In+(rr-br)*Fn)/(In*In+Fn*Fn);va>1?(yr=an,br=bn):va>0&&(yr+=In*va,br+=Fn*va)}return In=_r-yr,Fn=rr-br,In*In+Fn*Fn}function vt(_r,rr,yr,br){var an={id:typeof _r>"u"?null:_r,type:rr,geometry:yr,tags:br,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Kt(an),an}function Kt(_r){var rr=_r.geometry,yr=_r.type;if(yr==="Point"||yr==="MultiPoint"||yr==="LineString")Qt(_r,rr);else if(yr==="Polygon"||yr==="MultiLineString")for(var br=0;br0&&(br?In+=(an*Pa-va*bn)/2:In+=Math.sqrt(Math.pow(va-an,2)+Math.pow(Pa-bn,2))),an=va,bn=Pa}var La=rr.length-3;rr[2]=1,_t(rr,0,La,yr),rr[La+2]=1,rr.size=Math.abs(In),rr.start=0,rr.end=rr.size}function fn(_r,rr,yr,br){for(var an=0;an<_r.length;an++){var bn=[];Br(_r[an],bn,yr,br),rr.push(bn)}}function Fr(_r){return _r/360+.5}function Qr(_r){var rr=Math.sin(_r*Math.PI/180),yr=.5-.25*Math.log((1+rr)/(1-rr))/Math.PI;return yr<0?0:yr>1?1:yr}function Bt(_r,rr,yr,br,an,bn,In,Fn){if(yr/=rr,br/=rr,bn>=yr&&In=br)return null;for(var va=[],Pa=0;Pa<_r.length;Pa++){var La=_r[Pa],Oa=La.geometry,Wa=La.type,sa=an===0?La.minX:La.minY,ji=an===0?La.maxX:La.maxY;if(sa>=yr&&ji=br)continue;var Qi=[];if(Wa==="Point"||Wa==="MultiPoint")et(Oa,Qi,yr,br,an);else if(Wa==="LineString")ut(Oa,Qi,yr,br,an,!1,Fn.lineMetrics);else if(Wa==="MultiLineString")Ie(Oa,Qi,yr,br,an,!1);else if(Wa==="Polygon")Ie(Oa,Qi,yr,br,an,!0);else if(Wa==="MultiPolygon")for(var Xt=0;Xt=yr&&In<=br&&(rr.push(_r[bn]),rr.push(_r[bn+1]),rr.push(_r[bn+2]))}}function ut(_r,rr,yr,br,an,bn,In){for(var Fn=Be(_r),va=an===0?Fe:at,Pa=_r.start,La,Oa,Wa=0;Wa<_r.length-3;Wa+=3){var sa=_r[Wa],ji=_r[Wa+1],Qi=_r[Wa+2],Xt=_r[Wa+3],Lt=_r[Wa+4],$r=an===0?sa:ji,en=an===0?Xt:Lt,rn=!1;In&&(La=Math.sqrt(Math.pow(sa-Xt,2)+Math.pow(ji-Lt,2))),$ryr&&(Oa=va(Fn,sa,ji,Xt,Lt,yr),In&&(Fn.start=Pa+La*Oa)):$r>br?en=yr&&(Oa=va(Fn,sa,ji,Xt,Lt,yr),rn=!0),en>br&&$r<=br&&(Oa=va(Fn,sa,ji,Xt,Lt,br),rn=!0),!bn&&rn&&(In&&(Fn.end=Pa+La*Oa),rr.push(Fn),Fn=Be(_r)),In&&(Pa+=La)}var Wr=_r.length-3;sa=_r[Wr],ji=_r[Wr+1],Qi=_r[Wr+2],$r=an===0?sa:ji,$r>=yr&&$r<=br&&ke(Fn,sa,ji,Qi),Wr=Fn.length-3,bn&&Wr>=3&&(Fn[Wr]!==Fn[0]||Fn[Wr+1]!==Fn[1])&&ke(Fn,Fn[0],Fn[1],Fn[2]),Fn.length&&rr.push(Fn)}function Be(_r){var rr=[];return rr.size=_r.size,rr.start=_r.start,rr.end=_r.end,rr}function Ie(_r,rr,yr,br,an,bn){for(var In=0;In<_r.length;In++)ut(_r[In],rr,yr,br,an,bn,!1)}function ke(_r,rr,yr,br){_r.push(rr),_r.push(yr),_r.push(br)}function Fe(_r,rr,yr,br,an,bn){var In=(bn-rr)/(br-rr);return _r.push(bn),_r.push(yr+(an-yr)*In),_r.push(1),In}function at(_r,rr,yr,br,an,bn){var In=(bn-yr)/(an-yr);return _r.push(rr+(br-rr)*In),_r.push(bn),_r.push(1),In}function ct(_r,rr){var yr=rr.buffer/rr.extent,br=_r,an=Bt(_r,1,-1-yr,yr,0,-1,2,rr),bn=Bt(_r,1,1-yr,2+yr,0,-1,2,rr);return(an||bn)&&(br=Bt(_r,1,-yr,1+yr,0,-1,2,rr)||[],an&&(br=Gt(an,1).concat(br)),bn&&(br=br.concat(Gt(bn,-1)))),br}function Gt(_r,rr){for(var yr=[],br=0;br<_r.length;br++){var an=_r[br],bn=an.type,In;if(bn==="Point"||bn==="MultiPoint"||bn==="LineString")In=Vt(an.geometry,rr);else if(bn==="MultiLineString"||bn==="Polygon"){In=[];for(var Fn=0;FnIn.maxX&&(In.maxX=La),Oa>In.maxY&&(In.maxY=Oa)}return In}function kr(_r,rr,yr,br){var an=rr.geometry,bn=rr.type,In=[];if(bn==="Point"||bn==="MultiPoint")for(var Fn=0;Fn0&&rr.size<(an?In:br)){yr.numPoints+=rr.length/3;return}for(var Fn=[],va=0;vaIn)&&(yr.numSimplified++,Fn.push(rr[va]),Fn.push(rr[va+1])),yr.numPoints++;an&&Jr(Fn,bn),_r.push(Fn)}function Jr(_r,rr){for(var yr=0,br=0,an=_r.length,bn=an-2;br0===rr)for(br=0,an=_r.length;br24)throw new Error("maxZoom should be in the 0-24 range");if(rr.promoteId&&rr.generateId)throw new Error("promoteId and generateId cannot be used together.");var br=fr(_r,rr);this.tiles={},this.tileCoords=[],yr&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",rr.indexMaxZoom,rr.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),br=ct(br,rr),br.length&&this.splitTile(br,0,0,0),yr&&(br.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)))}ha.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ha.prototype.splitTile=function(_r,rr,yr,br,an,bn,In){for(var Fn=[_r,rr,yr,br],va=this.options,Pa=va.debug;Fn.length;){br=Fn.pop(),yr=Fn.pop(),rr=Fn.pop(),_r=Fn.pop();var La=1<1&&console.time("creation"),Wa=this.tiles[Oa]=Dr(_r,rr,yr,br,va),this.tileCoords.push({z:rr,x:yr,y:br}),Pa)){Pa>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",rr,yr,br,Wa.numFeatures,Wa.numPoints,Wa.numSimplified),console.timeEnd("creation"));var sa="z"+rr;this.stats[sa]=(this.stats[sa]||0)+1,this.total++}if(Wa.source=_r,an){if(rr===va.maxZoom||rr===an)continue;var ji=1<1&&console.time("clipping");var Qi=.5*va.buffer/va.extent,Xt=.5-Qi,Lt=.5+Qi,$r=1+Qi,en,rn,Wr,tn,wn,dn;en=rn=Wr=tn=null,wn=Bt(_r,La,yr-Qi,yr+Lt,0,Wa.minX,Wa.maxX,va),dn=Bt(_r,La,yr+Xt,yr+$r,0,Wa.minX,Wa.maxX,va),_r=null,wn&&(en=Bt(wn,La,br-Qi,br+Lt,1,Wa.minY,Wa.maxY,va),rn=Bt(wn,La,br+Xt,br+$r,1,Wa.minY,Wa.maxY,va),wn=null),dn&&(Wr=Bt(dn,La,br-Qi,br+Lt,1,Wa.minY,Wa.maxY,va),tn=Bt(dn,La,br+Xt,br+$r,1,Wa.minY,Wa.maxY,va),dn=null),Pa>1&&console.timeEnd("clipping"),Fn.push(en||[],rr+1,yr*2,br*2),Fn.push(rn||[],rr+1,yr*2,br*2+1),Fn.push(Wr||[],rr+1,yr*2+1,br*2),Fn.push(tn||[],rr+1,yr*2+1,br*2+1)}}},ha.prototype.getTile=function(_r,rr,yr){var br=this.options,an=br.extent,bn=br.debug;if(_r<0||_r>24)return null;var In=1<<_r;rr=(rr%In+In)%In;var Fn=oa(_r,rr,yr);if(this.tiles[Fn])return Zt(this.tiles[Fn],an);bn>1&&console.log("drilling down to z%d-%d-%d",_r,rr,yr);for(var va=_r,Pa=rr,La=yr,Oa;!Oa&&va>0;)va--,Pa=Math.floor(Pa/2),La=Math.floor(La/2),Oa=this.tiles[oa(va,Pa,La)];return!Oa||!Oa.source?null:(bn>1&&console.log("found parent tile z%d-%d-%d",va,Pa,La),bn>1&&console.time("drilling down"),this.splitTile(Oa.source,va,Pa,La,_r,rr,yr),bn>1&&console.timeEnd("drilling down"),this.tiles[Fn]?Zt(this.tiles[Fn],an):null)};function oa(_r,rr,yr){return((1<<_r)*yr+rr)*32+_r}function _a(_r,rr){for(var yr in rr)_r[yr]=rr[yr];return _r}function xa(_r,rr){var yr=_r.tileID.canonical;if(!this._geoJSONIndex)return rr(null,null);var br=this._geoJSONIndex.getTile(yr.z,yr.x,yr.y);if(!br)return rr(null,null);var an=new E(br.features),bn=F(an);(bn.byteOffset!==0||bn.byteLength!==bn.buffer.byteLength)&&(bn=new Uint8Array(bn)),rr(null,{vectorTile:an,rawData:bn.buffer})}var ra=(function(_r){function rr(yr,br,an,bn){_r.call(this,yr,br,an,xa),bn&&(this.loadGeoJSON=bn)}return _r&&(rr.__proto__=_r),rr.prototype=Object.create(_r&&_r.prototype),rr.prototype.constructor=rr,rr.prototype.loadData=function(br,an){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=an,this._pendingLoadDataParams=br,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},rr.prototype._loadData=function(){var br=this;if(!(!this._pendingCallback||!this._pendingLoadDataParams)){var an=this._pendingCallback,bn=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var In=bn&&bn.request&&bn.request.collectResourceTiming?new t.RequestPerformance(bn.request):!1;this.loadGeoJSON(bn,function(Fn,va){if(Fn||!va)return an(Fn);if(typeof va!="object")return an(new Error("Input data given to '"+bn.source+"' is not a valid GeoJSON object."));f(va,!0);try{if(bn.filter){var Pa=t.createExpression(bn.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Pa.result==="error")throw new Error(Pa.value.map(function(sa){return sa.key+": "+sa.message}).join(", "));var La=va.features.filter(function(sa){return Pa.value.evaluate({zoom:0},sa)});va={type:"FeatureCollection",features:La}}br._geoJSONIndex=bn.cluster?new $e(Ha(bn)).load(va.features):jn(va,bn.geojsonVtOptions)}catch(sa){return an(sa)}br.loaded={};var Oa={};if(In){var Wa=In.finish();Wa&&(Oa.resourceTiming={},Oa.resourceTiming[bn.source]=JSON.parse(JSON.stringify(Wa)))}an(null,Oa)})}},rr.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},rr.prototype.reloadTile=function(br,an){var bn=this.loaded,In=br.uid;return bn&&bn[In]?_r.prototype.reloadTile.call(this,br,an):this.loadTile(br,an)},rr.prototype.loadGeoJSON=function(br,an){if(br.request)t.getJSON(br.request,an);else if(typeof br.data=="string")try{return an(null,JSON.parse(br.data))}catch{return an(new Error("Input data given to '"+br.source+"' is not a valid GeoJSON object."))}else return an(new Error("Input data given to '"+br.source+"' is not a valid GeoJSON object."))},rr.prototype.removeSource=function(br,an){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),an()},rr.prototype.getClusterExpansionZoom=function(br,an){try{an(null,this._geoJSONIndex.getClusterExpansionZoom(br.clusterId))}catch(bn){an(bn)}},rr.prototype.getClusterChildren=function(br,an){try{an(null,this._geoJSONIndex.getChildren(br.clusterId))}catch(bn){an(bn)}},rr.prototype.getClusterLeaves=function(br,an){try{an(null,this._geoJSONIndex.getLeaves(br.clusterId,br.limit,br.offset))}catch(bn){an(bn)}},rr})(y);function Ha(_r){var rr=_r.superclusterOptions,yr=_r.clusterProperties;if(!yr||!rr)return rr;for(var br={},an={},bn={accumulated:null,zoom:0},In={properties:null},Fn=Object.keys(yr),va=0,Pa=Fn;va=0?0:Le.button},a.remove=function(Le){Le.parentNode&&Le.parentNode.removeChild(Le)};function g(Le,X,we){var ie,Me,tt,wt=t.browser.devicePixelRatio>1?"@2x":"",Et=t.getJSON(X.transformRequest(X.normalizeSpriteURL(Le,wt,".json"),t.ResourceType.SpriteJSON),function(Pt,lr){Et=null,tt||(tt=Pt,ie=lr,gt())}),lt=t.getImage(X.transformRequest(X.normalizeSpriteURL(Le,wt,".png"),t.ResourceType.SpriteImage),function(Pt,lr){lt=null,tt||(tt=Pt,Me=lr,gt())});function gt(){if(tt)we(tt);else if(ie&&Me){var Pt=t.browser.getImageData(Me),lr={};for(var nr in ie){var cr=ie[nr],gr=cr.width,pr=cr.height,Jt=cr.x,or=cr.y,ar=cr.sdf,Yr=cr.pixelRatio,cn=cr.stretchX,Sn=cr.stretchY,Sa=cr.content,fa=new t.RGBAImage({width:gr,height:pr});t.RGBAImage.copy(Pt,fa,{x:Jt,y:or},{x:0,y:0},{width:gr,height:pr}),lr[nr]={data:fa,pixelRatio:Yr,sdf:ar,stretchX:cn,stretchY:Sn,content:Sa}}we(null,lr)}}return{cancel:function(){Et&&(Et.cancel(),Et=null),lt&&(lt.cancel(),lt=null)}}}function C(Le){var X=Le.userImage;if(X&&X.render){var we=X.render();if(we)return Le.data.replace(new Uint8Array(X.data.buffer)),!0}return!1}var f=1,x=(function(Le){function X(){Le.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return Le&&(X.__proto__=Le),X.prototype=Object.create(Le&&Le.prototype),X.prototype.constructor=X,X.prototype.isLoaded=function(){return this.loaded},X.prototype.setLoaded=function(ie){if(this.loaded!==ie&&(this.loaded=ie,ie)){for(var Me=0,tt=this.requestors;Me=0?1.2:1))}E.prototype.draw=function(Le){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(Le,this.buffer,this.middle);for(var X=this.ctx.getImageData(0,0,this.size,this.size),we=new Uint8ClampedArray(this.size*this.size),ie=0;ie65535){Pt(new Error("glyphs > 65535 not supported"));return}if(cr.ranges[pr]){Pt(null,{stack:lr,id:nr,glyph:gr});return}var Jt=cr.requests[pr];Jt||(Jt=cr.requests[pr]=[],m.loadGlyphRange(lr,pr,ie.url,ie.requestManager,function(or,ar){if(ar){for(var Yr in ar)ie._doesCharSupportLocalGlyph(+Yr)||(cr.glyphs[+Yr]=ar[+Yr]);cr.ranges[pr]=!0}for(var cn=0,Sn=Jt;cn1&&(gt=X[++lt]);var lr=Math.abs(Pt-gt.left),nr=Math.abs(Pt-gt.right),cr=Math.min(lr,nr),gr=void 0,pr=tt/ie*(Me+1);if(gt.isDash){var Jt=Me-Math.abs(pr);gr=Math.sqrt(cr*cr+Jt*Jt)}else gr=Me-Math.sqrt(cr*cr+pr*pr);this.data[Et+Pt]=Math.max(0,Math.min(255,gr+128))}},V.prototype.addRegularDash=function(X){for(var we=X.length-1;we>=0;--we){var ie=X[we],Me=X[we+1];ie.zeroLength?X.splice(we,1):Me&&Me.isDash===ie.isDash&&(Me.left=ie.left,X.splice(we,1))}var tt=X[0],wt=X[X.length-1];tt.isDash===wt.isDash&&(tt.left=wt.left-this.width,wt.right=tt.right+this.width);for(var Et=this.width*this.nextRow,lt=0,gt=X[lt],Pt=0;Pt1&&(gt=X[++lt]);var lr=Math.abs(Pt-gt.left),nr=Math.abs(Pt-gt.right),cr=Math.min(lr,nr),gr=gt.isDash?cr:-cr;this.data[Et+Pt]=Math.max(0,Math.min(255,gr+128))}},V.prototype.addDash=function(X,we){var ie=we?7:0,Me=2*ie+1;if(this.nextRow+Me>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var tt=0,wt=0;wt=ie.minX&&X.x=ie.minY&&X.y0&&(Pt[new t.OverscaledTileID(ie.overscaledZ,Et,Me.z,wt,Me.y-1).key]={backfilled:!1},Pt[new t.OverscaledTileID(ie.overscaledZ,ie.wrap,Me.z,Me.x,Me.y-1).key]={backfilled:!1},Pt[new t.OverscaledTileID(ie.overscaledZ,gt,Me.z,lt,Me.y-1).key]={backfilled:!1}),Me.y+10&&(tt.resourceTiming=ie._resourceTiming,ie._resourceTiming=[]),ie.fire(new t.Event("data",tt))})},X.prototype.onAdd=function(ie){this.map=ie,this.load()},X.prototype.setData=function(ie){var Me=this;return this._data=ie,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(tt){if(tt){Me.fire(new t.ErrorEvent(tt));return}var wt={dataType:"source",sourceDataType:"content"};Me._collectResourceTiming&&Me._resourceTiming&&Me._resourceTiming.length>0&&(wt.resourceTiming=Me._resourceTiming,Me._resourceTiming=[]),Me.fire(new t.Event("data",wt))}),this},X.prototype.getClusterExpansionZoom=function(ie,Me){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:ie,source:this.id},Me),this},X.prototype.getClusterChildren=function(ie,Me){return this.actor.send("geojson.getClusterChildren",{clusterId:ie,source:this.id},Me),this},X.prototype.getClusterLeaves=function(ie,Me,tt,wt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:ie,limit:Me,offset:tt},wt),this},X.prototype._updateWorkerData=function(ie){var Me=this;this._loaded=!1;var tt=t.extend({},this.workerOptions),wt=this._data;typeof wt=="string"?(tt.request=this.map._requestManager.transformRequest(t.browser.resolveURL(wt),t.ResourceType.Source),tt.request.collectResourceTiming=this._collectResourceTiming):tt.data=JSON.stringify(wt),this.actor.send(this.type+".loadData",tt,function(Et,lt){Me._removed||lt&<.abandoned||(Me._loaded=!0,lt&<.resourceTiming&<.resourceTiming[Me.id]&&(Me._resourceTiming=lt.resourceTiming[Me.id].slice(0)),Me.actor.send(Me.type+".coalesce",{source:tt.source},null),ie(Et))})},X.prototype.loaded=function(){return this._loaded},X.prototype.loadTile=function(ie,Me){var tt=this,wt=ie.actor?"reloadTile":"loadTile";ie.actor=this.actor;var Et={type:this.type,uid:ie.uid,tileID:ie.tileID,zoom:ie.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};ie.request=this.actor.send(wt,Et,function(lt,gt){return delete ie.request,ie.unloadVectorData(),ie.aborted?Me(null):lt?Me(lt):(ie.loadVectorData(gt,tt.map.painter,wt==="reloadTile"),Me(null))})},X.prototype.abortTile=function(ie){ie.request&&(ie.request.cancel(),delete ie.request),ie.aborted=!0},X.prototype.unloadTile=function(ie){ie.unloadVectorData(),this.actor.send("removeTile",{uid:ie.uid,type:this.type,source:this.id})},X.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},X.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},X.prototype.hasTransition=function(){return!1},X})(t.Evented),xe=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),ge=(function(Le){function X(we,ie,Me,tt){Le.call(this),this.id=we,this.dispatcher=Me,this.coordinates=ie.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(tt),this.options=ie}return Le&&(X.__proto__=Le),X.prototype=Object.create(Le&&Le.prototype),X.prototype.constructor=X,X.prototype.load=function(ie,Me){var tt=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),function(wt,Et){tt._loaded=!0,wt?tt.fire(new t.ErrorEvent(wt)):Et&&(tt.image=Et,ie&&(tt.coordinates=ie),Me&&Me(),tt._finishLoading())})},X.prototype.loaded=function(){return this._loaded},X.prototype.updateImage=function(ie){var Me=this;return!this.image||!ie.url?this:(this.options.url=ie.url,this.load(ie.coordinates,function(){Me.texture=null}),this)},X.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},X.prototype.onAdd=function(ie){this.map=ie,this.load()},X.prototype.setCoordinates=function(ie){var Me=this;this.coordinates=ie;var tt=ie.map(t.MercatorCoordinate.fromLngLat);this.tileID=_e(tt),this.minzoom=this.maxzoom=this.tileID.z;var wt=tt.map(function(Et){return Me.tileID.getTilePoint(Et)._round()});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(wt[0].x,wt[0].y,0,0),this._boundsArray.emplaceBack(wt[1].x,wt[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(wt[3].x,wt[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(wt[2].x,wt[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},X.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var ie=this.map.painter.context,Me=ie.gl;this.boundsBuffer||(this.boundsBuffer=ie.createVertexBuffer(this._boundsArray,xe.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(ie,this.image,Me.RGBA),this.texture.bind(Me.LINEAR,Me.CLAMP_TO_EDGE));for(var tt in this.tiles){var wt=this.tiles[tt];wt.state!=="loaded"&&(wt.state="loaded",wt.texture=this.texture)}}},X.prototype.loadTile=function(ie,Me){this.tileID&&this.tileID.equals(ie.tileID.canonical)?(this.tiles[String(ie.tileID.wrap)]=ie,ie.buckets={},Me(null)):(ie.state="errored",Me(null))},X.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},X.prototype.hasTransition=function(){return!1},X})(t.Evented);function _e(Le){for(var X=1/0,we=1/0,ie=-1/0,Me=-1/0,tt=0,wt=Le;ttMe.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+Me.start(0)+" and "+Me.end(0)+"-second mark."))):this.video.currentTime=ie}},X.prototype.getVideo=function(){return this.video},X.prototype.onAdd=function(ie){this.map||(this.map=ie,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},X.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var ie=this.map.painter.context,Me=ie.gl;this.boundsBuffer||(this.boundsBuffer=ie.createVertexBuffer(this._boundsArray,xe.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(Me.LINEAR,Me.CLAMP_TO_EDGE),Me.texSubImage2D(Me.TEXTURE_2D,0,0,0,Me.RGBA,Me.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(ie,this.video,Me.RGBA),this.texture.bind(Me.LINEAR,Me.CLAMP_TO_EDGE));for(var tt in this.tiles){var wt=this.tiles[tt];wt.state!=="loaded"&&(wt.state="loaded",wt.texture=this.texture)}}},X.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},X.prototype.hasTransition=function(){return this.video&&!this.video.paused},X})(ge),se=(function(Le){function X(we,ie,Me,tt){Le.call(this,we,ie,Me,tt),ie.coordinates?(!Array.isArray(ie.coordinates)||ie.coordinates.length!==4||ie.coordinates.some(function(wt){return!Array.isArray(wt)||wt.length!==2||wt.some(function(Et){return typeof Et!="number"})}))&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+we,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+we,null,'missing required property "coordinates"'))),ie.animate&&typeof ie.animate!="boolean"&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+we,null,'optional "animate" property must be a boolean value'))),ie.canvas?typeof ie.canvas!="string"&&!(ie.canvas instanceof t.window.HTMLCanvasElement)&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+we,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 t.ErrorEvent(new t.ValidationError("sources."+we,null,'missing required property "canvas"'))),this.options=ie,this.animate=ie.animate!==void 0?ie.animate:!0}return Le&&(X.__proto__=Le),X.prototype=Object.create(Le&&Le.prototype),X.prototype.constructor=X,X.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},X.prototype.getCanvas=function(){return this.canvas},X.prototype.onAdd=function(ie){this.map=ie,this.load(),this.canvas&&this.animate&&this.play()},X.prototype.onRemove=function(){this.pause()},X.prototype.prepare=function(){var ie=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,ie=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,ie=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var Me=this.map.painter.context,tt=Me.gl;this.boundsBuffer||(this.boundsBuffer=Me.createVertexBuffer(this._boundsArray,xe.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(ie||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(Me,this.canvas,tt.RGBA,{premultiply:!0});for(var wt in this.tiles){var Et=this.tiles[wt];Et.state!=="loaded"&&(Et.state="loaded",Et.texture=this.texture)}}},X.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},X.prototype.hasTransition=function(){return this._playing},X.prototype._hasInvalidDimensions=function(){for(var ie=0,Me=[this.canvas.width,this.canvas.height];iethis.max){var Et=this._getAndRemoveByKey(this.order[0]);Et&&this.onRemove(Et)}return this},Xe.prototype.has=function(X){return X.wrapped().key in this.data},Xe.prototype.getAndRemove=function(X){return this.has(X)?this._getAndRemoveByKey(X.wrapped().key):null},Xe.prototype._getAndRemoveByKey=function(X){var we=this.data[X].shift();return we.timeout&&clearTimeout(we.timeout),this.data[X].length===0&&delete this.data[X],this.order.splice(this.order.indexOf(X),1),we.value},Xe.prototype.getByKey=function(X){var we=this.data[X];return we?we[0].value:null},Xe.prototype.get=function(X){if(!this.has(X))return null;var we=this.data[X.wrapped().key][0];return we.value},Xe.prototype.remove=function(X,we){if(!this.has(X))return this;var ie=X.wrapped().key,Me=we===void 0?0:this.data[ie].indexOf(we),tt=this.data[ie][Me];return this.data[ie].splice(Me,1),tt.timeout&&clearTimeout(tt.timeout),this.data[ie].length===0&&delete this.data[ie],this.onRemove(tt.value),this.order.splice(this.order.indexOf(ie),1),this},Xe.prototype.setMaxSize=function(X){for(this.max=X;this.order.length>this.max;){var we=this._getAndRemoveByKey(this.order[0]);we&&this.onRemove(we)}return this},Xe.prototype.filter=function(X){var we=[];for(var ie in this.data)for(var Me=0,tt=this.data[ie];Me1||(Math.abs(lr)>1&&(Math.abs(lr+cr)===1?lr+=cr:Math.abs(lr-cr)===1&&(lr-=cr)),!(!Pt.dem||!gt.dem)&&(gt.dem.backfillBorder(Pt.dem,lr,nr),gt.neighboringTiles&>.neighboringTiles[gr]&&(gt.neighboringTiles[gr].backfilled=!0)))}},X.prototype.getTile=function(ie){return this.getTileByID(ie.key)},X.prototype.getTileByID=function(ie){return this._tiles[ie]},X.prototype._retainLoadedChildren=function(ie,Me,tt,wt){for(var Et in this._tiles){var lt=this._tiles[Et];if(!(wt[Et]||!lt.hasData()||lt.tileID.overscaledZ<=Me||lt.tileID.overscaledZ>tt)){for(var gt=lt.tileID;lt&<.tileID.overscaledZ>Me+1;){var Pt=lt.tileID.scaledTo(lt.tileID.overscaledZ-1);lt=this._tiles[Pt.key],lt&<.hasData()&&(gt=Pt)}for(var lr=gt;lr.overscaledZ>Me;)if(lr=lr.scaledTo(lr.overscaledZ-1),ie[lr.key]){wt[gt.key]=gt;break}}}},X.prototype.findLoadedParent=function(ie,Me){if(ie.key in this._loadedParentTiles){var tt=this._loadedParentTiles[ie.key];return tt&&tt.tileID.overscaledZ>=Me?tt:null}for(var wt=ie.overscaledZ-1;wt>=Me;wt--){var Et=ie.scaledTo(wt),lt=this._getLoadedTile(Et);if(lt)return lt}},X.prototype._getLoadedTile=function(ie){var Me=this._tiles[ie.key];if(Me&&Me.hasData())return Me;var tt=this._cache.getByKey(ie.wrapped().key);return tt},X.prototype.updateCacheSize=function(ie){var Me=Math.ceil(ie.width/this._source.tileSize)+1,tt=Math.ceil(ie.height/this._source.tileSize)+1,wt=Me*tt,Et=5,lt=Math.floor(wt*Et),gt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,lt):lt;this._cache.setMaxSize(gt)},X.prototype.handleWrapJump=function(ie){var Me=this._prevLng===void 0?ie:this._prevLng,tt=ie-Me,wt=tt/360,Et=Math.round(wt);if(this._prevLng=ie,Et){var lt={};for(var gt in this._tiles){var Pt=this._tiles[gt];Pt.tileID=Pt.tileID.unwrapTo(Pt.tileID.wrap+Et),lt[Pt.tileID.key]=Pt}this._tiles=lt;for(var lr in this._timers)clearTimeout(this._timers[lr]),delete this._timers[lr];for(var nr in this._tiles){var cr=this._tiles[nr];this._setTileReloadTimer(nr,cr)}}},X.prototype.update=function(ie){var Me=this;if(this.transform=ie,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(ie),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var tt;this.used?this._source.tileID?tt=ie.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Ra){return new t.OverscaledTileID(Ra.canonical.z,Ra.wrap,Ra.canonical.z,Ra.canonical.x,Ra.canonical.y)}):(tt=ie.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(tt=tt.filter(function(Ra){return Me._source.hasTile(Ra)}))):tt=[];var wt=ie.coveringZoomLevel(this._source),Et=Math.max(wt-X.maxOverzooming,this._source.minzoom),lt=Math.max(wt+X.maxUnderzooming,this._source.minzoom),gt=this._updateRetainedTiles(tt,wt);if(va(this._source.type)){for(var Pt={},lr={},nr=Object.keys(gt),cr=0,gr=nr;crthis._source.maxzoom){var ar=Jt.children(this._source.maxzoom)[0],Yr=this.getTile(ar);if(Yr&&Yr.hasData()){tt[ar.key]=ar;continue}}else{var cn=Jt.children(this._source.maxzoom);if(tt[cn[0].key]&&tt[cn[1].key]&&tt[cn[2].key]&&tt[cn[3].key])continue}for(var Sn=or.wasRequested(),Sa=Jt.overscaledZ-1;Sa>=Et;--Sa){var fa=Jt.scaledTo(Sa);if(wt[fa.key]||(wt[fa.key]=!0,or=this.getTile(fa),!or&&Sn&&(or=this._addTile(fa)),or&&(tt[fa.key]=fa,Sn=or.wasRequested(),or.hasData())))break}}}return tt},X.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var ie in this._tiles){for(var Me=[],tt=void 0,wt=this._tiles[ie].tileID;wt.overscaledZ>0;){if(wt.key in this._loadedParentTiles){tt=this._loadedParentTiles[wt.key];break}Me.push(wt.key);var Et=wt.scaledTo(wt.overscaledZ-1);if(tt=this._getLoadedTile(Et),tt)break;wt=Et}for(var lt=0,gt=Me;lt0)&&(Me.hasData()&&Me.state!=="reloading"?this._cache.add(Me.tileID,Me,Me.getExpiryTimeout()):(Me.aborted=!0,this._abortTile(Me),this._unloadTile(Me))))},X.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var ie in this._tiles)this._removeTile(ie);this._cache.reset()},X.prototype.tilesIn=function(ie,Me,tt){var wt=this,Et=[],lt=this.transform;if(!lt)return Et;for(var gt=tt?lt.getCameraQueryGeometry(ie):ie,Pt=ie.map(function(Sa){return lt.pointCoordinate(Sa)}),lr=gt.map(function(Sa){return lt.pointCoordinate(Sa)}),nr=this.getIds(),cr=1/0,gr=1/0,pr=-1/0,Jt=-1/0,or=0,ar=lr;or=0&&Ya[1].y+Ra>=0){var ka=Pt.map(function(_i){return la.getTilePoint(_i)}),ri=lr.map(function(_i){return la.getTilePoint(_i)});Et.push({tile:fa,tileID:la,queryGeometry:ka,cameraQueryGeometry:ri,scale:Ea})}}},Sn=0;Sn=t.browser.now())return!0}return!1},X.prototype.setFeatureState=function(ie,Me,tt){ie=ie||"_geojsonTileLayer",this._state.updateState(ie,Me,tt)},X.prototype.removeFeatureState=function(ie,Me,tt){ie=ie||"_geojsonTileLayer",this._state.removeFeatureState(ie,Me,tt)},X.prototype.getFeatureState=function(ie,Me){return ie=ie||"_geojsonTileLayer",this._state.getState(ie,Me)},X.prototype.setDependencies=function(ie,Me,tt){var wt=this._tiles[ie];wt&&wt.setDependencies(Me,tt)},X.prototype.reloadTilesForDependencies=function(ie,Me){for(var tt in this._tiles){var wt=this._tiles[tt];wt.hasDependency(ie,Me)&&this._reloadTile(tt,"reloading")}this._cache.filter(function(Et){return!Et.hasDependency(ie,Me)})},X})(t.Evented);In.maxOverzooming=10,In.maxUnderzooming=3;function Fn(Le,X){var we=Math.abs(Le.wrap*2)-+(Le.wrap<0),ie=Math.abs(X.wrap*2)-+(X.wrap<0);return Le.overscaledZ-X.overscaledZ||ie-we||X.canonical.y-Le.canonical.y||X.canonical.x-Le.canonical.x}function va(Le){return Le==="raster"||Le==="image"||Le==="video"}function Pa(){return new t.window.Worker(Bs.workerUrl)}var La="mapboxgl_preloaded_worker_pool",Oa=function(){this.active={}};Oa.prototype.acquire=function(X){if(!this.workers)for(this.workers=[];this.workers.length0?(Me-wt)/Et:0;return this.points[tt].mult(1-lt).add(this.points[we].mult(lt))};var An=function(X,we,ie){var Me=this.boxCells=[],tt=this.circleCells=[];this.xCellCount=Math.ceil(X/ie),this.yCellCount=Math.ceil(we/ie);for(var wt=0;wtthis.width||Me<0||we>this.height)return tt?!1:[];var Et=[];if(X<=0&&we<=0&&this.width<=ie&&this.height<=Me){if(tt)return!0;for(var lt=0;lt0:Et}},An.prototype._queryCircle=function(X,we,ie,Me,tt){var wt=X-ie,Et=X+ie,lt=we-ie,gt=we+ie;if(Et<0||wt>this.width||gt<0||lt>this.height)return Me?!1:[];var Pt=[],lr={hitTest:Me,circle:{x:X,y:we,radius:ie},seenUids:{box:{},circle:{}}};return this._forEachCell(wt,lt,Et,gt,this._queryCellCircle,Pt,lr,tt),Me?Pt.length>0:Pt},An.prototype.query=function(X,we,ie,Me,tt){return this._query(X,we,ie,Me,!1,tt)},An.prototype.hitTest=function(X,we,ie,Me,tt){return this._query(X,we,ie,Me,!0,tt)},An.prototype.hitTestCircle=function(X,we,ie,Me){return this._queryCircle(X,we,ie,!0,Me)},An.prototype._queryCell=function(X,we,ie,Me,tt,wt,Et,lt){var gt=Et.seenUids,Pt=this.boxCells[tt];if(Pt!==null)for(var lr=this.bboxes,nr=0,cr=Pt;nr=lr[pr+0]&&Me>=lr[pr+1]&&(!lt||lt(this.boxKeys[gr]))){if(Et.hitTest)return wt.push(!0),!0;wt.push({key:this.boxKeys[gr],x1:lr[pr],y1:lr[pr+1],x2:lr[pr+2],y2:lr[pr+3]})}}}var Jt=this.circleCells[tt];if(Jt!==null)for(var or=this.circles,ar=0,Yr=Jt;arEt*Et+lt*lt},An.prototype._circleAndRectCollide=function(X,we,ie,Me,tt,wt,Et){var lt=(wt-Me)/2,gt=Math.abs(X-(Me+lt));if(gt>lt+ie)return!1;var Pt=(Et-tt)/2,lr=Math.abs(we-(tt+Pt));if(lr>Pt+ie)return!1;if(gt<=lt||lr<=Pt)return!0;var nr=gt-lt,cr=lr-Pt;return nr*nr+cr*cr<=ie*ie};function Yn(Le,X,we,ie,Me){var tt=t.create();return X?(t.scale(tt,tt,[1/Me,1/Me,1]),we||t.rotateZ(tt,tt,ie.angle)):t.multiply(tt,ie.labelPlaneMatrix,Le),tt}function qi(Le,X,we,ie,Me){if(X){var tt=t.clone(Le);return t.scale(tt,tt,[Me,Me,1]),we||t.rotateZ(tt,tt,-ie.angle),tt}else return ie.glCoordMatrix}function Ga(Le,X){var we=[Le.x,Le.y,0,1];ys(we,we,X);var ie=we[3];return{point:new t.Point(we[0]/ie,we[1]/ie),signedDistanceFromCamera:ie}}function to(Le,X){return .5+.5*(Le/X)}function _o(Le,X){var we=Le[0]/Le[3],ie=Le[1]/Le[3],Me=we>=-X[0]&&we<=X[0]&&ie>=-X[1]&&ie<=X[1];return Me}function Po(Le,X,we,ie,Me,tt,wt,Et){var lt=ie?Le.textSizeData:Le.iconSizeData,gt=t.evaluateSizeForZoom(lt,we.transform.zoom),Pt=[256/we.width*2+1,256/we.height*2+1],lr=ie?Le.text.dynamicLayoutVertexArray:Le.icon.dynamicLayoutVertexArray;lr.clear();for(var nr=Le.lineVertexArray,cr=ie?Le.text.placedSymbolArray:Le.icon.placedSymbolArray,gr=we.transform.width/we.transform.height,pr=!1,Jt=0;Jttt)return{useVertical:!0}}return(Le===t.WritingMode.vertical?X.ywe.x)?{needsFlipping:!0}:null}function Oi(Le,X,we,ie,Me,tt,wt,Et,lt,gt,Pt,lr,nr,cr){var gr=X/24,pr=Le.lineOffsetX*gr,Jt=Le.lineOffsetY*gr,or;if(Le.numGlyphs>1){var ar=Le.glyphStartIndex+Le.numGlyphs,Yr=Le.lineStartIndex,cn=Le.lineStartIndex+Le.lineLength,Sn=Ro(gr,Et,pr,Jt,we,Pt,lr,Le,lt,tt,nr);if(!Sn)return{notEnoughRoom:!0};var Sa=Ga(Sn.first.point,wt).point,fa=Ga(Sn.last.point,wt).point;if(ie&&!we){var la=Xo(Le.writingMode,Sa,fa,cr);if(la)return la}or=[Sn.first];for(var Ea=Le.glyphStartIndex+1;Ea0?ri.point:bs(lr,ka,Ra,1,Me),Ki=Xo(Le.writingMode,Ra,_i,cr);if(Ki)return Ki}var mo=cs(gr*Et.getoffsetX(Le.glyphStartIndex),pr,Jt,we,Pt,lr,Le.segment,Le.lineStartIndex,Le.lineStartIndex+Le.lineLength,lt,tt,nr);if(!mo)return{notEnoughRoom:!0};or=[mo]}for(var Us=0,zs=or;Us0?1:-1,gr=0;ie&&(cr*=-1,gr=Math.PI),cr<0&&(gr+=Math.PI);for(var pr=cr>0?Et+wt:Et+wt+1,Jt=Me,or=Me,ar=0,Yr=0,cn=Math.abs(nr),Sn=[];ar+Yr<=cn;){if(pr+=cr,pr=lt)return null;if(or=Jt,Sn.push(Jt),Jt=lr[pr],Jt===void 0){var Sa=new t.Point(gt.getx(pr),gt.gety(pr)),fa=Ga(Sa,Pt);if(fa.signedDistanceFromCamera>0)Jt=lr[pr]=fa.point;else{var la=pr-cr,Ea=ar===0?tt:new t.Point(gt.getx(la),gt.gety(la));Jt=bs(Ea,Sa,or,cn-ar+1,Pt)}}ar+=Yr,Yr=or.dist(Jt)}var Ra=(cn-ar)/Yr,Ya=Jt.sub(or),ka=Ya.mult(Ra)._add(or);ka._add(Ya._unit()._perp()._mult(we*cr));var ri=gr+Math.atan2(Jt.y-or.y,Jt.x-or.x);return Sn.push(ka),{point:ka,angle:ri,path:Sn}}var fl=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Is(Le,X){for(var we=0;we=1;Bl--)zs.push(mo.path[Bl]);for(var Pl=1;Pl0){for(var Ml=zs[0].clone(),ju=zs[0].clone(),Mh=1;Mh=ri.x&&ju.x<=_i.x&&Ml.y>=ri.y&&ju.y<=_i.y?wc=[zs]:ju.x_i.x||ju.y_i.y?wc=[]:wc=t.clipLine([zs],ri.x,ri.y,_i.x,_i.y)}for(var ud=0,nm=wc;ud=this.screenRightBoundary||Methis.screenBottomBoundary},hl.prototype.isInsideGrid=function(X,we,ie,Me){return ie>=0&&X=0&&we0){var cn;return this.prevPlacement&&this.prevPlacement.variableOffsets[nr.crossTileID]&&this.prevPlacement.placements[nr.crossTileID]&&this.prevPlacement.placements[nr.crossTileID].text&&(cn=this.prevPlacement.variableOffsets[nr.crossTileID].anchor),this.variableOffsets[nr.crossTileID]={textOffset:Jt,width:ie,height:Me,anchor:X,textBoxScale:tt,prevAnchor:cn},this.markUsedJustification(cr,X,nr,gr),cr.allowVerticalPlacement&&(this.markUsedOrientation(cr,gr,nr),this.placedOrientations[nr.crossTileID]=gr),{shift:or,placedGlyphBoxes:ar}}},Ws.prototype.placeLayerBucketPart=function(X,we,ie){var Me=this,tt=X.parameters,wt=tt.bucket,Et=tt.layout,lt=tt.posMatrix,gt=tt.textLabelPlaneMatrix,Pt=tt.labelToScreenMatrix,lr=tt.textPixelRatio,nr=tt.holdingForFade,cr=tt.collisionBoxArray,gr=tt.partiallyEvaluatedTextSize,pr=tt.collisionGroup,Jt=Et.get("text-optional"),or=Et.get("icon-optional"),ar=Et.get("text-allow-overlap"),Yr=Et.get("icon-allow-overlap"),cn=Et.get("text-rotation-alignment")==="map",Sn=Et.get("text-pitch-alignment")==="map",Sa=Et.get("icon-text-fit")!=="none",fa=Et.get("symbol-z-order")==="viewport-y",la=ar&&(Yr||!wt.hasIconData()||or),Ea=Yr&&(ar||!wt.hasTextData()||Jt);!wt.collisionArrays&&cr&&wt.deserializeCollisionBoxes(cr);var Ra=function(mo,Us){if(!we[mo.crossTileID]){if(nr){Me.placements[mo.crossTileID]=new ps(!1,!1,!1);return}var zs=!1,Bl=!1,Pl=!0,$l=null,Ul={box:null,offscreen:null},wc={box:null},Ml=null,ju=null,Mh=null,ud=0,nm=0,am=0;Us.textFeatureIndex?ud=Us.textFeatureIndex:mo.useRuntimeCollisionCircles&&(ud=mo.featureIndex),Us.verticalTextFeatureIndex&&(nm=Us.verticalTextFeatureIndex);var Qp=Us.textBox;if(Qp){var Lm=function(Zf){var Uc=t.WritingMode.horizontal;if(wt.allowVerticalPlacement&&!Zf&&Me.prevPlacement){var rv=Me.prevPlacement.placedOrientations[mo.crossTileID];rv&&(Me.placedOrientations[mo.crossTileID]=rv,Uc=rv,Me.markUsedOrientation(wt,Uc,mo))}return Uc},X0=function(Zf,Uc){if(wt.allowVerticalPlacement&&mo.numVerticalGlyphVertices>0&&Us.verticalTextBox)for(var rv=0,s_=wt.writingModes;rv0&&(mv=mv.filter(function(Zf){return Zf!==tv.anchor}),mv.unshift(tv.anchor))}var im=function(Zf,Uc,rv){for(var s_=Zf.x2-Zf.x1,Dx=Zf.y2-Zf.y1,Jc=mo.textBoxScale,Xw=Sa&&!Yr?Uc:null,Yy={box:[],offscreen:!1},BT=ar?mv.length*2:mv.length,sm=0;sm=mv.length,Yw=Me.attemptAnchorPlacement(Zy,Zf,s_,Dx,Jc,cn,Sn,lr,lt,pr,UT,mo,wt,rv,Xw);if(Yw&&(Yy=Yw.placedGlyphBoxes,Yy&&Yy.box&&Yy.box.length)){zs=!0,$l=Yw.shift;break}}return Yy},Rm=function(){return im(Qp,Us.iconBox,t.WritingMode.horizontal)},om=function(){var Zf=Us.verticalTextBox,Uc=Ul&&Ul.box&&Ul.box.length;return wt.allowVerticalPlacement&&!Uc&&mo.numVerticalGlyphVertices>0&&Zf?im(Zf,Us.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}};X0(Rm,om),Ul&&(zs=Ul.box,Pl=Ul.offscreen);var a_=Lm(Ul&&Ul.box);if(!zs&&Me.prevPlacement){var Y0=Me.prevPlacement.variableOffsets[mo.crossTileID];Y0&&(Me.variableOffsets[mo.crossTileID]=Y0,Me.markUsedJustification(wt,Y0.anchor,mo,a_))}}else{var Jm=function(Zf,Uc){var rv=Me.collisionIndex.placeCollisionBox(Zf,ar,lr,lt,pr.predicate);return rv&&rv.box&&rv.box.length&&(Me.markUsedOrientation(wt,Uc,mo),Me.placedOrientations[mo.crossTileID]=Uc),rv},ev=function(){return Jm(Qp,t.WritingMode.horizontal)},Qm=function(){var Zf=Us.verticalTextBox;return wt.allowVerticalPlacement&&mo.numVerticalGlyphVertices>0&&Zf?Jm(Zf,t.WritingMode.vertical):{box:null,offscreen:null}};X0(ev,Qm),Lm(Ul&&Ul.box&&Ul.box.length)}}if(Ml=Ul,zs=Ml&&Ml.box&&Ml.box.length>0,Pl=Ml&&Ml.offscreen,mo.useRuntimeCollisionCircles){var Fd=wt.text.placedSymbolArray.get(mo.centerJustifiedTextSymbolIndex),Z0=t.evaluateSizeForFeature(wt.textSizeData,gr,Fd),i_=Et.get("text-padding"),wp=mo.collisionCircleDiameter;ju=Me.collisionIndex.placeCollisionCircles(ar,Fd,wt.lineVertexArray,wt.glyphOffsetArray,Z0,lt,gt,Pt,ie,Sn,pr.predicate,wp,i_),zs=ar||ju.circles.length>0&&!ju.collisionDetected,Pl=Pl&&ju.offscreen}if(Us.iconFeatureIndex&&(am=Us.iconFeatureIndex),Us.iconBox){var Hy=function(Zf){var Uc=Sa&&$l?eu(Zf,$l.x,$l.y,cn,Sn,Me.transform.angle):Zf;return Me.collisionIndex.placeCollisionBox(Uc,Yr,lr,lt,pr.predicate)};wc&&wc.box&&wc.box.length&&Us.verticalIconBox?(Mh=Hy(Us.verticalIconBox),Bl=Mh.box.length>0):(Mh=Hy(Us.iconBox),Bl=Mh.box.length>0),Pl=Pl&&Mh.offscreen}var Lx=Jt||mo.numHorizontalGlyphVertices===0&&mo.numVerticalGlyphVertices===0,Rx=or||mo.numIconVertices===0;if(!Lx&&!Rx?Bl=zs=Bl&&zs:Rx?Lx||(Bl=Bl&&zs):zs=Bl&&zs,zs&&Ml&&Ml.box&&(wc&&wc.box&&nm?Me.collisionIndex.insertCollisionBox(Ml.box,Et.get("text-ignore-placement"),wt.bucketInstanceId,nm,pr.ID):Me.collisionIndex.insertCollisionBox(Ml.box,Et.get("text-ignore-placement"),wt.bucketInstanceId,ud,pr.ID)),Bl&&Mh&&Me.collisionIndex.insertCollisionBox(Mh.box,Et.get("icon-ignore-placement"),wt.bucketInstanceId,am,pr.ID),ju&&(zs&&Me.collisionIndex.insertCollisionCircles(ju.circles,Et.get("text-ignore-placement"),wt.bucketInstanceId,ud,pr.ID),ie)){var o_=wt.bucketInstanceId,Wy=Me.collisionCircleArrays[o_];Wy===void 0&&(Wy=Me.collisionCircleArrays[o_]=new Uo);for(var Xy=0;Xy=0;--ka){var ri=Ya[ka];Ra(wt.symbolInstances.get(ri),wt.collisionArrays[ri])}else for(var _i=X.symbolInstanceStart;_i=0&&(wt>=0&&Pt!==wt?X.text.placedSymbolArray.get(Pt).crossTileID=0:X.text.placedSymbolArray.get(Pt).crossTileID=ie.crossTileID)}},Ws.prototype.markUsedOrientation=function(X,we,ie){for(var Me=we===t.WritingMode.horizontal||we===t.WritingMode.horizontalOnly?we:0,tt=we===t.WritingMode.vertical?we:0,wt=[ie.leftJustifiedTextSymbolIndex,ie.centerJustifiedTextSymbolIndex,ie.rightJustifiedTextSymbolIndex],Et=0,lt=wt;Et0||Sn>0,Ra=Yr.numIconVertices>0,Ya=Me.placedOrientations[Yr.crossTileID],ka=Ya===t.WritingMode.vertical,ri=Ya===t.WritingMode.horizontal||Ya===t.WritingMode.horizontalOnly;if(Ea){var _i=Gu(la.text),Ki=ka?Eo:_i;gr(X.text,cn,Ki);var mo=ri?Eo:_i;gr(X.text,Sn,mo);var Us=la.text.isHidden();[Yr.rightJustifiedTextSymbolIndex,Yr.centerJustifiedTextSymbolIndex,Yr.leftJustifiedTextSymbolIndex].forEach(function(am){am>=0&&(X.text.placedSymbolArray.get(am).hidden=Us||ka?1:0)}),Yr.verticalPlacedTextSymbolIndex>=0&&(X.text.placedSymbolArray.get(Yr.verticalPlacedTextSymbolIndex).hidden=Us||ri?1:0);var zs=Me.variableOffsets[Yr.crossTileID];zs&&Me.markUsedJustification(X,zs.anchor,Yr,Ya);var Bl=Me.placedOrientations[Yr.crossTileID];Bl&&(Me.markUsedJustification(X,"left",Yr,Bl),Me.markUsedOrientation(X,Bl,Yr))}if(Ra){var Pl=Gu(la.icon),$l=!(nr&&Yr.verticalPlacedIconSymbolIndex&&ka);if(Yr.placedIconSymbolIndex>=0){var Ul=$l?Pl:Eo;gr(X.icon,Yr.numIconVertices,Ul),X.icon.placedSymbolArray.get(Yr.placedIconSymbolIndex).hidden=la.icon.isHidden()}if(Yr.verticalPlacedIconSymbolIndex>=0){var wc=$l?Eo:Pl;gr(X.icon,Yr.numVerticalIconVertices,wc),X.icon.placedSymbolArray.get(Yr.verticalPlacedIconSymbolIndex).hidden=la.icon.isHidden()}}if(X.hasIconCollisionBoxData()||X.hasTextCollisionBoxData()){var Ml=X.collisionArrays[ar];if(Ml){var ju=new t.Point(0,0);if(Ml.textBox||Ml.verticalTextBox){var Mh=!0;if(gt){var ud=Me.variableOffsets[Sa];ud?(ju=Kl(ud.anchor,ud.width,ud.height,ud.textOffset,ud.textBoxScale),Pt&&ju._rotate(lr?Me.transform.angle:-Me.transform.angle)):Mh=!1}Ml.textBox&&Bi(X.textCollisionBox.collisionVertexArray,la.text.placed,!Mh||ka,ju.x,ju.y),Ml.verticalTextBox&&Bi(X.textCollisionBox.collisionVertexArray,la.text.placed,!Mh||ri,ju.x,ju.y)}var nm=!!(!ri&&Ml.verticalIconBox);Ml.iconBox&&Bi(X.iconCollisionBox.collisionVertexArray,la.icon.placed,nm,nr?ju.x:0,nr?ju.y:0),Ml.verticalIconBox&&Bi(X.iconCollisionBox.collisionVertexArray,la.icon.placed,!nm,nr?ju.x:0,nr?ju.y:0)}}},Jt=0;JtX},Ws.prototype.setStale=function(){this.stale=!0};function Bi(Le,X,we,ie,Me){Le.emplaceBack(X?1:0,we?1:0,ie||0,Me||0),Le.emplaceBack(X?1:0,we?1:0,ie||0,Me||0),Le.emplaceBack(X?1:0,we?1:0,ie||0,Me||0),Le.emplaceBack(X?1:0,we?1:0,ie||0,Me||0)}var Mo=Math.pow(2,25),Jl=Math.pow(2,24),Qs=Math.pow(2,17),as=Math.pow(2,16),tu=Math.pow(2,9),dl=Math.pow(2,8),Rl=Math.pow(2,1);function Gu(Le){if(Le.opacity===0&&!Le.placed)return 0;if(Le.opacity===1&&Le.placed)return 4294967295;var X=Le.placed?1:0,we=Math.floor(Le.opacity*127);return we*Mo+X*Jl+we*Qs+X*as+we*tu+X*dl+we*Rl+X}var Eo=0,Os=function(X){this._sortAcrossTiles=X.layout.get("symbol-z-order")!=="viewport-y"&&X.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Os.prototype.continuePlacement=function(X,we,ie,Me,tt){for(var wt=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var Et=X[this._currentPlacementIndex],lt=we[Et],gt=this.placement.collisionIndex.transform.zoom;if(lt.type==="symbol"&&(!lt.minzoom||lt.minzoom<=gt)&&(!lt.maxzoom||lt.maxzoom>gt)){this._inProgressLayer||(this._inProgressLayer=new Os(lt));var Pt=this._inProgressLayer.continuePlacement(ie[lt.source],this.placement,this._showCollisionBoxes,lt,wt);if(Pt)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ws.prototype.commit=function(X){return this.placement.commit(X),this.placement};var pu=512/t.EXTENT/2,vu=function(X,we,ie){this.tileID=X,this.indexedSymbolInstances={},this.bucketInstanceId=ie;for(var Me=0;MeX.overscaledZ)for(var gt in lt){var Pt=lt[gt];Pt.tileID.isChildOf(X)&&Pt.findMatches(we.symbolInstances,X,wt)}else{var lr=X.scaledTo(Number(Et)),nr=lt[lr.key];nr&&nr.findMatches(we.symbolInstances,X,wt)}}for(var cr=0;cr0)throw new Error("Unimplemented: "+wt.map(function(Et){return Et.command}).join(", ")+".");return tt.forEach(function(Et){Et.command!=="setTransition"&&Me[Et.command].apply(Me,Et.args)}),this.stylesheet=ie,!0},X.prototype.addImage=function(ie,Me){if(this.getImage(ie))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(ie,Me),this._afterImageUpdated(ie)},X.prototype.updateImage=function(ie,Me){this.imageManager.updateImage(ie,Me)},X.prototype.getImage=function(ie){return this.imageManager.getImage(ie)},X.prototype.removeImage=function(ie){if(!this.getImage(ie))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(ie),this._afterImageUpdated(ie)},X.prototype._afterImageUpdated=function(ie){this._availableImages=this.imageManager.listImages(),this._changedImages[ie]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},X.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},X.prototype.addSource=function(ie,Me,tt){var wt=this;if(tt===void 0&&(tt={}),this._checkLoaded(),this.sourceCaches[ie]!==void 0)throw new Error("There is already a source with this ID");if(!Me.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(Me).join(", ")+".");var Et=["vector","raster","geojson","video","image"],lt=Et.indexOf(Me.type)>=0;if(!(lt&&this._validate(t.validateStyle.source,"sources."+ie,Me,null,tt))){this.map&&this.map._collectResourceTiming&&(Me.collectResourceTiming=!0);var gt=this.sourceCaches[ie]=new In(ie,Me,this.dispatcher);gt.style=this,gt.setEventedParent(this,function(){return{isSourceLoaded:wt.loaded(),source:gt.serialize(),sourceId:ie}}),gt.onAdd(this.map),this._changed=!0}},X.prototype.removeSource=function(ie){if(this._checkLoaded(),this.sourceCaches[ie]===void 0)throw new Error("There is no source with this ID");for(var Me in this._layers)if(this._layers[Me].source===ie)return this.fire(new t.ErrorEvent(new Error('Source "'+ie+'" cannot be removed while layer "'+Me+'" is using it.')));var tt=this.sourceCaches[ie];delete this.sourceCaches[ie],delete this._updatedSources[ie],tt.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:ie})),tt.setEventedParent(null),tt.clearTiles(),tt.onRemove&&tt.onRemove(this.map),this._changed=!0},X.prototype.setGeoJSONSourceData=function(ie,Me){this._checkLoaded();var tt=this.sourceCaches[ie].getSource();tt.setData(Me),this._changed=!0},X.prototype.getSource=function(ie){return this.sourceCaches[ie]&&this.sourceCaches[ie].getSource()},X.prototype.addLayer=function(ie,Me,tt){tt===void 0&&(tt={}),this._checkLoaded();var wt=ie.id;if(this.getLayer(wt)){this.fire(new t.ErrorEvent(new Error('Layer with id "'+wt+'" already exists on this map')));return}var Et;if(ie.type==="custom"){if(nl(this,t.validateCustomStyleLayer(ie)))return;Et=t.createStyleLayer(ie)}else{if(typeof ie.source=="object"&&(this.addSource(wt,ie.source),ie=t.clone$1(ie),ie=t.extend(ie,{source:wt})),this._validate(t.validateStyle.layer,"layers."+wt,ie,{arrayIndex:-1},tt))return;Et=t.createStyleLayer(ie),this._validateLayer(Et),Et.setEventedParent(this,{layer:{id:wt}}),this._serializedLayers[Et.id]=Et.serialize()}var lt=Me?this._order.indexOf(Me):this._order.length;if(Me&<===-1){this.fire(new t.ErrorEvent(new Error('Layer with id "'+Me+'" does not exist on this map.')));return}if(this._order.splice(lt,0,wt),this._layerOrderChanged=!0,this._layers[wt]=Et,this._removedLayers[wt]&&Et.source&&Et.type!=="custom"){var gt=this._removedLayers[wt];delete this._removedLayers[wt],gt.type!==Et.type?this._updatedSources[Et.source]="clear":(this._updatedSources[Et.source]="reload",this.sourceCaches[Et.source].pause())}this._updateLayer(Et),Et.onAdd&&Et.onAdd(this.map)},X.prototype.moveLayer=function(ie,Me){this._checkLoaded(),this._changed=!0;var tt=this._layers[ie];if(!tt){this.fire(new t.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be moved.")));return}if(ie!==Me){var wt=this._order.indexOf(ie);this._order.splice(wt,1);var Et=Me?this._order.indexOf(Me):this._order.length;if(Me&&Et===-1){this.fire(new t.ErrorEvent(new Error('Layer with id "'+Me+'" does not exist on this map.')));return}this._order.splice(Et,0,ie),this._layerOrderChanged=!0}},X.prototype.removeLayer=function(ie){this._checkLoaded();var Me=this._layers[ie];if(!Me){this.fire(new t.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be removed.")));return}Me.setEventedParent(null);var tt=this._order.indexOf(ie);this._order.splice(tt,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[ie]=Me,delete this._layers[ie],delete this._serializedLayers[ie],delete this._updatedLayers[ie],delete this._updatedPaintProps[ie],Me.onRemove&&Me.onRemove(this.map)},X.prototype.getLayer=function(ie){return this._layers[ie]},X.prototype.hasLayer=function(ie){return ie in this._layers},X.prototype.setLayerZoomRange=function(ie,Me,tt){this._checkLoaded();var wt=this.getLayer(ie);if(!wt){this.fire(new t.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot have zoom extent.")));return}wt.minzoom===Me&&wt.maxzoom===tt||(Me!=null&&(wt.minzoom=Me),tt!=null&&(wt.maxzoom=tt),this._updateLayer(wt))},X.prototype.setFilter=function(ie,Me,tt){tt===void 0&&(tt={}),this._checkLoaded();var wt=this.getLayer(ie);if(!wt){this.fire(new t.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be filtered.")));return}if(!t.deepEqual(wt.filter,Me)){if(Me==null){wt.filter=void 0,this._updateLayer(wt);return}this._validate(t.validateStyle.filter,"layers."+wt.id+".filter",Me,null,tt)||(wt.filter=t.clone$1(Me),this._updateLayer(wt))}},X.prototype.getFilter=function(ie){return t.clone$1(this.getLayer(ie).filter)},X.prototype.setLayoutProperty=function(ie,Me,tt,wt){wt===void 0&&(wt={}),this._checkLoaded();var Et=this.getLayer(ie);if(!Et){this.fire(new t.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be styled.")));return}t.deepEqual(Et.getLayoutProperty(Me),tt)||(Et.setLayoutProperty(Me,tt,wt),this._updateLayer(Et))},X.prototype.getLayoutProperty=function(ie,Me){var tt=this.getLayer(ie);if(!tt){this.fire(new t.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style.")));return}return tt.getLayoutProperty(Me)},X.prototype.setPaintProperty=function(ie,Me,tt,wt){wt===void 0&&(wt={}),this._checkLoaded();var Et=this.getLayer(ie);if(!Et){this.fire(new t.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be styled.")));return}if(!t.deepEqual(Et.getPaintProperty(Me),tt)){var lt=Et.setPaintProperty(Me,tt,wt);lt&&this._updateLayer(Et),this._changed=!0,this._updatedPaintProps[ie]=!0}},X.prototype.getPaintProperty=function(ie,Me){return this.getLayer(ie).getPaintProperty(Me)},X.prototype.setFeatureState=function(ie,Me){this._checkLoaded();var tt=ie.source,wt=ie.sourceLayer,Et=this.sourceCaches[tt];if(Et===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+tt+"' does not exist in the map's style.")));return}var lt=Et.getSource().type;if(lt==="geojson"&&wt){this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(lt==="vector"&&!wt){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}ie.id===void 0&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),Et.setFeatureState(wt,ie.id,Me)},X.prototype.removeFeatureState=function(ie,Me){this._checkLoaded();var tt=ie.source,wt=this.sourceCaches[tt];if(wt===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+tt+"' does not exist in the map's style.")));return}var Et=wt.getSource().type,lt=Et==="vector"?ie.sourceLayer:void 0;if(Et==="vector"&&!lt){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(Me&&typeof ie.id!="string"&&typeof ie.id!="number"){this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}wt.removeFeatureState(lt,ie.id,Me)},X.prototype.getFeatureState=function(ie){this._checkLoaded();var Me=ie.source,tt=ie.sourceLayer,wt=this.sourceCaches[Me];if(wt===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+Me+"' does not exist in the map's style.")));return}var Et=wt.getSource().type;if(Et==="vector"&&!tt){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return ie.id===void 0&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),wt.getFeatureState(tt,ie.id)},X.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},X.prototype.serialize=function(){return t.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:t.mapObject(this.sourceCaches,function(ie){return ie.serialize()}),layers:this._serializeLayers(this._order)},function(ie){return ie!==void 0})},X.prototype._updateLayer=function(ie){this._updatedLayers[ie.id]=!0,ie.source&&!this._updatedSources[ie.source]&&this.sourceCaches[ie.source].getSource().type!=="raster"&&(this._updatedSources[ie.source]="reload",this.sourceCaches[ie.source].pause()),this._changed=!0},X.prototype._flattenAndSortRenderedFeatures=function(ie){for(var Me=this,tt=function(ri){return Me._layers[ri].type==="fill-extrusion"},wt={},Et=[],lt=this._order.length-1;lt>=0;lt--){var gt=this._order[lt];if(tt(gt)){wt[gt]=lt;for(var Pt=0,lr=ie;Pt=0;ar--){var Yr=this._order[ar];if(tt(Yr))for(var cn=Et.length-1;cn>=0;cn--){var Sn=Et[cn].feature;if(wt[Sn.layer.id] 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;}`,yc=`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; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Jd=`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; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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 +? a_pos +: 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;}`,Ld=`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;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 exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Xh="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;}",mh=`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; +#define PI 3.141592653589793 +void 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,wd="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;}",Td=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,zf=` +#define scale 0.015873016 +attribute 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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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);}`,Rd=`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 vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,nh=` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);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);}`,Gf=`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; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,_c=` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute 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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +float 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;}`,Ch=`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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +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 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Ad=` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute 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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float 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);}`,lu=`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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,id="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;}",_p=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Dd=`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; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 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 ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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));}`,Yh=`#define SDF_PX 8.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Pd=`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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 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 ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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);}`,ff=`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,zd=`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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 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 ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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);}`,Vu=ku(Tf,Rf),hf=ku(_d,ad),gh=ku(ql,cf),bu=ku(xd,Lc),ah=ku(mc,Rc),Vc=ku(Df,xu),df=ku(gc,ul),Ru=ku(ru,rh),Nh=ku(Xc,ph),qf=ku(Lu,yp),yh=ku(al,Np),od=ku(Ol,ns),xp=ku(zh,Pf),Jp=ku(ic,bd),Oh=ku(vh,Wh),sd=ku(yc,Jd),Af=ku(Ld,Xh),ld=ku(mh,wd),Dc=ku(Td,zf),Fh=ku(Rd,nh),Nd=ku(Gf,_c),Bh=ku(Ch,Ad),Au=ku(lu,id),pf=ku(_p,Dd),Nf=ku(Yh,Pd),Sd=ku(ff,zd);function ku(Le,X){var we=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,ie=X.match(/attribute ([\w]+) ([\w]+)/g),Me=Le.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),tt=X.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),wt=tt?tt.concat(Me):Me,Et={};return Le=Le.replace(we,function(lt,gt,Pt,lr,nr){return Et[nr]=!0,gt==="define"?` +#ifndef HAS_UNIFORM_u_`+nr+` +varying `+Pt+" "+lr+" "+nr+`; +#else +uniform `+Pt+" "+lr+" u_"+nr+`; +#endif +`:` +#ifdef HAS_UNIFORM_u_`+nr+` + `+Pt+" "+lr+" "+nr+" = u_"+nr+`; +#endif +`}),X=X.replace(we,function(lt,gt,Pt,lr,nr){var cr=lr==="float"?"vec2":"vec4",gr=nr.match(/color/)?"color":cr;return Et[nr]?gt==="define"?` +#ifndef HAS_UNIFORM_u_`+nr+` +uniform lowp float u_`+nr+`_t; +attribute `+Pt+" "+cr+" a_"+nr+`; +varying `+Pt+" "+lr+" "+nr+`; +#else +uniform `+Pt+" "+lr+" u_"+nr+`; +#endif +`:gr==="vec4"?` +#ifndef HAS_UNIFORM_u_`+nr+` + `+nr+" = a_"+nr+`; +#else + `+Pt+" "+lr+" "+nr+" = u_"+nr+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+nr+` + `+nr+" = unpack_mix_"+gr+"(a_"+nr+", u_"+nr+`_t); +#else + `+Pt+" "+lr+" "+nr+" = u_"+nr+`; +#endif +`:gt==="define"?` +#ifndef HAS_UNIFORM_u_`+nr+` +uniform lowp float u_`+nr+`_t; +attribute `+Pt+" "+cr+" a_"+nr+`; +#else +uniform `+Pt+" "+lr+" u_"+nr+`; +#endif +`:gr==="vec4"?` +#ifndef HAS_UNIFORM_u_`+nr+` + `+Pt+" "+lr+" "+nr+" = a_"+nr+`; +#else + `+Pt+" "+lr+" "+nr+" = u_"+nr+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+nr+` + `+Pt+" "+lr+" "+nr+" = unpack_mix_"+gr+"(a_"+nr+", u_"+nr+`_t); +#else + `+Pt+" "+lr+" "+nr+" = u_"+nr+`; +#endif +`}),{fragmentSource:Le,vertexSource:X,staticAttributes:ie,staticUniforms:wt}}var Zh=Object.freeze({__proto__:null,prelude:Vu,background:hf,backgroundPattern:gh,circle:bu,clippingMask:ah,heatmap:Vc,heatmapTexture:df,collisionBox:Ru,collisionCircle:Nh,debug:qf,fill:yh,fillOutline:od,fillOutlinePattern:xp,fillPattern:Jp,fillExtrusion:Oh,fillExtrusionPattern:sd,hillshadePrepare:Af,hillshade:ld,line:Dc,lineGradient:Fh,linePattern:Nd,lineSDF:Bh,raster:Au,symbolIcon:pf,symbolSDF:Nf,symbolTextAndIcon:Sd}),_h=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};_h.prototype.bind=function(X,we,ie,Me,tt,wt,Et,lt){this.context=X;for(var gt=this.boundPaintVertexBuffers.length!==Me.length,Pt=0;!gt&&Pt>16,Et>>16],u_pixel_coord_lower:[wt&65535,Et&65535]}}function Jh(Le,X,we,ie){var Me=we.imageManager.getPattern(Le.from.toString()),tt=we.imageManager.getPattern(Le.to.toString()),wt=we.imageManager.getPixelSize(),Et=wt.width,lt=wt.height,gt=Math.pow(2,ie.tileID.overscaledZ),Pt=ie.tileSize*Math.pow(2,we.transform.tileZoom)/gt,lr=Pt*(ie.tileID.canonical.x+ie.tileID.wrap*gt),nr=Pt*ie.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Me.tl,u_pattern_br_a:Me.br,u_pattern_tl_b:tt.tl,u_pattern_br_b:tt.br,u_texsize:[Et,lt],u_mix:X.t,u_pattern_size_a:Me.displaySize,u_pattern_size_b:tt.displaySize,u_scale_a:X.fromScale,u_scale_b:X.toScale,u_tile_units_to_pixels:1/ll(ie,1,we.transform.tileZoom),u_pixel_coord_upper:[lr>>16,nr>>16],u_pixel_coord_lower:[lr&65535,nr&65535]}}var bp=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_lightpos:new t.Uniform3f(Le,X.u_lightpos),u_lightintensity:new t.Uniform1f(Le,X.u_lightintensity),u_lightcolor:new t.Uniform3f(Le,X.u_lightcolor),u_vertical_gradient:new t.Uniform1f(Le,X.u_vertical_gradient),u_opacity:new t.Uniform1f(Le,X.u_opacity)}},Oc=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_lightpos:new t.Uniform3f(Le,X.u_lightpos),u_lightintensity:new t.Uniform1f(Le,X.u_lightintensity),u_lightcolor:new t.Uniform3f(Le,X.u_lightcolor),u_vertical_gradient:new t.Uniform1f(Le,X.u_vertical_gradient),u_height_factor:new t.Uniform1f(Le,X.u_height_factor),u_image:new t.Uniform1i(Le,X.u_image),u_texsize:new t.Uniform2f(Le,X.u_texsize),u_pixel_coord_upper:new t.Uniform2f(Le,X.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(Le,X.u_pixel_coord_lower),u_scale:new t.Uniform3f(Le,X.u_scale),u_fade:new t.Uniform1f(Le,X.u_fade),u_opacity:new t.Uniform1f(Le,X.u_opacity)}},Od=function(Le,X,we,ie){var Me=X.style.light,tt=Me.properties.get("position"),wt=[tt.x,tt.y,tt.z],Et=t.create$1();Me.properties.get("anchor")==="viewport"&&t.fromRotation(Et,-X.transform.angle),t.transformMat3(wt,wt,Et);var lt=Me.properties.get("color");return{u_matrix:Le,u_lightpos:wt,u_lightintensity:Me.properties.get("intensity"),u_lightcolor:[lt.r,lt.g,lt.b],u_vertical_gradient:+we,u_opacity:ie}},Ef=function(Le,X,we,ie,Me,tt,wt){return t.extend(Od(Le,X,we,ie),Hf(tt,X,wt),{u_height_factor:-Math.pow(2,Me.overscaledZ)/wt.tileSize/8})},ih=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix)}},Wf=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_image:new t.Uniform1i(Le,X.u_image),u_texsize:new t.Uniform2f(Le,X.u_texsize),u_pixel_coord_upper:new t.Uniform2f(Le,X.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(Le,X.u_pixel_coord_lower),u_scale:new t.Uniform3f(Le,X.u_scale),u_fade:new t.Uniform1f(Le,X.u_fade)}},qu=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_world:new t.Uniform2f(Le,X.u_world)}},Yc=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_world:new t.Uniform2f(Le,X.u_world),u_image:new t.Uniform1i(Le,X.u_image),u_texsize:new t.Uniform2f(Le,X.u_texsize),u_pixel_coord_upper:new t.Uniform2f(Le,X.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(Le,X.u_pixel_coord_lower),u_scale:new t.Uniform3f(Le,X.u_scale),u_fade:new t.Uniform1f(Le,X.u_fade)}},Nu=function(Le){return{u_matrix:Le}},xh=function(Le,X,we,ie){return t.extend(Nu(Le),Hf(we,X,ie))},Xf=function(Le,X){return{u_matrix:Le,u_world:X}},Ed=function(Le,X,we,ie,Me){return t.extend(xh(Le,X,we,ie),{u_world:Me})},wr=function(Le,X){return{u_camera_to_center_distance:new t.Uniform1f(Le,X.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(Le,X.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(Le,X.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(Le,X.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(Le,X.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(Le,X.u_matrix)}},qr=function(Le,X,we,ie){var Me=Le.transform,tt,wt;if(ie.paint.get("circle-pitch-alignment")==="map"){var Et=ll(we,1,Me.zoom);tt=!0,wt=[Et,Et]}else tt=!1,wt=Me.pixelsToGLUnits;return{u_camera_to_center_distance:Me.cameraToCenterDistance,u_scale_with_map:+(ie.paint.get("circle-pitch-scale")==="map"),u_matrix:Le.translatePosMatrix(X.posMatrix,we,ie.paint.get("circle-translate"),ie.paint.get("circle-translate-anchor")),u_pitch_with_map:+tt,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:wt}},kn=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_camera_to_center_distance:new t.Uniform1f(Le,X.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(Le,X.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(Le,X.u_extrude_scale),u_overscale_factor:new t.Uniform1f(Le,X.u_overscale_factor)}},_n=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_inv_matrix:new t.UniformMatrix4f(Le,X.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(Le,X.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(Le,X.u_viewport_size)}},Qn=function(Le,X,we){var ie=ll(we,1,X.zoom),Me=Math.pow(2,X.zoom-we.tileID.overscaledZ),tt=we.tileID.overscaleFactor();return{u_matrix:Le,u_camera_to_center_distance:X.cameraToCenterDistance,u_pixels_to_tile_units:ie,u_extrude_scale:[X.pixelsToGLUnits[0]/(ie*Me),X.pixelsToGLUnits[1]/(ie*Me)],u_overscale_factor:tt}},$a=function(Le,X,we){return{u_matrix:Le,u_inv_matrix:X,u_camera_to_center_distance:we.cameraToCenterDistance,u_viewport_size:[we.width,we.height]}},Fa=function(Le,X){return{u_color:new t.UniformColor(Le,X.u_color),u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_overlay:new t.Uniform1i(Le,X.u_overlay),u_overlay_scale:new t.Uniform1f(Le,X.u_overlay_scale)}},Ai=function(Le,X,we){return we===void 0&&(we=1),{u_matrix:Le,u_color:X,u_overlay:0,u_overlay_scale:we}},Ni=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix)}},ho=function(Le){return{u_matrix:Le}},fi=function(Le,X){return{u_extrude_scale:new t.Uniform1f(Le,X.u_extrude_scale),u_intensity:new t.Uniform1f(Le,X.u_intensity),u_matrix:new t.UniformMatrix4f(Le,X.u_matrix)}},Yi=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_world:new t.Uniform2f(Le,X.u_world),u_image:new t.Uniform1i(Le,X.u_image),u_color_ramp:new t.Uniform1i(Le,X.u_color_ramp),u_opacity:new t.Uniform1f(Le,X.u_opacity)}},bi=function(Le,X,we,ie){return{u_matrix:Le,u_extrude_scale:ll(X,1,we),u_intensity:ie}},ii=function(Le,X,we,ie){var Me=t.create();t.ortho(Me,0,Le.width,Le.height,0,0,1);var tt=Le.context.gl;return{u_matrix:Me,u_world:[tt.drawingBufferWidth,tt.drawingBufferHeight],u_image:we,u_color_ramp:ie,u_opacity:X.paint.get("heatmap-opacity")}},bo=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_image:new t.Uniform1i(Le,X.u_image),u_latrange:new t.Uniform2f(Le,X.u_latrange),u_light:new t.Uniform2f(Le,X.u_light),u_shadow:new t.UniformColor(Le,X.u_shadow),u_highlight:new t.UniformColor(Le,X.u_highlight),u_accent:new t.UniformColor(Le,X.u_accent)}},os=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_image:new t.Uniform1i(Le,X.u_image),u_dimension:new t.Uniform2f(Le,X.u_dimension),u_zoom:new t.Uniform1f(Le,X.u_zoom),u_unpack:new t.Uniform4f(Le,X.u_unpack)}},rs=function(Le,X,we){var ie=we.paint.get("hillshade-shadow-color"),Me=we.paint.get("hillshade-highlight-color"),tt=we.paint.get("hillshade-accent-color"),wt=we.paint.get("hillshade-illumination-direction")*(Math.PI/180);we.paint.get("hillshade-illumination-anchor")==="viewport"&&(wt-=Le.transform.angle);var Et=!Le.options.moving;return{u_matrix:Le.transform.calculatePosMatrix(X.tileID.toUnwrapped(),Et),u_image:0,u_latrange:ls(Le,X.tileID),u_light:[we.paint.get("hillshade-exaggeration"),wt],u_shadow:ie,u_highlight:Me,u_accent:tt}},fs=function(Le,X){var we=X.stride,ie=t.create();return t.ortho(ie,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(ie,ie,[0,-t.EXTENT,0]),{u_matrix:ie,u_image:1,u_dimension:[we,we],u_zoom:Le.overscaledZ,u_unpack:X.getUnpackVector()}};function ls(Le,X){var we=Math.pow(2,X.canonical.z),ie=X.canonical.y;return[new t.MercatorCoordinate(0,ie/we).toLngLat().lat,new t.MercatorCoordinate(0,(ie+1)/we).toLngLat().lat]}var To=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_ratio:new t.Uniform1f(Le,X.u_ratio),u_device_pixel_ratio:new t.Uniform1f(Le,X.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(Le,X.u_units_to_pixels)}},ro=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_ratio:new t.Uniform1f(Le,X.u_ratio),u_device_pixel_ratio:new t.Uniform1f(Le,X.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(Le,X.u_units_to_pixels),u_image:new t.Uniform1i(Le,X.u_image),u_image_height:new t.Uniform1f(Le,X.u_image_height)}},Ts=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_texsize:new t.Uniform2f(Le,X.u_texsize),u_ratio:new t.Uniform1f(Le,X.u_ratio),u_device_pixel_ratio:new t.Uniform1f(Le,X.u_device_pixel_ratio),u_image:new t.Uniform1i(Le,X.u_image),u_units_to_pixels:new t.Uniform2f(Le,X.u_units_to_pixels),u_scale:new t.Uniform3f(Le,X.u_scale),u_fade:new t.Uniform1f(Le,X.u_fade)}},il=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_ratio:new t.Uniform1f(Le,X.u_ratio),u_device_pixel_ratio:new t.Uniform1f(Le,X.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(Le,X.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(Le,X.u_patternscale_a),u_patternscale_b:new t.Uniform2f(Le,X.u_patternscale_b),u_sdfgamma:new t.Uniform1f(Le,X.u_sdfgamma),u_image:new t.Uniform1i(Le,X.u_image),u_tex_y_a:new t.Uniform1f(Le,X.u_tex_y_a),u_tex_y_b:new t.Uniform1f(Le,X.u_tex_y_b),u_mix:new t.Uniform1f(Le,X.u_mix)}},Hl=function(Le,X,we){var ie=Le.transform;return{u_matrix:Zu(Le,X,we),u_ratio:1/ll(X,1,ie.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/ie.pixelsToGLUnits[0],1/ie.pixelsToGLUnits[1]]}},mu=function(Le,X,we,ie){return t.extend(Hl(Le,X,we),{u_image:0,u_image_height:ie})},Xl=function(Le,X,we,ie){var Me=Le.transform,tt=wl(X,Me);return{u_matrix:Zu(Le,X,we),u_texsize:X.imageAtlasTexture.size,u_ratio:1/ll(X,1,Me.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[tt,ie.fromScale,ie.toScale],u_fade:ie.t,u_units_to_pixels:[1/Me.pixelsToGLUnits[0],1/Me.pixelsToGLUnits[1]]}},gu=function(Le,X,we,ie,Me){var tt=Le.transform,wt=Le.lineAtlas,Et=wl(X,tt),lt=we.layout.get("line-cap")==="round",gt=wt.getDash(ie.from,lt),Pt=wt.getDash(ie.to,lt),lr=gt.width*Me.fromScale,nr=Pt.width*Me.toScale;return t.extend(Hl(Le,X,we),{u_patternscale_a:[Et/lr,-gt.height/2],u_patternscale_b:[Et/nr,-Pt.height/2],u_sdfgamma:wt.width/(Math.min(lr,nr)*256*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:gt.y,u_tex_y_b:Pt.y,u_mix:Me.t})};function wl(Le,X){return 1/ll(Le,1,X.tileZoom)}function Zu(Le,X,we){return Le.translatePosMatrix(X.tileID.posMatrix,X,we.paint.get("line-translate"),we.paint.get("line-translate-anchor"))}var Hu=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_tl_parent:new t.Uniform2f(Le,X.u_tl_parent),u_scale_parent:new t.Uniform1f(Le,X.u_scale_parent),u_buffer_scale:new t.Uniform1f(Le,X.u_buffer_scale),u_fade_t:new t.Uniform1f(Le,X.u_fade_t),u_opacity:new t.Uniform1f(Le,X.u_opacity),u_image0:new t.Uniform1i(Le,X.u_image0),u_image1:new t.Uniform1i(Le,X.u_image1),u_brightness_low:new t.Uniform1f(Le,X.u_brightness_low),u_brightness_high:new t.Uniform1f(Le,X.u_brightness_high),u_saturation_factor:new t.Uniform1f(Le,X.u_saturation_factor),u_contrast_factor:new t.Uniform1f(Le,X.u_contrast_factor),u_spin_weights:new t.Uniform3f(Le,X.u_spin_weights)}},fu=function(Le,X,we,ie,Me){return{u_matrix:Le,u_tl_parent:X,u_scale_parent:we,u_buffer_scale:1,u_fade_t:ie.mix,u_opacity:ie.opacity*Me.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Me.paint.get("raster-brightness-min"),u_brightness_high:Me.paint.get("raster-brightness-max"),u_saturation_factor:nu(Me.paint.get("raster-saturation")),u_contrast_factor:Fs(Me.paint.get("raster-contrast")),u_spin_weights:Vo(Me.paint.get("raster-hue-rotate"))}};function Vo(Le){Le*=Math.PI/180;var X=Math.sin(Le),we=Math.cos(Le);return[(2*we+1)/3,(-Math.sqrt(3)*X-we+1)/3,(Math.sqrt(3)*X-we+1)/3]}function Fs(Le){return Le>0?1/(1-Le):1+Le}function nu(Le){return Le>0?1-1/(1.001-Le):-Le}var Fl=function(Le,X){return{u_is_size_zoom_constant:new t.Uniform1i(Le,X.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(Le,X.u_is_size_feature_constant),u_size_t:new t.Uniform1f(Le,X.u_size_t),u_size:new t.Uniform1f(Le,X.u_size),u_camera_to_center_distance:new t.Uniform1f(Le,X.u_camera_to_center_distance),u_pitch:new t.Uniform1f(Le,X.u_pitch),u_rotate_symbol:new t.Uniform1i(Le,X.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(Le,X.u_aspect_ratio),u_fade_change:new t.Uniform1f(Le,X.u_fade_change),u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(Le,X.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(Le,X.u_coord_matrix),u_is_text:new t.Uniform1i(Le,X.u_is_text),u_pitch_with_map:new t.Uniform1i(Le,X.u_pitch_with_map),u_texsize:new t.Uniform2f(Le,X.u_texsize),u_texture:new t.Uniform1i(Le,X.u_texture)}},jc=function(Le,X){return{u_is_size_zoom_constant:new t.Uniform1i(Le,X.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(Le,X.u_is_size_feature_constant),u_size_t:new t.Uniform1f(Le,X.u_size_t),u_size:new t.Uniform1f(Le,X.u_size),u_camera_to_center_distance:new t.Uniform1f(Le,X.u_camera_to_center_distance),u_pitch:new t.Uniform1f(Le,X.u_pitch),u_rotate_symbol:new t.Uniform1i(Le,X.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(Le,X.u_aspect_ratio),u_fade_change:new t.Uniform1f(Le,X.u_fade_change),u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(Le,X.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(Le,X.u_coord_matrix),u_is_text:new t.Uniform1i(Le,X.u_is_text),u_pitch_with_map:new t.Uniform1i(Le,X.u_pitch_with_map),u_texsize:new t.Uniform2f(Le,X.u_texsize),u_texture:new t.Uniform1i(Le,X.u_texture),u_gamma_scale:new t.Uniform1f(Le,X.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(Le,X.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(Le,X.u_is_halo)}},Gc=function(Le,X){return{u_is_size_zoom_constant:new t.Uniform1i(Le,X.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(Le,X.u_is_size_feature_constant),u_size_t:new t.Uniform1f(Le,X.u_size_t),u_size:new t.Uniform1f(Le,X.u_size),u_camera_to_center_distance:new t.Uniform1f(Le,X.u_camera_to_center_distance),u_pitch:new t.Uniform1f(Le,X.u_pitch),u_rotate_symbol:new t.Uniform1i(Le,X.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(Le,X.u_aspect_ratio),u_fade_change:new t.Uniform1f(Le,X.u_fade_change),u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(Le,X.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(Le,X.u_coord_matrix),u_is_text:new t.Uniform1i(Le,X.u_is_text),u_pitch_with_map:new t.Uniform1i(Le,X.u_pitch_with_map),u_texsize:new t.Uniform2f(Le,X.u_texsize),u_texsize_icon:new t.Uniform2f(Le,X.u_texsize_icon),u_texture:new t.Uniform1i(Le,X.u_texture),u_texture_icon:new t.Uniform1i(Le,X.u_texture_icon),u_gamma_scale:new t.Uniform1f(Le,X.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(Le,X.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(Le,X.u_is_halo)}},Zc=function(Le,X,we,ie,Me,tt,wt,Et,lt,gt){var Pt=Me.transform;return{u_is_size_zoom_constant:+(Le==="constant"||Le==="source"),u_is_size_feature_constant:+(Le==="constant"||Le==="camera"),u_size_t:X?X.uSizeT:0,u_size:X?X.uSize:0,u_camera_to_center_distance:Pt.cameraToCenterDistance,u_pitch:Pt.pitch/360*2*Math.PI,u_rotate_symbol:+we,u_aspect_ratio:Pt.width/Pt.height,u_fade_change:Me.options.fadeDuration?Me.symbolFadeChange:1,u_matrix:tt,u_label_plane_matrix:wt,u_coord_matrix:Et,u_is_text:+lt,u_pitch_with_map:+ie,u_texsize:gt,u_texture:0}},kh=function(Le,X,we,ie,Me,tt,wt,Et,lt,gt,Pt){var lr=Me.transform;return t.extend(Zc(Le,X,we,ie,Me,tt,wt,Et,lt,gt),{u_gamma_scale:ie?Math.cos(lr._pitch)*lr.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:1})},qc=function(Le,X,we,ie,Me,tt,wt,Et,lt,gt){return t.extend(kh(Le,X,we,ie,Me,tt,wt,Et,!0,lt),{u_texsize_icon:gt,u_texture_icon:1})},oh=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_opacity:new t.Uniform1f(Le,X.u_opacity),u_color:new t.UniformColor(Le,X.u_color)}},Ku=function(Le,X){return{u_matrix:new t.UniformMatrix4f(Le,X.u_matrix),u_opacity:new t.Uniform1f(Le,X.u_opacity),u_image:new t.Uniform1i(Le,X.u_image),u_pattern_tl_a:new t.Uniform2f(Le,X.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(Le,X.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(Le,X.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(Le,X.u_pattern_br_b),u_texsize:new t.Uniform2f(Le,X.u_texsize),u_mix:new t.Uniform1f(Le,X.u_mix),u_pattern_size_a:new t.Uniform2f(Le,X.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(Le,X.u_pattern_size_b),u_scale_a:new t.Uniform1f(Le,X.u_scale_a),u_scale_b:new t.Uniform1f(Le,X.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(Le,X.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(Le,X.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(Le,X.u_tile_units_to_pixels)}},sh=function(Le,X,we){return{u_matrix:Le,u_opacity:X,u_color:we}},hs=function(Le,X,we,ie,Me,tt){return t.extend(Jh(ie,tt,we,Me),{u_matrix:Le,u_opacity:X})},Ss={fillExtrusion:bp,fillExtrusionPattern:Oc,fill:ih,fillPattern:Wf,fillOutline:qu,fillOutlinePattern:Yc,circle:wr,collisionBox:kn,collisionCircle:_n,debug:Fa,clippingMask:Ni,heatmap:fi,heatmapTexture:Yi,hillshade:bo,hillshadePrepare:os,line:To,lineGradient:ro,linePattern:Ts,lineSDF:il,raster:Hu,symbolIcon:Fl,symbolSDF:jc,symbolTextAndIcon:Gc,background:oh,backgroundPattern:Ku},lh;function Cf(Le,X,we,ie,Me,tt,wt){for(var Et=Le.context,lt=Et.gl,gt=Le.useProgram("collisionBox"),Pt=[],lr=0,nr=0,cr=0;cr0){var cn=t.create(),Sn=or;t.mul(cn,Jt.placementInvProjMatrix,Le.transform.glCoordMatrix),t.mul(cn,cn,Jt.placementViewportMatrix),Pt.push({circleArray:Yr,circleOffset:nr,transform:Sn,invTransform:cn}),lr+=Yr.length/4,nr=lr}ar&>.draw(Et,lt.LINES,oa.disabled,ra.disabled,Le.colorModeForRenderPass(),an.disabled,Qn(or,Le.transform,pr),we.id,ar.layoutVertexBuffer,ar.indexBuffer,ar.segments,null,Le.transform.zoom,null,null,ar.collisionVertexBuffer)}}if(!(!wt||!Pt.length)){var Sa=Le.useProgram("collisionCircle"),fa=new t.StructArrayLayout2f1f2i16;fa.resize(lr*4),fa._trim();for(var la=0,Ea=0,Ra=Pt;Ea=0&&(gr[Jt.associatedIconIndex]={shiftedAnchor:ri,angle:_i})}}if(Pt){cr.clear();for(var mo=Le.icon.placedSymbolArray,Us=0;Us0){var wt=t.browser.now(),Et=(wt-Le.timeAdded)/tt,lt=X?(wt-X.timeAdded)/tt:-1,gt=we.getSource(),Pt=Me.coveringZoomLevel({tileSize:gt.tileSize,roundZoom:gt.roundZoom}),lr=!X||Math.abs(X.tileID.overscaledZ-Pt)>Math.abs(Le.tileID.overscaledZ-Pt),nr=lr&&Le.refreshedUponExpiration?1:t.clamp(lr?Et:1-lt,0,1);return Le.refreshedUponExpiration&&Et>=1&&(Le.refreshedUponExpiration=!1),X?{opacity:1,mix:1-nr}:{opacity:nr,mix:0}}else return{opacity:1,mix:0}}function jr(Le,X,we){var ie=we.paint.get("background-color"),Me=we.paint.get("background-opacity");if(Me!==0){var tt=Le.context,wt=tt.gl,Et=Le.transform,lt=Et.tileSize,gt=we.paint.get("background-pattern");if(!Le.isPatternMissing(gt)){var Pt=!gt&&ie.a===1&&Me===1&&Le.opaquePassEnabledForLayer()?"opaque":"translucent";if(Le.renderPass===Pt){var lr=ra.disabled,nr=Le.depthModeForSublayer(0,Pt==="opaque"?oa.ReadWrite:oa.ReadOnly),cr=Le.colorModeForRenderPass(),gr=Le.useProgram(gt?"backgroundPattern":"background"),pr=Et.coveringTiles({tileSize:lt});gt&&(tt.activeTexture.set(wt.TEXTURE0),Le.imageManager.bind(Le.context));for(var Jt=we.getCrossfadeParameters(),or=0,ar=pr;or "+we.overscaledZ);var or=Jt+" "+cr+"kb";vs(Le,or),wt.draw(ie,Me.TRIANGLES,Et,lt,rr.alphaBlended,an.disabled,Ai(tt,t.Color.transparent,pr),Pt,Le.debugBuffer,Le.quadTriangleIndexBuffer,Le.debugSegments)}function vs(Le,X){Le.initDebugOverlayCanvas();var we=Le.debugOverlayCanvas,ie=Le.context.gl,Me=Le.debugOverlayCanvas.getContext("2d");Me.clearRect(0,0,we.width,we.height),Me.shadowColor="white",Me.shadowBlur=2,Me.lineWidth=1.5,Me.strokeStyle="white",Me.textBaseline="top",Me.font="bold 36px Open Sans, sans-serif",Me.fillText(X,5,5),Me.strokeText(X,5,5),Le.debugOverlayTexture.update(we),Le.debugOverlayTexture.bind(ie.LINEAR,ie.CLAMP_TO_EDGE)}function ml(Le,X,we){var ie=Le.context,Me=we.implementation;if(Le.renderPass==="offscreen"){var tt=Me.prerender;tt&&(Le.setCustomLayerDefaults(),ie.setColorMode(Le.colorModeForRenderPass()),tt.call(Me,ie.gl,Le.transform.customLayerMatrix()),ie.setDirty(),Le.setBaseState())}else if(Le.renderPass==="translucent"){Le.setCustomLayerDefaults(),ie.setColorMode(Le.colorModeForRenderPass()),ie.setStencilMode(ra.disabled);var wt=Me.renderingMode==="3d"?new oa(Le.context.gl.LEQUAL,oa.ReadWrite,Le.depthRangeFor3D):Le.depthModeForSublayer(0,oa.ReadOnly);ie.setDepthMode(wt),Me.render(ie.gl,Le.transform.customLayerMatrix()),ie.setDirty(),Le.setBaseState(),ie.bindFramebuffer.set(null)}}var yl={symbol:N,circle:ir,heatmap:Tr,line:Dn,fill:ot,"fill-extrusion":St,hillshade:Yt,raster:Mr,background:jr,debug:qo,custom:ml},Xs=function(X,we){this.context=new bn(X),this.transform=we,this._tileTextures={},this.setup(),this.numSublayers=In.maxUnderzooming+In.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new zu,this.gpuTimers={}};Xs.prototype.resize=function(X,we){if(this.width=X*t.browser.devicePixelRatio,this.height=we*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var ie=0,Me=this.style._order;ie256&&this.clearStencil(),ie.setColorMode(rr.disabled),ie.setDepthMode(oa.disabled);var tt=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var wt=0,Et=we;wt256&&this.clearStencil();var X=this.nextStencilID++,we=this.context.gl;return new ra({func:we.NOTEQUAL,mask:255},X,255,we.KEEP,we.KEEP,we.REPLACE)},Xs.prototype.stencilModeForClipping=function(X){var we=this.context.gl;return new ra({func:we.EQUAL,mask:255},this._tileClippingMaskIDs[X.key],0,we.KEEP,we.KEEP,we.REPLACE)},Xs.prototype.stencilConfigForOverlap=function(X){var we,ie=this.context.gl,Me=X.sort(function(gt,Pt){return Pt.overscaledZ-gt.overscaledZ}),tt=Me[Me.length-1].overscaledZ,wt=Me[0].overscaledZ-tt+1;if(wt>1){this.currentStencilSource=void 0,this.nextStencilID+wt>256&&this.clearStencil();for(var Et={},lt=0;lt=0;this.currentLayer--){var cn=this.style._layers[Me[this.currentLayer]],Sn=tt[cn.source],Sa=lt[cn.source];this._renderTileClippingMasks(cn,Sa),this.renderLayer(this,Sn,cn,Sa)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?we.pop():null},Xs.prototype.isPatternMissing=function(X){if(!X)return!1;if(!X.from||!X.to)return!0;var we=this.imageManager.getPattern(X.from.toString()),ie=this.imageManager.getPattern(X.to.toString());return!we||!ie},Xs.prototype.useProgram=function(X,we){this.cache=this.cache||{};var ie=""+X+(we?we.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[ie]||(this.cache[ie]=new Kh(this.context,X,Zh[X],we,Ss[X],this._showOverdrawInspector)),this.cache[ie]},Xs.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()},Xs.prototype.setBaseState=function(){var X=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(X.FUNC_ADD)},Xs.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var X=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,X.RGBA)}},Xs.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Sl=function(X,we){this.points=X,this.planes=we};Sl.fromInvProjectionMatrix=function(X,we,ie){var Me=[[-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]],tt=Math.pow(2,ie),wt=Me.map(function(gt){return t.transformMat4([],gt,X)}).map(function(gt){return t.scale$1([],gt,1/gt[3]/we*tt)}),Et=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],lt=Et.map(function(gt){var Pt=t.sub([],wt[gt[0]],wt[gt[1]]),lr=t.sub([],wt[gt[2]],wt[gt[1]]),nr=t.normalize([],t.cross([],Pt,lr)),cr=-t.dot(nr,wt[gt[1]]);return nr.concat(cr)});return new Sl(wt,lt)};var Ou=function(X,we){this.min=X,this.max=we,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Ou.prototype.quadrant=function(X){for(var we=[X%2===0,X<2],ie=t.clone$2(this.min),Me=t.clone$2(this.max),tt=0;tt=0;if(wt===0)return 0;wt!==we.length&&(ie=!1)}if(ie)return 2;for(var lt=0;lt<3;lt++){for(var gt=Number.MAX_VALUE,Pt=-Number.MAX_VALUE,lr=0;lrthis.max[lt]-this.min[lt])return 0}return 1};var Su=function(X,we,ie,Me){if(X===void 0&&(X=0),we===void 0&&(we=0),ie===void 0&&(ie=0),Me===void 0&&(Me=0),isNaN(X)||X<0||isNaN(we)||we<0||isNaN(ie)||ie<0||isNaN(Me)||Me<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=X,this.bottom=we,this.left=ie,this.right=Me};Su.prototype.interpolate=function(X,we,ie){return we.top!=null&&X.top!=null&&(this.top=t.number(X.top,we.top,ie)),we.bottom!=null&&X.bottom!=null&&(this.bottom=t.number(X.bottom,we.bottom,ie)),we.left!=null&&X.left!=null&&(this.left=t.number(X.left,we.left,ie)),we.right!=null&&X.right!=null&&(this.right=t.number(X.right,we.right,ie)),this},Su.prototype.getCenter=function(X,we){var ie=t.clamp((this.left+X-this.right)/2,0,X),Me=t.clamp((this.top+we-this.bottom)/2,0,we);return new t.Point(ie,Me)},Su.prototype.equals=function(X){return this.top===X.top&&this.bottom===X.bottom&&this.left===X.left&&this.right===X.right},Su.prototype.clone=function(){return new Su(this.top,this.bottom,this.left,this.right)},Su.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Ys=function(X,we,ie,Me,tt){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=tt===void 0?!0:tt,this._minZoom=X||0,this._maxZoom=we||22,this._minPitch=ie??0,this._maxPitch=Me??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Su,this._posMatrixCache={},this._alignedPosMatrixCache={}},Zs={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}};Ys.prototype.clone=function(){var X=new Ys(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return X.tileSize=this.tileSize,X.latRange=this.latRange,X.width=this.width,X.height=this.height,X._center=this._center,X.zoom=this.zoom,X.angle=this.angle,X._fov=this._fov,X._pitch=this._pitch,X._unmodified=this._unmodified,X._edgeInsets=this._edgeInsets.clone(),X._calcMatrices(),X},Zs.minZoom.get=function(){return this._minZoom},Zs.minZoom.set=function(Le){this._minZoom!==Le&&(this._minZoom=Le,this.zoom=Math.max(this.zoom,Le))},Zs.maxZoom.get=function(){return this._maxZoom},Zs.maxZoom.set=function(Le){this._maxZoom!==Le&&(this._maxZoom=Le,this.zoom=Math.min(this.zoom,Le))},Zs.minPitch.get=function(){return this._minPitch},Zs.minPitch.set=function(Le){this._minPitch!==Le&&(this._minPitch=Le,this.pitch=Math.max(this.pitch,Le))},Zs.maxPitch.get=function(){return this._maxPitch},Zs.maxPitch.set=function(Le){this._maxPitch!==Le&&(this._maxPitch=Le,this.pitch=Math.min(this.pitch,Le))},Zs.renderWorldCopies.get=function(){return this._renderWorldCopies},Zs.renderWorldCopies.set=function(Le){Le===void 0?Le=!0:Le===null&&(Le=!1),this._renderWorldCopies=Le},Zs.worldSize.get=function(){return this.tileSize*this.scale},Zs.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Zs.size.get=function(){return new t.Point(this.width,this.height)},Zs.bearing.get=function(){return-this.angle/Math.PI*180},Zs.bearing.set=function(Le){var X=-t.wrap(Le,-180,180)*Math.PI/180;this.angle!==X&&(this._unmodified=!1,this.angle=X,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Zs.pitch.get=function(){return this._pitch/Math.PI*180},Zs.pitch.set=function(Le){var X=t.clamp(Le,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==X&&(this._unmodified=!1,this._pitch=X,this._calcMatrices())},Zs.fov.get=function(){return this._fov/Math.PI*180},Zs.fov.set=function(Le){Le=Math.max(.01,Math.min(60,Le)),this._fov!==Le&&(this._unmodified=!1,this._fov=Le/180*Math.PI,this._calcMatrices())},Zs.zoom.get=function(){return this._zoom},Zs.zoom.set=function(Le){var X=Math.min(Math.max(Le,this.minZoom),this.maxZoom);this._zoom!==X&&(this._unmodified=!1,this._zoom=X,this.scale=this.zoomScale(X),this.tileZoom=Math.floor(X),this.zoomFraction=X-this.tileZoom,this._constrain(),this._calcMatrices())},Zs.center.get=function(){return this._center},Zs.center.set=function(Le){Le.lat===this._center.lat&&Le.lng===this._center.lng||(this._unmodified=!1,this._center=Le,this._constrain(),this._calcMatrices())},Zs.padding.get=function(){return this._edgeInsets.toJSON()},Zs.padding.set=function(Le){this._edgeInsets.equals(Le)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,Le,1),this._calcMatrices())},Zs.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Ys.prototype.isPaddingEqual=function(X){return this._edgeInsets.equals(X)},Ys.prototype.interpolatePadding=function(X,we,ie){this._unmodified=!1,this._edgeInsets.interpolate(X,we,ie),this._constrain(),this._calcMatrices()},Ys.prototype.coveringZoomLevel=function(X){var we=(X.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/X.tileSize));return Math.max(0,we)},Ys.prototype.getVisibleUnwrappedCoordinates=function(X){var we=[new t.UnwrappedTileID(0,X)];if(this._renderWorldCopies)for(var ie=this.pointCoordinate(new t.Point(0,0)),Me=this.pointCoordinate(new t.Point(this.width,0)),tt=this.pointCoordinate(new t.Point(this.width,this.height)),wt=this.pointCoordinate(new t.Point(0,this.height)),Et=Math.floor(Math.min(ie.x,Me.x,tt.x,wt.x)),lt=Math.floor(Math.max(ie.x,Me.x,tt.x,wt.x)),gt=1,Pt=Et-gt;Pt<=lt+gt;Pt++)Pt!==0&&we.push(new t.UnwrappedTileID(Pt,X));return we},Ys.prototype.coveringTiles=function(X){var we=this.coveringZoomLevel(X),ie=we;if(X.minzoom!==void 0&&weX.maxzoom&&(we=X.maxzoom);var Me=t.MercatorCoordinate.fromLngLat(this.center),tt=Math.pow(2,we),wt=[tt*Me.x,tt*Me.y,0],Et=Sl.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,we),lt=X.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(lt=we);var gt=3,Pt=function(ka){return{aabb:new Ou([ka*tt,0,0],[(ka+1)*tt,tt,0]),zoom:0,x:0,y:0,wrap:ka,fullyVisible:!1}},lr=[],nr=[],cr=we,gr=X.reparseOverscaled?ie:we;if(this._renderWorldCopies)for(var pr=1;pr<=3;pr++)lr.push(Pt(-pr)),lr.push(Pt(pr));for(lr.push(Pt(0));lr.length>0;){var Jt=lr.pop(),or=Jt.x,ar=Jt.y,Yr=Jt.fullyVisible;if(!Yr){var cn=Jt.aabb.intersects(Et);if(cn===0)continue;Yr=cn===2}var Sn=Jt.aabb.distanceX(wt),Sa=Jt.aabb.distanceY(wt),fa=Math.max(Math.abs(Sn),Math.abs(Sa)),la=gt+(1<la&&Jt.zoom>=lt){nr.push({tileID:new t.OverscaledTileID(Jt.zoom===cr?gr:Jt.zoom,Jt.wrap,Jt.zoom,or,ar),distanceSq:t.sqrLen([wt[0]-.5-or,wt[1]-.5-ar])});continue}for(var Ea=0;Ea<4;Ea++){var Ra=(or<<1)+Ea%2,Ya=(ar<<1)+(Ea>>1);lr.push({aabb:Jt.aabb.quadrant(Ea),zoom:Jt.zoom+1,x:Ra,y:Ya,wrap:Jt.wrap,fullyVisible:Yr})}}return nr.sort(function(ka,ri){return ka.distanceSq-ri.distanceSq}).map(function(ka){return ka.tileID})},Ys.prototype.resize=function(X,we){this.width=X,this.height=we,this.pixelsToGLUnits=[2/X,-2/we],this._constrain(),this._calcMatrices()},Zs.unmodified.get=function(){return this._unmodified},Ys.prototype.zoomScale=function(X){return Math.pow(2,X)},Ys.prototype.scaleZoom=function(X){return Math.log(X)/Math.LN2},Ys.prototype.project=function(X){var we=t.clamp(X.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(X.lng)*this.worldSize,t.mercatorYfromLat(we)*this.worldSize)},Ys.prototype.unproject=function(X){return new t.MercatorCoordinate(X.x/this.worldSize,X.y/this.worldSize).toLngLat()},Zs.point.get=function(){return this.project(this.center)},Ys.prototype.setLocationAtPoint=function(X,we){var ie=this.pointCoordinate(we),Me=this.pointCoordinate(this.centerPoint),tt=this.locationCoordinate(X),wt=new t.MercatorCoordinate(tt.x-(ie.x-Me.x),tt.y-(ie.y-Me.y));this.center=this.coordinateLocation(wt),this._renderWorldCopies&&(this.center=this.center.wrap())},Ys.prototype.locationPoint=function(X){return this.coordinatePoint(this.locationCoordinate(X))},Ys.prototype.pointLocation=function(X){return this.coordinateLocation(this.pointCoordinate(X))},Ys.prototype.locationCoordinate=function(X){return t.MercatorCoordinate.fromLngLat(X)},Ys.prototype.coordinateLocation=function(X){return X.toLngLat()},Ys.prototype.pointCoordinate=function(X){var we=0,ie=[X.x,X.y,0,1],Me=[X.x,X.y,1,1];t.transformMat4(ie,ie,this.pixelMatrixInverse),t.transformMat4(Me,Me,this.pixelMatrixInverse);var tt=ie[3],wt=Me[3],Et=ie[0]/tt,lt=Me[0]/wt,gt=ie[1]/tt,Pt=Me[1]/wt,lr=ie[2]/tt,nr=Me[2]/wt,cr=lr===nr?0:(we-lr)/(nr-lr);return new t.MercatorCoordinate(t.number(Et,lt,cr)/this.worldSize,t.number(gt,Pt,cr)/this.worldSize)},Ys.prototype.coordinatePoint=function(X){var we=[X.x*this.worldSize,X.y*this.worldSize,0,1];return t.transformMat4(we,we,this.pixelMatrix),new t.Point(we[0]/we[3],we[1]/we[3])},Ys.prototype.getBounds=function(){return new t.LngLatBounds().extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Ys.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},Ys.prototype.setMaxBounds=function(X){X?(this.lngRange=[X.getWest(),X.getEast()],this.latRange=[X.getSouth(),X.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Ys.prototype.calculatePosMatrix=function(X,we){we===void 0&&(we=!1);var ie=X.key,Me=we?this._alignedPosMatrixCache:this._posMatrixCache;if(Me[ie])return Me[ie];var tt=X.canonical,wt=this.worldSize/this.zoomScale(tt.z),Et=tt.x+Math.pow(2,tt.z)*X.wrap,lt=t.identity(new Float64Array(16));return t.translate(lt,lt,[Et*wt,tt.y*wt,0]),t.scale(lt,lt,[wt/t.EXTENT,wt/t.EXTENT,1]),t.multiply(lt,we?this.alignedProjMatrix:this.projMatrix,lt),Me[ie]=new Float32Array(lt),Me[ie]},Ys.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Ys.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var X=-90,we=90,ie=-180,Me=180,tt,wt,Et,lt,gt=this.size,Pt=this._unmodified;if(this.latRange){var lr=this.latRange;X=t.mercatorYfromLat(lr[1])*this.worldSize,we=t.mercatorYfromLat(lr[0])*this.worldSize,tt=we-Xwe&&(lt=we-Jt)}if(this.lngRange){var or=cr.x,ar=gt.x/2;or-arMe&&(Et=Me-ar)}(Et!==void 0||lt!==void 0)&&(this.center=this.unproject(new t.Point(Et!==void 0?Et:cr.x,lt!==void 0?lt:cr.y))),this._unmodified=Pt,this._constraining=!1}},Ys.prototype._calcMatrices=function(){if(this.height){var X=this._fov/2,we=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(X)*this.height;var ie=Math.PI/2+this._pitch,Me=this._fov*(.5+we.y/this.height),tt=Math.sin(Me)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-ie-Me,.01,Math.PI-.01)),wt=this.point,Et=wt.x,lt=wt.y,gt=Math.cos(Math.PI/2-this._pitch)*tt+this.cameraToCenterDistance,Pt=gt*1.01,lr=this.height/50,nr=new Float64Array(16);t.perspective(nr,this._fov,this.width/this.height,lr,Pt),nr[8]=-we.x*2/this.width,nr[9]=we.y*2/this.height,t.scale(nr,nr,[1,-1,1]),t.translate(nr,nr,[0,0,-this.cameraToCenterDistance]),t.rotateX(nr,nr,this._pitch),t.rotateZ(nr,nr,this.angle),t.translate(nr,nr,[-Et,-lt,0]),this.mercatorMatrix=t.scale([],nr,[this.worldSize,this.worldSize,this.worldSize]),t.scale(nr,nr,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=nr,this.invProjMatrix=t.invert([],this.projMatrix);var cr=this.width%2/2,gr=this.height%2/2,pr=Math.cos(this.angle),Jt=Math.sin(this.angle),or=Et-Math.round(Et)+pr*cr+Jt*gr,ar=lt-Math.round(lt)+pr*gr+Jt*cr,Yr=new Float64Array(nr);if(t.translate(Yr,Yr,[or>.5?or-1:or,ar>.5?ar-1:ar,0]),this.alignedProjMatrix=Yr,nr=t.create(),t.scale(nr,nr,[this.width/2,-this.height/2,1]),t.translate(nr,nr,[1,-1,0]),this.labelPlaneMatrix=nr,nr=t.create(),t.scale(nr,nr,[1,-1,1]),t.translate(nr,nr,[-1,-1,0]),t.scale(nr,nr,[2/this.width,2/this.height,1]),this.glCoordMatrix=nr,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),nr=t.invert(new Float64Array(16),this.pixelMatrix),!nr)throw new Error("failed to invert matrix");this.pixelMatrixInverse=nr,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Ys.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var X=this.pointCoordinate(new t.Point(0,0)),we=[X.x*this.worldSize,X.y*this.worldSize,0,1],ie=t.transformMat4(we,we,this.pixelMatrix);return ie[3]/this.cameraToCenterDistance},Ys.prototype.getCameraPoint=function(){var X=this._pitch,we=Math.tan(X)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,we))},Ys.prototype.getCameraQueryGeometry=function(X){var we=this.getCameraPoint();if(X.length===1)return[X[0],we];for(var ie=we.x,Me=we.y,tt=we.x,wt=we.y,Et=0,lt=X;Et=3&&!X.some(function(ie){return isNaN(ie)})){var we=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(X[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+X[2],+X[1]],zoom:+X[0],bearing:we,pitch:+(X[4]||0)}),!0}return!1},Pc.prototype._updateHashUnthrottled=function(){var X=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,X)}catch{}};var mf={linearity:.3,easing:t.bezier(0,0,.3,1)},Ce=t.extend({deceleration:2500,maxSpeed:1400},mf),Ye=t.extend({deceleration:20,maxSpeed:1400},mf),pt=t.extend({deceleration:1e3,maxSpeed:360},mf),Dt=t.extend({deceleration:1e3,maxSpeed:90},mf),Ot=function(X){this._map=X,this.clear()};Ot.prototype.clear=function(){this._inertiaBuffer=[]},Ot.prototype.record=function(X){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:X})},Ot.prototype._drainInertiaBuffer=function(){for(var X=this._inertiaBuffer,we=t.browser.now(),ie=160;X.length>0&&we-X[0].time>ie;)X.shift()},Ot.prototype._onMoveEnd=function(X){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var we={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},ie=0,Me=this._inertiaBuffer;ie=this._clickTolerance||this._map.fire(new hr(X.type,this._map,X))},on.prototype.dblclick=function(X){return this._firePreventable(new hr(X.type,this._map,X))},on.prototype.mouseover=function(X){this._map.fire(new hr(X.type,this._map,X))},on.prototype.mouseout=function(X){this._map.fire(new hr(X.type,this._map,X))},on.prototype.touchstart=function(X){return this._firePreventable(new Rr(X.type,this._map,X))},on.prototype.touchmove=function(X){this._map.fire(new Rr(X.type,this._map,X))},on.prototype.touchend=function(X){this._map.fire(new Rr(X.type,this._map,X))},on.prototype.touchcancel=function(X){this._map.fire(new Rr(X.type,this._map,X))},on.prototype._firePreventable=function(X){if(this._map.fire(X),X.defaultPrevented)return{}},on.prototype.isEnabled=function(){return!0},on.prototype.isActive=function(){return!1},on.prototype.enable=function(){},on.prototype.disable=function(){};var En=function(X){this._map=X};En.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},En.prototype.mousemove=function(X){this._map.fire(new hr(X.type,this._map,X))},En.prototype.mousedown=function(){this._delayContextMenu=!0},En.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new hr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},En.prototype.contextmenu=function(X){this._delayContextMenu?this._contextMenuEvent=X:this._map.fire(new hr(X.type,this._map,X)),this._map.listens("contextmenu")&&X.preventDefault()},En.prototype.isEnabled=function(){return!0},En.prototype.isActive=function(){return!1},En.prototype.enable=function(){},En.prototype.disable=function(){};var Un=function(X,we){this._map=X,this._el=X.getCanvasContainer(),this._container=X.getContainer(),this._clickTolerance=we.clickTolerance||1};Un.prototype.isEnabled=function(){return!!this._enabled},Un.prototype.isActive=function(){return!!this._active},Un.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Un.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Un.prototype.mousedown=function(X,we){this.isEnabled()&&X.shiftKey&&X.button===0&&(a.disableDrag(),this._startPos=this._lastPos=we,this._active=!0)},Un.prototype.mousemoveWindow=function(X,we){if(this._active){var ie=we;if(!(this._lastPos.equals(ie)||!this._box&&ie.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=X.timeStamp),ie.length===this.numTouches&&(this.centroid=Xa(we),this.touches=Gn(ie,we)))},Va.prototype.touchmove=function(X,we,ie){if(!(this.aborted||!this.centroid)){var Me=Gn(ie,we);for(var tt in this.touches){var wt=this.touches[tt],Et=Me[tt];(!Et||Et.dist(wt)>Aa)&&(this.aborted=!0)}}},Va.prototype.touchend=function(X,we,ie){if((!this.centroid||X.timeStamp-this.startTime>ma)&&(this.aborted=!0),ie.length===0){var Me=!this.aborted&&this.centroid;if(this.reset(),Me)return Me}};var Za=function(X){this.singleTap=new Va(X),this.numTaps=X.numTaps,this.reset()};Za.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Za.prototype.touchstart=function(X,we,ie){this.singleTap.touchstart(X,we,ie)},Za.prototype.touchmove=function(X,we,ie){this.singleTap.touchmove(X,we,ie)},Za.prototype.touchend=function(X,we,ie){var Me=this.singleTap.touchend(X,we,ie);if(Me){var tt=X.timeStamp-this.lastTime0&&(this._active=!0);var Me=Gn(ie,we),tt=new t.Point(0,0),wt=new t.Point(0,0),Et=0;for(var lt in Me){var gt=Me[lt],Pt=this._touches[lt];Pt&&(tt._add(gt),wt._add(gt.sub(Pt)),Et++,Me[lt]=gt)}if(this._touches=Me,!(EtMath.abs(Le.x)}var Yl=100,_u=(function(Le){function X(){Le.apply(this,arguments)}return Le&&(X.__proto__=Le),X.prototype=Object.create(Le&&Le.prototype),X.prototype.constructor=X,X.prototype.reset=function(){Le.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},X.prototype._start=function(ie){this._lastPoints=ie,Kc(ie[0].sub(ie[1]))&&(this._valid=!1)},X.prototype._move=function(ie,Me,tt){var wt=ie[0].sub(this._lastPoints[0]),Et=ie[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(wt,Et,tt.timeStamp),!!this._valid){this._lastPoints=ie,this._active=!0;var lt=(wt.y+Et.y)/2,gt=-.5;return{pitchDelta:lt*gt}}},X.prototype.gestureBeginsVertically=function(ie,Me,tt){if(this._valid!==void 0)return this._valid;var wt=2,Et=ie.mag()>=wt,lt=Me.mag()>=wt;if(!(!Et&&!lt)){if(!Et||!lt)return this._firstMove===void 0&&(this._firstMove=tt),tt-this._firstMove0==Me.y>0;return Kc(ie)&&Kc(Me)&>}},X})(Tl),kf={panStep:100,bearingStep:15,pitchStep:10},Ju=function(){var X=kf;this._panStep=X.panStep,this._bearingStep=X.bearingStep,this._pitchStep=X.pitchStep,this._rotationDisabled=!1};Ju.prototype.reset=function(){this._active=!1},Ju.prototype.keydown=function(X){var we=this;if(!(X.altKey||X.ctrlKey||X.metaKey)){var ie=0,Me=0,tt=0,wt=0,Et=0;switch(X.keyCode){case 61:case 107:case 171:case 187:ie=1;break;case 189:case 109:case 173:ie=-1;break;case 37:X.shiftKey?Me=-1:(X.preventDefault(),wt=-1);break;case 39:X.shiftKey?Me=1:(X.preventDefault(),wt=1);break;case 38:X.shiftKey?tt=1:(X.preventDefault(),Et=-1);break;case 40:X.shiftKey?tt=-1:(X.preventDefault(),Et=1);break;default:return}return this._rotationDisabled&&(Me=0,tt=0),{cameraAnimation:function(lt){var gt=lt.getZoom();lt.easeTo({duration:300,easeId:"keyboardHandler",easing:Ct,zoom:ie?Math.round(gt)+ie*(X.shiftKey?2:1):gt,bearing:lt.getBearing()+Me*we._bearingStep,pitch:lt.getPitch()+tt*we._pitchStep,offset:[-wt*we._panStep,-Et*we._panStep],center:lt.getCenter()},{originalEvent:X})}}}},Ju.prototype.enable=function(){this._enabled=!0},Ju.prototype.disable=function(){this._enabled=!1,this.reset()},Ju.prototype.isEnabled=function(){return this._enabled},Ju.prototype.isActive=function(){return this._active},Ju.prototype.disableRotation=function(){this._rotationDisabled=!0},Ju.prototype.enableRotation=function(){this._rotationDisabled=!1};function Ct(Le){return Le*(2-Le)}var Ir=4.000244140625,zr=1/100,qn=1/450,Ca=2,Ln=function(X,we){this._map=X,this._el=X.getCanvasContainer(),this._handler=we,this._delta=0,this._defaultZoomRate=zr,this._wheelZoomRate=qn,t.bindAll(["_onTimeout"],this)};Ln.prototype.setZoomRate=function(X){this._defaultZoomRate=X},Ln.prototype.setWheelZoomRate=function(X){this._wheelZoomRate=X},Ln.prototype.isEnabled=function(){return!!this._enabled},Ln.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Ln.prototype.isZooming=function(){return!!this._zooming},Ln.prototype.enable=function(X){this.isEnabled()||(this._enabled=!0,this._aroundCenter=X&&X.around==="center")},Ln.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Ln.prototype.wheel=function(X){if(this.isEnabled()){var we=X.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?X.deltaY*40:X.deltaY,ie=t.browser.now(),Me=ie-(this._lastWheelEventTime||0);this._lastWheelEventTime=ie,we!==0&&we%Ir===0?this._type="wheel":we!==0&&Math.abs(we)<4?this._type="trackpad":Me>400?(this._type=null,this._lastValue=we,this._timeout=setTimeout(this._onTimeout,40,X)):this._type||(this._type=Math.abs(Me*we)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,we+=this._lastValue)),X.shiftKey&&we&&(we=we/4),this._type&&(this._lastWheelEvent=X,this._delta-=we,this._active||this._start(X)),X.preventDefault()}},Ln.prototype._onTimeout=function(X){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(X)},Ln.prototype._start=function(X){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 we=a.mousePos(this._el,X);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(we)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Ln.prototype.renderFrame=function(){var X=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var we=this._map.transform;if(this._delta!==0){var ie=this._type==="wheel"&&Math.abs(this._delta)>Ir?this._wheelZoomRate:this._defaultZoomRate,Me=Ca/(1+Math.exp(-Math.abs(this._delta*ie)));this._delta<0&&Me!==0&&(Me=1/Me);var tt=typeof this._targetZoom=="number"?we.zoomScale(this._targetZoom):we.scale;this._targetZoom=Math.min(we.maxZoom,Math.max(we.minZoom,we.scaleZoom(tt*Me))),this._type==="wheel"&&(this._startZoom=we.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var wt=typeof this._targetZoom=="number"?this._targetZoom:we.zoom,Et=this._startZoom,lt=this._easing,gt=!1,Pt;if(this._type==="wheel"&&Et&<){var lr=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),nr=lt(lr);Pt=t.number(Et,wt,nr),lr<1?this._frameId||(this._frameId=!0):gt=!0}else Pt=wt,gt=!0;return this._active=!0,gt&&(this._active=!1,this._finishTimeout=setTimeout(function(){X._zooming=!1,X._handler._triggerRenderFrame(),delete X._targetZoom,delete X._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!gt,zoomDelta:Pt-we.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Ln.prototype._smoothOutEasing=function(X){var we=t.ease;if(this._prevEase){var ie=this._prevEase,Me=(t.browser.now()-ie.start)/ie.duration,tt=ie.easing(Me+.01)-ie.easing(Me),wt=.27/Math.sqrt(tt*tt+1e-4)*.01,Et=Math.sqrt(.27*.27-wt*wt);we=t.bezier(wt,Et,.25,1)}return this._prevEase={start:t.browser.now(),duration:X,easing:we},we},Ln.prototype.reset=function(){this._active=!1};var Mn=function(X,we){this._clickZoom=X,this._tapZoom=we};Mn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Mn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Mn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Mn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ei=function(){this.reset()};ei.prototype.reset=function(){this._active=!1},ei.prototype.dblclick=function(X,we){return X.preventDefault(),{cameraAnimation:function(ie){ie.easeTo({duration:300,zoom:ie.getZoom()+(X.shiftKey?-1:1),around:ie.unproject(we)},{originalEvent:X})}}},ei.prototype.enable=function(){this._enabled=!0},ei.prototype.disable=function(){this._enabled=!1,this.reset()},ei.prototype.isEnabled=function(){return this._enabled},ei.prototype.isActive=function(){return this._active};var Ja=function(){this._tap=new Za({numTouches:1,numTaps:1}),this.reset()};Ja.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Ja.prototype.touchstart=function(X,we,ie){this._swipePoint||(this._tapTime&&X.timeStamp-this._tapTime>Kn&&this.reset(),this._tapTime?ie.length>0&&(this._swipePoint=we[0],this._swipeTouch=ie[0].identifier):this._tap.touchstart(X,we,ie))},Ja.prototype.touchmove=function(X,we,ie){if(!this._tapTime)this._tap.touchmove(X,we,ie);else if(this._swipePoint){if(ie[0].identifier!==this._swipeTouch)return;var Me=we[0],tt=Me.y-this._swipePoint.y;return this._swipePoint=Me,X.preventDefault(),this._active=!0,{zoomDelta:tt/128}}},Ja.prototype.touchend=function(X,we,ie){if(this._tapTime)this._swipePoint&&ie.length===0&&this.reset();else{var Me=this._tap.touchend(X,we,ie);Me&&(this._tapTime=X.timeStamp)}},Ja.prototype.touchcancel=function(){this.reset()},Ja.prototype.enable=function(){this._enabled=!0},Ja.prototype.disable=function(){this._enabled=!1,this.reset()},Ja.prototype.isEnabled=function(){return this._enabled},Ja.prototype.isActive=function(){return this._active};var Qa=function(X,we,ie){this._el=X,this._mousePan=we,this._touchPan=ie};Qa.prototype.enable=function(X){this._inertiaOptions=X||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Qa.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Qa.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Qa.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var mi=function(X,we,ie){this._pitchWithRotate=X.pitchWithRotate,this._mouseRotate=we,this._mousePitch=ie};mi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},mi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},mi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},mi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var fo=function(X,we,ie,Me){this._el=X,this._touchZoom=we,this._touchRotate=ie,this._tapDragZoom=Me,this._rotationDisabled=!1,this._enabled=!0};fo.prototype.enable=function(X){this._touchZoom.enable(X),this._rotationDisabled||this._touchRotate.enable(X),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},fo.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},fo.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},fo.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},fo.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},fo.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Hi=function(Le){return Le.zoom||Le.drag||Le.pitch||Le.rotate},hi=(function(Le){function X(){Le.apply(this,arguments)}return Le&&(X.__proto__=Le),X.prototype=Object.create(Le&&Le.prototype),X.prototype.constructor=X,X})(t.Event);function za(Le){return Le.panDelta&&Le.panDelta.mag()||Le.zoomDelta||Le.bearingDelta||Le.pitchDelta}var gn=function(X,we){this._map=X,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ot(X),this._bearingSnap=we.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(we),t.bindAll(["handleEvent","handleWindowEvent"],this);var ie=this._el;this._listeners=[[ie,"touchstart",{passive:!0}],[ie,"touchmove",{passive:!1}],[ie,"touchend",void 0],[ie,"touchcancel",void 0],[ie,"mousedown",void 0],[ie,"mousemove",void 0],[ie,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[ie,"mouseover",void 0],[ie,"mouseout",void 0],[ie,"dblclick",void 0],[ie,"click",void 0],[ie,"keydown",{capture:!1}],[ie,"keyup",void 0],[ie,"wheel",{passive:!1}],[ie,"contextmenu",void 0],[t.window,"blur",void 0]];for(var Me=0,tt=this._listeners;MeEt?Math.min(2,Sn):Math.max(.5,Sn),ka=Math.pow(Ya,1-Ea),ri=wt.unproject(Yr.add(cn.mult(Ea*ka)).mult(Ra));wt.setLocationAtPoint(wt.renderWorldCopies?ri.wrap():ri,Jt)}tt._fireMoveEvents(Me)},function(Ea){tt._afterEase(Me,Ea)},ie),this},X.prototype._prepareEase=function(ie,Me,tt){tt===void 0&&(tt={}),this._moving=!0,!Me&&!tt.moving&&this.fire(new t.Event("movestart",ie)),this._zooming&&!tt.zooming&&this.fire(new t.Event("zoomstart",ie)),this._rotating&&!tt.rotating&&this.fire(new t.Event("rotatestart",ie)),this._pitching&&!tt.pitching&&this.fire(new t.Event("pitchstart",ie))},X.prototype._fireMoveEvents=function(ie){this.fire(new t.Event("move",ie)),this._zooming&&this.fire(new t.Event("zoom",ie)),this._rotating&&this.fire(new t.Event("rotate",ie)),this._pitching&&this.fire(new t.Event("pitch",ie))},X.prototype._afterEase=function(ie,Me){if(!(this._easeId&&Me&&this._easeId===Me)){delete this._easeId;var tt=this._zooming,wt=this._rotating,Et=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,tt&&this.fire(new t.Event("zoomend",ie)),wt&&this.fire(new t.Event("rotateend",ie)),Et&&this.fire(new t.Event("pitchend",ie)),this.fire(new t.Event("moveend",ie))}},X.prototype.flyTo=function(ie,Me){var tt=this;if(!ie.essential&&t.browser.prefersReducedMotion){var wt=t.pick(ie,["center","zoom","bearing","pitch","around"]);return this.jumpTo(wt,Me)}this.stop(),ie=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},ie);var Et=this.transform,lt=this.getZoom(),gt=this.getBearing(),Pt=this.getPitch(),lr=this.getPadding(),nr="zoom"in ie?t.clamp(+ie.zoom,Et.minZoom,Et.maxZoom):lt,cr="bearing"in ie?this._normalizeBearing(ie.bearing,gt):gt,gr="pitch"in ie?+ie.pitch:Pt,pr="padding"in ie?ie.padding:Et.padding,Jt=Et.zoomScale(nr-lt),or=t.Point.convert(ie.offset),ar=Et.centerPoint.add(or),Yr=Et.pointLocation(ar),cn=t.LngLat.convert(ie.center||Yr);this._normalizeCenter(cn);var Sn=Et.project(Yr),Sa=Et.project(cn).sub(Sn),fa=ie.curve,la=Math.max(Et.width,Et.height),Ea=la/Jt,Ra=Sa.mag();if("minZoom"in ie){var Ya=t.clamp(Math.min(ie.minZoom,lt,nr),Et.minZoom,Et.maxZoom),ka=la/Et.zoomScale(Ya-lt);fa=Math.sqrt(ka/Ra*2)}var ri=fa*fa;function _i(Ml){var ju=(Ea*Ea-la*la+(Ml?-1:1)*ri*ri*Ra*Ra)/(2*(Ml?Ea:la)*ri*Ra);return Math.log(Math.sqrt(ju*ju+1)-ju)}function Ki(Ml){return(Math.exp(Ml)-Math.exp(-Ml))/2}function mo(Ml){return(Math.exp(Ml)+Math.exp(-Ml))/2}function Us(Ml){return Ki(Ml)/mo(Ml)}var zs=_i(0),Bl=function(Ml){return mo(zs)/mo(zs+fa*Ml)},Pl=function(Ml){return la*((mo(zs)*Us(zs+fa*Ml)-Ki(zs))/ri)/Ra},$l=(_i(1)-zs)/fa;if(Math.abs(Ra)<1e-6||!isFinite($l)){if(Math.abs(la-Ea)<1e-6)return this.easeTo(ie,Me);var Ul=Eaie.maxDuration&&(ie.duration=0),this._zooming=!0,this._rotating=gt!==cr,this._pitching=gr!==Pt,this._padding=!Et.isPaddingEqual(pr),this._prepareEase(Me,!1),this._ease(function(Ml){var ju=Ml*$l,Mh=1/Bl(ju);Et.zoom=Ml===1?nr:lt+Et.scaleZoom(Mh),tt._rotating&&(Et.bearing=t.number(gt,cr,Ml)),tt._pitching&&(Et.pitch=t.number(Pt,gr,Ml)),tt._padding&&(Et.interpolatePadding(lr,pr,Ml),ar=Et.centerPoint.add(or));var ud=Ml===1?cn:Et.unproject(Sn.add(Sa.mult(Pl(ju))).mult(Mh));Et.setLocationAtPoint(Et.renderWorldCopies?ud.wrap():ud,ar),tt._fireMoveEvents(Me)},function(){return tt._afterEase(Me)},ie),this},X.prototype.isEasing=function(){return!!this._easeFrameId},X.prototype.stop=function(){return this._stop()},X.prototype._stop=function(ie,Me){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var tt=this._onEaseEnd;delete this._onEaseEnd,tt.call(this,Me)}if(!ie){var wt=this.handlers;wt&&wt.stop(!1)}return this},X.prototype._ease=function(ie,Me,tt){tt.animate===!1||tt.duration===0?(ie(1),Me()):(this._easeStart=t.browser.now(),this._easeOptions=tt,this._onEaseFrame=ie,this._onEaseEnd=Me,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},X.prototype._renderFrameCallback=function(){var ie=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(ie)),ie<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},X.prototype._normalizeBearing=function(ie,Me){ie=t.wrap(ie,-180,180);var tt=Math.abs(ie-Me);return Math.abs(ie-360-Me)180?-360:tt<-180?360:0}},X})(t.Evented),ga=function(X){X===void 0&&(X={}),this.options=X,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};ga.prototype.getDefaultPosition=function(){return"bottom-right"},ga.prototype.onAdd=function(X){var we=this.options&&this.options.compact;return this._map=X,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=a.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),we&&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),we===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},ga.prototype.onRemove=function(){a.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},ga.prototype._setElementTitle=function(X,we){var ie=this._map._getUIString("AttributionControl."+we);X.title=ie,X.setAttribute("aria-label",ie)},ga.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},ga.prototype._updateEditLink=function(){var X=this._editLink;X||(X=this._editLink=this._container.querySelector(".mapbox-improve-map"));var we=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(X){var ie=we.reduce(function(Me,tt,wt){return tt.value&&(Me+=tt.key+"="+tt.value+(wt=0)return!1;return!0});var Et=X.join(" | ");Et!==this._attribHTML&&(this._attribHTML=Et,X.length?(this._innerContainer.innerHTML=Et,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},ga.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Na=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Na.prototype.onAdd=function(X){this._map=X,this._container=a.create("div","mapboxgl-ctrl");var we=a.create("a","mapboxgl-ctrl-logo");return we.target="_blank",we.rel="noopener nofollow",we.href="https://www.mapbox.com/",we.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),we.setAttribute("rel","noopener nofollow"),this._container.appendChild(we),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Na.prototype.onRemove=function(){a.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Na.prototype.getDefaultPosition=function(){return"bottom-left"},Na.prototype._updateLogo=function(X){(!X||X.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},Na.prototype._logoRequired=function(){if(this._map.style){var X=this._map.style.sourceCaches;for(var we in X){var ie=X[we].getSource();if(ie.mapbox_logo)return!0}return!1}},Na.prototype._updateCompact=function(){var X=this._container.children;if(X.length){var we=X[0];this._map.getCanvasContainer().offsetWidth<250?we.classList.add("mapboxgl-compact"):we.classList.remove("mapboxgl-compact")}};var ba=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};ba.prototype.add=function(X){var we=++this._id,ie=this._queue;return ie.push({callback:X,id:we,cancelled:!1}),we},ba.prototype.remove=function(X){for(var we=this._currentlyRunning,ie=we?this._queue.concat(we):this._queue,Me=0,tt=ie;Meie.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(ie.minPitch!=null&&ie.maxPitch!=null&&ie.minPitch>ie.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(ie.minPitch!=null&&ie.minPitchyi)throw new Error("maxPitch must be less than or equal to "+yi);var tt=new Ys(ie.minZoom,ie.maxZoom,ie.minPitch,ie.maxPitch,ie.renderWorldCopies);if(Le.call(this,tt,ie),this._interactive=ie.interactive,this._maxTileCacheSize=ie.maxTileCacheSize,this._failIfMajorPerformanceCaveat=ie.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=ie.preserveDrawingBuffer,this._antialias=ie.antialias,this._trackResize=ie.trackResize,this._bearingSnap=ie.bearingSnap,this._refreshExpiredTiles=ie.refreshExpiredTiles,this._fadeDuration=ie.fadeDuration,this._crossSourceCollisions=ie.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=ie.collectResourceTiming,this._renderTaskQueue=new ba,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Fi,ie.locale),this._clickTolerance=ie.clickTolerance,this._requestManager=new t.RequestManager(ie.transformRequest,ie.accessToken),typeof ie.container=="string"){if(this._container=t.window.document.getElementById(ie.container),!this._container)throw new Error("Container '"+ie.container+"' not found.")}else if(ie.container instanceof io)this._container=ie.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(ie.maxBounds&&this.setMaxBounds(ie.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return Me._update(!1)}),this.on("moveend",function(){return Me._update(!1)}),this.on("zoom",function(){return Me._update(!0)}),typeof t.window<"u"&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new gn(this,ie);var wt=typeof ie.hash=="string"&&ie.hash||void 0;this._hash=ie.hash&&new Pc(wt).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:ie.center,zoom:ie.zoom,bearing:ie.bearing,pitch:ie.pitch}),ie.bounds&&(this.resize(),this.fitBounds(ie.bounds,t.extend({},ie.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=ie.localIdeographFontFamily,ie.style&&this.setStyle(ie.style,{localIdeographFontFamily:ie.localIdeographFontFamily}),ie.attributionControl&&this.addControl(new ga({customAttribution:ie.customAttribution})),this.addControl(new Na,ie.logoPosition),this.on("style.load",function(){Me.transform.unmodified&&Me.jumpTo(Me.style.stylesheet)}),this.on("data",function(Et){Me._update(Et.dataType==="style"),Me.fire(new t.Event(Et.dataType+"data",Et))}),this.on("dataloading",function(Et){Me.fire(new t.Event(Et.dataType+"dataloading",Et))})}Le&&(X.__proto__=Le),X.prototype=Object.create(Le&&Le.prototype),X.prototype.constructor=X;var we={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return X.prototype._getMapId=function(){return this._mapId},X.prototype.addControl=function(Me,tt){if(tt===void 0&&(Me.getDefaultPosition?tt=Me.getDefaultPosition():tt="top-right"),!Me||!Me.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var wt=Me.onAdd(this);this._controls.push(Me);var Et=this._controlPositions[tt];return tt.indexOf("bottom")!==-1?Et.insertBefore(wt,Et.firstChild):Et.appendChild(wt),this},X.prototype.removeControl=function(Me){if(!Me||!Me.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var tt=this._controls.indexOf(Me);return tt>-1&&this._controls.splice(tt,1),Me.onRemove(this),this},X.prototype.hasControl=function(Me){return this._controls.indexOf(Me)>-1},X.prototype.resize=function(Me){var tt=this._containerDimensions(),wt=tt[0],Et=tt[1];this._resizeCanvas(wt,Et),this.transform.resize(wt,Et),this.painter.resize(wt,Et);var lt=!this._moving;return lt&&(this.stop(),this.fire(new t.Event("movestart",Me)).fire(new t.Event("move",Me))),this.fire(new t.Event("resize",Me)),lt&&this.fire(new t.Event("moveend",Me)),this},X.prototype.getBounds=function(){return this.transform.getBounds()},X.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},X.prototype.setMaxBounds=function(Me){return this.transform.setMaxBounds(t.LngLatBounds.convert(Me)),this._update()},X.prototype.setMinZoom=function(Me){if(Me=Me??ca,Me>=ca&&Me<=this.transform.maxZoom)return this.transform.minZoom=Me,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Me,this._update(),this.getZoom()>Me&&this.setZoom(Me),this;throw new Error("maxZoom must be greater than the current minZoom")},X.prototype.getMaxZoom=function(){return this.transform.maxZoom},X.prototype.setMinPitch=function(Me){if(Me=Me??Zn,Me=Zn&&Me<=this.transform.maxPitch)return this.transform.minPitch=Me,this._update(),this.getPitch()yi)throw new Error("maxPitch must be less than or equal to "+yi);if(Me>=this.transform.minPitch)return this.transform.maxPitch=Me,this._update(),this.getPitch()>Me&&this.setPitch(Me),this;throw new Error("maxPitch must be greater than the current minPitch")},X.prototype.getMaxPitch=function(){return this.transform.maxPitch},X.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},X.prototype.setRenderWorldCopies=function(Me){return this.transform.renderWorldCopies=Me,this._update()},X.prototype.project=function(Me){return this.transform.locationPoint(t.LngLat.convert(Me))},X.prototype.unproject=function(Me){return this.transform.pointLocation(t.Point.convert(Me))},X.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},X.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},X.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},X.prototype._createDelegatedListener=function(Me,tt,wt){var Et=this,lt;if(Me==="mouseenter"||Me==="mouseover"){var gt=!1,Pt=function(Jt){var or=Et.getLayer(tt)?Et.queryRenderedFeatures(Jt.point,{layers:[tt]}):[];or.length?gt||(gt=!0,wt.call(Et,new hr(Me,Et,Jt.originalEvent,{features:or}))):gt=!1},lr=function(){gt=!1};return{layer:tt,listener:wt,delegates:{mousemove:Pt,mouseout:lr}}}else if(Me==="mouseleave"||Me==="mouseout"){var nr=!1,cr=function(Jt){var or=Et.getLayer(tt)?Et.queryRenderedFeatures(Jt.point,{layers:[tt]}):[];or.length?nr=!0:nr&&(nr=!1,wt.call(Et,new hr(Me,Et,Jt.originalEvent)))},gr=function(Jt){nr&&(nr=!1,wt.call(Et,new hr(Me,Et,Jt.originalEvent)))};return{layer:tt,listener:wt,delegates:{mousemove:cr,mouseout:gr}}}else{var pr=function(Jt){var or=Et.getLayer(tt)?Et.queryRenderedFeatures(Jt.point,{layers:[tt]}):[];or.length&&(Jt.features=or,wt.call(Et,Jt),delete Jt.features)};return{layer:tt,listener:wt,delegates:(lt={},lt[Me]=pr,lt)}}},X.prototype.on=function(Me,tt,wt){if(wt===void 0)return Le.prototype.on.call(this,Me,tt);var Et=this._createDelegatedListener(Me,tt,wt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Me]=this._delegatedListeners[Me]||[],this._delegatedListeners[Me].push(Et);for(var lt in Et.delegates)this.on(lt,Et.delegates[lt]);return this},X.prototype.once=function(Me,tt,wt){if(wt===void 0)return Le.prototype.once.call(this,Me,tt);var Et=this._createDelegatedListener(Me,tt,wt);for(var lt in Et.delegates)this.once(lt,Et.delegates[lt]);return this},X.prototype.off=function(Me,tt,wt){var Et=this;if(wt===void 0)return Le.prototype.off.call(this,Me,tt);var lt=function(gt){for(var Pt=gt[Me],lr=0;lr180;){var wt=we.locationPoint(Le);if(wt.x>=0&&wt.y>=0&&wt.x<=we.width&&wt.y<=we.height)break;Le.lng>we.center.lng?Le.lng-=360:Le.lng+=360}return Le}var us={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function _s(Le,X,we){var ie=Le.classList;for(var Me in us)ie.remove("mapboxgl-"+we+"-anchor-"+Me);ie.add("mapboxgl-"+we+"-anchor-"+X)}var Dl=(function(Le){function X(we,ie){if(Le.call(this),(we instanceof t.window.HTMLElement||ie)&&(we=t.extend({element:we},ie)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=we&&we.anchor||"center",this._color=we&&we.color||"#3FB1CE",this._scale=we&&we.scale||1,this._draggable=we&&we.draggable||!1,this._clickTolerance=we&&we.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=we&&we.rotation||0,this._rotationAlignment=we&&we.rotationAlignment||"auto",this._pitchAlignment=we&&we.pitchAlignment&&we.pitchAlignment!=="auto"?we.pitchAlignment:this._rotationAlignment,!we||!we.element){this._defaultMarker=!0,this._element=a.create("div"),this._element.setAttribute("aria-label","Map marker");var Me=a.createNS("http://www.w3.org/2000/svg","svg"),tt=41,wt=27;Me.setAttributeNS(null,"display","block"),Me.setAttributeNS(null,"height",tt+"px"),Me.setAttributeNS(null,"width",wt+"px"),Me.setAttributeNS(null,"viewBox","0 0 "+wt+" "+tt);var Et=a.createNS("http://www.w3.org/2000/svg","g");Et.setAttributeNS(null,"stroke","none"),Et.setAttributeNS(null,"stroke-width","1"),Et.setAttributeNS(null,"fill","none"),Et.setAttributeNS(null,"fill-rule","evenodd");var lt=a.createNS("http://www.w3.org/2000/svg","g");lt.setAttributeNS(null,"fill-rule","nonzero");var gt=a.createNS("http://www.w3.org/2000/svg","g");gt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),gt.setAttributeNS(null,"fill","#000000");for(var Pt=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],lr=0,nr=Pt;lr=Me}this._isDragging&&(this._pos=ie.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},X.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.Event("dragend")),this._state="inactive"},X.prototype._addDragHandler=function(ie){this._element.contains(ie.originalEvent.target)&&(ie.preventDefault(),this._positionDelta=ie.point.sub(this._pos).add(this._offset),this._pointerdownPos=ie.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},X.prototype.setDraggable=function(ie){return this._draggable=!!ie,this._map&&(ie?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},X.prototype.isDraggable=function(){return this._draggable},X.prototype.setRotation=function(ie){return this._rotation=ie||0,this._update(),this},X.prototype.getRotation=function(){return this._rotation},X.prototype.setRotationAlignment=function(ie){return this._rotationAlignment=ie||"auto",this._update(),this},X.prototype.getRotationAlignment=function(){return this._rotationAlignment},X.prototype.setPitchAlignment=function(ie){return this._pitchAlignment=ie&&ie!=="auto"?ie:this._rotationAlignment,this._update(),this},X.prototype.getPitchAlignment=function(){return this._pitchAlignment},X})(t.Evented),xs={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Wu;function xl(Le){Wu!==void 0?Le(Wu):t.window.navigator.permissions!==void 0?t.window.navigator.permissions.query({name:"geolocation"}).then(function(X){Wu=X.state!=="denied",Le(Wu)}):(Wu=!!t.window.navigator.geolocation,Le(Wu))}var Fu=0,oc=!1,xc=(function(Le){function X(we){Le.call(this),this.options=t.extend({},xs,we),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return Le&&(X.__proto__=Le),X.prototype=Object.create(Le&&Le.prototype),X.prototype.constructor=X,X.prototype.onAdd=function(ie){return this._map=ie,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),xl(this._setupUI),this._container},X.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Fu=0,oc=!1},X.prototype._isOutOfMapMaxBounds=function(ie){var Me=this._map.getMaxBounds(),tt=ie.coords;return Me&&(tt.longitudeMe.getEast()||tt.latitudeMe.getNorth())},X.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");break}},X.prototype._onSuccess=function(ie){if(this._map){if(this._isOutOfMapMaxBounds(ie)){this._setErrorState(),this.fire(new t.Event("outofmaxbounds",ie)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=ie,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");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(ie),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(ie),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",ie)),this._finish()}},X.prototype._updateCamera=function(ie){var Me=new t.LngLat(ie.coords.longitude,ie.coords.latitude),tt=ie.coords.accuracy,wt=this._map.getBearing(),Et=t.extend({bearing:wt},this.options.fitBoundsOptions);this._map.fitBounds(Me.toBounds(tt),Et,{geolocateSource:!0})},X.prototype._updateMarker=function(ie){if(ie){var Me=new t.LngLat(ie.coords.longitude,ie.coords.latitude);this._accuracyCircleMarker.setLngLat(Me).addTo(this._map),this._userLocationDotMarker.setLngLat(Me).addTo(this._map),this._accuracy=ie.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},X.prototype._updateCircleRadius=function(){var ie=this._map._container.clientHeight/2,Me=this._map.unproject([0,ie]),tt=this._map.unproject([1,ie]),wt=Me.distanceTo(tt),Et=Math.ceil(2*this._accuracy/wt);this._circleElement.style.width=Et+"px",this._circleElement.style.height=Et+"px"},X.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},X.prototype._onError=function(ie){if(this._map){if(this.options.trackUserLocation)if(ie.code===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._geolocateButton.disabled=!0;var Me=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=Me,this._geolocateButton.setAttribute("aria-label",Me),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(ie.code===3&&oc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",ie)),this._finish()}},X.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},X.prototype._setupUI=function(ie){var Me=this;if(this._container.addEventListener("contextmenu",function(Et){return Et.preventDefault()}),this._geolocateButton=a.create("button","mapboxgl-ctrl-geolocate",this._container),a.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",ie===!1){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var tt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=tt,this._geolocateButton.setAttribute("aria-label",tt)}else{var wt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=wt,this._geolocateButton.setAttribute("aria-label",wt)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Dl(this._dotElement),this._circleElement=a.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Dl({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(Et){var lt=Et.originalEvent&&Et.originalEvent.type==="resize";!Et.geolocateSource&&Me._watchState==="ACTIVE_LOCK"&&!lt&&(Me._watchState="BACKGROUND",Me._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),Me._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),Me.fire(new t.Event("trackuserlocationend")))})},X.prototype.trigger=function(){if(!this._setup)return t.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 t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Fu--,oc=!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 t.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 t.Event("trackuserlocationstart"));break}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");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Fu++;var ie;Fu>1?(ie={maximumAge:6e5,timeout:0},oc=!0):(ie=this.options.positionOptions,oc=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,ie)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},X.prototype._clearWatch=function(){t.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)},X})(t.Evented),Yf={maxWidth:100,unit:"metric"},Tu=function(X){this.options=t.extend({},Yf,X),t.bindAll(["_onMove","setUnit"],this)};Tu.prototype.getDefaultPosition=function(){return"bottom-left"},Tu.prototype._onMove=function(){Du(this._map,this._container,this.options)},Tu.prototype.onAdd=function(X){return this._map=X,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",X.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Tu.prototype.onRemove=function(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Tu.prototype.setUnit=function(X){this.options.unit=X,Du(this._map,this._container,this.options)};function Du(Le,X,we){var ie=we&&we.maxWidth||100,Me=Le._container.clientHeight/2,tt=Le.unproject([0,Me]),wt=Le.unproject([ie,Me]),Et=tt.distanceTo(wt);if(we&&we.unit==="imperial"){var lt=3.2808*Et;if(lt>5280){var gt=lt/5280;Fo(X,ie,gt,Le._getUIString("ScaleControl.Miles"))}else Fo(X,ie,lt,Le._getUIString("ScaleControl.Feet"))}else if(we&&we.unit==="nautical"){var Pt=Et/1852;Fo(X,ie,Pt,Le._getUIString("ScaleControl.NauticalMiles"))}else Et>=1e3?Fo(X,ie,Et/1e3,Le._getUIString("ScaleControl.Kilometers")):Fo(X,ie,Et,Le._getUIString("ScaleControl.Meters"))}function Fo(Le,X,we,ie){var Me=sl(we),tt=Me/we;Le.style.width=X*tt+"px",Le.innerHTML=Me+" "+ie}function bc(Le){var X=Math.pow(10,Math.ceil(-Math.log(Le)/Math.LN10));return Math.round(Le*X)/X}function sl(Le){var X=Math.pow(10,(""+Math.floor(Le)).length-1),we=Le/X;return we=we>=10?10:we>=5?5:we>=3?3:we>=2?2:we>=1?1:bc(we),X*we}var iu=function(X){this._fullscreen=!1,X&&X.container&&(X.container instanceof t.window.HTMLElement?this._container=X.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};iu.prototype.onAdd=function(X){return this._map=X,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},iu.prototype.onRemove=function(){a.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},iu.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},iu.prototype._setupUI=function(){var X=this._fullscreenButton=a.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);a.create("span","mapboxgl-ctrl-icon",X).setAttribute("aria-hidden",!0),X.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},iu.prototype._updateTitle=function(){var X=this._getTitle();this._fullscreenButton.setAttribute("aria-label",X),this._fullscreenButton.title=X},iu.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},iu.prototype._isFullscreen=function(){return this._fullscreen},iu.prototype._changeIcon=function(){var X=t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement;X===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},iu.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.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 Fc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Bc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Zo=(function(Le){function X(we){Le.call(this),this.options=t.extend(Object.create(Fc),we),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return Le&&(X.__proto__=Le),X.prototype=Object.create(Le&&Le.prototype),X.prototype.constructor=X,X.prototype.addTo=function(ie){return this._map&&this.remove(),this._map=ie,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._focusFirstElement(),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 t.Event("open")),this},X.prototype.isOpen=function(){return!!this._map},X.prototype.remove=function(){return this._content&&a.remove(this._content),this._container&&(a.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 t.Event("close")),this},X.prototype.getLngLat=function(){return this._lngLat},X.prototype.setLngLat=function(ie){return this._lngLat=t.LngLat.convert(ie),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},X.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},X.prototype.getElement=function(){return this._container},X.prototype.setText=function(ie){return this.setDOMContent(t.window.document.createTextNode(ie))},X.prototype.setHTML=function(ie){var Me=t.window.document.createDocumentFragment(),tt=t.window.document.createElement("body"),wt;for(tt.innerHTML=ie;wt=tt.firstChild,!!wt;)Me.appendChild(wt);return this.setDOMContent(Me)},X.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},X.prototype.setMaxWidth=function(ie){return this.options.maxWidth=ie,this._update(),this},X.prototype.setDOMContent=function(ie){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(ie),this._createCloseButton(),this._update(),this._focusFirstElement(),this},X.prototype.addClassName=function(ie){this._container&&this._container.classList.add(ie)},X.prototype.removeClassName=function(ie){this._container&&this._container.classList.remove(ie)},X.prototype.setOffset=function(ie){return this.options.offset=ie,this._update(),this},X.prototype.toggleClassName=function(ie){if(this._container)return this._container.classList.toggle(ie)},X.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=a.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))},X.prototype._onMouseUp=function(ie){this._update(ie.point)},X.prototype._onMouseMove=function(ie){this._update(ie.point)},X.prototype._onDrag=function(ie){this._update(ie.point)},X.prototype._update=function(ie){var Me=this,tt=this._lngLat||this._trackPointer;if(!(!this._map||!tt||!this._content)&&(this._container||(this._container=a.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=a.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(cr){return Me._container.classList.add(cr)}),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&&!ie))){var wt=this._pos=this._trackPointer&&ie?ie:this._map.project(this._lngLat),Et=this.options.anchor,lt=Ds(this.options.offset);if(!Et){var gt=this._container.offsetWidth,Pt=this._container.offsetHeight,lr;wt.y+lt.bottom.ythis._map.transform.height-Pt?lr=["bottom"]:lr=[],wt.xthis._map.transform.width-gt/2&&lr.push("right"),lr.length===0?Et="bottom":Et=lr.join("-")}var nr=wt.add(lt[Et]).round();a.setTransform(this._container,us[Et]+" translate("+nr.x+"px,"+nr.y+"px)"),_s(this._container,Et,"popup")}},X.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var ie=this._container.querySelector(Bc);ie&&ie.focus()}},X.prototype._onClose=function(){this.remove()},X})(t.Evented);function Ds(Le){if(Le)if(typeof Le=="number"){var X=Math.round(Math.sqrt(.5*Math.pow(Le,2)));return{center:new t.Point(0,0),top:new t.Point(0,Le),"top-left":new t.Point(X,X),"top-right":new t.Point(-X,X),bottom:new t.Point(0,-Le),"bottom-left":new t.Point(X,-X),"bottom-right":new t.Point(-X,-X),left:new t.Point(Le,0),right:new t.Point(-Le,0)}}else if(Le instanceof t.Point||Array.isArray(Le)){var we=t.Point.convert(Le);return{center:we,top:we,"top-left":we,"top-right":we,bottom:we,"bottom-left":we,"bottom-right":we,left:we,right:we}}else return{center:t.Point.convert(Le.center||[0,0]),top:t.Point.convert(Le.top||[0,0]),"top-left":t.Point.convert(Le["top-left"]||[0,0]),"top-right":t.Point.convert(Le["top-right"]||[0,0]),bottom:t.Point.convert(Le.bottom||[0,0]),"bottom-left":t.Point.convert(Le["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(Le["bottom-right"]||[0,0]),left:t.Point.convert(Le.left||[0,0]),right:t.Point.convert(Le.right||[0,0])};else return Ds(new t.Point(0,0))}var Bs={version:t.version,supported:r,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:lo,NavigationControl:vo,GeolocateControl:xc,AttributionControl:ga,ScaleControl:Tu,FullscreenControl:iu,Popup:Zo,Marker:Dl,Style:vc,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:Qi,clearPrewarmedResources:Xt,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(Le){t.config.ACCESS_TOKEN=Le},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(Le){t.config.API_URL=Le},get workerCount(){return Oa.workerCount},set workerCount(Le){Oa.workerCount=Le},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(Le){t.config.MAX_PARALLEL_IMAGE_REQUESTS=Le},clearStorage:function(X){t.clearTileCache(X)},workerUrl:""};return Bs}),M})}}),HZ=Re({"src/plots/mapbox/layers.js"(ae,K){var v=Rn(),S=kc().sanitizeHTML,M=n7(),L=Ix();function t(s,o){this.subplot=s,this.uid=s.uid+"-"+o,this.index=o,this.idSource="source-"+this.uid,this.idLayer=L.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var r=t.prototype;r.update=function(o){this.visible?this.needsNewImage(o)?this.updateImage(o):this.needsNewSource(o)?(this.removeLayer(),this.updateSource(o),this.updateLayer(o)):this.needsNewLayer(o)?this.updateLayer(o):this.updateStyle(o):(this.updateSource(o),this.updateLayer(o)),this.visible=a(o)},r.needsNewImage=function(s){var o=this.subplot.map;return o.getSource(this.idSource)&&this.sourceType==="image"&&s.sourcetype==="image"&&(this.source!==s.source||JSON.stringify(this.coordinates)!==JSON.stringify(s.coordinates))},r.needsNewSource=function(s){return this.sourceType!==s.sourcetype||JSON.stringify(this.source)!==JSON.stringify(s.source)||this.layerType!==s.type},r.needsNewLayer=function(s){return this.layerType!==s.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},r.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},r.updateImage=function(s){var o=this.subplot.map;o.getSource(this.idSource).updateImage({url:s.source,coordinates:s.coordinates});var c=this.findFollowingMapboxLayerId(this.lookupBelow());c!==null&&this.subplot.map.moveLayer(this.idLayer,c)},r.updateSource=function(s){var o=this.subplot.map;if(o.getSource(this.idSource)&&o.removeSource(this.idSource),this.sourceType=s.sourcetype,this.source=s.source,!!a(s)){var c=i(s);o.addSource(this.idSource,c)}},r.findFollowingMapboxLayerId=function(s){if(s==="traces")for(var o=this.subplot.getMapLayers(),c=0;c0){for(var c=0;c0}function l(s){var o={},c={};switch(s.type){case"circle":v.extendFlat(c,{"circle-radius":s.circle.radius,"circle-color":s.color,"circle-opacity":s.opacity});break;case"line":v.extendFlat(c,{"line-width":s.line.width,"line-color":s.color,"line-opacity":s.opacity,"line-dasharray":s.line.dash});break;case"fill":v.extendFlat(c,{"fill-color":s.color,"fill-outline-color":s.fill.outlinecolor,"fill-opacity":s.opacity});break;case"symbol":var p=s.symbol,d=M(p.textposition,p.iconsize);v.extendFlat(o,{"icon-image":p.icon+"-15","icon-size":p.iconsize/10,"text-field":p.text,"text-size":p.textfont.size,"text-anchor":d.anchor,"text-offset":d.offset,"symbol-placement":p.placement}),v.extendFlat(c,{"icon-color":s.color,"text-color":p.textfont.color,"text-opacity":s.opacity});break;case"raster":v.extendFlat(c,{"raster-fade-duration":0,"raster-opacity":s.opacity});break}return{layout:o,paint:c}}function i(s){var o=s.sourcetype,c=s.source,p={type:o},d;return o==="geojson"?d="data":o==="vector"?d=typeof c=="string"?"url":"tiles":o==="raster"?(d="tiles",p.tileSize=256):o==="image"&&(d="url",p.coordinates=s.coordinates),p[d]=c,s.sourceattribution&&(p.attribution=S(s.sourceattribution)),p}K.exports=function(o,c,p){var d=new t(o,c);return d.update(p),d}}}),WZ=Re({"src/plots/mapbox/mapbox.js"(ae,K){var v=a7(),S=Rn(),M=jw(),L=es(),t=js(),r=fv(),a=Sh(),l=gg(),i=l.drawMode,s=l.selectMode,o=Dh().prepSelect,c=Dh().clearOutline,p=Dh().clearSelectionsCache,d=Dh().selectOnClick,y=Ix(),g=HZ();function C(T,E){this.id=E,this.gd=T;var _=T._fullLayout,h=T._context;this.container=_._glcontainer.node(),this.isStatic=h.staticPlot,this.uid=_._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(_),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var f=C.prototype;f.plot=function(T,E,_){var h=this,m=E[h.id];h.map&&m.accesstoken!==h.accessToken&&(h.map.remove(),h.map=null,h.styleObj=null,h.traceHash={},h.layerList=[]);var w;h.map?w=new Promise(function(F,z){h.updateMap(T,E,F,z)}):w=new Promise(function(F,z){h.createMap(T,E,F,z)}),_.push(w)},f.createMap=function(T,E,_,h){var m=this,w=E[m.id],F=m.styleObj=A(w.style,E);m.accessToken=w.accesstoken;var z=w.bounds,U=z?[[z.west,z.south],[z.east,z.north]]:null,V=m.map=new v.Map({container:m.div,style:F.style,center:I(w.center),zoom:w.zoom,bearing:w.bearing,pitch:w.pitch,maxBounds:U,interactive:!m.isStatic,preserveDrawingBuffer:m.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new v.AttributionControl({compact:!0}));V._canvas.style.left="0px",V._canvas.style.top="0px",m.rejectOnError(h),m.isStatic||m.initFx(T,E);var G=[];G.push(new Promise(function(j){V.once("load",j)})),G=G.concat(M.fetchTraceGeoData(T)),Promise.all(G).then(function(){m.fillBelowLookup(T,E),m.updateData(T),m.updateLayout(E),m.resolveOnRender(_)}).catch(h)},f.updateMap=function(T,E,_,h){var m=this,w=m.map,F=E[this.id];m.rejectOnError(h);var z=[],U=A(F.style,E);JSON.stringify(m.styleObj)!==JSON.stringify(U)&&(m.styleObj=U,w.setStyle(U.style),m.traceHash={},z.push(new Promise(function(V){w.once("styledata",V)}))),z=z.concat(M.fetchTraceGeoData(T)),Promise.all(z).then(function(){m.fillBelowLookup(T,E),m.updateData(T),m.updateLayout(E),m.resolveOnRender(_)}).catch(h)},f.fillBelowLookup=function(T,E){var _=E[this.id],h=_.layers,m,w,F=this.belowLookup={},z=!1;for(m=0;m1)for(m=0;m-1&&d(U.originalEvent,h,[_.xaxis],[_.yaxis],_.id,z),V.indexOf("event")>-1&&a.click(h,U.originalEvent)}}},f.updateFx=function(T){var E=this,_=E.map,h=E.gd;if(E.isStatic)return;function m(U){var V=E.map.unproject(U);return[V.lng,V.lat]}var w=T.dragmode,F;F=function(U,V){if(V.isRect){var G=U.range={};G[E.id]=[m([V.xmin,V.ymin]),m([V.xmax,V.ymax])]}else{var j=U.lassoPoints={};j[E.id]=V.map(m)}};var z=E.dragOptions;E.dragOptions=S.extendDeep(z||{},{dragmode:T.dragmode,element:E.div,gd:h,plotinfo:{id:E.id,domain:T[E.id].domain,xaxis:E.xaxis,yaxis:E.yaxis,fillRangeItems:F},xaxes:[E.xaxis],yaxes:[E.yaxis],subplot:E.id}),_.off("click",E.onClickInPanHandler),s(w)||i(w)?(_.dragPan.disable(),_.on("zoomstart",E.clearOutline),E.dragOptions.prepFn=function(U,V,G){o(U,V,G,E.dragOptions,w)},r.init(E.dragOptions)):(_.dragPan.enable(),_.off("zoomstart",E.clearOutline),E.div.onmousedown=null,E.div.ontouchstart=null,E.div.removeEventListener("touchstart",E.div._ontouchstart),E.onClickInPanHandler=E.onClickInPanFn(E.dragOptions),_.on("click",E.onClickInPanHandler))},f.updateFramework=function(T){var E=T[this.id].domain,_=T._size,h=this.div.style;h.width=_.w*(E.x[1]-E.x[0])+"px",h.height=_.h*(E.y[1]-E.y[0])+"px",h.left=_.l+E.x[0]*_.w+"px",h.top=_.t+(1-E.y[1])*_.h+"px",this.xaxis._offset=_.l+E.x[0]*_.w,this.xaxis._length=_.w*(E.x[1]-E.x[0]),this.yaxis._offset=_.t+(1-E.y[1])*_.h,this.yaxis._length=_.h*(E.y[1]-E.y[0])},f.updateLayers=function(T){var E=T[this.id],_=E.layers,h=this.layerList,m;if(_.length!==h.length){for(m=0;mG/2){var j=F.split("|").join("
");U.text(j).attr("data-unformatted",j).call(l.convertToTspans,g),V=a.bBox(U.node())}U.attr("transform",S(-3,-V.height+8)),z.insert("rect",".static-attribution").attr({x:-V.width-6,y:-V.height-3,width:V.width+6,height:V.height+3,fill:"rgba(255, 255, 255, 0.75)"});var O=1;V.width+6>G&&(O=G/(V.width+6));var H=[x.l+x.w*I.x[1],x.t+x.h*(1-I.y[0])];z.attr("transform",S(H[0],H[1])+M(O))}};function d(g,C){var f=g._fullLayout,x=g._context;if(x.mapboxAccessToken==="")return"";for(var A=[],k=[],I=!1,T=!1,E=0;E1&&v.warn(o.multipleTokensErrorMsg),A[0]):(k.length&&v.log(["Listed mapbox access token(s)",k.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function y(g){return typeof g=="string"&&(o.styleValuesMapbox.indexOf(g)!==-1||g.indexOf("mapbox://")===0||g.indexOf("stamen")===0)}ae.updateFx=function(g){for(var C=g._fullLayout,f=C._subplots[s],x=0;x=0;l--)r.removeLayer(a[l][1])},t.dispose=function(){var r=this.subplot.map;this._removeLayers(),r.removeSource(this.sourceId)},K.exports=function(a,l){var i=l[0].trace,s=new L(a,i.uid),o=s.sourceId,c=v(l),p=s.below=a.belowLookup["trace-"+i.uid];return a.map.addSource(o,{type:"geojson",data:c.geojson}),s._addLayers(c,p),l[0].trace._glTrace=s,s}}}),QZ=Re({"src/traces/choroplethmapbox/index.js"(ae,K){K.exports={attributes:i7(),supplyDefaults:KZ(),colorbar:Ly(),calc:IP(),plot:JZ(),hoverPoints:RP(),eventData:DP(),selectPoints:PP(),styleOnSelect:function(v,S){if(S){var M=S[0].trace;M._glTrace.updateOnSelect(S)}},getBelow:function(v,S){for(var M=S.getMapLayers(),L=M.length-2;L>=0;L--){var t=M[L].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var r=L+1;r0?+g[d]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:A},properties:k})}}var T=L.extractOpts(i),E=T.reversescale?L.flipScale(T.colorscale):T.colorscale,_=E[0][1],h=M.opacity(_)<1?_:M.addOpacity(_,0),m=["interpolate",["linear"],["heatmap-density"],0,h];for(d=1;d=0;a--)t.removeLayer(r[a][1])},L.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},K.exports=function(r,a){var l=a[0].trace,i=new M(r,l.uid),s=i.sourceId,o=v(a),c=i.below=r.belowLookup["trace-"+l.uid];return r.map.addSource(s,{type:"geojson",data:o.geojson}),i._addLayers(o,c),i}}}),iK=Re({"src/traces/densitymapbox/hover.js"(ae,K){var v=js(),S=WP().hoverPoints,M=WP().getExtraText;K.exports=function(t,r,a){var l=S(t,r,a);if(l){var i=l[0],s=i.cd,o=s[0].trace,c=s[i.index];if(delete i.color,"z"in c){var p=i.subplot.mockAxis;i.z=c.z,i.zLabel=v.tickText(p,p.c2l(c.z),"hover").text}return i.extraText=M(o,c,s[0].t.labels),[i]}}}}),oK=Re({"src/traces/densitymapbox/event_data.js"(ae,K){K.exports=function(S,M){return S.lon=M.lon,S.lat=M.lat,S.z=M.z,S}}}),sK=Re({"src/traces/densitymapbox/index.js"(ae,K){K.exports={attributes:s7(),supplyDefaults:tK(),colorbar:Ly(),formatLabels:r7(),calc:rK(),plot:aK(),hoverPoints:iK(),eventData:oK(),getBelow:function(v,S){for(var M=S.getMapLayers(),L=0;LESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin} +{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),cK=Re({"src/plots/map/styles/arcgis-sat.js"(ae,K){K.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),Ww=Re({"src/plots/map/constants.js"(ae,K){var v=hg(),S=uK(),M=cK(),L='© OpenStreetMap contributors',t="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",l="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",s="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",o={basic:a,streets:a,outdoors:a,light:t,dark:r,satellite:M,"satellite-streets":S,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:L,tiles:["https://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":t,"carto-darkmatter":r,"carto-voyager":a,"carto-positron-nolabels":l,"carto-darkmatter-nolabels":i,"carto-voyager-nolabels":s},c=v(o);K.exports={styleValueDflt:"basic",stylesMap:o,styleValuesMap:c,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",c.join(", "),"or use a tile service."].join(` +`),mapOnErrorMsg:"Map error."}}}),QI=Re({"src/plots/map/layout_attributes.js"(ae,K){var v=Rn(),S=ko().defaultLine,M=af().attributes,L=Do(),t=wf().textposition,r=bf().overrideAll,a=Bu().templatedArray,l=Ww(),i=L({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});i.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var s=K.exports=r({_arrayAttrRegexps:[v.counterRegex("map",".layers",!0)],domain:M({name:"map"}),style:{valType:"any",values:l.styleValuesMap,dflt:l.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:a("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:S},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:S}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:i,textposition:v.extendFlat({},t,{arrayOk:!1})}})},"plot","from-root");s.uirevision={valType:"any",editType:"none"}}}),YP=Re({"src/traces/scattermap/attributes.js"(ae,K){var{hovertemplateAttrs:v,texttemplateAttrs:S,templatefallbackAttrs:M}=Wl(),L=hv(),t=PT(),r=wf(),a=QI(),l=As(),i=ac(),s=Li().extendFlat,o=bf().overrideAll,c=QI(),p=t.line,d=t.marker;K.exports=o({lon:t.lon,lat:t.lat,cluster:{enabled:{valType:"boolean"},maxzoom:s({},c.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:s({},d.opacity,{dflt:1})},mode:s({},r.mode,{dflt:"markers"}),text:s({},r.text,{}),texttemplate:S({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:M({editType:"plot"}),hovertext:s({},r.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:r.connectgaps,marker:s({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},i("marker")),fill:t.fill,fillcolor:L(),textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,below:{valType:"string"},selected:{marker:r.selected.marker},unselected:{marker:r.unselected.marker},hoverinfo:s({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:v(),hovertemplatefallback:M()},"calc","nested")}}),l7=Re({"src/traces/scattermap/constants.js"(ae,K){var v=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];K.exports={isSupportedFont:function(S){return v.indexOf(S)!==-1}}}}),fK=Re({"src/traces/scattermap/defaults.js"(ae,K){var v=Rn(),S=Mu(),M=Yp(),L=xg(),t=Sm(),r=Rp(),a=YP(),l=l7().isSupportedFont;K.exports=function(o,c,p,d){function y(m,w){return v.coerce(o,c,a,m,w)}function g(m,w){return v.coerce2(o,c,a,m,w)}var C=i(o,c,y);if(!C){c.visible=!1;return}if(y("text"),y("texttemplate"),y("texttemplatefallback"),y("hovertext"),y("hovertemplate"),y("hovertemplatefallback"),y("mode"),y("below"),S.hasMarkers(c)){M(o,c,p,d,y,{noLine:!0,noAngle:!0}),y("marker.allowoverlap"),y("marker.angle");var f=c.marker;f.symbol!=="circle"&&(v.isArrayOrTypedArray(f.size)&&(f.size=f.size[0]),v.isArrayOrTypedArray(f.color)&&(f.color=f.color[0]))}S.hasLines(c)&&(L(o,c,p,d,y,{noDash:!0}),y("connectgaps"));var x=g("cluster.maxzoom"),A=g("cluster.step"),k=g("cluster.color",c.marker&&c.marker.color||p),I=g("cluster.size"),T=g("cluster.opacity"),E=x!==!1||A!==!1||k!==!1||I!==!1||T!==!1,_=y("cluster.enabled",E);if(_||S.hasText(c)){var h=d.font.family;t(o,c,d,y,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(h)?h:"Open Sans Regular",weight:d.font.weight,style:d.font.style,size:d.font.size,color:d.font.color}})}y("fill"),c.fill!=="none"&&r(o,c,p,y),v.coerceSelectionMarkerOpacity(c,y)};function i(s,o,c){var p=c("lon")||[],d=c("lat")||[],y=Math.min(p.length,d.length);return o._length=y,y}}}),u7=Re({"src/traces/scattermap/format_labels.js"(ae,K){var v=js();K.exports=function(M,L,t){var r={},a=t[L.subplot]._subplot,l=a.mockAxis,i=M.lonlat;return r.lonLabel=v.tickText(l,l.c2l(i[0]),!0).text,r.latLabel=v.tickText(l,l.c2l(i[1]),!0).text,r}}}),c7=Re({"src/plots/map/convert_text_opts.js"(ae,K){var v=Rn();K.exports=function(M,L){var t=M.split(" "),r=t[0],a=t[1],l=v.isArrayOrTypedArray(L)?v.mean(L):L,i=.5+l/100,s=1.5+l/100,o=["",""],c=[0,0];switch(r){case"top":o[0]="top",c[1]=-s;break;case"bottom":o[0]="bottom",c[1]=s;break}switch(a){case"left":o[1]="right",c[0]=-i;break;case"right":o[1]="left",c[0]=i;break}var p;return o[0]&&o[1]?p=o.join("-"):o[0]?p=o[0]:o[1]?p=o[1]:p="center",{anchor:p,offset:c}}}}),hK=Re({"src/traces/scattermap/convert.js"(ae,K){var v=da(),S=Rn(),M=Ia().BADNUM,L=Vw(),t=nf(),r=qs(),a=pg(),l=Mu(),i=l7().isSupportedFont,s=c7(),o=Xp().appendArrayPointValue,c=kc().NEWLINES,p=kc().BR_TAG_ALL;K.exports=function(T,E){var _=E[0].trace,h=_.visible===!0&&_._length!==0,m=_.fill!=="none",w=l.hasLines(_),F=l.hasMarkers(_),z=l.hasText(_),U=F&&_.marker.symbol==="circle",V=F&&_.marker.symbol!=="circle",G=_.cluster&&_.cluster.enabled,j=d("fill"),O=d("line"),H=d("circle"),W=d("symbol"),ee={fill:j,line:O,circle:H,symbol:W};if(!h)return ee;var ue;if((m||w)&&(ue=L.calcTraceToLineCoords(E)),m&&(j.geojson=L.makePolygon(ue),j.layout.visibility="visible",S.extendFlat(j.paint,{"fill-color":_.fillcolor})),w&&(O.geojson=L.makeLine(ue),O.layout.visibility="visible",S.extendFlat(O.paint,{"line-width":_.line.width,"line-color":_.line.color,"line-opacity":_.opacity})),U){var xe=y(E);H.geojson=xe.geojson,H.layout.visibility="visible",G&&(H.filter=["!",["has","point_count"]],ee.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":A(_.cluster.color,_.cluster.step),"circle-radius":A(_.cluster.size,_.cluster.step),"circle-opacity":A(_.cluster.opacity,_.cluster.step)}},ee.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":k(_),"text-size":12}}),S.extendFlat(H.paint,{"circle-color":xe.mcc,"circle-radius":xe.mrc,"circle-opacity":xe.mo})}if(U&&G&&(H.filter=["!",["has","point_count"]]),(V||z)&&(W.geojson=g(E,T),S.extendFlat(W.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),V&&(S.extendFlat(W.layout,{"icon-size":_.marker.size/10}),"angle"in _.marker&&_.marker.angle!=="auto"&&S.extendFlat(W.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),W.layout["icon-allow-overlap"]=_.marker.allowoverlap,S.extendFlat(W.paint,{"icon-opacity":_.opacity*_.marker.opacity,"icon-color":_.marker.color})),z)){var ge=(_.marker||{}).size,_e=s(_.textposition,ge);S.extendFlat(W.layout,{"text-size":_.textfont.size,"text-anchor":_e.anchor,"text-offset":_e.offset,"text-font":k(_)}),S.extendFlat(W.paint,{"text-color":_.textfont.color,"text-opacity":_.opacity})}return ee};function d(I){return{type:I,geojson:L.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function y(I){var T=I[0].trace,E=T.marker,_=T.selectedpoints,h=S.isArrayOrTypedArray(E.color),m=S.isArrayOrTypedArray(E.size),w=S.isArrayOrTypedArray(E.opacity),F;function z(ge){return T.opacity*ge}function U(ge){return ge/2}var V;h&&(t.hasColorscale(T,"marker")?V=t.makeColorScaleFuncFromTrace(E):V=S.identity);var G;m&&(G=a(T));var j;w&&(j=function(ge){var _e=v(ge)?+S.constrain(ge,0,1):0;return z(_e)});var O=[];for(F=0;F850?F+=" Black":h>750?F+=" Extra Bold":h>650?F+=" Bold":h>550?F+=" Semi Bold":h>450?F+=" Medium":h>350?F+=" Regular":h>250?F+=" Light":h>150?F+=" Extra Light":F+=" Thin"):m.slice(0,2).join(" ")==="Open Sans"?(F="Open Sans",h>750?F+=" Extrabold":h>650?F+=" Bold":h>550?F+=" Semibold":h>350?F+=" Regular":F+=" Light"):m.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(F="Klokantech Noto Sans",m[3]==="CJK"&&(F+=" CJK"),F+=h>500?" Bold":" Regular")),w&&(F+=" Italic"),F==="Open Sans Regular Italic"?F="Open Sans Italic":F==="Open Sans Regular Bold"?F="Open Sans Bold":F==="Open Sans Regular Bold Italic"?F="Open Sans Bold Italic":F==="Klokantech Noto Sans Regular Italic"&&(F="Klokantech Noto Sans Italic"),i(F)||(F=E);var z=F.split(", ");return z}}}),dK=Re({"src/traces/scattermap/plot.js"(ae,K){var v=Rn(),S=hK(),M=Ww().traceLayerPrefix,L={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function t(a,l,i,s){this.type="scattermap",this.subplot=a,this.uid=l,this.clusterEnabled=i,this.isHidden=s,this.sourceIds={fill:"source-"+l+"-fill",line:"source-"+l+"-line",circle:"source-"+l+"-circle",symbol:"source-"+l+"-symbol",cluster:"source-"+l+"-circle",clusterCount:"source-"+l+"-circle"},this.layerIds={fill:M+l+"-fill",line:M+l+"-line",circle:M+l+"-circle",symbol:M+l+"-symbol",cluster:M+l+"-cluster",clusterCount:M+l+"-cluster-count"},this.below=null}var r=t.prototype;r.addSource=function(a,l,i){var s={type:"geojson",data:l.geojson};i&&i.enabled&&v.extendFlat(s,{cluster:!0,clusterMaxZoom:i.maxzoom});var o=this.subplot.map.getSource(this.sourceIds[a]);o?o.setData(l.geojson):this.subplot.map.addSource(this.sourceIds[a],s)},r.setSourceData=function(a,l){this.subplot.map.getSource(this.sourceIds[a]).setData(l.geojson)},r.addLayer=function(a,l,i){var s={type:l.type,id:this.layerIds[a],source:this.sourceIds[a],layout:l.layout,paint:l.paint};l.filter&&(s.filter=l.filter);for(var o=this.layerIds[a],c,p=this.subplot.getMapLayers(),d=0;d=0;w--){var F=m[w];o.removeLayer(g.layerIds[F])}h||o.removeSource(g.sourceIds.circle)}function x(h){for(var m=L.nonCluster,w=0;w=0;w--){var F=m[w];o.removeLayer(g.layerIds[F]),h||o.removeSource(g.sourceIds[F])}}function k(h){y?f(h):A(h)}function I(h){d?C(h):x(h)}function T(){for(var h=d?L.cluster:L.nonCluster,m=0;m=0;s--){var o=i[s];l.removeLayer(this.layerIds[o]),l.removeSource(this.sourceIds[o])}},K.exports=function(l,i){var s=i[0].trace,o=s.cluster&&s.cluster.enabled,c=s.visible!==!0,p=new t(l,s.uid,o,c),d=S(l.gd,i),y=p.below=l.belowLookup["trace-"+s.uid],g,C,f;if(o)for(p.addSource("circle",d.circle,s.cluster),g=0;g=0?Math.floor((s+180)/360):Math.ceil((s-180)/360),I=k*360,T=s-I;function E(G){var j=G.lonlat;if(j[0]===t||x&&C.indexOf(G.i+1)===-1)return 1/0;var O=S.modHalf(j[0],360),H=j[1],W=g.project([O,H]),ee=W.x-d.c2p([T,H]),ue=W.y-y.c2p([O,o]),xe=Math.max(3,G.mrc||0);return Math.max(Math.sqrt(ee*ee+ue*ue)-xe,1-3/xe)}if(v.getClosest(c,E,i),i.index!==!1){var _=c[i.index],h=_.lonlat,m=[S.modHalf(h[0],360)+I,h[1]],w=d.c2p(m),F=y.c2p(m),z=_.mrc||1;i.x0=w-z,i.x1=w+z,i.y0=F-z,i.y1=F+z;var U={};U[p.subplot]={_subplot:g};var V=p._module.formatLabels(_,p,U);return i.lonLabel=V.lonLabel,i.latLabel=V.latLabel,i.color=M(p,_),i.extraText=l(p,_,c[0].t.labels),i.hovertemplate=p.hovertemplate,[i]}}function l(i,s,o){if(i.hovertemplate)return;var c=s.hi||i.hoverinfo,p=c.split("+"),d=p.indexOf("all")!==-1,y=p.indexOf("lon")!==-1,g=p.indexOf("lat")!==-1,C=s.lonlat,f=[];function x(A){return A+"°"}return d||y&&g?f.push("("+x(C[1])+", "+x(C[0])+")"):y?f.push(o.lon+x(C[0])):g&&f.push(o.lat+x(C[1])),(d||p.indexOf("text")!==-1)&&L(s,i,f),f.join("
")}K.exports={hoverPoints:a,getExtraText:l}}}),pK=Re({"src/traces/scattermap/event_data.js"(ae,K){K.exports=function(S,M){return S.lon=M.lon,S.lat=M.lat,S}}}),vK=Re({"src/traces/scattermap/select.js"(ae,K){var v=Rn(),S=Mu(),M=Ia().BADNUM;K.exports=function(t,r){var a=t.cd,l=t.xaxis,i=t.yaxis,s=[],o=a[0].trace,c;if(!S.hasMarkers(o))return[];if(r===!1)for(c=0;c1)return 1;for(var oe=Q,Ee=0;Ee<8;Ee++){var Ge=this.sampleCurveX(oe)-Q;if(Math.abs(Ge)Ge?st=oe:kt=oe,oe=.5*(kt-st)+st;return oe},solve:function(Q,B){return this.sampleCurveY(this.solveCurveX(Q,B))}};var p=a(o);let d,y;function g(){return d==null&&(d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),d}function C(){if(y==null&&(y=!1,g())){const B=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(B){for(let Ee=0;Ee<25;Ee++){const Ge=4*Ee;B.fillStyle=`rgb(${Ge},${Ge+1},${Ge+2})`,B.fillRect(Ee%5,Math.floor(Ee/5),1,1)}const oe=B.getImageData(0,0,5,5).data;for(let Ee=0;Ee<100;Ee++)if(Ee%4!=3&&oe[Ee]!==Ee){y=!0;break}}}return y||!1}function f(Q,B,oe,Ee){const Ge=new p(Q,B,oe,Ee);return rt=>Ge.solve(rt)}const x=f(.25,.1,.25,1);function A(Q,B,oe){return Math.min(oe,Math.max(B,Q))}function k(Q,B,oe){const Ee=oe-B,Ge=((Q-B)%Ee+Ee)%Ee+B;return Ge===B?oe:Ge}function I(Q,...B){for(const oe of B)for(const Ee in oe)Q[Ee]=oe[Ee];return Q}let T=1;function E(Q,B,oe){const Ee={};for(const Ge in Q)Ee[Ge]=B.call(this,Q[Ge],Ge,Q);return Ee}function _(Q,B,oe){const Ee={};for(const Ge in Q)B.call(this,Q[Ge],Ge,Q)&&(Ee[Ge]=Q[Ge]);return Ee}function h(Q){return Array.isArray(Q)?Q.map(h):typeof Q=="object"&&Q?E(Q,h):Q}const m={};function w(Q){m[Q]||(typeof console<"u"&&console.warn(Q),m[Q]=!0)}function F(Q,B,oe){return(oe.y-Q.y)*(B.x-Q.x)>(B.y-Q.y)*(oe.x-Q.x)}function z(Q){return typeof WorkerGlobalScope<"u"&&Q!==void 0&&Q instanceof WorkerGlobalScope}let U=null;function V(Q){return typeof ImageBitmap<"u"&&Q instanceof ImageBitmap}const G="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function j(Q,B,oe,Ee,Ge){return r(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const rt=new VideoFrame(Q,{timestamp:0});try{const st=rt?.format;if(!st||!st.startsWith("BGR")&&!st.startsWith("RGB"))throw new Error(`Unrecognized format ${st}`);const kt=st.startsWith("BGR"),Ht=new Uint8ClampedArray(Ee*Ge*4);if(yield rt.copyTo(Ht,(function(sr,Er,Pr,nn,pn){const Cn=4*Math.max(-Er,0),Bn=(Math.max(0,Pr)-Pr)*nn*4+Cn,ta=4*nn,Da=Math.max(0,Er),Di=Math.max(0,Pr);return{rect:{x:Da,y:Di,width:Math.min(sr.width,Er+nn)-Da,height:Math.min(sr.height,Pr+pn)-Di},layout:[{offset:Bn,stride:ta}]}})(Q,B,oe,Ee,Ge)),kt)for(let sr=0;srz(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,se=function(Q,B){if(/:\/\//.test(Q.url)&&!/^https?:|^file:/.test(Q.url)){const Ee=xe(Q.url);if(Ee)return Ee(Q,B);if(z(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Q,targetMapId:ge},B)}if(!(/^file:/.test(oe=Q.url)||/^file:/.test(Y())&&!/^\w+:/.test(oe))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(Ee,Ge){return r(this,void 0,void 0,function*(){const rt=new Request(Ee.url,{method:Ee.method||"GET",body:Ee.body,credentials:Ee.credentials,headers:Ee.headers,cache:Ee.cache,referrer:Y(),signal:Ge.signal});Ee.type!=="json"||rt.headers.has("Accept")||rt.headers.set("Accept","application/json");const st=yield fetch(rt);if(!st.ok){const sr=yield st.blob();throw new _e(st.status,st.statusText,Ee.url,sr)}let kt;kt=Ee.type==="arrayBuffer"||Ee.type==="image"?st.arrayBuffer():Ee.type==="json"?st.json():st.text();const Ht=yield kt;if(Ge.signal.aborted)throw ee();return{data:Ht,cacheControl:st.headers.get("Cache-Control"),expires:st.headers.get("Expires")}})})(Q,B);if(z(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Q,mustQueue:!0,targetMapId:ge},B)}var oe;return(function(Ee,Ge){return new Promise((rt,st)=>{var kt;const Ht=new XMLHttpRequest;Ht.open(Ee.method||"GET",Ee.url,!0),Ee.type!=="arrayBuffer"&&Ee.type!=="image"||(Ht.responseType="arraybuffer");for(const sr in Ee.headers)Ht.setRequestHeader(sr,Ee.headers[sr]);Ee.type==="json"&&(Ht.responseType="text",!((kt=Ee.headers)===null||kt===void 0)&&kt.Accept||Ht.setRequestHeader("Accept","application/json")),Ht.withCredentials=Ee.credentials==="include",Ht.onerror=()=>{st(new Error(Ht.statusText))},Ht.onload=()=>{if(!Ge.signal.aborted)if((Ht.status>=200&&Ht.status<300||Ht.status===0)&&Ht.response!==null){let sr=Ht.response;if(Ee.type==="json")try{sr=JSON.parse(Ht.response)}catch(Er){return void st(Er)}rt({data:sr,cacheControl:Ht.getResponseHeader("Cache-Control"),expires:Ht.getResponseHeader("Expires")})}else{const sr=new Blob([Ht.response],{type:Ht.getResponseHeader("Content-Type")});st(new _e(Ht.status,Ht.statusText,Ee.url,sr))}},Ge.signal.addEventListener("abort",()=>{Ht.abort(),st(ee())}),Ht.send(Ee.body)})})(Q,B)};function ce(Q){if(!Q||Q.indexOf("://")<=0||Q.indexOf("data:image/")===0||Q.indexOf("blob:")===0)return!0;const B=new URL(Q),oe=window.location;return B.protocol===oe.protocol&&B.host===oe.host}function ne(Q,B,oe){oe[Q]&&oe[Q].indexOf(B)!==-1||(oe[Q]=oe[Q]||[],oe[Q].push(B))}function ye(Q,B,oe){if(oe&&oe[Q]){const Ee=oe[Q].indexOf(B);Ee!==-1&&oe[Q].splice(Ee,1)}}class le{constructor(B,oe={}){I(this,oe),this.type=B}}class Z extends le{constructor(B,oe={}){super("error",I({error:B},oe))}}class de{on(B,oe){return this._listeners=this._listeners||{},ne(B,oe,this._listeners),this}off(B,oe){return ye(B,oe,this._listeners),ye(B,oe,this._oneTimeListeners),this}once(B,oe){return oe?(this._oneTimeListeners=this._oneTimeListeners||{},ne(B,oe,this._oneTimeListeners),this):new Promise(Ee=>this.once(B,Ee))}fire(B,oe){typeof B=="string"&&(B=new le(B,oe||{}));const Ee=B.type;if(this.listens(Ee)){B.target=this;const Ge=this._listeners&&this._listeners[Ee]?this._listeners[Ee].slice():[];for(const kt of Ge)kt.call(this,B);const rt=this._oneTimeListeners&&this._oneTimeListeners[Ee]?this._oneTimeListeners[Ee].slice():[];for(const kt of rt)ye(Ee,kt,this._oneTimeListeners),kt.call(this,B);const st=this._eventedParent;st&&(I(B,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),st.fire(B))}else B instanceof Z&&console.error(B.error);return this}listens(B){return this._listeners&&this._listeners[B]&&this._listeners[B].length>0||this._oneTimeListeners&&this._oneTimeListeners[B]&&this._oneTimeListeners[B].length>0||this._eventedParent&&this._eventedParent.listens(B)}setEventedParent(B,oe){return this._eventedParent=B,this._eventedParentData=oe,this}}var pe={$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"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},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"},volatile:{type:"boolean",default:!1},"*":{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"},volatile:{type:"boolean",default:!1},"*":{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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{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",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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":{}}},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},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}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},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"}}};const Te=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ne(Q,B){const oe={};for(const Ee in Q)Ee!=="ref"&&(oe[Ee]=Q[Ee]);return Te.forEach(Ee=>{Ee in B&&(oe[Ee]=B[Ee])}),oe}function $e(Q,B){if(Array.isArray(Q)){if(!Array.isArray(B)||Q.length!==B.length)return!1;for(let oe=0;oe`:Q.itemType.kind==="value"?"array":`array<${B}>`}return Q.kind}const Be=[At,vt,Kt,Qt,fr,fn,mr,et(Ur),Fr,Qr,Bt];function Ie(Q,B){if(B.kind==="error")return null;if(Q.kind==="array"){if(B.kind==="array"&&(B.N===0&&B.itemType.kind==="value"||!Ie(Q.itemType,B.itemType))&&(typeof Q.N!="number"||Q.N===B.N))return null}else{if(Q.kind===B.kind)return null;if(Q.kind==="value"){for(const oe of Be)if(!Ie(oe,B))return null}}return`Expected ${ut(Q)} but found ${ut(B)} instead.`}function ke(Q,B){return B.some(oe=>oe.kind===Q.kind)}function Fe(Q,B){return B.some(oe=>oe==="null"?Q===null:oe==="array"?Array.isArray(Q):oe==="object"?Q&&!Array.isArray(Q)&&typeof Q=="object":oe===typeof Q)}function at(Q,B){return Q.kind==="array"&&B.kind==="array"?Q.itemType.kind===B.itemType.kind&&typeof Q.N=="number":Q.kind===B.kind}const ct=.96422,Gt=.82521,Vt=4/29,Zt=6/29,ur=3*Zt*Zt,Dr=Zt*Zt*Zt,kr=Math.PI/180,Sr=180/Math.PI;function Jr(Q){return(Q%=360)<0&&(Q+=360),Q}function jn([Q,B,oe,Ee]){let Ge,rt;const st=oa((.2225045*(Q=ha(Q))+.7168786*(B=ha(B))+.0606169*(oe=ha(oe)))/1);Q===B&&B===oe?Ge=rt=st:(Ge=oa((.4360747*Q+.3850649*B+.1430804*oe)/ct),rt=oa((.0139322*Q+.0971045*B+.7141733*oe)/Gt));const kt=116*st-16;return[kt<0?0:kt,500*(Ge-st),200*(st-rt),Ee]}function ha(Q){return Q<=.04045?Q/12.92:Math.pow((Q+.055)/1.055,2.4)}function oa(Q){return Q>Dr?Math.pow(Q,1/3):Q/ur+Vt}function _a([Q,B,oe,Ee]){let Ge=(Q+16)/116,rt=isNaN(B)?Ge:Ge+B/500,st=isNaN(oe)?Ge:Ge-oe/200;return Ge=1*ra(Ge),rt=ct*ra(rt),st=Gt*ra(st),[xa(3.1338561*rt-1.6168667*Ge-.4906146*st),xa(-.9787684*rt+1.9161415*Ge+.033454*st),xa(.0719453*rt-.2289914*Ge+1.4052427*st),Ee]}function xa(Q){return(Q=Q<=.00304?12.92*Q:1.055*Math.pow(Q,1/2.4)-.055)<0?0:Q>1?1:Q}function ra(Q){return Q>Zt?Q*Q*Q:ur*(Q-Vt)}function Ha(Q){return parseInt(Q.padEnd(2,Q),16)/255}function ci(Q,B){return _r(B?Q/100:Q,0,1)}function _r(Q,B,oe){return Math.min(Math.max(B,Q),oe)}function rr(Q){return!Q.some(Number.isNaN)}const yr={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]};class br{constructor(B,oe,Ee,Ge=1,rt=!0){this.r=B,this.g=oe,this.b=Ee,this.a=Ge,rt||(this.r*=Ge,this.g*=Ge,this.b*=Ge,Ge||this.overwriteGetter("rgb",[B,oe,Ee,Ge]))}static parse(B){if(B instanceof br)return B;if(typeof B!="string")return;const oe=(function(Ee){if((Ee=Ee.toLowerCase().trim())==="transparent")return[0,0,0,0];const Ge=yr[Ee];if(Ge){const[st,kt,Ht]=Ge;return[st/255,kt/255,Ht/255,1]}if(Ee.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(Ee)){const st=Ee.length<6?1:2;let kt=1;return[Ha(Ee.slice(kt,kt+=st)),Ha(Ee.slice(kt,kt+=st)),Ha(Ee.slice(kt,kt+=st)),Ha(Ee.slice(kt,kt+st)||"ff")]}if(Ee.startsWith("rgb")){const st=Ee.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(st){const[kt,Ht,sr,Er,Pr,nn,pn,Cn,Bn,ta,Da,Di]=st,ni=[Er||" ",pn||" ",ta].join("");if(ni===" "||ni===" /"||ni===",,"||ni===",,,"){const Ti=[sr,nn,Bn].join(""),uo=Ti==="%%%"?100:Ti===""?255:0;if(uo){const Oo=[_r(+Ht/uo,0,1),_r(+Pr/uo,0,1),_r(+Cn/uo,0,1),Da?ci(+Da,Di):1];if(rr(Oo))return Oo}}return}}const rt=Ee.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(rt){const[st,kt,Ht,sr,Er,Pr,nn,pn,Cn]=rt,Bn=[Ht||" ",Er||" ",nn].join("");if(Bn===" "||Bn===" /"||Bn===",,"||Bn===",,,"){const ta=[+kt,_r(+sr,0,100),_r(+Pr,0,100),pn?ci(+pn,Cn):1];if(rr(ta))return(function([Da,Di,ni,Ti]){function uo(Oo){const ms=(Oo+Da/30)%12,zl=Di*Math.min(ni,1-ni);return ni-zl*Math.max(-1,Math.min(ms-3,9-ms,1))}return Da=Jr(Da),Di/=100,ni/=100,[uo(0),uo(8),uo(4),Ti]})(ta)}}})(B);return oe?new br(...oe,!1):void 0}get rgb(){const{r:B,g:oe,b:Ee,a:Ge}=this,rt=Ge||1/0;return this.overwriteGetter("rgb",[B/rt,oe/rt,Ee/rt,Ge])}get hcl(){return this.overwriteGetter("hcl",(function(B){const[oe,Ee,Ge,rt]=jn(B),st=Math.sqrt(Ee*Ee+Ge*Ge);return[Math.round(1e4*st)?Jr(Math.atan2(Ge,Ee)*Sr):NaN,st,oe,rt]})(this.rgb))}get lab(){return this.overwriteGetter("lab",jn(this.rgb))}overwriteGetter(B,oe){return Object.defineProperty(this,B,{value:oe}),oe}toString(){const[B,oe,Ee,Ge]=this.rgb;return`rgba(${[B,oe,Ee].map(rt=>Math.round(255*rt)).join(",")},${Ge})`}}br.black=new br(0,0,0,1),br.white=new br(1,1,1,1),br.transparent=new br(0,0,0,0),br.red=new br(1,0,0,1);class an{constructor(B,oe,Ee){this.sensitivity=B?oe?"variant":"case":oe?"accent":"base",this.locale=Ee,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(B,oe){return this.collator.compare(B,oe)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class bn{constructor(B,oe,Ee,Ge,rt){this.text=B,this.image=oe,this.scale=Ee,this.fontStack=Ge,this.textColor=rt}}class In{constructor(B){this.sections=B}static fromString(B){return new In([new bn(B,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(B=>B.text.length!==0||B.image&&B.image.name.length!==0)}static factory(B){return B instanceof In?B:In.fromString(B)}toString(){return this.sections.length===0?"":this.sections.map(B=>B.text).join("")}}class Fn{constructor(B){this.values=B.slice()}static parse(B){if(B instanceof Fn)return B;if(typeof B=="number")return new Fn([B,B,B,B]);if(Array.isArray(B)&&!(B.length<1||B.length>4)){for(const oe of B)if(typeof oe!="number")return;switch(B.length){case 1:B=[B[0],B[0],B[0],B[0]];break;case 2:B=[B[0],B[1],B[0],B[1]];break;case 3:B=[B[0],B[1],B[2],B[1]]}return new Fn(B)}}toString(){return JSON.stringify(this.values)}}const va=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Pa{constructor(B){this.values=B.slice()}static parse(B){if(B instanceof Pa)return B;if(Array.isArray(B)&&!(B.length<1)&&B.length%2==0){for(let oe=0;oe=0&&Q<=255&&typeof B=="number"&&B>=0&&B<=255&&typeof oe=="number"&&oe>=0&&oe<=255?Ee===void 0||typeof Ee=="number"&&Ee>=0&&Ee<=1?null:`Invalid rgba value [${[Q,B,oe,Ee].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof Ee=="number"?[Q,B,oe,Ee]:[Q,B,oe]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Wa(Q){if(Q===null||typeof Q=="string"||typeof Q=="boolean"||typeof Q=="number"||Q instanceof br||Q instanceof an||Q instanceof In||Q instanceof Fn||Q instanceof Pa||Q instanceof La)return!0;if(Array.isArray(Q)){for(const B of Q)if(!Wa(B))return!1;return!0}if(typeof Q=="object"){for(const B in Q)if(!Wa(Q[B]))return!1;return!0}return!1}function sa(Q){if(Q===null)return At;if(typeof Q=="string")return Kt;if(typeof Q=="boolean")return Qt;if(typeof Q=="number")return vt;if(Q instanceof br)return fr;if(Q instanceof an)return Br;if(Q instanceof In)return fn;if(Q instanceof Fn)return Fr;if(Q instanceof Pa)return Bt;if(Q instanceof La)return Qr;if(Array.isArray(Q)){const B=Q.length;let oe;for(const Ee of Q){const Ge=sa(Ee);if(oe){if(oe===Ge)continue;oe=Ur;break}oe=Ge}return et(oe||Ur,B)}return mr}function ji(Q){const B=typeof Q;return Q===null?"":B==="string"||B==="number"||B==="boolean"?String(Q):Q instanceof br||Q instanceof In||Q instanceof Fn||Q instanceof Pa||Q instanceof La?Q.toString():JSON.stringify(Q)}class Qi{constructor(B,oe){this.type=B,this.value=oe}static parse(B,oe){if(B.length!==2)return oe.error(`'literal' expression requires exactly one argument, but found ${B.length-1} instead.`);if(!Wa(B[1]))return oe.error("invalid value");const Ee=B[1];let Ge=sa(Ee);const rt=oe.expectedType;return Ge.kind!=="array"||Ge.N!==0||!rt||rt.kind!=="array"||typeof rt.N=="number"&&rt.N!==0||(Ge=rt),new Qi(Ge,Ee)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Xt{constructor(B){this.name="ExpressionEvaluationError",this.message=B}toJSON(){return this.message}}const Lt={string:Kt,number:vt,boolean:Qt,object:mr};class $r{constructor(B,oe){this.type=B,this.args=oe}static parse(B,oe){if(B.length<2)return oe.error("Expected at least one argument.");let Ee,Ge=1;const rt=B[0];if(rt==="array"){let kt,Ht;if(B.length>2){const sr=B[1];if(typeof sr!="string"||!(sr in Lt)||sr==="object")return oe.error('The item type argument of "array" must be one of string, number, boolean',1);kt=Lt[sr],Ge++}else kt=Ur;if(B.length>3){if(B[2]!==null&&(typeof B[2]!="number"||B[2]<0||B[2]!==Math.floor(B[2])))return oe.error('The length argument to "array" must be a positive integer literal',2);Ht=B[2],Ge++}Ee=et(kt,Ht)}else{if(!Lt[rt])throw new Error(`Types doesn't contain name = ${rt}`);Ee=Lt[rt]}const st=[];for(;GeB.outputDefined())}}const en={"to-boolean":Qt,"to-color":fr,"to-number":vt,"to-string":Kt};class rn{constructor(B,oe){this.type=B,this.args=oe}static parse(B,oe){if(B.length<2)return oe.error("Expected at least one argument.");const Ee=B[0];if(!en[Ee])throw new Error(`Can't parse ${Ee} as it is not part of the known types`);if((Ee==="to-boolean"||Ee==="to-string")&&B.length!==2)return oe.error("Expected one argument.");const Ge=en[Ee],rt=[];for(let st=1;st4?`Invalid rbga value ${JSON.stringify(oe)}: expected an array containing either three or four numeric values.`:Oa(oe[0],oe[1],oe[2],oe[3]),!Ee))return new br(oe[0]/255,oe[1]/255,oe[2]/255,oe[3])}throw new Xt(Ee||`Could not parse color from value '${typeof oe=="string"?oe:JSON.stringify(oe)}'`)}case"padding":{let oe;for(const Ee of this.args){oe=Ee.evaluate(B);const Ge=Fn.parse(oe);if(Ge)return Ge}throw new Xt(`Could not parse padding from value '${typeof oe=="string"?oe:JSON.stringify(oe)}'`)}case"variableAnchorOffsetCollection":{let oe;for(const Ee of this.args){oe=Ee.evaluate(B);const Ge=Pa.parse(oe);if(Ge)return Ge}throw new Xt(`Could not parse variableAnchorOffsetCollection from value '${typeof oe=="string"?oe:JSON.stringify(oe)}'`)}case"number":{let oe=null;for(const Ee of this.args){if(oe=Ee.evaluate(B),oe===null)return 0;const Ge=Number(oe);if(!isNaN(Ge))return Ge}throw new Xt(`Could not convert ${JSON.stringify(oe)} to number.`)}case"formatted":return In.fromString(ji(this.args[0].evaluate(B)));case"resolvedImage":return La.fromString(ji(this.args[0].evaluate(B)));default:return ji(this.args[0].evaluate(B))}}eachChild(B){this.args.forEach(B)}outputDefined(){return this.args.every(B=>B.outputDefined())}}const Wr=["Unknown","Point","LineString","Polygon"];class tn{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Wr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(B){let oe=this._parseColorCache[B];return oe||(oe=this._parseColorCache[B]=br.parse(B)),oe}}class wn{constructor(B,oe,Ee=[],Ge,rt=new _t,st=[]){this.registry=B,this.path=Ee,this.key=Ee.map(kt=>`[${kt}]`).join(""),this.scope=rt,this.errors=st,this.expectedType=Ge,this._isConstant=oe}parse(B,oe,Ee,Ge,rt={}){return oe?this.concat(oe,Ee,Ge)._parse(B,rt):this._parse(B,rt)}_parse(B,oe){function Ee(Ge,rt,st){return st==="assert"?new $r(rt,[Ge]):st==="coerce"?new rn(rt,[Ge]):Ge}if(B!==null&&typeof B!="string"&&typeof B!="boolean"&&typeof B!="number"||(B=["literal",B]),Array.isArray(B)){if(B.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const Ge=B[0];if(typeof Ge!="string")return this.error(`Expression name must be a string, but found ${typeof Ge} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const rt=this.registry[Ge];if(rt){let st=rt.parse(B,this);if(!st)return null;if(this.expectedType){const kt=this.expectedType,Ht=st.type;if(kt.kind!=="string"&&kt.kind!=="number"&&kt.kind!=="boolean"&&kt.kind!=="object"&&kt.kind!=="array"||Ht.kind!=="value")if(kt.kind!=="color"&&kt.kind!=="formatted"&&kt.kind!=="resolvedImage"||Ht.kind!=="value"&&Ht.kind!=="string")if(kt.kind!=="padding"||Ht.kind!=="value"&&Ht.kind!=="number"&&Ht.kind!=="array")if(kt.kind!=="variableAnchorOffsetCollection"||Ht.kind!=="value"&&Ht.kind!=="array"){if(this.checkSubtype(kt,Ht))return null}else st=Ee(st,kt,oe.typeAnnotation||"coerce");else st=Ee(st,kt,oe.typeAnnotation||"coerce");else st=Ee(st,kt,oe.typeAnnotation||"coerce");else st=Ee(st,kt,oe.typeAnnotation||"assert")}if(!(st instanceof Qi)&&st.type.kind!=="resolvedImage"&&this._isConstant(st)){const kt=new tn;try{st=new Qi(st.type,st.evaluate(kt))}catch(Ht){return this.error(Ht.message),null}}return st}return this.error(`Unknown expression "${Ge}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(B===void 0?"'undefined' value invalid. Use null instead.":typeof B=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof B} instead.`)}concat(B,oe,Ee){const Ge=typeof B=="number"?this.path.concat(B):this.path,rt=Ee?this.scope.concat(Ee):this.scope;return new wn(this.registry,this._isConstant,Ge,oe||null,rt,this.errors)}error(B,...oe){const Ee=`${this.key}${oe.map(Ge=>`[${Ge}]`).join("")}`;this.errors.push(new Je(Ee,B))}checkSubtype(B,oe){const Ee=Ie(B,oe);return Ee&&this.error(Ee),Ee}}class dn{constructor(B,oe){this.type=oe.type,this.bindings=[].concat(B),this.result=oe}evaluate(B){return this.result.evaluate(B)}eachChild(B){for(const oe of this.bindings)B(oe[1]);B(this.result)}static parse(B,oe){if(B.length<4)return oe.error(`Expected at least 3 arguments, but found ${B.length-1} instead.`);const Ee=[];for(let rt=1;rt=Ee.length)throw new Xt(`Array index out of bounds: ${oe} > ${Ee.length-1}.`);if(oe!==Math.floor(oe))throw new Xt(`Array index must be an integer, but found ${oe} instead.`);return Ee[oe]}eachChild(B){B(this.index),B(this.input)}outputDefined(){return!1}}class Xr{constructor(B,oe){this.type=Qt,this.needle=B,this.haystack=oe}static parse(B,oe){if(B.length!==3)return oe.error(`Expected 2 arguments, but found ${B.length-1} instead.`);const Ee=oe.parse(B[1],1,Ur),Ge=oe.parse(B[2],2,Ur);return Ee&&Ge?ke(Ee.type,[Qt,Kt,vt,At,Ur])?new Xr(Ee,Ge):oe.error(`Expected first argument to be of type boolean, string, number or null, but found ${ut(Ee.type)} instead`):null}evaluate(B){const oe=this.needle.evaluate(B),Ee=this.haystack.evaluate(B);if(!Ee)return!1;if(!Fe(oe,["boolean","string","number","null"]))throw new Xt(`Expected first argument to be of type boolean, string, number or null, but found ${ut(sa(oe))} instead.`);if(!Fe(Ee,["string","array"]))throw new Xt(`Expected second argument to be of type array or string, but found ${ut(sa(Ee))} instead.`);return Ee.indexOf(oe)>=0}eachChild(B){B(this.needle),B(this.haystack)}outputDefined(){return!0}}class Tn{constructor(B,oe,Ee){this.type=vt,this.needle=B,this.haystack=oe,this.fromIndex=Ee}static parse(B,oe){if(B.length<=2||B.length>=5)return oe.error(`Expected 3 or 4 arguments, but found ${B.length-1} instead.`);const Ee=oe.parse(B[1],1,Ur),Ge=oe.parse(B[2],2,Ur);if(!Ee||!Ge)return null;if(!ke(Ee.type,[Qt,Kt,vt,At,Ur]))return oe.error(`Expected first argument to be of type boolean, string, number or null, but found ${ut(Ee.type)} instead`);if(B.length===4){const rt=oe.parse(B[3],3,vt);return rt?new Tn(Ee,Ge,rt):null}return new Tn(Ee,Ge)}evaluate(B){const oe=this.needle.evaluate(B),Ee=this.haystack.evaluate(B);if(!Fe(oe,["boolean","string","number","null"]))throw new Xt(`Expected first argument to be of type boolean, string, number or null, but found ${ut(sa(oe))} instead.`);let Ge;if(this.fromIndex&&(Ge=this.fromIndex.evaluate(B)),Fe(Ee,["string"])){const rt=Ee.indexOf(oe,Ge);return rt===-1?-1:[...Ee.slice(0,rt)].length}if(Fe(Ee,["array"]))return Ee.indexOf(oe,Ge);throw new Xt(`Expected second argument to be of type array or string, but found ${ut(sa(Ee))} instead.`)}eachChild(B){B(this.needle),B(this.haystack),this.fromIndex&&B(this.fromIndex)}outputDefined(){return!1}}class Xn{constructor(B,oe,Ee,Ge,rt,st){this.inputType=B,this.type=oe,this.input=Ee,this.cases=Ge,this.outputs=rt,this.otherwise=st}static parse(B,oe){if(B.length<5)return oe.error(`Expected at least 4 arguments, but found only ${B.length-1}.`);if(B.length%2!=1)return oe.error("Expected an even number of arguments.");let Ee,Ge;oe.expectedType&&oe.expectedType.kind!=="value"&&(Ge=oe.expectedType);const rt={},st=[];for(let sr=2;srNumber.MAX_SAFE_INTEGER)return nn.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Cn=="number"&&Math.floor(Cn)!==Cn)return nn.error("Numeric branch labels must be integer values.");if(Ee){if(nn.checkSubtype(Ee,sa(Cn)))return null}else Ee=sa(Cn);if(rt[String(Cn)]!==void 0)return nn.error("Branch labels must be unique.");rt[String(Cn)]=st.length}const pn=oe.parse(Pr,sr,Ge);if(!pn)return null;Ge=Ge||pn.type,st.push(pn)}const kt=oe.parse(B[1],1,Ur);if(!kt)return null;const Ht=oe.parse(B[B.length-1],B.length-1,Ge);return Ht?kt.type.kind!=="value"&&oe.concat(1).checkSubtype(Ee,kt.type)?null:new Xn(Ee,Ge,kt,rt,st,Ht):null}evaluate(B){const oe=this.input.evaluate(B);return(sa(oe)===this.inputType&&this.outputs[this.cases[oe]]||this.otherwise).evaluate(B)}eachChild(B){B(this.input),this.outputs.forEach(B),B(this.otherwise)}outputDefined(){return this.outputs.every(B=>B.outputDefined())&&this.otherwise.outputDefined()}}class ia{constructor(B,oe,Ee){this.type=B,this.branches=oe,this.otherwise=Ee}static parse(B,oe){if(B.length<4)return oe.error(`Expected at least 3 arguments, but found only ${B.length-1}.`);if(B.length%2!=0)return oe.error("Expected an odd number of arguments.");let Ee;oe.expectedType&&oe.expectedType.kind!=="value"&&(Ee=oe.expectedType);const Ge=[];for(let st=1;stoe.outputDefined())&&this.otherwise.outputDefined()}}class na{constructor(B,oe,Ee,Ge){this.type=B,this.input=oe,this.beginIndex=Ee,this.endIndex=Ge}static parse(B,oe){if(B.length<=2||B.length>=5)return oe.error(`Expected 3 or 4 arguments, but found ${B.length-1} instead.`);const Ee=oe.parse(B[1],1,Ur),Ge=oe.parse(B[2],2,vt);if(!Ee||!Ge)return null;if(!ke(Ee.type,[et(Ur),Kt,Ur]))return oe.error(`Expected first argument to be of type array or string, but found ${ut(Ee.type)} instead`);if(B.length===4){const rt=oe.parse(B[3],3,vt);return rt?new na(Ee.type,Ee,Ge,rt):null}return new na(Ee.type,Ee,Ge)}evaluate(B){const oe=this.input.evaluate(B),Ee=this.beginIndex.evaluate(B);let Ge;if(this.endIndex&&(Ge=this.endIndex.evaluate(B)),Fe(oe,["string"]))return[...oe].slice(Ee,Ge).join("");if(Fe(oe,["array"]))return oe.slice(Ee,Ge);throw new Xt(`Expected first argument to be of type array or string, but found ${ut(sa(oe))} instead.`)}eachChild(B){B(this.input),B(this.beginIndex),this.endIndex&&B(this.endIndex)}outputDefined(){return!1}}function An(Q,B){const oe=Q.length-1;let Ee,Ge,rt=0,st=oe,kt=0;for(;rt<=st;)if(kt=Math.floor((rt+st)/2),Ee=Q[kt],Ge=Q[kt+1],Ee<=B){if(kt===oe||BB))throw new Xt("Input is not a number.");st=kt-1}return 0}class Yn{constructor(B,oe,Ee){this.type=B,this.input=oe,this.labels=[],this.outputs=[];for(const[Ge,rt]of Ee)this.labels.push(Ge),this.outputs.push(rt)}static parse(B,oe){if(B.length-1<4)return oe.error(`Expected at least 4 arguments, but found only ${B.length-1}.`);if((B.length-1)%2!=0)return oe.error("Expected an even number of arguments.");const Ee=oe.parse(B[1],1,vt);if(!Ee)return null;const Ge=[];let rt=null;oe.expectedType&&oe.expectedType.kind!=="value"&&(rt=oe.expectedType);for(let st=1;st=kt)return oe.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',sr);const Pr=oe.parse(Ht,Er,rt);if(!Pr)return null;rt=rt||Pr.type,Ge.push([kt,Pr])}return new Yn(rt,Ee,Ge)}evaluate(B){const oe=this.labels,Ee=this.outputs;if(oe.length===1)return Ee[0].evaluate(B);const Ge=this.input.evaluate(B);if(Ge<=oe[0])return Ee[0].evaluate(B);const rt=oe.length;return Ge>=oe[rt-1]?Ee[rt-1].evaluate(B):Ee[An(oe,Ge)].evaluate(B)}eachChild(B){B(this.input);for(const oe of this.outputs)B(oe)}outputDefined(){return this.outputs.every(B=>B.outputDefined())}}function qi(Q){return Q&&Q.__esModule&&Object.prototype.hasOwnProperty.call(Q,"default")?Q.default:Q}var Ga=to;function to(Q,B,oe,Ee){this.cx=3*Q,this.bx=3*(oe-Q)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*B,this.by=3*(Ee-B)-this.cy,this.ay=1-this.cy-this.by,this.p1x=Q,this.p1y=B,this.p2x=oe,this.p2y=Ee}to.prototype={sampleCurveX:function(Q){return((this.ax*Q+this.bx)*Q+this.cx)*Q},sampleCurveY:function(Q){return((this.ay*Q+this.by)*Q+this.cy)*Q},sampleCurveDerivativeX:function(Q){return(3*this.ax*Q+2*this.bx)*Q+this.cx},solveCurveX:function(Q,B){if(B===void 0&&(B=1e-6),Q<0)return 0;if(Q>1)return 1;for(var oe=Q,Ee=0;Ee<8;Ee++){var Ge=this.sampleCurveX(oe)-Q;if(Math.abs(Ge)Ge?st=oe:kt=oe,oe=.5*(kt-st)+st;return oe},solve:function(Q,B){return this.sampleCurveY(this.solveCurveX(Q,B))}};var _o=qi(Ga);function Po(Q,B,oe){return Q+oe*(B-Q)}function Ro(Q,B,oe){return Q.map((Ee,Ge)=>Po(Ee,B[Ge],oe))}const Xo={number:Po,color:function(Q,B,oe,Ee="rgb"){switch(Ee){case"rgb":{const[Ge,rt,st,kt]=Ro(Q.rgb,B.rgb,oe);return new br(Ge,rt,st,kt,!1)}case"hcl":{const[Ge,rt,st,kt]=Q.hcl,[Ht,sr,Er,Pr]=B.hcl;let nn,pn;if(isNaN(Ge)||isNaN(Ht))isNaN(Ge)?isNaN(Ht)?nn=NaN:(nn=Ht,st!==1&&st!==0||(pn=sr)):(nn=Ge,Er!==1&&Er!==0||(pn=rt));else{let Di=Ht-Ge;Ht>Ge&&Di>180?Di-=360:Ht180&&(Di+=360),nn=Ge+oe*Di}const[Cn,Bn,ta,Da]=(function([Di,ni,Ti,uo]){return Di=isNaN(Di)?0:Di*kr,_a([Ti,Math.cos(Di)*ni,Math.sin(Di)*ni,uo])})([nn,pn??Po(rt,sr,oe),Po(st,Er,oe),Po(kt,Pr,oe)]);return new br(Cn,Bn,ta,Da,!1)}case"lab":{const[Ge,rt,st,kt]=_a(Ro(Q.lab,B.lab,oe));return new br(Ge,rt,st,kt,!1)}}},array:Ro,padding:function(Q,B,oe){return new Fn(Ro(Q.values,B.values,oe))},variableAnchorOffsetCollection:function(Q,B,oe){const Ee=Q.values,Ge=B.values;if(Ee.length!==Ge.length)throw new Xt(`Cannot interpolate values of different length. from: ${Q.toString()}, to: ${B.toString()}`);const rt=[];for(let st=0;sttypeof Er!="number"||Er<0||Er>1))return oe.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Ge={name:"cubic-bezier",controlPoints:sr}}}if(B.length-1<4)return oe.error(`Expected at least 4 arguments, but found only ${B.length-1}.`);if((B.length-1)%2!=0)return oe.error("Expected an even number of arguments.");if(rt=oe.parse(rt,2,vt),!rt)return null;const kt=[];let Ht=null;Ee==="interpolate-hcl"||Ee==="interpolate-lab"?Ht=fr:oe.expectedType&&oe.expectedType.kind!=="value"&&(Ht=oe.expectedType);for(let sr=0;sr=Er)return oe.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',nn);const Cn=oe.parse(Pr,pn,Ht);if(!Cn)return null;Ht=Ht||Cn.type,kt.push([Er,Cn])}return at(Ht,vt)||at(Ht,fr)||at(Ht,Fr)||at(Ht,Bt)||at(Ht,et(vt))?new Oi(Ht,Ee,Ge,rt,kt):oe.error(`Type ${ut(Ht)} is not interpolatable.`)}evaluate(B){const oe=this.labels,Ee=this.outputs;if(oe.length===1)return Ee[0].evaluate(B);const Ge=this.input.evaluate(B);if(Ge<=oe[0])return Ee[0].evaluate(B);const rt=oe.length;if(Ge>=oe[rt-1])return Ee[rt-1].evaluate(B);const st=An(oe,Ge),kt=Oi.interpolationFactor(this.interpolation,Ge,oe[st],oe[st+1]),Ht=Ee[st].evaluate(B),sr=Ee[st+1].evaluate(B);switch(this.operator){case"interpolate":return Xo[this.type.kind](Ht,sr,kt);case"interpolate-hcl":return Xo.color(Ht,sr,kt,"hcl");case"interpolate-lab":return Xo.color(Ht,sr,kt,"lab")}}eachChild(B){B(this.input);for(const oe of this.outputs)B(oe)}outputDefined(){return this.outputs.every(B=>B.outputDefined())}}function bs(Q,B,oe,Ee){const Ge=Ee-oe,rt=Q-oe;return Ge===0?0:B===1?rt/Ge:(Math.pow(B,rt)-1)/(Math.pow(B,Ge)-1)}class cs{constructor(B,oe){this.type=B,this.args=oe}static parse(B,oe){if(B.length<2)return oe.error("Expectected at least one argument.");let Ee=null;const Ge=oe.expectedType;Ge&&Ge.kind!=="value"&&(Ee=Ge);const rt=[];for(const kt of B.slice(1)){const Ht=oe.parse(kt,1+rt.length,Ee,void 0,{typeAnnotation:"omit"});if(!Ht)return null;Ee=Ee||Ht.type,rt.push(Ht)}if(!Ee)throw new Error("No output type");const st=Ge&&rt.some(kt=>Ie(Ge,kt.type));return new cs(st?Ur:Ee,rt)}evaluate(B){let oe,Ee=null,Ge=0;for(const rt of this.args)if(Ge++,Ee=rt.evaluate(B),Ee&&Ee instanceof La&&!Ee.available&&(oe||(oe=Ee.name),Ee=null,Ge===this.args.length&&(Ee=oe)),Ee!==null)break;return Ee}eachChild(B){this.args.forEach(B)}outputDefined(){return this.args.every(B=>B.outputDefined())}}function fl(Q,B){return Q==="=="||Q==="!="?B.kind==="boolean"||B.kind==="string"||B.kind==="number"||B.kind==="null"||B.kind==="value":B.kind==="string"||B.kind==="number"||B.kind==="value"}function Is(Q,B,oe,Ee){return Ee.compare(B,oe)===0}function ys(Q,B,oe){const Ee=Q!=="=="&&Q!=="!=";return class YH{constructor(rt,st,kt){this.type=Qt,this.lhs=rt,this.rhs=st,this.collator=kt,this.hasUntypedArgument=rt.type.kind==="value"||st.type.kind==="value"}static parse(rt,st){if(rt.length!==3&&rt.length!==4)return st.error("Expected two or three arguments.");const kt=rt[0];let Ht=st.parse(rt[1],1,Ur);if(!Ht)return null;if(!fl(kt,Ht.type))return st.concat(1).error(`"${kt}" comparisons are not supported for type '${ut(Ht.type)}'.`);let sr=st.parse(rt[2],2,Ur);if(!sr)return null;if(!fl(kt,sr.type))return st.concat(2).error(`"${kt}" comparisons are not supported for type '${ut(sr.type)}'.`);if(Ht.type.kind!==sr.type.kind&&Ht.type.kind!=="value"&&sr.type.kind!=="value")return st.error(`Cannot compare types '${ut(Ht.type)}' and '${ut(sr.type)}'.`);Ee&&(Ht.type.kind==="value"&&sr.type.kind!=="value"?Ht=new $r(sr.type,[Ht]):Ht.type.kind!=="value"&&sr.type.kind==="value"&&(sr=new $r(Ht.type,[sr])));let Er=null;if(rt.length===4){if(Ht.type.kind!=="string"&&sr.type.kind!=="string"&&Ht.type.kind!=="value"&&sr.type.kind!=="value")return st.error("Cannot use collator to compare non-string types.");if(Er=st.parse(rt[3],3,Br),!Er)return null}return new YH(Ht,sr,Er)}evaluate(rt){const st=this.lhs.evaluate(rt),kt=this.rhs.evaluate(rt);if(Ee&&this.hasUntypedArgument){const Ht=sa(st),sr=sa(kt);if(Ht.kind!==sr.kind||Ht.kind!=="string"&&Ht.kind!=="number")throw new Xt(`Expected arguments for "${Q}" to be (string, string) or (number, number), but found (${Ht.kind}, ${sr.kind}) instead.`)}if(this.collator&&!Ee&&this.hasUntypedArgument){const Ht=sa(st),sr=sa(kt);if(Ht.kind!=="string"||sr.kind!=="string")return B(rt,st,kt)}return this.collator?oe(rt,st,kt,this.collator.evaluate(rt)):B(rt,st,kt)}eachChild(rt){rt(this.lhs),rt(this.rhs),this.collator&&rt(this.collator)}outputDefined(){return!0}}}const ss=ys("==",function(Q,B,oe){return B===oe},Is),hl=ys("!=",function(Q,B,oe){return B!==oe},function(Q,B,oe,Ee){return!Is(0,B,oe,Ee)}),ll=ys("<",function(Q,B,oe){return B",function(Q,B,oe){return B>oe},function(Q,B,oe,Ee){return Ee.compare(B,oe)>0}),Ls=ys("<=",function(Q,B,oe){return B<=oe},function(Q,B,oe,Ee){return Ee.compare(B,oe)<=0}),ps=ys(">=",function(Q,B,oe){return B>=oe},function(Q,B,oe,Ee){return Ee.compare(B,oe)>=0});class Uo{constructor(B,oe,Ee){this.type=Br,this.locale=Ee,this.caseSensitive=B,this.diacriticSensitive=oe}static parse(B,oe){if(B.length!==2)return oe.error("Expected one argument.");const Ee=B[1];if(typeof Ee!="object"||Array.isArray(Ee))return oe.error("Collator options argument must be an object.");const Ge=oe.parse(Ee["case-sensitive"]!==void 0&&Ee["case-sensitive"],1,Qt);if(!Ge)return null;const rt=oe.parse(Ee["diacritic-sensitive"]!==void 0&&Ee["diacritic-sensitive"],1,Qt);if(!rt)return null;let st=null;return Ee.locale&&(st=oe.parse(Ee.locale,1,Kt),!st)?null:new Uo(Ge,rt,st)}evaluate(B){return new an(this.caseSensitive.evaluate(B),this.diacriticSensitive.evaluate(B),this.locale?this.locale.evaluate(B):null)}eachChild(B){B(this.caseSensitive),B(this.diacriticSensitive),this.locale&&B(this.locale)}outputDefined(){return!1}}class Rs{constructor(B,oe,Ee,Ge,rt){this.type=Kt,this.number=B,this.locale=oe,this.currency=Ee,this.minFractionDigits=Ge,this.maxFractionDigits=rt}static parse(B,oe){if(B.length!==3)return oe.error("Expected two arguments.");const Ee=oe.parse(B[1],1,vt);if(!Ee)return null;const Ge=B[2];if(typeof Ge!="object"||Array.isArray(Ge))return oe.error("NumberFormat options argument must be an object.");let rt=null;if(Ge.locale&&(rt=oe.parse(Ge.locale,1,Kt),!rt))return null;let st=null;if(Ge.currency&&(st=oe.parse(Ge.currency,1,Kt),!st))return null;let kt=null;if(Ge["min-fraction-digits"]&&(kt=oe.parse(Ge["min-fraction-digits"],1,vt),!kt))return null;let Ht=null;return Ge["max-fraction-digits"]&&(Ht=oe.parse(Ge["max-fraction-digits"],1,vt),!Ht)?null:new Rs(Ee,rt,st,kt,Ht)}evaluate(B){return new Intl.NumberFormat(this.locale?this.locale.evaluate(B):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(B):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(B):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(B):void 0}).format(this.number.evaluate(B))}eachChild(B){B(this.number),this.locale&&B(this.locale),this.currency&&B(this.currency),this.minFractionDigits&&B(this.minFractionDigits),this.maxFractionDigits&&B(this.maxFractionDigits)}outputDefined(){return!1}}class Ll{constructor(B){this.type=fn,this.sections=B}static parse(B,oe){if(B.length<2)return oe.error("Expected at least one argument.");const Ee=B[1];if(!Array.isArray(Ee)&&typeof Ee=="object")return oe.error("First argument must be an image or text section.");const Ge=[];let rt=!1;for(let st=1;st<=B.length-1;++st){const kt=B[st];if(rt&&typeof kt=="object"&&!Array.isArray(kt)){rt=!1;let Ht=null;if(kt["font-scale"]&&(Ht=oe.parse(kt["font-scale"],1,vt),!Ht))return null;let sr=null;if(kt["text-font"]&&(sr=oe.parse(kt["text-font"],1,et(Kt)),!sr))return null;let Er=null;if(kt["text-color"]&&(Er=oe.parse(kt["text-color"],1,fr),!Er))return null;const Pr=Ge[Ge.length-1];Pr.scale=Ht,Pr.font=sr,Pr.textColor=Er}else{const Ht=oe.parse(B[st],1,Ur);if(!Ht)return null;const sr=Ht.type.kind;if(sr!=="string"&&sr!=="value"&&sr!=="null"&&sr!=="resolvedImage")return oe.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");rt=!0,Ge.push({content:Ht,scale:null,font:null,textColor:null})}}return new Ll(Ge)}evaluate(B){return new In(this.sections.map(oe=>{const Ee=oe.content.evaluate(B);return sa(Ee)===Qr?new bn("",Ee,null,null,null):new bn(ji(Ee),null,oe.scale?oe.scale.evaluate(B):null,oe.font?oe.font.evaluate(B).join(","):null,oe.textColor?oe.textColor.evaluate(B):null)}))}eachChild(B){for(const oe of this.sections)B(oe.content),oe.scale&&B(oe.scale),oe.font&&B(oe.font),oe.textColor&&B(oe.textColor)}outputDefined(){return!1}}class Kl{constructor(B){this.type=Qr,this.input=B}static parse(B,oe){if(B.length!==2)return oe.error("Expected two arguments.");const Ee=oe.parse(B[1],1,Kt);return Ee?new Kl(Ee):oe.error("No image name provided.")}evaluate(B){const oe=this.input.evaluate(B),Ee=La.fromString(oe);return Ee&&B.availableImages&&(Ee.available=B.availableImages.indexOf(oe)>-1),Ee}eachChild(B){B(this.input)}outputDefined(){return!1}}class eu{constructor(B){this.type=vt,this.input=B}static parse(B,oe){if(B.length!==2)return oe.error(`Expected 1 argument, but found ${B.length-1} instead.`);const Ee=oe.parse(B[1],1);return Ee?Ee.type.kind!=="array"&&Ee.type.kind!=="string"&&Ee.type.kind!=="value"?oe.error(`Expected argument of type string or array, but found ${ut(Ee.type)} instead.`):new eu(Ee):null}evaluate(B){const oe=this.input.evaluate(B);if(typeof oe=="string")return[...oe].length;if(Array.isArray(oe))return oe.length;throw new Xt(`Expected value to be of type string or array, but found ${ut(sa(oe))} instead.`)}eachChild(B){B(this.input)}outputDefined(){return!1}}const Ws=8192;function Bi(Q,B){const oe=(180+Q[0])/360,Ee=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Q[1]*Math.PI/360)))/360,Ge=Math.pow(2,B.z);return[Math.round(oe*Ge*Ws),Math.round(Ee*Ge*Ws)]}function Mo(Q,B){const oe=Math.pow(2,B.z);return[(Ge=(Q[0]/Ws+B.x)/oe,360*Ge-180),(Ee=(Q[1]/Ws+B.y)/oe,360/Math.PI*Math.atan(Math.exp((180-360*Ee)*Math.PI/180))-90)];var Ee,Ge}function Jl(Q,B){Q[0]=Math.min(Q[0],B[0]),Q[1]=Math.min(Q[1],B[1]),Q[2]=Math.max(Q[2],B[0]),Q[3]=Math.max(Q[3],B[1])}function Qs(Q,B){return!(Q[0]<=B[0]||Q[2]>=B[2]||Q[1]<=B[1]||Q[3]>=B[3])}function as(Q,B,oe){const Ee=Q[0]-B[0],Ge=Q[1]-B[1],rt=Q[0]-oe[0],st=Q[1]-oe[1];return Ee*st-rt*Ge==0&&Ee*rt<=0&&Ge*st<=0}function tu(Q,B,oe,Ee){return(Ge=[Ee[0]-oe[0],Ee[1]-oe[1]])[0]*(rt=[B[0]-Q[0],B[1]-Q[1]])[1]-Ge[1]*rt[0]!=0&&!(!ws(Q,B,oe,Ee)||!ws(oe,Ee,Q,B));var Ge,rt}function dl(Q,B,oe){for(const Ee of oe)for(let Ge=0;Ge(Ge=Q)[1]!=(st=kt[Ht+1])[1]>Ge[1]&&Ge[0]<(st[0]-rt[0])*(Ge[1]-rt[1])/(st[1]-rt[1])+rt[0]&&(Ee=!Ee)}var Ge,rt,st;return Ee}function Gu(Q,B){for(const oe of B)if(Rl(Q,oe))return!0;return!1}function Eo(Q,B){for(const oe of Q)if(!Rl(oe,B))return!1;for(let oe=0;oe0&&kt<0||st<0&&kt>0}function pu(Q,B,oe){const Ee=[];for(let Ge=0;Geoe[2]){const Ge=.5*Ee;let rt=Q[0]-oe[0]>Ge?-Ee:oe[0]-Q[0]>Ge?Ee:0;rt===0&&(rt=Q[0]-oe[2]>Ge?-Ee:oe[2]-Q[0]>Ge?Ee:0),Q[0]+=rt}Jl(B,Q)}function Iu(Q,B,oe,Ee){const Ge=Math.pow(2,Ee.z)*Ws,rt=[Ee.x*Ws,Ee.y*Ws],st=[];for(const kt of Q)for(const Ht of kt){const sr=[Ht.x+rt[0],Ht.y+rt[1]];ts(sr,B,oe,Ge),st.push(sr)}return st}function zu(Q,B,oe,Ee){const Ge=Math.pow(2,Ee.z)*Ws,rt=[Ee.x*Ws,Ee.y*Ws],st=[];for(const Ht of Q){const sr=[];for(const Er of Ht){const Pr=[Er.x+rt[0],Er.y+rt[1]];Jl(B,Pr),sr.push(Pr)}st.push(sr)}if(B[2]-B[0]<=Ge/2){(kt=B)[0]=kt[1]=1/0,kt[2]=kt[3]=-1/0;for(const Ht of st)for(const sr of Ht)ts(sr,B,oe,Ge)}var kt;return st}class nl{constructor(B,oe){this.type=Qt,this.geojson=B,this.geometries=oe}static parse(B,oe){if(B.length!==2)return oe.error(`'within' expression requires exactly one argument, but found ${B.length-1} instead.`);if(Wa(B[1])){const Ee=B[1];if(Ee.type==="FeatureCollection"){const Ge=[];for(const rt of Ee.features){const{type:st,coordinates:kt}=rt.geometry;st==="Polygon"&&Ge.push(kt),st==="MultiPolygon"&&Ge.push(...kt)}if(Ge.length)return new nl(Ee,{type:"MultiPolygon",coordinates:Ge})}else if(Ee.type==="Feature"){const Ge=Ee.geometry.type;if(Ge==="Polygon"||Ge==="MultiPolygon")return new nl(Ee,Ee.geometry)}else if(Ee.type==="Polygon"||Ee.type==="MultiPolygon")return new nl(Ee,Ee)}return oe.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(B){if(B.geometry()!=null&&B.canonicalID()!=null){if(B.geometryType()==="Point")return(function(oe,Ee){const Ge=[1/0,1/0,-1/0,-1/0],rt=[1/0,1/0,-1/0,-1/0],st=oe.canonicalID();if(Ee.type==="Polygon"){const kt=pu(Ee.coordinates,rt,st),Ht=Iu(oe.geometry(),Ge,rt,st);if(!Qs(Ge,rt))return!1;for(const sr of Ht)if(!Rl(sr,kt))return!1}if(Ee.type==="MultiPolygon"){const kt=vu(Ee.coordinates,rt,st),Ht=Iu(oe.geometry(),Ge,rt,st);if(!Qs(Ge,rt))return!1;for(const sr of Ht)if(!Gu(sr,kt))return!1}return!0})(B,this.geometries);if(B.geometryType()==="LineString")return(function(oe,Ee){const Ge=[1/0,1/0,-1/0,-1/0],rt=[1/0,1/0,-1/0,-1/0],st=oe.canonicalID();if(Ee.type==="Polygon"){const kt=pu(Ee.coordinates,rt,st),Ht=zu(oe.geometry(),Ge,rt,st);if(!Qs(Ge,rt))return!1;for(const sr of Ht)if(!Eo(sr,kt))return!1}if(Ee.type==="MultiPolygon"){const kt=vu(Ee.coordinates,rt,st),Ht=zu(oe.geometry(),Ge,rt,st);if(!Qs(Ge,rt))return!1;for(const sr of Ht)if(!Os(sr,kt))return!1}return!0})(B,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Gl=class{constructor(Q=[],B=(oe,Ee)=>oeEe?1:0){if(this.data=Q,this.length=this.data.length,this.compare=B,this.length>0)for(let oe=(this.length>>1)-1;oe>=0;oe--)this._down(oe)}push(Q){this.data.push(Q),this._up(this.length++)}pop(){if(this.length===0)return;const Q=this.data[0],B=this.data.pop();return--this.length>0&&(this.data[0]=B,this._down(0)),Q}peek(){return this.data[0]}_up(Q){const{data:B,compare:oe}=this,Ee=B[Q];for(;Q>0;){const Ge=Q-1>>1,rt=B[Ge];if(oe(Ee,rt)>=0)break;B[Q]=rt,Q=Ge}B[Q]=Ee}_down(Q){const{data:B,compare:oe}=this,Ee=this.length>>1,Ge=B[Q];for(;Q=0)break;B[Q]=B[rt],Q=rt}B[Q]=Ge}};function su(Q,B,oe,Ee,Ge){cu(Q,B,oe,Ee||Q.length-1,Ge||jf)}function cu(Q,B,oe,Ee,Ge){for(;Ee>oe;){if(Ee-oe>600){var rt=Ee-oe+1,st=B-oe+1,kt=Math.log(rt),Ht=.5*Math.exp(2*kt/3),sr=.5*Math.sqrt(kt*Ht*(rt-Ht)/rt)*(st-rt/2<0?-1:1);cu(Q,B,Math.max(oe,Math.floor(B-st*Ht/rt+sr)),Math.min(Ee,Math.floor(B+(rt-st)*Ht/rt+sr)),Ge)}var Er=Q[B],Pr=oe,nn=Ee;for(vc(Q,oe,B),Ge(Q[Ee],Er)>0&&vc(Q,oe,Ee);Pr0;)nn--}Ge(Q[oe],Er)===0?vc(Q,oe,nn):vc(Q,++nn,Ee),nn<=B&&(oe=nn+1),B<=nn&&(Ee=nn-1)}}function vc(Q,B,oe){var Ee=Q[B];Q[B]=Q[oe],Q[oe]=Ee}function jf(Q,B){return QB?1:0}function Tf(Q,B){if(Q.length<=1)return[Q];const oe=[];let Ee,Ge;for(const rt of Q){const st=_d(rt);st!==0&&(rt.area=Math.abs(st),Ge===void 0&&(Ge=st<0),Ge===st<0?(Ee&&oe.push(Ee),Ee=[rt]):Ee.push(rt))}if(Ee&&oe.push(Ee),B>1)for(let rt=0;rt1?(sr=B[Ht+1][0],Er=B[Ht+1][1]):pn>0&&(sr+=Pr/this.kx*pn,Er+=nn/this.ky*pn)),Pr=this.wrap(oe[0]-sr)*this.kx,nn=(oe[1]-Er)*this.ky;const Cn=Pr*Pr+nn*nn;Cn180;)B-=360;return B}}function Lc(Q,B){return B[0]-Q[0]}function mc(Q){return Q[1]-Q[0]+1}function Rc(Q,B){return Q[1]>=Q[0]&&Q[1]Q[1])return[null,null];const oe=mc(Q);if(B){if(oe===2)return[Q,null];const Ge=Math.floor(oe/2);return[[Q[0],Q[0]+Ge],[Q[0]+Ge,Q[1]]]}if(oe===1)return[Q,null];const Ee=Math.floor(oe/2)-1;return[[Q[0],Q[0]+Ee],[Q[0]+Ee+1,Q[1]]]}function xu(Q,B){if(!Rc(B,Q.length))return[1/0,1/0,-1/0,-1/0];const oe=[1/0,1/0,-1/0,-1/0];for(let Ee=B[0];Ee<=B[1];++Ee)Jl(oe,Q[Ee]);return oe}function gc(Q){const B=[1/0,1/0,-1/0,-1/0];for(const oe of Q)for(const Ee of oe)Jl(B,Ee);return B}function ul(Q){return Q[0]!==-1/0&&Q[1]!==-1/0&&Q[2]!==1/0&&Q[3]!==1/0}function ru(Q,B,oe){if(!ul(Q)||!ul(B))return NaN;let Ee=0,Ge=0;return Q[2]B[2]&&(Ee=Q[0]-B[2]),Q[1]>B[3]&&(Ge=Q[1]-B[3]),Q[3]=Ee)return Ee;if(Qs(Ge,rt)){if(Np(Q,B))return 0}else if(Np(B,Q))return 0;let st=1/0;for(const kt of Q)for(let Ht=0,sr=kt.length,Er=sr-1;Ht0;){const Ht=st.pop();if(Ht[0]>=rt)continue;const sr=Ht[1],Er=B?50:100;if(mc(sr)<=Er){if(!Rc(sr,Q.length))return NaN;if(B){const Pr=al(Q,sr,oe,Ee);if(isNaN(Pr)||Pr===0)return Pr;rt=Math.min(rt,Pr)}else for(let Pr=sr[0];Pr<=sr[1];++Pr){const nn=yp(Q[Pr],oe,Ee);if(rt=Math.min(rt,nn),rt===0)return 0}}else{const Pr=Df(sr,B);ns(st,rt,Ee,Q,kt,Pr[0]),ns(st,rt,Ee,Q,kt,Pr[1])}}return rt}function ic(Q,B,oe,Ee,Ge,rt=1/0){let st=Math.min(rt,Ge.distance(Q[0],oe[0]));if(st===0)return st;const kt=new Gl([[0,[0,Q.length-1],[0,oe.length-1]]],Lc);for(;kt.length>0;){const Ht=kt.pop();if(Ht[0]>=st)continue;const sr=Ht[1],Er=Ht[2],Pr=B?50:100,nn=Ee?50:100;if(mc(sr)<=Pr&&mc(Er)<=nn){if(!Rc(sr,Q.length)&&Rc(Er,oe.length))return NaN;let pn;if(B&&Ee)pn=ph(Q,sr,oe,Er,Ge),st=Math.min(st,pn);else if(B&&!Ee){const Cn=Q.slice(sr[0],sr[1]+1);for(let Bn=Er[0];Bn<=Er[1];++Bn)if(pn=rh(oe[Bn],Cn,Ge),st=Math.min(st,pn),st===0)return st}else if(!B&&Ee){const Cn=oe.slice(Er[0],Er[1]+1);for(let Bn=sr[0];Bn<=sr[1];++Bn)if(pn=rh(Q[Bn],Cn,Ge),st=Math.min(st,pn),st===0)return st}else pn=Lu(Q,sr,oe,Er,Ge),st=Math.min(st,pn)}else{const pn=Df(sr,B),Cn=Df(Er,Ee);zh(kt,st,Ge,Q,oe,pn[0],Cn[0]),zh(kt,st,Ge,Q,oe,pn[0],Cn[1]),zh(kt,st,Ge,Q,oe,pn[1],Cn[0]),zh(kt,st,Ge,Q,oe,pn[1],Cn[1])}}return st}function bd(Q){return Q.type==="MultiPolygon"?Q.coordinates.map(B=>({type:"Polygon",coordinates:B})):Q.type==="MultiLineString"?Q.coordinates.map(B=>({type:"LineString",coordinates:B})):Q.type==="MultiPoint"?Q.coordinates.map(B=>({type:"Point",coordinates:B})):[Q]}class vh{constructor(B,oe){this.type=vt,this.geojson=B,this.geometries=oe}static parse(B,oe){if(B.length!==2)return oe.error(`'distance' expression requires exactly one argument, but found ${B.length-1} instead.`);if(Wa(B[1])){const Ee=B[1];if(Ee.type==="FeatureCollection")return new vh(Ee,Ee.features.map(Ge=>bd(Ge.geometry)).flat());if(Ee.type==="Feature")return new vh(Ee,bd(Ee.geometry));if("type"in Ee&&"coordinates"in Ee)return new vh(Ee,bd(Ee))}return oe.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(B){if(B.geometry()!=null&&B.canonicalID()!=null){if(B.geometryType()==="Point")return(function(oe,Ee){const Ge=oe.geometry(),rt=Ge.flat().map(Ht=>Mo([Ht.x,Ht.y],oe.canonical));if(Ge.length===0)return NaN;const st=new xd(rt[0][1]);let kt=1/0;for(const Ht of Ee){switch(Ht.type){case"Point":kt=Math.min(kt,ic(rt,!1,[Ht.coordinates],!1,st,kt));break;case"LineString":kt=Math.min(kt,ic(rt,!1,Ht.coordinates,!0,st,kt));break;case"Polygon":kt=Math.min(kt,Pf(rt,!1,Ht.coordinates,st,kt))}if(kt===0)return kt}return kt})(B,this.geometries);if(B.geometryType()==="LineString")return(function(oe,Ee){const Ge=oe.geometry(),rt=Ge.flat().map(Ht=>Mo([Ht.x,Ht.y],oe.canonical));if(Ge.length===0)return NaN;const st=new xd(rt[0][1]);let kt=1/0;for(const Ht of Ee){switch(Ht.type){case"Point":kt=Math.min(kt,ic(rt,!0,[Ht.coordinates],!1,st,kt));break;case"LineString":kt=Math.min(kt,ic(rt,!0,Ht.coordinates,!0,st,kt));break;case"Polygon":kt=Math.min(kt,Pf(rt,!0,Ht.coordinates,st,kt))}if(kt===0)return kt}return kt})(B,this.geometries);if(B.geometryType()==="Polygon")return(function(oe,Ee){const Ge=oe.geometry();if(Ge.length===0||Ge[0].length===0)return NaN;const rt=Tf(Ge,0).map(Ht=>Ht.map(sr=>sr.map(Er=>Mo([Er.x,Er.y],oe.canonical)))),st=new xd(rt[0][0][0][1]);let kt=1/0;for(const Ht of Ee)for(const sr of rt){switch(Ht.type){case"Point":kt=Math.min(kt,Pf([Ht.coordinates],!1,sr,st,kt));break;case"LineString":kt=Math.min(kt,Pf(Ht.coordinates,!0,sr,st,kt));break;case"Polygon":kt=Math.min(kt,Ol(sr,Ht.coordinates,st,kt))}if(kt===0)return kt}return kt})(B,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Wh={"==":ss,"!=":hl,">":Il,"<":ll,">=":ps,"<=":Ls,array:$r,at:xr,boolean:$r,case:ia,coalesce:cs,collator:Uo,format:Ll,image:Kl,in:Xr,"index-of":Tn,interpolate:Oi,"interpolate-hcl":Oi,"interpolate-lab":Oi,length:eu,let:dn,literal:Qi,match:Xn,number:$r,"number-format":Rs,object:$r,slice:na,step:Yn,string:$r,"to-boolean":rn,"to-color":rn,"to-number":rn,"to-string":rn,var:Nt,within:nl,distance:vh};class yc{constructor(B,oe,Ee,Ge){this.name=B,this.type=oe,this._evaluate=Ee,this.args=Ge}evaluate(B){return this._evaluate(B,this.args)}eachChild(B){this.args.forEach(B)}outputDefined(){return!1}static parse(B,oe){const Ee=B[0],Ge=yc.definitions[Ee];if(!Ge)return oe.error(`Unknown expression "${Ee}". If you wanted a literal array, use ["literal", [...]].`,0);const rt=Array.isArray(Ge)?Ge[0]:Ge.type,st=Array.isArray(Ge)?[[Ge[1],Ge[2]]]:Ge.overloads,kt=st.filter(([sr])=>!Array.isArray(sr)||sr.length===B.length-1);let Ht=null;for(const[sr,Er]of kt){Ht=new wn(oe.registry,wd,oe.path,null,oe.scope);const Pr=[];let nn=!1;for(let pn=1;pn{return nn=Pr,Array.isArray(nn)?`(${nn.map(ut).join(", ")})`:`(${ut(nn.type)}...)`;var nn}).join(" | "),Er=[];for(let Pr=1;Pr{oe=B?oe&&wd(Ee):oe&&Ee instanceof Qi}),!!oe&&Td(Q)&&Rd(Q,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Td(Q){if(Q instanceof yc&&(Q.name==="get"&&Q.args.length===1||Q.name==="feature-state"||Q.name==="has"&&Q.args.length===1||Q.name==="properties"||Q.name==="geometry-type"||Q.name==="id"||/^filter-/.test(Q.name))||Q instanceof nl||Q instanceof vh)return!1;let B=!0;return Q.eachChild(oe=>{B&&!Td(oe)&&(B=!1)}),B}function zf(Q){if(Q instanceof yc&&Q.name==="feature-state")return!1;let B=!0;return Q.eachChild(oe=>{B&&!zf(oe)&&(B=!1)}),B}function Rd(Q,B){if(Q instanceof yc&&B.indexOf(Q.name)>=0)return!1;let oe=!0;return Q.eachChild(Ee=>{oe&&!Rd(Ee,B)&&(oe=!1)}),oe}function nh(Q){return{result:"success",value:Q}}function Gf(Q){return{result:"error",value:Q}}function _c(Q){return Q["property-type"]==="data-driven"||Q["property-type"]==="cross-faded-data-driven"}function Ch(Q){return!!Q.expression&&Q.expression.parameters.indexOf("zoom")>-1}function Ad(Q){return!!Q.expression&&Q.expression.interpolated}function lu(Q){return Q instanceof Number?"number":Q instanceof String?"string":Q instanceof Boolean?"boolean":Array.isArray(Q)?"array":Q===null?"null":typeof Q}function id(Q){return typeof Q=="object"&&Q!==null&&!Array.isArray(Q)}function _p(Q){return Q}function Dd(Q,B){const oe=B.type==="color",Ee=Q.stops&&typeof Q.stops[0][0]=="object",Ge=Ee||!(Ee||Q.property!==void 0),rt=Q.type||(Ad(B)?"exponential":"interval");if(oe||B.type==="padding"){const Er=oe?br.parse:Fn.parse;(Q=Se({},Q)).stops&&(Q.stops=Q.stops.map(Pr=>[Pr[0],Er(Pr[1])])),Q.default=Er(Q.default?Q.default:B.default)}if(Q.colorSpace&&(st=Q.colorSpace)!=="rgb"&&st!=="hcl"&&st!=="lab")throw new Error(`Unknown color space: "${Q.colorSpace}"`);var st;let kt,Ht,sr;if(rt==="exponential")kt=zd;else if(rt==="interval")kt=ff;else if(rt==="categorical"){kt=Pd,Ht=Object.create(null);for(const Er of Q.stops)Ht[Er[0]]=Er[1];sr=typeof Q.stops[0][0]}else{if(rt!=="identity")throw new Error(`Unknown function type "${rt}"`);kt=Vu}if(Ee){const Er={},Pr=[];for(let Cn=0;CnCn[0]),evaluate:({zoom:Cn},Bn)=>zd({stops:nn,base:Q.base},B,Cn).evaluate(Cn,Bn)}}if(Ge){const Er=rt==="exponential"?{name:"exponential",base:Q.base!==void 0?Q.base:1}:null;return{kind:"camera",interpolationType:Er,interpolationFactor:Oi.interpolationFactor.bind(void 0,Er),zoomStops:Q.stops.map(Pr=>Pr[0]),evaluate:({zoom:Pr})=>kt(Q,B,Pr,Ht,sr)}}return{kind:"source",evaluate(Er,Pr){const nn=Pr&&Pr.properties?Pr.properties[Q.property]:void 0;return nn===void 0?Yh(Q.default,B.default):kt(Q,B,nn,Ht,sr)}}}function Yh(Q,B,oe){return Q!==void 0?Q:B!==void 0?B:oe!==void 0?oe:void 0}function Pd(Q,B,oe,Ee,Ge){return Yh(typeof oe===Ge?Ee[oe]:void 0,Q.default,B.default)}function ff(Q,B,oe){if(lu(oe)!=="number")return Yh(Q.default,B.default);const Ee=Q.stops.length;if(Ee===1||oe<=Q.stops[0][0])return Q.stops[0][1];if(oe>=Q.stops[Ee-1][0])return Q.stops[Ee-1][1];const Ge=An(Q.stops.map(rt=>rt[0]),oe);return Q.stops[Ge][1]}function zd(Q,B,oe){const Ee=Q.base!==void 0?Q.base:1;if(lu(oe)!=="number")return Yh(Q.default,B.default);const Ge=Q.stops.length;if(Ge===1||oe<=Q.stops[0][0])return Q.stops[0][1];if(oe>=Q.stops[Ge-1][0])return Q.stops[Ge-1][1];const rt=An(Q.stops.map(Er=>Er[0]),oe),st=(function(Er,Pr,nn,pn){const Cn=pn-nn,Bn=Er-nn;return Cn===0?0:Pr===1?Bn/Cn:(Math.pow(Pr,Bn)-1)/(Math.pow(Pr,Cn)-1)})(oe,Ee,Q.stops[rt][0],Q.stops[rt+1][0]),kt=Q.stops[rt][1],Ht=Q.stops[rt+1][1],sr=Xo[B.type]||_p;return typeof kt.evaluate=="function"?{evaluate(...Er){const Pr=kt.evaluate.apply(void 0,Er),nn=Ht.evaluate.apply(void 0,Er);if(Pr!==void 0&&nn!==void 0)return sr(Pr,nn,st,Q.colorSpace)}}:sr(kt,Ht,st,Q.colorSpace)}function Vu(Q,B,oe){switch(B.type){case"color":oe=br.parse(oe);break;case"formatted":oe=In.fromString(oe.toString());break;case"resolvedImage":oe=La.fromString(oe.toString());break;case"padding":oe=Fn.parse(oe);break;default:lu(oe)===B.type||B.type==="enum"&&B.values[oe]||(oe=void 0)}return Yh(oe,Q.default,B.default)}yc.register(Wh,{error:[{kind:"error"},[Kt],(Q,[B])=>{throw new Xt(B.evaluate(Q))}],typeof:[Kt,[Ur],(Q,[B])=>ut(sa(B.evaluate(Q)))],"to-rgba":[et(vt,4),[fr],(Q,[B])=>{const[oe,Ee,Ge,rt]=B.evaluate(Q).rgb;return[255*oe,255*Ee,255*Ge,rt]}],rgb:[fr,[vt,vt,vt],Jd],rgba:[fr,[vt,vt,vt,vt],Jd],has:{type:Qt,overloads:[[[Kt],(Q,[B])=>Ld(B.evaluate(Q),Q.properties())],[[Kt,mr],(Q,[B,oe])=>Ld(B.evaluate(Q),oe.evaluate(Q))]]},get:{type:Ur,overloads:[[[Kt],(Q,[B])=>Xh(B.evaluate(Q),Q.properties())],[[Kt,mr],(Q,[B,oe])=>Xh(B.evaluate(Q),oe.evaluate(Q))]]},"feature-state":[Ur,[Kt],(Q,[B])=>Xh(B.evaluate(Q),Q.featureState||{})],properties:[mr,[],Q=>Q.properties()],"geometry-type":[Kt,[],Q=>Q.geometryType()],id:[Ur,[],Q=>Q.id()],zoom:[vt,[],Q=>Q.globals.zoom],"heatmap-density":[vt,[],Q=>Q.globals.heatmapDensity||0],"line-progress":[vt,[],Q=>Q.globals.lineProgress||0],accumulated:[Ur,[],Q=>Q.globals.accumulated===void 0?null:Q.globals.accumulated],"+":[vt,mh(vt),(Q,B)=>{let oe=0;for(const Ee of B)oe+=Ee.evaluate(Q);return oe}],"*":[vt,mh(vt),(Q,B)=>{let oe=1;for(const Ee of B)oe*=Ee.evaluate(Q);return oe}],"-":{type:vt,overloads:[[[vt,vt],(Q,[B,oe])=>B.evaluate(Q)-oe.evaluate(Q)],[[vt],(Q,[B])=>-B.evaluate(Q)]]},"/":[vt,[vt,vt],(Q,[B,oe])=>B.evaluate(Q)/oe.evaluate(Q)],"%":[vt,[vt,vt],(Q,[B,oe])=>B.evaluate(Q)%oe.evaluate(Q)],ln2:[vt,[],()=>Math.LN2],pi:[vt,[],()=>Math.PI],e:[vt,[],()=>Math.E],"^":[vt,[vt,vt],(Q,[B,oe])=>Math.pow(B.evaluate(Q),oe.evaluate(Q))],sqrt:[vt,[vt],(Q,[B])=>Math.sqrt(B.evaluate(Q))],log10:[vt,[vt],(Q,[B])=>Math.log(B.evaluate(Q))/Math.LN10],ln:[vt,[vt],(Q,[B])=>Math.log(B.evaluate(Q))],log2:[vt,[vt],(Q,[B])=>Math.log(B.evaluate(Q))/Math.LN2],sin:[vt,[vt],(Q,[B])=>Math.sin(B.evaluate(Q))],cos:[vt,[vt],(Q,[B])=>Math.cos(B.evaluate(Q))],tan:[vt,[vt],(Q,[B])=>Math.tan(B.evaluate(Q))],asin:[vt,[vt],(Q,[B])=>Math.asin(B.evaluate(Q))],acos:[vt,[vt],(Q,[B])=>Math.acos(B.evaluate(Q))],atan:[vt,[vt],(Q,[B])=>Math.atan(B.evaluate(Q))],min:[vt,mh(vt),(Q,B)=>Math.min(...B.map(oe=>oe.evaluate(Q)))],max:[vt,mh(vt),(Q,B)=>Math.max(...B.map(oe=>oe.evaluate(Q)))],abs:[vt,[vt],(Q,[B])=>Math.abs(B.evaluate(Q))],round:[vt,[vt],(Q,[B])=>{const oe=B.evaluate(Q);return oe<0?-Math.round(-oe):Math.round(oe)}],floor:[vt,[vt],(Q,[B])=>Math.floor(B.evaluate(Q))],ceil:[vt,[vt],(Q,[B])=>Math.ceil(B.evaluate(Q))],"filter-==":[Qt,[Kt,Ur],(Q,[B,oe])=>Q.properties()[B.value]===oe.value],"filter-id-==":[Qt,[Ur],(Q,[B])=>Q.id()===B.value],"filter-type-==":[Qt,[Kt],(Q,[B])=>Q.geometryType()===B.value],"filter-<":[Qt,[Kt,Ur],(Q,[B,oe])=>{const Ee=Q.properties()[B.value],Ge=oe.value;return typeof Ee==typeof Ge&&Ee{const oe=Q.id(),Ee=B.value;return typeof oe==typeof Ee&&oe":[Qt,[Kt,Ur],(Q,[B,oe])=>{const Ee=Q.properties()[B.value],Ge=oe.value;return typeof Ee==typeof Ge&&Ee>Ge}],"filter-id->":[Qt,[Ur],(Q,[B])=>{const oe=Q.id(),Ee=B.value;return typeof oe==typeof Ee&&oe>Ee}],"filter-<=":[Qt,[Kt,Ur],(Q,[B,oe])=>{const Ee=Q.properties()[B.value],Ge=oe.value;return typeof Ee==typeof Ge&&Ee<=Ge}],"filter-id-<=":[Qt,[Ur],(Q,[B])=>{const oe=Q.id(),Ee=B.value;return typeof oe==typeof Ee&&oe<=Ee}],"filter->=":[Qt,[Kt,Ur],(Q,[B,oe])=>{const Ee=Q.properties()[B.value],Ge=oe.value;return typeof Ee==typeof Ge&&Ee>=Ge}],"filter-id->=":[Qt,[Ur],(Q,[B])=>{const oe=Q.id(),Ee=B.value;return typeof oe==typeof Ee&&oe>=Ee}],"filter-has":[Qt,[Ur],(Q,[B])=>B.value in Q.properties()],"filter-has-id":[Qt,[],Q=>Q.id()!==null&&Q.id()!==void 0],"filter-type-in":[Qt,[et(Kt)],(Q,[B])=>B.value.indexOf(Q.geometryType())>=0],"filter-id-in":[Qt,[et(Ur)],(Q,[B])=>B.value.indexOf(Q.id())>=0],"filter-in-small":[Qt,[Kt,et(Ur)],(Q,[B,oe])=>oe.value.indexOf(Q.properties()[B.value])>=0],"filter-in-large":[Qt,[Kt,et(Ur)],(Q,[B,oe])=>(function(Ee,Ge,rt,st){for(;rt<=st;){const kt=rt+st>>1;if(Ge[kt]===Ee)return!0;Ge[kt]>Ee?st=kt-1:rt=kt+1}return!1})(Q.properties()[B.value],oe.value,0,oe.value.length-1)],all:{type:Qt,overloads:[[[Qt,Qt],(Q,[B,oe])=>B.evaluate(Q)&&oe.evaluate(Q)],[mh(Qt),(Q,B)=>{for(const oe of B)if(!oe.evaluate(Q))return!1;return!0}]]},any:{type:Qt,overloads:[[[Qt,Qt],(Q,[B,oe])=>B.evaluate(Q)||oe.evaluate(Q)],[mh(Qt),(Q,B)=>{for(const oe of B)if(oe.evaluate(Q))return!0;return!1}]]},"!":[Qt,[Qt],(Q,[B])=>!B.evaluate(Q)],"is-supported-script":[Qt,[Kt],(Q,[B])=>{const oe=Q.globals&&Q.globals.isSupportedScript;return!oe||oe(B.evaluate(Q))}],upcase:[Kt,[Kt],(Q,[B])=>B.evaluate(Q).toUpperCase()],downcase:[Kt,[Kt],(Q,[B])=>B.evaluate(Q).toLowerCase()],concat:[Kt,mh(Ur),(Q,B)=>B.map(oe=>ji(oe.evaluate(Q))).join("")],"resolved-locale":[Kt,[Br],(Q,[B])=>B.evaluate(Q).resolvedLocale()]});class hf{constructor(B,oe){var Ee;this.expression=B,this._warningHistory={},this._evaluator=new tn,this._defaultValue=oe?(Ee=oe).type==="color"&&id(Ee.default)?new br(0,0,0,0):Ee.type==="color"?br.parse(Ee.default)||null:Ee.type==="padding"?Fn.parse(Ee.default)||null:Ee.type==="variableAnchorOffsetCollection"?Pa.parse(Ee.default)||null:Ee.default===void 0?null:Ee.default:null,this._enumValues=oe&&oe.type==="enum"?oe.values:null}evaluateWithoutErrorHandling(B,oe,Ee,Ge,rt,st){return this._evaluator.globals=B,this._evaluator.feature=oe,this._evaluator.featureState=Ee,this._evaluator.canonical=Ge,this._evaluator.availableImages=rt||null,this._evaluator.formattedSection=st,this.expression.evaluate(this._evaluator)}evaluate(B,oe,Ee,Ge,rt,st){this._evaluator.globals=B,this._evaluator.feature=oe||null,this._evaluator.featureState=Ee||null,this._evaluator.canonical=Ge,this._evaluator.availableImages=rt||null,this._evaluator.formattedSection=st||null;try{const kt=this.expression.evaluate(this._evaluator);if(kt==null||typeof kt=="number"&&kt!=kt)return this._defaultValue;if(this._enumValues&&!(kt in this._enumValues))throw new Xt(`Expected value to be one of ${Object.keys(this._enumValues).map(Ht=>JSON.stringify(Ht)).join(", ")}, but found ${JSON.stringify(kt)} instead.`);return kt}catch(kt){return this._warningHistory[kt.message]||(this._warningHistory[kt.message]=!0,typeof console<"u"&&console.warn(kt.message)),this._defaultValue}}}function gh(Q){return Array.isArray(Q)&&Q.length>0&&typeof Q[0]=="string"&&Q[0]in Wh}function bu(Q,B){const oe=new wn(Wh,wd,[],B?(function(Ge){const rt={color:fr,string:Kt,number:vt,enum:Kt,boolean:Qt,formatted:fn,padding:Fr,resolvedImage:Qr,variableAnchorOffsetCollection:Bt};return Ge.type==="array"?et(rt[Ge.value]||Ur,Ge.length):rt[Ge.type]})(B):void 0),Ee=oe.parse(Q,void 0,void 0,void 0,B&&B.type==="string"?{typeAnnotation:"coerce"}:void 0);return Ee?nh(new hf(Ee,B)):Gf(oe.errors)}class ah{constructor(B,oe){this.kind=B,this._styleExpression=oe,this.isStateDependent=B!=="constant"&&!zf(oe.expression)}evaluateWithoutErrorHandling(B,oe,Ee,Ge,rt,st){return this._styleExpression.evaluateWithoutErrorHandling(B,oe,Ee,Ge,rt,st)}evaluate(B,oe,Ee,Ge,rt,st){return this._styleExpression.evaluate(B,oe,Ee,Ge,rt,st)}}class Vc{constructor(B,oe,Ee,Ge){this.kind=B,this.zoomStops=Ee,this._styleExpression=oe,this.isStateDependent=B!=="camera"&&!zf(oe.expression),this.interpolationType=Ge}evaluateWithoutErrorHandling(B,oe,Ee,Ge,rt,st){return this._styleExpression.evaluateWithoutErrorHandling(B,oe,Ee,Ge,rt,st)}evaluate(B,oe,Ee,Ge,rt,st){return this._styleExpression.evaluate(B,oe,Ee,Ge,rt,st)}interpolationFactor(B,oe,Ee){return this.interpolationType?Oi.interpolationFactor(this.interpolationType,B,oe,Ee):0}}function df(Q,B){const oe=bu(Q,B);if(oe.result==="error")return oe;const Ee=oe.value.expression,Ge=Td(Ee);if(!Ge&&!_c(B))return Gf([new Je("","data expressions not supported")]);const rt=Rd(Ee,["zoom"]);if(!rt&&!Ch(B))return Gf([new Je("","zoom expressions not supported")]);const st=Nh(Ee);return st||rt?st instanceof Je?Gf([st]):st instanceof Oi&&!Ad(B)?Gf([new Je("",'"interpolate" expressions cannot be used with this property')]):nh(st?new Vc(Ge?"camera":"composite",oe.value,st.labels,st instanceof Oi?st.interpolation:void 0):new ah(Ge?"constant":"source",oe.value)):Gf([new Je("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ru{constructor(B,oe){this._parameters=B,this._specification=oe,Se(this,Dd(this._parameters,this._specification))}static deserialize(B){return new Ru(B._parameters,B._specification)}static serialize(B){return{_parameters:B._parameters,_specification:B._specification}}}function Nh(Q){let B=null;if(Q instanceof dn)B=Nh(Q.result);else if(Q instanceof cs){for(const oe of Q.args)if(B=Nh(oe),B)break}else(Q instanceof Yn||Q instanceof Oi)&&Q.input instanceof yc&&Q.input.name==="zoom"&&(B=Q);return B instanceof Je||Q.eachChild(oe=>{const Ee=Nh(oe);Ee instanceof Je?B=Ee:!B&&Ee?B=new Je("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):B&&Ee&&B!==Ee&&(B=new Je("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),B}function qf(Q){if(Q===!0||Q===!1)return!0;if(!Array.isArray(Q)||Q.length===0)return!1;switch(Q[0]){case"has":return Q.length>=2&&Q[1]!=="$id"&&Q[1]!=="$type";case"in":return Q.length>=3&&(typeof Q[1]!="string"||Array.isArray(Q[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return Q.length!==3||Array.isArray(Q[1])||Array.isArray(Q[2]);case"any":case"all":for(const B of Q.slice(1))if(!qf(B)&&typeof B!="boolean")return!1;return!0;default:return!0}}const yh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function od(Q){if(Q==null)return{filter:()=>!0,needGeometry:!1};qf(Q)||(Q=Oh(Q));const B=bu(Q,yh);if(B.result==="error")throw new Error(B.value.map(oe=>`${oe.key}: ${oe.message}`).join(", "));return{filter:(oe,Ee,Ge)=>B.value.evaluate(oe,Ee,{},Ge),needGeometry:Jp(Q)}}function xp(Q,B){return QB?1:0}function Jp(Q){if(!Array.isArray(Q))return!1;if(Q[0]==="within"||Q[0]==="distance")return!0;for(let B=1;B"||B==="<="||B===">="?sd(Q[1],Q[2],B):B==="any"?(oe=Q.slice(1),["any"].concat(oe.map(Oh))):B==="all"?["all"].concat(Q.slice(1).map(Oh)):B==="none"?["all"].concat(Q.slice(1).map(Oh).map(Dc)):B==="in"?Af(Q[1],Q.slice(2)):B==="!in"?Dc(Af(Q[1],Q.slice(2))):B==="has"?ld(Q[1]):B!=="!has"||Dc(ld(Q[1]));var oe}function sd(Q,B,oe){switch(Q){case"$type":return[`filter-type-${oe}`,B];case"$id":return[`filter-id-${oe}`,B];default:return[`filter-${oe}`,Q,B]}}function Af(Q,B){if(B.length===0)return!1;switch(Q){case"$type":return["filter-type-in",["literal",B]];case"$id":return["filter-id-in",["literal",B]];default:return B.length>200&&!B.some(oe=>typeof oe!=typeof B[0])?["filter-in-large",Q,["literal",B.sort(xp)]]:["filter-in-small",Q,["literal",B]]}}function ld(Q){switch(Q){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",Q]}}function Dc(Q){return["!",Q]}function Fh(Q){const B=typeof Q;if(B==="number"||B==="boolean"||B==="string"||Q==null)return JSON.stringify(Q);if(Array.isArray(Q)){let Ge="[";for(const rt of Q)Ge+=`${Fh(rt)},`;return`${Ge}]`}const oe=Object.keys(Q).sort();let Ee="{";for(let Ge=0;GeEe.maximum?[new ze(B,oe,`${oe} is greater than the maximum value ${Ee.maximum}`)]:[]}function Zh(Q){const B=Q.valueSpec,oe=Au(Q.value.type);let Ee,Ge,rt,st={};const kt=oe!=="categorical"&&Q.value.property===void 0,Ht=!kt,sr=lu(Q.value.stops)==="array"&&lu(Q.value.stops[0])==="array"&&lu(Q.value.stops[0][0])==="object",Er=Nf({key:Q.key,value:Q.value,valueSpec:Q.styleSpec.function,validateSpec:Q.validateSpec,style:Q.style,styleSpec:Q.styleSpec,objectElementValidators:{stops:function(pn){if(oe==="identity")return[new ze(pn.key,pn.value,'identity function may not have a "stops" property')];let Cn=[];const Bn=pn.value;return Cn=Cn.concat(Sd({key:pn.key,value:Bn,valueSpec:pn.valueSpec,validateSpec:pn.validateSpec,style:pn.style,styleSpec:pn.styleSpec,arrayElementValidator:Pr})),lu(Bn)==="array"&&Bn.length===0&&Cn.push(new ze(pn.key,Bn,"array must have at least one stop")),Cn},default:function(pn){return pn.validateSpec({key:pn.key,value:pn.value,valueSpec:B,validateSpec:pn.validateSpec,style:pn.style,styleSpec:pn.styleSpec})}}});return oe==="identity"&&kt&&Er.push(new ze(Q.key,Q.value,'missing required property "property"')),oe==="identity"||Q.value.stops||Er.push(new ze(Q.key,Q.value,'missing required property "stops"')),oe==="exponential"&&Q.valueSpec.expression&&!Ad(Q.valueSpec)&&Er.push(new ze(Q.key,Q.value,"exponential functions not supported")),Q.styleSpec.$version>=8&&(Ht&&!_c(Q.valueSpec)?Er.push(new ze(Q.key,Q.value,"property functions not supported")):kt&&!Ch(Q.valueSpec)&&Er.push(new ze(Q.key,Q.value,"zoom functions not supported"))),oe!=="categorical"&&!sr||Q.value.property!==void 0||Er.push(new ze(Q.key,Q.value,'"property" property is required')),Er;function Pr(pn){let Cn=[];const Bn=pn.value,ta=pn.key;if(lu(Bn)!=="array")return[new ze(ta,Bn,`array expected, ${lu(Bn)} found`)];if(Bn.length!==2)return[new ze(ta,Bn,`array length 2 expected, length ${Bn.length} found`)];if(sr){if(lu(Bn[0])!=="object")return[new ze(ta,Bn,`object expected, ${lu(Bn[0])} found`)];if(Bn[0].zoom===void 0)return[new ze(ta,Bn,"object stop key must have zoom")];if(Bn[0].value===void 0)return[new ze(ta,Bn,"object stop key must have value")];if(rt&&rt>Au(Bn[0].zoom))return[new ze(ta,Bn[0].zoom,"stop zoom values must appear in ascending order")];Au(Bn[0].zoom)!==rt&&(rt=Au(Bn[0].zoom),Ge=void 0,st={}),Cn=Cn.concat(Nf({key:`${ta}[0]`,value:Bn[0],valueSpec:{zoom:{}},validateSpec:pn.validateSpec,style:pn.style,styleSpec:pn.styleSpec,objectElementValidators:{zoom:ku,value:nn}}))}else Cn=Cn.concat(nn({key:`${ta}[0]`,value:Bn[0],validateSpec:pn.validateSpec,style:pn.style,styleSpec:pn.styleSpec},Bn));return gh(pf(Bn[1]))?Cn.concat([new ze(`${ta}[1]`,Bn[1],"expressions are not allowed in function stops.")]):Cn.concat(pn.validateSpec({key:`${ta}[1]`,value:Bn[1],valueSpec:B,validateSpec:pn.validateSpec,style:pn.style,styleSpec:pn.styleSpec}))}function nn(pn,Cn){const Bn=lu(pn.value),ta=Au(pn.value),Da=pn.value!==null?pn.value:Cn;if(Ee){if(Bn!==Ee)return[new ze(pn.key,Da,`${Bn} stop domain type must match previous stop domain type ${Ee}`)]}else Ee=Bn;if(Bn!=="number"&&Bn!=="string"&&Bn!=="boolean")return[new ze(pn.key,Da,"stop domain value must be a number, string, or boolean")];if(Bn!=="number"&&oe!=="categorical"){let Di=`number expected, ${Bn} found`;return _c(B)&&oe===void 0&&(Di+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ze(pn.key,Da,Di)]}return oe!=="categorical"||Bn!=="number"||isFinite(ta)&&Math.floor(ta)===ta?oe!=="categorical"&&Bn==="number"&&Ge!==void 0&&tanew ze(`${Q.key}${Ee.key}`,Q.value,Ee.message));const oe=B.value.expression||B.value._styleExpression.expression;if(Q.expressionContext==="property"&&Q.propertyKey==="text-font"&&!oe.outputDefined())return[new ze(Q.key,Q.value,`Invalid data expression for "${Q.propertyKey}". Output values must be contained as literals within the expression.`)];if(Q.expressionContext==="property"&&Q.propertyType==="layout"&&!zf(oe))return[new ze(Q.key,Q.value,'"feature-state" data expressions are not supported with layout properties.')];if(Q.expressionContext==="filter"&&!zf(oe))return[new ze(Q.key,Q.value,'"feature-state" data expressions are not supported with filters.')];if(Q.expressionContext&&Q.expressionContext.indexOf("cluster")===0){if(!Rd(oe,["zoom","feature-state"]))return[new ze(Q.key,Q.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(Q.expressionContext==="cluster-initial"&&!Td(oe))return[new ze(Q.key,Q.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Sf(Q){const B=Q.key,oe=Q.value,Ee=Q.valueSpec,Ge=[];return Array.isArray(Ee.values)?Ee.values.indexOf(Au(oe))===-1&&Ge.push(new ze(B,oe,`expected one of [${Ee.values.join(", ")}], ${JSON.stringify(oe)} found`)):Object.keys(Ee.values).indexOf(Au(oe))===-1&&Ge.push(new ze(B,oe,`expected one of [${Object.keys(Ee.values).join(", ")}], ${JSON.stringify(oe)} found`)),Ge}function Kh(Q){return qf(pf(Q.value))?_h(Se({},Q,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Hf(Q)}function Hf(Q){const B=Q.value,oe=Q.key;if(lu(B)!=="array")return[new ze(oe,B,`array expected, ${lu(B)} found`)];const Ee=Q.styleSpec;let Ge,rt=[];if(B.length<1)return[new ze(oe,B,"filter array must have at least 1 element")];switch(rt=rt.concat(Sf({key:`${oe}[0]`,value:B[0],valueSpec:Ee.filter_operator,style:Q.style,styleSpec:Q.styleSpec})),Au(B[0])){case"<":case"<=":case">":case">=":B.length>=2&&Au(B[1])==="$type"&&rt.push(new ze(oe,B,`"$type" cannot be use with operator "${B[0]}"`));case"==":case"!=":B.length!==3&&rt.push(new ze(oe,B,`filter array for operator "${B[0]}" must have 3 elements`));case"in":case"!in":B.length>=2&&(Ge=lu(B[1]),Ge!=="string"&&rt.push(new ze(`${oe}[1]`,B[1],`string expected, ${Ge} found`)));for(let st=2;st{sr in oe&&B.push(new ze(Ee,oe[sr],`"${sr}" is prohibited for ref layers`))}),Ge.layers.forEach(sr=>{Au(sr.id)===kt&&(Ht=sr)}),Ht?Ht.ref?B.push(new ze(Ee,oe.ref,"ref cannot reference another ref layer")):st=Au(Ht.type):B.push(new ze(Ee,oe.ref,`ref layer "${kt}" not found`))}else if(st!=="background")if(oe.source){const Ht=Ge.sources&&Ge.sources[oe.source],sr=Ht&&Au(Ht.type);Ht?sr==="vector"&&st==="raster"?B.push(new ze(Ee,oe.source,`layer "${oe.id}" requires a raster source`)):sr!=="raster-dem"&&st==="hillshade"?B.push(new ze(Ee,oe.source,`layer "${oe.id}" requires a raster-dem source`)):sr==="raster"&&st!=="raster"?B.push(new ze(Ee,oe.source,`layer "${oe.id}" requires a vector source`)):sr!=="vector"||oe["source-layer"]?sr==="raster-dem"&&st!=="hillshade"?B.push(new ze(Ee,oe.source,"raster-dem source can only be used with layer type 'hillshade'.")):st!=="line"||!oe.paint||!oe.paint["line-gradient"]||sr==="geojson"&&Ht.lineMetrics||B.push(new ze(Ee,oe,`layer "${oe.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):B.push(new ze(Ee,oe,`layer "${oe.id}" must specify a "source-layer"`)):B.push(new ze(Ee,oe.source,`source "${oe.source}" not found`))}else B.push(new ze(Ee,oe,'missing required property "source"'));return B=B.concat(Nf({key:Ee,value:oe,valueSpec:rt.layer,style:Q.style,styleSpec:Q.styleSpec,validateSpec:Q.validateSpec,objectElementValidators:{"*":()=>[],type:()=>Q.validateSpec({key:`${Ee}.type`,value:oe.type,valueSpec:rt.layer.type,style:Q.style,styleSpec:Q.styleSpec,validateSpec:Q.validateSpec,object:oe,objectKey:"type"}),filter:Kh,layout:Ht=>Nf({layer:oe,key:Ht.key,value:Ht.value,style:Ht.style,styleSpec:Ht.styleSpec,validateSpec:Ht.validateSpec,objectElementValidators:{"*":sr=>Oc(Se({layerType:st},sr))}}),paint:Ht=>Nf({layer:oe,key:Ht.key,value:Ht.value,style:Ht.style,styleSpec:Ht.styleSpec,validateSpec:Ht.validateSpec,objectElementValidators:{"*":sr=>bp(Se({layerType:st},sr))}})}})),B}function Ef(Q){const B=Q.value,oe=Q.key,Ee=lu(B);return Ee!=="string"?[new ze(oe,B,`string expected, ${Ee} found`)]:[]}const ih={promoteId:function({key:Q,value:B}){if(lu(B)==="string")return Ef({key:Q,value:B});{const oe=[];for(const Ee in B)oe.push(...Ef({key:`${Q}.${Ee}`,value:B[Ee]}));return oe}}};function Wf(Q){const B=Q.value,oe=Q.key,Ee=Q.styleSpec,Ge=Q.style,rt=Q.validateSpec;if(!B.type)return[new ze(oe,B,'"type" is required')];const st=Au(B.type);let kt;switch(st){case"vector":case"raster":return kt=Nf({key:oe,value:B,valueSpec:Ee[`source_${st.replace("-","_")}`],style:Q.style,styleSpec:Ee,objectElementValidators:ih,validateSpec:rt}),kt;case"raster-dem":return kt=(function(Ht){var sr;const Er=(sr=Ht.sourceName)!==null&&sr!==void 0?sr:"",Pr=Ht.value,nn=Ht.styleSpec,pn=nn.source_raster_dem,Cn=Ht.style;let Bn=[];const ta=lu(Pr);if(Pr===void 0)return Bn;if(ta!=="object")return Bn.push(new ze("source_raster_dem",Pr,`object expected, ${ta} found`)),Bn;const Da=Au(Pr.encoding)==="custom",Di=["redFactor","greenFactor","blueFactor","baseShift"],ni=Ht.value.encoding?`"${Ht.value.encoding}"`:"Default";for(const Ti in Pr)!Da&&Di.includes(Ti)?Bn.push(new ze(Ti,Pr[Ti],`In "${Er}": "${Ti}" is only valid when "encoding" is set to "custom". ${ni} encoding found`)):pn[Ti]?Bn=Bn.concat(Ht.validateSpec({key:Ti,value:Pr[Ti],valueSpec:pn[Ti],validateSpec:Ht.validateSpec,style:Cn,styleSpec:nn})):Bn.push(new ze(Ti,Pr[Ti],`unknown property "${Ti}"`));return Bn})({sourceName:oe,value:B,style:Q.style,styleSpec:Ee,validateSpec:rt}),kt;case"geojson":if(kt=Nf({key:oe,value:B,valueSpec:Ee.source_geojson,style:Ge,styleSpec:Ee,validateSpec:rt,objectElementValidators:ih}),B.cluster)for(const Ht in B.clusterProperties){const[sr,Er]=B.clusterProperties[Ht],Pr=typeof sr=="string"?[sr,["accumulated"],["get",Ht]]:sr;kt.push(..._h({key:`${oe}.${Ht}.map`,value:Er,expressionContext:"cluster-map"})),kt.push(..._h({key:`${oe}.${Ht}.reduce`,value:Pr,expressionContext:"cluster-reduce"}))}return kt;case"video":return Nf({key:oe,value:B,valueSpec:Ee.source_video,style:Ge,validateSpec:rt,styleSpec:Ee});case"image":return Nf({key:oe,value:B,valueSpec:Ee.source_image,style:Ge,validateSpec:rt,styleSpec:Ee});case"canvas":return[new ze(oe,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Sf({key:`${oe}.type`,value:B.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function qu(Q){const B=Q.value,oe=Q.styleSpec,Ee=oe.light,Ge=Q.style;let rt=[];const st=lu(B);if(B===void 0)return rt;if(st!=="object")return rt=rt.concat([new ze("light",B,`object expected, ${st} found`)]),rt;for(const kt in B){const Ht=kt.match(/^(.*)-transition$/);rt=rt.concat(Ht&&Ee[Ht[1]]&&Ee[Ht[1]].transition?Q.validateSpec({key:kt,value:B[kt],valueSpec:oe.transition,validateSpec:Q.validateSpec,style:Ge,styleSpec:oe}):Ee[kt]?Q.validateSpec({key:kt,value:B[kt],valueSpec:Ee[kt],validateSpec:Q.validateSpec,style:Ge,styleSpec:oe}):[new ze(kt,B[kt],`unknown property "${kt}"`)])}return rt}function Yc(Q){const B=Q.value,oe=Q.styleSpec,Ee=oe.sky,Ge=Q.style,rt=lu(B);if(B===void 0)return[];if(rt!=="object")return[new ze("sky",B,`object expected, ${rt} found`)];let st=[];for(const kt in B)st=st.concat(Ee[kt]?Q.validateSpec({key:kt,value:B[kt],valueSpec:Ee[kt],style:Ge,styleSpec:oe}):[new ze(kt,B[kt],`unknown property "${kt}"`)]);return st}function Nu(Q){const B=Q.value,oe=Q.styleSpec,Ee=oe.terrain,Ge=Q.style;let rt=[];const st=lu(B);if(B===void 0)return rt;if(st!=="object")return rt=rt.concat([new ze("terrain",B,`object expected, ${st} found`)]),rt;for(const kt in B)rt=rt.concat(Ee[kt]?Q.validateSpec({key:kt,value:B[kt],valueSpec:Ee[kt],validateSpec:Q.validateSpec,style:Ge,styleSpec:oe}):[new ze(kt,B[kt],`unknown property "${kt}"`)]);return rt}function xh(Q){let B=[];const oe=Q.value,Ee=Q.key;if(Array.isArray(oe)){const Ge=[],rt=[];for(const st in oe)oe[st].id&&Ge.includes(oe[st].id)&&B.push(new ze(Ee,oe,`all the sprites' ids must be unique, but ${oe[st].id} is duplicated`)),Ge.push(oe[st].id),oe[st].url&&rt.includes(oe[st].url)&&B.push(new ze(Ee,oe,`all the sprites' URLs must be unique, but ${oe[st].url} is duplicated`)),rt.push(oe[st].url),B=B.concat(Nf({key:`${Ee}[${st}]`,value:oe[st],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:Q.validateSpec}));return B}return Ef({key:Ee,value:oe})}const Xf={"*":()=>[],array:Sd,boolean:function(Q){const B=Q.value,oe=Q.key,Ee=lu(B);return Ee!=="boolean"?[new ze(oe,B,`boolean expected, ${Ee} found`)]:[]},number:ku,color:function(Q){const B=Q.key,oe=Q.value,Ee=lu(oe);return Ee!=="string"?[new ze(B,oe,`color expected, ${Ee} found`)]:br.parse(String(oe))?[]:[new ze(B,oe,`color expected, "${oe}" found`)]},constants:Bh,enum:Sf,filter:Kh,function:Zh,layer:Od,object:Nf,source:Wf,light:qu,sky:Yc,terrain:Nu,projection:function(Q){const B=Q.value,oe=Q.styleSpec,Ee=oe.projection,Ge=Q.style,rt=lu(B);if(B===void 0)return[];if(rt!=="object")return[new ze("projection",B,`object expected, ${rt} found`)];let st=[];for(const kt in B)st=st.concat(Ee[kt]?Q.validateSpec({key:kt,value:B[kt],valueSpec:Ee[kt],style:Ge,styleSpec:oe}):[new ze(kt,B[kt],`unknown property "${kt}"`)]);return st},string:Ef,formatted:function(Q){return Ef(Q).length===0?[]:_h(Q)},resolvedImage:function(Q){return Ef(Q).length===0?[]:_h(Q)},padding:function(Q){const B=Q.key,oe=Q.value;if(lu(oe)==="array"){if(oe.length<1||oe.length>4)return[new ze(B,oe,`padding requires 1 to 4 values; ${oe.length} values found`)];const Ee={type:"number"};let Ge=[];for(let rt=0;rt[]}})),Q.constants&&(oe=oe.concat(Bh({key:"constants",value:Q.constants}))),_n(oe)}function kn(Q){return function(B){return Q(zt(xt({},B),{validateSpec:Ed}))}}function _n(Q){return[].concat(Q).sort((B,oe)=>B.line-oe.line)}function Qn(Q){return function(...B){return _n(Q.apply(this,B))}}qr.source=Qn(kn(Wf)),qr.sprite=Qn(kn(xh)),qr.glyphs=Qn(kn(wr)),qr.light=Qn(kn(qu)),qr.sky=Qn(kn(Yc)),qr.terrain=Qn(kn(Nu)),qr.layer=Qn(kn(Od)),qr.filter=Qn(kn(Kh)),qr.paintProperty=Qn(kn(bp)),qr.layoutProperty=Qn(kn(Oc));const $a=qr,Fa=$a.light,Ai=$a.sky,Ni=$a.paintProperty,ho=$a.layoutProperty;function fi(Q,B){let oe=!1;if(B&&B.length)for(const Ee of B)Q.fire(new Z(new Error(Ee.message))),oe=!0;return oe}class Yi{constructor(B,oe,Ee){const Ge=this.cells=[];if(B instanceof ArrayBuffer){this.arrayBuffer=B;const st=new Int32Array(this.arrayBuffer);B=st[0],this.d=(oe=st[1])+2*(Ee=st[2]);for(let Ht=0;Ht=Pr[Cn+0]&&Ge>=Pr[Cn+1])?(kt[pn]=!0,st.push(Er[pn])):kt[pn]=!1}}}}_forEachCell(B,oe,Ee,Ge,rt,st,kt,Ht){const sr=this._convertToCellCoord(B),Er=this._convertToCellCoord(oe),Pr=this._convertToCellCoord(Ee),nn=this._convertToCellCoord(Ge);for(let pn=sr;pn<=Pr;pn++)for(let Cn=Er;Cn<=nn;Cn++){const Bn=this.d*Cn+pn;if((!Ht||Ht(this._convertFromCellCoord(pn),this._convertFromCellCoord(Cn),this._convertFromCellCoord(pn+1),this._convertFromCellCoord(Cn+1)))&&rt.call(this,B,oe,Ee,Ge,Bn,st,kt,Ht))return}}_convertFromCellCoord(B){return(B-this.padding)/this.scale}_convertToCellCoord(B){return Math.max(0,Math.min(this.d-1,Math.floor(B*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const B=this.cells,oe=3+this.cells.length+1+1;let Ee=0;for(let st=0;st=0)continue;const st=Q[rt];Ge[rt]=bi[oe].shallow.indexOf(rt)>=0?st:fs(st,B)}Q instanceof Error&&(Ge.message=Q.message)}if(Ge.$name)throw new Error("$name property is reserved for worker serialization logic.");return oe!=="Object"&&(Ge.$name=oe),Ge}function ls(Q){if(rs(Q))return Q;if(Array.isArray(Q))return Q.map(ls);if(typeof Q!="object")throw new Error("can't deserialize object of type "+typeof Q);const B=os(Q)||"Object";if(!bi[B])throw new Error(`can't deserialize unregistered class ${B}`);const{klass:oe}=bi[B];if(!oe)throw new Error(`can't deserialize unregistered class ${B}`);if(oe.deserialize)return oe.deserialize(Q);const Ee=Object.create(oe.prototype);for(const Ge of Object.keys(Q)){if(Ge==="$name")continue;const rt=Q[Ge];Ee[Ge]=bi[B].shallow.indexOf(Ge)>=0?rt:ls(rt)}return Ee}class To{constructor(){this.first=!0}update(B,oe){const Ee=Math.floor(B);return this.first?(this.first=!1,this.lastIntegerZoom=Ee,this.lastIntegerZoomTime=0,this.lastZoom=B,this.lastFloorZoom=Ee,!0):(this.lastFloorZoom>Ee?(this.lastIntegerZoom=Ee+1,this.lastIntegerZoomTime=oe):this.lastFloorZoomQ>=128&&Q<=255,"Hangul Jamo":Q=>Q>=4352&&Q<=4607,Khmer:Q=>Q>=6016&&Q<=6143,"General Punctuation":Q=>Q>=8192&&Q<=8303,"Letterlike Symbols":Q=>Q>=8448&&Q<=8527,"Number Forms":Q=>Q>=8528&&Q<=8591,"Miscellaneous Technical":Q=>Q>=8960&&Q<=9215,"Control Pictures":Q=>Q>=9216&&Q<=9279,"Optical Character Recognition":Q=>Q>=9280&&Q<=9311,"Enclosed Alphanumerics":Q=>Q>=9312&&Q<=9471,"Geometric Shapes":Q=>Q>=9632&&Q<=9727,"Miscellaneous Symbols":Q=>Q>=9728&&Q<=9983,"Miscellaneous Symbols and Arrows":Q=>Q>=11008&&Q<=11263,"Ideographic Description Characters":Q=>Q>=12272&&Q<=12287,"CJK Symbols and Punctuation":Q=>Q>=12288&&Q<=12351,Katakana:Q=>Q>=12448&&Q<=12543,Kanbun:Q=>Q>=12688&&Q<=12703,"CJK Strokes":Q=>Q>=12736&&Q<=12783,"Enclosed CJK Letters and Months":Q=>Q>=12800&&Q<=13055,"CJK Compatibility":Q=>Q>=13056&&Q<=13311,"Yijing Hexagram Symbols":Q=>Q>=19904&&Q<=19967,"Private Use Area":Q=>Q>=57344&&Q<=63743,"Vertical Forms":Q=>Q>=65040&&Q<=65055,"CJK Compatibility Forms":Q=>Q>=65072&&Q<=65103,"Small Form Variants":Q=>Q>=65104&&Q<=65135,"Halfwidth and Fullwidth Forms":Q=>Q>=65280&&Q<=65519};function Ts(Q){for(const B of Q)if(wl(B.charCodeAt(0)))return!0;return!1}function il(Q){for(const B of Q)if(!Xl(B.charCodeAt(0)))return!1;return!0}function Hl(Q){const B=Q.map(oe=>{try{return new RegExp(`\\p{sc=${oe}}`,"u").source}catch{return null}}).filter(oe=>oe);return new RegExp(B.join("|"),"u")}const mu=Hl(["Arab","Dupl","Mong","Ougr","Syrc"]);function Xl(Q){return!mu.test(String.fromCodePoint(Q))}const gu=Hl(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function wl(Q){return!(Q!==746&&Q!==747&&(Q<4352||!(ro["CJK Compatibility Forms"](Q)&&!(Q>=65097&&Q<=65103)||ro["CJK Compatibility"](Q)||ro["CJK Strokes"](Q)||!(!ro["CJK Symbols and Punctuation"](Q)||Q>=12296&&Q<=12305||Q>=12308&&Q<=12319||Q===12336)||ro["Enclosed CJK Letters and Months"](Q)||ro["Ideographic Description Characters"](Q)||ro.Kanbun(Q)||ro.Katakana(Q)&&Q!==12540||!(!ro["Halfwidth and Fullwidth Forms"](Q)||Q===65288||Q===65289||Q===65293||Q>=65306&&Q<=65310||Q===65339||Q===65341||Q===65343||Q>=65371&&Q<=65503||Q===65507||Q>=65512&&Q<=65519)||!(!ro["Small Form Variants"](Q)||Q>=65112&&Q<=65118||Q>=65123&&Q<=65126)||ro["Vertical Forms"](Q)||ro["Yijing Hexagram Symbols"](Q)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(Q))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(Q))||gu.test(String.fromCodePoint(Q)))))}function Zu(Q){return!(wl(Q)||(function(B){return!!(ro["Latin-1 Supplement"](B)&&(B===167||B===169||B===174||B===177||B===188||B===189||B===190||B===215||B===247)||ro["General Punctuation"](B)&&(B===8214||B===8224||B===8225||B===8240||B===8241||B===8251||B===8252||B===8258||B===8263||B===8264||B===8265||B===8273)||ro["Letterlike Symbols"](B)||ro["Number Forms"](B)||ro["Miscellaneous Technical"](B)&&(B>=8960&&B<=8967||B>=8972&&B<=8991||B>=8996&&B<=9e3||B===9003||B>=9085&&B<=9114||B>=9150&&B<=9165||B===9167||B>=9169&&B<=9179||B>=9186&&B<=9215)||ro["Control Pictures"](B)&&B!==9251||ro["Optical Character Recognition"](B)||ro["Enclosed Alphanumerics"](B)||ro["Geometric Shapes"](B)||ro["Miscellaneous Symbols"](B)&&!(B>=9754&&B<=9759)||ro["Miscellaneous Symbols and Arrows"](B)&&(B>=11026&&B<=11055||B>=11088&&B<=11097||B>=11192&&B<=11243)||ro["CJK Symbols and Punctuation"](B)||ro.Katakana(B)||ro["Private Use Area"](B)||ro["CJK Compatibility Forms"](B)||ro["Small Form Variants"](B)||ro["Halfwidth and Fullwidth Forms"](B)||B===8734||B===8756||B===8757||B>=9984&&B<=10087||B>=10102&&B<=10131||B===65532||B===65533)})(Q))}const Hu=Hl(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function fu(Q){return Hu.test(String.fromCodePoint(Q))}function Vo(Q,B){return!(!B&&fu(Q)||Q>=2304&&Q<=3583||Q>=3840&&Q<=4255||ro.Khmer(Q))}function Fs(Q){for(const B of Q)if(fu(B.charCodeAt(0)))return!0;return!1}const nu=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(Q){this.pluginStatus=Q.pluginStatus,this.pluginURL=Q.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(Q){this.applyArabicShaping=Q.applyArabicShaping,this.processBidirectionalText=Q.processBidirectionalText,this.processStyledBidirectionalText=Q.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Fl{constructor(B,oe){this.zoom=B,oe?(this.now=oe.now,this.fadeDuration=oe.fadeDuration,this.zoomHistory=oe.zoomHistory,this.transition=oe.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new To,this.transition={})}isSupportedScript(B){return(function(oe,Ee){for(const Ge of oe)if(!Vo(Ge.charCodeAt(0),Ee))return!1;return!0})(B,nu.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const B=this.zoom,oe=B-Math.floor(B),Ee=this.crossFadingFactor();return B>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:oe+(1-oe)*Ee}:{fromScale:.5,toScale:1,t:1-(1-Ee)*oe}}}class jc{constructor(B,oe){this.property=B,this.value=oe,this.expression=(function(Ee,Ge){if(id(Ee))return new Ru(Ee,Ge);if(gh(Ee)){const rt=df(Ee,Ge);if(rt.result==="error")throw new Error(rt.value.map(st=>`${st.key}: ${st.message}`).join(", "));return rt.value}{let rt=Ee;return Ge.type==="color"&&typeof Ee=="string"?rt=br.parse(Ee):Ge.type!=="padding"||typeof Ee!="number"&&!Array.isArray(Ee)?Ge.type==="variableAnchorOffsetCollection"&&Array.isArray(Ee)&&(rt=Pa.parse(Ee)):rt=Fn.parse(Ee),{kind:"constant",evaluate:()=>rt}}})(oe===void 0?B.specification.default:oe,B.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(B,oe,Ee){return this.property.possiblyEvaluate(this,B,oe,Ee)}}class Gc{constructor(B){this.property=B,this.value=new jc(B,void 0)}transitioned(B,oe){return new kh(this.property,this.value,oe,I({},B.transition,this.transition),B.now)}untransitioned(){return new kh(this.property,this.value,null,{},0)}}class Zc{constructor(B){this._properties=B,this._values=Object.create(B.defaultTransitionablePropertyValues)}getValue(B){return h(this._values[B].value.value)}setValue(B,oe){Object.prototype.hasOwnProperty.call(this._values,B)||(this._values[B]=new Gc(this._values[B].property)),this._values[B].value=new jc(this._values[B].property,oe===null?void 0:h(oe))}getTransition(B){return h(this._values[B].transition)}setTransition(B,oe){Object.prototype.hasOwnProperty.call(this._values,B)||(this._values[B]=new Gc(this._values[B].property)),this._values[B].transition=h(oe)||void 0}serialize(){const B={};for(const oe of Object.keys(this._values)){const Ee=this.getValue(oe);Ee!==void 0&&(B[oe]=Ee);const Ge=this.getTransition(oe);Ge!==void 0&&(B[`${oe}-transition`]=Ge)}return B}transitioned(B,oe){const Ee=new qc(this._properties);for(const Ge of Object.keys(this._values))Ee._values[Ge]=this._values[Ge].transitioned(B,oe._values[Ge]);return Ee}untransitioned(){const B=new qc(this._properties);for(const oe of Object.keys(this._values))B._values[oe]=this._values[oe].untransitioned();return B}}class kh{constructor(B,oe,Ee,Ge,rt){this.property=B,this.value=oe,this.begin=rt+Ge.delay||0,this.end=this.begin+Ge.duration||0,B.specification.transition&&(Ge.delay||Ge.duration)&&(this.prior=Ee)}possiblyEvaluate(B,oe,Ee){const Ge=B.now||0,rt=this.value.possiblyEvaluate(B,oe,Ee),st=this.prior;if(st){if(Ge>this.end)return this.prior=null,rt;if(this.value.isDataDriven())return this.prior=null,rt;if(Ge=1)return 1;const sr=Ht*Ht,Er=sr*Ht;return 4*(Ht<.5?Er:3*(Ht-sr)+Er-.75)})(kt))}}return rt}}class qc{constructor(B){this._properties=B,this._values=Object.create(B.defaultTransitioningPropertyValues)}possiblyEvaluate(B,oe,Ee){const Ge=new sh(this._properties);for(const rt of Object.keys(this._values))Ge._values[rt]=this._values[rt].possiblyEvaluate(B,oe,Ee);return Ge}hasTransition(){for(const B of Object.keys(this._values))if(this._values[B].prior)return!0;return!1}}class oh{constructor(B){this._properties=B,this._values=Object.create(B.defaultPropertyValues)}hasValue(B){return this._values[B].value!==void 0}getValue(B){return h(this._values[B].value)}setValue(B,oe){this._values[B]=new jc(this._values[B].property,oe===null?void 0:h(oe))}serialize(){const B={};for(const oe of Object.keys(this._values)){const Ee=this.getValue(oe);Ee!==void 0&&(B[oe]=Ee)}return B}possiblyEvaluate(B,oe,Ee){const Ge=new sh(this._properties);for(const rt of Object.keys(this._values))Ge._values[rt]=this._values[rt].possiblyEvaluate(B,oe,Ee);return Ge}}class Ku{constructor(B,oe,Ee){this.property=B,this.value=oe,this.parameters=Ee}isConstant(){return this.value.kind==="constant"}constantOr(B){return this.value.kind==="constant"?this.value.value:B}evaluate(B,oe,Ee,Ge){return this.property.evaluate(this.value,this.parameters,B,oe,Ee,Ge)}}class sh{constructor(B){this._properties=B,this._values=Object.create(B.defaultPossiblyEvaluatedValues)}get(B){return this._values[B]}}class hs{constructor(B){this.specification=B}possiblyEvaluate(B,oe){if(B.isDataDriven())throw new Error("Value should not be data driven");return B.expression.evaluate(oe)}interpolate(B,oe,Ee){const Ge=Xo[this.specification.type];return Ge?Ge(B,oe,Ee):B}}class Ss{constructor(B,oe){this.specification=B,this.overrides=oe}possiblyEvaluate(B,oe,Ee,Ge){return new Ku(this,B.expression.kind==="constant"||B.expression.kind==="camera"?{kind:"constant",value:B.expression.evaluate(oe,null,{},Ee,Ge)}:B.expression,oe)}interpolate(B,oe,Ee){if(B.value.kind!=="constant"||oe.value.kind!=="constant")return B;if(B.value.value===void 0||oe.value.value===void 0)return new Ku(this,{kind:"constant",value:void 0},B.parameters);const Ge=Xo[this.specification.type];if(Ge){const rt=Ge(B.value.value,oe.value.value,Ee);return new Ku(this,{kind:"constant",value:rt},B.parameters)}return B}evaluate(B,oe,Ee,Ge,rt,st){return B.kind==="constant"?B.value:B.evaluate(oe,Ee,Ge,rt,st)}}class lh extends Ss{possiblyEvaluate(B,oe,Ee,Ge){if(B.value===void 0)return new Ku(this,{kind:"constant",value:void 0},oe);if(B.expression.kind==="constant"){const rt=B.expression.evaluate(oe,null,{},Ee,Ge),st=B.property.specification.type==="resolvedImage"&&typeof rt!="string"?rt.name:rt,kt=this._calculate(st,st,st,oe);return new Ku(this,{kind:"constant",value:kt},oe)}if(B.expression.kind==="camera"){const rt=this._calculate(B.expression.evaluate({zoom:oe.zoom-1}),B.expression.evaluate({zoom:oe.zoom}),B.expression.evaluate({zoom:oe.zoom+1}),oe);return new Ku(this,{kind:"constant",value:rt},oe)}return new Ku(this,B.expression,oe)}evaluate(B,oe,Ee,Ge,rt,st){if(B.kind==="source"){const kt=B.evaluate(oe,Ee,Ge,rt,st);return this._calculate(kt,kt,kt,oe)}return B.kind==="composite"?this._calculate(B.evaluate({zoom:Math.floor(oe.zoom)-1},Ee,Ge),B.evaluate({zoom:Math.floor(oe.zoom)},Ee,Ge),B.evaluate({zoom:Math.floor(oe.zoom)+1},Ee,Ge),oe):B.value}_calculate(B,oe,Ee,Ge){return Ge.zoom>Ge.zoomHistory.lastIntegerZoom?{from:B,to:oe}:{from:Ee,to:oe}}interpolate(B){return B}}class Cf{constructor(B){this.specification=B}possiblyEvaluate(B,oe,Ee,Ge){if(B.value!==void 0){if(B.expression.kind==="constant"){const rt=B.expression.evaluate(oe,null,{},Ee,Ge);return this._calculate(rt,rt,rt,oe)}return this._calculate(B.expression.evaluate(new Fl(Math.floor(oe.zoom-1),oe)),B.expression.evaluate(new Fl(Math.floor(oe.zoom),oe)),B.expression.evaluate(new Fl(Math.floor(oe.zoom+1),oe)),oe)}}_calculate(B,oe,Ee,Ge){return Ge.zoom>Ge.zoomHistory.lastIntegerZoom?{from:B,to:oe}:{from:Ee,to:oe}}interpolate(B){return B}}class vf{constructor(B){this.specification=B}possiblyEvaluate(B,oe,Ee,Ge){return!!B.expression.evaluate(oe,null,{},Ee,Ge)}interpolate(){return!1}}class Qe{constructor(B){this.properties=B,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const oe in B){const Ee=B[oe];Ee.specification.overridable&&this.overridableProperties.push(oe);const Ge=this.defaultPropertyValues[oe]=new jc(Ee,void 0),rt=this.defaultTransitionablePropertyValues[oe]=new Gc(Ee);this.defaultTransitioningPropertyValues[oe]=rt.untransitioned(),this.defaultPossiblyEvaluatedValues[oe]=Ge.possiblyEvaluate({})}}}ii("DataDrivenProperty",Ss),ii("DataConstantProperty",hs),ii("CrossFadedDataDrivenProperty",lh),ii("CrossFadedProperty",Cf),ii("ColorRampProperty",vf);const N="-transition";class ve extends de{constructor(B,oe){if(super(),this.id=B.id,this.type=B.type,this._featureFilter={filter:()=>!0,needGeometry:!1},B.type!=="custom"&&(this.metadata=B.metadata,this.minzoom=B.minzoom,this.maxzoom=B.maxzoom,B.type!=="background"&&(this.source=B.source,this.sourceLayer=B["source-layer"],this.filter=B.filter),oe.layout&&(this._unevaluatedLayout=new oh(oe.layout)),oe.paint)){this._transitionablePaint=new Zc(oe.paint);for(const Ee in B.paint)this.setPaintProperty(Ee,B.paint[Ee],{validate:!1});for(const Ee in B.layout)this.setLayoutProperty(Ee,B.layout[Ee],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new sh(oe.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(B){return B==="visibility"?this.visibility:this._unevaluatedLayout.getValue(B)}setLayoutProperty(B,oe,Ee={}){oe!=null&&this._validate(ho,`layers.${this.id}.layout.${B}`,B,oe,Ee)||(B!=="visibility"?this._unevaluatedLayout.setValue(B,oe):this.visibility=oe)}getPaintProperty(B){return B.endsWith(N)?this._transitionablePaint.getTransition(B.slice(0,-11)):this._transitionablePaint.getValue(B)}setPaintProperty(B,oe,Ee={}){if(oe!=null&&this._validate(Ni,`layers.${this.id}.paint.${B}`,B,oe,Ee))return!1;if(B.endsWith(N))return this._transitionablePaint.setTransition(B.slice(0,-11),oe||void 0),!1;{const Ge=this._transitionablePaint._values[B],rt=Ge.property.specification["property-type"]==="cross-faded-data-driven",st=Ge.value.isDataDriven(),kt=Ge.value;this._transitionablePaint.setValue(B,oe),this._handleSpecialPaintPropertyUpdate(B);const Ht=this._transitionablePaint._values[B].value;return Ht.isDataDriven()||st||rt||this._handleOverridablePaintPropertyUpdate(B,kt,Ht)}}_handleSpecialPaintPropertyUpdate(B){}_handleOverridablePaintPropertyUpdate(B,oe,Ee){return!1}isHidden(B){return!!(this.minzoom&&B=this.maxzoom)||this.visibility==="none"}updateTransitions(B){this._transitioningPaint=this._transitionablePaint.transitioned(B,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(B,oe){B.getCrossfadeParameters&&(this._crossfadeParameters=B.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(B,void 0,oe)),this.paint=this._transitioningPaint.possiblyEvaluate(B,void 0,oe)}serialize(){const B={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&&(B.layout=B.layout||{},B.layout.visibility=this.visibility),_(B,(oe,Ee)=>!(oe===void 0||Ee==="layout"&&!Object.keys(oe).length||Ee==="paint"&&!Object.keys(oe).length))}_validate(B,oe,Ee,Ge,rt={}){return(!rt||rt.validate!==!1)&&fi(this,B.call($a,{key:oe,layerType:this.type,objectKey:Ee,value:Ge,styleSpec:pe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const B in this.paint._values){const oe=this.paint.get(B);if(oe instanceof Ku&&_c(oe.property.specification)&&(oe.value.kind==="source"||oe.value.kind==="composite")&&oe.value.isStateDependent)return!0}return!1}}const Oe={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ue{constructor(B,oe){this._structArray=B,this._pos1=oe*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ke{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(B,oe){return B._trim(),oe&&(B.isTransferred=!0,oe.push(B.arrayBuffer)),{length:B.length,arrayBuffer:B.arrayBuffer}}static deserialize(B){const oe=Object.create(this.prototype);return oe.arrayBuffer=B.arrayBuffer,oe.length=B.length,oe.capacity=B.arrayBuffer.byteLength/oe.bytesPerElement,oe._refreshViews(),oe}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(B){this.reserve(B),this.length=B}reserve(B){if(B>this.capacity){this.capacity=Math.max(B,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const oe=this.uint8;this._refreshViews(),oe&&this.uint8.set(oe)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function It(Q,B=1){let oe=0,Ee=0;return{members:Q.map(Ge=>{const rt=Oe[Ge.type].BYTES_PER_ELEMENT,st=oe=$t(oe,Math.max(B,rt)),kt=Ge.components||1;return Ee=Math.max(Ee,rt),oe+=rt*kt,{name:Ge.name,type:Ge.type,components:kt,offset:st}}),size:$t(oe,Math.max(Ee,B)),alignment:B}}function $t(Q,B){return Math.ceil(Q/B)*B}class ir extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(B,oe){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,B,oe)}emplace(B,oe,Ee){const Ge=2*B;return this.int16[Ge+0]=oe,this.int16[Ge+1]=Ee,B}}ir.prototype.bytesPerElement=4,ii("StructArrayLayout2i4",ir);class Tr extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee){const Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,B,oe,Ee)}emplace(B,oe,Ee,Ge){const rt=3*B;return this.int16[rt+0]=oe,this.int16[rt+1]=Ee,this.int16[rt+2]=Ge,B}}Tr.prototype.bytesPerElement=6,ii("StructArrayLayout3i6",Tr);class Or extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee,Ge){const rt=this.length;return this.resize(rt+1),this.emplace(rt,B,oe,Ee,Ge)}emplace(B,oe,Ee,Ge,rt){const st=4*B;return this.int16[st+0]=oe,this.int16[st+1]=Ee,this.int16[st+2]=Ge,this.int16[st+3]=rt,B}}Or.prototype.bytesPerElement=8,ii("StructArrayLayout4i8",Or);class Vr extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee,Ge,rt,st){const kt=this.length;return this.resize(kt+1),this.emplace(kt,B,oe,Ee,Ge,rt,st)}emplace(B,oe,Ee,Ge,rt,st,kt){const Ht=6*B;return this.int16[Ht+0]=oe,this.int16[Ht+1]=Ee,this.int16[Ht+2]=Ge,this.int16[Ht+3]=rt,this.int16[Ht+4]=st,this.int16[Ht+5]=kt,B}}Vr.prototype.bytesPerElement=12,ii("StructArrayLayout2i4i12",Vr);class vn extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee,Ge,rt,st){const kt=this.length;return this.resize(kt+1),this.emplace(kt,B,oe,Ee,Ge,rt,st)}emplace(B,oe,Ee,Ge,rt,st,kt){const Ht=4*B,sr=8*B;return this.int16[Ht+0]=oe,this.int16[Ht+1]=Ee,this.uint8[sr+4]=Ge,this.uint8[sr+5]=rt,this.uint8[sr+6]=st,this.uint8[sr+7]=kt,B}}vn.prototype.bytesPerElement=8,ii("StructArrayLayout2i4ub8",vn);class Dn extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(B,oe){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,B,oe)}emplace(B,oe,Ee){const Ge=2*B;return this.float32[Ge+0]=oe,this.float32[Ge+1]=Ee,B}}Dn.prototype.bytesPerElement=8,ii("StructArrayLayout2f8",Dn);class ot extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er){const Pr=this.length;return this.resize(Pr+1),this.emplace(Pr,B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er)}emplace(B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr){const nn=10*B;return this.uint16[nn+0]=oe,this.uint16[nn+1]=Ee,this.uint16[nn+2]=Ge,this.uint16[nn+3]=rt,this.uint16[nn+4]=st,this.uint16[nn+5]=kt,this.uint16[nn+6]=Ht,this.uint16[nn+7]=sr,this.uint16[nn+8]=Er,this.uint16[nn+9]=Pr,B}}ot.prototype.bytesPerElement=20,ii("StructArrayLayout10ui20",ot);class dt extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn){const pn=this.length;return this.resize(pn+1),this.emplace(pn,B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn)}emplace(B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn,pn){const Cn=12*B;return this.int16[Cn+0]=oe,this.int16[Cn+1]=Ee,this.int16[Cn+2]=Ge,this.int16[Cn+3]=rt,this.uint16[Cn+4]=st,this.uint16[Cn+5]=kt,this.uint16[Cn+6]=Ht,this.uint16[Cn+7]=sr,this.int16[Cn+8]=Er,this.int16[Cn+9]=Pr,this.int16[Cn+10]=nn,this.int16[Cn+11]=pn,B}}dt.prototype.bytesPerElement=24,ii("StructArrayLayout4i4ui4i24",dt);class St extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(B,oe,Ee){const Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,B,oe,Ee)}emplace(B,oe,Ee,Ge){const rt=3*B;return this.float32[rt+0]=oe,this.float32[rt+1]=Ee,this.float32[rt+2]=Ge,B}}St.prototype.bytesPerElement=12,ii("StructArrayLayout3f12",St);class Rt extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(B){const oe=this.length;return this.resize(oe+1),this.emplace(oe,B)}emplace(B,oe){return this.uint32[1*B+0]=oe,B}}Rt.prototype.bytesPerElement=4,ii("StructArrayLayout1ul4",Rt);class Yt extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee,Ge,rt,st,kt,Ht,sr){const Er=this.length;return this.resize(Er+1),this.emplace(Er,B,oe,Ee,Ge,rt,st,kt,Ht,sr)}emplace(B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er){const Pr=10*B,nn=5*B;return this.int16[Pr+0]=oe,this.int16[Pr+1]=Ee,this.int16[Pr+2]=Ge,this.int16[Pr+3]=rt,this.int16[Pr+4]=st,this.int16[Pr+5]=kt,this.uint32[nn+3]=Ht,this.uint16[Pr+8]=sr,this.uint16[Pr+9]=Er,B}}Yt.prototype.bytesPerElement=20,ii("StructArrayLayout6i1ul2ui20",Yt);class Ut extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee,Ge,rt,st){const kt=this.length;return this.resize(kt+1),this.emplace(kt,B,oe,Ee,Ge,rt,st)}emplace(B,oe,Ee,Ge,rt,st,kt){const Ht=6*B;return this.int16[Ht+0]=oe,this.int16[Ht+1]=Ee,this.int16[Ht+2]=Ge,this.int16[Ht+3]=rt,this.int16[Ht+4]=st,this.int16[Ht+5]=kt,B}}Ut.prototype.bytesPerElement=12,ii("StructArrayLayout2i2i2i12",Ut);class er extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee,Ge,rt){const st=this.length;return this.resize(st+1),this.emplace(st,B,oe,Ee,Ge,rt)}emplace(B,oe,Ee,Ge,rt,st){const kt=4*B,Ht=8*B;return this.float32[kt+0]=oe,this.float32[kt+1]=Ee,this.float32[kt+2]=Ge,this.int16[Ht+6]=rt,this.int16[Ht+7]=st,B}}er.prototype.bytesPerElement=16,ii("StructArrayLayout2f1f2i16",er);class Mr extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee,Ge,rt,st){const kt=this.length;return this.resize(kt+1),this.emplace(kt,B,oe,Ee,Ge,rt,st)}emplace(B,oe,Ee,Ge,rt,st,kt){const Ht=16*B,sr=4*B,Er=8*B;return this.uint8[Ht+0]=oe,this.uint8[Ht+1]=Ee,this.float32[sr+1]=Ge,this.float32[sr+2]=rt,this.int16[Er+6]=st,this.int16[Er+7]=kt,B}}Mr.prototype.bytesPerElement=16,ii("StructArrayLayout2ub2f2i16",Mr);class Nr extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee){const Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,B,oe,Ee)}emplace(B,oe,Ee,Ge){const rt=3*B;return this.uint16[rt+0]=oe,this.uint16[rt+1]=Ee,this.uint16[rt+2]=Ge,B}}Nr.prototype.bytesPerElement=6,ii("StructArrayLayout3ui6",Nr);class jr extends Ke{_refreshViews(){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)}emplaceBack(B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn,pn,Cn,Bn,ta,Da){const Di=this.length;return this.resize(Di+1),this.emplace(Di,B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn,pn,Cn,Bn,ta,Da)}emplace(B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn,pn,Cn,Bn,ta,Da,Di){const ni=24*B,Ti=12*B,uo=48*B;return this.int16[ni+0]=oe,this.int16[ni+1]=Ee,this.uint16[ni+2]=Ge,this.uint16[ni+3]=rt,this.uint32[Ti+2]=st,this.uint32[Ti+3]=kt,this.uint32[Ti+4]=Ht,this.uint16[ni+10]=sr,this.uint16[ni+11]=Er,this.uint16[ni+12]=Pr,this.float32[Ti+7]=nn,this.float32[Ti+8]=pn,this.uint8[uo+36]=Cn,this.uint8[uo+37]=Bn,this.uint8[uo+38]=ta,this.uint32[Ti+10]=Da,this.int16[ni+22]=Di,B}}jr.prototype.bytesPerElement=48,ii("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",jr);class sn extends Ke{_refreshViews(){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)}emplaceBack(B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn,pn,Cn,Bn,ta,Da,Di,ni,Ti,uo,Oo,ms,zl,Es,ds,tl,Hs){const Vs=this.length;return this.resize(Vs+1),this.emplace(Vs,B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn,pn,Cn,Bn,ta,Da,Di,ni,Ti,uo,Oo,ms,zl,Es,ds,tl,Hs)}emplace(B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn,pn,Cn,Bn,ta,Da,Di,ni,Ti,uo,Oo,ms,zl,Es,ds,tl,Hs,Vs){const Co=32*B,cl=16*B;return this.int16[Co+0]=oe,this.int16[Co+1]=Ee,this.int16[Co+2]=Ge,this.int16[Co+3]=rt,this.int16[Co+4]=st,this.int16[Co+5]=kt,this.int16[Co+6]=Ht,this.int16[Co+7]=sr,this.uint16[Co+8]=Er,this.uint16[Co+9]=Pr,this.uint16[Co+10]=nn,this.uint16[Co+11]=pn,this.uint16[Co+12]=Cn,this.uint16[Co+13]=Bn,this.uint16[Co+14]=ta,this.uint16[Co+15]=Da,this.uint16[Co+16]=Di,this.uint16[Co+17]=ni,this.uint16[Co+18]=Ti,this.uint16[Co+19]=uo,this.uint16[Co+20]=Oo,this.uint16[Co+21]=ms,this.uint16[Co+22]=zl,this.uint32[cl+12]=Es,this.float32[cl+13]=ds,this.float32[cl+14]=tl,this.uint16[Co+30]=Hs,this.uint16[Co+31]=Vs,B}}sn.prototype.bytesPerElement=64,ii("StructArrayLayout8i15ui1ul2f2ui64",sn);class xn extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(B){const oe=this.length;return this.resize(oe+1),this.emplace(oe,B)}emplace(B,oe){return this.float32[1*B+0]=oe,B}}xn.prototype.bytesPerElement=4,ii("StructArrayLayout1f4",xn);class $n extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(B,oe,Ee){const Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,B,oe,Ee)}emplace(B,oe,Ee,Ge){const rt=3*B;return this.uint16[6*B+0]=oe,this.float32[rt+1]=Ee,this.float32[rt+2]=Ge,B}}$n.prototype.bytesPerElement=12,ii("StructArrayLayout1ui2f12",$n);class Wn extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(B,oe,Ee){const Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,B,oe,Ee)}emplace(B,oe,Ee,Ge){const rt=4*B;return this.uint32[2*B+0]=oe,this.uint16[rt+2]=Ee,this.uint16[rt+3]=Ge,B}}Wn.prototype.bytesPerElement=8,ii("StructArrayLayout1ul2ui8",Wn);class ua extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(B,oe){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,B,oe)}emplace(B,oe,Ee){const Ge=2*B;return this.uint16[Ge+0]=oe,this.uint16[Ge+1]=Ee,B}}ua.prototype.bytesPerElement=4,ii("StructArrayLayout2ui4",ua);class Ua extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(B){const oe=this.length;return this.resize(oe+1),this.emplace(oe,B)}emplace(B,oe){return this.uint16[1*B+0]=oe,B}}Ua.prototype.bytesPerElement=2,ii("StructArrayLayout1ui2",Ua);class Si extends Ke{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(B,oe,Ee,Ge){const rt=this.length;return this.resize(rt+1),this.emplace(rt,B,oe,Ee,Ge)}emplace(B,oe,Ee,Ge,rt){const st=4*B;return this.float32[st+0]=oe,this.float32[st+1]=Ee,this.float32[st+2]=Ge,this.float32[st+3]=rt,B}}Si.prototype.bytesPerElement=16,ii("StructArrayLayout4f16",Si);class gi extends Ue{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new s(this.anchorPointX,this.anchorPointY)}}gi.prototype.size=20;class Mi extends Yt{get(B){return new gi(this,B)}}ii("CollisionBoxArray",Mi);class Ao extends Ue{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(B){this._structArray.uint8[this._pos1+37]=B}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(B){this._structArray.uint8[this._pos1+38]=B}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(B){this._structArray.uint32[this._pos4+10]=B}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Ao.prototype.size=48;class qo extends jr{get(B){return new Ao(this,B)}}ii("PlacedSymbolArray",qo);class Bo extends Ue{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(B){this._structArray.uint32[this._pos4+12]=B}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Bo.prototype.size=64;class vs extends sn{get(B){return new Bo(this,B)}}ii("SymbolInstanceArray",vs);class ml extends xn{getoffsetX(B){return this.float32[1*B+0]}}ii("GlyphOffsetArray",ml);class yl extends Tr{getx(B){return this.int16[3*B+0]}gety(B){return this.int16[3*B+1]}gettileUnitDistanceFromAnchor(B){return this.int16[3*B+2]}}ii("SymbolLineVertexArray",yl);class Xs extends Ue{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Xs.prototype.size=12;class Sl extends $n{get(B){return new Xs(this,B)}}ii("TextAnchorOffsetArray",Sl);class Ou extends Ue{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Ou.prototype.size=8;class Su extends Wn{get(B){return new Ou(this,B)}}ii("FeatureIndexArray",Su);class Ys extends ir{}class Zs extends ir{}class Qu extends ir{}class Pc extends Vr{}class mf extends vn{}class Ce extends Dn{}class Ye extends ot{}class pt extends dt{}class Dt extends St{}class Ot extends Rt{}class Wt extends Ut{}class dr extends Mr{}class hr extends Nr{}class Rr extends ua{}const ln=It([{name:"a_pos",components:2,type:"Int16"}],4),{members:on}=ln;class En{constructor(B=[]){this.segments=B}prepareSegment(B,oe,Ee,Ge){let rt=this.segments[this.segments.length-1];return B>En.MAX_VERTEX_ARRAY_LENGTH&&w(`Max vertices per segment is ${En.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${B}`),(!rt||rt.vertexLength+B>En.MAX_VERTEX_ARRAY_LENGTH||rt.sortKey!==Ge)&&(rt={vertexOffset:oe.length,primitiveOffset:Ee.length,vertexLength:0,primitiveLength:0},Ge!==void 0&&(rt.sortKey=Ge),this.segments.push(rt)),rt}get(){return this.segments}destroy(){for(const B of this.segments)for(const oe in B.vaos)B.vaos[oe].destroy()}static simpleSegment(B,oe,Ee,Ge){return new En([{vertexOffset:B,primitiveOffset:oe,vertexLength:Ee,primitiveLength:Ge,vaos:{},sortKey:0}])}}function Un(Q,B){return 256*(Q=A(Math.floor(Q),0,255))+A(Math.floor(B),0,255)}En.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ii("SegmentVector",En);const Gn=It([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Xa={exports:{}},Kn={exports:{}};Kn.exports=function(Q,B){var oe,Ee,Ge,rt,st,kt,Ht,sr;for(Ee=Q.length-(oe=3&Q.length),Ge=B,st=3432918353,kt=461845907,sr=0;sr>>16)*st&65535)<<16)&4294967295)<<15|Ht>>>17))*kt+(((Ht>>>16)*kt&65535)<<16)&4294967295)<<13|Ge>>>19))+((5*(Ge>>>16)&65535)<<16)&4294967295))+((58964+(rt>>>16)&65535)<<16);switch(Ht=0,oe){case 3:Ht^=(255&Q.charCodeAt(sr+2))<<16;case 2:Ht^=(255&Q.charCodeAt(sr+1))<<8;case 1:Ge^=Ht=(65535&(Ht=(Ht=(65535&(Ht^=255&Q.charCodeAt(sr)))*st+(((Ht>>>16)*st&65535)<<16)&4294967295)<<15|Ht>>>17))*kt+(((Ht>>>16)*kt&65535)<<16)&4294967295}return Ge^=Q.length,Ge=2246822507*(65535&(Ge^=Ge>>>16))+((2246822507*(Ge>>>16)&65535)<<16)&4294967295,Ge=3266489909*(65535&(Ge^=Ge>>>13))+((3266489909*(Ge>>>16)&65535)<<16)&4294967295,(Ge^=Ge>>>16)>>>0};var ma=Kn.exports,Aa={exports:{}};Aa.exports=function(Q,B){for(var oe,Ee=Q.length,Ge=B^Ee,rt=0;Ee>=4;)oe=1540483477*(65535&(oe=255&Q.charCodeAt(rt)|(255&Q.charCodeAt(++rt))<<8|(255&Q.charCodeAt(++rt))<<16|(255&Q.charCodeAt(++rt))<<24))+((1540483477*(oe>>>16)&65535)<<16),Ge=1540483477*(65535&Ge)+((1540483477*(Ge>>>16)&65535)<<16)^(oe=1540483477*(65535&(oe^=oe>>>24))+((1540483477*(oe>>>16)&65535)<<16)),Ee-=4,++rt;switch(Ee){case 3:Ge^=(255&Q.charCodeAt(rt+2))<<16;case 2:Ge^=(255&Q.charCodeAt(rt+1))<<8;case 1:Ge=1540483477*(65535&(Ge^=255&Q.charCodeAt(rt)))+((1540483477*(Ge>>>16)&65535)<<16)}return Ge=1540483477*(65535&(Ge^=Ge>>>13))+((1540483477*(Ge>>>16)&65535)<<16),(Ge^=Ge>>>15)>>>0};var Va=ma,Za=Aa.exports;Xa.exports=Va,Xa.exports.murmur3=Va,Xa.exports.murmur2=Za;var Ta=a(Xa.exports);class Ii{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(B,oe,Ee,Ge){this.ids.push(wo(B)),this.positions.push(oe,Ee,Ge)}getPositions(B){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const oe=wo(B);let Ee=0,Ge=this.ids.length-1;for(;Ee>1;this.ids[st]>=oe?Ge=st:Ee=st+1}const rt=[];for(;this.ids[Ee]===oe;)rt.push({index:this.positions[3*Ee],start:this.positions[3*Ee+1],end:this.positions[3*Ee+2]}),Ee++;return rt}static serialize(B,oe){const Ee=new Float64Array(B.ids),Ge=new Uint32Array(B.positions);return so(Ee,Ge,0,Ee.length-1),oe&&oe.push(Ee.buffer,Ge.buffer),{ids:Ee,positions:Ge}}static deserialize(B){const oe=new Ii;return oe.ids=B.ids,oe.positions=B.positions,oe.indexed=!0,oe}}function wo(Q){const B=+Q;return!isNaN(B)&&B<=Number.MAX_SAFE_INTEGER?B:Ta(String(Q))}function so(Q,B,oe,Ee){for(;oe>1];let rt=oe-1,st=Ee+1;for(;;){do rt++;while(Q[rt]Ge);if(rt>=st)break;yo(Q,rt,st),yo(B,3*rt,3*st),yo(B,3*rt+1,3*st+1),yo(B,3*rt+2,3*st+2)}st-oe`u_${Ge}`),this.type=Ee}setUniform(B,oe,Ee){B.set(Ee.constantOr(this.value))}getBinding(B,oe,Ee){return this.type==="color"?new Qo(B,oe):new Yo(B,oe)}}class wu{constructor(B,oe){this.uniformNames=oe.map(Ee=>`u_${Ee}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(B,oe){this.pixelRatioFrom=oe.pixelRatio,this.pixelRatioTo=B.pixelRatio,this.patternFrom=oe.tlbr,this.patternTo=B.tlbr}setUniform(B,oe,Ee,Ge){const rt=Ge==="u_pattern_to"?this.patternTo:Ge==="u_pattern_from"?this.patternFrom:Ge==="u_pixel_ratio_to"?this.pixelRatioTo:Ge==="u_pixel_ratio_from"?this.pixelRatioFrom:null;rt&&B.set(rt)}getBinding(B,oe,Ee){return Ee.substr(0,9)==="u_pattern"?new pl(B,oe):new Yo(B,oe)}}class zo{constructor(B,oe,Ee,Ge){this.expression=B,this.type=Ee,this.maxValue=0,this.paintVertexAttributes=oe.map(rt=>({name:`a_${rt}`,type:"Float32",components:Ee==="color"?2:1,offset:0})),this.paintVertexArray=new Ge}populatePaintArray(B,oe,Ee,Ge,rt){const st=this.paintVertexArray.length,kt=this.expression.evaluate(new Fl(0),oe,{},Ge,[],rt);this.paintVertexArray.resize(B),this._setPaintValue(st,B,kt)}updatePaintArray(B,oe,Ee,Ge){const rt=this.expression.evaluate({zoom:0},Ee,Ge);this._setPaintValue(B,oe,rt)}_setPaintValue(B,oe,Ee){if(this.type==="color"){const Ge=Tl(Ee);for(let rt=B;rt`u_${kt}_t`),this.type=Ee,this.useIntegerZoom=Ge,this.zoom=rt,this.maxValue=0,this.paintVertexAttributes=oe.map(kt=>({name:`a_${kt}`,type:"Float32",components:Ee==="color"?4:2,offset:0})),this.paintVertexArray=new st}populatePaintArray(B,oe,Ee,Ge,rt){const st=this.expression.evaluate(new Fl(this.zoom),oe,{},Ge,[],rt),kt=this.expression.evaluate(new Fl(this.zoom+1),oe,{},Ge,[],rt),Ht=this.paintVertexArray.length;this.paintVertexArray.resize(B),this._setPaintValue(Ht,B,st,kt)}updatePaintArray(B,oe,Ee,Ge){const rt=this.expression.evaluate({zoom:this.zoom},Ee,Ge),st=this.expression.evaluate({zoom:this.zoom+1},Ee,Ge);this._setPaintValue(B,oe,rt,st)}_setPaintValue(B,oe,Ee,Ge){if(this.type==="color"){const rt=Tl(Ee),st=Tl(Ge);for(let kt=B;kt`#define HAS_UNIFORM_${Ge}`))}return B}getBinderAttributes(){const B=[];for(const oe in this.binders){const Ee=this.binders[oe];if(Ee instanceof zo||Ee instanceof Ks)for(let Ge=0;Ge!0){this.programConfigurations={};for(const Ge of B)this.programConfigurations[Ge.id]=new yu(Ge,oe,Ee);this.needsUpload=!1,this._featureMap=new Ii,this._bufferOffset=0}populatePaintArrays(B,oe,Ee,Ge,rt,st){for(const kt in this.programConfigurations)this.programConfigurations[kt].populatePaintArrays(B,oe,Ge,rt,st);oe.id!==void 0&&this._featureMap.add(oe.id,Ee,this._bufferOffset,B),this._bufferOffset=B,this.needsUpload=!0}updatePaintArrays(B,oe,Ee,Ge){for(const rt of Ee)this.needsUpload=this.programConfigurations[rt.id].updatePaintArrays(B,this._featureMap,oe,rt,Ge)||this.needsUpload}get(B){return this.programConfigurations[B]}upload(B){if(this.needsUpload){for(const oe in this.programConfigurations)this.programConfigurations[oe].upload(B);this.needsUpload=!1}}destroy(){for(const B in this.programConfigurations)this.programConfigurations[B].destroy()}}function Kc(Q,B){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[Q]||[Q.replace(`${B}-`,"").replace(/-/g,"_")]}function Yl(Q,B,oe){const Ee={color:{source:Dn,composite:Si},number:{source:xn,composite:Dn}},Ge=(function(rt){return{"line-pattern":{source:Ye,composite:Ye},"fill-pattern":{source:Ye,composite:Ye},"fill-extrusion-pattern":{source:Ye,composite:Ye}}[rt]})(Q);return Ge&&Ge[oe]||Ee[B][oe]}ii("ConstantBinder",ec),ii("CrossFadedConstantBinder",wu),ii("SourceExpressionBinder",zo),ii("CrossFadedCompositeBinder",_l),ii("CompositeExpressionBinder",Ks),ii("ProgramConfiguration",yu,{omit:["_buffers"]}),ii("ProgramConfigurationSet",au);const _u=8192,kf=Math.pow(2,14)-1,Ju=-kf-1;function Ct(Q){const B=_u/Q.extent,oe=Q.loadGeometry();for(let Ee=0;Eest.x+1||Htst.y+1)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return oe}function Ir(Q,B){return{type:Q.type,id:Q.id,properties:Q.properties,geometry:B?Ct(Q):[]}}function zr(Q,B,oe,Ee,Ge){Q.emplaceBack(2*B+(Ee+1)/2,2*oe+(Ge+1)/2)}class qn{constructor(B){this.zoom=B.zoom,this.overscaling=B.overscaling,this.layers=B.layers,this.layerIds=this.layers.map(oe=>oe.id),this.index=B.index,this.hasPattern=!1,this.layoutVertexArray=new Zs,this.indexArray=new hr,this.segments=new En,this.programConfigurations=new au(B.layers,B.zoom),this.stateDependentLayerIds=this.layers.filter(oe=>oe.isStateDependent()).map(oe=>oe.id)}populate(B,oe,Ee){const Ge=this.layers[0],rt=[];let st=null,kt=!1;Ge.type==="circle"&&(st=Ge.layout.get("circle-sort-key"),kt=!st.isConstant());for(const{feature:Ht,id:sr,index:Er,sourceLayerIndex:Pr}of B){const nn=this.layers[0]._featureFilter.needGeometry,pn=Ir(Ht,nn);if(!this.layers[0]._featureFilter.filter(new Fl(this.zoom),pn,Ee))continue;const Cn=kt?st.evaluate(pn,{},Ee):void 0,Bn={id:sr,properties:Ht.properties,type:Ht.type,sourceLayerIndex:Pr,index:Er,geometry:nn?pn.geometry:Ct(Ht),patterns:{},sortKey:Cn};rt.push(Bn)}kt&&rt.sort((Ht,sr)=>Ht.sortKey-sr.sortKey);for(const Ht of rt){const{geometry:sr,index:Er,sourceLayerIndex:Pr}=Ht,nn=B[Er].feature;this.addFeature(Ht,sr,Er,Ee),oe.featureIndex.insert(nn,sr,Er,Pr,this.index)}}update(B,oe,Ee){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(B,oe,this.stateDependentLayers,Ee)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(B){this.uploaded||(this.layoutVertexBuffer=B.createVertexBuffer(this.layoutVertexArray,on),this.indexBuffer=B.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(B),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(B,oe,Ee,Ge){for(const rt of oe)for(const st of rt){const kt=st.x,Ht=st.y;if(kt<0||kt>=_u||Ht<0||Ht>=_u)continue;const sr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,B.sortKey),Er=sr.vertexLength;zr(this.layoutVertexArray,kt,Ht,-1,-1),zr(this.layoutVertexArray,kt,Ht,1,-1),zr(this.layoutVertexArray,kt,Ht,1,1),zr(this.layoutVertexArray,kt,Ht,-1,1),this.indexArray.emplaceBack(Er,Er+1,Er+2),this.indexArray.emplaceBack(Er,Er+3,Er+2),sr.vertexLength+=4,sr.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,B,Ee,{},Ge)}}function Ca(Q,B){for(let oe=0;oe1){if(Ja(Q,B))return!0;for(let Ee=0;Ee1?oe:oe.sub(B)._mult(Ge)._add(B))}function Hi(Q,B){let oe,Ee,Ge,rt=!1;for(let st=0;stB.y!=Ge.y>B.y&&B.x<(Ge.x-Ee.x)*(B.y-Ee.y)/(Ge.y-Ee.y)+Ee.x&&(rt=!rt)}return rt}function hi(Q,B){let oe=!1;for(let Ee=0,Ge=Q.length-1;EeB.y!=st.y>B.y&&B.x<(st.x-rt.x)*(B.y-rt.y)/(st.y-rt.y)+rt.x&&(oe=!oe)}return oe}function za(Q,B,oe){const Ee=oe[0],Ge=oe[2];if(Q.xGe.x&&B.x>Ge.x||Q.yGe.y&&B.y>Ge.y)return!1;const rt=F(Q,B,oe[0]);return rt!==F(Q,B,oe[1])||rt!==F(Q,B,oe[2])||rt!==F(Q,B,oe[3])}function gn(Q,B,oe){const Ee=B.paint.get(Q).value;return Ee.kind==="constant"?Ee.value:oe.programConfigurations.get(B.id).getMaxValue(Q)}function ea(Q){return Math.sqrt(Q[0]*Q[0]+Q[1]*Q[1])}function ga(Q,B,oe,Ee,Ge){if(!B[0]&&!B[1])return Q;const rt=s.convert(B)._mult(Ge);oe==="viewport"&&rt._rotate(-Ee);const st=[];for(let kt=0;ktlo(ta,Bn))})(sr,Ht),pn=Pr?Er*kt:Er;for(const Cn of Ge)for(const Bn of Cn){const ta=Pr?Bn:lo(Bn,Ht);let Da=pn;const Di=yi([],[Bn.x,Bn.y,0,1],Ht);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Da*=Di[3]/st.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Da*=st.cameraToCenterDistance/Di[3]),Ln(nn,ta,Da))return!0}return!1}}function lo(Q,B){const oe=yi([],[Q.x,Q.y,0,1],B);return new s(oe[0]/oe[3],oe[1]/oe[3])}class Jo extends qn{}let Wi;ii("HeatmapBucket",Jo,{omit:["layers"]});var vo={get paint(){return Wi=Wi||new Qe({"heatmap-radius":new Ss(pe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ss(pe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new hs(pe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new vf(pe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new hs(pe.paint_heatmap["heatmap-opacity"])})}};function vi(Q,{width:B,height:oe},Ee,Ge){if(Ge){if(Ge instanceof Uint8ClampedArray)Ge=new Uint8Array(Ge.buffer);else if(Ge.length!==B*oe*Ee)throw new RangeError(`mismatched image size. expected: ${Ge.length} but got: ${B*oe*Ee}`)}else Ge=new Uint8Array(B*oe*Ee);return Q.width=B,Q.height=oe,Q.data=Ge,Q}function Ho(Q,{width:B,height:oe},Ee){if(B===Q.width&&oe===Q.height)return;const Ge=vi({},{width:B,height:oe},Ee);us(Q,Ge,{x:0,y:0},{x:0,y:0},{width:Math.min(Q.width,B),height:Math.min(Q.height,oe)},Ee),Q.width=B,Q.height=oe,Q.data=Ge.data}function us(Q,B,oe,Ee,Ge,rt){if(Ge.width===0||Ge.height===0)return B;if(Ge.width>Q.width||Ge.height>Q.height||oe.x>Q.width-Ge.width||oe.y>Q.height-Ge.height)throw new RangeError("out of range source coordinates for image copy");if(Ge.width>B.width||Ge.height>B.height||Ee.x>B.width-Ge.width||Ee.y>B.height-Ge.height)throw new RangeError("out of range destination coordinates for image copy");const st=Q.data,kt=B.data;if(st===kt)throw new Error("srcData equals dstData, so image is already copied");for(let Ht=0;Ht{B[Q.evaluationKey]=Ht;const sr=Q.expression.evaluate(B);Ge.data[st+kt+0]=Math.floor(255*sr.r/sr.a),Ge.data[st+kt+1]=Math.floor(255*sr.g/sr.a),Ge.data[st+kt+2]=Math.floor(255*sr.b/sr.a),Ge.data[st+kt+3]=Math.floor(255*sr.a)};if(Q.clips)for(let st=0,kt=0;st80*oe){kt=1/0,Ht=1/0;let Er=-1/0,Pr=-1/0;for(let nn=oe;nnEr&&(Er=pn),Cn>Pr&&(Pr=Cn)}sr=Math.max(Er-kt,Pr-Ht),sr=sr!==0?32767/sr:0}return sl(rt,st,oe,kt,Ht,sr,0),st}function Fo(Q,B,oe,Ee,Ge){let rt;if(Ge===(function(st,kt,Ht,sr){let Er=0;for(let Pr=kt,nn=Ht-sr;Pr0)for(let st=B;st=B;st-=Ee)rt=nr(st/Ee|0,Q[st],Q[st+1],rt);return rt&&wt(rt,rt.next)&&(cr(rt),rt=rt.next),rt}function bc(Q,B){if(!Q)return Q;B||(B=Q);let oe,Ee=Q;do if(oe=!1,Ee.steiner||!wt(Ee,Ee.next)&&tt(Ee.prev,Ee,Ee.next)!==0)Ee=Ee.next;else{if(cr(Ee),Ee=B=Ee.prev,Ee===Ee.next)break;oe=!0}while(oe||Ee!==B);return B}function sl(Q,B,oe,Ee,Ge,rt,st){if(!Q)return;!st&&rt&&(function(Ht,sr,Er,Pr){let nn=Ht;do nn.z===0&&(nn.z=X(nn.x,nn.y,sr,Er,Pr)),nn.prevZ=nn.prev,nn.nextZ=nn.next,nn=nn.next;while(nn!==Ht);nn.prevZ.nextZ=null,nn.prevZ=null,(function(pn){let Cn,Bn=1;do{let ta,Da=pn;pn=null;let Di=null;for(Cn=0;Da;){Cn++;let ni=Da,Ti=0;for(let Oo=0;Oo0||uo>0&∋)Ti!==0&&(uo===0||!ni||Da.z<=ni.z)?(ta=Da,Da=Da.nextZ,Ti--):(ta=ni,ni=ni.nextZ,uo--),Di?Di.nextZ=ta:pn=ta,ta.prevZ=Di,Di=ta;Da=ni}Di.nextZ=null,Bn*=2}while(Cn>1)})(nn)})(Q,Ee,Ge,rt);let kt=Q;for(;Q.prev!==Q.next;){const Ht=Q.prev,sr=Q.next;if(rt?Fc(Q,Ee,Ge,rt):iu(Q))B.push(Ht.i,Q.i,sr.i),cr(Q),Q=sr.next,kt=sr.next;else if((Q=sr)===kt){st?st===1?sl(Q=Bc(bc(Q),B),B,oe,Ee,Ge,rt,2):st===2&&Zo(Q,B,oe,Ee,Ge,rt):sl(bc(Q),B,oe,Ee,Ge,rt,1);break}}}function iu(Q){const B=Q.prev,oe=Q,Ee=Q.next;if(tt(B,oe,Ee)>=0)return!1;const Ge=B.x,rt=oe.x,st=Ee.x,kt=B.y,Ht=oe.y,sr=Ee.y,Er=Gert?Ge>st?Ge:st:rt>st?rt:st,pn=kt>Ht?kt>sr?kt:sr:Ht>sr?Ht:sr;let Cn=Ee.next;for(;Cn!==B;){if(Cn.x>=Er&&Cn.x<=nn&&Cn.y>=Pr&&Cn.y<=pn&&ie(Ge,kt,rt,Ht,st,sr,Cn.x,Cn.y)&&tt(Cn.prev,Cn,Cn.next)>=0)return!1;Cn=Cn.next}return!0}function Fc(Q,B,oe,Ee){const Ge=Q.prev,rt=Q,st=Q.next;if(tt(Ge,rt,st)>=0)return!1;const kt=Ge.x,Ht=rt.x,sr=st.x,Er=Ge.y,Pr=rt.y,nn=st.y,pn=ktHt?kt>sr?kt:sr:Ht>sr?Ht:sr,ta=Er>Pr?Er>nn?Er:nn:Pr>nn?Pr:nn,Da=X(pn,Cn,B,oe,Ee),Di=X(Bn,ta,B,oe,Ee);let ni=Q.prevZ,Ti=Q.nextZ;for(;ni&&ni.z>=Da&&Ti&&Ti.z<=Di;){if(ni.x>=pn&&ni.x<=Bn&&ni.y>=Cn&&ni.y<=ta&&ni!==Ge&&ni!==st&&ie(kt,Er,Ht,Pr,sr,nn,ni.x,ni.y)&&tt(ni.prev,ni,ni.next)>=0||(ni=ni.prevZ,Ti.x>=pn&&Ti.x<=Bn&&Ti.y>=Cn&&Ti.y<=ta&&Ti!==Ge&&Ti!==st&&ie(kt,Er,Ht,Pr,sr,nn,Ti.x,Ti.y)&&tt(Ti.prev,Ti,Ti.next)>=0))return!1;Ti=Ti.nextZ}for(;ni&&ni.z>=Da;){if(ni.x>=pn&&ni.x<=Bn&&ni.y>=Cn&&ni.y<=ta&&ni!==Ge&&ni!==st&&ie(kt,Er,Ht,Pr,sr,nn,ni.x,ni.y)&&tt(ni.prev,ni,ni.next)>=0)return!1;ni=ni.prevZ}for(;Ti&&Ti.z<=Di;){if(Ti.x>=pn&&Ti.x<=Bn&&Ti.y>=Cn&&Ti.y<=ta&&Ti!==Ge&&Ti!==st&&ie(kt,Er,Ht,Pr,sr,nn,Ti.x,Ti.y)&&tt(Ti.prev,Ti,Ti.next)>=0)return!1;Ti=Ti.nextZ}return!0}function Bc(Q,B){let oe=Q;do{const Ee=oe.prev,Ge=oe.next.next;!wt(Ee,Ge)&&Et(Ee,oe,oe.next,Ge)&&Pt(Ee,Ge)&&Pt(Ge,Ee)&&(B.push(Ee.i,oe.i,Ge.i),cr(oe),cr(oe.next),oe=Q=Ge),oe=oe.next}while(oe!==Q);return bc(oe)}function Zo(Q,B,oe,Ee,Ge,rt){let st=Q;do{let kt=st.next.next;for(;kt!==st.prev;){if(st.i!==kt.i&&Me(st,kt)){let Ht=lr(st,kt);return st=bc(st,st.next),Ht=bc(Ht,Ht.next),sl(st,B,oe,Ee,Ge,rt,0),void sl(Ht,B,oe,Ee,Ge,rt,0)}kt=kt.next}st=st.next}while(st!==Q)}function Ds(Q,B){return Q.x-B.x}function Bs(Q,B){const oe=(function(Ge,rt){let st=rt;const kt=Ge.x,Ht=Ge.y;let sr,Er=-1/0;do{if(Ht<=st.y&&Ht>=st.next.y&&st.next.y!==st.y){const Bn=st.x+(Ht-st.y)*(st.next.x-st.x)/(st.next.y-st.y);if(Bn<=kt&&Bn>Er&&(Er=Bn,sr=st.x=st.x&&st.x>=nn&&kt!==st.x&&ie(Htsr.x||st.x===sr.x&&Le(sr,st)))&&(sr=st,Cn=Bn)}st=st.next}while(st!==Pr);return sr})(Q,B);if(!oe)return B;const Ee=lr(oe,Q);return bc(Ee,Ee.next),bc(oe,oe.next)}function Le(Q,B){return tt(Q.prev,Q,B.prev)<0&&tt(B.next,Q,Q.next)<0}function X(Q,B,oe,Ee,Ge){return(Q=1431655765&((Q=858993459&((Q=252645135&((Q=16711935&((Q=(Q-oe)*Ge|0)|Q<<8))|Q<<4))|Q<<2))|Q<<1))|(B=1431655765&((B=858993459&((B=252645135&((B=16711935&((B=(B-Ee)*Ge|0)|B<<8))|B<<4))|B<<2))|B<<1))<<1}function we(Q){let B=Q,oe=Q;do(B.x=(Q-st)*(rt-kt)&&(Q-st)*(Ee-kt)>=(oe-st)*(B-kt)&&(oe-st)*(rt-kt)>=(Ge-st)*(Ee-kt)}function Me(Q,B){return Q.next.i!==B.i&&Q.prev.i!==B.i&&!(function(oe,Ee){let Ge=oe;do{if(Ge.i!==oe.i&&Ge.next.i!==oe.i&&Ge.i!==Ee.i&&Ge.next.i!==Ee.i&&Et(Ge,Ge.next,oe,Ee))return!0;Ge=Ge.next}while(Ge!==oe);return!1})(Q,B)&&(Pt(Q,B)&&Pt(B,Q)&&(function(oe,Ee){let Ge=oe,rt=!1;const st=(oe.x+Ee.x)/2,kt=(oe.y+Ee.y)/2;do Ge.y>kt!=Ge.next.y>kt&&Ge.next.y!==Ge.y&&st<(Ge.next.x-Ge.x)*(kt-Ge.y)/(Ge.next.y-Ge.y)+Ge.x&&(rt=!rt),Ge=Ge.next;while(Ge!==oe);return rt})(Q,B)&&(tt(Q.prev,Q,B.prev)||tt(Q,B.prev,B))||wt(Q,B)&&tt(Q.prev,Q,Q.next)>0&&tt(B.prev,B,B.next)>0)}function tt(Q,B,oe){return(B.y-Q.y)*(oe.x-B.x)-(B.x-Q.x)*(oe.y-B.y)}function wt(Q,B){return Q.x===B.x&&Q.y===B.y}function Et(Q,B,oe,Ee){const Ge=gt(tt(Q,B,oe)),rt=gt(tt(Q,B,Ee)),st=gt(tt(oe,Ee,Q)),kt=gt(tt(oe,Ee,B));return Ge!==rt&&st!==kt||!(Ge!==0||!lt(Q,oe,B))||!(rt!==0||!lt(Q,Ee,B))||!(st!==0||!lt(oe,Q,Ee))||!(kt!==0||!lt(oe,B,Ee))}function lt(Q,B,oe){return B.x<=Math.max(Q.x,oe.x)&&B.x>=Math.min(Q.x,oe.x)&&B.y<=Math.max(Q.y,oe.y)&&B.y>=Math.min(Q.y,oe.y)}function gt(Q){return Q>0?1:Q<0?-1:0}function Pt(Q,B){return tt(Q.prev,Q,Q.next)<0?tt(Q,B,Q.next)>=0&&tt(Q,Q.prev,B)>=0:tt(Q,B,Q.prev)<0||tt(Q,Q.next,B)<0}function lr(Q,B){const oe=gr(Q.i,Q.x,Q.y),Ee=gr(B.i,B.x,B.y),Ge=Q.next,rt=B.prev;return Q.next=B,B.prev=Q,oe.next=Ge,Ge.prev=oe,Ee.next=oe,oe.prev=Ee,rt.next=Ee,Ee.prev=rt,Ee}function nr(Q,B,oe,Ee){const Ge=gr(Q,B,oe);return Ee?(Ge.next=Ee.next,Ge.prev=Ee,Ee.next.prev=Ge,Ee.next=Ge):(Ge.prev=Ge,Ge.next=Ge),Ge}function cr(Q){Q.next.prev=Q.prev,Q.prev.next=Q.next,Q.prevZ&&(Q.prevZ.nextZ=Q.nextZ),Q.nextZ&&(Q.nextZ.prevZ=Q.prevZ)}function gr(Q,B,oe){return{i:Q,x:B,y:oe,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function pr(Q,B,oe){const Ee=oe.patternDependencies;let Ge=!1;for(const rt of B){const st=rt.paint.get(`${Q}-pattern`);st.isConstant()||(Ge=!0);const kt=st.constantOr(null);kt&&(Ge=!0,Ee[kt.to]=!0,Ee[kt.from]=!0)}return Ge}function Jt(Q,B,oe,Ee,Ge){const rt=Ge.patternDependencies;for(const st of B){const kt=st.paint.get(`${Q}-pattern`).value;if(kt.kind!=="constant"){let Ht=kt.evaluate({zoom:Ee-1},oe,{},Ge.availableImages),sr=kt.evaluate({zoom:Ee},oe,{},Ge.availableImages),Er=kt.evaluate({zoom:Ee+1},oe,{},Ge.availableImages);Ht=Ht&&Ht.name?Ht.name:Ht,sr=sr&&sr.name?sr.name:sr,Er=Er&&Er.name?Er.name:Er,rt[Ht]=!0,rt[sr]=!0,rt[Er]=!0,oe.patterns[st.id]={min:Ht,mid:sr,max:Er}}}return oe}class or{constructor(B){this.zoom=B.zoom,this.overscaling=B.overscaling,this.layers=B.layers,this.layerIds=this.layers.map(oe=>oe.id),this.index=B.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Qu,this.indexArray=new hr,this.indexArray2=new Rr,this.programConfigurations=new au(B.layers,B.zoom),this.segments=new En,this.segments2=new En,this.stateDependentLayerIds=this.layers.filter(oe=>oe.isStateDependent()).map(oe=>oe.id)}populate(B,oe,Ee){this.hasPattern=pr("fill",this.layers,oe);const Ge=this.layers[0].layout.get("fill-sort-key"),rt=!Ge.isConstant(),st=[];for(const{feature:kt,id:Ht,index:sr,sourceLayerIndex:Er}of B){const Pr=this.layers[0]._featureFilter.needGeometry,nn=Ir(kt,Pr);if(!this.layers[0]._featureFilter.filter(new Fl(this.zoom),nn,Ee))continue;const pn=rt?Ge.evaluate(nn,{},Ee,oe.availableImages):void 0,Cn={id:Ht,properties:kt.properties,type:kt.type,sourceLayerIndex:Er,index:sr,geometry:Pr?nn.geometry:Ct(kt),patterns:{},sortKey:pn};st.push(Cn)}rt&&st.sort((kt,Ht)=>kt.sortKey-Ht.sortKey);for(const kt of st){const{geometry:Ht,index:sr,sourceLayerIndex:Er}=kt;if(this.hasPattern){const Pr=Jt("fill",this.layers,kt,this.zoom,oe);this.patternFeatures.push(Pr)}else this.addFeature(kt,Ht,sr,Ee,{});oe.featureIndex.insert(B[sr].feature,Ht,sr,Er,this.index)}}update(B,oe,Ee){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(B,oe,this.stateDependentLayers,Ee)}addFeatures(B,oe,Ee){for(const Ge of this.patternFeatures)this.addFeature(Ge,Ge.geometry,Ge.index,oe,Ee)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(B){this.uploaded||(this.layoutVertexBuffer=B.createVertexBuffer(this.layoutVertexArray,Tu),this.indexBuffer=B.createIndexBuffer(this.indexArray),this.indexBuffer2=B.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(B),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(B,oe,Ee,Ge,rt){for(const st of Tf(oe,500)){let kt=0;for(const pn of st)kt+=pn.length;const Ht=this.segments.prepareSegment(kt,this.layoutVertexArray,this.indexArray),sr=Ht.vertexLength,Er=[],Pr=[];for(const pn of st){if(pn.length===0)continue;pn!==st[0]&&Pr.push(Er.length/2);const Cn=this.segments2.prepareSegment(pn.length,this.layoutVertexArray,this.indexArray2),Bn=Cn.vertexLength;this.layoutVertexArray.emplaceBack(pn[0].x,pn[0].y),this.indexArray2.emplaceBack(Bn+pn.length-1,Bn),Er.push(pn[0].x),Er.push(pn[0].y);for(let ta=1;ta>3}if(Ge--,Ee===1||Ee===2)rt+=Q.readSVarint(),st+=Q.readSVarint(),Ee===1&&(B&&kt.push(B),B=[]),B.push(new Ra(rt,st));else{if(Ee!==7)throw new Error("unknown command "+Ee);B&&B.push(B[0].clone())}}return B&&kt.push(B),kt},ka.prototype.bbox=function(){var Q=this._pbf;Q.pos=this._geometry;for(var B=Q.readVarint()+Q.pos,oe=1,Ee=0,Ge=0,rt=0,st=1/0,kt=-1/0,Ht=1/0,sr=-1/0;Q.pos>3}if(Ee--,oe===1||oe===2)(Ge+=Q.readSVarint())kt&&(kt=Ge),(rt+=Q.readSVarint())sr&&(sr=rt);else if(oe!==7)throw new Error("unknown command "+oe)}return[st,Ht,kt,sr]},ka.prototype.toGeoJSON=function(Q,B,oe){var Ee,Ge,rt=this.extent*Math.pow(2,oe),st=this.extent*Q,kt=this.extent*B,Ht=this.loadGeometry(),sr=ka.types[this.type];function Er(pn){for(var Cn=0;Cn>3;Ge=st===1?Ee.readString():st===2?Ee.readFloat():st===3?Ee.readDouble():st===4?Ee.readVarint64():st===5?Ee.readVarint():st===6?Ee.readSVarint():st===7?Ee.readBoolean():null}return Ge})(oe))}Us.prototype.feature=function(Q){if(Q<0||Q>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[Q];var B=this._pbf.readVarint()+this._pbf.pos;return new Ki(this._pbf,B,this.extent,this._keys,this._values)};var Bl=mo;function Pl(Q,B,oe){if(Q===3){var Ee=new Bl(oe,oe.readVarint()+oe.pos);Ee.length&&(B[Ee.name]=Ee)}}Ea.VectorTile=function(Q,B){this.layers=Q.readFields(Pl,{},B)},Ea.VectorTileFeature=Ya,Ea.VectorTileLayer=mo;const $l=Ea.VectorTileFeature.types,Ul=Math.pow(2,13);function wc(Q,B,oe,Ee,Ge,rt,st,kt){Q.emplaceBack(B,oe,2*Math.floor(Ee*Ul)+st,Ge*Ul*2,rt*Ul*2,Math.round(kt))}class Ml{constructor(B){this.zoom=B.zoom,this.overscaling=B.overscaling,this.layers=B.layers,this.layerIds=this.layers.map(oe=>oe.id),this.index=B.index,this.hasPattern=!1,this.layoutVertexArray=new Pc,this.centroidVertexArray=new Ys,this.indexArray=new hr,this.programConfigurations=new au(B.layers,B.zoom),this.segments=new En,this.stateDependentLayerIds=this.layers.filter(oe=>oe.isStateDependent()).map(oe=>oe.id)}populate(B,oe,Ee){this.features=[],this.hasPattern=pr("fill-extrusion",this.layers,oe);for(const{feature:Ge,id:rt,index:st,sourceLayerIndex:kt}of B){const Ht=this.layers[0]._featureFilter.needGeometry,sr=Ir(Ge,Ht);if(!this.layers[0]._featureFilter.filter(new Fl(this.zoom),sr,Ee))continue;const Er={id:rt,sourceLayerIndex:kt,index:st,geometry:Ht?sr.geometry:Ct(Ge),properties:Ge.properties,type:Ge.type,patterns:{}};this.hasPattern?this.features.push(Jt("fill-extrusion",this.layers,Er,this.zoom,oe)):this.addFeature(Er,Er.geometry,st,Ee,{}),oe.featureIndex.insert(Ge,Er.geometry,st,kt,this.index,!0)}}addFeatures(B,oe,Ee){for(const Ge of this.features){const{geometry:rt}=Ge;this.addFeature(Ge,rt,Ge.index,oe,Ee)}}update(B,oe,Ee){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(B,oe,this.stateDependentLayers,Ee)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(B){this.uploaded||(this.layoutVertexBuffer=B.createVertexBuffer(this.layoutVertexArray,la),this.centroidVertexBuffer=B.createVertexBuffer(this.centroidVertexArray,fa.members,!0),this.indexBuffer=B.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(B),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(B,oe,Ee,Ge,rt){for(const st of Tf(oe,500)){const kt={x:0,y:0,vertexCount:0};let Ht=0;for(const Cn of st)Ht+=Cn.length;let sr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const Cn of st){if(Cn.length===0||Mh(Cn))continue;let Bn=0;for(let ta=0;ta=1){const Di=Cn[ta-1];if(!ju(Da,Di)){sr.vertexLength+4>En.MAX_VERTEX_ARRAY_LENGTH&&(sr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const ni=Da.sub(Di)._perp()._unit(),Ti=Di.dist(Da);Bn+Ti>32768&&(Bn=0),wc(this.layoutVertexArray,Da.x,Da.y,ni.x,ni.y,0,0,Bn),wc(this.layoutVertexArray,Da.x,Da.y,ni.x,ni.y,0,1,Bn),kt.x+=2*Da.x,kt.y+=2*Da.y,kt.vertexCount+=2,Bn+=Ti,wc(this.layoutVertexArray,Di.x,Di.y,ni.x,ni.y,0,0,Bn),wc(this.layoutVertexArray,Di.x,Di.y,ni.x,ni.y,0,1,Bn),kt.x+=2*Di.x,kt.y+=2*Di.y,kt.vertexCount+=2;const uo=sr.vertexLength;this.indexArray.emplaceBack(uo,uo+2,uo+1),this.indexArray.emplaceBack(uo+1,uo+2,uo+3),sr.vertexLength+=4,sr.primitiveLength+=2}}}}if(sr.vertexLength+Ht>En.MAX_VERTEX_ARRAY_LENGTH&&(sr=this.segments.prepareSegment(Ht,this.layoutVertexArray,this.indexArray)),$l[B.type]!=="Polygon")continue;const Er=[],Pr=[],nn=sr.vertexLength;for(const Cn of st)if(Cn.length!==0){Cn!==st[0]&&Pr.push(Er.length/2);for(let Bn=0;Bn_u)||Q.y===B.y&&(Q.y<0||Q.y>_u)}function Mh(Q){return Q.every(B=>B.x<0)||Q.every(B=>B.x>_u)||Q.every(B=>B.y<0)||Q.every(B=>B.y>_u)}let ud;ii("FillExtrusionBucket",Ml,{omit:["layers","features"]});var nm={get paint(){return ud=ud||new Qe({"fill-extrusion-opacity":new hs(pe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ss(pe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new hs(pe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new hs(pe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new lh(pe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ss(pe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ss(pe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new hs(pe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class am extends ve{constructor(B){super(B,nm)}createBucket(B){return new Ml(B)}queryRadius(){return ea(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(B,oe,Ee,Ge,rt,st,kt,Ht){const sr=ga(B,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),st.angle,kt),Er=this.paint.get("fill-extrusion-height").evaluate(oe,Ee),Pr=this.paint.get("fill-extrusion-base").evaluate(oe,Ee),nn=(function(Cn,Bn,ta,Da){const Di=[];for(const ni of Cn){const Ti=[ni.x,ni.y,0,1];yi(Ti,Ti,Bn),Di.push(new s(Ti[0]/Ti[3],Ti[1]/Ti[3]))}return Di})(sr,Ht),pn=(function(Cn,Bn,ta,Da){const Di=[],ni=[],Ti=Da[8]*Bn,uo=Da[9]*Bn,Oo=Da[10]*Bn,ms=Da[11]*Bn,zl=Da[8]*ta,Es=Da[9]*ta,ds=Da[10]*ta,tl=Da[11]*ta;for(const Hs of Cn){const Vs=[],Co=[];for(const cl of Hs){const rl=cl.x,Ql=cl.y,Of=Da[0]*rl+Da[4]*Ql+Da[12],Mf=Da[1]*rl+Da[5]*Ql+Da[13],Qd=Da[2]*rl+Da[6]*Ql+Da[14],Lv=Da[3]*rl+Da[7]*Ql+Da[15],cd=Qd+Oo,Ud=Lv+ms,gv=Of+zl,yv=Mf+Es,_v=Qd+ds,Ih=Lv+tl,ep=new s((Of+Ti)/Ud,(Mf+uo)/Ud);ep.z=cd/Ud,Vs.push(ep);const nv=new s(gv/Ih,yv/Ih);nv.z=_v/Ih,Co.push(nv)}Di.push(Vs),ni.push(Co)}return[Di,ni]})(Ge,Pr,Er,Ht);return(function(Cn,Bn,ta){let Da=1/0;Mn(ta,Bn)&&(Da=Lm(ta,Bn[0]));for(let Di=0;Dioe.id),this.index=B.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(oe=>{this.gradients[oe.id]={}}),this.layoutVertexArray=new mf,this.layoutVertexArray2=new Ce,this.indexArray=new hr,this.programConfigurations=new au(B.layers,B.zoom),this.segments=new En,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(oe=>oe.isStateDependent()).map(oe=>oe.id)}populate(B,oe,Ee){this.hasPattern=pr("line",this.layers,oe);const Ge=this.layers[0].layout.get("line-sort-key"),rt=!Ge.isConstant(),st=[];for(const{feature:kt,id:Ht,index:sr,sourceLayerIndex:Er}of B){const Pr=this.layers[0]._featureFilter.needGeometry,nn=Ir(kt,Pr);if(!this.layers[0]._featureFilter.filter(new Fl(this.zoom),nn,Ee))continue;const pn=rt?Ge.evaluate(nn,{},Ee):void 0,Cn={id:Ht,properties:kt.properties,type:kt.type,sourceLayerIndex:Er,index:sr,geometry:Pr?nn.geometry:Ct(kt),patterns:{},sortKey:pn};st.push(Cn)}rt&&st.sort((kt,Ht)=>kt.sortKey-Ht.sortKey);for(const kt of st){const{geometry:Ht,index:sr,sourceLayerIndex:Er}=kt;if(this.hasPattern){const Pr=Jt("line",this.layers,kt,this.zoom,oe);this.patternFeatures.push(Pr)}else this.addFeature(kt,Ht,sr,Ee,{});oe.featureIndex.insert(B[sr].feature,Ht,sr,Er,this.index)}}update(B,oe,Ee){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(B,oe,this.stateDependentLayers,Ee)}addFeatures(B,oe,Ee){for(const Ge of this.patternFeatures)this.addFeature(Ge,Ge.geometry,Ge.index,oe,Ee)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(B){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=B.createVertexBuffer(this.layoutVertexArray2,Qm)),this.layoutVertexBuffer=B.createVertexBuffer(this.layoutVertexArray,Jm),this.indexBuffer=B.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(B),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(B){if(B.properties&&Object.prototype.hasOwnProperty.call(B.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(B.properties,"mapbox_clip_end"))return{start:+B.properties.mapbox_clip_start,end:+B.properties.mapbox_clip_end}}addFeature(B,oe,Ee,Ge,rt){const st=this.layers[0].layout,kt=st.get("line-join").evaluate(B,{}),Ht=st.get("line-cap"),sr=st.get("line-miter-limit"),Er=st.get("line-round-limit");this.lineClips=this.lineFeatureClips(B);for(const Pr of oe)this.addLine(Pr,B,kt,Ht,sr,Er);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,B,Ee,rt,Ge)}addLine(B,oe,Ee,Ge,rt,st){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Da=0;Da=2&&B[Ht-1].equals(B[Ht-2]);)Ht--;let sr=0;for(;sr0;if(ms&&Da>sr){const tl=nn.dist(pn);if(tl>2*Er){const Hs=nn.sub(nn.sub(pn)._mult(Er/tl)._round());this.updateDistance(pn,Hs),this.addCurrentVertex(Hs,Bn,0,0,Pr),pn=Hs}}const Es=pn&&Cn;let ds=Es?Ee:kt?"butt":Ge;if(Es&&ds==="round"&&(uort&&(ds="bevel"),ds==="bevel"&&(uo>2&&(ds="flipbevel"),uo100)Di=ta.mult(-1);else{const tl=uo*Bn.add(ta).mag()/Bn.sub(ta).mag();Di._perp()._mult(tl*(zl?-1:1))}this.addCurrentVertex(nn,Di,0,0,Pr),this.addCurrentVertex(nn,Di.mult(-1),0,0,Pr)}else if(ds==="bevel"||ds==="fakeround"){const tl=-Math.sqrt(uo*uo-1),Hs=zl?tl:0,Vs=zl?0:tl;if(pn&&this.addCurrentVertex(nn,Bn,Hs,Vs,Pr),ds==="fakeround"){const Co=Math.round(180*Oo/Math.PI/20);for(let cl=1;cl2*Er){const Hs=nn.add(Cn.sub(nn)._mult(Er/tl)._round());this.updateDistance(nn,Hs),this.addCurrentVertex(Hs,ta,0,0,Pr),nn=Hs}}}}addCurrentVertex(B,oe,Ee,Ge,rt,st=!1){const kt=oe.y*Ge-oe.x,Ht=-oe.y-oe.x*Ge;this.addHalfVertex(B,oe.x+oe.y*Ee,oe.y-oe.x*Ee,st,!1,Ee,rt),this.addHalfVertex(B,kt,Ht,st,!0,-Ge,rt),this.distance>im/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(B,oe,Ee,Ge,rt,st))}addHalfVertex({x:B,y:oe},Ee,Ge,rt,st,kt,Ht){const sr=.5*(this.lineClips?this.scaledDistance*(im-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((B<<1)+(rt?1:0),(oe<<1)+(st?1:0),Math.round(63*Ee)+128,Math.round(63*Ge)+128,1+(kt===0?0:kt<0?-1:1)|(63&sr)<<2,sr>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const Er=Ht.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Er),Ht.primitiveLength++),st?this.e2=Er:this.e1=Er}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(B,oe){this.distance+=B.dist(oe),this.updateScaledDistance()}}let om,a_;ii("LineBucket",Rm,{omit:["layers","patternFeatures"]});var Y0={get paint(){return a_=a_||new Qe({"line-opacity":new Ss(pe.paint_line["line-opacity"]),"line-color":new Ss(pe.paint_line["line-color"]),"line-translate":new hs(pe.paint_line["line-translate"]),"line-translate-anchor":new hs(pe.paint_line["line-translate-anchor"]),"line-width":new Ss(pe.paint_line["line-width"]),"line-gap-width":new Ss(pe.paint_line["line-gap-width"]),"line-offset":new Ss(pe.paint_line["line-offset"]),"line-blur":new Ss(pe.paint_line["line-blur"]),"line-dasharray":new Cf(pe.paint_line["line-dasharray"]),"line-pattern":new lh(pe.paint_line["line-pattern"]),"line-gradient":new vf(pe.paint_line["line-gradient"])})},get layout(){return om=om||new Qe({"line-cap":new hs(pe.layout_line["line-cap"]),"line-join":new Ss(pe.layout_line["line-join"]),"line-miter-limit":new hs(pe.layout_line["line-miter-limit"]),"line-round-limit":new hs(pe.layout_line["line-round-limit"]),"line-sort-key":new Ss(pe.layout_line["line-sort-key"])})}};class Fd extends Ss{possiblyEvaluate(B,oe){return oe=new Fl(Math.floor(oe.zoom),{now:oe.now,fadeDuration:oe.fadeDuration,zoomHistory:oe.zoomHistory,transition:oe.transition}),super.possiblyEvaluate(B,oe)}evaluate(B,oe,Ee,Ge){return oe=I({},oe,{zoom:Math.floor(oe.zoom)}),super.evaluate(B,oe,Ee,Ge)}}let Z0;class i_ extends ve{constructor(B){super(B,Y0),this.gradientVersion=0,Z0||(Z0=new Fd(Y0.paint.properties["line-width"].specification),Z0.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(B){if(B==="line-gradient"){const oe=this.gradientExpression();this.stepInterpolant=!!(function(Ee){return Ee._styleExpression!==void 0})(oe)&&oe._styleExpression.expression instanceof Yn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(B,oe){super.recalculate(B,oe),this.paint._values["line-floorwidth"]=Z0.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,B)}createBucket(B){return new Rm(B)}queryRadius(B){const oe=B,Ee=wp(gn("line-width",this,oe),gn("line-gap-width",this,oe)),Ge=gn("line-offset",this,oe);return Ee/2+Math.abs(Ge)+ea(this.paint.get("line-translate"))}queryIntersectsFeature(B,oe,Ee,Ge,rt,st,kt){const Ht=ga(B,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),st.angle,kt),sr=kt/2*wp(this.paint.get("line-width").evaluate(oe,Ee),this.paint.get("line-gap-width").evaluate(oe,Ee)),Er=this.paint.get("line-offset").evaluate(oe,Ee);return Er&&(Ge=(function(Pr,nn){const pn=[];for(let Cn=0;Cn=3){for(let ta=0;ta0?B+2*Q:Q}const Hy=It([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Lx=It([{name:"a_projected_pos",components:3,type:"Float32"}],4);It([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Rx=It([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);It([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const o_=It([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Wy=It([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Xy(Q,B,oe){return Q.sections.forEach(Ee=>{Ee.text=(function(Ge,rt,st){const kt=rt.layout.get("text-transform").evaluate(st,{});return kt==="uppercase"?Ge=Ge.toLocaleUpperCase():kt==="lowercase"&&(Ge=Ge.toLocaleLowerCase()),nu.applyArabicShaping&&(Ge=nu.applyArabicShaping(Ge)),Ge})(Ee.text,B,oe)}),Q}It([{name:"triangle",components:3,type:"Uint16"}]),It([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),It([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),It([{type:"Float32",name:"offsetX"}]),It([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),It([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Zf={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Uc=24,rv=Jc,s_=function(Q,B,oe,Ee,Ge){var rt,st,kt=8*Ge-Ee-1,Ht=(1<>1,Er=-7,Pr=Ge-1,nn=-1,pn=Q[B+Pr];for(Pr+=nn,rt=pn&(1<<-Er)-1,pn>>=-Er,Er+=kt;Er>0;rt=256*rt+Q[B+Pr],Pr+=nn,Er-=8);for(st=rt&(1<<-Er)-1,rt>>=-Er,Er+=Ee;Er>0;st=256*st+Q[B+Pr],Pr+=nn,Er-=8);if(rt===0)rt=1-sr;else{if(rt===Ht)return st?NaN:1/0*(pn?-1:1);st+=Math.pow(2,Ee),rt-=sr}return(pn?-1:1)*st*Math.pow(2,rt-Ee)},Dx=function(Q,B,oe,Ee,Ge,rt){var st,kt,Ht,sr=8*rt-Ge-1,Er=(1<>1,nn=Ge===23?Math.pow(2,-24)-Math.pow(2,-77):0,pn=0,Cn=1,Bn=B<0||B===0&&1/B<0?1:0;for(B=Math.abs(B),isNaN(B)||B===1/0?(kt=isNaN(B)?1:0,st=Er):(st=Math.floor(Math.log(B)/Math.LN2),B*(Ht=Math.pow(2,-st))<1&&(st--,Ht*=2),(B+=st+Pr>=1?nn/Ht:nn*Math.pow(2,1-Pr))*Ht>=2&&(st++,Ht/=2),st+Pr>=Er?(kt=0,st=Er):st+Pr>=1?(kt=(B*Ht-1)*Math.pow(2,Ge),st+=Pr):(kt=B*Math.pow(2,Pr-1)*Math.pow(2,Ge),st=0));Ge>=8;Q[oe+pn]=255&kt,pn+=Cn,kt/=256,Ge-=8);for(st=st<0;Q[oe+pn]=255&st,pn+=Cn,st/=256,sr-=8);Q[oe+pn-Cn]|=128*Bn};function Jc(Q){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(Q)?Q:new Uint8Array(Q||0),this.pos=0,this.type=0,this.length=this.buf.length}Jc.Varint=0,Jc.Fixed64=1,Jc.Bytes=2,Jc.Fixed32=5;var Xw=4294967296,Yy=1/Xw,BT=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function sm(Q){return Q.type===Jc.Bytes?Q.readVarint()+Q.pos:Q.pos+1}function Zy(Q,B,oe){return oe?4294967296*B+(Q>>>0):4294967296*(B>>>0)+(Q>>>0)}function UT(Q,B,oe){var Ee=B<=16383?1:B<=2097151?2:B<=268435455?3:Math.floor(Math.log(B)/(7*Math.LN2));oe.realloc(Ee);for(var Ge=oe.pos-1;Ge>=Q;Ge--)oe.buf[Ge+Ee]=oe.buf[Ge]}function Yw(Q,B){for(var oe=0;oe>>8,Q[oe+2]=B>>>16,Q[oe+3]=B>>>24}function t6(Q,B){return(Q[B]|Q[B+1]<<8|Q[B+2]<<16)+(Q[B+3]<<24)}Jc.prototype={destroy:function(){this.buf=null},readFields:function(Q,B,oe){for(oe=oe||this.length;this.pos>3,rt=this.pos;this.type=7&Ee,Q(Ge,B,this),this.pos===rt&&this.skip(Ee)}return B},readMessage:function(Q,B){return this.readFields(Q,B,this.readVarint()+this.pos)},readFixed32:function(){var Q=VT(this.buf,this.pos);return this.pos+=4,Q},readSFixed32:function(){var Q=t6(this.buf,this.pos);return this.pos+=4,Q},readFixed64:function(){var Q=VT(this.buf,this.pos)+VT(this.buf,this.pos+4)*Xw;return this.pos+=8,Q},readSFixed64:function(){var Q=VT(this.buf,this.pos)+t6(this.buf,this.pos+4)*Xw;return this.pos+=8,Q},readFloat:function(){var Q=s_(this.buf,this.pos,!0,23,4);return this.pos+=4,Q},readDouble:function(){var Q=s_(this.buf,this.pos,!0,52,8);return this.pos+=8,Q},readVarint:function(Q){var B,oe,Ee=this.buf;return B=127&(oe=Ee[this.pos++]),oe<128?B:(B|=(127&(oe=Ee[this.pos++]))<<7,oe<128?B:(B|=(127&(oe=Ee[this.pos++]))<<14,oe<128?B:(B|=(127&(oe=Ee[this.pos++]))<<21,oe<128?B:(function(Ge,rt,st){var kt,Ht,sr=st.buf;if(kt=(112&(Ht=sr[st.pos++]))>>4,Ht<128||(kt|=(127&(Ht=sr[st.pos++]))<<3,Ht<128)||(kt|=(127&(Ht=sr[st.pos++]))<<10,Ht<128)||(kt|=(127&(Ht=sr[st.pos++]))<<17,Ht<128)||(kt|=(127&(Ht=sr[st.pos++]))<<24,Ht<128)||(kt|=(1&(Ht=sr[st.pos++]))<<31,Ht<128))return Zy(Ge,kt,rt);throw new Error("Expected varint not more than 10 bytes")})(B|=(15&(oe=Ee[this.pos]))<<28,Q,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var Q=this.readVarint();return Q%2==1?(Q+1)/-2:Q/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var Q=this.readVarint()+this.pos,B=this.pos;return this.pos=Q,Q-B>=12&&BT?(function(oe,Ee,Ge){return BT.decode(oe.subarray(Ee,Ge))})(this.buf,B,Q):(function(oe,Ee,Ge){for(var rt="",st=Ee;st239?4:Er>223?3:Er>191?2:1;if(st+nn>Ge)break;nn===1?Er<128&&(Pr=Er):nn===2?(192&(kt=oe[st+1]))==128&&(Pr=(31&Er)<<6|63&kt)<=127&&(Pr=null):nn===3?(Ht=oe[st+2],(192&(kt=oe[st+1]))==128&&(192&Ht)==128&&((Pr=(15&Er)<<12|(63&kt)<<6|63&Ht)<=2047||Pr>=55296&&Pr<=57343)&&(Pr=null)):nn===4&&(Ht=oe[st+2],sr=oe[st+3],(192&(kt=oe[st+1]))==128&&(192&Ht)==128&&(192&sr)==128&&((Pr=(15&Er)<<18|(63&kt)<<12|(63&Ht)<<6|63&sr)<=65535||Pr>=1114112)&&(Pr=null)),Pr===null?(Pr=65533,nn=1):Pr>65535&&(Pr-=65536,rt+=String.fromCharCode(Pr>>>10&1023|55296),Pr=56320|1023&Pr),rt+=String.fromCharCode(Pr),st+=nn}return rt})(this.buf,B,Q)},readBytes:function(){var Q=this.readVarint()+this.pos,B=this.buf.subarray(this.pos,Q);return this.pos=Q,B},readPackedVarint:function(Q,B){if(this.type!==Jc.Bytes)return Q.push(this.readVarint(B));var oe=sm(this);for(Q=Q||[];this.pos127;);else if(B===Jc.Bytes)this.pos=this.readVarint()+this.pos;else if(B===Jc.Fixed32)this.pos+=4;else{if(B!==Jc.Fixed64)throw new Error("Unimplemented type: "+B);this.pos+=8}},writeTag:function(Q,B){this.writeVarint(Q<<3|B)},realloc:function(Q){for(var B=this.length||16;B268435455||Q<0?(function(B,oe){var Ee,Ge;if(B>=0?(Ee=B%4294967296|0,Ge=B/4294967296|0):(Ge=~(-B/4294967296),4294967295^(Ee=~(-B%4294967296))?Ee=Ee+1|0:(Ee=0,Ge=Ge+1|0)),B>=18446744073709552e3||B<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");oe.realloc(10),(function(rt,st,kt){kt.buf[kt.pos++]=127&rt|128,rt>>>=7,kt.buf[kt.pos++]=127&rt|128,rt>>>=7,kt.buf[kt.pos++]=127&rt|128,rt>>>=7,kt.buf[kt.pos++]=127&rt|128,kt.buf[kt.pos]=127&(rt>>>=7)})(Ee,0,oe),(function(rt,st){var kt=(7&rt)<<4;st.buf[st.pos++]|=kt|((rt>>>=3)?128:0),rt&&(st.buf[st.pos++]=127&rt|((rt>>>=7)?128:0),rt&&(st.buf[st.pos++]=127&rt|((rt>>>=7)?128:0),rt&&(st.buf[st.pos++]=127&rt|((rt>>>=7)?128:0),rt&&(st.buf[st.pos++]=127&rt|((rt>>>=7)?128:0),rt&&(st.buf[st.pos++]=127&rt)))))})(Ge,oe)})(Q,this):(this.realloc(4),this.buf[this.pos++]=127&Q|(Q>127?128:0),Q<=127||(this.buf[this.pos++]=127&(Q>>>=7)|(Q>127?128:0),Q<=127||(this.buf[this.pos++]=127&(Q>>>=7)|(Q>127?128:0),Q<=127||(this.buf[this.pos++]=Q>>>7&127))))},writeSVarint:function(Q){this.writeVarint(Q<0?2*-Q-1:2*Q)},writeBoolean:function(Q){this.writeVarint(!!Q)},writeString:function(Q){Q=String(Q),this.realloc(4*Q.length),this.pos++;var B=this.pos;this.pos=(function(Ee,Ge,rt){for(var st,kt,Ht=0;Ht55295&&st<57344){if(!kt){st>56319||Ht+1===Ge.length?(Ee[rt++]=239,Ee[rt++]=191,Ee[rt++]=189):kt=st;continue}if(st<56320){Ee[rt++]=239,Ee[rt++]=191,Ee[rt++]=189,kt=st;continue}st=kt-55296<<10|st-56320|65536,kt=null}else kt&&(Ee[rt++]=239,Ee[rt++]=191,Ee[rt++]=189,kt=null);st<128?Ee[rt++]=st:(st<2048?Ee[rt++]=st>>6|192:(st<65536?Ee[rt++]=st>>12|224:(Ee[rt++]=st>>18|240,Ee[rt++]=st>>12&63|128),Ee[rt++]=st>>6&63|128),Ee[rt++]=63&st|128)}return rt})(this.buf,Q,this.pos);var oe=this.pos-B;oe>=128&&UT(B,oe,this),this.pos=B-1,this.writeVarint(oe),this.pos+=oe},writeFloat:function(Q){this.realloc(4),Dx(this.buf,Q,this.pos,!0,23,4),this.pos+=4},writeDouble:function(Q){this.realloc(8),Dx(this.buf,Q,this.pos,!0,52,8),this.pos+=8},writeBytes:function(Q){var B=Q.length;this.writeVarint(B),this.realloc(B);for(var oe=0;oe=128&&UT(oe,Ee,this),this.pos=oe-1,this.writeVarint(Ee),this.pos+=Ee},writeMessage:function(Q,B,oe){this.writeTag(Q,Jc.Bytes),this.writeRawMessage(B,oe)},writePackedVarint:function(Q,B){B.length&&this.writeMessage(Q,Yw,B)},writePackedSVarint:function(Q,B){B.length&&this.writeMessage(Q,l4,B)},writePackedBoolean:function(Q,B){B.length&&this.writeMessage(Q,f4,B)},writePackedFloat:function(Q,B){B.length&&this.writeMessage(Q,u4,B)},writePackedDouble:function(Q,B){B.length&&this.writeMessage(Q,c4,B)},writePackedFixed32:function(Q,B){B.length&&this.writeMessage(Q,h4,B)},writePackedSFixed32:function(Q,B){B.length&&this.writeMessage(Q,d4,B)},writePackedFixed64:function(Q,B){B.length&&this.writeMessage(Q,p4,B)},writePackedSFixed64:function(Q,B){B.length&&this.writeMessage(Q,$T,B)},writeBytesField:function(Q,B){this.writeTag(Q,Jc.Bytes),this.writeBytes(B)},writeFixed32Field:function(Q,B){this.writeTag(Q,Jc.Fixed32),this.writeFixed32(B)},writeSFixed32Field:function(Q,B){this.writeTag(Q,Jc.Fixed32),this.writeSFixed32(B)},writeFixed64Field:function(Q,B){this.writeTag(Q,Jc.Fixed64),this.writeFixed64(B)},writeSFixed64Field:function(Q,B){this.writeTag(Q,Jc.Fixed64),this.writeSFixed64(B)},writeVarintField:function(Q,B){this.writeTag(Q,Jc.Varint),this.writeVarint(B)},writeSVarintField:function(Q,B){this.writeTag(Q,Jc.Varint),this.writeSVarint(B)},writeStringField:function(Q,B){this.writeTag(Q,Jc.Bytes),this.writeString(B)},writeFloatField:function(Q,B){this.writeTag(Q,Jc.Fixed32),this.writeFloat(B)},writeDoubleField:function(Q,B){this.writeTag(Q,Jc.Fixed64),this.writeDouble(B)},writeBooleanField:function(Q,B){this.writeVarintField(Q,!!B)}};var sE=a(rv);const jT=3;function v4(Q,B,oe){Q===1&&oe.readMessage(r6,B)}function r6(Q,B,oe){if(Q===3){const{id:Ee,bitmap:Ge,width:rt,height:st,left:kt,top:Ht,advance:sr}=oe.readMessage(lE,{});B.push({id:Ee,bitmap:new _s({width:rt+2*jT,height:st+2*jT},Ge),metrics:{width:rt,height:st,left:kt,top:Ht,advance:sr}})}}function lE(Q,B,oe){Q===1?B.id=oe.readVarint():Q===2?B.bitmap=oe.readBytes():Q===3?B.width=oe.readVarint():Q===4?B.height=oe.readVarint():Q===5?B.left=oe.readSVarint():Q===6?B.top=oe.readSVarint():Q===7&&(B.advance=oe.readVarint())}const uE=jT;function GT(Q){let B=0,oe=0;for(const st of Q)B+=st.w*st.h,oe=Math.max(oe,st.w);Q.sort((st,kt)=>kt.h-st.h);const Ee=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(B/.95)),oe),h:1/0}];let Ge=0,rt=0;for(const st of Q)for(let kt=Ee.length-1;kt>=0;kt--){const Ht=Ee[kt];if(!(st.w>Ht.w||st.h>Ht.h)){if(st.x=Ht.x,st.y=Ht.y,rt=Math.max(rt,st.y+st.h),Ge=Math.max(Ge,st.x+st.w),st.w===Ht.w&&st.h===Ht.h){const sr=Ee.pop();kt=0&&Ee>=B&&HT[this.text.charCodeAt(Ee)];Ee--)oe--;this.text=this.text.substring(B,oe),this.sectionIndex=this.sectionIndex.slice(B,oe)}substring(B,oe){const Ee=new Nx;return Ee.text=this.text.substring(B,oe),Ee.sectionIndex=this.sectionIndex.slice(B,oe),Ee.sections=this.sections,Ee}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((B,oe)=>Math.max(B,this.sections[oe].scale),0)}addTextSection(B,oe){this.text+=B.text,this.sections.push(Zw.forText(B.scale,B.fontStack||oe));const Ee=this.sections.length-1;for(let Ge=0;Ge=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function qT(Q,B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn,pn,Cn){const Bn=Nx.fromFeature(Q,Ge);let ta;Pr===t.ah.vertical&&Bn.verticalizePunctuation();const{processBidirectionalText:Da,processStyledBidirectionalText:Di}=nu;if(Da&&Bn.sections.length===1){ta=[];const uo=Da(Bn.toString(),l_(Bn,sr,rt,B,Ee,pn));for(const Oo of uo){const ms=new Nx;ms.text=Oo,ms.sections=Bn.sections;for(let zl=0;zl0&&tg>Ap&&(Ap=tg)}else{const Ff=ms[sc.fontStack],Sp=Ff&&Ff[gf];if(Sp&&Sp.rect)qx=Sp.rect,Jf=Sp.metrics;else{const tg=Oo[sc.fontStack],cm=tg&&tg[gf];if(!cm)continue;Jf=cm.metrics}bh=(ep-sc.scale)*Uc}av?(uo.verticalizable=!0,xv.push({glyph:gf,imageName:Rg,x:Ql,y:Of+bh,vertical:av,scale:sc.scale,fontStack:sc.fontStack,sectionIndex:Qc,metrics:Jf,rect:qx}),Ql+=Dg*sc.scale+Co):(xv.push({glyph:gf,imageName:Rg,x:Ql,y:Of+bh,vertical:av,scale:sc.scale,fontStack:sc.fontStack,sectionIndex:Qc,metrics:Jf,rect:qx}),Ql+=Jf.advance*sc.scale+Co)}xv.length!==0&&(Mf=Math.max(Ql-Co,Mf),y4(xv,0,xv.length-1,Lv,Ap)),Ql=0;const um=ds*ep+Ap;Bp.lineOffset=Math.max(Ap,nv),Of+=um,Qd=Math.max(um,Qd),++cd}var Ud;const gv=Of-zx,{horizontalAlign:yv,verticalAlign:_v}=fE(tl);(function(Ih,ep,nv,Bp,xv,Ap,um,Kf,sc){const Qc=(ep-nv)*xv;let gf=0;gf=Ap!==um?-Kf*Bp-zx:(-Bp*sc+.5)*um;for(const bh of Ih)for(const Jf of bh.positionedGlyphs)Jf.x+=Qc,Jf.y+=gf})(uo.positionedLines,Lv,yv,_v,Mf,Qd,ds,gv,Es.length),uo.top+=-_v*gv,uo.bottom=uo.top+gv,uo.left+=-yv*Mf,uo.right=uo.left+Mf})(Ti,B,oe,Ee,ta,st,kt,Ht,Pr,sr,nn,Cn),!(function(uo){for(const Oo of uo)if(Oo.positionedGlyphs.length!==0)return!1;return!0})(ni)&&Ti}const HT={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},m4={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},g4={40:!0};function WT(Q,B,oe,Ee,Ge,rt){if(B.imageName){const st=Ee[B.imageName];return st?st.displaySize[0]*B.scale*Uc/rt+Ge:0}{const st=oe[B.fontStack],kt=st&&st[Q];return kt?kt.metrics.advance*B.scale+Ge:0}}function a6(Q,B,oe,Ee){const Ge=Math.pow(Q-B,2);return Ee?Q=0;let sr=0;for(let Pr=0;Prsr){const Er=Math.ceil(rt/sr);Ge*=Er/st,st=Er}return{x1:Ee,y1:Ge,x2:Ee+rt,y2:Ge+st}}function o6(Q,B,oe,Ee,Ge,rt){const st=Q.image;let kt;if(st.content){const ta=st.content,Da=st.pixelRatio||1;kt=[ta[0]/Da,ta[1]/Da,st.displaySize[0]-ta[2]/Da,st.displaySize[1]-ta[3]/Da]}const Ht=B.left*rt,sr=B.right*rt;let Er,Pr,nn,pn;oe==="width"||oe==="both"?(pn=Ge[0]+Ht-Ee[3],Pr=Ge[0]+sr+Ee[1]):(pn=Ge[0]+(Ht+sr-st.displaySize[0])/2,Pr=pn+st.displaySize[0]);const Cn=B.top*rt,Bn=B.bottom*rt;return oe==="height"||oe==="both"?(Er=Ge[1]+Cn-Ee[0],nn=Ge[1]+Bn+Ee[2]):(Er=Ge[1]+(Cn+Bn-st.displaySize[1])/2,nn=Er+st.displaySize[1]),{image:st,top:Er,right:Pr,bottom:nn,left:pn,collisionPadding:kt}}const Kw=255,s0=128,Jy=Kw*s0;function s6(Q,B){const{expression:oe}=B;if(oe.kind==="constant")return{kind:"constant",layoutSize:oe.evaluate(new Fl(Q+1))};if(oe.kind==="source")return{kind:"source"};{const{zoomStops:Ee,interpolationType:Ge}=oe;let rt=0;for(;rtst.id),this.index=B.index,this.pixelRatio=B.pixelRatio,this.sourceLayerIndex=B.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=wa([]),this.placementViewportMatrix=wa([]);const oe=this.layers[0]._unevaluatedLayout._values;this.textSizeData=s6(this.zoom,oe["text-size"]),this.iconSizeData=s6(this.zoom,oe["icon-size"]);const Ee=this.layers[0].layout,Ge=Ee.get("symbol-sort-key"),rt=Ee.get("symbol-z-order");this.canOverlap=hE(Ee,"text-overlap","text-allow-overlap")!=="never"||hE(Ee,"icon-overlap","icon-allow-overlap")!=="never"||Ee.get("text-ignore-placement")||Ee.get("icon-ignore-placement"),this.sortFeaturesByKey=rt!=="viewport-y"&&!Ge.isConstant(),this.sortFeaturesByY=(rt==="viewport-y"||rt==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,Ee.get("symbol-placement")==="point"&&(this.writingModes=Ee.get("text-writing-mode").map(st=>t.ah[st])),this.stateDependentLayerIds=this.layers.filter(st=>st.isStateDependent()).map(st=>st.id),this.sourceID=B.sourceID}createArrays(){this.text=new Uh(new au(this.layers,this.zoom,B=>/^text/.test(B))),this.icon=new Uh(new au(this.layers,this.zoom,B=>/^icon/.test(B))),this.glyphOffsetArray=new ml,this.lineVertexArray=new yl,this.symbolInstances=new vs,this.textAnchorOffsets=new Sl}calculateGlyphDependencies(B,oe,Ee,Ge,rt){for(let st=0;st0)&&(st.value.kind!=="constant"||st.value.value.length>0),Er=Ht.value.kind!=="constant"||!!Ht.value.value||Object.keys(Ht.parameters).length>0,Pr=rt.get("symbol-sort-key");if(this.features=[],!sr&&!Er)return;const nn=oe.iconDependencies,pn=oe.glyphDependencies,Cn=oe.availableImages,Bn=new Fl(this.zoom);for(const{feature:ta,id:Da,index:Di,sourceLayerIndex:ni}of B){const Ti=Ge._featureFilter.needGeometry,uo=Ir(ta,Ti);if(!Ge._featureFilter.filter(Bn,uo,Ee))continue;let Oo,ms;if(Ti||(uo.geometry=Ct(ta)),sr){const Es=Ge.getValueAndResolveTokens("text-field",uo,Ee,Cn),ds=In.factory(Es),tl=this.hasRTLText=this.hasRTLText||b4(ds);(!tl||nu.getRTLTextPluginStatus()==="unavailable"||tl&&nu.isParsed())&&(Oo=Xy(ds,Ge,uo))}if(Er){const Es=Ge.getValueAndResolveTokens("icon-image",uo,Ee,Cn);ms=Es instanceof La?Es:La.fromString(Es)}if(!Oo&&!ms)continue;const zl=this.sortFeaturesByKey?Pr.evaluate(uo,{},Ee):void 0;if(this.features.push({id:Da,text:Oo,icon:ms,index:Di,sourceLayerIndex:ni,geometry:uo.geometry,properties:ta.properties,type:x4[ta.type],sortKey:zl}),ms&&(nn[ms.name]=!0),Oo){const Es=st.evaluate(uo,{},Ee).join(","),ds=rt.get("text-rotation-alignment")!=="viewport"&&rt.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(const tl of Oo.sections)if(tl.image)nn[tl.image.name]=!0;else{const Hs=Ts(Oo.toString()),Vs=tl.fontStack||Es,Co=pn[Vs]=pn[Vs]||{};this.calculateGlyphDependencies(tl.text,Co,ds,this.allowVerticalPlacement,Hs)}}}rt.get("symbol-placement")==="line"&&(this.features=(function(ta){const Da={},Di={},ni=[];let Ti=0;function uo(Es){ni.push(ta[Es]),Ti++}function Oo(Es,ds,tl){const Hs=Di[Es];return delete Di[Es],Di[ds]=Hs,ni[Hs].geometry[0].pop(),ni[Hs].geometry[0]=ni[Hs].geometry[0].concat(tl[0]),Hs}function ms(Es,ds,tl){const Hs=Da[ds];return delete Da[ds],Da[Es]=Hs,ni[Hs].geometry[0].shift(),ni[Hs].geometry[0]=tl[0].concat(ni[Hs].geometry[0]),Hs}function zl(Es,ds,tl){const Hs=tl?ds[0][ds[0].length-1]:ds[0][0];return`${Es}:${Hs.x}:${Hs.y}`}for(let Es=0;EsEs.geometry)})(this.features)),this.sortFeaturesByKey&&this.features.sort((ta,Da)=>ta.sortKey-Da.sortKey)}update(B,oe,Ee){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(B,oe,this.layers,Ee),this.icon.programConfigurations.updatePaintArrays(B,oe,this.layers,Ee))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(B){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(B),this.iconCollisionBox.upload(B)),this.text.upload(B,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(B,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(B,oe){const Ee=this.lineVertexArray.length;if(B.segment!==void 0){let Ge=B.dist(oe[B.segment+1]),rt=B.dist(oe[B.segment]);const st={};for(let kt=B.segment+1;kt=0;kt--)st[kt]={x:oe[kt].x,y:oe[kt].y,tileUnitDistanceFromAnchor:rt},kt>0&&(rt+=oe[kt-1].dist(oe[kt]));for(let kt=0;kt0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(B,oe){const Ee=B.placedSymbolArray.get(oe),Ge=Ee.vertexStartIndex+4*Ee.numGlyphs;for(let rt=Ee.vertexStartIndex;rtGe[kt]-Ge[Ht]||rt[Ht]-rt[kt]),st}addToSortKeyRanges(B,oe){const Ee=this.sortKeyRanges[this.sortKeyRanges.length-1];Ee&&Ee.sortKey===oe?Ee.symbolInstanceEnd=B+1:this.sortKeyRanges.push({sortKey:oe,symbolInstanceStart:B,symbolInstanceEnd:B+1})}sortFeatures(B){if(this.sortFeaturesByY&&this.sortedAngle!==B&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(B),this.sortedAngle=B,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const oe of this.symbolInstanceIndexes){const Ee=this.symbolInstances.get(oe);this.featureSortOrder.push(Ee.featureIndex),[Ee.rightJustifiedTextSymbolIndex,Ee.centerJustifiedTextSymbolIndex,Ee.leftJustifiedTextSymbolIndex].forEach((Ge,rt,st)=>{Ge>=0&&st.indexOf(Ge)===rt&&this.addIndicesForPlacedSymbol(this.text,Ge)}),Ee.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ee.verticalPlacedTextSymbolIndex),Ee.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ee.placedIconSymbolIndex),Ee.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ee.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Jw,Qw;ii("SymbolBucket",u_,{omit:["layers","collisionBoxArray","features","compareText"]}),u_.MAX_GLYPHS=65535,u_.addDynamicAttributes=Qy;var pE={get paint(){return Qw=Qw||new Qe({"icon-opacity":new Ss(pe.paint_symbol["icon-opacity"]),"icon-color":new Ss(pe.paint_symbol["icon-color"]),"icon-halo-color":new Ss(pe.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ss(pe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ss(pe.paint_symbol["icon-halo-blur"]),"icon-translate":new hs(pe.paint_symbol["icon-translate"]),"icon-translate-anchor":new hs(pe.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ss(pe.paint_symbol["text-opacity"]),"text-color":new Ss(pe.paint_symbol["text-color"],{runtimeType:fr,getOverride:Q=>Q.textColor,hasOverride:Q=>!!Q.textColor}),"text-halo-color":new Ss(pe.paint_symbol["text-halo-color"]),"text-halo-width":new Ss(pe.paint_symbol["text-halo-width"]),"text-halo-blur":new Ss(pe.paint_symbol["text-halo-blur"]),"text-translate":new hs(pe.paint_symbol["text-translate"]),"text-translate-anchor":new hs(pe.paint_symbol["text-translate-anchor"])})},get layout(){return Jw=Jw||new Qe({"symbol-placement":new hs(pe.layout_symbol["symbol-placement"]),"symbol-spacing":new hs(pe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new hs(pe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ss(pe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new hs(pe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new hs(pe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new hs(pe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new hs(pe.layout_symbol["icon-ignore-placement"]),"icon-optional":new hs(pe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new hs(pe.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ss(pe.layout_symbol["icon-size"]),"icon-text-fit":new hs(pe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new hs(pe.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ss(pe.layout_symbol["icon-image"]),"icon-rotate":new Ss(pe.layout_symbol["icon-rotate"]),"icon-padding":new Ss(pe.layout_symbol["icon-padding"]),"icon-keep-upright":new hs(pe.layout_symbol["icon-keep-upright"]),"icon-offset":new Ss(pe.layout_symbol["icon-offset"]),"icon-anchor":new Ss(pe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new hs(pe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new hs(pe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new hs(pe.layout_symbol["text-rotation-alignment"]),"text-field":new Ss(pe.layout_symbol["text-field"]),"text-font":new Ss(pe.layout_symbol["text-font"]),"text-size":new Ss(pe.layout_symbol["text-size"]),"text-max-width":new Ss(pe.layout_symbol["text-max-width"]),"text-line-height":new hs(pe.layout_symbol["text-line-height"]),"text-letter-spacing":new Ss(pe.layout_symbol["text-letter-spacing"]),"text-justify":new Ss(pe.layout_symbol["text-justify"]),"text-radial-offset":new Ss(pe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new hs(pe.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ss(pe.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ss(pe.layout_symbol["text-anchor"]),"text-max-angle":new hs(pe.layout_symbol["text-max-angle"]),"text-writing-mode":new hs(pe.layout_symbol["text-writing-mode"]),"text-rotate":new Ss(pe.layout_symbol["text-rotate"]),"text-padding":new hs(pe.layout_symbol["text-padding"]),"text-keep-upright":new hs(pe.layout_symbol["text-keep-upright"]),"text-transform":new Ss(pe.layout_symbol["text-transform"]),"text-offset":new Ss(pe.layout_symbol["text-offset"]),"text-allow-overlap":new hs(pe.layout_symbol["text-allow-overlap"]),"text-overlap":new hs(pe.layout_symbol["text-overlap"]),"text-ignore-placement":new hs(pe.layout_symbol["text-ignore-placement"]),"text-optional":new hs(pe.layout_symbol["text-optional"])})}};class Fx{constructor(B){if(B.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=B.property.overrides?B.property.overrides.runtimeType:At,this.defaultValue=B}evaluate(B){if(B.formattedSection){const oe=this.defaultValue.property.overrides;if(oe&&oe.hasOverride(B.formattedSection))return oe.getOverride(B.formattedSection)}return B.feature&&B.featureState?this.defaultValue.evaluate(B.feature,B.featureState):this.defaultValue.property.specification.default}eachChild(B){this.defaultValue.isConstant()||B(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ii("FormatSectionOverride",Fx,{omit:["defaultValue"]});class ZT extends ve{constructor(B){super(B,pE)}recalculate(B,oe){if(super.recalculate(B,oe),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const Ee=this.layout.get("text-writing-mode");if(Ee){const Ge=[];for(const rt of Ee)Ge.indexOf(rt)<0&&Ge.push(rt);this.layout._values["text-writing-mode"]=Ge}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(B,oe,Ee,Ge){const rt=this.layout.get(B).evaluate(oe,{},Ee,Ge),st=this._unevaluatedLayout._values[B];return st.isDataDriven()||gh(st.value)||!rt?rt:(function(kt,Ht){return Ht.replace(/{([^{}]+)}/g,(sr,Er)=>kt&&Er in kt?String(kt[Er]):"")})(oe.properties,rt)}createBucket(B){return new u_(B)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const B of pE.paint.overridableProperties){if(!ZT.hasPaintOverride(this.layout,B))continue;const oe=this.paint.get(B),Ee=new Fx(oe),Ge=new hf(Ee,oe.property.specification);let rt=null;rt=oe.value.kind==="constant"||oe.value.kind==="source"?new ah("source",Ge):new Vc("composite",Ge,oe.value.zoomStops),this.paint._values[B]=new Ku(oe.property,rt,oe.parameters)}}_handleOverridablePaintPropertyUpdate(B,oe,Ee){return!(!this.layout||oe.isDataDriven()||Ee.isDataDriven())&&ZT.hasPaintOverride(this.layout,B)}static hasPaintOverride(B,oe){const Ee=B.get("text-field"),Ge=pE.paint.properties[oe];let rt=!1;const st=kt=>{for(const Ht of kt)if(Ge.overrides&&Ge.overrides.hasOverride(Ht))return void(rt=!0)};if(Ee.value.kind==="constant"&&Ee.value.value instanceof In)st(Ee.value.value.sections);else if(Ee.value.kind==="source"){const kt=sr=>{rt||(sr instanceof Qi&&sa(sr.value)===fn?st(sr.value.sections):sr instanceof Ll?st(sr.sections):sr.eachChild(kt))},Ht=Ee.value;Ht._styleExpression&&kt(Ht._styleExpression.expression)}return rt}}let vE;var l6={get paint(){return vE=vE||new Qe({"background-color":new hs(pe.paint_background["background-color"]),"background-pattern":new Cf(pe.paint_background["background-pattern"]),"background-opacity":new hs(pe.paint_background["background-opacity"])})}};class e2 extends ve{constructor(B){super(B,l6)}}let KT;var mE={get paint(){return KT=KT||new Qe({"raster-opacity":new hs(pe.paint_raster["raster-opacity"]),"raster-hue-rotate":new hs(pe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new hs(pe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new hs(pe.paint_raster["raster-brightness-max"]),"raster-saturation":new hs(pe.paint_raster["raster-saturation"]),"raster-contrast":new hs(pe.paint_raster["raster-contrast"]),"raster-resampling":new hs(pe.paint_raster["raster-resampling"]),"raster-fade-duration":new hs(pe.paint_raster["raster-fade-duration"])})}};class w4 extends ve{constructor(B){super(B,mE)}}class u6 extends ve{constructor(B){super(B,{}),this.onAdd=oe=>{this.implementation.onAdd&&this.implementation.onAdd(oe,oe.painter.context.gl)},this.onRemove=oe=>{this.implementation.onRemove&&this.implementation.onRemove(oe,oe.painter.context.gl)},this.implementation=B}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class t2{constructor(B){this._methodToThrottle=B,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const gE=63710088e-1;class l0{constructor(B,oe){if(isNaN(B)||isNaN(oe))throw new Error(`Invalid LngLat object: (${B}, ${oe})`);if(this.lng=+B,this.lat=+oe,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new l0(k(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(B){const oe=Math.PI/180,Ee=this.lat*oe,Ge=B.lat*oe,rt=Math.sin(Ee)*Math.sin(Ge)+Math.cos(Ee)*Math.cos(Ge)*Math.cos((B.lng-this.lng)*oe);return gE*Math.acos(Math.min(rt,1))}static convert(B){if(B instanceof l0)return B;if(Array.isArray(B)&&(B.length===2||B.length===3))return new l0(Number(B[0]),Number(B[1]));if(!Array.isArray(B)&&typeof B=="object"&&B!==null)return new l0(Number("lng"in B?B.lng:B.lon),Number(B.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 [, ]")}}const c6=2*Math.PI*gE;function JT(Q){return c6*Math.cos(Q*Math.PI/180)}function QT(Q){return(180+Q)/360}function f6(Q){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Q*Math.PI/360)))/360}function eg(Q,B){return Q/JT(B)}function yE(Q){return 360/Math.PI*Math.atan(Math.exp((180-360*Q)*Math.PI/180))-90}class r2{constructor(B,oe,Ee=0){this.x=+B,this.y=+oe,this.z=+Ee}static fromLngLat(B,oe=0){const Ee=l0.convert(B);return new r2(QT(Ee.lng),f6(Ee.lat),eg(oe,Ee.lat))}toLngLat(){return new l0(360*this.x-180,yE(this.y))}toAltitude(){return this.z*JT(yE(this.y))}meterInMercatorCoordinateUnits(){return 1/c6*(B=yE(this.y),1/Math.cos(B*Math.PI/180));var B}}function h6(Q,B,oe){var Ee=2*Math.PI*6378137/256/Math.pow(2,oe);return[Q*Ee-2*Math.PI*6378137/2,B*Ee-2*Math.PI*6378137/2]}class _E{constructor(B,oe,Ee){if(!(function(Ge,rt,st){return!(Ge<0||Ge>25||st<0||st>=Math.pow(2,Ge)||rt<0||rt>=Math.pow(2,Ge))})(B,oe,Ee))throw new Error(`x=${oe}, y=${Ee}, z=${B} outside of bounds. 0<=x<${Math.pow(2,B)}, 0<=y<${Math.pow(2,B)} 0<=z<=25 `);this.z=B,this.x=oe,this.y=Ee,this.key=Bx(0,B,B,oe,Ee)}equals(B){return this.z===B.z&&this.x===B.x&&this.y===B.y}url(B,oe,Ee){const Ge=(st=this.y,kt=this.z,Ht=h6(256*(rt=this.x),256*(st=Math.pow(2,kt)-st-1),kt),sr=h6(256*(rt+1),256*(st+1),kt),Ht[0]+","+Ht[1]+","+sr[0]+","+sr[1]);var rt,st,kt,Ht,sr;const Er=(function(Pr,nn,pn){let Cn,Bn="";for(let ta=Pr;ta>0;ta--)Cn=1<1?"@2x":"").replace(/{quadkey}/g,Er).replace(/{bbox-epsg-3857}/g,Ge)}isChildOf(B){const oe=this.z-B.z;return oe>0&&B.x===this.x>>oe&&B.y===this.y>>oe}getTilePoint(B){const oe=Math.pow(2,this.z);return new s((B.x*oe-this.x)*_u,(B.y*oe-this.y)*_u)}toString(){return`${this.z}/${this.x}/${this.y}`}}class d6{constructor(B,oe){this.wrap=B,this.canonical=oe,this.key=Bx(B,oe.z,oe.z,oe.x,oe.y)}}class Dm{constructor(B,oe,Ee,Ge,rt){if(B= z; overscaledZ = ${B}; z = ${Ee}`);this.overscaledZ=B,this.wrap=oe,this.canonical=new _E(Ee,+Ge,+rt),this.key=Bx(oe,B,Ee,Ge,rt)}clone(){return new Dm(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(B){return this.overscaledZ===B.overscaledZ&&this.wrap===B.wrap&&this.canonical.equals(B.canonical)}scaledTo(B){if(B>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${B}; overscaledZ = ${this.overscaledZ}`);const oe=this.canonical.z-B;return B>this.canonical.z?new Dm(B,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Dm(B,this.wrap,B,this.canonical.x>>oe,this.canonical.y>>oe)}calculateScaledKey(B,oe){if(B>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${B}; overscaledZ = ${this.overscaledZ}`);const Ee=this.canonical.z-B;return B>this.canonical.z?Bx(this.wrap*+oe,B,this.canonical.z,this.canonical.x,this.canonical.y):Bx(this.wrap*+oe,B,B,this.canonical.x>>Ee,this.canonical.y>>Ee)}isChildOf(B){if(B.wrap!==this.wrap)return!1;const oe=this.canonical.z-B.canonical.z;return B.overscaledZ===0||B.overscaledZ>oe&&B.canonical.y===this.canonical.y>>oe}children(B){if(this.overscaledZ>=B)return[new Dm(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const oe=this.canonical.z+1,Ee=2*this.canonical.x,Ge=2*this.canonical.y;return[new Dm(oe,this.wrap,oe,Ee,Ge),new Dm(oe,this.wrap,oe,Ee+1,Ge),new Dm(oe,this.wrap,oe,Ee,Ge+1),new Dm(oe,this.wrap,oe,Ee+1,Ge+1)]}isLessThan(B){return this.wrapB.wrap)&&(this.overscaledZB.overscaledZ)&&(this.canonical.xB.canonical.x)&&this.canonical.ythis.max&&(this.max=Pr),Pr=this.dim+1||oe<-1||oe>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(oe+1)*this.stride+(B+1)}unpack(B,oe,Ee){return B*this.redFactor+oe*this.greenFactor+Ee*this.blueFactor-this.baseShift}getPixels(){return new Dl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(B,oe,Ee){if(this.dim!==B.dim)throw new Error("dem dimension mismatch");let Ge=oe*this.dim,rt=oe*this.dim+this.dim,st=Ee*this.dim,kt=Ee*this.dim+this.dim;switch(oe){case-1:Ge=rt-1;break;case 1:rt=Ge+1}switch(Ee){case-1:st=kt-1;break;case 1:kt=st+1}const Ht=-oe*this.dim,sr=-Ee*this.dim;for(let Er=st;Er=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${B} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[B]}}class v6{constructor(B,oe,Ee,Ge,rt){this.type="Feature",this._vectorTileFeature=B,B._z=oe,B._x=Ee,B._y=Ge,this.properties=B.properties,this.id=rt}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(B){this._geometry=B}toJSON(){const B={geometry:this.geometry};for(const oe in this)oe!=="_geometry"&&oe!=="_vectorTileFeature"&&(B[oe]=this[oe]);return B}}class m6{constructor(B,oe){this.tileID=B,this.x=B.canonical.x,this.y=B.canonical.y,this.z=B.canonical.z,this.grid=new Yi(_u,16,0),this.grid3D=new Yi(_u,16,0),this.featureIndexArray=new Su,this.promoteId=oe}insert(B,oe,Ee,Ge,rt,st){const kt=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(Ee,Ge,rt);const Ht=st?this.grid3D:this.grid;for(let sr=0;sr=0&&Pr[3]>=0&&Ht.insert(kt,Pr[0],Pr[1],Pr[2],Pr[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ea.VectorTile(new sE(this.rawTileData)).layers,this.sourceLayerCoder=new p6(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(B,oe,Ee,Ge){this.loadVTLayers();const rt=B.params||{},st=_u/B.tileSize/B.scale,kt=od(rt.filter),Ht=B.queryGeometry,sr=B.queryPadding*st,Er=xE(Ht),Pr=this.grid.query(Er.minX-sr,Er.minY-sr,Er.maxX+sr,Er.maxY+sr),nn=xE(B.cameraQueryGeometry),pn=this.grid3D.query(nn.minX-sr,nn.minY-sr,nn.maxX+sr,nn.maxY+sr,(ta,Da,Di,ni)=>(function(Ti,uo,Oo,ms,zl){for(const ds of Ti)if(uo<=ds.x&&Oo<=ds.y&&ms>=ds.x&&zl>=ds.y)return!0;const Es=[new s(uo,Oo),new s(uo,zl),new s(ms,zl),new s(ms,Oo)];if(Ti.length>2){for(const ds of Es)if(hi(Ti,ds))return!0}for(let ds=0;ds(ni||(ni=Ct(Ti)),uo.queryIntersectsFeature(Ht,Ti,Oo,ni,this.z,B.transform,st,B.pixelPosMatrix)))}return Cn}loadMatchingFeature(B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr){const nn=this.bucketLayerIDs[oe];if(st&&!(function(ta,Da){for(let Di=0;Di=0)return!0;return!1})(st,nn))return;const pn=this.sourceLayerCoder.decode(Ee),Cn=this.vtLayers[pn].feature(Ge);if(rt.needGeometry){const ta=Ir(Cn,!0);if(!rt.filter(new Fl(this.tileID.overscaledZ),ta,this.tileID.canonical))return}else if(!rt.filter(new Fl(this.tileID.overscaledZ),Cn))return;const Bn=this.getId(Cn,pn);for(let ta=0;ta{const kt=B instanceof sh?B.get(st):null;return kt&&kt.evaluate?kt.evaluate(oe,Ee,Ge):kt})}function xE(Q){let B=1/0,oe=1/0,Ee=-1/0,Ge=-1/0;for(const rt of Q)B=Math.min(B,rt.x),oe=Math.min(oe,rt.y),Ee=Math.max(Ee,rt.x),Ge=Math.max(Ge,rt.y);return{minX:B,minY:oe,maxX:Ee,maxY:Ge}}function y6(Q,B){return B-Q}function _6(Q,B,oe,Ee,Ge){const rt=[];for(let st=0;st=Ee&&Pr.x>=Ee||(Er.x>=Ee?Er=new s(Ee,Er.y+(Ee-Er.x)/(Pr.x-Er.x)*(Pr.y-Er.y))._round():Pr.x>=Ee&&(Pr=new s(Ee,Er.y+(Ee-Er.x)/(Pr.x-Er.x)*(Pr.y-Er.y))._round()),Er.y>=Ge&&Pr.y>=Ge||(Er.y>=Ge?Er=new s(Er.x+(Ge-Er.y)/(Pr.y-Er.y)*(Pr.x-Er.x),Ge)._round():Pr.y>=Ge&&(Pr=new s(Er.x+(Ge-Er.y)/(Pr.y-Er.y)*(Pr.x-Er.x),Ge)._round()),Ht&&Er.equals(Ht[Ht.length-1])||(Ht=[Er],rt.push(Ht)),Ht.push(Pr)))))}}return rt}ii("FeatureIndex",m6,{omit:["rawTileData","sourceLayerCoder"]});class e1 extends s{constructor(B,oe,Ee,Ge){super(B,oe),this.angle=Ee,Ge!==void 0&&(this.segment=Ge)}clone(){return new e1(this.x,this.y,this.angle,this.segment)}}function x6(Q,B,oe,Ee,Ge){if(B.segment===void 0||oe===0)return!0;let rt=B,st=B.segment+1,kt=0;for(;kt>-oe/2;){if(st--,st<0)return!1;kt-=Q[st].dist(rt),rt=Q[st]}kt+=Q[st].dist(Q[st+1]),st++;const Ht=[];let sr=0;for(;ktEe;)sr-=Ht.shift().angleDelta;if(sr>Ge)return!1;st++,kt+=Er.dist(Pr)}return!0}function b6(Q){let B=0;for(let oe=0;oesr){const Cn=(sr-Ht)/pn,Bn=Xo.number(Pr.x,nn.x,Cn),ta=Xo.number(Pr.y,nn.y,Cn),Da=new e1(Bn,ta,nn.angleTo(Pr),Er);return Da._round(),!st||x6(Q,Da,kt,st,B)?Da:void 0}Ht+=pn}}function A4(Q,B,oe,Ee,Ge,rt,st,kt,Ht){const sr=w6(Ee,rt,st),Er=T6(Ee,Ge),Pr=Er*st,nn=Q[0].x===0||Q[0].x===Ht||Q[0].y===0||Q[0].y===Ht;return B-Pr=0&&Ti=0&&uo=0&&nn+sr<=Er){const Oo=new e1(Ti,uo,Di,Cn);Oo._round(),Ee&&!x6(Q,Oo,rt,Ee,Ge)||pn.push(Oo)}}Pr+=Da}return kt||pn.length||st||(pn=f_(Q,Pr/2,oe,Ee,Ge,rt,st,!0,Ht)),pn}ii("Anchor",e1);const Ux=Bd;function A6(Q,B,oe,Ee){const Ge=[],rt=Q.image,st=rt.pixelRatio,kt=rt.paddedRect.w-2*Ux,Ht=rt.paddedRect.h-2*Ux;let sr={x1:Q.left,y1:Q.top,x2:Q.right,y2:Q.bottom};const Er=rt.stretchX||[[0,kt]],Pr=rt.stretchY||[[0,Ht]],nn=(Co,cl)=>Co+cl[1]-cl[0],pn=Er.reduce(nn,0),Cn=Pr.reduce(nn,0),Bn=kt-pn,ta=Ht-Cn;let Da=0,Di=pn,ni=0,Ti=Cn,uo=0,Oo=Bn,ms=0,zl=ta;if(rt.content&&Ee){const Co=rt.content,cl=Co[2]-Co[0],rl=Co[3]-Co[1];(rt.textFitWidth||rt.textFitHeight)&&(sr=i6(Q)),Da=$x(Er,0,Co[0]),ni=$x(Pr,0,Co[1]),Di=$x(Er,Co[0],Co[2]),Ti=$x(Pr,Co[1],Co[3]),uo=Co[0]-Da,ms=Co[1]-ni,Oo=cl-Di,zl=rl-Ti}const Es=sr.x1,ds=sr.y1,tl=sr.x2-Es,Hs=sr.y2-ds,Vs=(Co,cl,rl,Ql)=>{const Of=lm(Co.stretch-Da,Di,tl,Es),Mf=eA(Co.fixed-uo,Oo,Co.stretch,pn),Qd=lm(cl.stretch-ni,Ti,Hs,ds),Lv=eA(cl.fixed-ms,zl,cl.stretch,Cn),cd=lm(rl.stretch-Da,Di,tl,Es),Ud=eA(rl.fixed-uo,Oo,rl.stretch,pn),gv=lm(Ql.stretch-ni,Ti,Hs,ds),yv=eA(Ql.fixed-ms,zl,Ql.stretch,Cn),_v=new s(Of,Qd),Ih=new s(cd,Qd),ep=new s(cd,gv),nv=new s(Of,gv),Bp=new s(Mf/st,Lv/st),xv=new s(Ud/st,yv/st),Ap=B*Math.PI/180;if(Ap){const sc=Math.sin(Ap),Qc=Math.cos(Ap),gf=[Qc,-sc,sc,Qc];_v._matMult(gf),Ih._matMult(gf),nv._matMult(gf),ep._matMult(gf)}const um=Co.stretch+Co.fixed,Kf=cl.stretch+cl.fixed;return{tl:_v,tr:Ih,bl:nv,br:ep,tex:{x:rt.paddedRect.x+Ux+um,y:rt.paddedRect.y+Ux+Kf,w:rl.stretch+rl.fixed-um,h:Ql.stretch+Ql.fixed-Kf},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Bp,pixelOffsetBR:xv,minFontScaleX:Oo/st/tl,minFontScaleY:zl/st/Hs,isSDF:oe}};if(Ee&&(rt.stretchX||rt.stretchY)){const Co=Vx(Er,Bn,pn),cl=Vx(Pr,ta,Cn);for(let rl=0;rl0&&(Bn=Math.max(10,Bn),this.circleDiameter=Bn)}else{const nn=!((Pr=st.image)===null||Pr===void 0)&&Pr.content&&(st.image.textFitWidth||st.image.textFitHeight)?i6(st):{x1:st.left,y1:st.top,x2:st.right,y2:st.bottom};nn.y1=nn.y1*kt-Ht[0],nn.y2=nn.y2*kt+Ht[2],nn.x1=nn.x1*kt-Ht[3],nn.x2=nn.x2*kt+Ht[1];const pn=st.collisionPadding;if(pn&&(nn.x1-=pn[0]*kt,nn.y1-=pn[1]*kt,nn.x2+=pn[2]*kt,nn.y2+=pn[3]*kt),Er){const Cn=new s(nn.x1,nn.y1),Bn=new s(nn.x2,nn.y1),ta=new s(nn.x1,nn.y2),Da=new s(nn.x2,nn.y2),Di=Er*Math.PI/180;Cn._rotate(Di),Bn._rotate(Di),ta._rotate(Di),Da._rotate(Di),nn.x1=Math.min(Cn.x,Bn.x,ta.x,Da.x),nn.x2=Math.max(Cn.x,Bn.x,ta.x,Da.x),nn.y1=Math.min(Cn.y,Bn.y,ta.y,Da.y),nn.y2=Math.max(Cn.y,Bn.y,ta.y,Da.y)}B.emplaceBack(oe.x,oe.y,nn.x1,nn.y1,nn.x2,nn.y2,Ee,Ge,rt)}this.boxEndIndex=B.length}}class S4{constructor(B=[],oe=(Ee,Ge)=>EeGe?1:0){if(this.data=B,this.length=this.data.length,this.compare=oe,this.length>0)for(let Ee=(this.length>>1)-1;Ee>=0;Ee--)this._down(Ee)}push(B){this.data.push(B),this._up(this.length++)}pop(){if(this.length===0)return;const B=this.data[0],oe=this.data.pop();return--this.length>0&&(this.data[0]=oe,this._down(0)),B}peek(){return this.data[0]}_up(B){const{data:oe,compare:Ee}=this,Ge=oe[B];for(;B>0;){const rt=B-1>>1,st=oe[rt];if(Ee(Ge,st)>=0)break;oe[B]=st,B=rt}oe[B]=Ge}_down(B){const{data:oe,compare:Ee}=this,Ge=this.length>>1,rt=oe[B];for(;B=0)break;oe[B]=oe[st],B=st}oe[B]=rt}}function E4(Q,B=1,oe=!1){let Ee=1/0,Ge=1/0,rt=-1/0,st=-1/0;const kt=Q[0];for(let pn=0;pnrt)&&(rt=Cn.x),(!pn||Cn.y>st)&&(st=Cn.y)}const Ht=Math.min(rt-Ee,st-Ge);let sr=Ht/2;const Er=new S4([],C4);if(Ht===0)return new s(Ee,Ge);for(let pn=Ee;pnPr.d||!Pr.d)&&(Pr=pn,oe&&console.log("found best %d after %d probes",Math.round(1e4*pn.d)/1e4,nn)),pn.max-Pr.d<=B||(sr=pn.h/2,Er.push(new u0(pn.p.x-sr,pn.p.y-sr,sr,Q)),Er.push(new u0(pn.p.x+sr,pn.p.y-sr,sr,Q)),Er.push(new u0(pn.p.x-sr,pn.p.y+sr,sr,Q)),Er.push(new u0(pn.p.x+sr,pn.p.y+sr,sr,Q)),nn+=4)}return oe&&(console.log(`num probes: ${nn}`),console.log(`best distance: ${Pr.d}`)),Pr.p}function C4(Q,B){return B.max-Q.max}function u0(Q,B,oe,Ee){this.p=new s(Q,B),this.h=oe,this.d=(function(Ge,rt){let st=!1,kt=1/0;for(let Ht=0;HtGe.y!=Cn.y>Ge.y&&Ge.x<(Cn.x-pn.x)*(Ge.y-pn.y)/(Cn.y-pn.y)+pn.x&&(st=!st),kt=Math.min(kt,fo(Ge,pn,Cn))}}return(st?1:-1)*Math.sqrt(kt)})(this.p,Ee),this.max=this.d+this.h*Math.SQRT2}var Tp;t.aq=void 0,(Tp=t.aq||(t.aq={}))[Tp.center=1]="center",Tp[Tp.left=2]="left",Tp[Tp.right=3]="right",Tp[Tp.top=4]="top",Tp[Tp.bottom=5]="bottom",Tp[Tp["top-left"]=6]="top-left",Tp[Tp["top-right"]=7]="top-right",Tp[Tp["bottom-left"]=8]="bottom-left",Tp[Tp["bottom-right"]=9]="bottom-right";const t1=7,bE=Number.POSITIVE_INFINITY;function S6(Q,B){return B[1]!==bE?(function(oe,Ee,Ge){let rt=0,st=0;switch(Ee=Math.abs(Ee),Ge=Math.abs(Ge),oe){case"top-right":case"top-left":case"top":st=Ge-t1;break;case"bottom-right":case"bottom-left":case"bottom":st=-Ge+t1}switch(oe){case"top-right":case"bottom-right":case"right":rt=-Ee;break;case"top-left":case"bottom-left":case"left":rt=Ee}return[rt,st]})(Q,B[0],B[1]):(function(oe,Ee){let Ge=0,rt=0;Ee<0&&(Ee=0);const st=Ee/Math.SQRT2;switch(oe){case"top-right":case"top-left":rt=st-t1;break;case"bottom-right":case"bottom-left":rt=-st+t1;break;case"bottom":rt=-Ee+t1;break;case"top":rt=Ee-t1}switch(oe){case"top-right":case"bottom-right":Ge=-st;break;case"top-left":case"bottom-left":Ge=st;break;case"left":Ge=Ee;break;case"right":Ge=-Ee}return[Ge,rt]})(Q,B[0])}function E6(Q,B,oe){var Ee;const Ge=Q.layout,rt=(Ee=Ge.get("text-variable-anchor-offset"))===null||Ee===void 0?void 0:Ee.evaluate(B,{},oe);if(rt){const kt=rt.values,Ht=[];for(let sr=0;srnn*Uc);Er.startsWith("top")?Pr[1]-=t1:Er.startsWith("bottom")&&(Pr[1]+=t1),Ht[sr+1]=Pr}return new Pa(Ht)}const st=Ge.get("text-variable-anchor");if(st){let kt;kt=Q._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Ge.get("text-radial-offset").evaluate(B,{},oe)*Uc,bE]:Ge.get("text-offset").evaluate(B,{},oe).map(sr=>sr*Uc);const Ht=[];for(const sr of st)Ht.push(sr,S6(sr,kt));return new Pa(Ht)}return null}function wE(Q){switch(Q){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function k4(Q,B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er){let Pr=rt.textMaxSize.evaluate(B,{});Pr===void 0&&(Pr=st);const nn=Q.layers[0].layout,pn=nn.get("icon-offset").evaluate(B,{},Er),Cn=k6(oe.horizontal),Bn=st/24,ta=Q.tilePixelRatio*Bn,Da=Q.tilePixelRatio*Pr/24,Di=Q.tilePixelRatio*kt,ni=Q.tilePixelRatio*nn.get("symbol-spacing"),Ti=nn.get("text-padding")*Q.tilePixelRatio,uo=(function(Co,cl,rl,Ql=1){const Of=Co.get("icon-padding").evaluate(cl,{},rl),Mf=Of&&Of.values;return[Mf[0]*Ql,Mf[1]*Ql,Mf[2]*Ql,Mf[3]*Ql]})(nn,B,Er,Q.tilePixelRatio),Oo=nn.get("text-max-angle")/180*Math.PI,ms=nn.get("text-rotation-alignment")!=="viewport"&&nn.get("symbol-placement")!=="point",zl=nn.get("icon-rotation-alignment")==="map"&&nn.get("symbol-placement")!=="point",Es=nn.get("symbol-placement"),ds=ni/2,tl=nn.get("icon-text-fit");let Hs;Ee&&tl!=="none"&&(Q.allowVerticalPlacement&&oe.vertical&&(Hs=o6(Ee,oe.vertical,tl,nn.get("icon-text-fit-padding"),pn,Bn)),Cn&&(Ee=o6(Ee,Cn,tl,nn.get("icon-text-fit-padding"),pn,Bn)));const Vs=(Co,cl)=>{cl.x<0||cl.x>=_u||cl.y<0||cl.y>=_u||(function(rl,Ql,Of,Mf,Qd,Lv,cd,Ud,gv,yv,_v,Ih,ep,nv,Bp,xv,Ap,um,Kf,sc,Qc,gf,bh,Jf,qx){const Rg=rl.addToLineVertexArray(Ql,Of);let Dg,av,Ff,Sp,tg=0,cm=0,bv=0,kE=0,ME=-1,iA=-1;const J0={};let IE=Ta("");if(rl.allowVerticalPlacement&&Mf.vertical){const Up=Ud.layout.get("text-rotate").evaluate(Qc,{},Jf)+90;Ff=new tA(gv,Ql,yv,_v,Ih,Mf.vertical,ep,nv,Bp,Up),cd&&(Sp=new tA(gv,Ql,yv,_v,Ih,cd,Ap,um,Bp,Up))}if(Qd){const Up=Ud.layout.get("icon-rotate").evaluate(Qc,{}),fm=Ud.layout.get("icon-text-fit")!=="none",r1=A6(Qd,Up,bh,fm),Pg=cd?A6(cd,Up,bh,fm):void 0;av=new tA(gv,Ql,yv,_v,Ih,Qd,Ap,um,!1,Up),tg=4*r1.length;const h_=rl.iconSizeData;let zg=null;h_.kind==="source"?(zg=[s0*Ud.layout.get("icon-size").evaluate(Qc,{})],zg[0]>Jy&&w(`${rl.layerIds[0]}: Value for "icon-size" is >= ${Kw}. Reduce your "icon-size".`)):h_.kind==="composite"&&(zg=[s0*gf.compositeIconSizes[0].evaluate(Qc,{},Jf),s0*gf.compositeIconSizes[1].evaluate(Qc,{},Jf)],(zg[0]>Jy||zg[1]>Jy)&&w(`${rl.layerIds[0]}: Value for "icon-size" is >= ${Kw}. Reduce your "icon-size".`)),rl.addSymbols(rl.icon,r1,zg,sc,Kf,Qc,t.ah.none,Ql,Rg.lineStartIndex,Rg.lineLength,-1,Jf),ME=rl.icon.placedSymbolArray.length-1,Pg&&(cm=4*Pg.length,rl.addSymbols(rl.icon,Pg,zg,sc,Kf,Qc,t.ah.vertical,Ql,Rg.lineStartIndex,Rg.lineLength,-1,Jf),iA=rl.icon.placedSymbolArray.length-1)}const LE=Object.keys(Mf.horizontal);for(const Up of LE){const fm=Mf.horizontal[Up];if(!Dg){IE=Ta(fm.text);const Pg=Ud.layout.get("text-rotate").evaluate(Qc,{},Jf);Dg=new tA(gv,Ql,yv,_v,Ih,fm,ep,nv,Bp,Pg)}const r1=fm.positionedLines.length===1;if(bv+=C6(rl,Ql,fm,Lv,Ud,Bp,Qc,xv,Rg,Mf.vertical?t.ah.horizontal:t.ah.horizontalOnly,r1?LE:[Up],J0,ME,gf,Jf),r1)break}Mf.vertical&&(kE+=C6(rl,Ql,Mf.vertical,Lv,Ud,Bp,Qc,xv,Rg,t.ah.vertical,["vertical"],J0,iA,gf,Jf));const RE=Dg?Dg.boxStartIndex:rl.collisionBoxArray.length,DE=Dg?Dg.boxEndIndex:rl.collisionBoxArray.length,M4=Ff?Ff.boxStartIndex:rl.collisionBoxArray.length,I4=Ff?Ff.boxEndIndex:rl.collisionBoxArray.length,L4=av?av.boxStartIndex:rl.collisionBoxArray.length,R4=av?av.boxEndIndex:rl.collisionBoxArray.length,D6=Sp?Sp.boxStartIndex:rl.collisionBoxArray.length,Hx=Sp?Sp.boxEndIndex:rl.collisionBoxArray.length;let $d=-1;const Wx=(Up,fm)=>Up&&Up.circleDiameter?Math.max(Up.circleDiameter,fm):fm;$d=Wx(Dg,$d),$d=Wx(Ff,$d),$d=Wx(av,$d),$d=Wx(Sp,$d);const PE=$d>-1?1:0;PE&&($d*=qx/Uc),rl.glyphOffsetArray.length>=u_.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Qc.sortKey!==void 0&&rl.addToSortKeyRanges(rl.symbolInstances.length,Qc.sortKey);const P6=E6(Ud,Qc,Jf),[D4,z6]=(function(Up,fm){const r1=Up.length,Pg=fm?.values;if(Pg?.length>0)for(let h_=0;h_=0?J0.right:-1,J0.center>=0?J0.center:-1,J0.left>=0?J0.left:-1,J0.vertical||-1,ME,iA,IE,RE,DE,M4,I4,L4,R4,D6,Hx,yv,bv,kE,tg,cm,PE,0,ep,$d,D4,z6)})(Q,cl,Co,oe,Ee,Ge,Hs,Q.layers[0],Q.collisionBoxArray,B.index,B.sourceLayerIndex,Q.index,ta,[Ti,Ti,Ti,Ti],ms,Ht,Di,uo,zl,pn,B,rt,sr,Er,st)};if(Es==="line")for(const Co of _6(B.geometry,0,0,_u,_u)){const cl=A4(Co,ni,Oo,oe.vertical||Cn,Ee,24,Da,Q.overscaling,_u);for(const rl of cl)Cn&&M6(Q,Cn.text,ds,rl)||Vs(Co,rl)}else if(Es==="line-center"){for(const Co of B.geometry)if(Co.length>1){const cl=T4(Co,Oo,oe.vertical||Cn,Ee,24,Da);cl&&Vs(Co,cl)}}else if(B.type==="Polygon")for(const Co of Tf(B.geometry,0)){const cl=E4(Co,16);Vs(Co[0],new e1(cl.x,cl.y,0))}else if(B.type==="LineString")for(const Co of B.geometry)Vs(Co,new e1(Co[0].x,Co[0].y,0));else if(B.type==="Point")for(const Co of B.geometry)for(const cl of Co)Vs([cl],new e1(cl.x,cl.y,0))}function C6(Q,B,oe,Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn,pn,Cn){const Bn=(function(Di,ni,Ti,uo,Oo,ms,zl,Es){const ds=uo.layout.get("text-rotate").evaluate(ms,{})*Math.PI/180,tl=[];for(const Hs of ni.positionedLines)for(const Vs of Hs.positionedGlyphs){if(!Vs.rect)continue;const Co=Vs.rect||{};let cl=uE+1,rl=!0,Ql=1,Of=0;const Mf=(Oo||Es)&&Vs.vertical,Qd=Vs.metrics.advance*Vs.scale/2;if(Es&&ni.verticalizable&&(Of=Hs.lineOffset/2-(Vs.imageName?-(Uc-Vs.metrics.width*Vs.scale)/2:(Vs.scale-1)*Uc)),Vs.imageName){const sc=zl[Vs.imageName];rl=sc.sdf,Ql=sc.pixelRatio,cl=Bd/Ql}const Lv=Oo?[Vs.x+Qd,Vs.y]:[0,0];let cd=Oo?[0,0]:[Vs.x+Qd+Ti[0],Vs.y+Ti[1]-Of],Ud=[0,0];Mf&&(Ud=cd,cd=[0,0]);const gv=Vs.metrics.isDoubleResolution?2:1,yv=(Vs.metrics.left-cl)*Vs.scale-Qd+cd[0],_v=(-Vs.metrics.top-cl)*Vs.scale+cd[1],Ih=yv+Co.w/gv*Vs.scale/Ql,ep=_v+Co.h/gv*Vs.scale/Ql,nv=new s(yv,_v),Bp=new s(Ih,_v),xv=new s(yv,ep),Ap=new s(Ih,ep);if(Mf){const sc=new s(-Qd,Qd-zx),Qc=-Math.PI/2,gf=Uc/2-Qd,bh=new s(5-zx-gf,-(Vs.imageName?gf:0)),Jf=new s(...Ud);nv._rotateAround(Qc,sc)._add(bh)._add(Jf),Bp._rotateAround(Qc,sc)._add(bh)._add(Jf),xv._rotateAround(Qc,sc)._add(bh)._add(Jf),Ap._rotateAround(Qc,sc)._add(bh)._add(Jf)}if(ds){const sc=Math.sin(ds),Qc=Math.cos(ds),gf=[Qc,-sc,sc,Qc];nv._matMult(gf),Bp._matMult(gf),xv._matMult(gf),Ap._matMult(gf)}const um=new s(0,0),Kf=new s(0,0);tl.push({tl:nv,tr:Bp,bl:xv,br:Ap,tex:Co,writingMode:ni.writingMode,glyphOffset:Lv,sectionIndex:Vs.sectionIndex,isSDF:rl,pixelOffsetTL:um,pixelOffsetBR:Kf,minFontScaleX:0,minFontScaleY:0})}return tl})(0,oe,kt,Ge,rt,st,Ee,Q.allowVerticalPlacement),ta=Q.textSizeData;let Da=null;ta.kind==="source"?(Da=[s0*Ge.layout.get("text-size").evaluate(st,{})],Da[0]>Jy&&w(`${Q.layerIds[0]}: Value for "text-size" is >= ${Kw}. Reduce your "text-size".`)):ta.kind==="composite"&&(Da=[s0*pn.compositeTextSizes[0].evaluate(st,{},Cn),s0*pn.compositeTextSizes[1].evaluate(st,{},Cn)],(Da[0]>Jy||Da[1]>Jy)&&w(`${Q.layerIds[0]}: Value for "text-size" is >= ${Kw}. Reduce your "text-size".`)),Q.addSymbols(Q.text,Bn,Da,kt,rt,st,sr,B,Ht.lineStartIndex,Ht.lineLength,nn,Cn);for(const Di of Er)Pr[Di]=Q.text.placedSymbolArray.length-1;return 4*Bn.length}function k6(Q){for(const B in Q)return Q[B];return null}function M6(Q,B,oe,Ee){const Ge=Q.compareText;if(B in Ge){const rt=Ge[B];for(let st=rt.length-1;st>=0;st--)if(Ee.dist(rt[st])>4;if(Ge!==1)throw new Error(`Got v${Ge} data when expected v1.`);const rt=I6[15&Ee];if(!rt)throw new Error("Unrecognized array type.");const[st]=new Uint16Array(B,2,1),[kt]=new Uint32Array(B,4,1);return new TE(kt,st,rt,B)}constructor(B,oe=64,Ee=Float64Array,Ge){if(isNaN(B)||B<0)throw new Error(`Unpexpected numItems value: ${B}.`);this.numItems=+B,this.nodeSize=Math.min(Math.max(+oe,2),65535),this.ArrayType=Ee,this.IndexArrayType=B<65536?Uint16Array:Uint32Array;const rt=I6.indexOf(this.ArrayType),st=2*B*this.ArrayType.BYTES_PER_ELEMENT,kt=B*this.IndexArrayType.BYTES_PER_ELEMENT,Ht=(8-kt%8)%8;if(rt<0)throw new Error(`Unexpected typed array class: ${Ee}.`);Ge&&Ge instanceof ArrayBuffer?(this.data=Ge,this.ids=new this.IndexArrayType(this.data,8,B),this.coords=new this.ArrayType(this.data,8+kt+Ht,2*B),this._pos=2*B,this._finished=!0):(this.data=new ArrayBuffer(8+st+kt+Ht),this.ids=new this.IndexArrayType(this.data,8,B),this.coords=new this.ArrayType(this.data,8+kt+Ht,2*B),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+rt]),new Uint16Array(this.data,2,1)[0]=oe,new Uint32Array(this.data,4,1)[0]=B)}add(B,oe){const Ee=this._pos>>1;return this.ids[Ee]=Ee,this.coords[this._pos++]=B,this.coords[this._pos++]=oe,Ee}finish(){const B=this._pos>>1;if(B!==this.numItems)throw new Error(`Added ${B} items when expected ${this.numItems}.`);return AE(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(B,oe,Ee,Ge){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:rt,coords:st,nodeSize:kt}=this,Ht=[0,rt.length-1,0],sr=[];for(;Ht.length;){const Er=Ht.pop()||0,Pr=Ht.pop()||0,nn=Ht.pop()||0;if(Pr-nn<=kt){for(let ta=nn;ta<=Pr;ta++){const Da=st[2*ta],Di=st[2*ta+1];Da>=B&&Da<=Ee&&Di>=oe&&Di<=Ge&&sr.push(rt[ta])}continue}const pn=nn+Pr>>1,Cn=st[2*pn],Bn=st[2*pn+1];Cn>=B&&Cn<=Ee&&Bn>=oe&&Bn<=Ge&&sr.push(rt[pn]),(Er===0?B<=Cn:oe<=Bn)&&(Ht.push(nn),Ht.push(pn-1),Ht.push(1-Er)),(Er===0?Ee>=Cn:Ge>=Bn)&&(Ht.push(pn+1),Ht.push(Pr),Ht.push(1-Er))}return sr}within(B,oe,Ee){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Ge,coords:rt,nodeSize:st}=this,kt=[0,Ge.length-1,0],Ht=[],sr=Ee*Ee;for(;kt.length;){const Er=kt.pop()||0,Pr=kt.pop()||0,nn=kt.pop()||0;if(Pr-nn<=st){for(let ta=nn;ta<=Pr;ta++)Fp(rt[2*ta],rt[2*ta+1],B,oe)<=sr&&Ht.push(Ge[ta]);continue}const pn=nn+Pr>>1,Cn=rt[2*pn],Bn=rt[2*pn+1];Fp(Cn,Bn,B,oe)<=sr&&Ht.push(Ge[pn]),(Er===0?B-Ee<=Cn:oe-Ee<=Bn)&&(kt.push(nn),kt.push(pn-1),kt.push(1-Er)),(Er===0?B+Ee>=Cn:oe+Ee>=Bn)&&(kt.push(pn+1),kt.push(Pr),kt.push(1-Er))}return Ht}}function AE(Q,B,oe,Ee,Ge,rt){if(Ge-Ee<=oe)return;const st=Ee+Ge>>1;L6(Q,B,st,Ee,Ge,rt),AE(Q,B,oe,Ee,st-1,1-rt),AE(Q,B,oe,st+1,Ge,1-rt)}function L6(Q,B,oe,Ee,Ge,rt){for(;Ge>Ee;){if(Ge-Ee>600){const sr=Ge-Ee+1,Er=oe-Ee+1,Pr=Math.log(sr),nn=.5*Math.exp(2*Pr/3),pn=.5*Math.sqrt(Pr*nn*(sr-nn)/sr)*(Er-sr/2<0?-1:1);L6(Q,B,oe,Math.max(Ee,Math.floor(oe-Er*nn/sr+pn)),Math.min(Ge,Math.floor(oe+(sr-Er)*nn/sr+pn)),rt)}const st=B[2*oe+rt];let kt=Ee,Ht=Ge;for(jx(Q,B,Ee,oe),B[2*Ge+rt]>st&&jx(Q,B,Ee,Ge);ktst;)Ht--}B[2*Ee+rt]===st?jx(Q,B,Ee,Ht):(Ht++,jx(Q,B,Ht,Ge)),Ht<=oe&&(Ee=Ht+1),oe<=Ht&&(Ge=Ht-1)}}function jx(Q,B,oe,Ee){rA(Q,oe,Ee),rA(B,2*oe,2*Ee),rA(B,2*oe+1,2*Ee+1)}function rA(Q,B,oe){const Ee=Q[B];Q[B]=Q[oe],Q[oe]=Ee}function Fp(Q,B,oe,Ee){const Ge=Q-oe,rt=B-Ee;return Ge*Ge+rt*rt}var SE;t.bg=void 0,(SE=t.bg||(t.bg={})).create="create",SE.load="load",SE.fullLoad="fullLoad";let nA=null,Gx=[];const EE=1e3/60,aA="loadTime",CE="fullLoadTime",R6={mark(Q){performance.mark(Q)},frame(Q){const B=Q;nA!=null&&Gx.push(B-nA),nA=B},clearMetrics(){nA=null,Gx=[],performance.clearMeasures(aA),performance.clearMeasures(CE);for(const Q in t.bg)performance.clearMarks(t.bg[Q])},getPerformanceMetrics(){performance.measure(aA,t.bg.create,t.bg.load),performance.measure(CE,t.bg.create,t.bg.fullLoad);const Q=performance.getEntriesByName(aA)[0].duration,B=performance.getEntriesByName(CE)[0].duration,oe=Gx.length,Ee=1/(Gx.reduce((rt,st)=>rt+st,0)/oe/1e3),Ge=Gx.filter(rt=>rt>EE).reduce((rt,st)=>rt+(st-EE)/EE,0);return{loadTime:Q,fullLoadTime:B,fps:Ee,percentDroppedFrames:Ge/(oe+Ge)*100,totalFrames:oe}}};t.$=class extends Or{},t.A=io,t.B=Ai,t.C=function(Q){if(U==null){const B=Q.navigator?Q.navigator.userAgent:null;U=!!Q.safari||!(!B||!(/\b(iPad|iPhone|iPod)\b/.test(B)||B.match("Safari")&&!B.match("Chrome")))}return U},t.D=hs,t.E=de,t.F=class{constructor(Q,B){this.target=Q,this.mapId=B,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new t2(()=>this.process()),this.subscription=(function(oe,Ee,Ge,rt){return oe.addEventListener(Ee,Ge,!1),{unsubscribe:()=>{oe.removeEventListener(Ee,Ge,!1)}}})(this.target,"message",oe=>this.receive(oe)),this.globalScope=z(self)?Q:window}registerMessageHandler(Q,B){this.messageHandlers[Q]=B}sendAsync(Q,B){return new Promise((oe,Ee)=>{const Ge=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Ge]={resolve:oe,reject:Ee},B&&B.signal.addEventListener("abort",()=>{delete this.resolveRejects[Ge];const kt={id:Ge,type:"",origin:location.origin,targetMapId:Q.targetMapId,sourceMapId:this.mapId};this.target.postMessage(kt)},{once:!0});const rt=[],st=Object.assign(Object.assign({},Q),{id:Ge,sourceMapId:this.mapId,origin:location.origin,data:fs(Q.data,rt)});this.target.postMessage(st,{transfer:rt})})}receive(Q){const B=Q.data,oe=B.id;if(!(B.origin!=="file://"&&location.origin!=="file://"&&B.origin!=="resource://android"&&location.origin!=="resource://android"&&B.origin!==location.origin||B.targetMapId&&this.mapId!==B.targetMapId)){if(B.type===""){delete this.tasks[oe];const Ee=this.abortControllers[oe];return delete this.abortControllers[oe],void(Ee&&Ee.abort())}if(z(self)||B.mustQueue)return this.tasks[oe]=B,this.taskQueue.push(oe),void this.invoker.trigger();this.processTask(oe,B)}}process(){if(this.taskQueue.length===0)return;const Q=this.taskQueue.shift(),B=this.tasks[Q];delete this.tasks[Q],this.taskQueue.length>0&&this.invoker.trigger(),B&&this.processTask(Q,B)}processTask(Q,B){return r(this,void 0,void 0,function*(){if(B.type===""){const Ge=this.resolveRejects[Q];return delete this.resolveRejects[Q],Ge?void(B.error?Ge.reject(ls(B.error)):Ge.resolve(ls(B.data))):void 0}if(!this.messageHandlers[B.type])return void this.completeTask(Q,new Error(`Could not find a registered handler for ${B.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const oe=ls(B.data),Ee=new AbortController;this.abortControllers[Q]=Ee;try{const Ge=yield this.messageHandlers[B.type](B.sourceMapId,oe,Ee);this.completeTask(Q,null,Ge)}catch(Ge){this.completeTask(Q,Ge)}})}completeTask(Q,B,oe){const Ee=[];delete this.abortControllers[Q];const Ge={id:Q,type:"",sourceMapId:this.mapId,origin:location.origin,error:B?fs(B):null,data:fs(oe,Ee)};this.target.postMessage(Ge,{transfer:Ee})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=ge,t.H=function(){var Q=new io(16);return io!=Float32Array&&(Q[1]=0,Q[2]=0,Q[3]=0,Q[4]=0,Q[6]=0,Q[7]=0,Q[8]=0,Q[9]=0,Q[11]=0,Q[12]=0,Q[13]=0,Q[14]=0),Q[0]=1,Q[5]=1,Q[10]=1,Q[15]=1,Q},t.I=Op,t.J=function(Q,B,oe){var Ee,Ge,rt,st,kt,Ht,sr,Er,Pr,nn,pn,Cn,Bn=oe[0],ta=oe[1],Da=oe[2];return B===Q?(Q[12]=B[0]*Bn+B[4]*ta+B[8]*Da+B[12],Q[13]=B[1]*Bn+B[5]*ta+B[9]*Da+B[13],Q[14]=B[2]*Bn+B[6]*ta+B[10]*Da+B[14],Q[15]=B[3]*Bn+B[7]*ta+B[11]*Da+B[15]):(Ge=B[1],rt=B[2],st=B[3],kt=B[4],Ht=B[5],sr=B[6],Er=B[7],Pr=B[8],nn=B[9],pn=B[10],Cn=B[11],Q[0]=Ee=B[0],Q[1]=Ge,Q[2]=rt,Q[3]=st,Q[4]=kt,Q[5]=Ht,Q[6]=sr,Q[7]=Er,Q[8]=Pr,Q[9]=nn,Q[10]=pn,Q[11]=Cn,Q[12]=Ee*Bn+kt*ta+Pr*Da+B[12],Q[13]=Ge*Bn+Ht*ta+nn*Da+B[13],Q[14]=rt*Bn+sr*ta+pn*Da+B[14],Q[15]=st*Bn+Er*ta+Cn*Da+B[15]),Q},t.K=function(Q,B,oe){var Ee=oe[0],Ge=oe[1],rt=oe[2];return Q[0]=B[0]*Ee,Q[1]=B[1]*Ee,Q[2]=B[2]*Ee,Q[3]=B[3]*Ee,Q[4]=B[4]*Ge,Q[5]=B[5]*Ge,Q[6]=B[6]*Ge,Q[7]=B[7]*Ge,Q[8]=B[8]*rt,Q[9]=B[9]*rt,Q[10]=B[10]*rt,Q[11]=B[11]*rt,Q[12]=B[12],Q[13]=B[13],Q[14]=B[14],Q[15]=B[15],Q},t.L=ca,t.M=function(Q,B){const oe={};for(let Ee=0;Ee{const B=window.document.createElement("video");return B.muted=!0,new Promise(oe=>{B.onloadstart=()=>{oe(B)};for(const Ee of Q){const Ge=window.document.createElement("source");ce(Ee)||(B.crossOrigin="Anonymous"),Ge.src=Ee,B.appendChild(Ge)}})},t.a4=function(){return T++},t.a5=Mi,t.a6=u_,t.a7=od,t.a8=Ir,t.a9=v6,t.aA=function(Q){if(Q.type==="custom")return new u6(Q);switch(Q.type){case"background":return new e2(Q);case"circle":return new ti(Q);case"fill":return new Sn(Q);case"fill-extrusion":return new am(Q);case"heatmap":return new xl(Q);case"hillshade":return new xc(Q);case"line":return new i_(Q);case"raster":return new w4(Q);case"symbol":return new ZT(Q)}},t.aB=h,t.aC=function(Q,B){if(!Q)return[{command:"setStyle",args:[B]}];let oe=[];try{if(!$e(Q.version,B.version))return[{command:"setStyle",args:[B]}];$e(Q.center,B.center)||oe.push({command:"setCenter",args:[B.center]}),$e(Q.zoom,B.zoom)||oe.push({command:"setZoom",args:[B.zoom]}),$e(Q.bearing,B.bearing)||oe.push({command:"setBearing",args:[B.bearing]}),$e(Q.pitch,B.pitch)||oe.push({command:"setPitch",args:[B.pitch]}),$e(Q.sprite,B.sprite)||oe.push({command:"setSprite",args:[B.sprite]}),$e(Q.glyphs,B.glyphs)||oe.push({command:"setGlyphs",args:[B.glyphs]}),$e(Q.transition,B.transition)||oe.push({command:"setTransition",args:[B.transition]}),$e(Q.light,B.light)||oe.push({command:"setLight",args:[B.light]}),$e(Q.terrain,B.terrain)||oe.push({command:"setTerrain",args:[B.terrain]}),$e(Q.sky,B.sky)||oe.push({command:"setSky",args:[B.sky]}),$e(Q.projection,B.projection)||oe.push({command:"setProjection",args:[B.projection]});const Ee={},Ge=[];(function(st,kt,Ht,sr){let Er;for(Er in kt=kt||{},st=st||{})Object.prototype.hasOwnProperty.call(st,Er)&&(Object.prototype.hasOwnProperty.call(kt,Er)||it(Er,Ht,sr));for(Er in kt)Object.prototype.hasOwnProperty.call(kt,Er)&&(Object.prototype.hasOwnProperty.call(st,Er)?$e(st[Er],kt[Er])||(st[Er].type==="geojson"&&kt[Er].type==="geojson"&&bt(st,kt,Er)?Ze(Ht,{command:"setGeoJSONSourceData",args:[Er,kt[Er].data]}):yt(Er,kt,Ht,sr)):Xe(Er,kt,Ht))})(Q.sources,B.sources,Ge,Ee);const rt=[];Q.layers&&Q.layers.forEach(st=>{"source"in st&&Ee[st.source]?oe.push({command:"removeLayer",args:[st.id]}):rt.push(st)}),oe=oe.concat(Ge),(function(st,kt,Ht){kt=kt||[];const sr=(st=st||[]).map(ht),Er=kt.map(ht),Pr=st.reduce(Ve,{}),nn=kt.reduce(Ve,{}),pn=sr.slice(),Cn=Object.create(null);let Bn,ta,Da,Di,ni;for(let Ti=0,uo=0;Ti@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(oe,Ee,Ge,rt)=>{const st=Ge||rt;return B[Ee]=!st||st.toLowerCase(),""}),B["max-age"]){const oe=parseInt(B["max-age"],10);isNaN(oe)?delete B["max-age"]:B["max-age"]=oe}return B},t.ab=function(Q,B){const oe=[];for(const Ee in Q)Ee in B||oe.push(Ee);return oe},t.ac=A,t.ad=function(Q,B,oe){var Ee=Math.sin(oe),Ge=Math.cos(oe),rt=B[0],st=B[1],kt=B[2],Ht=B[3],sr=B[4],Er=B[5],Pr=B[6],nn=B[7];return B!==Q&&(Q[8]=B[8],Q[9]=B[9],Q[10]=B[10],Q[11]=B[11],Q[12]=B[12],Q[13]=B[13],Q[14]=B[14],Q[15]=B[15]),Q[0]=rt*Ge+sr*Ee,Q[1]=st*Ge+Er*Ee,Q[2]=kt*Ge+Pr*Ee,Q[3]=Ht*Ge+nn*Ee,Q[4]=sr*Ge-rt*Ee,Q[5]=Er*Ge-st*Ee,Q[6]=Pr*Ge-kt*Ee,Q[7]=nn*Ge-Ht*Ee,Q},t.ae=function(Q){var B=new io(16);return B[0]=Q[0],B[1]=Q[1],B[2]=Q[2],B[3]=Q[3],B[4]=Q[4],B[5]=Q[5],B[6]=Q[6],B[7]=Q[7],B[8]=Q[8],B[9]=Q[9],B[10]=Q[10],B[11]=Q[11],B[12]=Q[12],B[13]=Q[13],B[14]=Q[14],B[15]=Q[15],B},t.af=yi,t.ag=function(Q,B){let oe=0,Ee=0;if(Q.kind==="constant")Ee=Q.layoutSize;else if(Q.kind!=="source"){const{interpolationType:Ge,minZoom:rt,maxZoom:st}=Q,kt=Ge?A(Oi.interpolationFactor(Ge,B,rt,st),0,1):0;Q.kind==="camera"?Ee=Xo.number(Q.minSize,Q.maxSize,kt):oe=kt}return{uSizeT:oe,uSize:Ee}},t.ai=function(Q,{uSize:B,uSizeT:oe},{lowerSize:Ee,upperSize:Ge}){return Q.kind==="source"?Ee/s0:Q.kind==="composite"?Xo.number(Ee/s0,Ge/s0,oe):B},t.aj=Qy,t.ak=function(Q,B,oe,Ee){const Ge=B.y-Q.y,rt=B.x-Q.x,st=Ee.y-oe.y,kt=Ee.x-oe.x,Ht=st*rt-kt*Ge;if(Ht===0)return null;const sr=(kt*(Q.y-oe.y)-st*(Q.x-oe.x))/Ht;return new s(Q.x+sr*rt,Q.y+sr*Ge)},t.al=_6,t.am=Ca,t.an=wa,t.ao=function(Q){let B=1/0,oe=1/0,Ee=-1/0,Ge=-1/0;for(const rt of Q)B=Math.min(B,rt.x),oe=Math.min(oe,rt.y),Ee=Math.max(Ee,rt.x),Ge=Math.max(Ge,rt.y);return[B,oe,Ee,Ge]},t.ap=Uc,t.ar=hE,t.as=function(Q,B){var oe=B[0],Ee=B[1],Ge=B[2],rt=B[3],st=B[4],kt=B[5],Ht=B[6],sr=B[7],Er=B[8],Pr=B[9],nn=B[10],pn=B[11],Cn=B[12],Bn=B[13],ta=B[14],Da=B[15],Di=oe*kt-Ee*st,ni=oe*Ht-Ge*st,Ti=oe*sr-rt*st,uo=Ee*Ht-Ge*kt,Oo=Ee*sr-rt*kt,ms=Ge*sr-rt*Ht,zl=Er*Bn-Pr*Cn,Es=Er*ta-nn*Cn,ds=Er*Da-pn*Cn,tl=Pr*ta-nn*Bn,Hs=Pr*Da-pn*Bn,Vs=nn*Da-pn*ta,Co=Di*Vs-ni*Hs+Ti*tl+uo*ds-Oo*Es+ms*zl;return Co?(Q[0]=(kt*Vs-Ht*Hs+sr*tl)*(Co=1/Co),Q[1]=(Ge*Hs-Ee*Vs-rt*tl)*Co,Q[2]=(Bn*ms-ta*Oo+Da*uo)*Co,Q[3]=(nn*Oo-Pr*ms-pn*uo)*Co,Q[4]=(Ht*ds-st*Vs-sr*Es)*Co,Q[5]=(oe*Vs-Ge*ds+rt*Es)*Co,Q[6]=(ta*Ti-Cn*ms-Da*ni)*Co,Q[7]=(Er*ms-nn*Ti+pn*ni)*Co,Q[8]=(st*Hs-kt*ds+sr*zl)*Co,Q[9]=(Ee*ds-oe*Hs-rt*zl)*Co,Q[10]=(Cn*Oo-Bn*Ti+Da*Di)*Co,Q[11]=(Pr*Ti-Er*Oo-pn*Di)*Co,Q[12]=(kt*Es-st*tl-Ht*zl)*Co,Q[13]=(oe*tl-Ee*Es+Ge*zl)*Co,Q[14]=(Bn*ni-Cn*uo-ta*Di)*Co,Q[15]=(Er*uo-Pr*ni+nn*Di)*Co,Q):null},t.at=wE,t.au=fE,t.av=TE,t.aw=function(){const Q={},B=pe.$version;for(const oe in pe.$root){const Ee=pe.$root[oe];if(Ee.required){let Ge=null;Ge=oe==="version"?B:Ee.type==="array"?[]:{},Ge!=null&&(Q[oe]=Ge)}}return Q},t.ax=To,t.ay=Y,t.az=function(Q){Q=Q.slice();const B=Object.create(null);for(let oe=0;oe25||Ee<0||Ee>=1||oe<0||oe>=1)},t.bc=function(Q,B){return Q[0]=B[0],Q[1]=0,Q[2]=0,Q[3]=0,Q[4]=0,Q[5]=B[1],Q[6]=0,Q[7]=0,Q[8]=0,Q[9]=0,Q[10]=B[2],Q[11]=0,Q[12]=0,Q[13]=0,Q[14]=0,Q[15]=1,Q},t.bd=class extends Tr{},t.be=gE,t.bf=R6,t.bh=_e,t.bi=function(Q,B){ue.REGISTERED_PROTOCOLS[Q]=B},t.bj=function(Q){delete ue.REGISTERED_PROTOCOLS[Q]},t.bk=function(Q,B){const oe={};for(let Ge=0;GeVs*Uc)}let Es=st?"center":oe.get("text-justify").evaluate(sr,{},Q.canonical);const ds=oe.get("symbol-placement")==="point"?oe.get("text-max-width").evaluate(sr,{},Q.canonical)*Uc:1/0,tl=()=>{Q.bucket.allowVerticalPlacement&&Ts(Ti)&&(Cn.vertical=qT(Bn,Q.glyphMap,Q.glyphPositions,Q.imagePositions,Er,ds,rt,ms,"left",Oo,Da,t.ah.vertical,!0,nn,Pr))};if(!st&&zl){const Hs=new Set;if(Es==="auto")for(let Co=0;Cor(void 0,void 0,void 0,function*(){if(Q.byteLength===0)return createImageBitmap(new ImageData(1,1));const B=new Blob([new Uint8Array(Q)],{type:"image/png"});try{return createImageBitmap(B)}catch(oe){throw new Error(`Could not load image because of ${oe.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),t.e=I,t.f=Q=>new Promise((B,oe)=>{const Ee=new Image;Ee.onload=()=>{B(Ee),URL.revokeObjectURL(Ee.src),Ee.onload=null,window.requestAnimationFrame(()=>{Ee.src=G})},Ee.onerror=()=>oe(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."));const Ge=new Blob([new Uint8Array(Q)],{type:"image/png"});Ee.src=Q.byteLength?URL.createObjectURL(Ge):G}),t.g=xe,t.h=(Q,B)=>se(I(Q,{type:"json"}),B),t.i=z,t.j=Z,t.k=le,t.l=(Q,B)=>se(I(Q,{type:"arrayBuffer"}),B),t.m=se,t.n=function(Q){return new sE(Q).readFields(v4,[])},t.o=_s,t.p=GT,t.q=Qe,t.r=Fa,t.s=ce,t.t=fi,t.u=$a,t.v=pe,t.w=w,t.x=function([Q,B,oe]){return B+=90,B*=Math.PI/180,oe*=Math.PI/180,{x:Q*Math.cos(B)*Math.sin(oe),y:Q*Math.sin(B)*Math.sin(oe),z:Q*Math.cos(oe)}},t.y=Xo,t.z=Fl}),M("worker",["./shared"],function(t){class r{constructor(et){this.keyCache={},et&&this.replace(et)}replace(et){this._layerConfigs={},this._layers={},this.update(et,[])}update(et,ut){for(const Ie of et){this._layerConfigs[Ie.id]=Ie;const ke=this._layers[Ie.id]=t.aA(Ie);ke._featureFilter=t.a7(ke.filter),this.keyCache[Ie.id]&&delete this.keyCache[Ie.id]}for(const Ie of ut)delete this.keyCache[Ie],delete this._layerConfigs[Ie],delete this._layers[Ie];this.familiesBySource={};const Be=t.bk(Object.values(this._layerConfigs),this.keyCache);for(const Ie of Be){const ke=Ie.map(Zt=>this._layers[Zt.id]),Fe=ke[0];if(Fe.visibility==="none")continue;const at=Fe.source||"";let ct=this.familiesBySource[at];ct||(ct=this.familiesBySource[at]={});const Gt=Fe.sourceLayer||"_geojsonTileLayer";let Vt=ct[Gt];Vt||(Vt=ct[Gt]=[]),Vt.push(ke)}}}class a{constructor(et){const ut={},Be=[];for(const at in et){const ct=et[at],Gt=ut[at]={};for(const Vt in ct){const Zt=ct[+Vt];if(!Zt||Zt.bitmap.width===0||Zt.bitmap.height===0)continue;const ur={x:0,y:0,w:Zt.bitmap.width+2,h:Zt.bitmap.height+2};Be.push(ur),Gt[Vt]={rect:ur,metrics:Zt.metrics}}}const{w:Ie,h:ke}=t.p(Be),Fe=new t.o({width:Ie||1,height:ke||1});for(const at in et){const ct=et[at];for(const Gt in ct){const Vt=ct[+Gt];if(!Vt||Vt.bitmap.width===0||Vt.bitmap.height===0)continue;const Zt=ut[at][Gt].rect;t.o.copy(Vt.bitmap,Fe,{x:0,y:0},{x:Zt.x+1,y:Zt.y+1},Vt.bitmap)}}this.image=Fe,this.positions=ut}}t.bl("GlyphAtlas",a);class l{constructor(et){this.tileID=new t.S(et.tileID.overscaledZ,et.tileID.wrap,et.tileID.canonical.z,et.tileID.canonical.x,et.tileID.canonical.y),this.uid=et.uid,this.zoom=et.zoom,this.pixelRatio=et.pixelRatio,this.tileSize=et.tileSize,this.source=et.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=et.showCollisionBoxes,this.collectResourceTiming=!!et.collectResourceTiming,this.returnDependencies=!!et.returnDependencies,this.promoteId=et.promoteId,this.inFlightDependencies=[]}parse(et,ut,Be,Ie){return t._(this,void 0,void 0,function*(){this.status="parsing",this.data=et,this.collisionBoxArray=new t.a5;const ke=new t.bm(Object.keys(et.layers).sort()),Fe=new t.bn(this.tileID,this.promoteId);Fe.bucketLayerIDs=[];const at={},ct={featureIndex:Fe,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Be},Gt=ut.familiesBySource[this.source];for(const xa in Gt){const ra=et.layers[xa];if(!ra)continue;ra.version===1&&t.w(`Vector tile source "${this.source}" layer "${xa}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Ha=ke.encode(xa),ci=[];for(let _r=0;_r=rr.maxzoom||rr.visibility!=="none"&&(i(_r,this.zoom,Be),(at[rr.id]=rr.createBucket({index:Fe.bucketLayerIDs.length,layers:_r,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Ha,sourceID:this.source})).populate(ci,ct,this.tileID.canonical),Fe.bucketLayerIDs.push(_r.map(yr=>yr.id)))}}const Vt=t.aF(ct.glyphDependencies,xa=>Object.keys(xa).map(Number));this.inFlightDependencies.forEach(xa=>xa?.abort()),this.inFlightDependencies=[];let Zt=Promise.resolve({});if(Object.keys(Vt).length){const xa=new AbortController;this.inFlightDependencies.push(xa),Zt=Ie.sendAsync({type:"GG",data:{stacks:Vt,source:this.source,tileID:this.tileID,type:"glyphs"}},xa)}const ur=Object.keys(ct.iconDependencies);let Dr=Promise.resolve({});if(ur.length){const xa=new AbortController;this.inFlightDependencies.push(xa),Dr=Ie.sendAsync({type:"GI",data:{icons:ur,source:this.source,tileID:this.tileID,type:"icons"}},xa)}const kr=Object.keys(ct.patternDependencies);let Sr=Promise.resolve({});if(kr.length){const xa=new AbortController;this.inFlightDependencies.push(xa),Sr=Ie.sendAsync({type:"GI",data:{icons:kr,source:this.source,tileID:this.tileID,type:"patterns"}},xa)}const[Jr,jn,ha]=yield Promise.all([Zt,Dr,Sr]),oa=new a(Jr),_a=new t.bo(jn,ha);for(const xa in at){const ra=at[xa];ra instanceof t.a6?(i(ra.layers,this.zoom,Be),t.bp({bucket:ra,glyphMap:Jr,glyphPositions:oa.positions,imageMap:jn,imagePositions:_a.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):ra.hasPattern&&(ra instanceof t.bq||ra instanceof t.br||ra instanceof t.bs)&&(i(ra.layers,this.zoom,Be),ra.addFeatures(ct,this.tileID.canonical,_a.patternPositions))}return this.status="done",{buckets:Object.values(at).filter(xa=>!xa.isEmpty()),featureIndex:Fe,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:oa.image,imageAtlas:_a,glyphMap:this.returnDependencies?Jr:null,iconMap:this.returnDependencies?jn:null,glyphPositions:this.returnDependencies?oa.positions:null}})}}function i(Bt,et,ut){const Be=new t.z(et);for(const Ie of Bt)Ie.recalculate(Be,ut)}class s{constructor(et,ut,Be){this.actor=et,this.layerIndex=ut,this.availableImages=Be,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(et,ut){return t._(this,void 0,void 0,function*(){const Be=yield t.l(et.request,ut);try{return{vectorTile:new t.bt.VectorTile(new t.bu(Be.data)),rawData:Be.data,cacheControl:Be.cacheControl,expires:Be.expires}}catch(Ie){const ke=new Uint8Array(Be.data);let Fe=`Unable to parse the tile at ${et.request.url}, `;throw Fe+=ke[0]===31&&ke[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${Ie.message}`,new Error(Fe)}})}loadTile(et){return t._(this,void 0,void 0,function*(){const ut=et.uid,Be=!!(et&&et.request&&et.request.collectResourceTiming)&&new t.bv(et.request),Ie=new l(et);this.loading[ut]=Ie;const ke=new AbortController;Ie.abort=ke;try{const Fe=yield this.loadVectorTile(et,ke);if(delete this.loading[ut],!Fe)return null;const at=Fe.rawData,ct={};Fe.expires&&(ct.expires=Fe.expires),Fe.cacheControl&&(ct.cacheControl=Fe.cacheControl);const Gt={};if(Be){const Zt=Be.finish();Zt&&(Gt.resourceTiming=JSON.parse(JSON.stringify(Zt)))}Ie.vectorTile=Fe.vectorTile;const Vt=Ie.parse(Fe.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[ut]=Ie,this.fetching[ut]={rawTileData:at,cacheControl:ct,resourceTiming:Gt};try{const Zt=yield Vt;return t.e({rawTileData:at.slice(0)},Zt,ct,Gt)}finally{delete this.fetching[ut]}}catch(Fe){throw delete this.loading[ut],Ie.status="done",this.loaded[ut]=Ie,Fe}})}reloadTile(et){return t._(this,void 0,void 0,function*(){const ut=et.uid;if(!this.loaded||!this.loaded[ut])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Be=this.loaded[ut];if(Be.showCollisionBoxes=et.showCollisionBoxes,Be.status==="parsing"){const Ie=yield Be.parse(Be.vectorTile,this.layerIndex,this.availableImages,this.actor);let ke;if(this.fetching[ut]){const{rawTileData:Fe,cacheControl:at,resourceTiming:ct}=this.fetching[ut];delete this.fetching[ut],ke=t.e({rawTileData:Fe.slice(0)},Ie,at,ct)}else ke=Ie;return ke}if(Be.status==="done"&&Be.vectorTile)return Be.parse(Be.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(et){return t._(this,void 0,void 0,function*(){const ut=this.loading,Be=et.uid;ut&&ut[Be]&&ut[Be].abort&&(ut[Be].abort.abort(),delete ut[Be])})}removeTile(et){return t._(this,void 0,void 0,function*(){this.loaded&&this.loaded[et.uid]&&delete this.loaded[et.uid]})}}class o{constructor(){this.loaded={}}loadTile(et){return t._(this,void 0,void 0,function*(){const{uid:ut,encoding:Be,rawImageData:Ie,redFactor:ke,greenFactor:Fe,blueFactor:at,baseShift:ct}=et,Gt=Ie.width+2,Vt=Ie.height+2,Zt=t.b(Ie)?new t.R({width:Gt,height:Vt},yield t.bw(Ie,-1,-1,Gt,Vt)):Ie,ur=new t.bx(ut,Zt,Be,ke,Fe,at,ct);return this.loaded=this.loaded||{},this.loaded[ut]=ur,ur})}removeTile(et){const ut=this.loaded,Be=et.uid;ut&&ut[Be]&&delete ut[Be]}}function c(Bt,et){if(Bt.length!==0){p(Bt[0],et);for(var ut=1;ut=Math.abs(at)?ut-ct+at:at-ct+ut,ut=ct}ut+Be>=0!=!!et&&Bt.reverse()}var d=t.by(function Bt(et,ut){var Be,Ie=et&&et.type;if(Ie==="FeatureCollection")for(Be=0;Be>31}function z(Bt,et){for(var ut=Bt.loadGeometry(),Be=Bt.type,Ie=0,ke=0,Fe=ut.length,at=0;atBt},j=Math.fround||(O=new Float32Array(1),Bt=>(O[0]=+Bt,O[0]));var O;const H=3,W=5,ee=6;class ue{constructor(et){this.options=Object.assign(Object.create(G),et),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(et){const{log:ut,minZoom:Be,maxZoom:Ie}=this.options;ut&&console.time("total time");const ke=`prepare ${et.length} points`;ut&&console.time(ke),this.points=et;const Fe=[];for(let ct=0;ct=Be;ct--){const Gt=+Date.now();at=this.trees[ct]=this._createTree(this._cluster(at,ct)),ut&&console.log("z%d: %d clusters in %dms",ct,at.numItems,+Date.now()-Gt)}return ut&&console.timeEnd("total time"),this}getClusters(et,ut){let Be=((et[0]+180)%360+360)%360-180;const Ie=Math.max(-90,Math.min(90,et[1]));let ke=et[2]===180?180:((et[2]+180)%360+360)%360-180;const Fe=Math.max(-90,Math.min(90,et[3]));if(et[2]-et[0]>=360)Be=-180,ke=180;else if(Be>ke){const Zt=this.getClusters([Be,Ie,180,Fe],ut),ur=this.getClusters([-180,Ie,ke,Fe],ut);return Zt.concat(ur)}const at=this.trees[this._limitZoom(ut)],ct=at.range(_e(Be),Y(Fe),_e(ke),Y(Ie)),Gt=at.data,Vt=[];for(const Zt of ct){const ur=this.stride*Zt;Vt.push(Gt[ur+W]>1?xe(Gt,ur,this.clusterProps):this.points[Gt[ur+H]])}return Vt}getChildren(et){const ut=this._getOriginId(et),Be=this._getOriginZoom(et),Ie="No cluster with the specified id.",ke=this.trees[Be];if(!ke)throw new Error(Ie);const Fe=ke.data;if(ut*this.stride>=Fe.length)throw new Error(Ie);const at=this.options.radius/(this.options.extent*Math.pow(2,Be-1)),ct=ke.within(Fe[ut*this.stride],Fe[ut*this.stride+1],at),Gt=[];for(const Vt of ct){const Zt=Vt*this.stride;Fe[Zt+4]===et&&Gt.push(Fe[Zt+W]>1?xe(Fe,Zt,this.clusterProps):this.points[Fe[Zt+H]])}if(Gt.length===0)throw new Error(Ie);return Gt}getLeaves(et,ut,Be){const Ie=[];return this._appendLeaves(Ie,et,ut=ut||10,Be=Be||0,0),Ie}getTile(et,ut,Be){const Ie=this.trees[this._limitZoom(et)],ke=Math.pow(2,et),{extent:Fe,radius:at}=this.options,ct=at/Fe,Gt=(Be-ct)/ke,Vt=(Be+1+ct)/ke,Zt={features:[]};return this._addTileFeatures(Ie.range((ut-ct)/ke,Gt,(ut+1+ct)/ke,Vt),Ie.data,ut,Be,ke,Zt),ut===0&&this._addTileFeatures(Ie.range(1-ct/ke,Gt,1,Vt),Ie.data,ke,Be,ke,Zt),ut===ke-1&&this._addTileFeatures(Ie.range(0,Gt,ct/ke,Vt),Ie.data,-1,Be,ke,Zt),Zt.features.length?Zt:null}getClusterExpansionZoom(et){let ut=this._getOriginZoom(et)-1;for(;ut<=this.options.maxZoom;){const Be=this.getChildren(et);if(ut++,Be.length!==1)break;et=Be[0].properties.cluster_id}return ut}_appendLeaves(et,ut,Be,Ie,ke){const Fe=this.getChildren(ut);for(const at of Fe){const ct=at.properties;if(ct&&ct.cluster?ke+ct.point_count<=Ie?ke+=ct.point_count:ke=this._appendLeaves(et,ct.cluster_id,Be,Ie,ke):ke1;let Vt,Zt,ur;if(Gt)Vt=ge(ut,ct,this.clusterProps),Zt=ut[ct],ur=ut[ct+1];else{const Sr=this.points[ut[ct+H]];Vt=Sr.properties;const[Jr,jn]=Sr.geometry.coordinates;Zt=_e(Jr),ur=Y(jn)}const Dr={type:1,geometry:[[Math.round(this.options.extent*(Zt*ke-Be)),Math.round(this.options.extent*(ur*ke-Ie))]],tags:Vt};let kr;kr=Gt||this.options.generateId?ut[ct+H]:this.points[ut[ct+H]].id,kr!==void 0&&(Dr.id=kr),Fe.features.push(Dr)}}_limitZoom(et){return Math.max(this.options.minZoom,Math.min(Math.floor(+et),this.options.maxZoom+1))}_cluster(et,ut){const{radius:Be,extent:Ie,reduce:ke,minPoints:Fe}=this.options,at=Be/(Ie*Math.pow(2,ut)),ct=et.data,Gt=[],Vt=this.stride;for(let Zt=0;Ztut&&(Jr+=ct[ha+W])}if(Jr>Sr&&Jr>=Fe){let jn,ha=ur*Sr,oa=Dr*Sr,_a=-1;const xa=((Zt/Vt|0)<<5)+(ut+1)+this.points.length;for(const ra of kr){const Ha=ra*Vt;if(ct[Ha+2]<=ut)continue;ct[Ha+2]=ut;const ci=ct[Ha+W];ha+=ct[Ha]*ci,oa+=ct[Ha+1]*ci,ct[Ha+4]=xa,ke&&(jn||(jn=this._map(ct,Zt,!0),_a=this.clusterProps.length,this.clusterProps.push(jn)),ke(jn,this._map(ct,Ha)))}ct[Zt+4]=xa,Gt.push(ha/Jr,oa/Jr,1/0,xa,-1,Jr),ke&&Gt.push(_a)}else{for(let jn=0;jn1)for(const jn of kr){const ha=jn*Vt;if(!(ct[ha+2]<=ut)){ct[ha+2]=ut;for(let oa=0;oa>5}_getOriginZoom(et){return(et-this.points.length)%32}_map(et,ut,Be){if(et[ut+W]>1){const Fe=this.clusterProps[et[ut+ee]];return Be?Object.assign({},Fe):Fe}const Ie=this.points[et[ut+H]].properties,ke=this.options.map(Ie);return Be&&ke===Ie?Object.assign({},ke):ke}}function xe(Bt,et,ut){return{type:"Feature",id:Bt[et+H],properties:ge(Bt,et,ut),geometry:{type:"Point",coordinates:[(Be=Bt[et],360*(Be-.5)),se(Bt[et+1])]}};var Be}function ge(Bt,et,ut){const Be=Bt[et+W],Ie=Be>=1e4?`${Math.round(Be/1e3)}k`:Be>=1e3?Math.round(Be/100)/10+"k":Be,ke=Bt[et+ee],Fe=ke===-1?{}:Object.assign({},ut[ke]);return Object.assign(Fe,{cluster:!0,cluster_id:Bt[et+H],point_count:Be,point_count_abbreviated:Ie})}function _e(Bt){return Bt/360+.5}function Y(Bt){const et=Math.sin(Bt*Math.PI/180),ut=.5-.25*Math.log((1+et)/(1-et))/Math.PI;return ut<0?0:ut>1?1:ut}function se(Bt){const et=(180-360*Bt)*Math.PI/180;return 360*Math.atan(Math.exp(et))/Math.PI-90}function ce(Bt,et,ut,Be){let Ie=Be;const ke=et+(ut-et>>1);let Fe,at=ut-et;const ct=Bt[et],Gt=Bt[et+1],Vt=Bt[ut],Zt=Bt[ut+1];for(let ur=et+3;urIe)Fe=ur,Ie=Dr;else if(Dr===Ie){const kr=Math.abs(ur-ke);krBe&&(Fe-et>3&&ce(Bt,et,Fe,Be),Bt[Fe+2]=Ie,ut-Fe>3&&ce(Bt,Fe,ut,Be))}function ne(Bt,et,ut,Be,Ie,ke){let Fe=Ie-ut,at=ke-Be;if(Fe!==0||at!==0){const ct=((Bt-ut)*Fe+(et-Be)*at)/(Fe*Fe+at*at);ct>1?(ut=Ie,Be=ke):ct>0&&(ut+=Fe*ct,Be+=at*ct)}return Fe=Bt-ut,at=et-Be,Fe*Fe+at*at}function ye(Bt,et,ut,Be){const Ie={id:Bt??null,type:et,geometry:ut,tags:Be,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(et==="Point"||et==="MultiPoint"||et==="LineString")le(Ie,ut);else if(et==="Polygon")le(Ie,ut[0]);else if(et==="MultiLineString")for(const ke of ut)le(Ie,ke);else if(et==="MultiPolygon")for(const ke of ut)le(Ie,ke[0]);return Ie}function le(Bt,et){for(let ut=0;ut0&&(Fe+=Be?(Ie*Vt-Gt*ke)/2:Math.sqrt(Math.pow(Gt-Ie,2)+Math.pow(Vt-ke,2))),Ie=Gt,ke=Vt}const at=et.length-3;et[2]=1,ce(et,0,at,ut),et[at+2]=1,et.size=Math.abs(Fe),et.start=0,et.end=et.size}function Te(Bt,et,ut,Be){for(let Ie=0;Ie1?1:ut}function Ze(Bt,et,ut,Be,Ie,ke,Fe,at){if(Be/=et,ke>=(ut/=et)&&Fe=Be)return null;const ct=[];for(const Gt of Bt){const Vt=Gt.geometry;let Zt=Gt.type;const ur=Ie===0?Gt.minX:Gt.minY,Dr=Ie===0?Gt.maxX:Gt.maxY;if(ur>=ut&&Dr=Be)continue;let kr=[];if(Zt==="Point"||Zt==="MultiPoint")Xe(Vt,kr,ut,Be,Ie);else if(Zt==="LineString")it(Vt,kr,ut,Be,Ie,!1,at.lineMetrics);else if(Zt==="MultiLineString")bt(Vt,kr,ut,Be,Ie,!1);else if(Zt==="Polygon")bt(Vt,kr,ut,Be,Ie,!0);else if(Zt==="MultiPolygon")for(const Sr of Vt){const Jr=[];bt(Sr,Jr,ut,Be,Ie,!0),Jr.length&&kr.push(Jr)}if(kr.length){if(at.lineMetrics&&Zt==="LineString"){for(const Sr of kr)ct.push(ye(Gt.id,Zt,Sr,Gt.tags));continue}Zt!=="LineString"&&Zt!=="MultiLineString"||(kr.length===1?(Zt="LineString",kr=kr[0]):Zt="MultiLineString"),Zt!=="Point"&&Zt!=="MultiPoint"||(Zt=kr.length===3?"Point":"MultiPoint"),ct.push(ye(Gt.id,Zt,kr,Gt.tags))}}return ct.length?ct:null}function Xe(Bt,et,ut,Be,Ie){for(let ke=0;ke=ut&&Fe<=Be&&mt(et,Bt[ke],Bt[ke+1],Bt[ke+2])}}function it(Bt,et,ut,Be,Ie,ke,Fe){let at=yt(Bt);const ct=Ie===0?ht:Ve;let Gt,Vt,Zt=Bt.start;for(let Jr=0;Jrut&&(Vt=ct(at,jn,ha,_a,xa,ut),Fe&&(at.start=Zt+Gt*Vt)):ra>Be?Ha=ut&&(Vt=ct(at,jn,ha,_a,xa,ut),ci=!0),Ha>Be&&ra<=Be&&(Vt=ct(at,jn,ha,_a,xa,Be),ci=!0),!ke&&ci&&(Fe&&(at.end=Zt+Gt*Vt),et.push(at),at=yt(Bt)),Fe&&(Zt+=Gt)}let ur=Bt.length-3;const Dr=Bt[ur],kr=Bt[ur+1],Sr=Ie===0?Dr:kr;Sr>=ut&&Sr<=Be&&mt(at,Dr,kr,Bt[ur+2]),ur=at.length-3,ke&&ur>=3&&(at[ur]!==at[0]||at[ur+1]!==at[1])&&mt(at,at[0],at[1],at[2]),at.length&&et.push(at)}function yt(Bt){const et=[];return et.size=Bt.size,et.start=Bt.start,et.end=Bt.end,et}function bt(Bt,et,ut,Be,Ie,ke){for(const Fe of Bt)it(Fe,et,ut,Be,Ie,ke,!1)}function mt(Bt,et,ut,Be){Bt.push(et,ut,Be)}function ht(Bt,et,ut,Be,Ie,ke){const Fe=(ke-et)/(Be-et);return mt(Bt,ke,ut+(Ie-ut)*Fe,1),Fe}function Ve(Bt,et,ut,Be,Ie,ke){const Fe=(ke-ut)/(Ie-ut);return mt(Bt,et+(Be-et)*Fe,ke,1),Fe}function ze(Bt,et){const ut=[];for(let Be=0;Be0&&et.size<(Ie?Fe:Be))return void(ut.numPoints+=et.length/3);const at=[];for(let ct=0;ctFe)&&(ut.numSimplified++,at.push(et[ct],et[ct+1])),ut.numPoints++;Ie&&(function(ct,Gt){let Vt=0;for(let Zt=0,ur=ct.length,Dr=ur-2;Zt0===Gt)for(let Zt=0,ur=ct.length;Zt24)throw new Error("maxZoom should be in the 0-24 range");if(ut.promoteId&&ut.generateId)throw new Error("promoteId and generateId cannot be used together.");let Ie=(function(ke,Fe){const at=[];if(ke.type==="FeatureCollection")for(let ct=0;ct1&&console.time("creation"),Dr=this.tiles[ur]=At(et,ut,Be,Ie,Gt),this.tileCoords.push({z:ut,x:Be,y:Ie}),Vt)){Vt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ut,Be,Ie,Dr.numFeatures,Dr.numPoints,Dr.numSimplified),console.timeEnd("creation"));const ci=`z${ut}`;this.stats[ci]=(this.stats[ci]||0)+1,this.total++}if(Dr.source=et,ke==null){if(ut===Gt.indexMaxZoom||Dr.numPoints<=Gt.indexMaxPoints)continue}else{if(ut===Gt.maxZoom||ut===ke)continue;if(ke!=null){const ci=ke-ut;if(Be!==Fe>>ci||Ie!==at>>ci)continue}}if(Dr.source=null,et.length===0)continue;Vt>1&&console.time("clipping");const kr=.5*Gt.buffer/Gt.extent,Sr=.5-kr,Jr=.5+kr,jn=1+kr;let ha=null,oa=null,_a=null,xa=null,ra=Ze(et,Zt,Be-kr,Be+Jr,0,Dr.minX,Dr.maxX,Gt),Ha=Ze(et,Zt,Be+Sr,Be+jn,0,Dr.minX,Dr.maxX,Gt);et=null,ra&&(ha=Ze(ra,Zt,Ie-kr,Ie+Jr,1,Dr.minY,Dr.maxY,Gt),oa=Ze(ra,Zt,Ie+Sr,Ie+jn,1,Dr.minY,Dr.maxY,Gt),ra=null),Ha&&(_a=Ze(Ha,Zt,Ie-kr,Ie+Jr,1,Dr.minY,Dr.maxY,Gt),xa=Ze(Ha,Zt,Ie+Sr,Ie+jn,1,Dr.minY,Dr.maxY,Gt),Ha=null),Vt>1&&console.timeEnd("clipping"),ct.push(ha||[],ut+1,2*Be,2*Ie),ct.push(oa||[],ut+1,2*Be,2*Ie+1),ct.push(_a||[],ut+1,2*Be+1,2*Ie),ct.push(xa||[],ut+1,2*Be+1,2*Ie+1)}}getTile(et,ut,Be){et=+et,ut=+ut,Be=+Be;const Ie=this.options,{extent:ke,debug:Fe}=Ie;if(et<0||et>24)return null;const at=1<1&&console.log("drilling down to z%d-%d-%d",et,ut,Be);let Gt,Vt=et,Zt=ut,ur=Be;for(;!Gt&&Vt>0;)Vt--,Zt>>=1,ur>>=1,Gt=this.tiles[mr(Vt,Zt,ur)];return Gt&&Gt.source?(Fe>1&&(console.log("found parent tile z%d-%d-%d",Vt,Zt,ur),console.time("drilling down")),this.splitTile(Gt.source,Vt,Zt,ur,et,ut,Be),Fe>1&&console.timeEnd("drilling down"),this.tiles[ct]?Je(this.tiles[ct],ke):null):null}}function mr(Bt,et,ut){return 32*((1<{Zt.properties=Dr;const kr={};for(const Sr of ur)kr[Sr]=ct[Sr].evaluate(Vt,Zt);return kr},Fe.reduce=(Dr,kr)=>{Zt.properties=kr;for(const Sr of ur)Vt.accumulated=Dr[Sr],Dr[Sr]=Gt[Sr].evaluate(Vt,Zt)},Fe})(et)).load((yield this._pendingData).features):(Ie=yield this._pendingData,new fr(Ie,et.geojsonVtOptions)),this.loaded={};const ke={};if(Be){const Fe=Be.finish();Fe&&(ke.resourceTiming={},ke.resourceTiming[et.source]=JSON.parse(JSON.stringify(Fe)))}return ke}catch(ke){if(delete this._pendingRequest,t.bB(ke))return{abandoned:!0};throw ke}var Ie})}getData(){return t._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(et){const ut=this.loaded;return ut&&ut[et.uid]?super.reloadTile(et):this.loadTile(et)}loadAndProcessGeoJSON(et,ut){return t._(this,void 0,void 0,function*(){let Be=yield this.loadGeoJSON(et,ut);if(delete this._pendingRequest,typeof Be!="object")throw new Error(`Input data given to '${et.source}' is not a valid GeoJSON object.`);if(d(Be,!0),et.filter){const Ie=t.bC(et.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ie.result==="error")throw new Error(Ie.value.map(Fe=>`${Fe.key}: ${Fe.message}`).join(", "));Be={type:"FeatureCollection",features:Be.features.filter(Fe=>Ie.value.evaluate({zoom:0},Fe))}}return Be})}loadGeoJSON(et,ut){return t._(this,void 0,void 0,function*(){const{promoteId:Be}=et;if(et.request){const Ie=yield t.h(et.request,ut);return this._dataUpdateable=Br(Ie.data,Be)?fn(Ie.data,Be):void 0,Ie.data}if(typeof et.data=="string")try{const Ie=JSON.parse(et.data);return this._dataUpdateable=Br(Ie,Be)?fn(Ie,Be):void 0,Ie}catch{throw new Error(`Input data given to '${et.source}' is not a valid GeoJSON object.`)}if(!et.dataDiff)throw new Error(`Input data given to '${et.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${et.source}`);return(function(Ie,ke,Fe){var at,ct,Gt,Vt;if(ke.removeAll&&Ie.clear(),ke.remove)for(const Zt of ke.remove)Ie.delete(Zt);if(ke.add)for(const Zt of ke.add){const ur=Ur(Zt,Fe);ur!=null&&Ie.set(ur,Zt)}if(ke.update)for(const Zt of ke.update){let ur=Ie.get(Zt.id);if(ur==null)continue;const Dr=!Zt.removeAllProperties&&(((at=Zt.removeProperties)===null||at===void 0?void 0:at.length)>0||((ct=Zt.addOrUpdateProperties)===null||ct===void 0?void 0:ct.length)>0);if((Zt.newGeometry||Zt.removeAllProperties||Dr)&&(ur=Object.assign({},ur),Ie.set(Zt.id,ur),Dr&&(ur.properties=Object.assign({},ur.properties))),Zt.newGeometry&&(ur.geometry=Zt.newGeometry),Zt.removeAllProperties)ur.properties={};else if(((Gt=Zt.removeProperties)===null||Gt===void 0?void 0:Gt.length)>0)for(const kr of Zt.removeProperties)Object.prototype.hasOwnProperty.call(ur.properties,kr)&&delete ur.properties[kr];if(((Vt=Zt.addOrUpdateProperties)===null||Vt===void 0?void 0:Vt.length)>0)for(const{key:kr,value:Sr}of Zt.addOrUpdateProperties)ur.properties[kr]=Sr}})(this._dataUpdateable,et.dataDiff,Be),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(et){return t._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(et){return this._geoJSONIndex.getClusterExpansionZoom(et.clusterId)}getClusterChildren(et){return this._geoJSONIndex.getChildren(et.clusterId)}getClusterLeaves(et){return this._geoJSONIndex.getLeaves(et.clusterId,et.limit,et.offset)}}class Qr{constructor(et){this.self=et,this.actor=new t.F(et),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(ut,Be)=>{if(this.externalWorkerSourceTypes[ut])throw new Error(`Worker source with name "${ut}" already registered.`);this.externalWorkerSourceTypes[ut]=Be},this.self.addProtocol=t.bi,this.self.removeProtocol=t.bj,this.self.registerRTLTextPlugin=ut=>{if(t.bD.isParsed())throw new Error("RTL text plugin already registered.");t.bD.setMethods(ut)},this.actor.registerMessageHandler("LDT",(ut,Be)=>this._getDEMWorkerSource(ut,Be.source).loadTile(Be)),this.actor.registerMessageHandler("RDT",(ut,Be)=>t._(this,void 0,void 0,function*(){this._getDEMWorkerSource(ut,Be.source).removeTile(Be)})),this.actor.registerMessageHandler("GCEZ",(ut,Be)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(ut,Be.type,Be.source).getClusterExpansionZoom(Be)})),this.actor.registerMessageHandler("GCC",(ut,Be)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(ut,Be.type,Be.source).getClusterChildren(Be)})),this.actor.registerMessageHandler("GCL",(ut,Be)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(ut,Be.type,Be.source).getClusterLeaves(Be)})),this.actor.registerMessageHandler("LD",(ut,Be)=>this._getWorkerSource(ut,Be.type,Be.source).loadData(Be)),this.actor.registerMessageHandler("GD",(ut,Be)=>this._getWorkerSource(ut,Be.type,Be.source).getData()),this.actor.registerMessageHandler("LT",(ut,Be)=>this._getWorkerSource(ut,Be.type,Be.source).loadTile(Be)),this.actor.registerMessageHandler("RT",(ut,Be)=>this._getWorkerSource(ut,Be.type,Be.source).reloadTile(Be)),this.actor.registerMessageHandler("AT",(ut,Be)=>this._getWorkerSource(ut,Be.type,Be.source).abortTile(Be)),this.actor.registerMessageHandler("RMT",(ut,Be)=>this._getWorkerSource(ut,Be.type,Be.source).removeTile(Be)),this.actor.registerMessageHandler("RS",(ut,Be)=>t._(this,void 0,void 0,function*(){if(!this.workerSources[ut]||!this.workerSources[ut][Be.type]||!this.workerSources[ut][Be.type][Be.source])return;const Ie=this.workerSources[ut][Be.type][Be.source];delete this.workerSources[ut][Be.type][Be.source],Ie.removeSource!==void 0&&Ie.removeSource(Be)})),this.actor.registerMessageHandler("RM",ut=>t._(this,void 0,void 0,function*(){delete this.layerIndexes[ut],delete this.availableImages[ut],delete this.workerSources[ut],delete this.demWorkerSources[ut]})),this.actor.registerMessageHandler("SR",(ut,Be)=>t._(this,void 0,void 0,function*(){this.referrer=Be})),this.actor.registerMessageHandler("SRPS",(ut,Be)=>this._syncRTLPluginState(ut,Be)),this.actor.registerMessageHandler("IS",(ut,Be)=>t._(this,void 0,void 0,function*(){this.self.importScripts(Be)})),this.actor.registerMessageHandler("SI",(ut,Be)=>this._setImages(ut,Be)),this.actor.registerMessageHandler("UL",(ut,Be)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(ut).update(Be.layers,Be.removedIds)})),this.actor.registerMessageHandler("SL",(ut,Be)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(ut).replace(Be)}))}_setImages(et,ut){return t._(this,void 0,void 0,function*(){this.availableImages[et]=ut;for(const Be in this.workerSources[et]){const Ie=this.workerSources[et][Be];for(const ke in Ie)Ie[ke].availableImages=ut}})}_syncRTLPluginState(et,ut){return t._(this,void 0,void 0,function*(){if(t.bD.isParsed())return t.bD.getState();if(ut.pluginStatus!=="loading")return t.bD.setState(ut),ut;const Be=ut.pluginURL;if(this.self.importScripts(Be),t.bD.isParsed()){const Ie={pluginStatus:"loaded",pluginURL:Be};return t.bD.setState(Ie),Ie}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Be}`)})}_getAvailableImages(et){let ut=this.availableImages[et];return ut||(ut=[]),ut}_getLayerIndex(et){let ut=this.layerIndexes[et];return ut||(ut=this.layerIndexes[et]=new r),ut}_getWorkerSource(et,ut,Be){if(this.workerSources[et]||(this.workerSources[et]={}),this.workerSources[et][ut]||(this.workerSources[et][ut]={}),!this.workerSources[et][ut][Be]){const Ie={sendAsync:(ke,Fe)=>(ke.targetMapId=et,this.actor.sendAsync(ke,Fe))};switch(ut){case"vector":this.workerSources[et][ut][Be]=new s(Ie,this._getLayerIndex(et),this._getAvailableImages(et));break;case"geojson":this.workerSources[et][ut][Be]=new Fr(Ie,this._getLayerIndex(et),this._getAvailableImages(et));break;default:this.workerSources[et][ut][Be]=new this.externalWorkerSourceTypes[ut](Ie,this._getLayerIndex(et),this._getAvailableImages(et))}}return this.workerSources[et][ut][Be]}_getDEMWorkerSource(et,ut){return this.demWorkerSources[et]||(this.demWorkerSources[et]={}),this.demWorkerSources[et][ut]||(this.demWorkerSources[et][ut]=new o),this.demWorkerSources[et][ut]}}return t.i(self)&&(self.worker=new Qr(self)),Qr}),M("index",["exports","./shared"],function(t,r){var a="4.7.1";let l,i;const s={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Qe=>new Promise((N,ve)=>{const Oe=requestAnimationFrame(N);Qe.signal.addEventListener("abort",()=>{cancelAnimationFrame(Oe),ve(r.c())})}),getImageData(Qe,N=0){return this.getImageCanvasContext(Qe).getImageData(-N,-N,Qe.width+2*N,Qe.height+2*N)},getImageCanvasContext(Qe){const N=window.document.createElement("canvas"),ve=N.getContext("2d",{willReadFrequently:!0});if(!ve)throw new Error("failed to create canvas 2d context");return N.width=Qe.width,N.height=Qe.height,ve.drawImage(Qe,0,0,Qe.width,Qe.height),ve},resolveURL:Qe=>(l||(l=document.createElement("a")),l.href=Qe,l.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(i==null&&(i=matchMedia("(prefers-reduced-motion: reduce)")),i.matches)}};class o{static testProp(N){if(!o.docStyle)return N[0];for(let ve=0;ve{window.removeEventListener("click",o.suppressClickInternal,!0)},0)}static getScale(N){const ve=N.getBoundingClientRect();return{x:ve.width/N.offsetWidth||1,y:ve.height/N.offsetHeight||1,boundingClientRect:ve}}static getPoint(N,ve,Oe){const Ue=ve.boundingClientRect;return new r.P((Oe.clientX-Ue.left)/ve.x-N.clientLeft,(Oe.clientY-Ue.top)/ve.y-N.clientTop)}static mousePos(N,ve){const Oe=o.getScale(N);return o.getPoint(N,Oe,ve)}static touchPos(N,ve){const Oe=[],Ue=o.getScale(N);for(let Ke=0;Ke{p&&C(p),p=null,g=!0},d.onerror=()=>{y=!0,p=null},d.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(Qe){let N,ve,Oe,Ue;Qe.resetRequestQueue=()=>{N=[],ve=0,Oe=0,Ue={}},Qe.addThrottleControl=ir=>{const Tr=Oe++;return Ue[Tr]=ir,Tr},Qe.removeThrottleControl=ir=>{delete Ue[ir],It()},Qe.getImage=(ir,Tr,Or=!0)=>new Promise((Vr,vn)=>{c.supported&&(ir.headers||(ir.headers={}),ir.headers.accept="image/webp,*/*"),r.e(ir,{type:"image"}),N.push({abortController:Tr,requestParameters:ir,supportImageRefresh:Or,state:"queued",onError:Dn=>{vn(Dn)},onSuccess:Dn=>{Vr(Dn)}}),It()});const Ke=ir=>r._(this,void 0,void 0,function*(){ir.state="running";const{requestParameters:Tr,supportImageRefresh:Or,onError:Vr,onSuccess:vn,abortController:Dn}=ir,ot=Or===!1&&!r.i(self)&&!r.g(Tr.url)&&(!Tr.headers||Object.keys(Tr.headers).reduce((Rt,Yt)=>Rt&&Yt==="accept",!0));ve++;const dt=ot?$t(Tr,Dn):r.m(Tr,Dn);try{const Rt=yield dt;delete ir.abortController,ir.state="completed",Rt.data instanceof HTMLImageElement||r.b(Rt.data)?vn(Rt):Rt.data&&vn({data:yield(St=Rt.data,typeof createImageBitmap=="function"?r.d(St):r.f(St)),cacheControl:Rt.cacheControl,expires:Rt.expires})}catch(Rt){delete ir.abortController,Vr(Rt)}finally{ve--,It()}var St}),It=()=>{const ir=(()=>{for(const Tr of Object.keys(Ue))if(Ue[Tr]())return!0;return!1})()?r.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:r.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let Tr=ve;Tr0;Tr++){const Or=N.shift();Or.abortController.signal.aborted?Tr--:Ke(Or)}},$t=(ir,Tr)=>new Promise((Or,Vr)=>{const vn=new Image,Dn=ir.url,ot=ir.credentials;ot&&ot==="include"?vn.crossOrigin="use-credentials":(ot&&ot==="same-origin"||!r.s(Dn))&&(vn.crossOrigin="anonymous"),Tr.signal.addEventListener("abort",()=>{vn.src="",Vr(r.c())}),vn.fetchPriority="high",vn.onload=()=>{vn.onerror=vn.onload=null,Or({data:vn})},vn.onerror=()=>{vn.onerror=vn.onload=null,Tr.signal.aborted||Vr(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."))},vn.src=Dn})})(f||(f={})),f.resetRequestQueue();class x{constructor(N){this._transformRequestFn=N}transformRequest(N,ve){return this._transformRequestFn&&this._transformRequestFn(N,ve)||{url:N}}setTransformRequest(N){this._transformRequestFn=N}}function A(Qe){var N=new r.A(3);return N[0]=Qe[0],N[1]=Qe[1],N[2]=Qe[2],N}var k,I=function(Qe,N,ve){return Qe[0]=N[0]-ve[0],Qe[1]=N[1]-ve[1],Qe[2]=N[2]-ve[2],Qe};k=new r.A(3),r.A!=Float32Array&&(k[0]=0,k[1]=0,k[2]=0);var T=function(Qe){var N=Qe[0],ve=Qe[1];return N*N+ve*ve};function E(Qe){const N=[];if(typeof Qe=="string")N.push({id:"default",url:Qe});else if(Qe&&Qe.length>0){const ve=[];for(const{id:Oe,url:Ue}of Qe){const Ke=`${Oe}${Ue}`;ve.indexOf(Ke)===-1&&(ve.push(Ke),N.push({id:Oe,url:Ue}))}}return N}function _(Qe,N,ve){const Oe=Qe.split("?");return Oe[0]+=`${N}${ve}`,Oe.join("?")}(function(){var Qe=new r.A(2);r.A!=Float32Array&&(Qe[0]=0,Qe[1]=0)})();class h{constructor(N,ve,Oe,Ue){this.context=N,this.format=Oe,this.texture=N.gl.createTexture(),this.update(ve,Ue)}update(N,ve,Oe){const{width:Ue,height:Ke}=N,It=!(this.size&&this.size[0]===Ue&&this.size[1]===Ke||Oe),{context:$t}=this,{gl:ir}=$t;if(this.useMipmap=!!(ve&&ve.useMipmap),ir.bindTexture(ir.TEXTURE_2D,this.texture),$t.pixelStoreUnpackFlipY.set(!1),$t.pixelStoreUnpack.set(1),$t.pixelStoreUnpackPremultiplyAlpha.set(this.format===ir.RGBA&&(!ve||ve.premultiply!==!1)),It)this.size=[Ue,Ke],N instanceof HTMLImageElement||N instanceof HTMLCanvasElement||N instanceof HTMLVideoElement||N instanceof ImageData||r.b(N)?ir.texImage2D(ir.TEXTURE_2D,0,this.format,this.format,ir.UNSIGNED_BYTE,N):ir.texImage2D(ir.TEXTURE_2D,0,this.format,Ue,Ke,0,this.format,ir.UNSIGNED_BYTE,N.data);else{const{x:Tr,y:Or}=Oe||{x:0,y:0};N instanceof HTMLImageElement||N instanceof HTMLCanvasElement||N instanceof HTMLVideoElement||N instanceof ImageData||r.b(N)?ir.texSubImage2D(ir.TEXTURE_2D,0,Tr,Or,ir.RGBA,ir.UNSIGNED_BYTE,N):ir.texSubImage2D(ir.TEXTURE_2D,0,Tr,Or,Ue,Ke,ir.RGBA,ir.UNSIGNED_BYTE,N.data)}this.useMipmap&&this.isSizePowerOfTwo()&&ir.generateMipmap(ir.TEXTURE_2D)}bind(N,ve,Oe){const{context:Ue}=this,{gl:Ke}=Ue;Ke.bindTexture(Ke.TEXTURE_2D,this.texture),Oe!==Ke.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Oe=Ke.LINEAR),N!==this.filter&&(Ke.texParameteri(Ke.TEXTURE_2D,Ke.TEXTURE_MAG_FILTER,N),Ke.texParameteri(Ke.TEXTURE_2D,Ke.TEXTURE_MIN_FILTER,Oe||N),this.filter=N),ve!==this.wrap&&(Ke.texParameteri(Ke.TEXTURE_2D,Ke.TEXTURE_WRAP_S,ve),Ke.texParameteri(Ke.TEXTURE_2D,Ke.TEXTURE_WRAP_T,ve),this.wrap=ve)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:N}=this.context;N.deleteTexture(this.texture),this.texture=null}}function m(Qe){const{userImage:N}=Qe;return!!(N&&N.render&&N.render())&&(Qe.data.replace(new Uint8Array(N.data.buffer)),!0)}class w extends r.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new r.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(N){if(this.loaded!==N&&(this.loaded=N,N)){for(const{ids:ve,promiseResolve:Oe}of this.requestors)Oe(this._getImagesForIds(ve));this.requestors=[]}}getImage(N){const ve=this.images[N];if(ve&&!ve.data&&ve.spriteData){const Oe=ve.spriteData;ve.data=new r.R({width:Oe.width,height:Oe.height},Oe.context.getImageData(Oe.x,Oe.y,Oe.width,Oe.height).data),ve.spriteData=null}return ve}addImage(N,ve){if(this.images[N])throw new Error(`Image id ${N} already exist, use updateImage instead`);this._validate(N,ve)&&(this.images[N]=ve)}_validate(N,ve){let Oe=!0;const Ue=ve.data||ve.spriteData;return this._validateStretch(ve.stretchX,Ue&&Ue.width)||(this.fire(new r.j(new Error(`Image "${N}" has invalid "stretchX" value`))),Oe=!1),this._validateStretch(ve.stretchY,Ue&&Ue.height)||(this.fire(new r.j(new Error(`Image "${N}" has invalid "stretchY" value`))),Oe=!1),this._validateContent(ve.content,ve)||(this.fire(new r.j(new Error(`Image "${N}" has invalid "content" value`))),Oe=!1),Oe}_validateStretch(N,ve){if(!N)return!0;let Oe=0;for(const Ue of N){if(Ue[0]{let Ue=!0;if(!this.isLoaded())for(const Ke of N)this.images[Ke]||(Ue=!1);this.isLoaded()||Ue?ve(this._getImagesForIds(N)):this.requestors.push({ids:N,promiseResolve:ve})})}_getImagesForIds(N){const ve={};for(const Oe of N){let Ue=this.getImage(Oe);Ue||(this.fire(new r.k("styleimagemissing",{id:Oe})),Ue=this.getImage(Oe)),Ue?ve[Oe]={data:Ue.data.clone(),pixelRatio:Ue.pixelRatio,sdf:Ue.sdf,version:Ue.version,stretchX:Ue.stretchX,stretchY:Ue.stretchY,content:Ue.content,textFitWidth:Ue.textFitWidth,textFitHeight:Ue.textFitHeight,hasRenderCallback:!!(Ue.userImage&&Ue.userImage.render)}:r.w(`Image "${Oe}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return ve}getPixelSize(){const{width:N,height:ve}=this.atlasImage;return{width:N,height:ve}}getPattern(N){const ve=this.patterns[N],Oe=this.getImage(N);if(!Oe)return null;if(ve&&ve.position.version===Oe.version)return ve.position;if(ve)ve.position.version=Oe.version;else{const Ue={w:Oe.data.width+2,h:Oe.data.height+2,x:0,y:0},Ke=new r.I(Ue,Oe);this.patterns[N]={bin:Ue,position:Ke}}return this._updatePatternAtlas(),this.patterns[N].position}bind(N){const ve=N.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new h(N,this.atlasImage,ve.RGBA),this.atlasTexture.bind(ve.LINEAR,ve.CLAMP_TO_EDGE)}_updatePatternAtlas(){const N=[];for(const Ke in this.patterns)N.push(this.patterns[Ke].bin);const{w:ve,h:Oe}=r.p(N),Ue=this.atlasImage;Ue.resize({width:ve||1,height:Oe||1});for(const Ke in this.patterns){const{bin:It}=this.patterns[Ke],$t=It.x+1,ir=It.y+1,Tr=this.getImage(Ke).data,Or=Tr.width,Vr=Tr.height;r.R.copy(Tr,Ue,{x:0,y:0},{x:$t,y:ir},{width:Or,height:Vr}),r.R.copy(Tr,Ue,{x:0,y:Vr-1},{x:$t,y:ir-1},{width:Or,height:1}),r.R.copy(Tr,Ue,{x:0,y:0},{x:$t,y:ir+Vr},{width:Or,height:1}),r.R.copy(Tr,Ue,{x:Or-1,y:0},{x:$t-1,y:ir},{width:1,height:Vr}),r.R.copy(Tr,Ue,{x:0,y:0},{x:$t+Or,y:ir},{width:1,height:Vr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(N){for(const ve of N){if(this.callbackDispatchedThisFrame[ve])continue;this.callbackDispatchedThisFrame[ve]=!0;const Oe=this.getImage(ve);Oe||r.w(`Image with ID: "${ve}" was not found`),m(Oe)&&this.updateImage(ve,Oe)}}}const F=1e20;function z(Qe,N,ve,Oe,Ue,Ke,It,$t,ir){for(let Tr=N;Tr-1);ir++,Ke[ir]=$t,It[ir]=Tr,It[ir+1]=F}for(let $t=0,ir=0;$t65535)throw new Error("glyphs > 65535 not supported");if(Oe.ranges[Ke])return{stack:N,id:ve,glyph:Ue};if(!this.url)throw new Error("glyphsUrl is not set");if(!Oe.requests[Ke]){const $t=V.loadGlyphRange(N,Ke,this.url,this.requestManager);Oe.requests[Ke]=$t}const It=yield Oe.requests[Ke];for(const $t in It)this._doesCharSupportLocalGlyph(+$t)||(Oe.glyphs[+$t]=It[+$t]);return Oe.ranges[Ke]=!0,{stack:N,id:ve,glyph:It[ve]||null}})}_doesCharSupportLocalGlyph(N){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(N))}_tinySDF(N,ve,Oe){const Ue=this.localIdeographFontFamily;if(!Ue||!this._doesCharSupportLocalGlyph(Oe))return;let Ke=N.tinySDF;if(!Ke){let $t="400";/bold/i.test(ve)?$t="900":/medium/i.test(ve)?$t="500":/light/i.test(ve)&&($t="200"),Ke=N.tinySDF=new V.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Ue,fontWeight:$t})}const It=Ke.draw(String.fromCharCode(Oe));return{id:Oe,bitmap:new r.o({width:It.width||60,height:It.height||60},It.data),metrics:{width:It.glyphWidth/2||24,height:It.glyphHeight/2||24,left:It.glyphLeft/2+.5||0,top:It.glyphTop/2-27.5||-8,advance:It.glyphAdvance/2||24,isDoubleResolution:!0}}}}V.loadGlyphRange=function(Qe,N,ve,Oe){return r._(this,void 0,void 0,function*(){const Ue=256*N,Ke=Ue+255,It=Oe.transformRequest(ve.replace("{fontstack}",Qe).replace("{range}",`${Ue}-${Ke}`),"Glyphs"),$t=yield r.l(It,new AbortController);if(!$t||!$t.data)throw new Error(`Could not load glyph range. range: ${N}, ${Ue}-${Ke}`);const ir={};for(const Tr of r.n($t.data))ir[Tr.id]=Tr;return ir})},V.TinySDF=class{constructor({fontSize:Qe=24,buffer:N=3,radius:ve=8,cutoff:Oe=.25,fontFamily:Ue="sans-serif",fontWeight:Ke="normal",fontStyle:It="normal"}={}){this.buffer=N,this.cutoff=Oe,this.radius=ve;const $t=this.size=Qe+4*N,ir=this._createCanvas($t),Tr=this.ctx=ir.getContext("2d",{willReadFrequently:!0});Tr.font=`${It} ${Ke} ${Qe}px ${Ue}`,Tr.textBaseline="alphabetic",Tr.textAlign="left",Tr.fillStyle="black",this.gridOuter=new Float64Array($t*$t),this.gridInner=new Float64Array($t*$t),this.f=new Float64Array($t),this.z=new Float64Array($t+1),this.v=new Uint16Array($t)}_createCanvas(Qe){const N=document.createElement("canvas");return N.width=N.height=Qe,N}draw(Qe){const{width:N,actualBoundingBoxAscent:ve,actualBoundingBoxDescent:Oe,actualBoundingBoxLeft:Ue,actualBoundingBoxRight:Ke}=this.ctx.measureText(Qe),It=Math.ceil(ve),$t=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Ke-Ue))),ir=Math.min(this.size-this.buffer,It+Math.ceil(Oe)),Tr=$t+2*this.buffer,Or=ir+2*this.buffer,Vr=Math.max(Tr*Or,0),vn=new Uint8ClampedArray(Vr),Dn={data:vn,width:Tr,height:Or,glyphWidth:$t,glyphHeight:ir,glyphTop:It,glyphLeft:0,glyphAdvance:N};if($t===0||ir===0)return Dn;const{ctx:ot,buffer:dt,gridInner:St,gridOuter:Rt}=this;ot.clearRect(dt,dt,$t,ir),ot.fillText(Qe,dt,dt+It);const Yt=ot.getImageData(dt,dt,$t,ir);Rt.fill(F,0,Vr),St.fill(0,0,Vr);for(let Ut=0;Ut0?jr*jr:0,St[Nr]=jr<0?jr*jr:0}}z(Rt,0,0,Tr,Or,Tr,this.f,this.v,this.z),z(St,dt,dt,$t,ir,Tr,this.f,this.v,this.z);for(let Ut=0;Ut1&&(ir=N[++$t]);const Or=Math.abs(Tr-ir.left),Vr=Math.abs(Tr-ir.right),vn=Math.min(Or,Vr);let Dn;const ot=Ke/Oe*(Ue+1);if(ir.isDash){const dt=Ue-Math.abs(ot);Dn=Math.sqrt(vn*vn+dt*dt)}else Dn=Ue-Math.sqrt(vn*vn+ot*ot);this.data[It+Tr]=Math.max(0,Math.min(255,Dn+128))}}}addRegularDash(N){for(let $t=N.length-1;$t>=0;--$t){const ir=N[$t],Tr=N[$t+1];ir.zeroLength?N.splice($t,1):Tr&&Tr.isDash===ir.isDash&&(Tr.left=ir.left,N.splice($t,1))}const ve=N[0],Oe=N[N.length-1];ve.isDash===Oe.isDash&&(ve.left=Oe.left-this.width,Oe.right=ve.right+this.width);const Ue=this.width*this.nextRow;let Ke=0,It=N[Ke];for(let $t=0;$t1&&(It=N[++Ke]);const ir=Math.abs($t-It.left),Tr=Math.abs($t-It.right),Or=Math.min(ir,Tr);this.data[Ue+$t]=Math.max(0,Math.min(255,(It.isDash?Or:-Or)+128))}}addDash(N,ve){const Oe=ve?7:0,Ue=2*Oe+1;if(this.nextRow+Ue>this.height)return r.w("LineAtlas out of space"),null;let Ke=0;for(let $t=0;$t{ve.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ue]}numActive(){return Object.keys(this.active).length}}const ge=Math.floor(s.hardwareConcurrency/2);let _e,Y;function se(){return _e||(_e=new xe),_e}xe.workerCount=r.C(globalThis)?Math.max(Math.min(ge,3),1):1;class ce{constructor(N,ve){this.workerPool=N,this.actors=[],this.currentActor=0,this.id=ve;const Oe=this.workerPool.acquire(ve);for(let Ue=0;Ue{ve.remove()}),this.actors=[],N&&this.workerPool.release(this.id)}registerMessageHandler(N,ve){for(const Oe of this.actors)Oe.registerMessageHandler(N,ve)}}function ne(){return Y||(Y=new ce(se(),r.G),Y.registerMessageHandler("GR",(Qe,N,ve)=>r.m(N,ve))),Y}function ye(Qe,N){const ve=r.H();return r.J(ve,ve,[1,1,0]),r.K(ve,ve,[.5*Qe.width,.5*Qe.height,1]),r.L(ve,ve,Qe.calculatePosMatrix(N.toUnwrapped()))}function le(Qe,N,ve,Oe,Ue,Ke){const It=(function(Vr,vn,Dn){if(Vr)for(const ot of Vr){const dt=vn[ot];if(dt&&dt.source===Dn&&dt.type==="fill-extrusion")return!0}else for(const ot in vn){const dt=vn[ot];if(dt.source===Dn&&dt.type==="fill-extrusion")return!0}return!1})(Ue&&Ue.layers,N,Qe.id),$t=Ke.maxPitchScaleFactor(),ir=Qe.tilesIn(Oe,$t,It);ir.sort(Z);const Tr=[];for(const Vr of ir)Tr.push({wrappedTileID:Vr.tileID.wrapped().key,queryResults:Vr.tile.queryRenderedFeatures(N,ve,Qe._state,Vr.queryGeometry,Vr.cameraQueryGeometry,Vr.scale,Ue,Ke,$t,ye(Qe.transform,Vr.tileID))});const Or=(function(Vr){const vn={},Dn={};for(const ot of Vr){const dt=ot.queryResults,St=ot.wrappedTileID,Rt=Dn[St]=Dn[St]||{};for(const Yt in dt){const Ut=dt[Yt],er=Rt[Yt]=Rt[Yt]||{},Mr=vn[Yt]=vn[Yt]||[];for(const Nr of Ut)er[Nr.featureIndex]||(er[Nr.featureIndex]=!0,Mr.push(Nr))}}return vn})(Tr);for(const Vr in Or)Or[Vr].forEach(vn=>{const Dn=vn.feature,ot=Qe.getFeatureState(Dn.layer["source-layer"],Dn.id);Dn.source=Dn.layer.source,Dn.layer["source-layer"]&&(Dn.sourceLayer=Dn.layer["source-layer"]),Dn.state=ot});return Or}function Z(Qe,N){const ve=Qe.tileID,Oe=N.tileID;return ve.overscaledZ-Oe.overscaledZ||ve.canonical.y-Oe.canonical.y||ve.wrap-Oe.wrap||ve.canonical.x-Oe.canonical.x}function de(Qe,N,ve){return r._(this,void 0,void 0,function*(){let Oe=Qe;if(Qe.url?Oe=(yield r.h(N.transformRequest(Qe.url,"Source"),ve)).data:yield s.frameAsync(ve),!Oe)return null;const Ue=r.M(r.e(Oe,Qe),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Oe&&Oe.vector_layers&&(Ue.vectorLayerIds=Oe.vector_layers.map(Ke=>Ke.id)),Ue})}class pe{constructor(N,ve){N&&(ve?this.setSouthWest(N).setNorthEast(ve):Array.isArray(N)&&(N.length===4?this.setSouthWest([N[0],N[1]]).setNorthEast([N[2],N[3]]):this.setSouthWest(N[0]).setNorthEast(N[1])))}setNorthEast(N){return this._ne=N instanceof r.N?new r.N(N.lng,N.lat):r.N.convert(N),this}setSouthWest(N){return this._sw=N instanceof r.N?new r.N(N.lng,N.lat):r.N.convert(N),this}extend(N){const ve=this._sw,Oe=this._ne;let Ue,Ke;if(N instanceof r.N)Ue=N,Ke=N;else{if(!(N instanceof pe))return Array.isArray(N)?N.length===4||N.every(Array.isArray)?this.extend(pe.convert(N)):this.extend(r.N.convert(N)):N&&("lng"in N||"lon"in N)&&"lat"in N?this.extend(r.N.convert(N)):this;if(Ue=N._sw,Ke=N._ne,!Ue||!Ke)return this}return ve||Oe?(ve.lng=Math.min(Ue.lng,ve.lng),ve.lat=Math.min(Ue.lat,ve.lat),Oe.lng=Math.max(Ke.lng,Oe.lng),Oe.lat=Math.max(Ke.lat,Oe.lat)):(this._sw=new r.N(Ue.lng,Ue.lat),this._ne=new r.N(Ke.lng,Ke.lat)),this}getCenter(){return new r.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new r.N(this.getWest(),this.getNorth())}getSouthEast(){return new r.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(N){const{lng:ve,lat:Oe}=r.N.convert(N);let Ue=this._sw.lng<=ve&&ve<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ue=this._sw.lng>=ve&&ve>=this._ne.lng),this._sw.lat<=Oe&&Oe<=this._ne.lat&&Ue}static convert(N){return N instanceof pe?N:N&&new pe(N)}static fromLngLat(N,ve=0){const Oe=360*ve/40075017,Ue=Oe/Math.cos(Math.PI/180*N.lat);return new pe(new r.N(N.lng-Ue,N.lat-Oe),new r.N(N.lng+Ue,N.lat+Oe))}adjustAntiMeridian(){const N=new r.N(this._sw.lng,this._sw.lat),ve=new r.N(this._ne.lng,this._ne.lat);return new pe(N,N.lng>ve.lng?new r.N(ve.lng+360,ve.lat):ve)}}class Te{constructor(N,ve,Oe){this.bounds=pe.convert(this.validateBounds(N)),this.minzoom=ve||0,this.maxzoom=Oe||24}validateBounds(N){return Array.isArray(N)&&N.length===4?[Math.max(-180,N[0]),Math.max(-90,N[1]),Math.min(180,N[2]),Math.min(90,N[3])]:[-180,-90,180,90]}contains(N){const ve=Math.pow(2,N.z),Oe=Math.floor(r.O(this.bounds.getWest())*ve),Ue=Math.floor(r.Q(this.bounds.getNorth())*ve),Ke=Math.ceil(r.O(this.bounds.getEast())*ve),It=Math.ceil(r.Q(this.bounds.getSouth())*ve);return N.x>=Oe&&N.x=Ue&&N.y{this._options.tiles=N}),this}setUrl(N){return this.setSourceProperty(()=>{this.url=N,this._options.url=N}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return r.e({},this._options)}loadTile(N){return r._(this,void 0,void 0,function*(){const ve=N.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Oe={request:this.map._requestManager.transformRequest(ve,"Tile"),uid:N.uid,tileID:N.tileID,zoom:N.tileID.overscaledZ,tileSize:this.tileSize*N.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Oe.request.collectResourceTiming=this._collectResourceTiming;let Ue="RT";if(N.actor&&N.state!=="expired"){if(N.state==="loading")return new Promise((Ke,It)=>{N.reloadPromise={resolve:Ke,reject:It}})}else N.actor=this.dispatcher.getActor(),Ue="LT";N.abortController=new AbortController;try{const Ke=yield N.actor.sendAsync({type:Ue,data:Oe},N.abortController);if(delete N.abortController,N.aborted)return;this._afterTileLoadWorkerResponse(N,Ke)}catch(Ke){if(delete N.abortController,N.aborted)return;if(Ke&&Ke.status!==404)throw Ke;this._afterTileLoadWorkerResponse(N,null)}})}_afterTileLoadWorkerResponse(N,ve){if(ve&&ve.resourceTiming&&(N.resourceTiming=ve.resourceTiming),ve&&this.map._refreshExpiredTiles&&N.setExpiryData(ve),N.loadVectorData(ve,this.map.painter),N.reloadPromise){const Oe=N.reloadPromise;N.reloadPromise=null,this.loadTile(N).then(Oe.resolve).catch(Oe.reject)}}abortTile(N){return r._(this,void 0,void 0,function*(){N.abortController&&(N.abortController.abort(),delete N.abortController),N.actor&&(yield N.actor.sendAsync({type:"AT",data:{uid:N.uid,type:this.type,source:this.id}}))})}unloadTile(N){return r._(this,void 0,void 0,function*(){N.unloadVectorData(),N.actor&&(yield N.actor.sendAsync({type:"RMT",data:{uid:N.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class $e extends r.E{constructor(N,ve,Oe,Ue){super(),this.id=N,this.dispatcher=Oe,this.setEventedParent(Ue),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=r.e({type:"raster"},ve),r.e(this,r.M(ve,["url","scheme","tileSize"]))}load(){return r._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new r.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const N=yield de(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,N&&(r.e(this,N),N.bounds&&(this.tileBounds=new Te(N.bounds,this.minzoom,this.maxzoom)),this.fire(new r.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new r.k("data",{dataType:"source",sourceDataType:"content"})))}catch(N){this._tileJSONRequest=null,this.fire(new r.j(N))}})}loaded(){return this._loaded}onAdd(N){this.map=N,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(N){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),N(),this.load()}setTiles(N){return this.setSourceProperty(()=>{this._options.tiles=N}),this}setUrl(N){return this.setSourceProperty(()=>{this.url=N,this._options.url=N}),this}serialize(){return r.e({},this._options)}hasTile(N){return!this.tileBounds||this.tileBounds.contains(N.canonical)}loadTile(N){return r._(this,void 0,void 0,function*(){const ve=N.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);N.abortController=new AbortController;try{const Oe=yield f.getImage(this.map._requestManager.transformRequest(ve,"Tile"),N.abortController,this.map._refreshExpiredTiles);if(delete N.abortController,N.aborted)return void(N.state="unloaded");if(Oe&&Oe.data){this.map._refreshExpiredTiles&&Oe.cacheControl&&Oe.expires&&N.setExpiryData({cacheControl:Oe.cacheControl,expires:Oe.expires});const Ue=this.map.painter.context,Ke=Ue.gl,It=Oe.data;N.texture=this.map.painter.getTileTexture(It.width),N.texture?N.texture.update(It,{useMipmap:!0}):(N.texture=new h(Ue,It,Ke.RGBA,{useMipmap:!0}),N.texture.bind(Ke.LINEAR,Ke.CLAMP_TO_EDGE,Ke.LINEAR_MIPMAP_NEAREST)),N.state="loaded"}}catch(Oe){if(delete N.abortController,N.aborted)N.state="unloaded";else if(Oe)throw N.state="errored",Oe}})}abortTile(N){return r._(this,void 0,void 0,function*(){N.abortController&&(N.abortController.abort(),delete N.abortController)})}unloadTile(N){return r._(this,void 0,void 0,function*(){N.texture&&this.map.painter.saveTileTexture(N.texture)})}hasTransition(){return!1}}class Ze extends $e{constructor(N,ve,Oe,Ue){super(N,ve,Oe,Ue),this.type="raster-dem",this.maxzoom=22,this._options=r.e({type:"raster-dem"},ve),this.encoding=ve.encoding||"mapbox",this.redFactor=ve.redFactor,this.greenFactor=ve.greenFactor,this.blueFactor=ve.blueFactor,this.baseShift=ve.baseShift}loadTile(N){return r._(this,void 0,void 0,function*(){const ve=N.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Oe=this.map._requestManager.transformRequest(ve,"Tile");N.neighboringTiles=this._getNeighboringTiles(N.tileID),N.abortController=new AbortController;try{const Ue=yield f.getImage(Oe,N.abortController,this.map._refreshExpiredTiles);if(delete N.abortController,N.aborted)return void(N.state="unloaded");if(Ue&&Ue.data){const Ke=Ue.data;this.map._refreshExpiredTiles&&Ue.cacheControl&&Ue.expires&&N.setExpiryData({cacheControl:Ue.cacheControl,expires:Ue.expires});const It=r.b(Ke)&&r.U()?Ke:yield this.readImageNow(Ke),$t={type:this.type,uid:N.uid,source:this.id,rawImageData:It,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!N.actor||N.state==="expired"){N.actor=this.dispatcher.getActor();const ir=yield N.actor.sendAsync({type:"LDT",data:$t});N.dem=ir,N.needsHillshadePrepare=!0,N.needsTerrainPrepare=!0,N.state="loaded"}}}catch(Ue){if(delete N.abortController,N.aborted)N.state="unloaded";else if(Ue)throw N.state="errored",Ue}})}readImageNow(N){return r._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&r.V()){const ve=N.width+2,Oe=N.height+2;try{return new r.R({width:ve,height:Oe},yield r.W(N,-1,-1,ve,Oe))}catch{}}return s.getImageData(N,1)})}_getNeighboringTiles(N){const ve=N.canonical,Oe=Math.pow(2,ve.z),Ue=(ve.x-1+Oe)%Oe,Ke=ve.x===0?N.wrap-1:N.wrap,It=(ve.x+1+Oe)%Oe,$t=ve.x+1===Oe?N.wrap+1:N.wrap,ir={};return ir[new r.S(N.overscaledZ,Ke,ve.z,Ue,ve.y).key]={backfilled:!1},ir[new r.S(N.overscaledZ,$t,ve.z,It,ve.y).key]={backfilled:!1},ve.y>0&&(ir[new r.S(N.overscaledZ,Ke,ve.z,Ue,ve.y-1).key]={backfilled:!1},ir[new r.S(N.overscaledZ,N.wrap,ve.z,ve.x,ve.y-1).key]={backfilled:!1},ir[new r.S(N.overscaledZ,$t,ve.z,It,ve.y-1).key]={backfilled:!1}),ve.y+10&&r.e(Ke,{resourceTiming:Ue}),this.fire(new r.k("data",Object.assign(Object.assign({},Ke),{sourceDataType:"metadata"}))),this.fire(new r.k("data",Object.assign(Object.assign({},Ke),{sourceDataType:"content"})))}catch(Oe){if(this._pendingLoads--,this._removed)return void this.fire(new r.k("dataabort",{dataType:"source"}));this.fire(new r.j(Oe))}})}loaded(){return this._pendingLoads===0}loadTile(N){return r._(this,void 0,void 0,function*(){const ve=N.actor?"RT":"LT";N.actor=this.actor;const Oe={type:this.type,uid:N.uid,tileID:N.tileID,zoom:N.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};N.abortController=new AbortController;const Ue=yield this.actor.sendAsync({type:ve,data:Oe},N.abortController);delete N.abortController,N.unloadVectorData(),N.aborted||N.loadVectorData(Ue,this.map.painter,ve==="RT")})}abortTile(N){return r._(this,void 0,void 0,function*(){N.abortController&&(N.abortController.abort(),delete N.abortController),N.aborted=!0})}unloadTile(N){return r._(this,void 0,void 0,function*(){N.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:N.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return r.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var it=r.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class yt extends r.E{constructor(N,ve,Oe,Ue){super(),this.id=N,this.dispatcher=Oe,this.coordinates=ve.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ue),this.options=ve}load(N){return r._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new r.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const ve=yield f.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,ve&&ve.data&&(this.image=ve.data,N&&(this.coordinates=N),this._finishLoading())}catch(ve){this._request=null,this._loaded=!0,this.fire(new r.j(ve))}})}loaded(){return this._loaded}updateImage(N){return N.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=N.url,this.load(N.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new r.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(N){this.map=N,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(N){this.coordinates=N;const ve=N.map(r.Z.fromLngLat);this.tileID=(function(Ue){let Ke=1/0,It=1/0,$t=-1/0,ir=-1/0;for(const vn of Ue)Ke=Math.min(Ke,vn.x),It=Math.min(It,vn.y),$t=Math.max($t,vn.x),ir=Math.max(ir,vn.y);const Tr=Math.max($t-Ke,ir-It),Or=Math.max(0,Math.floor(-Math.log(Tr)/Math.LN2)),Vr=Math.pow(2,Or);return new r.a1(Or,Math.floor((Ke+$t)/2*Vr),Math.floor((It+ir)/2*Vr))})(ve),this.minzoom=this.maxzoom=this.tileID.z;const Oe=ve.map(Ue=>this.tileID.getTilePoint(Ue)._round());return this._boundsArray=new r.$,this._boundsArray.emplaceBack(Oe[0].x,Oe[0].y,0,0),this._boundsArray.emplaceBack(Oe[1].x,Oe[1].y,r.X,0),this._boundsArray.emplaceBack(Oe[3].x,Oe[3].y,0,r.X),this._boundsArray.emplaceBack(Oe[2].x,Oe[2].y,r.X,r.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new r.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const N=this.map.painter.context,ve=N.gl;this.boundsBuffer||(this.boundsBuffer=N.createVertexBuffer(this._boundsArray,it.members)),this.boundsSegments||(this.boundsSegments=r.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new h(N,this.image,ve.RGBA),this.texture.bind(ve.LINEAR,ve.CLAMP_TO_EDGE));let Oe=!1;for(const Ue in this.tiles){const Ke=this.tiles[Ue];Ke.state!=="loaded"&&(Ke.state="loaded",Ke.texture=this.texture,Oe=!0)}Oe&&this.fire(new r.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(N){return r._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(N.tileID.canonical)?(this.tiles[String(N.tileID.wrap)]=N,N.buckets={}):N.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class bt extends yt{constructor(N,ve,Oe,Ue){super(N,ve,Oe,Ue),this.roundZoom=!0,this.type="video",this.options=ve}load(){return r._(this,void 0,void 0,function*(){this._loaded=!1;const N=this.options;this.urls=[];for(const ve of N.urls)this.urls.push(this.map._requestManager.transformRequest(ve,"Source").url);try{const ve=yield r.a3(this.urls);if(this._loaded=!0,!ve)return;this.video=ve,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(ve){this.fire(new r.j(ve))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(N){if(this.video){const ve=this.video.seekable;Nve.end(0)?this.fire(new r.j(new r.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${ve.start(0)} and ${ve.end(0)}-second mark.`))):this.video.currentTime=N}}getVideo(){return this.video}onAdd(N){this.map||(this.map=N,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const N=this.map.painter.context,ve=N.gl;this.boundsBuffer||(this.boundsBuffer=N.createVertexBuffer(this._boundsArray,it.members)),this.boundsSegments||(this.boundsSegments=r.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ve.LINEAR,ve.CLAMP_TO_EDGE),ve.texSubImage2D(ve.TEXTURE_2D,0,0,0,ve.RGBA,ve.UNSIGNED_BYTE,this.video)):(this.texture=new h(N,this.video,ve.RGBA),this.texture.bind(ve.LINEAR,ve.CLAMP_TO_EDGE));let Oe=!1;for(const Ue in this.tiles){const Ke=this.tiles[Ue];Ke.state!=="loaded"&&(Ke.state="loaded",Ke.texture=this.texture,Oe=!0)}Oe&&this.fire(new r.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class mt extends yt{constructor(N,ve,Oe,Ue){super(N,ve,Oe,Ue),ve.coordinates?Array.isArray(ve.coordinates)&&ve.coordinates.length===4&&!ve.coordinates.some(Ke=>!Array.isArray(Ke)||Ke.length!==2||Ke.some(It=>typeof It!="number"))||this.fire(new r.j(new r.a2(`sources.${N}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new r.j(new r.a2(`sources.${N}`,null,'missing required property "coordinates"'))),ve.animate&&typeof ve.animate!="boolean"&&this.fire(new r.j(new r.a2(`sources.${N}`,null,'optional "animate" property must be a boolean value'))),ve.canvas?typeof ve.canvas=="string"||ve.canvas instanceof HTMLCanvasElement||this.fire(new r.j(new r.a2(`sources.${N}`,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 r.j(new r.a2(`sources.${N}`,null,'missing required property "canvas"'))),this.options=ve,this.animate=ve.animate===void 0||ve.animate}load(){return r._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new r.j(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())})}getCanvas(){return this.canvas}onAdd(N){this.map=N,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let N=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,N=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,N=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const ve=this.map.painter.context,Oe=ve.gl;this.boundsBuffer||(this.boundsBuffer=ve.createVertexBuffer(this._boundsArray,it.members)),this.boundsSegments||(this.boundsSegments=r.a0.simpleSegment(0,0,4,2)),this.texture?(N||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new h(ve,this.canvas,Oe.RGBA,{premultiply:!0});let Ue=!1;for(const Ke in this.tiles){const It=this.tiles[Ke];It.state!=="loaded"&&(It.state="loaded",It.texture=this.texture,Ue=!0)}Ue&&this.fire(new r.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const N of[this.canvas.width,this.canvas.height])if(isNaN(N)||N<=0)return!0;return!1}}const ht={},Ve=Qe=>{switch(Qe){case"geojson":return Xe;case"image":return yt;case"raster":return $e;case"raster-dem":return Ze;case"vector":return Ne;case"video":return bt;case"canvas":return mt}return ht[Qe]},ze="RTLPluginLoaded";class Se extends r.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=ne()}_syncState(N){return this.status=N,this.dispatcher.broadcast("SRPS",{pluginStatus:N,pluginURL:this.url}).catch(ve=>{throw this.status="error",ve})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(N){return r._(this,arguments,void 0,function*(ve,Oe=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=s.resolveURL(ve),!this.url)throw new Error(`requested url ${ve} is invalid`);if(this.status==="unavailable"){if(!Oe)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return r._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new r.k(ze))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Je=null;function _t(){return Je||(Je=new Se),Je}class At{constructor(N,ve){this.timeAdded=0,this.fadeEndTime=0,this.tileID=N,this.uid=r.a4(),this.uses=0,this.tileSize=ve,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(N){const ve=N+this.timeAdded;veKe.getLayer(Tr)).filter(Boolean);if(ir.length!==0){$t.layers=ir,$t.stateDependentLayerIds&&($t.stateDependentLayers=$t.stateDependentLayerIds.map(Tr=>ir.filter(Or=>Or.id===Tr)[0]));for(const Tr of ir)It[Tr.id]=$t}}return It})(N.buckets,ve.style),this.hasSymbolBuckets=!1;for(const Ue in this.buckets){const Ke=this.buckets[Ue];if(Ke instanceof r.a6){if(this.hasSymbolBuckets=!0,!Oe)break;Ke.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const Ue in this.buckets){const Ke=this.buckets[Ue];if(Ke instanceof r.a6&&Ke.hasRTLText){this.hasRTLText=!0,_t().lazyLoad();break}}this.queryPadding=0;for(const Ue in this.buckets){const Ke=this.buckets[Ue];this.queryPadding=Math.max(this.queryPadding,ve.style.getLayer(Ue).queryRadius(Ke))}N.imageAtlas&&(this.imageAtlas=N.imageAtlas),N.glyphAtlasImage&&(this.glyphAtlasImage=N.glyphAtlasImage)}else this.collisionBoxArray=new r.a5}unloadVectorData(){for(const N in this.buckets)this.buckets[N].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(N){return this.buckets[N.id]}upload(N){for(const Oe in this.buckets){const Ue=this.buckets[Oe];Ue.uploadPending()&&Ue.upload(N)}const ve=N.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new h(N,this.imageAtlas.image,ve.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new h(N,this.glyphAtlasImage,ve.ALPHA),this.glyphAtlasImage=null)}prepare(N){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(N,this.imageAtlasTexture)}queryRenderedFeatures(N,ve,Oe,Ue,Ke,It,$t,ir,Tr,Or){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Ue,cameraQueryGeometry:Ke,scale:It,tileSize:this.tileSize,pixelPosMatrix:Or,transform:ir,params:$t,queryPadding:this.queryPadding*Tr},N,ve,Oe):{}}querySourceFeatures(N,ve){const Oe=this.latestFeatureIndex;if(!Oe||!Oe.rawTileData)return;const Ue=Oe.loadVTLayers(),Ke=ve&&ve.sourceLayer?ve.sourceLayer:"",It=Ue._geojsonTileLayer||Ue[Ke];if(!It)return;const $t=r.a7(ve&&ve.filter),{z:ir,x:Tr,y:Or}=this.tileID.canonical,Vr={z:ir,x:Tr,y:Or};for(let vn=0;vnOe)Ue=!1;else if(ve)if(this.expirationTime{this.remove(N,Ke)},Oe)),this.data[Ue].push(Ke),this.order.push(Ue),this.order.length>this.max){const It=this._getAndRemoveByKey(this.order[0]);It&&this.onRemove(It)}return this}has(N){return N.wrapped().key in this.data}getAndRemove(N){return this.has(N)?this._getAndRemoveByKey(N.wrapped().key):null}_getAndRemoveByKey(N){const ve=this.data[N].shift();return ve.timeout&&clearTimeout(ve.timeout),this.data[N].length===0&&delete this.data[N],this.order.splice(this.order.indexOf(N),1),ve.value}getByKey(N){const ve=this.data[N];return ve?ve[0].value:null}get(N){return this.has(N)?this.data[N.wrapped().key][0].value:null}remove(N,ve){if(!this.has(N))return this;const Oe=N.wrapped().key,Ue=ve===void 0?0:this.data[Oe].indexOf(ve),Ke=this.data[Oe][Ue];return this.data[Oe].splice(Ue,1),Ke.timeout&&clearTimeout(Ke.timeout),this.data[Oe].length===0&&delete this.data[Oe],this.onRemove(Ke.value),this.order.splice(this.order.indexOf(Oe),1),this}setMaxSize(N){for(this.max=N;this.order.length>this.max;){const ve=this._getAndRemoveByKey(this.order[0]);ve&&this.onRemove(ve)}return this}filter(N){const ve=[];for(const Oe in this.data)for(const Ue of this.data[Oe])N(Ue.value)||ve.push(Ue);for(const Oe of ve)this.remove(Oe.value.tileID,Oe)}}class Kt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(N,ve,Oe){const Ue=String(ve);if(this.stateChanges[N]=this.stateChanges[N]||{},this.stateChanges[N][Ue]=this.stateChanges[N][Ue]||{},r.e(this.stateChanges[N][Ue],Oe),this.deletedStates[N]===null){this.deletedStates[N]={};for(const Ke in this.state[N])Ke!==Ue&&(this.deletedStates[N][Ke]=null)}else if(this.deletedStates[N]&&this.deletedStates[N][Ue]===null){this.deletedStates[N][Ue]={};for(const Ke in this.state[N][Ue])Oe[Ke]||(this.deletedStates[N][Ue][Ke]=null)}else for(const Ke in Oe)this.deletedStates[N]&&this.deletedStates[N][Ue]&&this.deletedStates[N][Ue][Ke]===null&&delete this.deletedStates[N][Ue][Ke]}removeFeatureState(N,ve,Oe){if(this.deletedStates[N]===null)return;const Ue=String(ve);if(this.deletedStates[N]=this.deletedStates[N]||{},Oe&&ve!==void 0)this.deletedStates[N][Ue]!==null&&(this.deletedStates[N][Ue]=this.deletedStates[N][Ue]||{},this.deletedStates[N][Ue][Oe]=null);else if(ve!==void 0)if(this.stateChanges[N]&&this.stateChanges[N][Ue])for(Oe in this.deletedStates[N][Ue]={},this.stateChanges[N][Ue])this.deletedStates[N][Ue][Oe]=null;else this.deletedStates[N][Ue]=null;else this.deletedStates[N]=null}getState(N,ve){const Oe=String(ve),Ue=r.e({},(this.state[N]||{})[Oe],(this.stateChanges[N]||{})[Oe]);if(this.deletedStates[N]===null)return{};if(this.deletedStates[N]){const Ke=this.deletedStates[N][ve];if(Ke===null)return{};for(const It in Ke)delete Ue[It]}return Ue}initializeTileState(N,ve){N.setFeatureState(this.state,ve)}coalesceChanges(N,ve){const Oe={};for(const Ue in this.stateChanges){this.state[Ue]=this.state[Ue]||{};const Ke={};for(const It in this.stateChanges[Ue])this.state[Ue][It]||(this.state[Ue][It]={}),r.e(this.state[Ue][It],this.stateChanges[Ue][It]),Ke[It]=this.state[Ue][It];Oe[Ue]=Ke}for(const Ue in this.deletedStates){this.state[Ue]=this.state[Ue]||{};const Ke={};if(this.deletedStates[Ue]===null)for(const It in this.state[Ue])Ke[It]={},this.state[Ue][It]={};else for(const It in this.deletedStates[Ue]){if(this.deletedStates[Ue][It]===null)this.state[Ue][It]={};else for(const $t of Object.keys(this.deletedStates[Ue][It]))delete this.state[Ue][It][$t];Ke[It]=this.state[Ue][It]}Oe[Ue]=Oe[Ue]||{},r.e(Oe[Ue],Ke)}if(this.stateChanges={},this.deletedStates={},Object.keys(Oe).length!==0)for(const Ue in N)N[Ue].setFeatureState(Oe,ve)}}class Qt extends r.E{constructor(N,ve,Oe){super(),this.id=N,this.dispatcher=Oe,this.on("data",Ue=>this._dataHandler(Ue)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Ue,Ke,It,$t)=>{const ir=new(Ve(Ke.type))(Ue,Ke,It,$t);if(ir.id!==Ue)throw new Error(`Expected Source id to be ${Ue} instead of ${ir.id}`);return ir})(N,ve,Oe,this),this._tiles={},this._cache=new vt(0,Ue=>this._unloadTile(Ue)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Kt,this._didEmitContent=!1,this._updated=!1}onAdd(N){this.map=N,this._maxTileCacheSize=N?N._maxTileCacheSize:null,this._maxTileCacheZoomLevels=N?N._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(N)}onRemove(N){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(N)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const N in this._tiles){const ve=this._tiles[N];if(ve.state!=="loaded"&&ve.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const N=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,N&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(N,ve,Oe){return r._(this,void 0,void 0,function*(){try{yield this._source.loadTile(N),this._tileLoaded(N,ve,Oe)}catch(Ue){N.state="errored",Ue.status!==404?this._source.fire(new r.j(Ue,{tile:N})):this.update(this.transform,this.terrain)}})}_unloadTile(N){this._source.unloadTile&&this._source.unloadTile(N)}_abortTile(N){this._source.abortTile&&this._source.abortTile(N),this._source.fire(new r.k("dataabort",{tile:N,coord:N.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(N){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const ve in this._tiles){const Oe=this._tiles[ve];Oe.upload(N),Oe.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(N=>N.tileID).sort(fr).map(N=>N.key)}getRenderableIds(N){const ve=[];for(const Oe in this._tiles)this._isIdRenderable(Oe,N)&&ve.push(this._tiles[Oe]);return N?ve.sort((Oe,Ue)=>{const Ke=Oe.tileID,It=Ue.tileID,$t=new r.P(Ke.canonical.x,Ke.canonical.y)._rotate(this.transform.angle),ir=new r.P(It.canonical.x,It.canonical.y)._rotate(this.transform.angle);return Ke.overscaledZ-It.overscaledZ||ir.y-$t.y||ir.x-$t.x}).map(Oe=>Oe.tileID.key):ve.map(Oe=>Oe.tileID).sort(fr).map(Oe=>Oe.key)}hasRenderableParent(N){const ve=this.findLoadedParent(N,0);return!!ve&&this._isIdRenderable(ve.tileID.key)}_isIdRenderable(N,ve){return this._tiles[N]&&this._tiles[N].hasData()&&!this._coveredTiles[N]&&(ve||!this._tiles[N].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const N in this._tiles)this._tiles[N].state!=="errored"&&this._reloadTile(N,"reloading")}}_reloadTile(N,ve){return r._(this,void 0,void 0,function*(){const Oe=this._tiles[N];Oe&&(Oe.state!=="loading"&&(Oe.state=ve),yield this._loadTile(Oe,N,ve))})}_tileLoaded(N,ve,Oe){N.timeAdded=s.now(),Oe==="expired"&&(N.refreshedUponExpiration=!0),this._setTileReloadTimer(ve,N),this.getSource().type==="raster-dem"&&N.dem&&this._backfillDEM(N),this._state.initializeTileState(N,this.map?this.map.painter:null),N.aborted||this._source.fire(new r.k("data",{dataType:"source",tile:N,coord:N.tileID}))}_backfillDEM(N){const ve=this.getRenderableIds();for(let Ue=0;Ue1||(Math.abs(It)>1&&(Math.abs(It+ir)===1?It+=ir:Math.abs(It-ir)===1&&(It-=ir)),Ke.dem&&Ue.dem&&(Ue.dem.backfillBorder(Ke.dem,It,$t),Ue.neighboringTiles&&Ue.neighboringTiles[Tr]&&(Ue.neighboringTiles[Tr].backfilled=!0)))}}getTile(N){return this.getTileByID(N.key)}getTileByID(N){return this._tiles[N]}_retainLoadedChildren(N,ve,Oe,Ue){for(const Ke in this._tiles){let It=this._tiles[Ke];if(Ue[Ke]||!It.hasData()||It.tileID.overscaledZ<=ve||It.tileID.overscaledZ>Oe)continue;let $t=It.tileID;for(;It&&It.tileID.overscaledZ>ve+1;){const Tr=It.tileID.scaledTo(It.tileID.overscaledZ-1);It=this._tiles[Tr.key],It&&It.hasData()&&($t=Tr)}let ir=$t;for(;ir.overscaledZ>ve;)if(ir=ir.scaledTo(ir.overscaledZ-1),N[ir.key]){Ue[$t.key]=$t;break}}}findLoadedParent(N,ve){if(N.key in this._loadedParentTiles){const Oe=this._loadedParentTiles[N.key];return Oe&&Oe.tileID.overscaledZ>=ve?Oe:null}for(let Oe=N.overscaledZ-1;Oe>=ve;Oe--){const Ue=N.scaledTo(Oe),Ke=this._getLoadedTile(Ue);if(Ke)return Ke}}findLoadedSibling(N){return this._getLoadedTile(N)}_getLoadedTile(N){const ve=this._tiles[N.key];return ve&&ve.hasData()?ve:this._cache.getByKey(N.wrapped().key)}updateCacheSize(N){const ve=Math.ceil(N.width/this._source.tileSize)+1,Oe=Math.ceil(N.height/this._source.tileSize)+1,Ue=Math.floor(ve*Oe*(this._maxTileCacheZoomLevels===null?r.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Ke=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Ue):Ue;this._cache.setMaxSize(Ke)}handleWrapJump(N){const ve=Math.round((N-(this._prevLng===void 0?N:this._prevLng))/360);if(this._prevLng=N,ve){const Oe={};for(const Ue in this._tiles){const Ke=this._tiles[Ue];Ke.tileID=Ke.tileID.unwrapTo(Ke.tileID.wrap+ve),Oe[Ke.tileID.key]=Ke}this._tiles=Oe;for(const Ue in this._timers)clearTimeout(this._timers[Ue]),delete this._timers[Ue];for(const Ue in this._tiles)this._setTileReloadTimer(Ue,this._tiles[Ue])}}_updateCoveredAndRetainedTiles(N,ve,Oe,Ue,Ke,It){const $t={},ir={},Tr=Object.keys(N),Or=s.now();for(const Vr of Tr){const vn=N[Vr],Dn=this._tiles[Vr];if(!Dn||Dn.fadeEndTime!==0&&Dn.fadeEndTime<=Or)continue;const ot=this.findLoadedParent(vn,ve),dt=this.findLoadedSibling(vn),St=ot||dt||null;St&&(this._addTile(St.tileID),$t[St.tileID.key]=St.tileID),ir[Vr]=vn}this._retainLoadedChildren(ir,Ue,Oe,N);for(const Vr in $t)N[Vr]||(this._coveredTiles[Vr]=!0,N[Vr]=$t[Vr]);if(It){const Vr={},vn={};for(const Dn of Ke)this._tiles[Dn.key].hasData()?Vr[Dn.key]=Dn:vn[Dn.key]=Dn;for(const Dn in vn){const ot=vn[Dn].children(this._source.maxzoom);this._tiles[ot[0].key]&&this._tiles[ot[1].key]&&this._tiles[ot[2].key]&&this._tiles[ot[3].key]&&(Vr[ot[0].key]=N[ot[0].key]=ot[0],Vr[ot[1].key]=N[ot[1].key]=ot[1],Vr[ot[2].key]=N[ot[2].key]=ot[2],Vr[ot[3].key]=N[ot[3].key]=ot[3],delete vn[Dn])}for(const Dn in vn){const ot=vn[Dn],dt=this.findLoadedParent(ot,this._source.minzoom),St=this.findLoadedSibling(ot),Rt=dt||St||null;if(Rt){Vr[Rt.tileID.key]=N[Rt.tileID.key]=Rt.tileID;for(const Yt in Vr)Vr[Yt].isChildOf(Rt.tileID)&&delete Vr[Yt]}}for(const Dn in this._tiles)Vr[Dn]||(this._coveredTiles[Dn]=!0)}}update(N,ve){if(!this._sourceLoaded||this._paused)return;let Oe;this.transform=N,this.terrain=ve,this.updateCacheSize(N),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Oe=N.getVisibleUnwrappedCoordinates(this._source.tileID).map(Or=>new r.S(Or.canonical.z,Or.wrap,Or.canonical.z,Or.canonical.x,Or.canonical.y)):(Oe=N.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:ve}),this._source.hasTile&&(Oe=Oe.filter(Or=>this._source.hasTile(Or)))):Oe=[];const Ue=N.coveringZoomLevel(this._source),Ke=Math.max(Ue-Qt.maxOverzooming,this._source.minzoom),It=Math.max(Ue+Qt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const Or={};for(const Vr of Oe)if(Vr.canonical.z>this._source.minzoom){const vn=Vr.scaledTo(Vr.canonical.z-1);Or[vn.key]=vn;const Dn=Vr.scaledTo(Math.max(this._source.minzoom,Math.min(Vr.canonical.z,5)));Or[Dn.key]=Dn}Oe=Oe.concat(Object.values(Or))}const $t=Oe.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,$t&&this.fire(new r.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const ir=this._updateRetainedTiles(Oe,Ue);mr(this._source.type)&&this._updateCoveredAndRetainedTiles(ir,Ke,It,Ue,Oe,ve);for(const Or in ir)this._tiles[Or].clearFadeHold();const Tr=r.ab(this._tiles,ir);for(const Or of Tr){const Vr=this._tiles[Or];Vr.hasSymbolBuckets&&!Vr.holdingForFade()?Vr.setHoldDuration(this.map._fadeDuration):Vr.hasSymbolBuckets&&!Vr.symbolFadeFinished()||this._removeTile(Or)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const N in this._tiles)this._tiles[N].holdingForFade()&&this._removeTile(N)}_updateRetainedTiles(N,ve){var Oe;const Ue={},Ke={},It=Math.max(ve-Qt.maxOverzooming,this._source.minzoom),$t=Math.max(ve+Qt.maxUnderzooming,this._source.minzoom),ir={};for(const Tr of N){const Or=this._addTile(Tr);Ue[Tr.key]=Tr,Or.hasData()||vethis._source.maxzoom){const vn=Tr.children(this._source.maxzoom)[0],Dn=this.getTile(vn);if(Dn&&Dn.hasData()){Ue[vn.key]=vn;continue}}else{const vn=Tr.children(this._source.maxzoom);if(Ue[vn[0].key]&&Ue[vn[1].key]&&Ue[vn[2].key]&&Ue[vn[3].key])continue}let Vr=Or.wasRequested();for(let vn=Tr.overscaledZ-1;vn>=It;--vn){const Dn=Tr.scaledTo(vn);if(Ke[Dn.key])break;if(Ke[Dn.key]=!0,Or=this.getTile(Dn),!Or&&Vr&&(Or=this._addTile(Dn)),Or){const ot=Or.hasData();if((ot||!(!((Oe=this.map)===null||Oe===void 0)&&Oe.cancelPendingTileRequestsWhileZooming)||Vr)&&(Ue[Dn.key]=Dn),Vr=Or.wasRequested(),ot)break}}}return Ue}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const N in this._tiles){const ve=[];let Oe,Ue=this._tiles[N].tileID;for(;Ue.overscaledZ>0;){if(Ue.key in this._loadedParentTiles){Oe=this._loadedParentTiles[Ue.key];break}ve.push(Ue.key);const Ke=Ue.scaledTo(Ue.overscaledZ-1);if(Oe=this._getLoadedTile(Ke),Oe)break;Ue=Ke}for(const Ke of ve)this._loadedParentTiles[Ke]=Oe}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const N in this._tiles){const ve=this._tiles[N].tileID,Oe=this._getLoadedTile(ve);this._loadedSiblingTiles[ve.key]=Oe}}_addTile(N){let ve=this._tiles[N.key];if(ve)return ve;ve=this._cache.getAndRemove(N),ve&&(this._setTileReloadTimer(N.key,ve),ve.tileID=N,this._state.initializeTileState(ve,this.map?this.map.painter:null),this._cacheTimers[N.key]&&(clearTimeout(this._cacheTimers[N.key]),delete this._cacheTimers[N.key],this._setTileReloadTimer(N.key,ve)));const Oe=ve;return ve||(ve=new At(N,this._source.tileSize*N.overscaleFactor()),this._loadTile(ve,N.key,ve.state)),ve.uses++,this._tiles[N.key]=ve,Oe||this._source.fire(new r.k("dataloading",{tile:ve,coord:ve.tileID,dataType:"source"})),ve}_setTileReloadTimer(N,ve){N in this._timers&&(clearTimeout(this._timers[N]),delete this._timers[N]);const Oe=ve.getExpiryTimeout();Oe&&(this._timers[N]=setTimeout(()=>{this._reloadTile(N,"expired"),delete this._timers[N]},Oe))}_removeTile(N){const ve=this._tiles[N];ve&&(ve.uses--,delete this._tiles[N],this._timers[N]&&(clearTimeout(this._timers[N]),delete this._timers[N]),ve.uses>0||(ve.hasData()&&ve.state!=="reloading"?this._cache.add(ve.tileID,ve,ve.getExpiryTimeout()):(ve.aborted=!0,this._abortTile(ve),this._unloadTile(ve))))}_dataHandler(N){const ve=N.sourceDataType;N.dataType==="source"&&ve==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&N.dataType==="source"&&ve==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const N in this._tiles)this._removeTile(N);this._cache.reset()}tilesIn(N,ve,Oe){const Ue=[],Ke=this.transform;if(!Ke)return Ue;const It=Oe?Ke.getCameraQueryGeometry(N):N,$t=N.map(ot=>Ke.pointCoordinate(ot,this.terrain)),ir=It.map(ot=>Ke.pointCoordinate(ot,this.terrain)),Tr=this.getIds();let Or=1/0,Vr=1/0,vn=-1/0,Dn=-1/0;for(const ot of ir)Or=Math.min(Or,ot.x),Vr=Math.min(Vr,ot.y),vn=Math.max(vn,ot.x),Dn=Math.max(Dn,ot.y);for(let ot=0;ot=0&&Ut[1].y+Yt>=0){const er=$t.map(Nr=>St.getTilePoint(Nr)),Mr=ir.map(Nr=>St.getTilePoint(Nr));Ue.push({tile:dt,tileID:St,queryGeometry:er,cameraQueryGeometry:Mr,scale:Rt})}}return Ue}getVisibleCoordinates(N){const ve=this.getRenderableIds(N).map(Oe=>this._tiles[Oe].tileID);for(const Oe of ve)Oe.posMatrix=this.transform.calculatePosMatrix(Oe.toUnwrapped());return ve}hasTransition(){if(this._source.hasTransition())return!0;if(mr(this._source.type)){const N=s.now();for(const ve in this._tiles)if(this._tiles[ve].fadeEndTime>=N)return!0}return!1}setFeatureState(N,ve,Oe){this._state.updateState(N=N||"_geojsonTileLayer",ve,Oe)}removeFeatureState(N,ve,Oe){this._state.removeFeatureState(N=N||"_geojsonTileLayer",ve,Oe)}getFeatureState(N,ve){return this._state.getState(N=N||"_geojsonTileLayer",ve)}setDependencies(N,ve,Oe){const Ue=this._tiles[N];Ue&&Ue.setDependencies(ve,Oe)}reloadTilesForDependencies(N,ve){for(const Oe in this._tiles)this._tiles[Oe].hasDependency(N,ve)&&this._reloadTile(Oe,"reloading");this._cache.filter(Oe=>!Oe.hasDependency(N,ve))}}function fr(Qe,N){const ve=Math.abs(2*Qe.wrap)-+(Qe.wrap<0),Oe=Math.abs(2*N.wrap)-+(N.wrap<0);return Qe.overscaledZ-N.overscaledZ||Oe-ve||N.canonical.y-Qe.canonical.y||N.canonical.x-Qe.canonical.x}function mr(Qe){return Qe==="raster"||Qe==="image"||Qe==="video"}Qt.maxOverzooming=10,Qt.maxUnderzooming=3;class Ur{constructor(N,ve){this.reset(N,ve)}reset(N,ve){this.points=N||[],this._distances=[0];for(let Oe=1;Oe0?(Ue-It)/$t:0;return this.points[Ke].mult(1-ir).add(this.points[ve].mult(ir))}}function Br(Qe,N){let ve=!0;return Qe==="always"||Qe!=="never"&&N!=="never"||(ve=!1),ve}class fn{constructor(N,ve,Oe){const Ue=this.boxCells=[],Ke=this.circleCells=[];this.xCellCount=Math.ceil(N/Oe),this.yCellCount=Math.ceil(ve/Oe);for(let It=0;Itthis.width||Ue<0||ve>this.height)return[];const ir=[];if(N<=0&&ve<=0&&this.width<=Oe&&this.height<=Ue){if(Ke)return[{key:null,x1:N,y1:ve,x2:Oe,y2:Ue}];for(let Tr=0;Tr0}hitTestCircle(N,ve,Oe,Ue,Ke){const It=N-Oe,$t=N+Oe,ir=ve-Oe,Tr=ve+Oe;if($t<0||It>this.width||Tr<0||ir>this.height)return!1;const Or=[];return this._forEachCell(It,ir,$t,Tr,this._queryCellCircle,Or,{hitTest:!0,overlapMode:Ue,circle:{x:N,y:ve,radius:Oe},seenUids:{box:{},circle:{}}},Ke),Or.length>0}_queryCell(N,ve,Oe,Ue,Ke,It,$t,ir){const{seenUids:Tr,hitTest:Or,overlapMode:Vr}=$t,vn=this.boxCells[Ke];if(vn!==null){const ot=this.bboxes;for(const dt of vn)if(!Tr.box[dt]){Tr.box[dt]=!0;const St=4*dt,Rt=this.boxKeys[dt];if(N<=ot[St+2]&&ve<=ot[St+3]&&Oe>=ot[St+0]&&Ue>=ot[St+1]&&(!ir||ir(Rt))&&(!Or||!Br(Vr,Rt.overlapMode))&&(It.push({key:Rt,x1:ot[St],y1:ot[St+1],x2:ot[St+2],y2:ot[St+3]}),Or))return!0}}const Dn=this.circleCells[Ke];if(Dn!==null){const ot=this.circles;for(const dt of Dn)if(!Tr.circle[dt]){Tr.circle[dt]=!0;const St=3*dt,Rt=this.circleKeys[dt];if(this._circleAndRectCollide(ot[St],ot[St+1],ot[St+2],N,ve,Oe,Ue)&&(!ir||ir(Rt))&&(!Or||!Br(Vr,Rt.overlapMode))){const Yt=ot[St],Ut=ot[St+1],er=ot[St+2];if(It.push({key:Rt,x1:Yt-er,y1:Ut-er,x2:Yt+er,y2:Ut+er}),Or)return!0}}}return!1}_queryCellCircle(N,ve,Oe,Ue,Ke,It,$t,ir){const{circle:Tr,seenUids:Or,overlapMode:Vr}=$t,vn=this.boxCells[Ke];if(vn!==null){const ot=this.bboxes;for(const dt of vn)if(!Or.box[dt]){Or.box[dt]=!0;const St=4*dt,Rt=this.boxKeys[dt];if(this._circleAndRectCollide(Tr.x,Tr.y,Tr.radius,ot[St+0],ot[St+1],ot[St+2],ot[St+3])&&(!ir||ir(Rt))&&!Br(Vr,Rt.overlapMode))return It.push(!0),!0}}const Dn=this.circleCells[Ke];if(Dn!==null){const ot=this.circles;for(const dt of Dn)if(!Or.circle[dt]){Or.circle[dt]=!0;const St=3*dt,Rt=this.circleKeys[dt];if(this._circlesCollide(ot[St],ot[St+1],ot[St+2],Tr.x,Tr.y,Tr.radius)&&(!ir||ir(Rt))&&!Br(Vr,Rt.overlapMode))return It.push(!0),!0}}}_forEachCell(N,ve,Oe,Ue,Ke,It,$t,ir){const Tr=this._convertToXCellCoord(N),Or=this._convertToYCellCoord(ve),Vr=this._convertToXCellCoord(Oe),vn=this._convertToYCellCoord(Ue);for(let Dn=Tr;Dn<=Vr;Dn++)for(let ot=Or;ot<=vn;ot++)if(Ke.call(this,N,ve,Oe,Ue,this.xCellCount*ot+Dn,It,$t,ir))return}_convertToXCellCoord(N){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(N*this.xScale)))}_convertToYCellCoord(N){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(N*this.yScale)))}_circlesCollide(N,ve,Oe,Ue,Ke,It){const $t=Ue-N,ir=Ke-ve,Tr=Oe+It;return Tr*Tr>$t*$t+ir*ir}_circleAndRectCollide(N,ve,Oe,Ue,Ke,It,$t){const ir=(It-Ue)/2,Tr=Math.abs(N-(Ue+ir));if(Tr>ir+Oe)return!1;const Or=($t-Ke)/2,Vr=Math.abs(ve-(Ke+Or));if(Vr>Or+Oe)return!1;if(Tr<=ir||Vr<=Or)return!0;const vn=Tr-ir,Dn=Vr-Or;return vn*vn+Dn*Dn<=Oe*Oe}}function Fr(Qe,N,ve,Oe,Ue){const Ke=r.H();return N?(r.K(Ke,Ke,[1/Ue,1/Ue,1]),ve||r.ad(Ke,Ke,Oe.angle)):r.L(Ke,Oe.labelPlaneMatrix,Qe),Ke}function Qr(Qe,N,ve,Oe,Ue){if(N){const Ke=r.ae(Qe);return r.K(Ke,Ke,[Ue,Ue,1]),ve||r.ad(Ke,Ke,-Oe.angle),Ke}return Oe.glCoordMatrix}function Bt(Qe,N,ve,Oe){let Ue;Oe?(Ue=[Qe,N,Oe(Qe,N),1],r.af(Ue,Ue,ve)):(Ue=[Qe,N,0,1],Sr(Ue,Ue,ve));const Ke=Ue[3];return{point:new r.P(Ue[0]/Ke,Ue[1]/Ke),signedDistanceFromCamera:Ke,isOccluded:!1}}function et(Qe,N){return .5+Qe/N*.5}function ut(Qe,N){return Qe.x>=-N[0]&&Qe.x<=N[0]&&Qe.y>=-N[1]&&Qe.y<=N[1]}function Be(Qe,N,ve,Oe,Ue,Ke,It,$t,ir,Tr,Or,Vr,vn,Dn,ot){const dt=Oe?Qe.textSizeData:Qe.iconSizeData,St=r.ag(dt,ve.transform.zoom),Rt=[256/ve.width*2+1,256/ve.height*2+1],Yt=Oe?Qe.text.dynamicLayoutVertexArray:Qe.icon.dynamicLayoutVertexArray;Yt.clear();const Ut=Qe.lineVertexArray,er=Oe?Qe.text.placedSymbolArray:Qe.icon.placedSymbolArray,Mr=ve.transform.width/ve.transform.height;let Nr=!1;for(let jr=0;jrMath.abs(ve.x-N.x)*Oe?{useVertical:!0}:(Qe===r.ah.vertical?N.yve.x)?{needsFlipping:!0}:null}function Fe(Qe,N,ve,Oe,Ue,Ke,It,$t,ir,Tr,Or){const Vr=ve/24,vn=N.lineOffsetX*Vr,Dn=N.lineOffsetY*Vr;let ot;if(N.numGlyphs>1){const dt=N.glyphStartIndex+N.numGlyphs,St=N.lineStartIndex,Rt=N.lineStartIndex+N.lineLength,Yt=Ie(Vr,$t,vn,Dn,Oe,N,Or,Qe);if(!Yt)return{notEnoughRoom:!0};const Ut=Bt(Yt.first.point.x,Yt.first.point.y,It,Qe.getElevation).point,er=Bt(Yt.last.point.x,Yt.last.point.y,It,Qe.getElevation).point;if(Ue&&!Oe){const Mr=ke(N.writingMode,Ut,er,Tr);if(Mr)return Mr}ot=[Yt.first];for(let Mr=N.glyphStartIndex+1;Mr0?Ut.point:(function(Nr,jr,sn,xn,$n,Wn){return at(Nr,jr,sn,1,$n,Wn)})(Qe.tileAnchorPoint,Yt,St,0,Ke,Qe),Mr=ke(N.writingMode,St,er,Tr);if(Mr)return Mr}const dt=ur(Vr*$t.getoffsetX(N.glyphStartIndex),vn,Dn,Oe,N.segment,N.lineStartIndex,N.lineStartIndex+N.lineLength,Qe,Or);if(!dt||Qe.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};ot=[dt]}for(const dt of ot)r.aj(ir,dt.point,dt.angle);return{}}function at(Qe,N,ve,Oe,Ue,Ke){const It=Qe.add(Qe.sub(N)._unit()),$t=Ue!==void 0?Bt(It.x,It.y,Ue,Ke.getElevation).point:Gt(It.x,It.y,Ke).point,ir=ve.sub($t);return ve.add(ir._mult(Oe/ir.mag()))}function ct(Qe,N,ve){const Oe=N.projectionCache;if(Oe.projections[Qe])return Oe.projections[Qe];const Ue=new r.P(N.lineVertexArray.getx(Qe),N.lineVertexArray.gety(Qe)),Ke=Gt(Ue.x,Ue.y,N);if(Ke.signedDistanceFromCamera>0)return Oe.projections[Qe]=Ke.point,Oe.anyProjectionOccluded=Oe.anyProjectionOccluded||Ke.isOccluded,Ke.point;const It=Qe-ve.direction;return(function($t,ir,Tr,Or,Vr){return at($t,ir,Tr,Or,void 0,Vr)})(ve.distanceFromAnchor===0?N.tileAnchorPoint:new r.P(N.lineVertexArray.getx(It),N.lineVertexArray.gety(It)),Ue,ve.previousVertex,ve.absOffsetX-ve.distanceFromAnchor+1,N)}function Gt(Qe,N,ve){const Oe=Qe+ve.translation[0],Ue=N+ve.translation[1];let Ke;return!ve.pitchWithMap&&ve.projection.useSpecialProjectionForSymbols?(Ke=ve.projection.projectTileCoordinates(Oe,Ue,ve.unwrappedTileID,ve.getElevation),Ke.point.x=(.5*Ke.point.x+.5)*ve.width,Ke.point.y=(.5*-Ke.point.y+.5)*ve.height):(Ke=Bt(Oe,Ue,ve.labelPlaneMatrix,ve.getElevation),Ke.isOccluded=!1),Ke}function Vt(Qe,N,ve){return Qe._unit()._perp()._mult(N*ve)}function Zt(Qe,N,ve,Oe,Ue,Ke,It,$t,ir){if($t.projectionCache.offsets[Qe])return $t.projectionCache.offsets[Qe];const Tr=ve.add(N);if(Qe+ir.direction=Ue)return $t.projectionCache.offsets[Qe]=Tr,Tr;const Or=ct(Qe+ir.direction,$t,ir),Vr=Vt(Or.sub(ve),It,ir.direction),vn=ve.add(Vr),Dn=Or.add(Vr);return $t.projectionCache.offsets[Qe]=r.ak(Ke,Tr,vn,Dn)||Tr,$t.projectionCache.offsets[Qe]}function ur(Qe,N,ve,Oe,Ue,Ke,It,$t,ir){const Tr=Oe?Qe-N:Qe+N;let Or=Tr>0?1:-1,Vr=0;Oe&&(Or*=-1,Vr=Math.PI),Or<0&&(Vr+=Math.PI);let vn,Dn=Or>0?Ke+Ue:Ke+Ue+1;$t.projectionCache.cachedAnchorPoint?vn=$t.projectionCache.cachedAnchorPoint:(vn=Gt($t.tileAnchorPoint.x,$t.tileAnchorPoint.y,$t).point,$t.projectionCache.cachedAnchorPoint=vn);let ot,dt,St=vn,Rt=vn,Yt=0,Ut=0;const er=Math.abs(Tr),Mr=[];let Nr;for(;Yt+Ut<=er;){if(Dn+=Or,Dn=It)return null;Yt+=Ut,Rt=St,dt=ot;const xn={absOffsetX:er,direction:Or,distanceFromAnchor:Yt,previousVertex:Rt};if(St=ct(Dn,$t,xn),ve===0)Mr.push(Rt),Nr=St.sub(Rt);else{let $n;const Wn=St.sub(Rt);$n=Wn.mag()===0?Vt(ct(Dn+Or,$t,xn).sub(St),ve,Or):Vt(Wn,ve,Or),dt||(dt=Rt.add($n)),ot=Zt(Dn,$n,St,Ke,It,dt,ve,$t,xn),Mr.push(dt),Nr=ot.sub(dt)}Ut=Nr.mag()}const jr=Nr._mult((er-Yt)/Ut)._add(dt||Rt),sn=Vr+Math.atan2(St.y-Rt.y,St.x-Rt.x);return Mr.push(jr),{point:jr,angle:ir?sn:0,path:Mr}}const Dr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function kr(Qe,N){for(let ve=0;ve=1;Bo--)Mi.push(Si.path[Bo]);for(let Bo=1;Bovs.signedDistanceFromCamera<=0)?[]:Bo.map(vs=>vs.point)}let qo=[];if(Mi.length>0){const Bo=Mi[0].clone(),vs=Mi[0].clone();for(let ml=1;ml=Wn.x&&vs.x<=ua.x&&Bo.y>=Wn.y&&vs.y<=ua.y?[Mi]:vs.xua.x||vs.yua.y?[]:r.al([Mi],Wn.x,Wn.y,ua.x,ua.y)}for(const Bo of qo){Ua.reset(Bo,.25*$n);let vs=0;vs=Ua.length<=.5*$n?1:Math.ceil(Ua.paddedLength/Ao)+1;for(let ml=0;mlBt(Ue.x,Ue.y,Oe,ve.getElevation))}queryRenderedSymbols(N){if(N.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const ve=[];let Oe=1/0,Ue=1/0,Ke=-1/0,It=-1/0;for(const Or of N){const Vr=new r.P(Or.x+Jr,Or.y+Jr);Oe=Math.min(Oe,Vr.x),Ue=Math.min(Ue,Vr.y),Ke=Math.max(Ke,Vr.x),It=Math.max(It,Vr.y),ve.push(Vr)}const $t=this.grid.query(Oe,Ue,Ke,It).concat(this.ignoredGrid.query(Oe,Ue,Ke,It)),ir={},Tr={};for(const Or of $t){const Vr=Or.key;if(ir[Vr.bucketInstanceId]===void 0&&(ir[Vr.bucketInstanceId]={}),ir[Vr.bucketInstanceId][Vr.featureIndex])continue;const vn=[new r.P(Or.x1,Or.y1),new r.P(Or.x2,Or.y1),new r.P(Or.x2,Or.y2),new r.P(Or.x1,Or.y2)];r.am(ve,vn)&&(ir[Vr.bucketInstanceId][Vr.featureIndex]=!0,Tr[Vr.bucketInstanceId]===void 0&&(Tr[Vr.bucketInstanceId]=[]),Tr[Vr.bucketInstanceId].push(Vr.featureIndex))}return Tr}insertCollisionBox(N,ve,Oe,Ue,Ke,It){(Oe?this.ignoredGrid:this.grid).insert({bucketInstanceId:Ue,featureIndex:Ke,collisionGroupID:It,overlapMode:ve},N[0],N[1],N[2],N[3])}insertCollisionCircles(N,ve,Oe,Ue,Ke,It){const $t=Oe?this.ignoredGrid:this.grid,ir={bucketInstanceId:Ue,featureIndex:Ke,collisionGroupID:It,overlapMode:ve};for(let Tr=0;Tr=this.screenRightBoundary||Uethis.screenBottomBoundary}isInsideGrid(N,ve,Oe,Ue){return Oe>=0&&N=0&&vethis.projectAndGetPerspectiveRatio(Oe,$n.x,$n.y,Ue,Tr));sn=xn.some($n=>!$n.isOccluded),jr=xn.map($n=>$n.point)}else sn=!0;return{box:r.ao(jr),allPointsOccluded:!sn}}}function ha(Qe,N,ve){return N*(r.X/(Qe.tileSize*Math.pow(2,ve-Qe.tileID.overscaledZ)))}class oa{constructor(N,ve,Oe,Ue){this.opacity=N?Math.max(0,Math.min(1,N.opacity+(N.placed?ve:-ve))):Ue&&Oe?1:0,this.placed=Oe}isHidden(){return this.opacity===0&&!this.placed}}class _a{constructor(N,ve,Oe,Ue,Ke){this.text=new oa(N?N.text:null,ve,Oe,Ke),this.icon=new oa(N?N.icon:null,ve,Ue,Ke)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class xa{constructor(N,ve,Oe){this.text=N,this.icon=ve,this.skipFade=Oe}}class ra{constructor(){this.invProjMatrix=r.H(),this.viewportMatrix=r.H(),this.circles=[]}}class Ha{constructor(N,ve,Oe,Ue,Ke){this.bucketInstanceId=N,this.featureIndex=ve,this.sourceLayerIndex=Oe,this.bucketIndex=Ue,this.tileID=Ke}}class ci{constructor(N){this.crossSourceCollisions=N,this.maxGroupID=0,this.collisionGroups={}}get(N){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[N]){const ve=++this.maxGroupID;this.collisionGroups[N]={ID:ve,predicate:Oe=>Oe.collisionGroupID===ve}}return this.collisionGroups[N]}}function _r(Qe,N,ve,Oe,Ue){const{horizontalAlign:Ke,verticalAlign:It}=r.au(Qe);return new r.P(-(Ke-.5)*N+Oe[0]*Ue,-(It-.5)*ve+Oe[1]*Ue)}class rr{constructor(N,ve,Oe,Ue,Ke,It){this.transform=N.clone(),this.terrain=Oe,this.collisionIndex=new jn(this.transform,ve),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Ue,this.retainedQueryData={},this.collisionGroups=new ci(Ke),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=It,It&&(It.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(N){const ve=this.terrain;return ve?(Oe,Ue)=>ve.getElevation(N,Oe,Ue):null}getBucketParts(N,ve,Oe,Ue){const Ke=Oe.getBucket(ve),It=Oe.latestFeatureIndex;if(!Ke||!It||ve.id!==Ke.layerIds[0])return;const $t=Oe.collisionBoxArray,ir=Ke.layers[0].layout,Tr=Ke.layers[0].paint,Or=Math.pow(2,this.transform.zoom-Oe.tileID.overscaledZ),Vr=Oe.tileSize/r.X,vn=Oe.tileID.toUnwrapped(),Dn=this.transform.calculatePosMatrix(vn),ot=ir.get("text-pitch-alignment")==="map",dt=ir.get("text-rotation-alignment")==="map",St=ha(Oe,1,this.transform.zoom),Rt=this.collisionIndex.mapProjection.translatePosition(this.transform,Oe,Tr.get("text-translate"),Tr.get("text-translate-anchor")),Yt=this.collisionIndex.mapProjection.translatePosition(this.transform,Oe,Tr.get("icon-translate"),Tr.get("icon-translate-anchor")),Ut=Fr(Dn,ot,dt,this.transform,St);let er=null;if(ot){const Nr=Qr(Dn,ot,dt,this.transform,St);er=r.L([],this.transform.labelPlaneMatrix,Nr)}this.retainedQueryData[Ke.bucketInstanceId]=new Ha(Ke.bucketInstanceId,It,Ke.sourceLayerIndex,Ke.index,Oe.tileID);const Mr={bucket:Ke,layout:ir,translationText:Rt,translationIcon:Yt,posMatrix:Dn,unwrappedTileID:vn,textLabelPlaneMatrix:Ut,labelToScreenMatrix:er,scale:Or,textPixelRatio:Vr,holdingForFade:Oe.holdingForFade(),collisionBoxArray:$t,partiallyEvaluatedTextSize:r.ag(Ke.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Ke.sourceID)};if(Ue)for(const Nr of Ke.sortKeyRanges){const{sortKey:jr,symbolInstanceStart:sn,symbolInstanceEnd:xn}=Nr;N.push({sortKey:jr,symbolInstanceStart:sn,symbolInstanceEnd:xn,parameters:Mr})}else N.push({symbolInstanceStart:0,symbolInstanceEnd:Ke.symbolInstances.length,parameters:Mr})}attemptAnchorPlacement(N,ve,Oe,Ue,Ke,It,$t,ir,Tr,Or,Vr,vn,Dn,ot,dt,St,Rt,Yt,Ut){const er=r.aq[N.textAnchor],Mr=[N.textOffset0,N.textOffset1],Nr=_r(er,Oe,Ue,Mr,Ke),jr=this.collisionIndex.placeCollisionBox(ve,vn,ir,Tr,Or,$t,It,St,Vr.predicate,Ut,Nr);if((!Yt||this.collisionIndex.placeCollisionBox(Yt,vn,ir,Tr,Or,$t,It,Rt,Vr.predicate,Ut,Nr).placeable)&&jr.placeable){let sn;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Dn.crossTileID]&&this.prevPlacement.placements[Dn.crossTileID]&&this.prevPlacement.placements[Dn.crossTileID].text&&(sn=this.prevPlacement.variableOffsets[Dn.crossTileID].anchor),Dn.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Dn.crossTileID]={textOffset:Mr,width:Oe,height:Ue,anchor:er,textBoxScale:Ke,prevAnchor:sn},this.markUsedJustification(ot,er,Dn,dt),ot.allowVerticalPlacement&&(this.markUsedOrientation(ot,dt,Dn),this.placedOrientations[Dn.crossTileID]=dt),{shift:Nr,placedGlyphBoxes:jr}}}placeLayerBucketPart(N,ve,Oe){const{bucket:Ue,layout:Ke,translationText:It,translationIcon:$t,posMatrix:ir,unwrappedTileID:Tr,textLabelPlaneMatrix:Or,labelToScreenMatrix:Vr,textPixelRatio:vn,holdingForFade:Dn,collisionBoxArray:ot,partiallyEvaluatedTextSize:dt,collisionGroup:St}=N.parameters,Rt=Ke.get("text-optional"),Yt=Ke.get("icon-optional"),Ut=r.ar(Ke,"text-overlap","text-allow-overlap"),er=Ut==="always",Mr=r.ar(Ke,"icon-overlap","icon-allow-overlap"),Nr=Mr==="always",jr=Ke.get("text-rotation-alignment")==="map",sn=Ke.get("text-pitch-alignment")==="map",xn=Ke.get("icon-text-fit")!=="none",$n=Ke.get("symbol-z-order")==="viewport-y",Wn=er&&(Nr||!Ue.hasIconData()||Yt),ua=Nr&&(er||!Ue.hasTextData()||Rt);!Ue.collisionArrays&&ot&&Ue.deserializeCollisionBoxes(ot);const Ua=this._getTerrainElevationFunc(this.retainedQueryData[Ue.bucketInstanceId].tileID),Si=(gi,Mi,Ao)=>{var qo,Bo;if(ve[gi.crossTileID])return;if(Dn)return void(this.placements[gi.crossTileID]=new xa(!1,!1,!1));let vs=!1,ml=!1,yl=!0,Xs=null,Sl={box:null,placeable:!1,offscreen:null},Ou={placeable:!1},Su=null,Ys=null,Zs=null,Qu=0,Pc=0,mf=0;Mi.textFeatureIndex?Qu=Mi.textFeatureIndex:gi.useRuntimeCollisionCircles&&(Qu=gi.featureIndex),Mi.verticalTextFeatureIndex&&(Pc=Mi.verticalTextFeatureIndex);const Ce=Mi.textBox;if(Ce){const Ot=Rr=>{let ln=r.ah.horizontal;if(Ue.allowVerticalPlacement&&!Rr&&this.prevPlacement){const on=this.prevPlacement.placedOrientations[gi.crossTileID];on&&(this.placedOrientations[gi.crossTileID]=on,ln=on,this.markUsedOrientation(Ue,ln,gi))}return ln},Wt=(Rr,ln)=>{if(Ue.allowVerticalPlacement&&gi.numVerticalGlyphVertices>0&&Mi.verticalTextBox){for(const on of Ue.writingModes)if(on===r.ah.vertical?(Sl=ln(),Ou=Sl):Sl=Rr(),Sl&&Sl.placeable)break}else Sl=Rr()},dr=gi.textAnchorOffsetStartIndex,hr=gi.textAnchorOffsetEndIndex;if(hr===dr){const Rr=(ln,on)=>{const En=this.collisionIndex.placeCollisionBox(ln,Ut,vn,ir,Tr,sn,jr,It,St.predicate,Ua);return En&&En.placeable&&(this.markUsedOrientation(Ue,on,gi),this.placedOrientations[gi.crossTileID]=on),En};Wt(()=>Rr(Ce,r.ah.horizontal),()=>{const ln=Mi.verticalTextBox;return Ue.allowVerticalPlacement&&gi.numVerticalGlyphVertices>0&&ln?Rr(ln,r.ah.vertical):{box:null,offscreen:null}}),Ot(Sl&&Sl.placeable)}else{let Rr=r.aq[(Bo=(qo=this.prevPlacement)===null||qo===void 0?void 0:qo.variableOffsets[gi.crossTileID])===null||Bo===void 0?void 0:Bo.anchor];const ln=(En,Un,Gn)=>{const Xa=En.x2-En.x1,Kn=En.y2-En.y1,ma=gi.textBoxScale,Aa=xn&&Mr==="never"?Un:null;let Va=null,Za=Ut==="never"?1:2,Ta="never";Rr&&Za++;for(let Ii=0;Iiln(Ce,Mi.iconBox,r.ah.horizontal),()=>{const En=Mi.verticalTextBox;return Ue.allowVerticalPlacement&&(!Sl||!Sl.placeable)&&gi.numVerticalGlyphVertices>0&&En?ln(En,Mi.verticalIconBox,r.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Sl&&(vs=Sl.placeable,yl=Sl.offscreen);const on=Ot(Sl&&Sl.placeable);if(!vs&&this.prevPlacement){const En=this.prevPlacement.variableOffsets[gi.crossTileID];En&&(this.variableOffsets[gi.crossTileID]=En,this.markUsedJustification(Ue,En.anchor,gi,on))}}}if(Su=Sl,vs=Su&&Su.placeable,yl=Su&&Su.offscreen,gi.useRuntimeCollisionCircles){const Ot=Ue.text.placedSymbolArray.get(gi.centerJustifiedTextSymbolIndex),Wt=r.ai(Ue.textSizeData,dt,Ot),dr=Ke.get("text-padding");Ys=this.collisionIndex.placeCollisionCircles(Ut,Ot,Ue.lineVertexArray,Ue.glyphOffsetArray,Wt,ir,Tr,Or,Vr,Oe,sn,St.predicate,gi.collisionCircleDiameter,dr,It,Ua),Ys.circles.length&&Ys.collisionDetected&&!Oe&&r.w("Collisions detected, but collision boxes are not shown"),vs=er||Ys.circles.length>0&&!Ys.collisionDetected,yl=yl&&Ys.offscreen}if(Mi.iconFeatureIndex&&(mf=Mi.iconFeatureIndex),Mi.iconBox){const Ot=Wt=>this.collisionIndex.placeCollisionBox(Wt,Mr,vn,ir,Tr,sn,jr,$t,St.predicate,Ua,xn&&Xs?Xs:void 0);Ou&&Ou.placeable&&Mi.verticalIconBox?(Zs=Ot(Mi.verticalIconBox),ml=Zs.placeable):(Zs=Ot(Mi.iconBox),ml=Zs.placeable),yl=yl&&Zs.offscreen}const Ye=Rt||gi.numHorizontalGlyphVertices===0&&gi.numVerticalGlyphVertices===0,pt=Yt||gi.numIconVertices===0;Ye||pt?pt?Ye||(ml=ml&&vs):vs=ml&&vs:ml=vs=ml&&vs;const Dt=ml&&Zs.placeable;if(vs&&Su.placeable&&this.collisionIndex.insertCollisionBox(Su.box,Ut,Ke.get("text-ignore-placement"),Ue.bucketInstanceId,Ou&&Ou.placeable&&Pc?Pc:Qu,St.ID),Dt&&this.collisionIndex.insertCollisionBox(Zs.box,Mr,Ke.get("icon-ignore-placement"),Ue.bucketInstanceId,mf,St.ID),Ys&&vs&&this.collisionIndex.insertCollisionCircles(Ys.circles,Ut,Ke.get("text-ignore-placement"),Ue.bucketInstanceId,Qu,St.ID),Oe&&this.storeCollisionData(Ue.bucketInstanceId,Ao,Mi,Su,Zs,Ys),gi.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Ue.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[gi.crossTileID]=new xa(vs||Wn,ml||ua,yl||Ue.justReloaded),ve[gi.crossTileID]=!0};if($n){if(N.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const gi=Ue.getSortedSymbolIndexes(this.transform.angle);for(let Mi=gi.length-1;Mi>=0;--Mi){const Ao=gi[Mi];Si(Ue.symbolInstances.get(Ao),Ue.collisionArrays[Ao],Ao)}}else for(let gi=N.symbolInstanceStart;gi=0&&(N.text.placedSymbolArray.get($t).crossTileID=Ke>=0&&$t!==Ke?0:Oe.crossTileID)}markUsedOrientation(N,ve,Oe){const Ue=ve===r.ah.horizontal||ve===r.ah.horizontalOnly?ve:0,Ke=ve===r.ah.vertical?ve:0,It=[Oe.leftJustifiedTextSymbolIndex,Oe.centerJustifiedTextSymbolIndex,Oe.rightJustifiedTextSymbolIndex];for(const $t of It)N.text.placedSymbolArray.get($t).placedOrientation=Ue;Oe.verticalPlacedTextSymbolIndex&&(N.text.placedSymbolArray.get(Oe.verticalPlacedTextSymbolIndex).placedOrientation=Ke)}commit(N){this.commitTime=N,this.zoomAtLastRecencyCheck=this.transform.zoom;const ve=this.prevPlacement;let Oe=!1;this.prevZoomAdjustment=ve?ve.zoomAdjustment(this.transform.zoom):0;const Ue=ve?ve.symbolFadeChange(N):1,Ke=ve?ve.opacities:{},It=ve?ve.variableOffsets:{},$t=ve?ve.placedOrientations:{};for(const ir in this.placements){const Tr=this.placements[ir],Or=Ke[ir];Or?(this.opacities[ir]=new _a(Or,Ue,Tr.text,Tr.icon),Oe=Oe||Tr.text!==Or.text.placed||Tr.icon!==Or.icon.placed):(this.opacities[ir]=new _a(null,Ue,Tr.text,Tr.icon,Tr.skipFade),Oe=Oe||Tr.text||Tr.icon)}for(const ir in Ke){const Tr=Ke[ir];if(!this.opacities[ir]){const Or=new _a(Tr,Ue,!1,!1);Or.isHidden()||(this.opacities[ir]=Or,Oe=Oe||Tr.text.placed||Tr.icon.placed)}}for(const ir in It)this.variableOffsets[ir]||!this.opacities[ir]||this.opacities[ir].isHidden()||(this.variableOffsets[ir]=It[ir]);for(const ir in $t)this.placedOrientations[ir]||!this.opacities[ir]||this.opacities[ir].isHidden()||(this.placedOrientations[ir]=$t[ir]);if(ve&&ve.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Oe?this.lastPlacementChangeTime=N:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ve?ve.lastPlacementChangeTime:N)}updateLayerOpacities(N,ve){const Oe={};for(const Ue of ve){const Ke=Ue.getBucket(N);Ke&&Ue.latestFeatureIndex&&N.id===Ke.layerIds[0]&&this.updateBucketOpacities(Ke,Ue.tileID,Oe,Ue.collisionBoxArray)}}updateBucketOpacities(N,ve,Oe,Ue){N.hasTextData()&&(N.text.opacityVertexArray.clear(),N.text.hasVisibleVertices=!1),N.hasIconData()&&(N.icon.opacityVertexArray.clear(),N.icon.hasVisibleVertices=!1),N.hasIconCollisionBoxData()&&N.iconCollisionBox.collisionVertexArray.clear(),N.hasTextCollisionBoxData()&&N.textCollisionBox.collisionVertexArray.clear();const Ke=N.layers[0],It=Ke.layout,$t=new _a(null,0,!1,!1,!0),ir=It.get("text-allow-overlap"),Tr=It.get("icon-allow-overlap"),Or=Ke._unevaluatedLayout.hasValue("text-variable-anchor")||Ke._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Vr=It.get("text-rotation-alignment")==="map",vn=It.get("text-pitch-alignment")==="map",Dn=It.get("icon-text-fit")!=="none",ot=new _a(null,0,ir&&(Tr||!N.hasIconData()||It.get("icon-optional")),Tr&&(ir||!N.hasTextData()||It.get("text-optional")),!0);!N.collisionArrays&&Ue&&(N.hasIconCollisionBoxData()||N.hasTextCollisionBoxData())&&N.deserializeCollisionBoxes(Ue);const dt=(Rt,Yt,Ut)=>{for(let er=0;er0,sn=this.placedOrientations[Yt.crossTileID],xn=sn===r.ah.vertical,$n=sn===r.ah.horizontal||sn===r.ah.horizontalOnly;if(Ut>0||er>0){const ua=La(Nr.text);dt(N.text,Ut,xn?Oa:ua),dt(N.text,er,$n?Oa:ua);const Ua=Nr.text.isHidden();[Yt.rightJustifiedTextSymbolIndex,Yt.centerJustifiedTextSymbolIndex,Yt.leftJustifiedTextSymbolIndex].forEach(Mi=>{Mi>=0&&(N.text.placedSymbolArray.get(Mi).hidden=Ua||xn?1:0)}),Yt.verticalPlacedTextSymbolIndex>=0&&(N.text.placedSymbolArray.get(Yt.verticalPlacedTextSymbolIndex).hidden=Ua||$n?1:0);const Si=this.variableOffsets[Yt.crossTileID];Si&&this.markUsedJustification(N,Si.anchor,Yt,sn);const gi=this.placedOrientations[Yt.crossTileID];gi&&(this.markUsedJustification(N,"left",Yt,gi),this.markUsedOrientation(N,gi,Yt))}if(jr){const ua=La(Nr.icon),Ua=!(Dn&&Yt.verticalPlacedIconSymbolIndex&&xn);Yt.placedIconSymbolIndex>=0&&(dt(N.icon,Yt.numIconVertices,Ua?ua:Oa),N.icon.placedSymbolArray.get(Yt.placedIconSymbolIndex).hidden=Nr.icon.isHidden()),Yt.verticalPlacedIconSymbolIndex>=0&&(dt(N.icon,Yt.numVerticalIconVertices,Ua?Oa:ua),N.icon.placedSymbolArray.get(Yt.verticalPlacedIconSymbolIndex).hidden=Nr.icon.isHidden())}const Wn=St&&St.has(Rt)?St.get(Rt):{text:null,icon:null};if(N.hasIconCollisionBoxData()||N.hasTextCollisionBoxData()){const ua=N.collisionArrays[Rt];if(ua){let Ua=new r.P(0,0);if(ua.textBox||ua.verticalTextBox){let Si=!0;if(Or){const gi=this.variableOffsets[Mr];gi?(Ua=_r(gi.anchor,gi.width,gi.height,gi.textOffset,gi.textBoxScale),Vr&&Ua._rotate(vn?this.transform.angle:-this.transform.angle)):Si=!1}if(ua.textBox||ua.verticalTextBox){let gi;ua.textBox&&(gi=xn),ua.verticalTextBox&&(gi=$n),yr(N.textCollisionBox.collisionVertexArray,Nr.text.placed,!Si||gi,Wn.text,Ua.x,Ua.y)}}if(ua.iconBox||ua.verticalIconBox){const Si=!!(!$n&&ua.verticalIconBox);let gi;ua.iconBox&&(gi=Si),ua.verticalIconBox&&(gi=!Si),yr(N.iconCollisionBox.collisionVertexArray,Nr.icon.placed,gi,Wn.icon,Dn?Ua.x:0,Dn?Ua.y:0)}}}}if(N.sortFeatures(this.transform.angle),this.retainedQueryData[N.bucketInstanceId]&&(this.retainedQueryData[N.bucketInstanceId].featureSortOrder=N.featureSortOrder),N.hasTextData()&&N.text.opacityVertexBuffer&&N.text.opacityVertexBuffer.updateData(N.text.opacityVertexArray),N.hasIconData()&&N.icon.opacityVertexBuffer&&N.icon.opacityVertexBuffer.updateData(N.icon.opacityVertexArray),N.hasIconCollisionBoxData()&&N.iconCollisionBox.collisionVertexBuffer&&N.iconCollisionBox.collisionVertexBuffer.updateData(N.iconCollisionBox.collisionVertexArray),N.hasTextCollisionBoxData()&&N.textCollisionBox.collisionVertexBuffer&&N.textCollisionBox.collisionVertexBuffer.updateData(N.textCollisionBox.collisionVertexArray),N.text.opacityVertexArray.length!==N.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${N.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${N.text.layoutVertexArray.length}) / 4`);if(N.icon.opacityVertexArray.length!==N.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${N.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${N.icon.layoutVertexArray.length}) / 4`);if(N.bucketInstanceId in this.collisionCircleArrays){const Rt=this.collisionCircleArrays[N.bucketInstanceId];N.placementInvProjMatrix=Rt.invProjMatrix,N.placementViewportMatrix=Rt.viewportMatrix,N.collisionCircleArray=Rt.circles,delete this.collisionCircleArrays[N.bucketInstanceId]}}symbolFadeChange(N){return this.fadeDuration===0?1:(N-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(N){return Math.max(0,(this.transform.zoom-N)/1.5)}hasTransitions(N){return this.stale||N-this.lastPlacementChangeTimeN}setStale(){this.stale=!0}}function yr(Qe,N,ve,Oe,Ue,Ke){Oe&&Oe.length!==0||(Oe=[0,0,0,0]);const It=Oe[0]-Jr,$t=Oe[1]-Jr,ir=Oe[2]-Jr,Tr=Oe[3]-Jr;Qe.emplaceBack(N?1:0,ve?1:0,Ue||0,Ke||0,It,$t),Qe.emplaceBack(N?1:0,ve?1:0,Ue||0,Ke||0,ir,$t),Qe.emplaceBack(N?1:0,ve?1:0,Ue||0,Ke||0,ir,Tr),Qe.emplaceBack(N?1:0,ve?1:0,Ue||0,Ke||0,It,Tr)}const br=Math.pow(2,25),an=Math.pow(2,24),bn=Math.pow(2,17),In=Math.pow(2,16),Fn=Math.pow(2,9),va=Math.pow(2,8),Pa=Math.pow(2,1);function La(Qe){if(Qe.opacity===0&&!Qe.placed)return 0;if(Qe.opacity===1&&Qe.placed)return 4294967295;const N=Qe.placed?1:0,ve=Math.floor(127*Qe.opacity);return ve*br+N*an+ve*bn+N*In+ve*Fn+N*va+ve*Pa+N}const Oa=0;function Wa(){return{isOccluded:(Qe,N,ve)=>!1,getPitchedTextCorrection:(Qe,N,ve)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Qe,N,ve,Oe){throw new Error("Not implemented.")},translatePosition:(Qe,N,ve,Oe)=>(function(Ue,Ke,It,$t,ir=!1){if(!It[0]&&!It[1])return[0,0];const Tr=ir?$t==="map"?Ue.angle:0:$t==="viewport"?-Ue.angle:0;if(Tr){const Or=Math.sin(Tr),Vr=Math.cos(Tr);It=[It[0]*Vr-It[1]*Or,It[0]*Or+It[1]*Vr]}return[ir?It[0]:ha(Ke,It[0],Ue.zoom),ir?It[1]:ha(Ke,It[1],Ue.zoom)]})(Qe,N,ve,Oe),getCircleRadiusCorrection:Qe=>1}}class sa{constructor(N){this._sortAcrossTiles=N.layout.get("symbol-z-order")!=="viewport-y"&&!N.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(N,ve,Oe,Ue,Ke){const It=this._bucketParts;for(;this._currentTileIndex$t.sortKey-ir.sortKey));this._currentPartIndex!this._forceFullPlacement&&s.now()-Ue>2;for(;this._currentPlacementIndex>=0;){const It=ve[N[this._currentPlacementIndex]],$t=this.placement.collisionIndex.transform.zoom;if(It.type==="symbol"&&(!It.minzoom||It.minzoom<=$t)&&(!It.maxzoom||It.maxzoom>$t)){if(this._inProgressLayer||(this._inProgressLayer=new sa(It)),this._inProgressLayer.continuePlacement(Oe[It.source],this.placement,this._showCollisionBoxes,It,Ke))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(N){return this.placement.commit(N),this.placement}}const Qi=512/r.X/2;class Xt{constructor(N,ve,Oe){this.tileID=N,this.bucketInstanceId=Oe,this._symbolsByKey={};const Ue=new Map;for(let Ke=0;Ke({x:Math.floor(ir.anchorX*Qi),y:Math.floor(ir.anchorY*Qi)})),crossTileIDs:It.map(ir=>ir.crossTileID)};if($t.positions.length>128){const ir=new r.av($t.positions.length,16,Uint16Array);for(const{x:Tr,y:Or}of $t.positions)ir.add(Tr,Or);ir.finish(),delete $t.positions,$t.index=ir}this._symbolsByKey[Ke]=$t}}getScaledCoordinates(N,ve){const{x:Oe,y:Ue,z:Ke}=this.tileID.canonical,{x:It,y:$t,z:ir}=ve.canonical,Tr=Qi/Math.pow(2,ir-Ke),Or=($t*r.X+N.anchorY)*Tr,Vr=Ue*r.X*Qi;return{x:Math.floor((It*r.X+N.anchorX)*Tr-Oe*r.X*Qi),y:Math.floor(Or-Vr)}}findMatches(N,ve,Oe){const Ue=this.tileID.canonical.zN)}}class Lt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class $r{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(N){const ve=Math.round((N-this.lng)/360);if(ve!==0)for(const Oe in this.indexes){const Ue=this.indexes[Oe],Ke={};for(const It in Ue){const $t=Ue[It];$t.tileID=$t.tileID.unwrapTo($t.tileID.wrap+ve),Ke[$t.tileID.key]=$t}this.indexes[Oe]=Ke}this.lng=N}addBucket(N,ve,Oe){if(this.indexes[N.overscaledZ]&&this.indexes[N.overscaledZ][N.key]){if(this.indexes[N.overscaledZ][N.key].bucketInstanceId===ve.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(N.overscaledZ,this.indexes[N.overscaledZ][N.key])}for(let Ke=0;KeN.overscaledZ)for(const $t in It){const ir=It[$t];ir.tileID.isChildOf(N)&&ir.findMatches(ve.symbolInstances,N,Ue)}else{const $t=It[N.scaledTo(Number(Ke)).key];$t&&$t.findMatches(ve.symbolInstances,N,Ue)}}for(let Ke=0;Ke{ve[Oe]=!0});for(const Oe in this.layerIndexes)ve[Oe]||delete this.layerIndexes[Oe]}}const rn=(Qe,N)=>r.t(Qe,N&&N.filter(ve=>ve.identifier!=="source.canvas")),Wr=r.aw();class tn extends r.E{constructor(N,ve={}){super(),this._rtlPluginLoaded=()=>{for(const Oe in this.sourceCaches){const Ue=this.sourceCaches[Oe].getSource().type;Ue!=="vector"&&Ue!=="geojson"||this.sourceCaches[Oe].reload()}},this.map=N,this.dispatcher=new ce(se(),N._getMapId()),this.dispatcher.registerMessageHandler("GG",(Oe,Ue)=>this.getGlyphs(Oe,Ue)),this.dispatcher.registerMessageHandler("GI",(Oe,Ue)=>this.getImages(Oe,Ue)),this.imageManager=new w,this.imageManager.setEventedParent(this),this.glyphManager=new V(N._requestManager,ve.localIdeographFontFamily),this.lineAtlas=new ee(256,512),this.crossTileSymbolIndex=new en,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new r.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",r.ay()),_t().on(ze,this._rtlPluginLoaded),this.on("data",Oe=>{if(Oe.dataType!=="source"||Oe.sourceDataType!=="metadata")return;const Ue=this.sourceCaches[Oe.sourceId];if(!Ue)return;const Ke=Ue.getSource();if(Ke&&Ke.vectorLayerIds)for(const It in this._layers){const $t=this._layers[It];$t.source===Ke.id&&this._validateLayer($t)}})}loadURL(N,ve={},Oe){this.fire(new r.k("dataloading",{dataType:"style"})),ve.validate=typeof ve.validate!="boolean"||ve.validate;const Ue=this.map._requestManager.transformRequest(N,"Style");this._loadStyleRequest=new AbortController;const Ke=this._loadStyleRequest;r.h(Ue,this._loadStyleRequest).then(It=>{this._loadStyleRequest=null,this._load(It.data,ve,Oe)}).catch(It=>{this._loadStyleRequest=null,It&&!Ke.signal.aborted&&this.fire(new r.j(It))})}loadJSON(N,ve={},Oe){this.fire(new r.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,s.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,ve.validate=ve.validate!==!1,this._load(N,ve,Oe)}).catch(()=>{})}loadEmpty(){this.fire(new r.k("dataloading",{dataType:"style"})),this._load(Wr,{validate:!1})}_load(N,ve,Oe){var Ue;const Ke=ve.transformStyle?ve.transformStyle(Oe,N):N;if(!ve.validate||!rn(this,r.u(Ke))){this._loaded=!0,this.stylesheet=Ke;for(const It in Ke.sources)this.addSource(It,Ke.sources[It],{validate:!1});Ke.sprite?this._loadSprite(Ke.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Ke.glyphs),this._createLayers(),this.light=new O(this.stylesheet.light),this.sky=new W(this.stylesheet.sky),this.map.setTerrain((Ue=this.stylesheet.terrain)!==null&&Ue!==void 0?Ue:null),this.fire(new r.k("data",{dataType:"style"})),this.fire(new r.k("style.load"))}}_createLayers(){const N=r.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",N),this._order=N.map(ve=>ve.id),this._layers={},this._serializedLayers=null;for(const ve of N){const Oe=r.aA(ve);Oe.setEventedParent(this,{layer:{id:ve.id}}),this._layers[ve.id]=Oe}}_loadSprite(N,ve=!1,Oe=void 0){let Ue;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,(function(Ke,It,$t,ir){return r._(this,void 0,void 0,function*(){const Tr=E(Ke),Or=$t>1?"@2x":"",Vr={},vn={};for(const{id:Dn,url:ot}of Tr){const dt=It.transformRequest(_(ot,Or,".json"),"SpriteJSON");Vr[Dn]=r.h(dt,ir);const St=It.transformRequest(_(ot,Or,".png"),"SpriteImage");vn[Dn]=f.getImage(St,ir)}return yield Promise.all([...Object.values(Vr),...Object.values(vn)]),(function(Dn,ot){return r._(this,void 0,void 0,function*(){const dt={};for(const St in Dn){dt[St]={};const Rt=s.getImageCanvasContext((yield ot[St]).data),Yt=(yield Dn[St]).data;for(const Ut in Yt){const{width:er,height:Mr,x:Nr,y:jr,sdf:sn,pixelRatio:xn,stretchX:$n,stretchY:Wn,content:ua,textFitWidth:Ua,textFitHeight:Si}=Yt[Ut];dt[St][Ut]={data:null,pixelRatio:xn,sdf:sn,stretchX:$n,stretchY:Wn,content:ua,textFitWidth:Ua,textFitHeight:Si,spriteData:{width:er,height:Mr,x:Nr,y:jr,context:Rt}}}}return dt})})(Vr,vn)})})(N,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Ke=>{if(this._spriteRequest=null,Ke)for(const It in Ke){this._spritesImagesIds[It]=[];const $t=this._spritesImagesIds[It]?this._spritesImagesIds[It].filter(ir=>!(ir in Ke)):[];for(const ir of $t)this.imageManager.removeImage(ir),this._changedImages[ir]=!0;for(const ir in Ke[It]){const Tr=It==="default"?ir:`${It}:${ir}`;this._spritesImagesIds[It].push(Tr),Tr in this.imageManager.images?this.imageManager.updateImage(Tr,Ke[It][ir],!1):this.imageManager.addImage(Tr,Ke[It][ir]),ve&&(this._changedImages[Tr]=!0)}}}).catch(Ke=>{this._spriteRequest=null,Ue=Ke,this.fire(new r.j(Ue))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),ve&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new r.k("data",{dataType:"style"})),Oe&&Oe(Ue)})}_unloadSprite(){for(const N of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(N),this._changedImages[N]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new r.k("data",{dataType:"style"}))}_validateLayer(N){const ve=this.sourceCaches[N.source];if(!ve)return;const Oe=N.sourceLayer;if(!Oe)return;const Ue=ve.getSource();(Ue.type==="geojson"||Ue.vectorLayerIds&&Ue.vectorLayerIds.indexOf(Oe)===-1)&&this.fire(new r.j(new Error(`Source layer "${Oe}" does not exist on source "${Ue.id}" as specified by style layer "${N.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const N in this.sourceCaches)if(!this.sourceCaches[N].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(N,ve=!1){const Oe=this._serializedAllLayers();if(!N||N.length===0)return Object.values(ve?r.aB(Oe):Oe);const Ue=[];for(const Ke of N)if(Oe[Ke]){const It=ve?r.aB(Oe[Ke]):Oe[Ke];Ue.push(It)}return Ue}_serializedAllLayers(){let N=this._serializedLayers;if(N)return N;N=this._serializedLayers={};const ve=Object.keys(this._layers);for(const Oe of ve){const Ue=this._layers[Oe];Ue.type!=="custom"&&(N[Oe]=Ue.serialize())}return N}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const N in this.sourceCaches)if(this.sourceCaches[N].hasTransition())return!0;for(const N in this._layers)if(this._layers[N].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(N){if(!this._loaded)return;const ve=this._changed;if(ve){const Ue=Object.keys(this._updatedLayers),Ke=Object.keys(this._removedLayers);(Ue.length||Ke.length)&&this._updateWorkerLayers(Ue,Ke);for(const It in this._updatedSources){const $t=this._updatedSources[It];if($t==="reload")this._reloadSource(It);else{if($t!=="clear")throw new Error(`Invalid action ${$t}`);this._clearSource(It)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const It in this._updatedPaintProps)this._layers[It].updateTransitions(N);this.light.updateTransitions(N),this.sky.updateTransitions(N),this._resetUpdates()}const Oe={};for(const Ue in this.sourceCaches){const Ke=this.sourceCaches[Ue];Oe[Ue]=Ke.used,Ke.used=!1}for(const Ue of this._order){const Ke=this._layers[Ue];Ke.recalculate(N,this._availableImages),!Ke.isHidden(N.zoom)&&Ke.source&&(this.sourceCaches[Ke.source].used=!0)}for(const Ue in Oe){const Ke=this.sourceCaches[Ue];!!Oe[Ue]!=!!Ke.used&&Ke.fire(new r.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Ue}))}this.light.recalculate(N),this.sky.recalculate(N),this.z=N.zoom,ve&&this.fire(new r.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const N=Object.keys(this._changedImages);if(N.length){for(const ve in this.sourceCaches)this.sourceCaches[ve].reloadTilesForDependencies(["icons","patterns"],N);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const N in this.sourceCaches)this.sourceCaches[N].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(N,ve){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(N,!1),removedIds:ve})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(N,ve={}){var Oe;this._checkLoaded();const Ue=this.serialize();if(N=ve.transformStyle?ve.transformStyle(Ue,N):N,((Oe=ve.validate)===null||Oe===void 0||Oe)&&rn(this,r.u(N)))return!1;(N=r.aB(N)).layers=r.az(N.layers);const Ke=r.aC(Ue,N),It=this._getOperationsToPerform(Ke);if(It.unimplemented.length>0)throw new Error(`Unimplemented: ${It.unimplemented.join(", ")}.`);if(It.operations.length===0)return!1;for(const $t of It.operations)$t();return this.stylesheet=N,this._serializedLayers=null,!0}_getOperationsToPerform(N){const ve=[],Oe=[];for(const Ue of N)switch(Ue.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":ve.push(()=>this.addLayer.apply(this,Ue.args));break;case"removeLayer":ve.push(()=>this.removeLayer.apply(this,Ue.args));break;case"setPaintProperty":ve.push(()=>this.setPaintProperty.apply(this,Ue.args));break;case"setLayoutProperty":ve.push(()=>this.setLayoutProperty.apply(this,Ue.args));break;case"setFilter":ve.push(()=>this.setFilter.apply(this,Ue.args));break;case"addSource":ve.push(()=>this.addSource.apply(this,Ue.args));break;case"removeSource":ve.push(()=>this.removeSource.apply(this,Ue.args));break;case"setLayerZoomRange":ve.push(()=>this.setLayerZoomRange.apply(this,Ue.args));break;case"setLight":ve.push(()=>this.setLight.apply(this,Ue.args));break;case"setGeoJSONSourceData":ve.push(()=>this.setGeoJSONSourceData.apply(this,Ue.args));break;case"setGlyphs":ve.push(()=>this.setGlyphs.apply(this,Ue.args));break;case"setSprite":ve.push(()=>this.setSprite.apply(this,Ue.args));break;case"setSky":ve.push(()=>this.setSky.apply(this,Ue.args));break;case"setTerrain":ve.push(()=>this.map.setTerrain.apply(this,Ue.args));break;case"setTransition":ve.push(()=>{});break;default:Oe.push(Ue.command)}return{operations:ve,unimplemented:Oe}}addImage(N,ve){if(this.getImage(N))return this.fire(new r.j(new Error(`An image named "${N}" already exists.`)));this.imageManager.addImage(N,ve),this._afterImageUpdated(N)}updateImage(N,ve){this.imageManager.updateImage(N,ve)}getImage(N){return this.imageManager.getImage(N)}removeImage(N){if(!this.getImage(N))return this.fire(new r.j(new Error(`An image named "${N}" does not exist.`)));this.imageManager.removeImage(N),this._afterImageUpdated(N)}_afterImageUpdated(N){this._availableImages=this.imageManager.listImages(),this._changedImages[N]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new r.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(N,ve,Oe={}){if(this._checkLoaded(),this.sourceCaches[N]!==void 0)throw new Error(`Source "${N}" already exists.`);if(!ve.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(ve).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(ve.type)>=0&&this._validate(r.u.source,`sources.${N}`,ve,null,Oe))return;this.map&&this.map._collectResourceTiming&&(ve.collectResourceTiming=!0);const Ue=this.sourceCaches[N]=new Qt(N,ve,this.dispatcher);Ue.style=this,Ue.setEventedParent(this,()=>({isSourceLoaded:Ue.loaded(),source:Ue.serialize(),sourceId:N})),Ue.onAdd(this.map),this._changed=!0}removeSource(N){if(this._checkLoaded(),this.sourceCaches[N]===void 0)throw new Error("There is no source with this ID");for(const Oe in this._layers)if(this._layers[Oe].source===N)return this.fire(new r.j(new Error(`Source "${N}" cannot be removed while layer "${Oe}" is using it.`)));const ve=this.sourceCaches[N];delete this.sourceCaches[N],delete this._updatedSources[N],ve.fire(new r.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:N})),ve.setEventedParent(null),ve.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(N,ve){if(this._checkLoaded(),this.sourceCaches[N]===void 0)throw new Error(`There is no source with this ID=${N}`);const Oe=this.sourceCaches[N].getSource();if(Oe.type!=="geojson")throw new Error(`geojsonSource.type is ${Oe.type}, which is !== 'geojson`);Oe.setData(ve),this._changed=!0}getSource(N){return this.sourceCaches[N]&&this.sourceCaches[N].getSource()}addLayer(N,ve,Oe={}){this._checkLoaded();const Ue=N.id;if(this.getLayer(Ue))return void this.fire(new r.j(new Error(`Layer "${Ue}" already exists on this map.`)));let Ke;if(N.type==="custom"){if(rn(this,r.aD(N)))return;Ke=r.aA(N)}else{if("source"in N&&typeof N.source=="object"&&(this.addSource(Ue,N.source),N=r.aB(N),N=r.e(N,{source:Ue})),this._validate(r.u.layer,`layers.${Ue}`,N,{arrayIndex:-1},Oe))return;Ke=r.aA(N),this._validateLayer(Ke),Ke.setEventedParent(this,{layer:{id:Ue}})}const It=ve?this._order.indexOf(ve):this._order.length;if(ve&&It===-1)this.fire(new r.j(new Error(`Cannot add layer "${Ue}" before non-existing layer "${ve}".`)));else{if(this._order.splice(It,0,Ue),this._layerOrderChanged=!0,this._layers[Ue]=Ke,this._removedLayers[Ue]&&Ke.source&&Ke.type!=="custom"){const $t=this._removedLayers[Ue];delete this._removedLayers[Ue],$t.type!==Ke.type?this._updatedSources[Ke.source]="clear":(this._updatedSources[Ke.source]="reload",this.sourceCaches[Ke.source].pause())}this._updateLayer(Ke),Ke.onAdd&&Ke.onAdd(this.map)}}moveLayer(N,ve){if(this._checkLoaded(),this._changed=!0,!this._layers[N])return void this.fire(new r.j(new Error(`The layer '${N}' does not exist in the map's style and cannot be moved.`)));if(N===ve)return;const Oe=this._order.indexOf(N);this._order.splice(Oe,1);const Ue=ve?this._order.indexOf(ve):this._order.length;ve&&Ue===-1?this.fire(new r.j(new Error(`Cannot move layer "${N}" before non-existing layer "${ve}".`))):(this._order.splice(Ue,0,N),this._layerOrderChanged=!0)}removeLayer(N){this._checkLoaded();const ve=this._layers[N];if(!ve)return void this.fire(new r.j(new Error(`Cannot remove non-existing layer "${N}".`)));ve.setEventedParent(null);const Oe=this._order.indexOf(N);this._order.splice(Oe,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[N]=ve,delete this._layers[N],this._serializedLayers&&delete this._serializedLayers[N],delete this._updatedLayers[N],delete this._updatedPaintProps[N],ve.onRemove&&ve.onRemove(this.map)}getLayer(N){return this._layers[N]}getLayersOrder(){return[...this._order]}hasLayer(N){return N in this._layers}setLayerZoomRange(N,ve,Oe){this._checkLoaded();const Ue=this.getLayer(N);Ue?Ue.minzoom===ve&&Ue.maxzoom===Oe||(ve!=null&&(Ue.minzoom=ve),Oe!=null&&(Ue.maxzoom=Oe),this._updateLayer(Ue)):this.fire(new r.j(new Error(`Cannot set the zoom range of non-existing layer "${N}".`)))}setFilter(N,ve,Oe={}){this._checkLoaded();const Ue=this.getLayer(N);if(Ue){if(!r.aE(Ue.filter,ve))return ve==null?(Ue.filter=void 0,void this._updateLayer(Ue)):void(this._validate(r.u.filter,`layers.${Ue.id}.filter`,ve,null,Oe)||(Ue.filter=r.aB(ve),this._updateLayer(Ue)))}else this.fire(new r.j(new Error(`Cannot filter non-existing layer "${N}".`)))}getFilter(N){return r.aB(this.getLayer(N).filter)}setLayoutProperty(N,ve,Oe,Ue={}){this._checkLoaded();const Ke=this.getLayer(N);Ke?r.aE(Ke.getLayoutProperty(ve),Oe)||(Ke.setLayoutProperty(ve,Oe,Ue),this._updateLayer(Ke)):this.fire(new r.j(new Error(`Cannot style non-existing layer "${N}".`)))}getLayoutProperty(N,ve){const Oe=this.getLayer(N);if(Oe)return Oe.getLayoutProperty(ve);this.fire(new r.j(new Error(`Cannot get style of non-existing layer "${N}".`)))}setPaintProperty(N,ve,Oe,Ue={}){this._checkLoaded();const Ke=this.getLayer(N);Ke?r.aE(Ke.getPaintProperty(ve),Oe)||(Ke.setPaintProperty(ve,Oe,Ue)&&this._updateLayer(Ke),this._changed=!0,this._updatedPaintProps[N]=!0,this._serializedLayers=null):this.fire(new r.j(new Error(`Cannot style non-existing layer "${N}".`)))}getPaintProperty(N,ve){return this.getLayer(N).getPaintProperty(ve)}setFeatureState(N,ve){this._checkLoaded();const Oe=N.source,Ue=N.sourceLayer,Ke=this.sourceCaches[Oe];if(Ke===void 0)return void this.fire(new r.j(new Error(`The source '${Oe}' does not exist in the map's style.`)));const It=Ke.getSource().type;It==="geojson"&&Ue?this.fire(new r.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):It!=="vector"||Ue?(N.id===void 0&&this.fire(new r.j(new Error("The feature id parameter must be provided."))),Ke.setFeatureState(Ue,N.id,ve)):this.fire(new r.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(N,ve){this._checkLoaded();const Oe=N.source,Ue=this.sourceCaches[Oe];if(Ue===void 0)return void this.fire(new r.j(new Error(`The source '${Oe}' does not exist in the map's style.`)));const Ke=Ue.getSource().type,It=Ke==="vector"?N.sourceLayer:void 0;Ke!=="vector"||It?ve&&typeof N.id!="string"&&typeof N.id!="number"?this.fire(new r.j(new Error("A feature id is required to remove its specific state property."))):Ue.removeFeatureState(It,N.id,ve):this.fire(new r.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(N){this._checkLoaded();const ve=N.source,Oe=N.sourceLayer,Ue=this.sourceCaches[ve];if(Ue!==void 0)return Ue.getSource().type!=="vector"||Oe?(N.id===void 0&&this.fire(new r.j(new Error("The feature id parameter must be provided."))),Ue.getFeatureState(Oe,N.id)):void this.fire(new r.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new r.j(new Error(`The source '${ve}' does not exist in the map's style.`)))}getTransition(){return r.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const N=r.aF(this.sourceCaches,Ke=>Ke.serialize()),ve=this._serializeByIds(this._order,!0),Oe=this.map.getTerrain()||void 0,Ue=this.stylesheet;return r.aG({version:Ue.version,name:Ue.name,metadata:Ue.metadata,light:Ue.light,sky:Ue.sky,center:Ue.center,zoom:Ue.zoom,bearing:Ue.bearing,pitch:Ue.pitch,sprite:Ue.sprite,glyphs:Ue.glyphs,transition:Ue.transition,sources:N,layers:ve,terrain:Oe},Ke=>Ke!==void 0)}_updateLayer(N){this._updatedLayers[N.id]=!0,N.source&&!this._updatedSources[N.source]&&this.sourceCaches[N.source].getSource().type!=="raster"&&(this._updatedSources[N.source]="reload",this.sourceCaches[N.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(N){const ve=It=>this._layers[It].type==="fill-extrusion",Oe={},Ue=[];for(let It=this._order.length-1;It>=0;It--){const $t=this._order[It];if(ve($t)){Oe[$t]=It;for(const ir of N){const Tr=ir[$t];if(Tr)for(const Or of Tr)Ue.push(Or)}}}Ue.sort((It,$t)=>$t.intersectionZ-It.intersectionZ);const Ke=[];for(let It=this._order.length-1;It>=0;It--){const $t=this._order[It];if(ve($t))for(let ir=Ue.length-1;ir>=0;ir--){const Tr=Ue[ir].feature;if(Oe[Tr.layer.id]{const sn=Rt.featureSortOrder;if(sn){const xn=sn.indexOf(Nr.featureIndex);return sn.indexOf(jr.featureIndex)-xn}return jr.featureIndex-Nr.featureIndex});for(const Nr of Mr)er.push(Nr)}}for(const Rt in ot)ot[Rt].forEach(Yt=>{const Ut=Yt.feature,er=Tr[$t[Rt].source].getFeatureState(Ut.layer["source-layer"],Ut.id);Ut.source=Ut.layer.source,Ut.layer["source-layer"]&&(Ut.sourceLayer=Ut.layer["source-layer"]),Ut.state=er});return ot})(this._layers,It,this.sourceCaches,N,ve,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Ke)}querySourceFeatures(N,ve){ve&&ve.filter&&this._validate(r.u.filter,"querySourceFeatures.filter",ve.filter,null,ve);const Oe=this.sourceCaches[N];return Oe?(function(Ue,Ke){const It=Ue.getRenderableIds().map(Tr=>Ue.getTileByID(Tr)),$t=[],ir={};for(let Tr=0;Trvn.getTileByID(Dn)).sort((Dn,ot)=>ot.tileID.overscaledZ-Dn.tileID.overscaledZ||(Dn.tileID.isLessThan(ot.tileID)?-1:1))}const Vr=this.crossTileSymbolIndex.addLayer(Or,ir[Or.source],N.center.lng);It=It||Vr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Ke=Ke||this._layerOrderChanged||Oe===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.now(),N.zoom))&&(this.pauseablePlacement=new ji(N,this.map.terrain,this._order,Ke,ve,Oe,Ue,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,ir),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.now()),$t=!0),It&&this.pauseablePlacement.placement.setStale()),$t||It)for(const Tr of this._order){const Or=this._layers[Tr];Or.type==="symbol"&&this.placement.updateLayerOpacities(Or,ir[Or.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.now())}_releaseSymbolFadeTiles(){for(const N in this.sourceCaches)this.sourceCaches[N].releaseSymbolFadeTiles()}getImages(N,ve){return r._(this,void 0,void 0,function*(){const Oe=yield this.imageManager.getImages(ve.icons);this._updateTilesForChangedImages();const Ue=this.sourceCaches[ve.source];return Ue&&Ue.setDependencies(ve.tileID.key,ve.type,ve.icons),Oe})}getGlyphs(N,ve){return r._(this,void 0,void 0,function*(){const Oe=yield this.glyphManager.getGlyphs(ve.stacks),Ue=this.sourceCaches[ve.source];return Ue&&Ue.setDependencies(ve.tileID.key,ve.type,[""]),Oe})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(N,ve={}){this._checkLoaded(),N&&this._validate(r.u.glyphs,"glyphs",N,null,ve)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=N,this.glyphManager.entries={},this.glyphManager.setURL(N))}addSprite(N,ve,Oe={},Ue){this._checkLoaded();const Ke=[{id:N,url:ve}],It=[...E(this.stylesheet.sprite),...Ke];this._validate(r.u.sprite,"sprite",It,null,Oe)||(this.stylesheet.sprite=It,this._loadSprite(Ke,!0,Ue))}removeSprite(N){this._checkLoaded();const ve=E(this.stylesheet.sprite);if(ve.find(Oe=>Oe.id===N)){if(this._spritesImagesIds[N])for(const Oe of this._spritesImagesIds[N])this.imageManager.removeImage(Oe),this._changedImages[Oe]=!0;ve.splice(ve.findIndex(Oe=>Oe.id===N),1),this.stylesheet.sprite=ve.length>0?ve:void 0,delete this._spritesImagesIds[N],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new r.k("data",{dataType:"style"}))}else this.fire(new r.j(new Error(`Sprite "${N}" doesn't exists on this map.`)))}getSprite(){return E(this.stylesheet.sprite)}setSprite(N,ve={},Oe){this._checkLoaded(),N&&this._validate(r.u.sprite,"sprite",N,null,ve)||(this.stylesheet.sprite=N,N?this._loadSprite(N,!0,Oe):(this._unloadSprite(),Oe&&Oe(null)))}}var wn=r.Y([{name:"a_pos",type:"Int16",components:2}]);const dn={prelude:Nt(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 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 +);}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;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:Nt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Nt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Nt(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Nt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Nt(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:Nt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Nt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Nt("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;}","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);}"),debug:Nt("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);}","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,get_elevation(a_pos),1);}"),fill:Nt(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Nt(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Nt(`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; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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;}`),fillPattern:Nt(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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);}`),fillExtrusion:Nt(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),fillExtrusionPattern:Nt(`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; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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 +? a_pos +: 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;}`),hillshadePrepare:Nt(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;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 exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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;}"),hillshade:Nt(`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; +#define PI 3.141592653589793 +void 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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;}"),line:Nt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute 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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:Nt(`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 vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),linePattern:Nt(`#ifdef GL_ES +precision highp float; +#endif +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; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute 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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +float 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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Nt(`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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +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 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute 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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float 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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +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);}`),raster:Nt(`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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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;}"),symbolIcon:Nt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Nt(`#define SDF_PX 8.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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 inner_edge=(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);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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 bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Nt(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,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);}`),terrain:Nt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Nt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:Nt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:Nt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function Nt(Qe,N){const ve=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Oe=N.match(/attribute ([\w]+) ([\w]+)/g),Ue=Qe.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ke=N.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),It=Ke?Ke.concat(Ue):Ue,$t={};return{fragmentSource:Qe=Qe.replace(ve,(ir,Tr,Or,Vr,vn)=>($t[vn]=!0,Tr==="define"?` +#ifndef HAS_UNIFORM_u_${vn} +varying ${Or} ${Vr} ${vn}; +#else +uniform ${Or} ${Vr} u_${vn}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${vn} + ${Or} ${Vr} ${vn} = u_${vn}; +#endif +`)),vertexSource:N=N.replace(ve,(ir,Tr,Or,Vr,vn)=>{const Dn=Vr==="float"?"vec2":"vec4",ot=vn.match(/color/)?"color":Dn;return $t[vn]?Tr==="define"?` +#ifndef HAS_UNIFORM_u_${vn} +uniform lowp float u_${vn}_t; +attribute ${Or} ${Dn} a_${vn}; +varying ${Or} ${Vr} ${vn}; +#else +uniform ${Or} ${Vr} u_${vn}; +#endif +`:ot==="vec4"?` +#ifndef HAS_UNIFORM_u_${vn} + ${vn} = a_${vn}; +#else + ${Or} ${Vr} ${vn} = u_${vn}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${vn} + ${vn} = unpack_mix_${ot}(a_${vn}, u_${vn}_t); +#else + ${Or} ${Vr} ${vn} = u_${vn}; +#endif +`:Tr==="define"?` +#ifndef HAS_UNIFORM_u_${vn} +uniform lowp float u_${vn}_t; +attribute ${Or} ${Dn} a_${vn}; +#else +uniform ${Or} ${Vr} u_${vn}; +#endif +`:ot==="vec4"?` +#ifndef HAS_UNIFORM_u_${vn} + ${Or} ${Vr} ${vn} = a_${vn}; +#else + ${Or} ${Vr} ${vn} = u_${vn}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${vn} + ${Or} ${Vr} ${vn} = unpack_mix_${ot}(a_${vn}, u_${vn}_t); +#else + ${Or} ${Vr} ${vn} = u_${vn}; +#endif +`}),staticAttributes:Oe,staticUniforms:It}}class xr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(N,ve,Oe,Ue,Ke,It,$t,ir,Tr){this.context=N;let Or=this.boundPaintVertexBuffers.length!==Ue.length;for(let Vr=0;!Or&&Vr({u_matrix:Qe,u_texture:0,u_ele_delta:N,u_fog_matrix:ve,u_fog_color:Oe?Oe.properties.get("fog-color"):r.aM.white,u_fog_ground_blend:Oe?Oe.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Oe?Oe.calculateFogBlendOpacity(Ue):0,u_horizon_color:Oe?Oe.properties.get("horizon-color"):r.aM.white,u_horizon_fog_blend:Oe?Oe.properties.get("horizon-fog-blend"):1});function Tn(Qe){const N=[];for(let ve=0;ve({u_depth:new r.aH(Nr,jr.u_depth),u_terrain:new r.aH(Nr,jr.u_terrain),u_terrain_dim:new r.aI(Nr,jr.u_terrain_dim),u_terrain_matrix:new r.aJ(Nr,jr.u_terrain_matrix),u_terrain_unpack:new r.aK(Nr,jr.u_terrain_unpack),u_terrain_exaggeration:new r.aI(Nr,jr.u_terrain_exaggeration)}))(N,Mr),this.binderUniforms=Oe?Oe.getUniforms(N,Mr):[]}draw(N,ve,Oe,Ue,Ke,It,$t,ir,Tr,Or,Vr,vn,Dn,ot,dt,St,Rt,Yt){const Ut=N.gl;if(this.failedToCreate)return;if(N.program.set(this.program),N.setDepthMode(Oe),N.setStencilMode(Ue),N.setColorMode(Ke),N.setCullFace(It),ir){N.activeTexture.set(Ut.TEXTURE2),Ut.bindTexture(Ut.TEXTURE_2D,ir.depthTexture),N.activeTexture.set(Ut.TEXTURE3),Ut.bindTexture(Ut.TEXTURE_2D,ir.texture);for(const Mr in this.terrainUniforms)this.terrainUniforms[Mr].set(ir[Mr])}for(const Mr in this.fixedUniforms)this.fixedUniforms[Mr].set($t[Mr]);dt&&dt.setUniforms(N,this.binderUniforms,Dn,{zoom:ot});let er=0;switch(ve){case Ut.LINES:er=2;break;case Ut.TRIANGLES:er=3;break;case Ut.LINE_STRIP:er=1}for(const Mr of vn.get()){const Nr=Mr.vaos||(Mr.vaos={});(Nr[Tr]||(Nr[Tr]=new xr)).bind(N,this,Or,dt?dt.getPaintVertexBuffers():[],Vr,Mr.vertexOffset,St,Rt,Yt),Ut.drawElements(ve,Mr.primitiveLength*er,Ut.UNSIGNED_SHORT,Mr.primitiveOffset*er*2)}}}function ia(Qe,N,ve){const Oe=1/ha(ve,1,N.transform.tileZoom),Ue=Math.pow(2,ve.tileID.overscaledZ),Ke=ve.tileSize*Math.pow(2,N.transform.tileZoom)/Ue,It=Ke*(ve.tileID.canonical.x+ve.tileID.wrap*Ue),$t=Ke*ve.tileID.canonical.y;return{u_image:0,u_texsize:ve.imageAtlasTexture.size,u_scale:[Oe,Qe.fromScale,Qe.toScale],u_fade:Qe.t,u_pixel_coord_upper:[It>>16,$t>>16],u_pixel_coord_lower:[65535&It,65535&$t]}}const na=(Qe,N,ve,Oe)=>{const Ue=N.style.light,Ke=Ue.properties.get("position"),It=[Ke.x,Ke.y,Ke.z],$t=(function(){var Tr=new r.A(9);return r.A!=Float32Array&&(Tr[1]=0,Tr[2]=0,Tr[3]=0,Tr[5]=0,Tr[6]=0,Tr[7]=0),Tr[0]=1,Tr[4]=1,Tr[8]=1,Tr})();Ue.properties.get("anchor")==="viewport"&&(function(Tr,Or){var Vr=Math.sin(Or),vn=Math.cos(Or);Tr[0]=vn,Tr[1]=Vr,Tr[2]=0,Tr[3]=-Vr,Tr[4]=vn,Tr[5]=0,Tr[6]=0,Tr[7]=0,Tr[8]=1})($t,-N.transform.angle),(function(Tr,Or,Vr){var vn=Or[0],Dn=Or[1],ot=Or[2];Tr[0]=vn*Vr[0]+Dn*Vr[3]+ot*Vr[6],Tr[1]=vn*Vr[1]+Dn*Vr[4]+ot*Vr[7],Tr[2]=vn*Vr[2]+Dn*Vr[5]+ot*Vr[8]})(It,It,$t);const ir=Ue.properties.get("color");return{u_matrix:Qe,u_lightpos:It,u_lightintensity:Ue.properties.get("intensity"),u_lightcolor:[ir.r,ir.g,ir.b],u_vertical_gradient:+ve,u_opacity:Oe}},An=(Qe,N,ve,Oe,Ue,Ke,It)=>r.e(na(Qe,N,ve,Oe),ia(Ke,N,It),{u_height_factor:-Math.pow(2,Ue.overscaledZ)/It.tileSize/8}),Yn=Qe=>({u_matrix:Qe}),qi=(Qe,N,ve,Oe)=>r.e(Yn(Qe),ia(ve,N,Oe)),Ga=(Qe,N)=>({u_matrix:Qe,u_world:N}),to=(Qe,N,ve,Oe,Ue)=>r.e(qi(Qe,N,ve,Oe),{u_world:Ue}),_o=(Qe,N,ve,Oe)=>{const Ue=Qe.transform;let Ke,It;if(Oe.paint.get("circle-pitch-alignment")==="map"){const $t=ha(ve,1,Ue.zoom);Ke=!0,It=[$t,$t]}else Ke=!1,It=Ue.pixelsToGLUnits;return{u_camera_to_center_distance:Ue.cameraToCenterDistance,u_scale_with_map:+(Oe.paint.get("circle-pitch-scale")==="map"),u_matrix:Qe.translatePosMatrix(N.posMatrix,ve,Oe.paint.get("circle-translate"),Oe.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ke,u_device_pixel_ratio:Qe.pixelRatio,u_extrude_scale:It}},Po=(Qe,N,ve)=>({u_matrix:Qe,u_inv_matrix:N,u_camera_to_center_distance:ve.cameraToCenterDistance,u_viewport_size:[ve.width,ve.height]}),Ro=(Qe,N,ve=1)=>({u_matrix:Qe,u_color:N,u_overlay:0,u_overlay_scale:ve}),Xo=Qe=>({u_matrix:Qe}),Oi=(Qe,N,ve,Oe)=>({u_matrix:Qe,u_extrude_scale:ha(N,1,ve),u_intensity:Oe}),bs=(Qe,N,ve,Oe)=>{const Ue=r.H();r.aP(Ue,0,Qe.width,Qe.height,0,0,1);const Ke=Qe.context.gl;return{u_matrix:Ue,u_world:[Ke.drawingBufferWidth,Ke.drawingBufferHeight],u_image:ve,u_color_ramp:Oe,u_opacity:N.paint.get("heatmap-opacity")}};function cs(Qe,N){const ve=Math.pow(2,N.canonical.z),Oe=N.canonical.y;return[new r.Z(0,Oe/ve).toLngLat().lat,new r.Z(0,(Oe+1)/ve).toLngLat().lat]}const fl=(Qe,N,ve,Oe)=>{const Ue=Qe.transform;return{u_matrix:ll(Qe,N,ve,Oe),u_ratio:1/ha(N,1,Ue.zoom),u_device_pixel_ratio:Qe.pixelRatio,u_units_to_pixels:[1/Ue.pixelsToGLUnits[0],1/Ue.pixelsToGLUnits[1]]}},Is=(Qe,N,ve,Oe,Ue)=>r.e(fl(Qe,N,ve,Ue),{u_image:0,u_image_height:Oe}),ys=(Qe,N,ve,Oe,Ue)=>{const Ke=Qe.transform,It=hl(N,Ke);return{u_matrix:ll(Qe,N,ve,Ue),u_texsize:N.imageAtlasTexture.size,u_ratio:1/ha(N,1,Ke.zoom),u_device_pixel_ratio:Qe.pixelRatio,u_image:0,u_scale:[It,Oe.fromScale,Oe.toScale],u_fade:Oe.t,u_units_to_pixels:[1/Ke.pixelsToGLUnits[0],1/Ke.pixelsToGLUnits[1]]}},ss=(Qe,N,ve,Oe,Ue,Ke)=>{const It=Qe.lineAtlas,$t=hl(N,Qe.transform),ir=ve.layout.get("line-cap")==="round",Tr=It.getDash(Oe.from,ir),Or=It.getDash(Oe.to,ir),Vr=Tr.width*Ue.fromScale,vn=Or.width*Ue.toScale;return r.e(fl(Qe,N,ve,Ke),{u_patternscale_a:[$t/Vr,-Tr.height/2],u_patternscale_b:[$t/vn,-Or.height/2],u_sdfgamma:It.width/(256*Math.min(Vr,vn)*Qe.pixelRatio)/2,u_image:0,u_tex_y_a:Tr.y,u_tex_y_b:Or.y,u_mix:Ue.t})};function hl(Qe,N){return 1/ha(Qe,1,N.tileZoom)}function ll(Qe,N,ve,Oe){return Qe.translatePosMatrix(Oe?Oe.posMatrix:N.tileID.posMatrix,N,ve.paint.get("line-translate"),ve.paint.get("line-translate-anchor"))}const Il=(Qe,N,ve,Oe,Ue)=>{return{u_matrix:Qe,u_tl_parent:N,u_scale_parent:ve,u_buffer_scale:1,u_fade_t:Oe.mix,u_opacity:Oe.opacity*Ue.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Ue.paint.get("raster-brightness-min"),u_brightness_high:Ue.paint.get("raster-brightness-max"),u_saturation_factor:(It=Ue.paint.get("raster-saturation"),It>0?1-1/(1.001-It):-It),u_contrast_factor:(Ke=Ue.paint.get("raster-contrast"),Ke>0?1/(1-Ke):1+Ke),u_spin_weights:Ls(Ue.paint.get("raster-hue-rotate"))};var Ke,It};function Ls(Qe){Qe*=Math.PI/180;const N=Math.sin(Qe),ve=Math.cos(Qe);return[(2*ve+1)/3,(-Math.sqrt(3)*N-ve+1)/3,(Math.sqrt(3)*N-ve+1)/3]}const ps=(Qe,N,ve,Oe,Ue,Ke,It,$t,ir,Tr,Or,Vr,vn,Dn)=>{const ot=It.transform;return{u_is_size_zoom_constant:+(Qe==="constant"||Qe==="source"),u_is_size_feature_constant:+(Qe==="constant"||Qe==="camera"),u_size_t:N?N.uSizeT:0,u_size:N?N.uSize:0,u_camera_to_center_distance:ot.cameraToCenterDistance,u_pitch:ot.pitch/360*2*Math.PI,u_rotate_symbol:+ve,u_aspect_ratio:ot.width/ot.height,u_fade_change:It.options.fadeDuration?It.symbolFadeChange:1,u_matrix:$t,u_label_plane_matrix:ir,u_coord_matrix:Tr,u_is_text:+Vr,u_pitch_with_map:+Oe,u_is_along_line:Ue,u_is_variable_anchor:Ke,u_texsize:vn,u_texture:0,u_translation:Or,u_pitched_scale:Dn}},Uo=(Qe,N,ve,Oe,Ue,Ke,It,$t,ir,Tr,Or,Vr,vn,Dn,ot)=>{const dt=It.transform;return r.e(ps(Qe,N,ve,Oe,Ue,Ke,It,$t,ir,Tr,Or,Vr,vn,ot),{u_gamma_scale:Oe?Math.cos(dt._pitch)*dt.cameraToCenterDistance:1,u_device_pixel_ratio:It.pixelRatio,u_is_halo:1})},Rs=(Qe,N,ve,Oe,Ue,Ke,It,$t,ir,Tr,Or,Vr,vn,Dn)=>r.e(Uo(Qe,N,ve,Oe,Ue,Ke,It,$t,ir,Tr,Or,!0,Vr,!0,Dn),{u_texsize_icon:vn,u_texture_icon:1}),Ll=(Qe,N,ve)=>({u_matrix:Qe,u_opacity:N,u_color:ve}),Kl=(Qe,N,ve,Oe,Ue,Ke)=>r.e((function(It,$t,ir,Tr){const Or=ir.imageManager.getPattern(It.from.toString()),Vr=ir.imageManager.getPattern(It.to.toString()),{width:vn,height:Dn}=ir.imageManager.getPixelSize(),ot=Math.pow(2,Tr.tileID.overscaledZ),dt=Tr.tileSize*Math.pow(2,ir.transform.tileZoom)/ot,St=dt*(Tr.tileID.canonical.x+Tr.tileID.wrap*ot),Rt=dt*Tr.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Or.tl,u_pattern_br_a:Or.br,u_pattern_tl_b:Vr.tl,u_pattern_br_b:Vr.br,u_texsize:[vn,Dn],u_mix:$t.t,u_pattern_size_a:Or.displaySize,u_pattern_size_b:Vr.displaySize,u_scale_a:$t.fromScale,u_scale_b:$t.toScale,u_tile_units_to_pixels:1/ha(Tr,1,ir.transform.tileZoom),u_pixel_coord_upper:[St>>16,Rt>>16],u_pixel_coord_lower:[65535&St,65535&Rt]}})(Oe,Ke,ve,Ue),{u_matrix:Qe,u_opacity:N}),eu={fillExtrusion:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_lightpos:new r.aN(Qe,N.u_lightpos),u_lightintensity:new r.aI(Qe,N.u_lightintensity),u_lightcolor:new r.aN(Qe,N.u_lightcolor),u_vertical_gradient:new r.aI(Qe,N.u_vertical_gradient),u_opacity:new r.aI(Qe,N.u_opacity)}),fillExtrusionPattern:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_lightpos:new r.aN(Qe,N.u_lightpos),u_lightintensity:new r.aI(Qe,N.u_lightintensity),u_lightcolor:new r.aN(Qe,N.u_lightcolor),u_vertical_gradient:new r.aI(Qe,N.u_vertical_gradient),u_height_factor:new r.aI(Qe,N.u_height_factor),u_image:new r.aH(Qe,N.u_image),u_texsize:new r.aO(Qe,N.u_texsize),u_pixel_coord_upper:new r.aO(Qe,N.u_pixel_coord_upper),u_pixel_coord_lower:new r.aO(Qe,N.u_pixel_coord_lower),u_scale:new r.aN(Qe,N.u_scale),u_fade:new r.aI(Qe,N.u_fade),u_opacity:new r.aI(Qe,N.u_opacity)}),fill:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix)}),fillPattern:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_image:new r.aH(Qe,N.u_image),u_texsize:new r.aO(Qe,N.u_texsize),u_pixel_coord_upper:new r.aO(Qe,N.u_pixel_coord_upper),u_pixel_coord_lower:new r.aO(Qe,N.u_pixel_coord_lower),u_scale:new r.aN(Qe,N.u_scale),u_fade:new r.aI(Qe,N.u_fade)}),fillOutline:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_world:new r.aO(Qe,N.u_world)}),fillOutlinePattern:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_world:new r.aO(Qe,N.u_world),u_image:new r.aH(Qe,N.u_image),u_texsize:new r.aO(Qe,N.u_texsize),u_pixel_coord_upper:new r.aO(Qe,N.u_pixel_coord_upper),u_pixel_coord_lower:new r.aO(Qe,N.u_pixel_coord_lower),u_scale:new r.aN(Qe,N.u_scale),u_fade:new r.aI(Qe,N.u_fade)}),circle:(Qe,N)=>({u_camera_to_center_distance:new r.aI(Qe,N.u_camera_to_center_distance),u_scale_with_map:new r.aH(Qe,N.u_scale_with_map),u_pitch_with_map:new r.aH(Qe,N.u_pitch_with_map),u_extrude_scale:new r.aO(Qe,N.u_extrude_scale),u_device_pixel_ratio:new r.aI(Qe,N.u_device_pixel_ratio),u_matrix:new r.aJ(Qe,N.u_matrix)}),collisionBox:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_pixel_extrude_scale:new r.aO(Qe,N.u_pixel_extrude_scale)}),collisionCircle:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_inv_matrix:new r.aJ(Qe,N.u_inv_matrix),u_camera_to_center_distance:new r.aI(Qe,N.u_camera_to_center_distance),u_viewport_size:new r.aO(Qe,N.u_viewport_size)}),debug:(Qe,N)=>({u_color:new r.aL(Qe,N.u_color),u_matrix:new r.aJ(Qe,N.u_matrix),u_overlay:new r.aH(Qe,N.u_overlay),u_overlay_scale:new r.aI(Qe,N.u_overlay_scale)}),clippingMask:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix)}),heatmap:(Qe,N)=>({u_extrude_scale:new r.aI(Qe,N.u_extrude_scale),u_intensity:new r.aI(Qe,N.u_intensity),u_matrix:new r.aJ(Qe,N.u_matrix)}),heatmapTexture:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_world:new r.aO(Qe,N.u_world),u_image:new r.aH(Qe,N.u_image),u_color_ramp:new r.aH(Qe,N.u_color_ramp),u_opacity:new r.aI(Qe,N.u_opacity)}),hillshade:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_image:new r.aH(Qe,N.u_image),u_latrange:new r.aO(Qe,N.u_latrange),u_light:new r.aO(Qe,N.u_light),u_shadow:new r.aL(Qe,N.u_shadow),u_highlight:new r.aL(Qe,N.u_highlight),u_accent:new r.aL(Qe,N.u_accent)}),hillshadePrepare:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_image:new r.aH(Qe,N.u_image),u_dimension:new r.aO(Qe,N.u_dimension),u_zoom:new r.aI(Qe,N.u_zoom),u_unpack:new r.aK(Qe,N.u_unpack)}),line:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_ratio:new r.aI(Qe,N.u_ratio),u_device_pixel_ratio:new r.aI(Qe,N.u_device_pixel_ratio),u_units_to_pixels:new r.aO(Qe,N.u_units_to_pixels)}),lineGradient:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_ratio:new r.aI(Qe,N.u_ratio),u_device_pixel_ratio:new r.aI(Qe,N.u_device_pixel_ratio),u_units_to_pixels:new r.aO(Qe,N.u_units_to_pixels),u_image:new r.aH(Qe,N.u_image),u_image_height:new r.aI(Qe,N.u_image_height)}),linePattern:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_texsize:new r.aO(Qe,N.u_texsize),u_ratio:new r.aI(Qe,N.u_ratio),u_device_pixel_ratio:new r.aI(Qe,N.u_device_pixel_ratio),u_image:new r.aH(Qe,N.u_image),u_units_to_pixels:new r.aO(Qe,N.u_units_to_pixels),u_scale:new r.aN(Qe,N.u_scale),u_fade:new r.aI(Qe,N.u_fade)}),lineSDF:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_ratio:new r.aI(Qe,N.u_ratio),u_device_pixel_ratio:new r.aI(Qe,N.u_device_pixel_ratio),u_units_to_pixels:new r.aO(Qe,N.u_units_to_pixels),u_patternscale_a:new r.aO(Qe,N.u_patternscale_a),u_patternscale_b:new r.aO(Qe,N.u_patternscale_b),u_sdfgamma:new r.aI(Qe,N.u_sdfgamma),u_image:new r.aH(Qe,N.u_image),u_tex_y_a:new r.aI(Qe,N.u_tex_y_a),u_tex_y_b:new r.aI(Qe,N.u_tex_y_b),u_mix:new r.aI(Qe,N.u_mix)}),raster:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_tl_parent:new r.aO(Qe,N.u_tl_parent),u_scale_parent:new r.aI(Qe,N.u_scale_parent),u_buffer_scale:new r.aI(Qe,N.u_buffer_scale),u_fade_t:new r.aI(Qe,N.u_fade_t),u_opacity:new r.aI(Qe,N.u_opacity),u_image0:new r.aH(Qe,N.u_image0),u_image1:new r.aH(Qe,N.u_image1),u_brightness_low:new r.aI(Qe,N.u_brightness_low),u_brightness_high:new r.aI(Qe,N.u_brightness_high),u_saturation_factor:new r.aI(Qe,N.u_saturation_factor),u_contrast_factor:new r.aI(Qe,N.u_contrast_factor),u_spin_weights:new r.aN(Qe,N.u_spin_weights)}),symbolIcon:(Qe,N)=>({u_is_size_zoom_constant:new r.aH(Qe,N.u_is_size_zoom_constant),u_is_size_feature_constant:new r.aH(Qe,N.u_is_size_feature_constant),u_size_t:new r.aI(Qe,N.u_size_t),u_size:new r.aI(Qe,N.u_size),u_camera_to_center_distance:new r.aI(Qe,N.u_camera_to_center_distance),u_pitch:new r.aI(Qe,N.u_pitch),u_rotate_symbol:new r.aH(Qe,N.u_rotate_symbol),u_aspect_ratio:new r.aI(Qe,N.u_aspect_ratio),u_fade_change:new r.aI(Qe,N.u_fade_change),u_matrix:new r.aJ(Qe,N.u_matrix),u_label_plane_matrix:new r.aJ(Qe,N.u_label_plane_matrix),u_coord_matrix:new r.aJ(Qe,N.u_coord_matrix),u_is_text:new r.aH(Qe,N.u_is_text),u_pitch_with_map:new r.aH(Qe,N.u_pitch_with_map),u_is_along_line:new r.aH(Qe,N.u_is_along_line),u_is_variable_anchor:new r.aH(Qe,N.u_is_variable_anchor),u_texsize:new r.aO(Qe,N.u_texsize),u_texture:new r.aH(Qe,N.u_texture),u_translation:new r.aO(Qe,N.u_translation),u_pitched_scale:new r.aI(Qe,N.u_pitched_scale)}),symbolSDF:(Qe,N)=>({u_is_size_zoom_constant:new r.aH(Qe,N.u_is_size_zoom_constant),u_is_size_feature_constant:new r.aH(Qe,N.u_is_size_feature_constant),u_size_t:new r.aI(Qe,N.u_size_t),u_size:new r.aI(Qe,N.u_size),u_camera_to_center_distance:new r.aI(Qe,N.u_camera_to_center_distance),u_pitch:new r.aI(Qe,N.u_pitch),u_rotate_symbol:new r.aH(Qe,N.u_rotate_symbol),u_aspect_ratio:new r.aI(Qe,N.u_aspect_ratio),u_fade_change:new r.aI(Qe,N.u_fade_change),u_matrix:new r.aJ(Qe,N.u_matrix),u_label_plane_matrix:new r.aJ(Qe,N.u_label_plane_matrix),u_coord_matrix:new r.aJ(Qe,N.u_coord_matrix),u_is_text:new r.aH(Qe,N.u_is_text),u_pitch_with_map:new r.aH(Qe,N.u_pitch_with_map),u_is_along_line:new r.aH(Qe,N.u_is_along_line),u_is_variable_anchor:new r.aH(Qe,N.u_is_variable_anchor),u_texsize:new r.aO(Qe,N.u_texsize),u_texture:new r.aH(Qe,N.u_texture),u_gamma_scale:new r.aI(Qe,N.u_gamma_scale),u_device_pixel_ratio:new r.aI(Qe,N.u_device_pixel_ratio),u_is_halo:new r.aH(Qe,N.u_is_halo),u_translation:new r.aO(Qe,N.u_translation),u_pitched_scale:new r.aI(Qe,N.u_pitched_scale)}),symbolTextAndIcon:(Qe,N)=>({u_is_size_zoom_constant:new r.aH(Qe,N.u_is_size_zoom_constant),u_is_size_feature_constant:new r.aH(Qe,N.u_is_size_feature_constant),u_size_t:new r.aI(Qe,N.u_size_t),u_size:new r.aI(Qe,N.u_size),u_camera_to_center_distance:new r.aI(Qe,N.u_camera_to_center_distance),u_pitch:new r.aI(Qe,N.u_pitch),u_rotate_symbol:new r.aH(Qe,N.u_rotate_symbol),u_aspect_ratio:new r.aI(Qe,N.u_aspect_ratio),u_fade_change:new r.aI(Qe,N.u_fade_change),u_matrix:new r.aJ(Qe,N.u_matrix),u_label_plane_matrix:new r.aJ(Qe,N.u_label_plane_matrix),u_coord_matrix:new r.aJ(Qe,N.u_coord_matrix),u_is_text:new r.aH(Qe,N.u_is_text),u_pitch_with_map:new r.aH(Qe,N.u_pitch_with_map),u_is_along_line:new r.aH(Qe,N.u_is_along_line),u_is_variable_anchor:new r.aH(Qe,N.u_is_variable_anchor),u_texsize:new r.aO(Qe,N.u_texsize),u_texsize_icon:new r.aO(Qe,N.u_texsize_icon),u_texture:new r.aH(Qe,N.u_texture),u_texture_icon:new r.aH(Qe,N.u_texture_icon),u_gamma_scale:new r.aI(Qe,N.u_gamma_scale),u_device_pixel_ratio:new r.aI(Qe,N.u_device_pixel_ratio),u_is_halo:new r.aH(Qe,N.u_is_halo),u_translation:new r.aO(Qe,N.u_translation),u_pitched_scale:new r.aI(Qe,N.u_pitched_scale)}),background:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_opacity:new r.aI(Qe,N.u_opacity),u_color:new r.aL(Qe,N.u_color)}),backgroundPattern:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_opacity:new r.aI(Qe,N.u_opacity),u_image:new r.aH(Qe,N.u_image),u_pattern_tl_a:new r.aO(Qe,N.u_pattern_tl_a),u_pattern_br_a:new r.aO(Qe,N.u_pattern_br_a),u_pattern_tl_b:new r.aO(Qe,N.u_pattern_tl_b),u_pattern_br_b:new r.aO(Qe,N.u_pattern_br_b),u_texsize:new r.aO(Qe,N.u_texsize),u_mix:new r.aI(Qe,N.u_mix),u_pattern_size_a:new r.aO(Qe,N.u_pattern_size_a),u_pattern_size_b:new r.aO(Qe,N.u_pattern_size_b),u_scale_a:new r.aI(Qe,N.u_scale_a),u_scale_b:new r.aI(Qe,N.u_scale_b),u_pixel_coord_upper:new r.aO(Qe,N.u_pixel_coord_upper),u_pixel_coord_lower:new r.aO(Qe,N.u_pixel_coord_lower),u_tile_units_to_pixels:new r.aI(Qe,N.u_tile_units_to_pixels)}),terrain:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_texture:new r.aH(Qe,N.u_texture),u_ele_delta:new r.aI(Qe,N.u_ele_delta),u_fog_matrix:new r.aJ(Qe,N.u_fog_matrix),u_fog_color:new r.aL(Qe,N.u_fog_color),u_fog_ground_blend:new r.aI(Qe,N.u_fog_ground_blend),u_fog_ground_blend_opacity:new r.aI(Qe,N.u_fog_ground_blend_opacity),u_horizon_color:new r.aL(Qe,N.u_horizon_color),u_horizon_fog_blend:new r.aI(Qe,N.u_horizon_fog_blend)}),terrainDepth:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_ele_delta:new r.aI(Qe,N.u_ele_delta)}),terrainCoords:(Qe,N)=>({u_matrix:new r.aJ(Qe,N.u_matrix),u_texture:new r.aH(Qe,N.u_texture),u_terrain_coords_id:new r.aI(Qe,N.u_terrain_coords_id),u_ele_delta:new r.aI(Qe,N.u_ele_delta)}),sky:(Qe,N)=>({u_sky_color:new r.aL(Qe,N.u_sky_color),u_horizon_color:new r.aL(Qe,N.u_horizon_color),u_horizon:new r.aI(Qe,N.u_horizon),u_sky_horizon_blend:new r.aI(Qe,N.u_sky_horizon_blend)})};class Ws{constructor(N,ve,Oe){this.context=N;const Ue=N.gl;this.buffer=Ue.createBuffer(),this.dynamicDraw=!!Oe,this.context.unbindVAO(),N.bindElementBuffer.set(this.buffer),Ue.bufferData(Ue.ELEMENT_ARRAY_BUFFER,ve.arrayBuffer,this.dynamicDraw?Ue.DYNAMIC_DRAW:Ue.STATIC_DRAW),this.dynamicDraw||delete ve.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(N){const ve=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),ve.bufferSubData(ve.ELEMENT_ARRAY_BUFFER,0,N.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Bi={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Mo{constructor(N,ve,Oe,Ue){this.length=ve.length,this.attributes=Oe,this.itemSize=ve.bytesPerElement,this.dynamicDraw=Ue,this.context=N;const Ke=N.gl;this.buffer=Ke.createBuffer(),N.bindVertexBuffer.set(this.buffer),Ke.bufferData(Ke.ARRAY_BUFFER,ve.arrayBuffer,this.dynamicDraw?Ke.DYNAMIC_DRAW:Ke.STATIC_DRAW),this.dynamicDraw||delete ve.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(N){if(N.length!==this.length)throw new Error(`Length of new data is ${N.length}, which doesn't match current length of ${this.length}`);const ve=this.context.gl;this.bind(),ve.bufferSubData(ve.ARRAY_BUFFER,0,N.arrayBuffer)}enableAttributes(N,ve){for(let Oe=0;Oe0){const Nr=r.H();r.aQ(Nr,Ut.placementInvProjMatrix,Qe.transform.glCoordMatrix),r.aQ(Nr,Nr,Ut.placementViewportMatrix),ir.push({circleArray:Mr,circleOffset:Or,transform:Yt.posMatrix,invTransform:Nr,coord:Yt}),Tr+=Mr.length/4,Or=Tr}er&&$t.draw(Ke,It.LINES,al.disabled,Ol.disabled,Qe.colorModeForRenderPass(),ns.disabled,{u_matrix:Yt.posMatrix,u_pixel_extrude_scale:[1/(Vr=Qe.transform).width,1/Vr.height]},Qe.style.map.terrain&&Qe.style.map.terrain.getTerrainData(Yt),ve.id,er.layoutVertexBuffer,er.indexBuffer,er.segments,null,Qe.transform.zoom,null,null,er.collisionVertexBuffer)}var Vr;if(!Ue||!ir.length)return;const vn=Qe.useProgram("collisionCircle"),Dn=new r.aR;Dn.resize(4*Tr),Dn._trim();let ot=0;for(const Rt of ir)for(let Yt=0;Yt=0&&(Rt[Ut.associatedIconIndex]={shiftedAnchor:Ao,angle:qo})}else kr(Ut.numGlyphs,dt)}if(Tr){St.clear();const Yt=Qe.icon.placedSymbolArray;for(let Ut=0;UtQe.style.map.terrain.getElevation(Wn,Gn,Xa):null,Un=ve.layout.get("text-rotation-alignment")==="map";Be(Ua,Wn.posMatrix,Qe,Ue,Pc,Ce,Rt,Tr,Un,dt,Wn.toUnwrapped(),ot.width,ot.height,Ye,En)}const Ot=Wn.posMatrix,Wt=Ue&&sn||Dt,dr=Yt||Wt?ic:Pc,hr=mf,Rr=Mi&&ve.paint.get(Ue?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let ln;ln=Mi?Ua.iconsInText?Rs(Ao.kind,vs,Ut,Rt,Yt,Wt,Qe,Ot,dr,hr,Ye,yl,Su,$n):Uo(Ao.kind,vs,Ut,Rt,Yt,Wt,Qe,Ot,dr,hr,Ye,Ue,yl,!0,$n):ps(Ao.kind,vs,Ut,Rt,Yt,Wt,Qe,Ot,dr,hr,Ye,Ue,yl,$n);const on={program:Bo,buffers:Si,uniformValues:ln,atlasTexture:Xs,atlasTextureIcon:Ys,atlasInterpolation:Sl,atlasInterpolationIcon:Ou,isSDF:Mi,hasHalo:Rr};if(Mr&&Ua.canOverlap){Nr=!0;const En=Si.segments.get();for(const Un of En)xn.push({segments:new r.a0([Un]),sortKey:Un.sortKey,state:on,terrainData:ml})}else xn.push({segments:Si.segments,sortKey:0,state:on,terrainData:ml})}Nr&&xn.sort((Wn,ua)=>Wn.sortKey-ua.sortKey);for(const Wn of xn){const ua=Wn.state;if(vn.activeTexture.set(Dn.TEXTURE0),ua.atlasTexture.bind(ua.atlasInterpolation,Dn.CLAMP_TO_EDGE),ua.atlasTextureIcon&&(vn.activeTexture.set(Dn.TEXTURE1),ua.atlasTextureIcon&&ua.atlasTextureIcon.bind(ua.atlasInterpolationIcon,Dn.CLAMP_TO_EDGE)),ua.isSDF){const Ua=ua.uniformValues;ua.hasHalo&&(Ua.u_is_halo=1,Ld(ua.buffers,Wn.segments,ve,Qe,ua.program,jr,Or,Vr,Ua,Wn.terrainData)),Ua.u_is_halo=0}Ld(ua.buffers,Wn.segments,ve,Qe,ua.program,jr,Or,Vr,ua.uniformValues,Wn.terrainData)}}function Ld(Qe,N,ve,Oe,Ue,Ke,It,$t,ir,Tr){const Or=Oe.context;Ue.draw(Or,Or.gl.TRIANGLES,Ke,It,$t,ns.disabled,ir,Tr,ve.id,Qe.layoutVertexBuffer,Qe.indexBuffer,N,ve.paint,Oe.transform.zoom,Qe.programConfigurations.get(ve.id),Qe.dynamicLayoutVertexBuffer,Qe.opacityVertexBuffer)}function Xh(Qe,N,ve,Oe){const Ue=Qe.context,Ke=Ue.gl,It=Ol.disabled,$t=new Lu([Ke.ONE,Ke.ONE],r.aM.transparent,[!0,!0,!0,!0]),ir=N.getBucket(ve);if(!ir)return;const Tr=Oe.key;let Or=ve.heatmapFbos.get(Tr);Or||(Or=wd(Ue,N.tileSize,N.tileSize),ve.heatmapFbos.set(Tr,Or)),Ue.bindFramebuffer.set(Or.framebuffer),Ue.viewport.set([0,0,N.tileSize,N.tileSize]),Ue.clear({color:r.aM.transparent});const Vr=ir.programConfigurations.get(ve.id),vn=Qe.useProgram("heatmap",Vr),Dn=Qe.style.map.terrain.getTerrainData(Oe);vn.draw(Ue,Ke.TRIANGLES,al.disabled,It,$t,ns.disabled,Oi(Oe.posMatrix,N,Qe.transform.zoom,ve.paint.get("heatmap-intensity")),Dn,ve.id,ir.layoutVertexBuffer,ir.indexBuffer,ir.segments,ve.paint,Qe.transform.zoom,Vr)}function mh(Qe,N,ve){const Oe=Qe.context,Ue=Oe.gl;Oe.setColorMode(Qe.colorModeForRenderPass());const Ke=Td(Oe,N),It=ve.key,$t=N.heatmapFbos.get(It);$t&&(Oe.activeTexture.set(Ue.TEXTURE0),Ue.bindTexture(Ue.TEXTURE_2D,$t.colorAttachment.get()),Oe.activeTexture.set(Ue.TEXTURE1),Ke.bind(Ue.LINEAR,Ue.CLAMP_TO_EDGE),Qe.useProgram("heatmapTexture").draw(Oe,Ue.TRIANGLES,al.disabled,Ol.disabled,Qe.colorModeForRenderPass(),ns.disabled,bs(Qe,N,0,1),null,N.id,Qe.rasterBoundsBuffer,Qe.quadTriangleIndexBuffer,Qe.rasterBoundsSegments,N.paint,Qe.transform.zoom),$t.destroy(),N.heatmapFbos.delete(It))}function wd(Qe,N,ve){var Oe,Ue;const Ke=Qe.gl,It=Ke.createTexture();Ke.bindTexture(Ke.TEXTURE_2D,It),Ke.texParameteri(Ke.TEXTURE_2D,Ke.TEXTURE_WRAP_S,Ke.CLAMP_TO_EDGE),Ke.texParameteri(Ke.TEXTURE_2D,Ke.TEXTURE_WRAP_T,Ke.CLAMP_TO_EDGE),Ke.texParameteri(Ke.TEXTURE_2D,Ke.TEXTURE_MIN_FILTER,Ke.LINEAR),Ke.texParameteri(Ke.TEXTURE_2D,Ke.TEXTURE_MAG_FILTER,Ke.LINEAR);const $t=(Oe=Qe.HALF_FLOAT)!==null&&Oe!==void 0?Oe:Ke.UNSIGNED_BYTE,ir=(Ue=Qe.RGBA16F)!==null&&Ue!==void 0?Ue:Ke.RGBA;Ke.texImage2D(Ke.TEXTURE_2D,0,ir,N,ve,0,Ke.RGBA,$t,null);const Tr=Qe.createFramebuffer(N,ve,!1,!1);return Tr.colorAttachment.set(It),Tr}function Td(Qe,N){return N.colorRampTexture||(N.colorRampTexture=new h(Qe,N.colorRamp,Qe.gl.RGBA)),N.colorRampTexture}function zf(Qe,N,ve,Oe,Ue){if(!ve||!Oe||!Oe.imageAtlas)return;const Ke=Oe.imageAtlas.patternPositions;let It=Ke[ve.to.toString()],$t=Ke[ve.from.toString()];if(!It&&$t&&(It=$t),!$t&&It&&($t=It),!It||!$t){const ir=Ue.getPaintProperty(N);It=Ke[ir],$t=Ke[ir]}It&&$t&&Qe.setConstantPatternPositions(It,$t)}function Rd(Qe,N,ve,Oe,Ue,Ke,It){const $t=Qe.context.gl,ir="fill-pattern",Tr=ve.paint.get(ir),Or=Tr&&Tr.constantOr(1),Vr=ve.getCrossfadeParameters();let vn,Dn,ot,dt,St;It?(Dn=Or&&!ve.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",vn=$t.LINES):(Dn=Or?"fillPattern":"fill",vn=$t.TRIANGLES);const Rt=Tr.constantOr(null);for(const Yt of Oe){const Ut=N.getTile(Yt);if(Or&&!Ut.patternsLoaded())continue;const er=Ut.getBucket(ve);if(!er)continue;const Mr=er.programConfigurations.get(ve.id),Nr=Qe.useProgram(Dn,Mr),jr=Qe.style.map.terrain&&Qe.style.map.terrain.getTerrainData(Yt);Or&&(Qe.context.activeTexture.set($t.TEXTURE0),Ut.imageAtlasTexture.bind($t.LINEAR,$t.CLAMP_TO_EDGE),Mr.updatePaintBuffers(Vr)),zf(Mr,ir,Rt,Ut,ve);const sn=jr?Yt:null,xn=Qe.translatePosMatrix(sn?sn.posMatrix:Yt.posMatrix,Ut,ve.paint.get("fill-translate"),ve.paint.get("fill-translate-anchor"));if(It){dt=er.indexBuffer2,St=er.segments2;const $n=[$t.drawingBufferWidth,$t.drawingBufferHeight];ot=Dn==="fillOutlinePattern"&&Or?to(xn,Qe,Vr,Ut,$n):Ga(xn,$n)}else dt=er.indexBuffer,St=er.segments,ot=Or?qi(xn,Qe,Vr,Ut):Yn(xn);Nr.draw(Qe.context,vn,Ue,Qe.stencilModeForClipping(Yt),Ke,ns.disabled,ot,jr,ve.id,er.layoutVertexBuffer,dt,St,ve.paint,Qe.transform.zoom,Mr)}}function nh(Qe,N,ve,Oe,Ue,Ke,It){const $t=Qe.context,ir=$t.gl,Tr="fill-extrusion-pattern",Or=ve.paint.get(Tr),Vr=Or.constantOr(1),vn=ve.getCrossfadeParameters(),Dn=ve.paint.get("fill-extrusion-opacity"),ot=Or.constantOr(null);for(const dt of Oe){const St=N.getTile(dt),Rt=St.getBucket(ve);if(!Rt)continue;const Yt=Qe.style.map.terrain&&Qe.style.map.terrain.getTerrainData(dt),Ut=Rt.programConfigurations.get(ve.id),er=Qe.useProgram(Vr?"fillExtrusionPattern":"fillExtrusion",Ut);Vr&&(Qe.context.activeTexture.set(ir.TEXTURE0),St.imageAtlasTexture.bind(ir.LINEAR,ir.CLAMP_TO_EDGE),Ut.updatePaintBuffers(vn)),zf(Ut,Tr,ot,St,ve);const Mr=Qe.translatePosMatrix(dt.posMatrix,St,ve.paint.get("fill-extrusion-translate"),ve.paint.get("fill-extrusion-translate-anchor")),Nr=ve.paint.get("fill-extrusion-vertical-gradient"),jr=Vr?An(Mr,Qe,Nr,Dn,dt,vn,St):na(Mr,Qe,Nr,Dn);er.draw($t,$t.gl.TRIANGLES,Ue,Ke,It,ns.backCCW,jr,Yt,ve.id,Rt.layoutVertexBuffer,Rt.indexBuffer,Rt.segments,ve.paint,Qe.transform.zoom,Ut,Qe.style.map.terrain&&Rt.centroidVertexBuffer)}}function Gf(Qe,N,ve,Oe,Ue,Ke,It){const $t=Qe.context,ir=$t.gl,Tr=ve.fbo;if(!Tr)return;const Or=Qe.useProgram("hillshade"),Vr=Qe.style.map.terrain&&Qe.style.map.terrain.getTerrainData(N);$t.activeTexture.set(ir.TEXTURE0),ir.bindTexture(ir.TEXTURE_2D,Tr.colorAttachment.get()),Or.draw($t,ir.TRIANGLES,Ue,Ke,It,ns.disabled,((vn,Dn,ot,dt)=>{const St=ot.paint.get("hillshade-shadow-color"),Rt=ot.paint.get("hillshade-highlight-color"),Yt=ot.paint.get("hillshade-accent-color");let Ut=ot.paint.get("hillshade-illumination-direction")*(Math.PI/180);ot.paint.get("hillshade-illumination-anchor")==="viewport"&&(Ut-=vn.transform.angle);const er=!vn.options.moving;return{u_matrix:dt?dt.posMatrix:vn.transform.calculatePosMatrix(Dn.tileID.toUnwrapped(),er),u_image:0,u_latrange:cs(0,Dn.tileID),u_light:[ot.paint.get("hillshade-exaggeration"),Ut],u_shadow:St,u_highlight:Rt,u_accent:Yt}})(Qe,ve,Oe,Vr?N:null),Vr,Oe.id,Qe.rasterBoundsBuffer,Qe.quadTriangleIndexBuffer,Qe.rasterBoundsSegments)}function _c(Qe,N,ve,Oe,Ue,Ke){const It=Qe.context,$t=It.gl,ir=N.dem;if(ir&&ir.data){const Tr=ir.dim,Or=ir.stride,Vr=ir.getPixels();if(It.activeTexture.set($t.TEXTURE1),It.pixelStoreUnpackPremultiplyAlpha.set(!1),N.demTexture=N.demTexture||Qe.getTileTexture(Or),N.demTexture){const Dn=N.demTexture;Dn.update(Vr,{premultiply:!1}),Dn.bind($t.NEAREST,$t.CLAMP_TO_EDGE)}else N.demTexture=new h(It,Vr,$t.RGBA,{premultiply:!1}),N.demTexture.bind($t.NEAREST,$t.CLAMP_TO_EDGE);It.activeTexture.set($t.TEXTURE0);let vn=N.fbo;if(!vn){const Dn=new h(It,{width:Tr,height:Tr,data:null},$t.RGBA);Dn.bind($t.LINEAR,$t.CLAMP_TO_EDGE),vn=N.fbo=It.createFramebuffer(Tr,Tr,!0,!1),vn.colorAttachment.set(Dn.texture)}It.bindFramebuffer.set(vn.framebuffer),It.viewport.set([0,0,Tr,Tr]),Qe.useProgram("hillshadePrepare").draw(It,$t.TRIANGLES,Oe,Ue,Ke,ns.disabled,((Dn,ot)=>{const dt=ot.stride,St=r.H();return r.aP(St,0,r.X,-r.X,0,0,1),r.J(St,St,[0,-r.X,0]),{u_matrix:St,u_image:1,u_dimension:[dt,dt],u_zoom:Dn.overscaledZ,u_unpack:ot.getUnpackVector()}})(N.tileID,ir),null,ve.id,Qe.rasterBoundsBuffer,Qe.quadTriangleIndexBuffer,Qe.rasterBoundsSegments),N.needsHillshadePrepare=!1}}function Ch(Qe,N,ve,Oe,Ue,Ke){const It=Oe.paint.get("raster-fade-duration");if(!Ke&&It>0){const $t=s.now(),ir=($t-Qe.timeAdded)/It,Tr=N?($t-N.timeAdded)/It:-1,Or=ve.getSource(),Vr=Ue.coveringZoomLevel({tileSize:Or.tileSize,roundZoom:Or.roundZoom}),vn=!N||Math.abs(N.tileID.overscaledZ-Vr)>Math.abs(Qe.tileID.overscaledZ-Vr),Dn=vn&&Qe.refreshedUponExpiration?1:r.ac(vn?ir:1-Tr,0,1);return Qe.refreshedUponExpiration&&ir>=1&&(Qe.refreshedUponExpiration=!1),N?{opacity:1,mix:1-Dn}:{opacity:Dn,mix:0}}return{opacity:1,mix:0}}const Ad=new r.aM(1,0,0,1),lu=new r.aM(0,1,0,1),id=new r.aM(0,0,1,1),_p=new r.aM(1,0,1,1),Dd=new r.aM(0,1,1,1);function Yh(Qe,N,ve,Oe){ff(Qe,0,N+ve/2,Qe.transform.width,ve,Oe)}function Pd(Qe,N,ve,Oe){ff(Qe,N-ve/2,0,ve,Qe.transform.height,Oe)}function ff(Qe,N,ve,Oe,Ue,Ke){const It=Qe.context,$t=It.gl;$t.enable($t.SCISSOR_TEST),$t.scissor(N*Qe.pixelRatio,ve*Qe.pixelRatio,Oe*Qe.pixelRatio,Ue*Qe.pixelRatio),It.clear({color:Ke}),$t.disable($t.SCISSOR_TEST)}function zd(Qe,N,ve){const Oe=Qe.context,Ue=Oe.gl,Ke=ve.posMatrix,It=Qe.useProgram("debug"),$t=al.disabled,ir=Ol.disabled,Tr=Qe.colorModeForRenderPass(),Or="$debug",Vr=Qe.style.map.terrain&&Qe.style.map.terrain.getTerrainData(ve);Oe.activeTexture.set(Ue.TEXTURE0);const vn=N.getTileByID(ve.key).latestRawTileData,Dn=Math.floor((vn&&vn.byteLength||0)/1024),ot=N.getTile(ve).tileSize,dt=512/Math.min(ot,512)*(ve.overscaledZ/Qe.transform.zoom)*.5;let St=ve.canonical.toString();ve.overscaledZ!==ve.canonical.z&&(St+=` => ${ve.overscaledZ}`),(function(Rt,Yt){Rt.initDebugOverlayCanvas();const Ut=Rt.debugOverlayCanvas,er=Rt.context.gl,Mr=Rt.debugOverlayCanvas.getContext("2d");Mr.clearRect(0,0,Ut.width,Ut.height),Mr.shadowColor="white",Mr.shadowBlur=2,Mr.lineWidth=1.5,Mr.strokeStyle="white",Mr.textBaseline="top",Mr.font="bold 36px Open Sans, sans-serif",Mr.fillText(Yt,5,5),Mr.strokeText(Yt,5,5),Rt.debugOverlayTexture.update(Ut),Rt.debugOverlayTexture.bind(er.LINEAR,er.CLAMP_TO_EDGE)})(Qe,`${St} ${Dn}kB`),It.draw(Oe,Ue.TRIANGLES,$t,ir,Lu.alphaBlended,ns.disabled,Ro(Ke,r.aM.transparent,dt),null,Or,Qe.debugBuffer,Qe.quadTriangleIndexBuffer,Qe.debugSegments),It.draw(Oe,Ue.LINE_STRIP,$t,ir,Tr,ns.disabled,Ro(Ke,r.aM.red),Vr,Or,Qe.debugBuffer,Qe.tileBorderIndexBuffer,Qe.debugSegments)}function Vu(Qe,N,ve){const Oe=Qe.context,Ue=Oe.gl,Ke=Qe.colorModeForRenderPass(),It=new al(Ue.LEQUAL,al.ReadWrite,Qe.depthRangeFor3D),$t=Qe.useProgram("terrain"),ir=N.getTerrainMesh();Oe.bindFramebuffer.set(null),Oe.viewport.set([0,0,Qe.width,Qe.height]);for(const Tr of ve){const Or=Qe.renderToTexture.getTexture(Tr),Vr=N.getTerrainData(Tr.tileID);Oe.activeTexture.set(Ue.TEXTURE0),Ue.bindTexture(Ue.TEXTURE_2D,Or.texture);const vn=Qe.transform.calculatePosMatrix(Tr.tileID.toUnwrapped()),Dn=N.getMeshFrameDelta(Qe.transform.zoom),ot=Qe.transform.calculateFogMatrix(Tr.tileID.toUnwrapped()),dt=Xr(vn,Dn,ot,Qe.style.sky,Qe.transform.pitch);$t.draw(Oe,Ue.TRIANGLES,It,Ol.disabled,Ke,ns.backCCW,dt,Vr,"terrain",ir.vertexBuffer,ir.indexBuffer,ir.segments)}}class hf{constructor(N,ve,Oe){this.vertexBuffer=N,this.indexBuffer=ve,this.segments=Oe}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class gh{constructor(N,ve){this.context=new yp(N),this.transform=ve,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:r.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Qt.maxUnderzooming+Qt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new en}resize(N,ve,Oe){if(this.width=Math.floor(N*Oe),this.height=Math.floor(ve*Oe),this.pixelRatio=Oe,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const Ue of this.style._order)this.style._layers[Ue].resize()}setup(){const N=this.context,ve=new r.aX;ve.emplaceBack(0,0),ve.emplaceBack(r.X,0),ve.emplaceBack(0,r.X),ve.emplaceBack(r.X,r.X),this.tileExtentBuffer=N.createVertexBuffer(ve,wn.members),this.tileExtentSegments=r.a0.simpleSegment(0,0,4,2);const Oe=new r.aX;Oe.emplaceBack(0,0),Oe.emplaceBack(r.X,0),Oe.emplaceBack(0,r.X),Oe.emplaceBack(r.X,r.X),this.debugBuffer=N.createVertexBuffer(Oe,wn.members),this.debugSegments=r.a0.simpleSegment(0,0,4,5);const Ue=new r.$;Ue.emplaceBack(0,0,0,0),Ue.emplaceBack(r.X,0,r.X,0),Ue.emplaceBack(0,r.X,0,r.X),Ue.emplaceBack(r.X,r.X,r.X,r.X),this.rasterBoundsBuffer=N.createVertexBuffer(Ue,it.members),this.rasterBoundsSegments=r.a0.simpleSegment(0,0,4,2);const Ke=new r.aX;Ke.emplaceBack(0,0),Ke.emplaceBack(1,0),Ke.emplaceBack(0,1),Ke.emplaceBack(1,1),this.viewportBuffer=N.createVertexBuffer(Ke,wn.members),this.viewportSegments=r.a0.simpleSegment(0,0,4,2);const It=new r.aZ;It.emplaceBack(0),It.emplaceBack(1),It.emplaceBack(3),It.emplaceBack(2),It.emplaceBack(0),this.tileBorderIndexBuffer=N.createIndexBuffer(It);const $t=new r.aY;$t.emplaceBack(0,1,2),$t.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=N.createIndexBuffer($t);const ir=this.context.gl;this.stencilClearMode=new Ol({func:ir.ALWAYS,mask:0},0,255,ir.ZERO,ir.ZERO,ir.ZERO)}clearStencil(){const N=this.context,ve=N.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const Oe=r.H();r.aP(Oe,0,this.width,this.height,0,0,1),r.K(Oe,Oe,[ve.drawingBufferWidth,ve.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(N,ve.TRIANGLES,al.disabled,this.stencilClearMode,Lu.disabled,ns.disabled,Xo(Oe),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(N,ve){if(this.currentStencilSource===N.source||!N.isTileClipped()||!ve||!ve.length)return;this.currentStencilSource=N.source;const Oe=this.context,Ue=Oe.gl;this.nextStencilID+ve.length>256&&this.clearStencil(),Oe.setColorMode(Lu.disabled),Oe.setDepthMode(al.disabled);const Ke=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const It of ve){const $t=this._tileClippingMaskIDs[It.key]=this.nextStencilID++,ir=this.style.map.terrain&&this.style.map.terrain.getTerrainData(It);Ke.draw(Oe,Ue.TRIANGLES,al.disabled,new Ol({func:Ue.ALWAYS,mask:0},$t,255,Ue.KEEP,Ue.KEEP,Ue.REPLACE),Lu.disabled,ns.disabled,Xo(It.posMatrix),ir,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const N=this.nextStencilID++,ve=this.context.gl;return new Ol({func:ve.NOTEQUAL,mask:255},N,255,ve.KEEP,ve.KEEP,ve.REPLACE)}stencilModeForClipping(N){const ve=this.context.gl;return new Ol({func:ve.EQUAL,mask:255},this._tileClippingMaskIDs[N.key],0,ve.KEEP,ve.KEEP,ve.REPLACE)}stencilConfigForOverlap(N){const ve=this.context.gl,Oe=N.sort((It,$t)=>$t.overscaledZ-It.overscaledZ),Ue=Oe[Oe.length-1].overscaledZ,Ke=Oe[0].overscaledZ-Ue+1;if(Ke>1){this.currentStencilSource=void 0,this.nextStencilID+Ke>256&&this.clearStencil();const It={};for(let $t=0;$t({u_sky_color:Rt.properties.get("sky-color"),u_horizon_color:Rt.properties.get("horizon-color"),u_horizon:(Yt.height/2+Yt.getHorizon())*Ut,u_sky_horizon_blend:Rt.properties.get("sky-horizon-blend")*Yt.height/2*Ut}))(Tr,ir.style.map.transform,ir.pixelRatio),Dn=new al(Vr.LEQUAL,al.ReadWrite,[0,1]),ot=Ol.disabled,dt=ir.colorModeForRenderPass(),St=ir.useProgram("sky");if(!Tr.mesh){const Rt=new r.aX;Rt.emplaceBack(-1,-1),Rt.emplaceBack(1,-1),Rt.emplaceBack(1,1),Rt.emplaceBack(-1,1);const Yt=new r.aY;Yt.emplaceBack(0,1,2),Yt.emplaceBack(0,2,3),Tr.mesh=new hf(Or.createVertexBuffer(Rt,wn.members),Or.createIndexBuffer(Yt),r.a0.simpleSegment(0,0,Rt.length,Yt.length))}St.draw(Or,Vr.TRIANGLES,Dn,ot,dt,ns.disabled,vn,void 0,"sky",Tr.mesh.vertexBuffer,Tr.mesh.indexBuffer,Tr.mesh.segments)})(this,this.style.sky),this._showOverdrawInspector=ve.showOverdrawInspector,this.depthRangeFor3D=[0,1-(N._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Oe.length-1;this.currentLayer>=0;this.currentLayer--){const ir=this.style._layers[Oe[this.currentLayer]],Tr=Ue[ir.source],Or=Ke[ir.source];this._renderTileClippingMasks(ir,Or),this.renderLayer(this,Tr,ir,Or)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerSt.source&&!St.isHidden(Or)?[Tr.sourceCaches[St.source]]:[]),Dn=vn.filter(St=>St.getSource().type==="vector"),ot=vn.filter(St=>St.getSource().type!=="vector"),dt=St=>{(!Vr||Vr.getSource().maxzoomdt(St)),Vr||ot.forEach(St=>dt(St)),Vr})(this.style,this.transform.zoom);ir&&(function(Tr,Or,Vr){for(let vn=0;vn0),Ue&&(r.b0(ve,Oe),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(Ke,It){const $t=Ke.context,ir=$t.gl,Tr=Lu.unblended,Or=new al(ir.LEQUAL,al.ReadWrite,[0,1]),Vr=It.getTerrainMesh(),vn=It.sourceCache.getRenderableTiles(),Dn=Ke.useProgram("terrainDepth");$t.bindFramebuffer.set(It.getFramebuffer("depth").framebuffer),$t.viewport.set([0,0,Ke.width/devicePixelRatio,Ke.height/devicePixelRatio]),$t.clear({color:r.aM.transparent,depth:1});for(const ot of vn){const dt=It.getTerrainData(ot.tileID),St={u_matrix:Ke.transform.calculatePosMatrix(ot.tileID.toUnwrapped()),u_ele_delta:It.getMeshFrameDelta(Ke.transform.zoom)};Dn.draw($t,ir.TRIANGLES,Or,Ol.disabled,Tr,ns.backCCW,St,dt,"terrain",Vr.vertexBuffer,Vr.indexBuffer,Vr.segments)}$t.bindFramebuffer.set(null),$t.viewport.set([0,0,Ke.width,Ke.height])})(this,this.style.map.terrain),(function(Ke,It){const $t=Ke.context,ir=$t.gl,Tr=Lu.unblended,Or=new al(ir.LEQUAL,al.ReadWrite,[0,1]),Vr=It.getTerrainMesh(),vn=It.getCoordsTexture(),Dn=It.sourceCache.getRenderableTiles(),ot=Ke.useProgram("terrainCoords");$t.bindFramebuffer.set(It.getFramebuffer("coords").framebuffer),$t.viewport.set([0,0,Ke.width/devicePixelRatio,Ke.height/devicePixelRatio]),$t.clear({color:r.aM.transparent,depth:1}),It.coordsIndex=[];for(const dt of Dn){const St=It.getTerrainData(dt.tileID);$t.activeTexture.set(ir.TEXTURE0),ir.bindTexture(ir.TEXTURE_2D,vn.texture);const Rt={u_matrix:Ke.transform.calculatePosMatrix(dt.tileID.toUnwrapped()),u_terrain_coords_id:(255-It.coordsIndex.length)/255,u_texture:0,u_ele_delta:It.getMeshFrameDelta(Ke.transform.zoom)};ot.draw($t,ir.TRIANGLES,Or,Ol.disabled,Tr,ns.backCCW,Rt,St,"terrain",Vr.vertexBuffer,Vr.indexBuffer,Vr.segments),It.coordsIndex.push(dt.tileID.key)}$t.bindFramebuffer.set(null),$t.viewport.set([0,0,Ke.width,Ke.height])})(this,this.style.map.terrain))}renderLayer(N,ve,Oe,Ue){if(!Oe.isHidden(this.transform.zoom)&&(Oe.type==="background"||Oe.type==="custom"||(Ue||[]).length))switch(this.id=Oe.id,Oe.type){case"symbol":(function(Ke,It,$t,ir,Tr){if(Ke.renderPass!=="translucent")return;const Or=Ol.disabled,Vr=Ke.colorModeForRenderPass();($t._unevaluatedLayout.hasValue("text-variable-anchor")||$t._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(vn,Dn,ot,dt,St,Rt,Yt,Ut,er){const Mr=Dn.transform,Nr=Wa(),jr=St==="map",sn=Rt==="map";for(const xn of vn){const $n=dt.getTile(xn),Wn=$n.getBucket(ot);if(!Wn||!Wn.text||!Wn.text.segments.get().length)continue;const ua=r.ag(Wn.textSizeData,Mr.zoom),Ua=ha($n,1,Dn.transform.zoom),Si=Fr(xn.posMatrix,sn,jr,Dn.transform,Ua),gi=ot.layout.get("icon-text-fit")!=="none"&&Wn.hasIconData();if(ua){const Mi=Math.pow(2,Mr.zoom-$n.tileID.overscaledZ),Ao=Dn.style.map.terrain?(Bo,vs)=>Dn.style.map.terrain.getElevation(xn,Bo,vs):null,qo=Nr.translatePosition(Mr,$n,Yt,Ut);Wh(Wn,jr,sn,er,Mr,Si,xn.posMatrix,Mi,ua,gi,Nr,qo,xn.toUnwrapped(),Ao)}}})(ir,Ke,$t,It,$t.layout.get("text-rotation-alignment"),$t.layout.get("text-pitch-alignment"),$t.paint.get("text-translate"),$t.paint.get("text-translate-anchor"),Tr),$t.paint.get("icon-opacity").constantOr(1)!==0&&Jd(Ke,It,$t,ir,!1,$t.paint.get("icon-translate"),$t.paint.get("icon-translate-anchor"),$t.layout.get("icon-rotation-alignment"),$t.layout.get("icon-pitch-alignment"),$t.layout.get("icon-keep-upright"),Or,Vr),$t.paint.get("text-opacity").constantOr(1)!==0&&Jd(Ke,It,$t,ir,!0,$t.paint.get("text-translate"),$t.paint.get("text-translate-anchor"),$t.layout.get("text-rotation-alignment"),$t.layout.get("text-pitch-alignment"),$t.layout.get("text-keep-upright"),Or,Vr),It.map.showCollisionBoxes&&(Pf(Ke,It,$t,ir,!0),Pf(Ke,It,$t,ir,!1))})(N,ve,Oe,Ue,this.style.placement.variableOffsets);break;case"circle":(function(Ke,It,$t,ir){if(Ke.renderPass!=="translucent")return;const Tr=$t.paint.get("circle-opacity"),Or=$t.paint.get("circle-stroke-width"),Vr=$t.paint.get("circle-stroke-opacity"),vn=!$t.layout.get("circle-sort-key").isConstant();if(Tr.constantOr(1)===0&&(Or.constantOr(1)===0||Vr.constantOr(1)===0))return;const Dn=Ke.context,ot=Dn.gl,dt=Ke.depthModeForSublayer(0,al.ReadOnly),St=Ol.disabled,Rt=Ke.colorModeForRenderPass(),Yt=[];for(let Ut=0;UtUt.sortKey-er.sortKey);for(const Ut of Yt){const{programConfiguration:er,program:Mr,layoutVertexBuffer:Nr,indexBuffer:jr,uniformValues:sn,terrainData:xn}=Ut.state;Mr.draw(Dn,ot.TRIANGLES,dt,St,Rt,ns.disabled,sn,xn,$t.id,Nr,jr,Ut.segments,$t.paint,Ke.transform.zoom,er)}})(N,ve,Oe,Ue);break;case"heatmap":(function(Ke,It,$t,ir){if($t.paint.get("heatmap-opacity")===0)return;const Tr=Ke.context;if(Ke.style.map.terrain){for(const Or of ir){const Vr=It.getTile(Or);It.hasRenderableParent(Or)||(Ke.renderPass==="offscreen"?Xh(Ke,Vr,$t,Or):Ke.renderPass==="translucent"&&mh(Ke,$t,Or))}Tr.viewport.set([0,0,Ke.width,Ke.height])}else Ke.renderPass==="offscreen"?(function(Or,Vr,vn,Dn){const ot=Or.context,dt=ot.gl,St=Ol.disabled,Rt=new Lu([dt.ONE,dt.ONE],r.aM.transparent,[!0,!0,!0,!0]);(function(Yt,Ut,er){const Mr=Yt.gl;Yt.activeTexture.set(Mr.TEXTURE1),Yt.viewport.set([0,0,Ut.width/4,Ut.height/4]);let Nr=er.heatmapFbos.get(r.aU);Nr?(Mr.bindTexture(Mr.TEXTURE_2D,Nr.colorAttachment.get()),Yt.bindFramebuffer.set(Nr.framebuffer)):(Nr=wd(Yt,Ut.width/4,Ut.height/4),er.heatmapFbos.set(r.aU,Nr))})(ot,Or,vn),ot.clear({color:r.aM.transparent});for(let Yt=0;Yt20&&Or.texParameterf(Or.TEXTURE_2D,Tr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Tr.extTextureFilterAnisotropicMax);const Wn=Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(Yt),ua=Wn?Yt:null,Ua=ua?ua.posMatrix:Ke.transform.calculatePosMatrix(Yt.toUnwrapped(),Rt),Si=Il(Ua,xn||[0,0],sn||1,jr,$t);Vr instanceof yt?vn.draw(Tr,Or.TRIANGLES,Ut,Ol.disabled,Dn,ns.disabled,Si,Wn,$t.id,Vr.boundsBuffer,Ke.quadTriangleIndexBuffer,Vr.boundsSegments):vn.draw(Tr,Or.TRIANGLES,Ut,ot[Yt.overscaledZ],Dn,ns.disabled,Si,Wn,$t.id,Ke.rasterBoundsBuffer,Ke.quadTriangleIndexBuffer,Ke.rasterBoundsSegments)}})(N,ve,Oe,Ue);break;case"background":(function(Ke,It,$t,ir){const Tr=$t.paint.get("background-color"),Or=$t.paint.get("background-opacity");if(Or===0)return;const Vr=Ke.context,vn=Vr.gl,Dn=Ke.transform,ot=Dn.tileSize,dt=$t.paint.get("background-pattern");if(Ke.isPatternMissing(dt))return;const St=!dt&&Tr.a===1&&Or===1&&Ke.opaquePassEnabledForLayer()?"opaque":"translucent";if(Ke.renderPass!==St)return;const Rt=Ol.disabled,Yt=Ke.depthModeForSublayer(0,St==="opaque"?al.ReadWrite:al.ReadOnly),Ut=Ke.colorModeForRenderPass(),er=Ke.useProgram(dt?"backgroundPattern":"background"),Mr=ir||Dn.coveringTiles({tileSize:ot,terrain:Ke.style.map.terrain});dt&&(Vr.activeTexture.set(vn.TEXTURE0),Ke.imageManager.bind(Ke.context));const Nr=$t.getCrossfadeParameters();for(const jr of Mr){const sn=ir?jr.posMatrix:Ke.transform.calculatePosMatrix(jr.toUnwrapped()),xn=dt?Kl(sn,Or,Ke,dt,{tileID:jr,tileSize:ot},Nr):Ll(sn,Or,Tr),$n=Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(jr);er.draw(Vr,vn.TRIANGLES,Yt,Rt,Ut,ns.disabled,xn,$n,$t.id,Ke.tileExtentBuffer,Ke.quadTriangleIndexBuffer,Ke.tileExtentSegments)}})(N,0,Oe,Ue);break;case"custom":(function(Ke,It,$t){const ir=Ke.context,Tr=$t.implementation;if(Ke.renderPass==="offscreen"){const Or=Tr.prerender;Or&&(Ke.setCustomLayerDefaults(),ir.setColorMode(Ke.colorModeForRenderPass()),Or.call(Tr,ir.gl,Ke.transform.customLayerMatrix()),ir.setDirty(),Ke.setBaseState())}else if(Ke.renderPass==="translucent"){Ke.setCustomLayerDefaults(),ir.setColorMode(Ke.colorModeForRenderPass()),ir.setStencilMode(Ol.disabled);const Or=Tr.renderingMode==="3d"?new al(Ke.context.gl.LEQUAL,al.ReadWrite,Ke.depthRangeFor3D):Ke.depthModeForSublayer(0,al.ReadOnly);ir.setDepthMode(Or),Tr.render(ir.gl,Ke.transform.customLayerMatrix(),{farZ:Ke.transform.farZ,nearZ:Ke.transform.nearZ,fov:Ke.transform._fov,modelViewProjectionMatrix:Ke.transform.modelViewProjectionMatrix,projectionMatrix:Ke.transform.projectionMatrix}),ir.setDirty(),Ke.setBaseState(),ir.bindFramebuffer.set(null)}})(N,0,Oe)}}translatePosMatrix(N,ve,Oe,Ue,Ke){if(!Oe[0]&&!Oe[1])return N;const It=Ke?Ue==="map"?this.transform.angle:0:Ue==="viewport"?-this.transform.angle:0;if(It){const Tr=Math.sin(It),Or=Math.cos(It);Oe=[Oe[0]*Or-Oe[1]*Tr,Oe[0]*Tr+Oe[1]*Or]}const $t=[Ke?Oe[0]:ha(ve,Oe[0],this.transform.zoom),Ke?Oe[1]:ha(ve,Oe[1],this.transform.zoom),0],ir=new Float32Array(16);return r.J(ir,N,$t),ir}saveTileTexture(N){const ve=this._tileTextures[N.size[0]];ve?ve.push(N):this._tileTextures[N.size[0]]=[N]}getTileTexture(N){const ve=this._tileTextures[N];return ve&&ve.length>0?ve.pop():null}isPatternMissing(N){if(!N)return!1;if(!N.from||!N.to)return!0;const ve=this.imageManager.getPattern(N.from.toString()),Oe=this.imageManager.getPattern(N.to.toString());return!ve||!Oe}useProgram(N,ve){this.cache=this.cache||{};const Oe=N+(ve?ve.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Oe]||(this.cache[Oe]=new Xn(this.context,dn[N],ve,eu[N],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Oe]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const N=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(N.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new h(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:N,drawingBufferHeight:ve}=this.context.gl;return this.width!==N||this.height!==ve}}class bu{constructor(N,ve){this.points=N,this.planes=ve}static fromInvProjectionMatrix(N,ve,Oe){const Ue=Math.pow(2,Oe),Ke=[[-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]].map($t=>{const ir=1/($t=r.af([],$t,N))[3]/ve*Ue;return r.b1($t,$t,[ir,ir,1/$t[3],ir])}),It=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map($t=>{const ir=(function(vn,Dn){var ot=Dn[0],dt=Dn[1],St=Dn[2],Rt=ot*ot+dt*dt+St*St;return Rt>0&&(Rt=1/Math.sqrt(Rt)),vn[0]=Dn[0]*Rt,vn[1]=Dn[1]*Rt,vn[2]=Dn[2]*Rt,vn})([],(function(vn,Dn,ot){var dt=Dn[0],St=Dn[1],Rt=Dn[2],Yt=ot[0],Ut=ot[1],er=ot[2];return vn[0]=St*er-Rt*Ut,vn[1]=Rt*Yt-dt*er,vn[2]=dt*Ut-St*Yt,vn})([],I([],Ke[$t[0]],Ke[$t[1]]),I([],Ke[$t[2]],Ke[$t[1]]))),Tr=-((Or=ir)[0]*(Vr=Ke[$t[1]])[0]+Or[1]*Vr[1]+Or[2]*Vr[2]);var Or,Vr;return ir.concat(Tr)});return new bu(Ke,It)}}class ah{constructor(N,ve){this.min=N,this.max=ve,this.center=(function(Oe,Ue,Ke){return Oe[0]=.5*Ue[0],Oe[1]=.5*Ue[1],Oe[2]=.5*Ue[2],Oe})([],(function(Oe,Ue,Ke){return Oe[0]=Ue[0]+Ke[0],Oe[1]=Ue[1]+Ke[1],Oe[2]=Ue[2]+Ke[2],Oe})([],this.min,this.max))}quadrant(N){const ve=[N%2==0,N<2],Oe=A(this.min),Ue=A(this.max);for(let Ke=0;Ke=0&&It++;if(It===0)return 0;It!==ve.length&&(Oe=!1)}if(Oe)return 2;for(let Ue=0;Ue<3;Ue++){let Ke=Number.MAX_VALUE,It=-Number.MAX_VALUE;for(let $t=0;$tthis.max[Ue]-this.min[Ue])return 0}return 1}}class Vc{constructor(N=0,ve=0,Oe=0,Ue=0){if(isNaN(N)||N<0||isNaN(ve)||ve<0||isNaN(Oe)||Oe<0||isNaN(Ue)||Ue<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=N,this.bottom=ve,this.left=Oe,this.right=Ue}interpolate(N,ve,Oe){return ve.top!=null&&N.top!=null&&(this.top=r.y.number(N.top,ve.top,Oe)),ve.bottom!=null&&N.bottom!=null&&(this.bottom=r.y.number(N.bottom,ve.bottom,Oe)),ve.left!=null&&N.left!=null&&(this.left=r.y.number(N.left,ve.left,Oe)),ve.right!=null&&N.right!=null&&(this.right=r.y.number(N.right,ve.right,Oe)),this}getCenter(N,ve){const Oe=r.ac((this.left+N-this.right)/2,0,N),Ue=r.ac((this.top+ve-this.bottom)/2,0,ve);return new r.P(Oe,Ue)}equals(N){return this.top===N.top&&this.bottom===N.bottom&&this.left===N.left&&this.right===N.right}clone(){return new Vc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const df=85.051129;class Ru{constructor(N,ve,Oe,Ue,Ke){this.tileSize=512,this._renderWorldCopies=Ke===void 0||!!Ke,this._minZoom=N||0,this._maxZoom=ve||22,this._minPitch=Oe??0,this._maxPitch=Ue??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new r.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Vc,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const N=new Ru(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return N.apply(this),N}apply(N){this.tileSize=N.tileSize,this.latRange=N.latRange,this.lngRange=N.lngRange,this.width=N.width,this.height=N.height,this._center=N._center,this._elevation=N._elevation,this.minElevationForCurrentTile=N.minElevationForCurrentTile,this.zoom=N.zoom,this.angle=N.angle,this._fov=N._fov,this._pitch=N._pitch,this._unmodified=N._unmodified,this._edgeInsets=N._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(N){this._minZoom!==N&&(this._minZoom=N,this.zoom=Math.max(this.zoom,N))}get maxZoom(){return this._maxZoom}set maxZoom(N){this._maxZoom!==N&&(this._maxZoom=N,this.zoom=Math.min(this.zoom,N))}get minPitch(){return this._minPitch}set minPitch(N){this._minPitch!==N&&(this._minPitch=N,this.pitch=Math.max(this.pitch,N))}get maxPitch(){return this._maxPitch}set maxPitch(N){this._maxPitch!==N&&(this._maxPitch=N,this.pitch=Math.min(this.pitch,N))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(N){N===void 0?N=!0:N===null&&(N=!1),this._renderWorldCopies=N}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new r.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(N){const ve=-r.b3(N,-180,180)*Math.PI/180;this.angle!==ve&&(this._unmodified=!1,this.angle=ve,this._calcMatrices(),this.rotationMatrix=(function(){var Oe=new r.A(4);return r.A!=Float32Array&&(Oe[1]=0,Oe[2]=0),Oe[0]=1,Oe[3]=1,Oe})(),(function(Oe,Ue,Ke){var It=Ue[0],$t=Ue[1],ir=Ue[2],Tr=Ue[3],Or=Math.sin(Ke),Vr=Math.cos(Ke);Oe[0]=It*Vr+ir*Or,Oe[1]=$t*Vr+Tr*Or,Oe[2]=It*-Or+ir*Vr,Oe[3]=$t*-Or+Tr*Vr})(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(N){const ve=r.ac(N,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==ve&&(this._unmodified=!1,this._pitch=ve,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(N){N=Math.max(.01,Math.min(60,N)),this._fov!==N&&(this._unmodified=!1,this._fov=N/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(N){const ve=Math.min(Math.max(N,this.minZoom),this.maxZoom);this._zoom!==ve&&(this._unmodified=!1,this._zoom=ve,this.tileZoom=Math.max(0,Math.floor(ve)),this.scale=this.zoomScale(ve),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(N){N.lat===this._center.lat&&N.lng===this._center.lng||(this._unmodified=!1,this._center=N,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(N){N!==this._elevation&&(this._elevation=N,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(N){this._edgeInsets.equals(N)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,N,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(N){return this._edgeInsets.equals(N)}interpolatePadding(N,ve,Oe){this._unmodified=!1,this._edgeInsets.interpolate(N,ve,Oe),this._constrain(),this._calcMatrices()}coveringZoomLevel(N){const ve=(N.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/N.tileSize));return Math.max(0,ve)}getVisibleUnwrappedCoordinates(N){const ve=[new r.b4(0,N)];if(this._renderWorldCopies){const Oe=this.pointCoordinate(new r.P(0,0)),Ue=this.pointCoordinate(new r.P(this.width,0)),Ke=this.pointCoordinate(new r.P(this.width,this.height)),It=this.pointCoordinate(new r.P(0,this.height)),$t=Math.floor(Math.min(Oe.x,Ue.x,Ke.x,It.x)),ir=Math.floor(Math.max(Oe.x,Ue.x,Ke.x,It.x)),Tr=1;for(let Or=$t-Tr;Or<=ir+Tr;Or++)Or!==0&&ve.push(new r.b4(Or,N))}return ve}coveringTiles(N){var ve,Oe;let Ue=this.coveringZoomLevel(N);const Ke=Ue;if(N.minzoom!==void 0&&UeN.maxzoom&&(Ue=N.maxzoom);const It=this.pointCoordinate(this.getCameraPoint()),$t=r.Z.fromLngLat(this.center),ir=Math.pow(2,Ue),Tr=[ir*It.x,ir*It.y,0],Or=[ir*$t.x,ir*$t.y,0],Vr=bu.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Ue);let vn=N.minzoom||0;!N.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(vn=Ue);const Dn=N.terrain?2/Math.min(this.tileSize,N.tileSize)*this.tileSize:3,ot=Ut=>({aabb:new ah([Ut*ir,0,0],[(Ut+1)*ir,ir,0]),zoom:0,x:0,y:0,wrap:Ut,fullyVisible:!1}),dt=[],St=[],Rt=Ue,Yt=N.reparseOverscaled?Ke:Ue;if(this._renderWorldCopies)for(let Ut=1;Ut<=3;Ut++)dt.push(ot(-Ut)),dt.push(ot(Ut));for(dt.push(ot(0));dt.length>0;){const Ut=dt.pop(),er=Ut.x,Mr=Ut.y;let Nr=Ut.fullyVisible;if(!Nr){const Wn=Ut.aabb.intersects(Vr);if(Wn===0)continue;Nr=Wn===2}const jr=N.terrain?Tr:Or,sn=Ut.aabb.distanceX(jr),xn=Ut.aabb.distanceY(jr),$n=Math.max(Math.abs(sn),Math.abs(xn));if(Ut.zoom===Rt||$n>Dn+(1<=vn){const Wn=Rt-Ut.zoom,ua=Tr[0]-.5-(er<>1),Si=Ut.zoom+1;let gi=Ut.aabb.quadrant(Wn);if(N.terrain){const Mi=new r.S(Si,Ut.wrap,Si,ua,Ua),Ao=N.terrain.getMinMaxElevation(Mi),qo=(ve=Ao.minElevation)!==null&&ve!==void 0?ve:this.elevation,Bo=(Oe=Ao.maxElevation)!==null&&Oe!==void 0?Oe:this.elevation;gi=new ah([gi.min[0],gi.min[1],qo],[gi.max[0],gi.max[1],Bo])}dt.push({aabb:gi,zoom:Si,x:ua,y:Ua,wrap:Ut.wrap,fullyVisible:Nr})}}return St.sort((Ut,er)=>Ut.distanceSq-er.distanceSq).map(Ut=>Ut.tileID)}resize(N,ve){this.width=N,this.height=ve,this.pixelsToGLUnits=[2/N,-2/ve],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(N){return Math.pow(2,N)}scaleZoom(N){return Math.log(N)/Math.LN2}project(N){const ve=r.ac(N.lat,-85.051129,df);return new r.P(r.O(N.lng)*this.worldSize,r.Q(ve)*this.worldSize)}unproject(N){return new r.Z(N.x/this.worldSize,N.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(N){const ve=this.elevation,Oe=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Ue=this.pointLocation(this.centerPoint,N),Ke=N.getElevationForLngLatZoom(Ue,this.tileZoom);if(!(this.elevation-Ke))return;const It=Oe+ve-Ke,$t=Math.cos(this._pitch)*this.cameraToCenterDistance/It/r.b5(1,Ue.lat),ir=this.scaleZoom($t/this.tileSize);this._elevation=Ke,this._center=Ue,this.zoom=ir}setLocationAtPoint(N,ve){const Oe=this.pointCoordinate(ve),Ue=this.pointCoordinate(this.centerPoint),Ke=this.locationCoordinate(N),It=new r.Z(Ke.x-(Oe.x-Ue.x),Ke.y-(Oe.y-Ue.y));this.center=this.coordinateLocation(It),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(N,ve){return ve?this.coordinatePoint(this.locationCoordinate(N),ve.getElevationForLngLatZoom(N,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(N))}pointLocation(N,ve){return this.coordinateLocation(this.pointCoordinate(N,ve))}locationCoordinate(N){return r.Z.fromLngLat(N)}coordinateLocation(N){return N&&N.toLngLat()}pointCoordinate(N,ve){if(ve){const vn=ve.pointCoordinate(N);if(vn!=null)return vn}const Oe=[N.x,N.y,0,1],Ue=[N.x,N.y,1,1];r.af(Oe,Oe,this.pixelMatrixInverse),r.af(Ue,Ue,this.pixelMatrixInverse);const Ke=Oe[3],It=Ue[3],$t=Oe[1]/Ke,ir=Ue[1]/It,Tr=Oe[2]/Ke,Or=Ue[2]/It,Vr=Tr===Or?0:(0-Tr)/(Or-Tr);return new r.Z(r.y.number(Oe[0]/Ke,Ue[0]/It,Vr)/this.worldSize,r.y.number($t,ir,Vr)/this.worldSize)}coordinatePoint(N,ve=0,Oe=this.pixelMatrix){const Ue=[N.x*this.worldSize,N.y*this.worldSize,ve,1];return r.af(Ue,Ue,Oe),new r.P(Ue[0]/Ue[3],Ue[1]/Ue[3])}getBounds(){const N=Math.max(0,this.height/2-this.getHorizon());return new pe().extend(this.pointLocation(new r.P(0,N))).extend(this.pointLocation(new r.P(this.width,N))).extend(this.pointLocation(new r.P(this.width,this.height))).extend(this.pointLocation(new r.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new pe([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(N){N?(this.lngRange=[N.getWest(),N.getEast()],this.latRange=[N.getSouth(),N.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,df])}calculateTileMatrix(N){const ve=N.canonical,Oe=this.worldSize/this.zoomScale(ve.z),Ue=ve.x+Math.pow(2,ve.z)*N.wrap,Ke=r.an(new Float64Array(16));return r.J(Ke,Ke,[Ue*Oe,ve.y*Oe,0]),r.K(Ke,Ke,[Oe/r.X,Oe/r.X,1]),Ke}calculatePosMatrix(N,ve=!1){const Oe=N.key,Ue=ve?this._alignedPosMatrixCache:this._posMatrixCache;if(Ue[Oe])return Ue[Oe];const Ke=this.calculateTileMatrix(N);return r.L(Ke,ve?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Ke),Ue[Oe]=new Float32Array(Ke),Ue[Oe]}calculateFogMatrix(N){const ve=N.key,Oe=this._fogMatrixCache;if(Oe[ve])return Oe[ve];const Ue=this.calculateTileMatrix(N);return r.L(Ue,this.fogMatrix,Ue),Oe[ve]=new Float32Array(Ue),Oe[ve]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(N,ve){ve=r.ac(+ve,this.minZoom,this.maxZoom);const Oe={center:new r.N(N.lng,N.lat),zoom:ve};let Ue=this.lngRange;if(!this._renderWorldCopies&&Ue===null){const Ut=179.9999999999;Ue=[-Ut,Ut]}const Ke=this.tileSize*this.zoomScale(Oe.zoom);let It=0,$t=Ke,ir=0,Tr=Ke,Or=0,Vr=0;const{x:vn,y:Dn}=this.size;if(this.latRange){const Ut=this.latRange;It=r.Q(Ut[1])*Ke,$t=r.Q(Ut[0])*Ke,$t-It$t&&(Rt=$t-Ut)}if(Ue){const Ut=(ir+Tr)/2;let er=ot;this._renderWorldCopies&&(er=r.b3(ot,Ut-Ke/2,Ut+Ke/2));const Mr=vn/2;er-MrTr&&(St=Tr-Mr)}if(St!==void 0||Rt!==void 0){const Ut=new r.P(St??ot,Rt??dt);Oe.center=this.unproject.call({worldSize:Ke},Ut).wrap()}return Oe}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const N=this._unmodified,{center:ve,zoom:Oe}=this.getConstrained(this.center,this.zoom);this.center=ve,this.zoom=Oe,this._unmodified=N,this._constraining=!1}_calcMatrices(){if(!this.height)return;const N=this.centerOffset,ve=this.point.x,Oe=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=r.b5(1,this.center.lat)*this.worldSize;let Ue=r.an(new Float64Array(16));r.K(Ue,Ue,[this.width/2,-this.height/2,1]),r.J(Ue,Ue,[1,-1,0]),this.labelPlaneMatrix=Ue,Ue=r.an(new Float64Array(16)),r.K(Ue,Ue,[1,-1,1]),r.J(Ue,Ue,[-1,-1,0]),r.K(Ue,Ue,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ue;const Ke=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),It=Math.min(this.elevation,this.minElevationForCurrentTile),$t=Ke-It*this._pixelPerMeter/Math.cos(this._pitch),ir=It<0?$t:Ke,Tr=Math.PI/2+this._pitch,Or=this._fov*(.5+N.y/this.height),Vr=Math.sin(Or)*ir/Math.sin(r.ac(Math.PI-Tr-Or,.01,Math.PI-.01)),vn=this.getHorizon(),Dn=2*Math.atan(vn/this.cameraToCenterDistance)*(.5+N.y/(2*vn)),ot=Math.sin(Dn)*ir/Math.sin(r.ac(Math.PI-Tr-Dn,.01,Math.PI-.01)),dt=Math.min(Vr,ot);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*dt+ir),this.nearZ=this.height/50,Ue=new Float64Array(16),r.b6(Ue,this._fov,this.width/this.height,this.nearZ,this.farZ),Ue[8]=2*-N.x/this.width,Ue[9]=2*N.y/this.height,this.projectionMatrix=r.ae(Ue),r.K(Ue,Ue,[1,-1,1]),r.J(Ue,Ue,[0,0,-this.cameraToCenterDistance]),r.b7(Ue,Ue,this._pitch),r.ad(Ue,Ue,this.angle),r.J(Ue,Ue,[-ve,-Oe,0]),this.mercatorMatrix=r.K([],Ue,[this.worldSize,this.worldSize,this.worldSize]),r.K(Ue,Ue,[1,1,this._pixelPerMeter]),this.pixelMatrix=r.L(new Float64Array(16),this.labelPlaneMatrix,Ue),r.J(Ue,Ue,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Ue,this.invModelViewProjectionMatrix=r.as([],Ue),this.fogMatrix=new Float64Array(16),r.b6(this.fogMatrix,this._fov,this.width/this.height,Ke,this.farZ),this.fogMatrix[8]=2*-N.x/this.width,this.fogMatrix[9]=2*N.y/this.height,r.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),r.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),r.b7(this.fogMatrix,this.fogMatrix,this._pitch),r.ad(this.fogMatrix,this.fogMatrix,this.angle),r.J(this.fogMatrix,this.fogMatrix,[-ve,-Oe,0]),r.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),r.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=r.L(new Float64Array(16),this.labelPlaneMatrix,Ue);const St=this.width%2/2,Rt=this.height%2/2,Yt=Math.cos(this.angle),Ut=Math.sin(this.angle),er=ve-Math.round(ve)+Yt*St+Ut*Rt,Mr=Oe-Math.round(Oe)+Yt*Rt+Ut*St,Nr=new Float64Array(Ue);if(r.J(Nr,Nr,[er>.5?er-1:er,Mr>.5?Mr-1:Mr,0]),this.alignedModelViewProjectionMatrix=Nr,Ue=r.as(new Float64Array(16),this.pixelMatrix),!Ue)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ue,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const N=this.pointCoordinate(new r.P(0,0)),ve=[N.x*this.worldSize,N.y*this.worldSize,0,1];return r.af(ve,ve,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const N=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new r.P(0,N))}getCameraQueryGeometry(N){const ve=this.getCameraPoint();if(N.length===1)return[N[0],ve];{let Oe=ve.x,Ue=ve.y,Ke=ve.x,It=ve.y;for(const $t of N)Oe=Math.min(Oe,$t.x),Ue=Math.min(Ue,$t.y),Ke=Math.max(Ke,$t.x),It=Math.max(It,$t.y);return[new r.P(Oe,Ue),new r.P(Ke,Ue),new r.P(Ke,It),new r.P(Oe,It),new r.P(Oe,Ue)]}}lngLatToCameraDepth(N,ve){const Oe=this.locationCoordinate(N),Ue=[Oe.x*this.worldSize,Oe.y*this.worldSize,ve,1];return r.af(Ue,Ue,this.modelViewProjectionMatrix),Ue[2]/Ue[3]}}function Nh(Qe,N){let ve,Oe=!1,Ue=null,Ke=null;const It=()=>{Ue=null,Oe&&(Qe.apply(Ke,ve),Ue=setTimeout(It,N),Oe=!1)};return(...$t)=>(Oe=!0,Ke=this,ve=$t,Ue||It(),Ue)}class qf{constructor(N){this._getCurrentHash=()=>{const ve=window.location.hash.replace("#","");if(this._hashName){let Oe;return ve.split("&").map(Ue=>Ue.split("=")).forEach(Ue=>{Ue[0]===this._hashName&&(Oe=Ue)}),(Oe&&Oe[1]||"").split("/")}return ve.split("/")},this._onHashChange=()=>{const ve=this._getCurrentHash();if(ve.length>=3&&!ve.some(Oe=>isNaN(Oe))){const Oe=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(ve[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+ve[2],+ve[1]],zoom:+ve[0],bearing:Oe,pitch:+(ve[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const ve=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,ve)},this._removeHash=()=>{const ve=this._getCurrentHash();if(ve.length===0)return;const Oe=ve.join("/");let Ue=Oe;Ue.split("&").length>0&&(Ue=Ue.split("&")[0]),this._hashName&&(Ue=`${this._hashName}=${Oe}`);let Ke=window.location.hash.replace(Ue,"");Ke.startsWith("#&")?Ke=Ke.slice(0,1)+Ke.slice(2):Ke==="#"&&(Ke="");let It=window.location.href.replace(/(#.+)?$/,Ke);It=It.replace("&&","&"),window.history.replaceState(window.history.state,null,It)},this._updateHash=Nh(this._updateHashUnthrottled,300),this._hashName=N&&encodeURIComponent(N)}addTo(N){return this._map=N,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(N){const ve=this._map.getCenter(),Oe=Math.round(100*this._map.getZoom())/100,Ue=Math.ceil((Oe*Math.LN2+Math.log(512/360/.5))/Math.LN10),Ke=Math.pow(10,Ue),It=Math.round(ve.lng*Ke)/Ke,$t=Math.round(ve.lat*Ke)/Ke,ir=this._map.getBearing(),Tr=this._map.getPitch();let Or="";if(Or+=N?`/${It}/${$t}/${Oe}`:`${Oe}/${$t}/${It}`,(ir||Tr)&&(Or+="/"+Math.round(10*ir)/10),Tr&&(Or+=`/${Math.round(Tr)}`),this._hashName){const Vr=this._hashName;let vn=!1;const Dn=window.location.hash.slice(1).split("&").map(ot=>{const dt=ot.split("=")[0];return dt===Vr?(vn=!0,`${dt}=${Or}`):ot}).filter(ot=>ot);return vn||Dn.push(`${Vr}=${Or}`),`#${Dn.join("&")}`}return`#${Or}`}}const yh={linearity:.3,easing:r.b8(0,0,.3,1)},od=r.e({deceleration:2500,maxSpeed:1400},yh),xp=r.e({deceleration:20,maxSpeed:1400},yh),Jp=r.e({deceleration:1e3,maxSpeed:360},yh),Oh=r.e({deceleration:1e3,maxSpeed:90},yh);class sd{constructor(N){this._map=N,this.clear()}clear(){this._inertiaBuffer=[]}record(N){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.now(),settings:N})}_drainInertiaBuffer(){const N=this._inertiaBuffer,ve=s.now();for(;N.length>0&&ve-N[0].time>160;)N.shift()}_onMoveEnd(N){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const ve={zoom:0,bearing:0,pitch:0,pan:new r.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Ke}of this._inertiaBuffer)ve.zoom+=Ke.zoomDelta||0,ve.bearing+=Ke.bearingDelta||0,ve.pitch+=Ke.pitchDelta||0,Ke.panDelta&&ve.pan._add(Ke.panDelta),Ke.around&&(ve.around=Ke.around),Ke.pinchAround&&(ve.pinchAround=Ke.pinchAround);const Oe=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Ue={};if(ve.pan.mag()){const Ke=ld(ve.pan.mag(),Oe,r.e({},od,N||{}));Ue.offset=ve.pan.mult(Ke.amount/ve.pan.mag()),Ue.center=this._map.transform.center,Af(Ue,Ke)}if(ve.zoom){const Ke=ld(ve.zoom,Oe,xp);Ue.zoom=this._map.transform.zoom+Ke.amount,Af(Ue,Ke)}if(ve.bearing){const Ke=ld(ve.bearing,Oe,Jp);Ue.bearing=this._map.transform.bearing+r.ac(Ke.amount,-179,179),Af(Ue,Ke)}if(ve.pitch){const Ke=ld(ve.pitch,Oe,Oh);Ue.pitch=this._map.transform.pitch+Ke.amount,Af(Ue,Ke)}if(Ue.zoom||Ue.bearing){const Ke=ve.pinchAround===void 0?ve.around:ve.pinchAround;Ue.around=Ke?this._map.unproject(Ke):this._map.getCenter()}return this.clear(),r.e(Ue,{noMoveStart:!0})}}function Af(Qe,N){(!Qe.duration||Qe.durationve.unproject(ir)),$t=Ke.reduce((ir,Tr,Or,Vr)=>ir.add(Tr.div(Vr.length)),new r.P(0,0));super(N,{points:Ke,point:$t,lngLats:It,lngLat:ve.unproject($t),originalEvent:Oe}),this._defaultPrevented=!1}}class Nd extends r.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(N,ve,Oe){super(N,{originalEvent:Oe}),this._defaultPrevented=!1}}class Bh{constructor(N,ve){this._map=N,this._clickTolerance=ve.clickTolerance}reset(){delete this._mousedownPos}wheel(N){return this._firePreventable(new Nd(N.type,this._map,N))}mousedown(N,ve){return this._mousedownPos=ve,this._firePreventable(new Dc(N.type,this._map,N))}mouseup(N){this._map.fire(new Dc(N.type,this._map,N))}click(N,ve){this._mousedownPos&&this._mousedownPos.dist(ve)>=this._clickTolerance||this._map.fire(new Dc(N.type,this._map,N))}dblclick(N){return this._firePreventable(new Dc(N.type,this._map,N))}mouseover(N){this._map.fire(new Dc(N.type,this._map,N))}mouseout(N){this._map.fire(new Dc(N.type,this._map,N))}touchstart(N){return this._firePreventable(new Fh(N.type,this._map,N))}touchmove(N){this._map.fire(new Fh(N.type,this._map,N))}touchend(N){this._map.fire(new Fh(N.type,this._map,N))}touchcancel(N){this._map.fire(new Fh(N.type,this._map,N))}_firePreventable(N){if(this._map.fire(N),N.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Au{constructor(N){this._map=N}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(N){this._map.fire(new Dc(N.type,this._map,N))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dc("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(N){this._delayContextMenu?this._contextMenuEvent=N:this._ignoreContextMenu||this._map.fire(new Dc(N.type,this._map,N)),this._map.listens("contextmenu")&&N.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class pf{constructor(N){this._map=N}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(N){return this.transform.pointLocation(r.P.convert(N),this._map.terrain)}}class Nf{constructor(N,ve){this._map=N,this._tr=new pf(N),this._el=N.getCanvasContainer(),this._container=N.getContainer(),this._clickTolerance=ve.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(N,ve){this.isEnabled()&&N.shiftKey&&N.button===0&&(o.disableDrag(),this._startPos=this._lastPos=ve,this._active=!0)}mousemoveWindow(N,ve){if(!this._active)return;const Oe=ve;if(this._lastPos.equals(Oe)||!this._box&&Oe.dist(this._startPos)Ke.fitScreenCoordinates(Oe,Ue,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",N)}keydown(N){this._active&&N.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",N))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(N,ve){return this._map.fire(new r.k(N,{originalEvent:ve}))}}function Sd(Qe,N){if(Qe.length!==N.length)throw new Error(`The number of touches and points are not equal - touches ${Qe.length}, points ${N.length}`);const ve={};for(let Oe=0;Oethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=N.timeStamp),Oe.length===this.numTouches&&(this.centroid=(function(Ue){const Ke=new r.P(0,0);for(const It of Ue)Ke._add(It);return Ke.div(Ue.length)})(ve),this.touches=Sd(Oe,ve)))}touchmove(N,ve,Oe){if(this.aborted||!this.centroid)return;const Ue=Sd(Oe,ve);for(const Ke in this.touches){const It=Ue[Ke];(!It||It.dist(this.touches[Ke])>30)&&(this.aborted=!0)}}touchend(N,ve,Oe){if((!this.centroid||N.timeStamp-this.startTime>500)&&(this.aborted=!0),Oe.length===0){const Ue=!this.aborted&&this.centroid;if(this.reset(),Ue)return Ue}}}class Zh{constructor(N){this.singleTap=new ku(N),this.numTaps=N.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(N,ve,Oe){this.singleTap.touchstart(N,ve,Oe)}touchmove(N,ve,Oe){this.singleTap.touchmove(N,ve,Oe)}touchend(N,ve,Oe){const Ue=this.singleTap.touchend(N,ve,Oe);if(Ue){const Ke=N.timeStamp-this.lastTime<500,It=!this.lastTap||this.lastTap.dist(Ue)<30;if(Ke&&It||this.reset(),this.count++,this.lastTime=N.timeStamp,this.lastTap=Ue,this.count===this.numTaps)return this.reset(),Ue}}}class _h{constructor(N){this._tr=new pf(N),this._zoomIn=new Zh({numTouches:1,numTaps:2}),this._zoomOut=new Zh({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(N,ve,Oe){this._zoomIn.touchstart(N,ve,Oe),this._zoomOut.touchstart(N,ve,Oe)}touchmove(N,ve,Oe){this._zoomIn.touchmove(N,ve,Oe),this._zoomOut.touchmove(N,ve,Oe)}touchend(N,ve,Oe){const Ue=this._zoomIn.touchend(N,ve,Oe),Ke=this._zoomOut.touchend(N,ve,Oe),It=this._tr;return Ue?(this._active=!0,N.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:$t=>$t.easeTo({duration:300,zoom:It.zoom+1,around:It.unproject(Ue)},{originalEvent:N})}):Ke?(this._active=!0,N.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:$t=>$t.easeTo({duration:300,zoom:It.zoom-1,around:It.unproject(Ke)},{originalEvent:N})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Sf{constructor(N){this._enabled=!!N.enable,this._moveStateManager=N.moveStateManager,this._clickTolerance=N.clickTolerance||1,this._moveFunction=N.move,this._activateOnStart=!!N.activateOnStart,N.assignEvents(this),this.reset()}reset(N){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(N)}_move(...N){const ve=this._moveFunction(...N);if(ve.bearingDelta||ve.pitchDelta||ve.around||ve.panDelta)return this._active=!0,ve}dragStart(N,ve){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(N)&&(this._moveStateManager.startMove(N),this._lastPoint=ve.length?ve[0]:ve,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(N,ve){if(!this.isEnabled())return;const Oe=this._lastPoint;if(!Oe)return;if(N.preventDefault(),!this._moveStateManager.isValidMoveEvent(N))return void this.reset(N);const Ue=ve.length?ve[0]:ve;return!this._moved&&Ue.dist(Oe){Qe.mousedown=Qe.dragStart,Qe.mousemoveWindow=Qe.dragMove,Qe.mouseup=Qe.dragEnd,Qe.contextmenu=N=>{N.preventDefault()}},Oc=({enable:Qe,clickTolerance:N,bearingDegreesPerPixelMoved:ve=.8})=>{const Oe=new Hf({checkCorrectEvent:Ue=>o.mouseButton(Ue)===0&&Ue.ctrlKey||o.mouseButton(Ue)===2});return new Sf({clickTolerance:N,move:(Ue,Ke)=>({bearingDelta:(Ke.x-Ue.x)*ve}),moveStateManager:Oe,enable:Qe,assignEvents:bp})},Od=({enable:Qe,clickTolerance:N,pitchDegreesPerPixelMoved:ve=-.5})=>{const Oe=new Hf({checkCorrectEvent:Ue=>o.mouseButton(Ue)===0&&Ue.ctrlKey||o.mouseButton(Ue)===2});return new Sf({clickTolerance:N,move:(Ue,Ke)=>({pitchDelta:(Ke.y-Ue.y)*ve}),moveStateManager:Oe,enable:Qe,assignEvents:bp})};class Ef{constructor(N,ve){this._clickTolerance=N.clickTolerance||1,this._map=ve,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new r.P(0,0)}_shouldBePrevented(N){return N<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(N,ve,Oe){return this._calculateTransform(N,ve,Oe)}touchmove(N,ve,Oe){if(this._active){if(!this._shouldBePrevented(Oe.length))return N.preventDefault(),this._calculateTransform(N,ve,Oe);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",N)}}touchend(N,ve,Oe){this._calculateTransform(N,ve,Oe),this._active&&this._shouldBePrevented(Oe.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(N,ve,Oe){Oe.length>0&&(this._active=!0);const Ue=Sd(Oe,ve),Ke=new r.P(0,0),It=new r.P(0,0);let $t=0;for(const Tr in Ue){const Or=Ue[Tr],Vr=this._touches[Tr];Vr&&(Ke._add(Or),It._add(Or.sub(Vr)),$t++,Ue[Tr]=Or)}if(this._touches=Ue,this._shouldBePrevented($t)||!It.mag())return;const ir=It.div($t);return this._sum._add(ir),this._sum.mag()Math.abs(Qe.x)}class Ed extends ih{constructor(N){super(),this._currentTouchCount=0,this._map=N}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(N,ve,Oe){super.touchstart(N,ve,Oe),this._currentTouchCount=Oe.length}_start(N){this._lastPoints=N,Xf(N[0].sub(N[1]))&&(this._valid=!1)}_move(N,ve,Oe){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const Ue=N[0].sub(this._lastPoints[0]),Ke=N[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Ue,Ke,Oe.timeStamp),this._valid?(this._lastPoints=N,this._active=!0,{pitchDelta:(Ue.y+Ke.y)/2*-.5}):void 0}gestureBeginsVertically(N,ve,Oe){if(this._valid!==void 0)return this._valid;const Ue=N.mag()>=2,Ke=ve.mag()>=2;if(!Ue&&!Ke)return;if(!Ue||!Ke)return this._firstMove===void 0&&(this._firstMove=Oe),Oe-this._firstMove<100&&void 0;const It=N.y>0==ve.y>0;return Xf(N)&&Xf(ve)&&It}}const wr={panStep:100,bearingStep:15,pitchStep:10};class qr{constructor(N){this._tr=new pf(N);const ve=wr;this._panStep=ve.panStep,this._bearingStep=ve.bearingStep,this._pitchStep=ve.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(N){if(N.altKey||N.ctrlKey||N.metaKey)return;let ve=0,Oe=0,Ue=0,Ke=0,It=0;switch(N.keyCode){case 61:case 107:case 171:case 187:ve=1;break;case 189:case 109:case 173:ve=-1;break;case 37:N.shiftKey?Oe=-1:(N.preventDefault(),Ke=-1);break;case 39:N.shiftKey?Oe=1:(N.preventDefault(),Ke=1);break;case 38:N.shiftKey?Ue=1:(N.preventDefault(),It=-1);break;case 40:N.shiftKey?Ue=-1:(N.preventDefault(),It=1);break;default:return}return this._rotationDisabled&&(Oe=0,Ue=0),{cameraAnimation:$t=>{const ir=this._tr;$t.easeTo({duration:300,easeId:"keyboardHandler",easing:kn,zoom:ve?Math.round(ir.zoom)+ve*(N.shiftKey?2:1):ir.zoom,bearing:ir.bearing+Oe*this._bearingStep,pitch:ir.pitch+Ue*this._pitchStep,offset:[-Ke*this._panStep,-It*this._panStep],center:ir.center},{originalEvent:N})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function kn(Qe){return Qe*(2-Qe)}const _n=4.000244140625;class Qn{constructor(N,ve){this._onTimeout=Oe=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Oe)},this._map=N,this._tr=new pf(N),this._triggerRenderFrame=ve,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(N){this._defaultZoomRate=N}setWheelZoomRate(N){this._wheelZoomRate=N}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(N){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!N&&N.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(N){return!!this._map.cooperativeGestures.isEnabled()&&!(N.ctrlKey||this._map.cooperativeGestures.isBypassed(N))}wheel(N){if(!this.isEnabled())return;if(this._shouldBePrevented(N))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",N);let ve=N.deltaMode===WheelEvent.DOM_DELTA_LINE?40*N.deltaY:N.deltaY;const Oe=s.now(),Ue=Oe-(this._lastWheelEventTime||0);this._lastWheelEventTime=Oe,ve!==0&&ve%_n==0?this._type="wheel":ve!==0&&Math.abs(ve)<4?this._type="trackpad":Ue>400?(this._type=null,this._lastValue=ve,this._timeout=setTimeout(this._onTimeout,40,N)):this._type||(this._type=Math.abs(Ue*ve)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ve+=this._lastValue)),N.shiftKey&&ve&&(ve/=4),this._type&&(this._lastWheelEvent=N,this._delta-=ve,this._active||this._start(N)),N.preventDefault()}_start(N){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const ve=o.mousePos(this._map.getCanvas(),N),Oe=this._tr;this._around=ve.y>Oe.transform.height/2-Oe.transform.getHorizon()?r.N.convert(this._aroundCenter?Oe.center:Oe.unproject(ve)):r.N.convert(Oe.center),this._aroundPoint=Oe.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const N=this._tr.transform;if(this._delta!==0){const ir=this._type==="wheel"&&Math.abs(this._delta)>_n?this._wheelZoomRate:this._defaultZoomRate;let Tr=2/(1+Math.exp(-Math.abs(this._delta*ir)));this._delta<0&&Tr!==0&&(Tr=1/Tr);const Or=typeof this._targetZoom=="number"?N.zoomScale(this._targetZoom):N.scale;this._targetZoom=Math.min(N.maxZoom,Math.max(N.minZoom,N.scaleZoom(Or*Tr))),this._type==="wheel"&&(this._startZoom=N.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const ve=typeof this._targetZoom=="number"?this._targetZoom:N.zoom,Oe=this._startZoom,Ue=this._easing;let Ke,It=!1;const $t=s.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Oe&&Ue&&$t){const ir=Math.min($t/200,1),Tr=Ue(ir);Ke=r.y.number(Oe,ve,Tr),ir<1?this._frameId||(this._frameId=!0):It=!0}else Ke=ve,It=!0;return this._active=!0,It&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!It,zoomDelta:Ke-N.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(N){let ve=r.b9;if(this._prevEase){const Oe=this._prevEase,Ue=(s.now()-Oe.start)/Oe.duration,Ke=Oe.easing(Ue+.01)-Oe.easing(Ue),It=.27/Math.sqrt(Ke*Ke+1e-4)*.01,$t=Math.sqrt(.0729-It*It);ve=r.b8(It,$t,.25,1)}return this._prevEase={start:s.now(),duration:N,easing:ve},ve}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class $a{constructor(N,ve){this._clickZoom=N,this._tapZoom=ve}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Fa{constructor(N){this._tr=new pf(N),this.reset()}reset(){this._active=!1}dblclick(N,ve){return N.preventDefault(),{cameraAnimation:Oe=>{Oe.easeTo({duration:300,zoom:this._tr.zoom+(N.shiftKey?-1:1),around:this._tr.unproject(ve)},{originalEvent:N})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ai{constructor(){this._tap=new Zh({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(N,ve,Oe){if(!this._swipePoint)if(this._tapTime){const Ue=ve[0],Ke=N.timeStamp-this._tapTime<500,It=this._tapPoint.dist(Ue)<30;Ke&&It?Oe.length>0&&(this._swipePoint=Ue,this._swipeTouch=Oe[0].identifier):this.reset()}else this._tap.touchstart(N,ve,Oe)}touchmove(N,ve,Oe){if(this._tapTime){if(this._swipePoint){if(Oe[0].identifier!==this._swipeTouch)return;const Ue=ve[0],Ke=Ue.y-this._swipePoint.y;return this._swipePoint=Ue,N.preventDefault(),this._active=!0,{zoomDelta:Ke/128}}}else this._tap.touchmove(N,ve,Oe)}touchend(N,ve,Oe){if(this._tapTime)this._swipePoint&&Oe.length===0&&this.reset();else{const Ue=this._tap.touchend(N,ve,Oe);Ue&&(this._tapTime=N.timeStamp,this._tapPoint=Ue)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ni{constructor(N,ve,Oe){this._el=N,this._mousePan=ve,this._touchPan=Oe}enable(N){this._inertiaOptions=N||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ho{constructor(N,ve,Oe){this._pitchWithRotate=N.pitchWithRotate,this._mouseRotate=ve,this._mousePitch=Oe}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class fi{constructor(N,ve,Oe,Ue){this._el=N,this._touchZoom=ve,this._touchRotate=Oe,this._tapDragZoom=Ue,this._rotationDisabled=!1,this._enabled=!0}enable(N){this._touchZoom.enable(N),this._rotationDisabled||this._touchRotate.enable(N),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Yi{constructor(N,ve){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=N,this._options=ve,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const N=this._map.getCanvasContainer();N.classList.add("maplibregl-cooperative-gestures"),this._container=o.create("div","maplibregl-cooperative-gesture-screen",N);let ve=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(ve=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const Oe=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Ue=document.createElement("div");Ue.className="maplibregl-desktop-message",Ue.textContent=ve,this._container.appendChild(Ue);const Ke=document.createElement("div");Ke.className="maplibregl-mobile-message",Ke.textContent=Oe,this._container.appendChild(Ke),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(o.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(N){return N[this._bypassKey]}notifyGestureBlocked(N,ve){this._enabled&&(this._map.fire(new r.k("cooperativegestureprevented",{gestureType:N,originalEvent:ve})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const bi=Qe=>Qe.zoom||Qe.drag||Qe.pitch||Qe.rotate;class ii extends r.k{}function bo(Qe){return Qe.panDelta&&Qe.panDelta.mag()||Qe.zoomDelta||Qe.bearingDelta||Qe.pitchDelta}class os{constructor(N,ve){this.handleWindowEvent=Ue=>{this.handleEvent(Ue,`${Ue.type}Window`)},this.handleEvent=(Ue,Ke)=>{if(Ue.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const It=Ue.type==="renderFrame"?void 0:Ue,$t={needsRenderFrame:!1},ir={},Tr={},Or=Ue.touches,Vr=Or?this._getMapTouches(Or):void 0,vn=Vr?o.touchPos(this._map.getCanvas(),Vr):o.mousePos(this._map.getCanvas(),Ue);for(const{handlerName:dt,handler:St,allowed:Rt}of this._handlers){if(!St.isEnabled())continue;let Yt;this._blockedByActive(Tr,Rt,dt)?St.reset():St[Ke||Ue.type]&&(Yt=St[Ke||Ue.type](Ue,vn,Vr),this.mergeHandlerResult($t,ir,Yt,dt,It),Yt&&Yt.needsRenderFrame&&this._triggerRenderFrame()),(Yt||St.isActive())&&(Tr[dt]=St)}const Dn={};for(const dt in this._previousActiveHandlers)Tr[dt]||(Dn[dt]=It);this._previousActiveHandlers=Tr,(Object.keys(Dn).length||bo($t))&&(this._changes.push([$t,ir,Dn]),this._triggerRenderFrame()),(Object.keys(Tr).length||bo($t))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:ot}=$t;ot&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ot(this._map))},this._map=N,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new sd(N),this._bearingSnap=ve.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ve);const Oe=this._el;this._listeners=[[Oe,"touchstart",{passive:!0}],[Oe,"touchmove",{passive:!1}],[Oe,"touchend",void 0],[Oe,"touchcancel",void 0],[Oe,"mousedown",void 0],[Oe,"mousemove",void 0],[Oe,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Oe,"mouseover",void 0],[Oe,"mouseout",void 0],[Oe,"dblclick",void 0],[Oe,"click",void 0],[Oe,"keydown",{capture:!1}],[Oe,"keyup",void 0],[Oe,"wheel",{passive:!1}],[Oe,"contextmenu",void 0],[window,"blur",void 0]];for(const[Ue,Ke,It]of this._listeners)o.addEventListener(Ue,Ke,Ue===document?this.handleWindowEvent:this.handleEvent,It)}destroy(){for(const[N,ve,Oe]of this._listeners)o.removeEventListener(N,ve,N===document?this.handleWindowEvent:this.handleEvent,Oe)}_addDefaultHandlers(N){const ve=this._map,Oe=ve.getCanvasContainer();this._add("mapEvent",new Bh(ve,N));const Ue=ve.boxZoom=new Nf(ve,N);this._add("boxZoom",Ue),N.interactive&&N.boxZoom&&Ue.enable();const Ke=ve.cooperativeGestures=new Yi(ve,N.cooperativeGestures);this._add("cooperativeGestures",Ke),N.cooperativeGestures&&Ke.enable();const It=new _h(ve),$t=new Fa(ve);ve.doubleClickZoom=new $a($t,It),this._add("tapZoom",It),this._add("clickZoom",$t),N.interactive&&N.doubleClickZoom&&ve.doubleClickZoom.enable();const ir=new Ai;this._add("tapDragZoom",ir);const Tr=ve.touchPitch=new Ed(ve);this._add("touchPitch",Tr),N.interactive&&N.touchPitch&&ve.touchPitch.enable(N.touchPitch);const Or=Oc(N),Vr=Od(N);ve.dragRotate=new ho(N,Or,Vr),this._add("mouseRotate",Or,["mousePitch"]),this._add("mousePitch",Vr,["mouseRotate"]),N.interactive&&N.dragRotate&&ve.dragRotate.enable();const vn=(({enable:Yt,clickTolerance:Ut})=>{const er=new Hf({checkCorrectEvent:Mr=>o.mouseButton(Mr)===0&&!Mr.ctrlKey});return new Sf({clickTolerance:Ut,move:(Mr,Nr)=>({around:Nr,panDelta:Nr.sub(Mr)}),activateOnStart:!0,moveStateManager:er,enable:Yt,assignEvents:bp})})(N),Dn=new Ef(N,ve);ve.dragPan=new Ni(Oe,vn,Dn),this._add("mousePan",vn),this._add("touchPan",Dn,["touchZoom","touchRotate"]),N.interactive&&N.dragPan&&ve.dragPan.enable(N.dragPan);const ot=new xh,dt=new Yc;ve.touchZoomRotate=new fi(Oe,dt,ot,ir),this._add("touchRotate",ot,["touchPan","touchZoom"]),this._add("touchZoom",dt,["touchPan","touchRotate"]),N.interactive&&N.touchZoomRotate&&ve.touchZoomRotate.enable(N.touchZoomRotate);const St=ve.scrollZoom=new Qn(ve,()=>this._triggerRenderFrame());this._add("scrollZoom",St,["mousePan"]),N.interactive&&N.scrollZoom&&ve.scrollZoom.enable(N.scrollZoom);const Rt=ve.keyboard=new qr(ve);this._add("keyboard",Rt),N.interactive&&N.keyboard&&ve.keyboard.enable(),this._add("blockableMapEvent",new Au(ve))}_add(N,ve,Oe){this._handlers.push({handlerName:N,handler:ve,allowed:Oe}),this._handlersById[N]=ve}stop(N){if(!this._updatingCamera){for(const{handler:ve}of this._handlers)ve.reset();this._inertia.clear(),this._fireEvents({},{},N),this._changes=[]}}isActive(){for(const{handler:N}of this._handlers)if(N.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!bi(this._eventsInProgress)||this.isZooming()}_blockedByActive(N,ve,Oe){for(const Ue in N)if(Ue!==Oe&&(!ve||ve.indexOf(Ue)<0))return!0;return!1}_getMapTouches(N){const ve=[];for(const Oe of N)this._el.contains(Oe.target)&&ve.push(Oe);return ve}mergeHandlerResult(N,ve,Oe,Ue,Ke){if(!Oe)return;r.e(N,Oe);const It={handlerName:Ue,originalEvent:Oe.originalEvent||Ke};Oe.zoomDelta!==void 0&&(ve.zoom=It),Oe.panDelta!==void 0&&(ve.drag=It),Oe.pitchDelta!==void 0&&(ve.pitch=It),Oe.bearingDelta!==void 0&&(ve.rotate=It)}_applyChanges(){const N={},ve={},Oe={};for(const[Ue,Ke,It]of this._changes)Ue.panDelta&&(N.panDelta=(N.panDelta||new r.P(0,0))._add(Ue.panDelta)),Ue.zoomDelta&&(N.zoomDelta=(N.zoomDelta||0)+Ue.zoomDelta),Ue.bearingDelta&&(N.bearingDelta=(N.bearingDelta||0)+Ue.bearingDelta),Ue.pitchDelta&&(N.pitchDelta=(N.pitchDelta||0)+Ue.pitchDelta),Ue.around!==void 0&&(N.around=Ue.around),Ue.pinchAround!==void 0&&(N.pinchAround=Ue.pinchAround),Ue.noInertia&&(N.noInertia=Ue.noInertia),r.e(ve,Ke),r.e(Oe,It);this._updateMapTransform(N,ve,Oe),this._changes=[]}_updateMapTransform(N,ve,Oe){const Ue=this._map,Ke=Ue._getTransformForUpdate(),It=Ue.terrain;if(!(bo(N)||It&&this._terrainMovement))return this._fireEvents(ve,Oe,!0);let{panDelta:$t,zoomDelta:ir,bearingDelta:Tr,pitchDelta:Or,around:Vr,pinchAround:vn}=N;vn!==void 0&&(Vr=vn),Ue._stop(!0),Vr=Vr||Ue.transform.centerPoint;const Dn=Ke.pointLocation($t?Vr.sub($t):Vr);Tr&&(Ke.bearing+=Tr),Or&&(Ke.pitch+=Or),ir&&(Ke.zoom+=ir),It?this._terrainMovement||!ve.drag&&!ve.zoom?ve.drag&&this._terrainMovement?Ke.center=Ke.pointLocation(Ke.centerPoint.sub($t)):Ke.setLocationAtPoint(Dn,Vr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Ke.setLocationAtPoint(Dn,Vr)):Ke.setLocationAtPoint(Dn,Vr),Ue._applyUpdatedTransform(Ke),this._map._update(),N.noInertia||this._inertia.record(N),this._fireEvents(ve,Oe,!0)}_fireEvents(N,ve,Oe){const Ue=bi(this._eventsInProgress),Ke=bi(N),It={};for(const Vr in N){const{originalEvent:vn}=N[Vr];this._eventsInProgress[Vr]||(It[`${Vr}start`]=vn),this._eventsInProgress[Vr]=N[Vr]}!Ue&&Ke&&this._fireEvent("movestart",Ke.originalEvent);for(const Vr in It)this._fireEvent(Vr,It[Vr]);Ke&&this._fireEvent("move",Ke.originalEvent);for(const Vr in N){const{originalEvent:vn}=N[Vr];this._fireEvent(Vr,vn)}const $t={};let ir;for(const Vr in this._eventsInProgress){const{handlerName:vn,originalEvent:Dn}=this._eventsInProgress[Vr];this._handlersById[vn].isActive()||(delete this._eventsInProgress[Vr],ir=ve[vn]||Dn,$t[`${Vr}end`]=ir)}for(const Vr in $t)this._fireEvent(Vr,$t[Vr]);const Tr=bi(this._eventsInProgress),Or=(Ue||Ke)&&!Tr;if(Or&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const Vr=this._map._getTransformForUpdate();Vr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Vr)}if(Oe&&Or){this._updatingCamera=!0;const Vr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),vn=Dn=>Dn!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new ii("renderFrame",{timeStamp:N})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class rs extends r.E{constructor(N,ve){super(),this._renderFrameCallback=()=>{const Oe=Math.min((s.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Oe)),Oe<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=N,this._bearingSnap=ve.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new r.N(this.transform.center.lng,this.transform.center.lat)}setCenter(N,ve){return this.jumpTo({center:N},ve)}panBy(N,ve,Oe){return N=r.P.convert(N).mult(-1),this.panTo(this.transform.center,r.e({offset:N},ve),Oe)}panTo(N,ve,Oe){return this.easeTo(r.e({center:N},ve),Oe)}getZoom(){return this.transform.zoom}setZoom(N,ve){return this.jumpTo({zoom:N},ve),this}zoomTo(N,ve,Oe){return this.easeTo(r.e({zoom:N},ve),Oe)}zoomIn(N,ve){return this.zoomTo(this.getZoom()+1,N,ve),this}zoomOut(N,ve){return this.zoomTo(this.getZoom()-1,N,ve),this}getBearing(){return this.transform.bearing}setBearing(N,ve){return this.jumpTo({bearing:N},ve),this}getPadding(){return this.transform.padding}setPadding(N,ve){return this.jumpTo({padding:N},ve),this}rotateTo(N,ve,Oe){return this.easeTo(r.e({bearing:N},ve),Oe)}resetNorth(N,ve){return this.rotateTo(0,r.e({duration:1e3},N),ve),this}resetNorthPitch(N,ve){return this.easeTo(r.e({bearing:0,pitch:0,duration:1e3},N),ve),this}snapToNorth(N,ve){return Math.abs(this.getBearing()){if(this._zooming&&(Ue.zoom=r.y.number(Ke,St,jr)),this._rotating&&(Ue.bearing=r.y.number(It,Tr,jr)),this._pitching&&(Ue.pitch=r.y.number($t,Or,jr)),this._padding&&(Ue.interpolatePadding(ir,Vr,jr),Dn=Ue.centerPoint.add(vn)),this.terrain&&!N.freezeElevation&&this._updateElevation(jr),er)Ue.setLocationAtPoint(er,Mr);else{const sn=Ue.zoomScale(Ue.zoom-Ke),xn=St>Ke?Math.min(2,Ut):Math.max(.5,Ut),$n=Math.pow(xn,1-jr),Wn=Ue.unproject(Rt.add(Yt.mult(jr*$n)).mult(sn));Ue.setLocationAtPoint(Ue.renderWorldCopies?Wn.wrap():Wn,Dn)}this._applyUpdatedTransform(Ue),this._fireMoveEvents(ve)},jr=>{this.terrain&&N.freezeElevation&&this._finalizeElevation(),this._afterEase(ve,jr)},N),this}_prepareEase(N,ve,Oe={}){this._moving=!0,ve||Oe.moving||this.fire(new r.k("movestart",N)),this._zooming&&!Oe.zooming&&this.fire(new r.k("zoomstart",N)),this._rotating&&!Oe.rotating&&this.fire(new r.k("rotatestart",N)),this._pitching&&!Oe.pitching&&this.fire(new r.k("pitchstart",N))}_prepareElevation(N){this._elevationCenter=N,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(N,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(N){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const ve=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(N<1&&ve!==this._elevationTarget){const Oe=this._elevationTarget-this._elevationStart;this._elevationStart+=N*(Oe-(ve-(Oe*N+this._elevationStart))/(1-N)),this._elevationTarget=ve}this.transform.elevation=r.y.number(this._elevationStart,this._elevationTarget,N)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(N){const ve=N.getCameraPosition(),Oe=this.terrain.getElevationForLngLatZoom(ve.lngLat,N.zoom);if(ve.altitudethis._elevateCameraIfInsideTerrain(Ue)),this.transformCameraUpdate&&ve.push(Ue=>this.transformCameraUpdate(Ue)),!ve.length)return;const Oe=N.clone();for(const Ue of ve){const Ke=Oe.clone(),{center:It,zoom:$t,pitch:ir,bearing:Tr,elevation:Or}=Ue(Ke);It&&(Ke.center=It),$t!==void 0&&(Ke.zoom=$t),ir!==void 0&&(Ke.pitch=ir),Tr!==void 0&&(Ke.bearing=Tr),Or!==void 0&&(Ke.elevation=Or),Oe.apply(Ke)}this.transform.apply(Oe)}_fireMoveEvents(N){this.fire(new r.k("move",N)),this._zooming&&this.fire(new r.k("zoom",N)),this._rotating&&this.fire(new r.k("rotate",N)),this._pitching&&this.fire(new r.k("pitch",N))}_afterEase(N,ve){if(this._easeId&&ve&&this._easeId===ve)return;delete this._easeId;const Oe=this._zooming,Ue=this._rotating,Ke=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Oe&&this.fire(new r.k("zoomend",N)),Ue&&this.fire(new r.k("rotateend",N)),Ke&&this.fire(new r.k("pitchend",N)),this.fire(new r.k("moveend",N))}flyTo(N,ve){var Oe;if(!N.essential&&s.prefersReducedMotion){const Mi=r.M(N,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Mi,ve)}this.stop(),N=r.e({offset:[0,0],speed:1.2,curve:1.42,easing:r.b9},N);const Ue=this._getTransformForUpdate(),Ke=Ue.zoom,It=Ue.bearing,$t=Ue.pitch,ir=Ue.padding,Tr="bearing"in N?this._normalizeBearing(N.bearing,It):It,Or="pitch"in N?+N.pitch:$t,Vr="padding"in N?N.padding:Ue.padding,vn=r.P.convert(N.offset);let Dn=Ue.centerPoint.add(vn);const ot=Ue.pointLocation(Dn),{center:dt,zoom:St}=Ue.getConstrained(r.N.convert(N.center||ot),(Oe=N.zoom)!==null&&Oe!==void 0?Oe:Ke);this._normalizeCenter(dt,Ue);const Rt=Ue.zoomScale(St-Ke),Yt=Ue.project(ot),Ut=Ue.project(dt).sub(Yt);let er=N.curve;const Mr=Math.max(Ue.width,Ue.height),Nr=Mr/Rt,jr=Ut.mag();if("minZoom"in N){const Mi=r.ac(Math.min(N.minZoom,Ke,St),Ue.minZoom,Ue.maxZoom),Ao=Mr/Ue.zoomScale(Mi-Ke);er=Math.sqrt(Ao/jr*2)}const sn=er*er;function xn(Mi){const Ao=(Nr*Nr-Mr*Mr+(Mi?-1:1)*sn*sn*jr*jr)/(2*(Mi?Nr:Mr)*sn*jr);return Math.log(Math.sqrt(Ao*Ao+1)-Ao)}function $n(Mi){return(Math.exp(Mi)-Math.exp(-Mi))/2}function Wn(Mi){return(Math.exp(Mi)+Math.exp(-Mi))/2}const ua=xn(!1);let Ua=function(Mi){return Wn(ua)/Wn(ua+er*Mi)},Si=function(Mi){return Mr*((Wn(ua)*($n(Ao=ua+er*Mi)/Wn(Ao))-$n(ua))/sn)/jr;var Ao},gi=(xn(!0)-ua)/er;if(Math.abs(jr)<1e-6||!isFinite(gi)){if(Math.abs(Mr-Nr)<1e-6)return this.easeTo(N,ve);const Mi=Nr0,Ua=Ao=>Math.exp(Mi*er*Ao)}return N.duration="duration"in N?+N.duration:1e3*gi/("screenSpeed"in N?+N.screenSpeed/er:+N.speed),N.maxDuration&&N.duration>N.maxDuration&&(N.duration=0),this._zooming=!0,this._rotating=It!==Tr,this._pitching=Or!==$t,this._padding=!Ue.isPaddingEqual(Vr),this._prepareEase(ve,!1),this.terrain&&this._prepareElevation(dt),this._ease(Mi=>{const Ao=Mi*gi,qo=1/Ua(Ao);Ue.zoom=Mi===1?St:Ke+Ue.scaleZoom(qo),this._rotating&&(Ue.bearing=r.y.number(It,Tr,Mi)),this._pitching&&(Ue.pitch=r.y.number($t,Or,Mi)),this._padding&&(Ue.interpolatePadding(ir,Vr,Mi),Dn=Ue.centerPoint.add(vn)),this.terrain&&!N.freezeElevation&&this._updateElevation(Mi);const Bo=Mi===1?dt:Ue.unproject(Yt.add(Ut.mult(Si(Ao))).mult(qo));Ue.setLocationAtPoint(Ue.renderWorldCopies?Bo.wrap():Bo,Dn),this._applyUpdatedTransform(Ue),this._fireMoveEvents(ve)},()=>{this.terrain&&N.freezeElevation&&this._finalizeElevation(),this._afterEase(ve)},N),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(N,ve){var Oe;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const Ue=this._onEaseEnd;delete this._onEaseEnd,Ue.call(this,ve)}return N||(Oe=this.handlers)===null||Oe===void 0||Oe.stop(!1),this}_ease(N,ve,Oe){Oe.animate===!1||Oe.duration===0?(N(1),ve()):(this._easeStart=s.now(),this._easeOptions=Oe,this._onEaseFrame=N,this._onEaseEnd=ve,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(N,ve){N=r.b3(N,-180,180);const Oe=Math.abs(N-ve);return Math.abs(N-360-ve)180?-360:Oe<-180?360:0}queryTerrainElevation(N){return this.terrain?this.terrain.getElevationForLngLatZoom(r.N.convert(N),this.transform.tileZoom)-this.transform.elevation:null}}const fs={compact:!0,customAttribution:'MapLibre'};class ls{constructor(N=fs){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=ve=>{!ve||ve.sourceDataType!=="metadata"&&ve.sourceDataType!=="visibility"&&ve.dataType!=="style"&&ve.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=N}getDefaultPosition(){return"bottom-right"}onAdd(N){return this._map=N,this._compact=this.options.compact,this._container=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){o.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(N,ve){const Oe=this._map._getUIString(`AttributionControl.${ve}`);N.title=Oe,N.setAttribute("aria-label",Oe)}_updateAttributions(){if(!this._map.style)return;let N=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?N=N.concat(this.options.customAttribution.map(Ue=>typeof Ue!="string"?"":Ue)):typeof this.options.customAttribution=="string"&&N.push(this.options.customAttribution)),this._map.style.stylesheet){const Ue=this._map.style.stylesheet;this.styleOwner=Ue.owner,this.styleId=Ue.id}const ve=this._map.style.sourceCaches;for(const Ue in ve){const Ke=ve[Ue];if(Ke.used||Ke.usedForTerrain){const It=Ke.getSource();It.attribution&&N.indexOf(It.attribution)<0&&N.push(It.attribution)}}N=N.filter(Ue=>String(Ue).trim()),N.sort((Ue,Ke)=>Ue.length-Ke.length),N=N.filter((Ue,Ke)=>{for(let It=Ke+1;It=0)return!1;return!0});const Oe=N.join(" | ");Oe!==this._attribHTML&&(this._attribHTML=Oe,N.length?(this._innerContainer.innerHTML=Oe,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class To{constructor(N={}){this._updateCompact=()=>{const ve=this._container.children;if(ve.length){const Oe=ve[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Oe.classList.add("maplibregl-compact"):Oe.classList.remove("maplibregl-compact")}},this.options=N}getDefaultPosition(){return"bottom-left"}onAdd(N){this._map=N,this._compact=this.options&&this.options.compact,this._container=o.create("div","maplibregl-ctrl");const ve=o.create("a","maplibregl-ctrl-logo");return ve.target="_blank",ve.rel="noopener nofollow",ve.href="https://maplibre.org/",ve.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ve.setAttribute("rel","noopener nofollow"),this._container.appendChild(ve),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ro{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(N){const ve=++this._id;return this._queue.push({callback:N,id:ve,cancelled:!1}),ve}remove(N){const ve=this._currentlyRunning,Oe=ve?this._queue.concat(ve):this._queue;for(const Ue of Oe)if(Ue.id===N)return void(Ue.cancelled=!0)}run(N=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const ve=this._currentlyRunning=this._queue;this._queue=[];for(const Oe of ve)if(!Oe.cancelled&&(Oe.callback(N),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ts=r.Y([{name:"a_pos3d",type:"Int16",components:3}]);class il extends r.E{constructor(N){super(),this.sourceCache=N,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,N.usedForTerrain=!0,N.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(N,ve){this.sourceCache.update(N,ve),this._renderableTilesKeys=[];const Oe={};for(const Ue of N.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:ve}))Oe[Ue.key]=!0,this._renderableTilesKeys.push(Ue.key),this._tiles[Ue.key]||(Ue.posMatrix=new Float64Array(16),r.aP(Ue.posMatrix,0,r.X,0,r.X,0,1),this._tiles[Ue.key]=new At(Ue,this.tileSize));for(const Ue in this._tiles)Oe[Ue]||delete this._tiles[Ue]}freeRtt(N){for(const ve in this._tiles){const Oe=this._tiles[ve];(!N||Oe.tileID.equals(N)||Oe.tileID.isChildOf(N)||N.isChildOf(Oe.tileID))&&(Oe.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(N=>this.getTileByID(N))}getTileByID(N){return this._tiles[N]}getTerrainCoords(N){const ve={};for(const Oe of this._renderableTilesKeys){const Ue=this._tiles[Oe].tileID;if(Ue.canonical.equals(N.canonical)){const Ke=N.clone();Ke.posMatrix=new Float64Array(16),r.aP(Ke.posMatrix,0,r.X,0,r.X,0,1),ve[Oe]=Ke}else if(Ue.canonical.isChildOf(N.canonical)){const Ke=N.clone();Ke.posMatrix=new Float64Array(16);const It=Ue.canonical.z-N.canonical.z,$t=Ue.canonical.x-(Ue.canonical.x>>It<>It<>It;r.aP(Ke.posMatrix,0,Tr,0,Tr,0,1),r.J(Ke.posMatrix,Ke.posMatrix,[-$t*Tr,-ir*Tr,0]),ve[Oe]=Ke}else if(N.canonical.isChildOf(Ue.canonical)){const Ke=N.clone();Ke.posMatrix=new Float64Array(16);const It=N.canonical.z-Ue.canonical.z,$t=N.canonical.x-(N.canonical.x>>It<>It<>It;r.aP(Ke.posMatrix,0,r.X,0,r.X,0,1),r.J(Ke.posMatrix,Ke.posMatrix,[$t*Tr,ir*Tr,0]),r.K(Ke.posMatrix,Ke.posMatrix,[1/2**It,1/2**It,0]),ve[Oe]=Ke}}return ve}getSourceTile(N,ve){const Oe=this.sourceCache._source;let Ue=N.overscaledZ-this.deltaZoom;if(Ue>Oe.maxzoom&&(Ue=Oe.maxzoom),Ue=Oe.minzoom&&(!Ke||!Ke.dem);)Ke=this.sourceCache.getTileByID(N.scaledTo(Ue--).key);return Ke}tilesAfterTime(N=Date.now()){return Object.values(this._tiles).filter(ve=>ve.timeAdded>=N)}}class Hl{constructor(N,ve,Oe){this.painter=N,this.sourceCache=new il(ve),this.options=Oe,this.exaggeration=typeof Oe.exaggeration=="number"?Oe.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(N,ve,Oe,Ue=r.X){var Ke;if(!(ve>=0&&ve=0&&OeN.canonical.z&&(N.canonical.z>=Ue?Ke=N.canonical.z-Ue:r.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const It=N.canonical.x-(N.canonical.x>>Ke<>Ke<>8<<4|Ke>>8,ve[It+3]=0;const Oe=new r.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(ve.buffer)),Ue=new h(N,Oe,N.gl.RGBA,{premultiply:!1});return Ue.bind(N.gl.NEAREST,N.gl.CLAMP_TO_EDGE),this._coordsTexture=Ue,Ue}pointCoordinate(N){this.painter.maybeDrawDepthAndCoords(!0);const ve=new Uint8Array(4),Oe=this.painter.context,Ue=Oe.gl,Ke=Math.round(N.x*this.painter.pixelRatio/devicePixelRatio),It=Math.round(N.y*this.painter.pixelRatio/devicePixelRatio),$t=Math.round(this.painter.height/devicePixelRatio);Oe.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Ue.readPixels(Ke,$t-It-1,1,1,Ue.RGBA,Ue.UNSIGNED_BYTE,ve),Oe.bindFramebuffer.set(null);const ir=ve[0]+(ve[2]>>4<<8),Tr=ve[1]+((15&ve[2])<<8),Or=this.coordsIndex[255-ve[3]],Vr=Or&&this.sourceCache.getTileByID(Or);if(!Vr)return null;const vn=this._coordsTextureSize,Dn=(1<N.id!==ve),this._recentlyUsed.push(N.id)}stampObject(N){N.stamp=++this._stamp}getOrCreateFreeObject(){for(const ve of this._recentlyUsed)if(!this._objects[ve].inUse)return this._objects[ve];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const N=this._createObject(this._objects.length);return this._objects.push(N),N}freeObject(N){N.inUse=!1}freeAllObjects(){for(const N of this._objects)this.freeObject(N)}isFull(){return!(this._objects.length!N.inUse)===!1}}const Xl={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class gu{constructor(N,ve){this.painter=N,this.terrain=ve,this.pool=new mu(N.context,30,ve.sourceCache.tileSize*ve.qualityFactor)}destruct(){this.pool.destruct()}getTexture(N){return this.pool.getObjectForId(N.rtt[this._stacks.length-1].id).texture}prepareForRender(N,ve){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=N._order.filter(Oe=>!N._layers[Oe].isHidden(ve)),this._coordsDescendingInv={};for(const Oe in N.sourceCaches){this._coordsDescendingInv[Oe]={};const Ue=N.sourceCaches[Oe].getVisibleCoordinates();for(const Ke of Ue){const It=this.terrain.sourceCache.getTerrainCoords(Ke);for(const $t in It)this._coordsDescendingInv[Oe][$t]||(this._coordsDescendingInv[Oe][$t]=[]),this._coordsDescendingInv[Oe][$t].push(It[$t])}}this._coordsDescendingInvStr={};for(const Oe of N._order){const Ue=N._layers[Oe],Ke=Ue.source;if(Xl[Ue.type]&&!this._coordsDescendingInvStr[Ke]){this._coordsDescendingInvStr[Ke]={};for(const It in this._coordsDescendingInv[Ke])this._coordsDescendingInvStr[Ke][It]=this._coordsDescendingInv[Ke][It].map($t=>$t.key).sort().join()}}for(const Oe of this._renderableTiles)for(const Ue in this._coordsDescendingInvStr){const Ke=this._coordsDescendingInvStr[Ue][Oe.tileID.key];Ke&&Ke!==Oe.rttCoords[Ue]&&(Oe.rtt=[])}}renderLayer(N){if(N.isHidden(this.painter.transform.zoom))return!1;const ve=N.type,Oe=this.painter,Ue=this._renderableLayerIds[this._renderableLayerIds.length-1]===N.id;if(Xl[ve]&&(this._prevType&&Xl[this._prevType]||this._stacks.push([]),this._prevType=ve,this._stacks[this._stacks.length-1].push(N.id),!Ue))return!0;if(Xl[this._prevType]||Xl[ve]&&Ue){this._prevType=ve;const Ke=this._stacks.length-1,It=this._stacks[Ke]||[];for(const $t of this._renderableTiles){if(this.pool.isFull()&&(Vu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push($t),$t.rtt[Ke]){const Tr=this.pool.getObjectForId($t.rtt[Ke].id);if(Tr.stamp===$t.rtt[Ke].stamp){this.pool.useObject(Tr);continue}}const ir=this.pool.getOrCreateFreeObject();this.pool.useObject(ir),this.pool.stampObject(ir),$t.rtt[Ke]={id:ir.id,stamp:ir.stamp},Oe.context.bindFramebuffer.set(ir.fbo.framebuffer),Oe.context.clear({color:r.aM.transparent,stencil:0}),Oe.currentStencilSource=void 0;for(let Tr=0;Tr{Qe.touchstart=Qe.dragStart,Qe.touchmoveWindow=Qe.dragMove,Qe.touchend=Qe.dragEnd},Vo={showCompass:!0,showZoom:!0,visualizePitch:!1};class Fs{constructor(N,ve,Oe=!1){this.mousedown=It=>{this.startMouse(r.e({},It,{ctrlKey:!0,preventDefault:()=>It.preventDefault()}),o.mousePos(this.element,It)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=It=>{this.moveMouse(It,o.mousePos(this.element,It))},this.mouseup=It=>{this.mouseRotate.dragEnd(It),this.mousePitch&&this.mousePitch.dragEnd(It),this.offTemp()},this.touchstart=It=>{It.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,It.targetTouches)[0],this.startTouch(It,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=It=>{It.targetTouches.length!==1?this.reset():(this._lastPos=o.touchPos(this.element,It.targetTouches)[0],this.moveTouch(It,this._lastPos))},this.touchend=It=>{It.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const Ue=N.dragRotate._mouseRotate.getClickTolerance(),Ke=N.dragRotate._mousePitch.getClickTolerance();this.element=ve,this.mouseRotate=Oc({clickTolerance:Ue,enable:!0}),this.touchRotate=(({enable:It,clickTolerance:$t,bearingDegreesPerPixelMoved:ir=.8})=>{const Tr=new Jh;return new Sf({clickTolerance:$t,move:(Or,Vr)=>({bearingDelta:(Vr.x-Or.x)*ir}),moveStateManager:Tr,enable:It,assignEvents:fu})})({clickTolerance:Ue,enable:!0}),this.map=N,Oe&&(this.mousePitch=Od({clickTolerance:Ke,enable:!0}),this.touchPitch=(({enable:It,clickTolerance:$t,pitchDegreesPerPixelMoved:ir=-.5})=>{const Tr=new Jh;return new Sf({clickTolerance:$t,move:(Or,Vr)=>({pitchDelta:(Vr.y-Or.y)*ir}),moveStateManager:Tr,enable:It,assignEvents:fu})})({clickTolerance:Ke,enable:!0})),o.addEventListener(ve,"mousedown",this.mousedown),o.addEventListener(ve,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(ve,"touchcancel",this.reset)}startMouse(N,ve){this.mouseRotate.dragStart(N,ve),this.mousePitch&&this.mousePitch.dragStart(N,ve),o.disableDrag()}startTouch(N,ve){this.touchRotate.dragStart(N,ve),this.touchPitch&&this.touchPitch.dragStart(N,ve),o.disableDrag()}moveMouse(N,ve){const Oe=this.map,{bearingDelta:Ue}=this.mouseRotate.dragMove(N,ve)||{};if(Ue&&Oe.setBearing(Oe.getBearing()+Ue),this.mousePitch){const{pitchDelta:Ke}=this.mousePitch.dragMove(N,ve)||{};Ke&&Oe.setPitch(Oe.getPitch()+Ke)}}moveTouch(N,ve){const Oe=this.map,{bearingDelta:Ue}=this.touchRotate.dragMove(N,ve)||{};if(Ue&&Oe.setBearing(Oe.getBearing()+Ue),this.touchPitch){const{pitchDelta:Ke}=this.touchPitch.dragMove(N,ve)||{};Ke&&Oe.setPitch(Oe.getPitch()+Ke)}}off(){const N=this.element;o.removeEventListener(N,"mousedown",this.mousedown),o.removeEventListener(N,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(N,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend)}}let nu;function Fl(Qe,N,ve){const Oe=new r.N(Qe.lng,Qe.lat);if(Qe=new r.N(Qe.lng,Qe.lat),N){const Ue=new r.N(Qe.lng-360,Qe.lat),Ke=new r.N(Qe.lng+360,Qe.lat),It=ve.locationPoint(Qe).distSqr(N);ve.locationPoint(Ue).distSqr(N)180;){const Ue=ve.locationPoint(Qe);if(Ue.x>=0&&Ue.y>=0&&Ue.x<=ve.width&&Ue.y<=ve.height)break;Qe.lng>ve.center.lng?Qe.lng-=360:Qe.lng+=360}return Qe.lng!==Oe.lng&&ve.locationPoint(Qe).y>ve.height/2-ve.getHorizon()?Qe:Oe}const jc={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Gc(Qe,N,ve){const Oe=Qe.classList;for(const Ue in jc)Oe.remove(`maplibregl-${ve}-anchor-${Ue}`);Oe.add(`maplibregl-${ve}-anchor-${N}`)}class Zc extends r.E{constructor(N){if(super(),this._onKeyPress=ve=>{const Oe=ve.code,Ue=ve.charCode||ve.keyCode;Oe!=="Space"&&Oe!=="Enter"&&Ue!==32&&Ue!==13||this.togglePopup()},this._onMapClick=ve=>{const Oe=ve.originalEvent.target,Ue=this._element;this._popup&&(Oe===Ue||Ue.contains(Oe))&&this.togglePopup()},this._update=ve=>{var Oe;if(!this._map)return;const Ue=this._map.loaded()&&!this._map.isMoving();(ve?.type==="terrain"||ve?.type==="render"&&!Ue)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Fl(this._lngLat,this._flatPos,this._map.transform):(Oe=this._lngLat)===null||Oe===void 0?void 0:Oe.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Ke="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Ke=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Ke=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let It="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?It="rotateX(0deg)":this._pitchAlignment==="map"&&(It=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||ve&&ve.type!=="moveend"||(this._pos=this._pos.round()),o.setTransform(this._element,`${jc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${It} ${Ke}`),s.frameAsync(new AbortController).then(()=>{this._updateOpacity(ve&&ve.type==="moveend")}).catch(()=>{})},this._onMove=ve=>{if(!this._isDragging){const Oe=this._clickTolerance||this._map._clickTolerance;this._isDragging=ve.point.dist(this._pointerdownPos)>=Oe}this._isDragging&&(this._pos=ve.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new r.k("dragstart"))),this.fire(new r.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new r.k("dragend")),this._state="inactive"},this._addDragHandler=ve=>{this._element.contains(ve.originalEvent.target)&&(ve.preventDefault(),this._positionDelta=ve.point.sub(this._pos).add(this._offset),this._pointerdownPos=ve.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=N&&N.anchor||"center",this._color=N&&N.color||"#3FB1CE",this._scale=N&&N.scale||1,this._draggable=N&&N.draggable||!1,this._clickTolerance=N&&N.clickTolerance||0,this._subpixelPositioning=N&&N.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=N&&N.rotation||0,this._rotationAlignment=N&&N.rotationAlignment||"auto",this._pitchAlignment=N&&N.pitchAlignment&&N.pitchAlignment!=="auto"?N.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(N?.opacity,N?.opacityWhenCovered),N&&N.element)this._element=N.element,this._offset=r.P.convert(N&&N.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div");const ve=o.createNS("http://www.w3.org/2000/svg","svg"),Oe=41,Ue=27;ve.setAttributeNS(null,"display","block"),ve.setAttributeNS(null,"height",`${Oe}px`),ve.setAttributeNS(null,"width",`${Ue}px`),ve.setAttributeNS(null,"viewBox",`0 0 ${Ue} ${Oe}`);const Ke=o.createNS("http://www.w3.org/2000/svg","g");Ke.setAttributeNS(null,"stroke","none"),Ke.setAttributeNS(null,"stroke-width","1"),Ke.setAttributeNS(null,"fill","none"),Ke.setAttributeNS(null,"fill-rule","evenodd");const It=o.createNS("http://www.w3.org/2000/svg","g");It.setAttributeNS(null,"fill-rule","nonzero");const $t=o.createNS("http://www.w3.org/2000/svg","g");$t.setAttributeNS(null,"transform","translate(3.0, 29.0)"),$t.setAttributeNS(null,"fill","#000000");const ir=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const Rt of ir){const Yt=o.createNS("http://www.w3.org/2000/svg","ellipse");Yt.setAttributeNS(null,"opacity","0.04"),Yt.setAttributeNS(null,"cx","10.5"),Yt.setAttributeNS(null,"cy","5.80029008"),Yt.setAttributeNS(null,"rx",Rt.rx),Yt.setAttributeNS(null,"ry",Rt.ry),$t.appendChild(Yt)}const Tr=o.createNS("http://www.w3.org/2000/svg","g");Tr.setAttributeNS(null,"fill",this._color);const Or=o.createNS("http://www.w3.org/2000/svg","path");Or.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),Tr.appendChild(Or);const Vr=o.createNS("http://www.w3.org/2000/svg","g");Vr.setAttributeNS(null,"opacity","0.25"),Vr.setAttributeNS(null,"fill","#000000");const vn=o.createNS("http://www.w3.org/2000/svg","path");vn.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),Vr.appendChild(vn);const Dn=o.createNS("http://www.w3.org/2000/svg","g");Dn.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Dn.setAttributeNS(null,"fill","#FFFFFF");const ot=o.createNS("http://www.w3.org/2000/svg","g");ot.setAttributeNS(null,"transform","translate(8.0, 8.0)");const dt=o.createNS("http://www.w3.org/2000/svg","circle");dt.setAttributeNS(null,"fill","#000000"),dt.setAttributeNS(null,"opacity","0.25"),dt.setAttributeNS(null,"cx","5.5"),dt.setAttributeNS(null,"cy","5.5"),dt.setAttributeNS(null,"r","5.4999962");const St=o.createNS("http://www.w3.org/2000/svg","circle");St.setAttributeNS(null,"fill","#FFFFFF"),St.setAttributeNS(null,"cx","5.5"),St.setAttributeNS(null,"cy","5.5"),St.setAttributeNS(null,"r","5.4999962"),ot.appendChild(dt),ot.appendChild(St),It.appendChild($t),It.appendChild(Tr),It.appendChild(Vr),It.appendChild(Dn),It.appendChild(ot),ve.appendChild(It),ve.setAttributeNS(null,"height",Oe*this._scale+"px"),ve.setAttributeNS(null,"width",Ue*this._scale+"px"),this._element.appendChild(ve),this._offset=r.P.convert(N&&N.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",ve=>{ve.preventDefault()}),this._element.addEventListener("mousedown",ve=>{ve.preventDefault()}),Gc(this._element,this._anchor,"marker"),N&&N.className)for(const ve of N.className.split(" "))this._element.classList.add(ve);this._popup=null}addTo(N){return this.remove(),this._map=N,this._element.setAttribute("aria-label",N._getUIString("Marker.Title")),N.getCanvasContainer().appendChild(this._element),N.on("move",this._update),N.on("moveend",this._update),N.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(N){return this._lngLat=r.N.convert(N),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(N){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),N){if(!("offset"in N.options)){const Ue=Math.abs(13.5)/Math.SQRT2;N.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[Ue,-1*(38.1-13.5+Ue)],"bottom-right":[-Ue,-1*(38.1-13.5+Ue)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=N,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(N){return this._subpixelPositioning=N,this}getPopup(){return this._popup}togglePopup(){const N=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:N?(N.isOpen()?N.remove():(N.setLngLat(this._lngLat),N.addTo(this._map)),this):this}_updateOpacity(N=!1){var ve,Oe;if(!(!((ve=this._map)===null||ve===void 0)&&ve.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(N)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const Ue=this._map,Ke=Ue.terrain.depthAtPoint(this._pos),It=Ue.terrain.getElevationForLngLatZoom(this._lngLat,Ue.transform.tileZoom);if(Ue.transform.lngLatToCameraDepth(this._lngLat,It)-Ke<.006)return void(this._element.style.opacity=this._opacity);const $t=-this._offset.y/Ue.transform._pixelPerMeter,ir=Math.sin(Ue.getPitch()*Math.PI/180)*$t,Tr=Ue.terrain.depthAtPoint(new r.P(this._pos.x,this._pos.y-this._offset.y)),Or=Ue.transform.lngLatToCameraDepth(this._lngLat,It+ir)-Tr>.006;!((Oe=this._popup)===null||Oe===void 0)&&Oe.isOpen()&&Or&&this._popup.remove(),this._element.style.opacity=Or?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(N){return this._offset=r.P.convert(N),this._update(),this}addClassName(N){this._element.classList.add(N)}removeClassName(N){this._element.classList.remove(N)}toggleClassName(N){return this._element.classList.toggle(N)}setDraggable(N){return this._draggable=!!N,this._map&&(N?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(N){return this._rotation=N||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(N){return this._rotationAlignment=N||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(N){return this._pitchAlignment=N&&N!=="auto"?N:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(N,ve){return N===void 0&&ve===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),N!==void 0&&(this._opacity=N),ve!==void 0&&(this._opacityWhenCovered=ve),this._map&&this._updateOpacity(!0),this}}const kh={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let qc=0,oh=!1;const Ku={maxWidth:100,unit:"metric"};function sh(Qe,N,ve){const Oe=ve&&ve.maxWidth||100,Ue=Qe._container.clientHeight/2,Ke=Qe.unproject([0,Ue]),It=Qe.unproject([Oe,Ue]),$t=Ke.distanceTo(It);if(ve&&ve.unit==="imperial"){const ir=3.2808*$t;ir>5280?hs(N,Oe,ir/5280,Qe._getUIString("ScaleControl.Miles")):hs(N,Oe,ir,Qe._getUIString("ScaleControl.Feet"))}else ve&&ve.unit==="nautical"?hs(N,Oe,$t/1852,Qe._getUIString("ScaleControl.NauticalMiles")):$t>=1e3?hs(N,Oe,$t/1e3,Qe._getUIString("ScaleControl.Kilometers")):hs(N,Oe,$t,Qe._getUIString("ScaleControl.Meters"))}function hs(Qe,N,ve,Oe){const Ue=(function(Ke){const It=Math.pow(10,`${Math.floor(Ke)}`.length-1);let $t=Ke/It;return $t=$t>=10?10:$t>=5?5:$t>=3?3:$t>=2?2:$t>=1?1:(function(ir){const Tr=Math.pow(10,Math.ceil(-Math.log(ir)/Math.LN10));return Math.round(ir*Tr)/Tr})($t),It*$t})(ve);Qe.style.width=N*(Ue/ve)+"px",Qe.innerHTML=`${Ue} ${Oe}`}const Ss={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},lh=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Cf(Qe){if(Qe){if(typeof Qe=="number"){const N=Math.round(Math.abs(Qe)/Math.SQRT2);return{center:new r.P(0,0),top:new r.P(0,Qe),"top-left":new r.P(N,N),"top-right":new r.P(-N,N),bottom:new r.P(0,-Qe),"bottom-left":new r.P(N,-N),"bottom-right":new r.P(-N,-N),left:new r.P(Qe,0),right:new r.P(-Qe,0)}}if(Qe instanceof r.P||Array.isArray(Qe)){const N=r.P.convert(Qe);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:r.P.convert(Qe.center||[0,0]),top:r.P.convert(Qe.top||[0,0]),"top-left":r.P.convert(Qe["top-left"]||[0,0]),"top-right":r.P.convert(Qe["top-right"]||[0,0]),bottom:r.P.convert(Qe.bottom||[0,0]),"bottom-left":r.P.convert(Qe["bottom-left"]||[0,0]),"bottom-right":r.P.convert(Qe["bottom-right"]||[0,0]),left:r.P.convert(Qe.left||[0,0]),right:r.P.convert(Qe.right||[0,0])}}return Cf(new r.P(0,0))}const vf=a;t.AJAXError=r.bh,t.Evented=r.E,t.LngLat=r.N,t.MercatorCoordinate=r.Z,t.Point=r.P,t.addProtocol=r.bi,t.config=r.a,t.removeProtocol=r.bj,t.AttributionControl=ls,t.BoxZoomHandler=Nf,t.CanvasSource=mt,t.CooperativeGesturesHandler=Yi,t.DoubleClickZoomHandler=$a,t.DragPanHandler=Ni,t.DragRotateHandler=ho,t.EdgeInsets=Vc,t.FullscreenControl=class extends r.E{constructor(Qe={}){super(),this._onFullscreenChange=()=>{var N;let ve=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((N=ve?.shadowRoot)===null||N===void 0)&&N.fullscreenElement;)ve=ve.shadowRoot.fullscreenElement;ve===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Qe&&Qe.container&&(Qe.container instanceof HTMLElement?this._container=Qe.container:r.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(Qe){return this._map=Qe,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const Qe=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon",Qe).setAttribute("aria-hidden","true"),Qe.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const Qe=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Qe),this._fullscreenButton.title=Qe}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new r.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new r.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=Xe,t.GeolocateControl=class extends r.E{constructor(Qe){super(),this._onSuccess=N=>{if(this._map){if(this._isOutOfMapMaxBounds(N))return this._setErrorState(),this.fire(new r.k("outofmaxbounds",N)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=N,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(N),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(N),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new r.k("geolocate",N)),this._finish()}},this._updateCamera=N=>{const ve=new r.N(N.coords.longitude,N.coords.latitude),Oe=N.coords.accuracy,Ue=this._map.getBearing(),Ke=r.e({bearing:Ue},this.options.fitBoundsOptions),It=pe.fromLngLat(ve,Oe);this._map.fitBounds(It,Ke,{geolocateSource:!0})},this._updateMarker=N=>{if(N){const ve=new r.N(N.coords.longitude,N.coords.latitude);this._accuracyCircleMarker.setLngLat(ve).addTo(this._map),this._userLocationDotMarker.setLngLat(ve).addTo(this._map),this._accuracy=N.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=N=>{if(this._map){if(this.options.trackUserLocation)if(N.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const ve=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ve,this._geolocateButton.setAttribute("aria-label",ve),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(N.code===3&&oh)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new r.k("error",N)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",N=>N.preventDefault()),this._geolocateButton=o.create("button","maplibregl-ctrl-geolocate",this._container),o.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=N=>{if(this._map){if(N===!1){r.w("Geolocation support is not available so the GeolocateControl will be disabled.");const ve=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=ve,this._geolocateButton.setAttribute("aria-label",ve)}else{const ve=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=ve,this._geolocateButton.setAttribute("aria-label",ve)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Zc({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zc({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",ve=>{ve.geolocateSource||this._watchState!=="ACTIVE_LOCK"||ve.originalEvent&&ve.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new r.k("trackuserlocationend")),this.fire(new r.k("userlocationlostfocus")))})}},this.options=r.e({},kh,Qe)}onAdd(Qe){return this._map=Qe,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return r._(this,arguments,void 0,function*(N=!1){if(nu!==void 0&&!N)return nu;if(window.navigator.permissions===void 0)return nu=!!window.navigator.geolocation,nu;try{nu=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{nu=!!window.navigator.geolocation}return nu})})().then(N=>this._finishSetupUI(N)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,qc=0,oh=!1}_isOutOfMapMaxBounds(Qe){const N=this._map.getMaxBounds(),ve=Qe.coords;return N&&(ve.longitudeN.getEast()||ve.latitudeN.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const Qe=this._map.getBounds(),N=Qe.getSouthEast(),ve=Qe.getNorthEast(),Oe=N.distanceTo(ve),Ue=Math.ceil(this._accuracy/(Oe/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Ue}px`,this._circleElement.style.height=`${Ue}px`}trigger(){if(!this._setup)return r.w("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 r.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":qc--,oh=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new r.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new r.k("trackuserlocationstart")),this.fire(new r.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let Qe;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),qc++,qc>1?(Qe={maximumAge:6e5,timeout:0},oh=!0):(Qe=this.options.positionOptions,oh=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Qe)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},t.Hash=qf,t.ImageSource=yt,t.KeyboardHandler=qr,t.LngLatBounds=pe,t.LogoControl=To,t.Map=class extends rs{constructor(Qe){r.bf.mark(r.bg.create);const N=Object.assign(Object.assign({},Hu),Qe);if(N.minZoom!=null&&N.maxZoom!=null&&N.minZoom>N.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(N.minPitch!=null&&N.maxPitch!=null&&N.minPitch>N.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(N.minPitch!=null&&N.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(N.maxPitch!=null&&N.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ru(N.minZoom,N.maxZoom,N.minPitch,N.maxPitch,N.renderWorldCopies),{bearingSnap:N.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new ro,this._controls=[],this._mapId=r.a4(),this._contextLost=ve=>{ve.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new r.k("webglcontextlost",{originalEvent:ve}))},this._contextRestored=ve=>{this._setupPainter(),this.resize(),this._update(),this.fire(new r.k("webglcontextrestored",{originalEvent:ve}))},this._onMapScroll=ve=>{if(ve.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=N.interactive,this._maxTileCacheSize=N.maxTileCacheSize,this._maxTileCacheZoomLevels=N.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=N.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=N.preserveDrawingBuffer===!0,this._antialias=N.antialias===!0,this._trackResize=N.trackResize===!0,this._bearingSnap=N.bearingSnap,this._refreshExpiredTiles=N.refreshExpiredTiles===!0,this._fadeDuration=N.fadeDuration,this._crossSourceCollisions=N.crossSourceCollisions===!0,this._collectResourceTiming=N.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},wl),N.locale),this._clickTolerance=N.clickTolerance,this._overridePixelRatio=N.pixelRatio,this._maxCanvasSize=N.maxCanvasSize,this.transformCameraUpdate=N.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=N.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=f.addThrottleControl(()=>this.isMoving()),this._requestManager=new x(N.transformRequest),typeof N.container=="string"){if(this._container=document.getElementById(N.container),!this._container)throw new Error(`Container '${N.container}' not found.`)}else{if(!(N.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=N.container}if(N.maxBounds&&this.setMaxBounds(N.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let ve=!1;const Oe=Nh(Ue=>{this._trackResize&&!this._removed&&(this.resize(Ue),this.redraw())},50);this._resizeObserver=new ResizeObserver(Ue=>{ve?Oe(Ue):ve=!0}),this._resizeObserver.observe(this._container)}this.handlers=new os(this,N),this._hash=N.hash&&new qf(typeof N.hash=="string"&&N.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:N.center,zoom:N.zoom,bearing:N.bearing,pitch:N.pitch}),N.bounds&&(this.resize(),this.fitBounds(N.bounds,r.e({},N.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=N.localIdeographFontFamily,this._validateStyle=N.validateStyle,N.style&&this.setStyle(N.style,{localIdeographFontFamily:N.localIdeographFontFamily}),N.attributionControl&&this.addControl(new ls(typeof N.attributionControl=="boolean"?void 0:N.attributionControl)),N.maplibreLogo&&this.addControl(new To,N.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",ve=>{this._update(ve.dataType==="style"),this.fire(new r.k(`${ve.dataType}data`,ve))}),this.on("dataloading",ve=>{this.fire(new r.k(`${ve.dataType}dataloading`,ve))}),this.on("dataabort",ve=>{this.fire(new r.k("sourcedataabort",ve))})}_getMapId(){return this._mapId}addControl(Qe,N){if(N===void 0&&(N=Qe.getDefaultPosition?Qe.getDefaultPosition():"top-right"),!Qe||!Qe.onAdd)return this.fire(new r.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const ve=Qe.onAdd(this);this._controls.push(Qe);const Oe=this._controlPositions[N];return N.indexOf("bottom")!==-1?Oe.insertBefore(ve,Oe.firstChild):Oe.appendChild(ve),this}removeControl(Qe){if(!Qe||!Qe.onRemove)return this.fire(new r.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const N=this._controls.indexOf(Qe);return N>-1&&this._controls.splice(N,1),Qe.onRemove(this),this}hasControl(Qe){return this._controls.indexOf(Qe)>-1}calculateCameraOptionsFromTo(Qe,N,ve,Oe){return Oe==null&&this.terrain&&(Oe=this.terrain.getElevationForLngLatZoom(ve,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Qe,N,ve,Oe)}resize(Qe){var N;const ve=this._containerDimensions(),Oe=ve[0],Ue=ve[1],Ke=this._getClampedPixelRatio(Oe,Ue);if(this._resizeCanvas(Oe,Ue,Ke),this.painter.resize(Oe,Ue,Ke),this.painter.overLimit()){const $t=this.painter.context.gl;this._maxCanvasSize=[$t.drawingBufferWidth,$t.drawingBufferHeight];const ir=this._getClampedPixelRatio(Oe,Ue);this._resizeCanvas(Oe,Ue,ir),this.painter.resize(Oe,Ue,ir)}this.transform.resize(Oe,Ue),(N=this._requestedCameraState)===null||N===void 0||N.resize(Oe,Ue);const It=!this._moving;return It&&(this.stop(),this.fire(new r.k("movestart",Qe)).fire(new r.k("move",Qe))),this.fire(new r.k("resize",Qe)),It&&this.fire(new r.k("moveend",Qe)),this}_getClampedPixelRatio(Qe,N){const{0:ve,1:Oe}=this._maxCanvasSize,Ue=this.getPixelRatio(),Ke=Qe*Ue,It=N*Ue;return Math.min(Ke>ve?ve/Ke:1,It>Oe?Oe/It:1)*Ue}getPixelRatio(){var Qe;return(Qe=this._overridePixelRatio)!==null&&Qe!==void 0?Qe:devicePixelRatio}setPixelRatio(Qe){this._overridePixelRatio=Qe,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Qe){return this.transform.setMaxBounds(pe.convert(Qe)),this._update()}setMinZoom(Qe){if((Qe=Qe??-2)>=-2&&Qe<=this.transform.maxZoom)return this.transform.minZoom=Qe,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Qe,this._update(),this.getZoom()>Qe&&this.setZoom(Qe),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Qe){if((Qe=Qe??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Qe>=0&&Qe<=this.transform.maxPitch)return this.transform.minPitch=Qe,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Qe>=this.transform.minPitch)return this.transform.maxPitch=Qe,this._update(),this.getPitch()>Qe&&this.setPitch(Qe),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Qe){return this.transform.renderWorldCopies=Qe,this._update()}project(Qe){return this.transform.locationPoint(r.N.convert(Qe),this.style&&this.terrain)}unproject(Qe){return this.transform.pointLocation(r.P.convert(Qe),this.terrain)}isMoving(){var Qe;return this._moving||((Qe=this.handlers)===null||Qe===void 0?void 0:Qe.isMoving())}isZooming(){var Qe;return this._zooming||((Qe=this.handlers)===null||Qe===void 0?void 0:Qe.isZooming())}isRotating(){var Qe;return this._rotating||((Qe=this.handlers)===null||Qe===void 0?void 0:Qe.isRotating())}_createDelegatedListener(Qe,N,ve){if(Qe==="mouseenter"||Qe==="mouseover"){let Oe=!1;return{layers:N,listener:ve,delegates:{mousemove:Ke=>{const It=N.filter(ir=>this.getLayer(ir)),$t=It.length!==0?this.queryRenderedFeatures(Ke.point,{layers:It}):[];$t.length?Oe||(Oe=!0,ve.call(this,new Dc(Qe,this,Ke.originalEvent,{features:$t}))):Oe=!1},mouseout:()=>{Oe=!1}}}}if(Qe==="mouseleave"||Qe==="mouseout"){let Oe=!1;return{layers:N,listener:ve,delegates:{mousemove:It=>{const $t=N.filter(ir=>this.getLayer(ir));($t.length!==0?this.queryRenderedFeatures(It.point,{layers:$t}):[]).length?Oe=!0:Oe&&(Oe=!1,ve.call(this,new Dc(Qe,this,It.originalEvent)))},mouseout:It=>{Oe&&(Oe=!1,ve.call(this,new Dc(Qe,this,It.originalEvent)))}}}}{const Oe=Ue=>{const Ke=N.filter($t=>this.getLayer($t)),It=Ke.length!==0?this.queryRenderedFeatures(Ue.point,{layers:Ke}):[];It.length&&(Ue.features=It,ve.call(this,Ue),delete Ue.features)};return{layers:N,listener:ve,delegates:{[Qe]:Oe}}}}_saveDelegatedListener(Qe,N){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Qe]=this._delegatedListeners[Qe]||[],this._delegatedListeners[Qe].push(N)}_removeDelegatedListener(Qe,N,ve){if(!this._delegatedListeners||!this._delegatedListeners[Qe])return;const Oe=this._delegatedListeners[Qe];for(let Ue=0;UeN.includes(It))){for(const It in Ke.delegates)this.off(It,Ke.delegates[It]);return void Oe.splice(Ue,1)}}}on(Qe,N,ve){if(ve===void 0)return super.on(Qe,N);const Oe=this._createDelegatedListener(Qe,typeof N=="string"?[N]:N,ve);this._saveDelegatedListener(Qe,Oe);for(const Ue in Oe.delegates)this.on(Ue,Oe.delegates[Ue]);return this}once(Qe,N,ve){if(ve===void 0)return super.once(Qe,N);const Oe=typeof N=="string"?[N]:N,Ue=this._createDelegatedListener(Qe,Oe,ve);for(const Ke in Ue.delegates){const It=Ue.delegates[Ke];Ue.delegates[Ke]=(...$t)=>{this._removeDelegatedListener(Qe,Oe,ve),It(...$t)}}this._saveDelegatedListener(Qe,Ue);for(const Ke in Ue.delegates)this.once(Ke,Ue.delegates[Ke]);return this}off(Qe,N,ve){return ve===void 0?super.off(Qe,N):(this._removeDelegatedListener(Qe,typeof N=="string"?[N]:N,ve),this)}queryRenderedFeatures(Qe,N){if(!this.style)return[];let ve;const Oe=Qe instanceof r.P||Array.isArray(Qe),Ue=Oe?Qe:[[0,0],[this.transform.width,this.transform.height]];if(N=N||(Oe?{}:Qe)||{},Ue instanceof r.P||typeof Ue[0]=="number")ve=[r.P.convert(Ue)];else{const Ke=r.P.convert(Ue[0]),It=r.P.convert(Ue[1]);ve=[Ke,new r.P(It.x,Ke.y),It,new r.P(Ke.x,It.y),Ke]}return this.style.queryRenderedFeatures(ve,N,this.transform)}querySourceFeatures(Qe,N){return this.style.querySourceFeatures(Qe,N)}setStyle(Qe,N){return(N=r.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},N)).diff!==!1&&N.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Qe?(this._diffStyle(Qe,N),this):(this._localIdeographFontFamily=N.localIdeographFontFamily,this._updateStyle(Qe,N))}setTransformRequest(Qe){return this._requestManager.setTransformRequest(Qe),this}_getUIString(Qe){const N=this._locale[Qe];if(N==null)throw new Error(`Missing UI string '${Qe}'`);return N}_updateStyle(Qe,N){if(N.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Qe,N));const ve=this.style&&N.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Qe)),Qe?(this.style=new tn(this,N||{}),this.style.setEventedParent(this,{style:this.style}),typeof Qe=="string"?this.style.loadURL(Qe,N,ve):this.style.loadJSON(Qe,N,ve),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new tn(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Qe,N){if(typeof Qe=="string"){const ve=this._requestManager.transformRequest(Qe,"Style");r.h(ve,new AbortController).then(Oe=>{this._updateDiff(Oe.data,N)}).catch(Oe=>{Oe&&this.fire(new r.j(Oe))})}else typeof Qe=="object"&&this._updateDiff(Qe,N)}_updateDiff(Qe,N){try{this.style.setState(Qe,N)&&this._update(!0)}catch(ve){r.w(`Unable to perform style diff: ${ve.message||ve.error||ve}. Rebuilding the style from scratch.`),this._updateStyle(Qe,N)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():r.w("There is no style added to the map.")}addSource(Qe,N){return this._lazyInitEmptyStyle(),this.style.addSource(Qe,N),this._update(!0)}isSourceLoaded(Qe){const N=this.style&&this.style.sourceCaches[Qe];if(N!==void 0)return N.loaded();this.fire(new r.j(new Error(`There is no source with ID '${Qe}'`)))}setTerrain(Qe){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Qe){const N=this.style.sourceCaches[Qe.source];if(!N)throw new Error(`cannot load terrain, because there exists no source with ID: ${Qe.source}`);this.terrain===null&&N.reload();for(const ve in this.style._layers){const Oe=this.style._layers[ve];Oe.type==="hillshade"&&Oe.source===Qe.source&&r.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Hl(this.painter,N,Qe),this.painter.renderToTexture=new gu(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=ve=>{ve.dataType==="style"?this.terrain.sourceCache.freeRtt():ve.dataType==="source"&&ve.tile&&(ve.sourceId!==Qe.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(ve.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new r.k("terrain",{terrain:Qe})),this}getTerrain(){var Qe,N;return(N=(Qe=this.terrain)===null||Qe===void 0?void 0:Qe.options)!==null&&N!==void 0?N:null}areTilesLoaded(){const Qe=this.style&&this.style.sourceCaches;for(const N in Qe){const ve=Qe[N]._tiles;for(const Oe in ve){const Ue=ve[Oe];if(Ue.state!=="loaded"&&Ue.state!=="errored")return!1}}return!0}removeSource(Qe){return this.style.removeSource(Qe),this._update(!0)}getSource(Qe){return this.style.getSource(Qe)}addImage(Qe,N,ve={}){const{pixelRatio:Oe=1,sdf:Ue=!1,stretchX:Ke,stretchY:It,content:$t,textFitWidth:ir,textFitHeight:Tr}=ve;if(this._lazyInitEmptyStyle(),!(N instanceof HTMLImageElement||r.b(N))){if(N.width===void 0||N.height===void 0)return this.fire(new r.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:Or,height:Vr,data:vn}=N,Dn=N;return this.style.addImage(Qe,{data:new r.R({width:Or,height:Vr},new Uint8Array(vn)),pixelRatio:Oe,stretchX:Ke,stretchY:It,content:$t,textFitWidth:ir,textFitHeight:Tr,sdf:Ue,version:0,userImage:Dn}),Dn.onAdd&&Dn.onAdd(this,Qe),this}}{const{width:Or,height:Vr,data:vn}=s.getImageData(N);this.style.addImage(Qe,{data:new r.R({width:Or,height:Vr},vn),pixelRatio:Oe,stretchX:Ke,stretchY:It,content:$t,textFitWidth:ir,textFitHeight:Tr,sdf:Ue,version:0})}}updateImage(Qe,N){const ve=this.style.getImage(Qe);if(!ve)return this.fire(new r.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const Oe=N instanceof HTMLImageElement||r.b(N)?s.getImageData(N):N,{width:Ue,height:Ke,data:It}=Oe;if(Ue===void 0||Ke===void 0)return this.fire(new r.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Ue!==ve.data.width||Ke!==ve.data.height)return this.fire(new r.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const $t=!(N instanceof HTMLImageElement||r.b(N));return ve.data.replace(It,$t),this.style.updateImage(Qe,ve),this}getImage(Qe){return this.style.getImage(Qe)}hasImage(Qe){return Qe?!!this.style.getImage(Qe):(this.fire(new r.j(new Error("Missing required image id"))),!1)}removeImage(Qe){this.style.removeImage(Qe)}loadImage(Qe){return f.getImage(this._requestManager.transformRequest(Qe,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Qe,N){return this._lazyInitEmptyStyle(),this.style.addLayer(Qe,N),this._update(!0)}moveLayer(Qe,N){return this.style.moveLayer(Qe,N),this._update(!0)}removeLayer(Qe){return this.style.removeLayer(Qe),this._update(!0)}getLayer(Qe){return this.style.getLayer(Qe)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Qe,N,ve){return this.style.setLayerZoomRange(Qe,N,ve),this._update(!0)}setFilter(Qe,N,ve={}){return this.style.setFilter(Qe,N,ve),this._update(!0)}getFilter(Qe){return this.style.getFilter(Qe)}setPaintProperty(Qe,N,ve,Oe={}){return this.style.setPaintProperty(Qe,N,ve,Oe),this._update(!0)}getPaintProperty(Qe,N){return this.style.getPaintProperty(Qe,N)}setLayoutProperty(Qe,N,ve,Oe={}){return this.style.setLayoutProperty(Qe,N,ve,Oe),this._update(!0)}getLayoutProperty(Qe,N){return this.style.getLayoutProperty(Qe,N)}setGlyphs(Qe,N={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Qe,N),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Qe,N,ve={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Qe,N,ve,Oe=>{Oe||this._update(!0)}),this}removeSprite(Qe){return this._lazyInitEmptyStyle(),this.style.removeSprite(Qe),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Qe,N={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Qe,N,ve=>{ve||this._update(!0)}),this}setLight(Qe,N={}){return this._lazyInitEmptyStyle(),this.style.setLight(Qe,N),this._update(!0)}getLight(){return this.style.getLight()}setSky(Qe){return this._lazyInitEmptyStyle(),this.style.setSky(Qe),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Qe,N){return this.style.setFeatureState(Qe,N),this._update()}removeFeatureState(Qe,N){return this.style.removeFeatureState(Qe,N),this._update()}getFeatureState(Qe){return this.style.getFeatureState(Qe)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Qe=0,N=0;return this._container&&(Qe=this._container.clientWidth||400,N=this._container.clientHeight||300),[Qe,N]}_setupContainer(){const Qe=this._container;Qe.classList.add("maplibregl-map");const N=this._canvasContainer=o.create("div","maplibregl-canvas-container",Qe);this._interactive&&N.classList.add("maplibregl-interactive"),this._canvas=o.create("canvas","maplibregl-canvas",N),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const ve=this._containerDimensions(),Oe=this._getClampedPixelRatio(ve[0],ve[1]);this._resizeCanvas(ve[0],ve[1],Oe);const Ue=this._controlContainer=o.create("div","maplibregl-control-container",Qe),Ke=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(It=>{Ke[It]=o.create("div",`maplibregl-ctrl-${It} `,Ue)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Qe,N,ve){this._canvas.width=Math.floor(ve*Qe),this._canvas.height=Math.floor(ve*N),this._canvas.style.width=`${Qe}px`,this._canvas.style.height=`${N}px`}_setupPainter(){const Qe={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let N=null;this._canvas.addEventListener("webglcontextcreationerror",Oe=>{N={requestedAttributes:Qe},Oe&&(N.statusMessage=Oe.statusMessage,N.type=Oe.type)},{once:!0});const ve=this._canvas.getContext("webgl2",Qe)||this._canvas.getContext("webgl",Qe);if(!ve){const Oe="Failed to initialize WebGL";throw N?(N.message=Oe,new Error(JSON.stringify(N))):new Error(Oe)}this.painter=new gh(ve,this.transform),c.testSupport(ve)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Qe){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Qe,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Qe){return this._update(),this._renderTaskQueue.add(Qe)}_cancelRenderFrame(Qe){this._renderTaskQueue.remove(Qe)}_render(Qe){const N=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Qe),this._removed)return;let ve=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const Ue=this.transform.zoom,Ke=s.now();this.style.zoomHistory.update(Ue,Ke);const It=new r.z(Ue,{now:Ke,fadeDuration:N,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),$t=It.crossFadingFactor();$t===1&&$t===this._crossFadingFactor||(ve=!0,this._crossFadingFactor=$t),this.style.update(It)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,N,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:N,showPadding:this.showPadding}),this.fire(new r.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,r.bf.mark(r.bg.load),this.fire(new r.k("load"))),this.style&&(this.style.hasTransitions()||ve)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const Oe=this._sourcesDirty||this._styleDirty||this._placementDirty;return Oe||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new r.k("idle")),!this._loaded||this._fullyLoaded||Oe||(this._fullyLoaded=!0,r.bf.mark(r.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var Qe;this._hash&&this._hash.remove();for(const ve of this._controls)ve.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),f.removeThrottleControl(this._imageQueueHandle),(Qe=this._resizeObserver)===null||Qe===void 0||Qe.disconnect();const N=this.painter.context.gl.getExtension("WEBGL_lose_context");N?.loseContext&&N.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),r.bf.clearMetrics(),this._removed=!0,this.fire(new r.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,s.frameAsync(this._frameRequest).then(Qe=>{r.bf.frame(Qe),this._frameRequest=null,this._render(Qe)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Qe){this._showTileBoundaries!==Qe&&(this._showTileBoundaries=Qe,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Qe){this._showPadding!==Qe&&(this._showPadding=Qe,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Qe){this._showCollisionBoxes!==Qe&&(this._showCollisionBoxes=Qe,Qe?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Qe){this._showOverdrawInspector!==Qe&&(this._showOverdrawInspector=Qe,this._update())}get repaint(){return!!this._repaint}set repaint(Qe){this._repaint!==Qe&&(this._repaint=Qe,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Qe){this._vertices=Qe,this._update()}get version(){return Zu}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=Dc,t.MapTouchEvent=Fh,t.MapWheelEvent=Nd,t.Marker=Zc,t.NavigationControl=class{constructor(Qe){this._updateZoomButtons=()=>{const N=this._map.getZoom(),ve=N===this._map.getMaxZoom(),Oe=N===this._map.getMinZoom();this._zoomInButton.disabled=ve,this._zoomOutButton.disabled=Oe,this._zoomInButton.setAttribute("aria-disabled",ve.toString()),this._zoomOutButton.setAttribute("aria-disabled",Oe.toString())},this._rotateCompassArrow=()=>{const N=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=N},this._setButtonTitle=(N,ve)=>{const Oe=this._map._getUIString(`NavigationControl.${ve}`);N.title=Oe,N.setAttribute("aria-label",Oe)},this.options=r.e({},Vo,Qe),this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",N=>N.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",N=>this._map.zoomIn({},{originalEvent:N})),o.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",N=>this._map.zoomOut({},{originalEvent:N})),o.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",N=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:N}):this._map.resetNorth({},{originalEvent:N})}),this._compassIcon=o.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Qe){return this._map=Qe,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Fs(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(Qe,N){const ve=o.create("button",Qe,this._container);return ve.type="button",ve.addEventListener("click",N),ve}},t.Popup=class extends r.E{constructor(Qe){super(),this.remove=()=>(this._content&&o.remove(this._content),this._container&&(o.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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new r.k("close"))),this),this._onMouseUp=N=>{this._update(N.point)},this._onMouseMove=N=>{this._update(N.point)},this._onDrag=N=>{this._update(N.point)},this._update=N=>{var ve;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=o.create("div","maplibregl-popup",this._map.getContainer()),this._tip=o.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const $t of this.options.className.split(" "))this._container.classList.add($t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Fl(this._lngLat,this._flatPos,this._map.transform):(ve=this._lngLat)===null||ve===void 0?void 0:ve.wrap(),this._trackPointer&&!N)return;const Oe=this._flatPos=this._pos=this._trackPointer&&N?N:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&N?N:this._map.transform.locationPoint(this._lngLat));let Ue=this.options.anchor;const Ke=Cf(this.options.offset);if(!Ue){const $t=this._container.offsetWidth,ir=this._container.offsetHeight;let Tr;Tr=Oe.y+Ke.bottom.ythis._map.transform.height-ir?["bottom"]:[],Oe.x<$t/2?Tr.push("left"):Oe.x>this._map.transform.width-$t/2&&Tr.push("right"),Ue=Tr.length===0?"bottom":Tr.join("-")}let It=Oe.add(Ke[Ue]);this.options.subpixelPositioning||(It=It.round()),o.setTransform(this._container,`${jc[Ue]} translate(${It.x}px,${It.y}px)`),Gc(this._container,Ue,"popup")},this._onClose=()=>{this.remove()},this.options=r.e(Object.create(Ss),Qe)}addTo(Qe){return this._map&&this.remove(),this._map=Qe,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._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new r.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Qe){return this._lngLat=r.N.convert(Qe),this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(Qe){return this.setDOMContent(document.createTextNode(Qe))}setHTML(Qe){const N=document.createDocumentFragment(),ve=document.createElement("body");let Oe;for(ve.innerHTML=Qe;Oe=ve.firstChild,Oe;)N.appendChild(Oe);return this.setDOMContent(N)}getMaxWidth(){var Qe;return(Qe=this._container)===null||Qe===void 0?void 0:Qe.style.maxWidth}setMaxWidth(Qe){return this.options.maxWidth=Qe,this._update(),this}setDOMContent(Qe){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Qe),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Qe){return this._container&&this._container.classList.add(Qe),this}removeClassName(Qe){return this._container&&this._container.classList.remove(Qe),this}setOffset(Qe){return this.options.offset=Qe,this._update(),this}toggleClassName(Qe){if(this._container)return this._container.classList.toggle(Qe)}setSubpixelPositioning(Qe){this.options.subpixelPositioning=Qe}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const Qe=this._container.querySelector(lh);Qe&&Qe.focus()}},t.RasterDEMTileSource=Ze,t.RasterTileSource=$e,t.ScaleControl=class{constructor(Qe){this._onMove=()=>{sh(this._map,this._container,this.options)},this.setUnit=N=>{this.options.unit=N,sh(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Ku),Qe)}getDefaultPosition(){return"bottom-left"}onAdd(Qe){return this._map=Qe,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Qe.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=Qn,t.Style=tn,t.TerrainControl=class{constructor(Qe){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=Qe}onAdd(Qe){return this._map=Qe,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain",this._container),o.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=Ed,t.TwoFingersTouchRotateHandler=xh,t.TwoFingersTouchZoomHandler=Yc,t.TwoFingersTouchZoomRotateHandler=fi,t.VectorTileSource=Ne,t.VideoSource=bt,t.addSourceType=(Qe,N)=>r._(void 0,void 0,void 0,function*(){if(Ve(Qe))throw new Error(`A source type called "${Qe}" already exists.`);((ve,Oe)=>{ht[ve]=Oe})(Qe,N)}),t.clearPrewarmedResources=function(){const Qe=_e;Qe&&(Qe.isPreloaded()&&Qe.numActive()===1?(Qe.release(ue),_e=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},t.getMaxParallelImageRequests=function(){return r.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return _t().getRTLTextPluginStatus()},t.getVersion=function(){return vf},t.getWorkerCount=function(){return xe.workerCount},t.getWorkerUrl=function(){return r.a.WORKER_URL},t.importScriptInWorkers=function(Qe){return ne().broadcast("IS",Qe)},t.prewarm=function(){se().acquire(ue)},t.setMaxParallelImageRequests=function(Qe){r.a.MAX_PARALLEL_IMAGE_REQUESTS=Qe},t.setRTLTextPlugin=function(Qe,N){return _t().setRTLTextPlugin(Qe,N)},t.setWorkerCount=function(Qe){xe.workerCount=Qe},t.setWorkerUrl=function(Qe){r.a.WORKER_URL=Qe}});var L=v;return L})}}),gK=Re({"src/plots/map/layers.js"(ae,K){var v=Rn(),S=kc().sanitizeHTML,M=c7(),L=Ww();function t(s,o){this.subplot=s,this.uid=s.uid+"-"+o,this.index=o,this.idSource="source-"+this.uid,this.idLayer=L.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var r=t.prototype;r.update=function(o){this.visible?this.needsNewImage(o)?this.updateImage(o):this.needsNewSource(o)?(this.removeLayer(),this.updateSource(o),this.updateLayer(o)):this.needsNewLayer(o)?this.updateLayer(o):this.updateStyle(o):(this.updateSource(o),this.updateLayer(o)),this.visible=a(o)},r.needsNewImage=function(s){var o=this.subplot.map;return o.getSource(this.idSource)&&this.sourceType==="image"&&s.sourcetype==="image"&&(this.source!==s.source||JSON.stringify(this.coordinates)!==JSON.stringify(s.coordinates))},r.needsNewSource=function(s){return this.sourceType!==s.sourcetype||JSON.stringify(this.source)!==JSON.stringify(s.source)||this.layerType!==s.type},r.needsNewLayer=function(s){return this.layerType!==s.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},r.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},r.updateImage=function(s){var o=this.subplot.map;o.getSource(this.idSource).updateImage({url:s.source,coordinates:s.coordinates});var c=this.findFollowingMapLayerId(this.lookupBelow());c!==null&&this.subplot.map.moveLayer(this.idLayer,c)},r.updateSource=function(s){var o=this.subplot.map;if(o.getSource(this.idSource)&&o.removeSource(this.idSource),this.sourceType=s.sourcetype,this.source=s.source,!!a(s)){var c=i(s);o.addSource(this.idSource,c)}},r.findFollowingMapLayerId=function(s){if(s==="traces")for(var o=this.subplot.getMapLayers(),c=0;c0){for(var c=0;c0}function l(s){var o={},c={};switch(s.type){case"circle":v.extendFlat(c,{"circle-radius":s.circle.radius,"circle-color":s.color,"circle-opacity":s.opacity});break;case"line":v.extendFlat(c,{"line-width":s.line.width,"line-color":s.color,"line-opacity":s.opacity,"line-dasharray":s.line.dash});break;case"fill":v.extendFlat(c,{"fill-color":s.color,"fill-outline-color":s.fill.outlinecolor,"fill-opacity":s.opacity});break;case"symbol":var p=s.symbol,d=M(p.textposition,p.iconsize);v.extendFlat(o,{"icon-image":p.icon+"-15","icon-size":p.iconsize/10,"text-field":p.text,"text-size":p.textfont.size,"text-anchor":d.anchor,"text-offset":d.offset,"symbol-placement":p.placement}),v.extendFlat(c,{"icon-color":s.color,"text-color":p.textfont.color,"text-opacity":s.opacity});break;case"raster":v.extendFlat(c,{"raster-fade-duration":0,"raster-opacity":s.opacity});break}return{layout:o,paint:c}}function i(s){var o=s.sourcetype,c=s.source,p={type:o},d;return o==="geojson"?d="data":o==="vector"?d=typeof c=="string"?"url":"tiles":o==="raster"?(d="tiles",p.tileSize=256):o==="image"&&(d="url",p.coordinates=s.coordinates),p[d]=c,s.sourceattribution&&(p.attribution=S(s.sourceattribution)),p}K.exports=function(o,c,p){var d=new t(o,c);return d.update(p),d}}}),yK=Re({"src/plots/map/map.js"(ae,K){var v=mK(),S=Rn(),M=jw(),L=es(),t=js(),r=fv(),a=Sh(),l=gg(),i=l.drawMode,s=l.selectMode,o=Dh().prepSelect,c=Dh().clearOutline,p=Dh().clearSelectionsCache,d=Dh().selectOnClick,y=Ww(),g=gK();function C(T,E){this.id=E,this.gd=T;var _=T._fullLayout,h=T._context;this.container=_._glcontainer.node(),this.isStatic=h.staticPlot,this.uid=_._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(_),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var f=C.prototype;f.plot=function(T,E,_){var h=this,m;h.map?m=new Promise(function(w,F){h.updateMap(T,E,w,F)}):m=new Promise(function(w,F){h.createMap(T,E,w,F)}),_.push(m)},f.createMap=function(T,E,_,h){var m=this,w=E[m.id],F=m.styleObj=A(w.style),z=w.bounds,U=z?[[z.west,z.south],[z.east,z.north]]:null,V=m.map=new v.Map({container:m.div,style:F.style,center:I(w.center),zoom:w.zoom,bearing:w.bearing,pitch:w.pitch,maxBounds:U,interactive:!m.isStatic,preserveDrawingBuffer:m.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new v.AttributionControl({compact:!0})),G={};V.on("styleimagemissing",function(O){var H=O.id;if(!G[H]&&H.includes("-15")){G[H]=!0;var W=new Image(15,15);W.onload=function(){V.addImage(H,W)},W.crossOrigin="Anonymous",W.src="https://unpkg.com/maki@2.1.0/icons/"+H+".svg"}}),V.setTransformRequest(function(O){return O=O.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),O=O.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),O=O.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:O}}),V._canvas.style.left="0px",V._canvas.style.top="0px",m.rejectOnError(h),m.isStatic||m.initFx(T,E);var j=[];j.push(new Promise(function(O){V.once("load",O)})),j=j.concat(M.fetchTraceGeoData(T)),Promise.all(j).then(function(){m.fillBelowLookup(T,E),m.updateData(T),m.updateLayout(E),m.resolveOnRender(_)}).catch(h)},f.updateMap=function(T,E,_,h){var m=this,w=m.map,F=E[this.id];m.rejectOnError(h);var z=[],U=A(F.style);JSON.stringify(m.styleObj)!==JSON.stringify(U)&&(m.styleObj=U,w.setStyle(U.style),m.traceHash={},z.push(new Promise(function(V){w.once("styledata",V)}))),z=z.concat(M.fetchTraceGeoData(T)),Promise.all(z).then(function(){m.fillBelowLookup(T,E),m.updateData(T),m.updateLayout(E),m.resolveOnRender(_)}).catch(h)},f.fillBelowLookup=function(T,E){var _=E[this.id],h=_.layers,m,w,F=this.belowLookup={},z=!1;for(m=0;m1)for(m=0;m-1&&d(U.originalEvent,h,[_.xaxis],[_.yaxis],_.id,z),V.indexOf("event")>-1&&a.click(h,U.originalEvent)}}},f.updateFx=function(T){var E=this,_=E.map,h=E.gd;if(E.isStatic)return;function m(U){var V=E.map.unproject(U);return[V.lng,V.lat]}var w=T.dragmode,F;F=function(U,V){if(V.isRect){var G=U.range={};G[E.id]=[m([V.xmin,V.ymin]),m([V.xmax,V.ymax])]}else{var j=U.lassoPoints={};j[E.id]=V.map(m)}};var z=E.dragOptions;E.dragOptions=S.extendDeep(z||{},{dragmode:T.dragmode,element:E.div,gd:h,plotinfo:{id:E.id,domain:T[E.id].domain,xaxis:E.xaxis,yaxis:E.yaxis,fillRangeItems:F},xaxes:[E.xaxis],yaxes:[E.yaxis],subplot:E.id}),_.off("click",E.onClickInPanHandler),s(w)||i(w)?(_.dragPan.disable(),_.on("zoomstart",E.clearOutline),E.dragOptions.prepFn=function(U,V,G){o(U,V,G,E.dragOptions,w)},r.init(E.dragOptions)):(_.dragPan.enable(),_.off("zoomstart",E.clearOutline),E.div.onmousedown=null,E.div.ontouchstart=null,E.div.removeEventListener("touchstart",E.div._ontouchstart),E.onClickInPanHandler=E.onClickInPanFn(E.dragOptions),_.on("click",E.onClickInPanHandler))},f.updateFramework=function(T){var E=T[this.id].domain,_=T._size,h=this.div.style;h.width=_.w*(E.x[1]-E.x[0])+"px",h.height=_.h*(E.y[1]-E.y[0])+"px",h.left=_.l+E.x[0]*_.w+"px",h.top=_.t+(1-E.y[1])*_.h+"px",this.xaxis._offset=_.l+E.x[0]*_.w,this.xaxis._length=_.w*(E.x[1]-E.x[0]),this.yaxis._offset=_.t+(1-E.y[1])*_.h,this.yaxis._length=_.h*(E.y[1]-E.y[0])},f.updateLayers=function(T){var E=T[this.id],_=E.layers,h=this.layerList,m;if(_.length!==h.length){for(m=0;m_/2){var h=k.split("|").join("
");T.text(h).attr("data-unformatted",h).call(a.convertToTspans,s),E=r.bBox(T.node())}T.attr("transform",v(-3,-E.height+8)),I.insert("rect",".static-attribution").attr({x:-E.width-6,y:-E.height-3,width:E.width+6,height:E.height+3,fill:"rgba(255, 255, 255, 0.75)"});var m=1;E.width+6>_&&(m=_/(E.width+6));var w=[p.l+p.w*g.x[1],p.t+p.h*(1-g.y[0])];I.attr("transform",v(w[0],w[1])+S(m))}},ae.updateFx=function(s){for(var o=s._fullLayout,c=o._subplots[i],p=0;p=0;l--)r.removeLayer(a[l][1])},t.dispose=function(){var r=this.subplot.map;this._removeLayers(),r.removeSource(this.sourceId)},K.exports=function(a,l){var i=l[0].trace,s=new L(a,i.uid),o=s.sourceId,c=v(l),p=s.below=a.belowLookup["trace-"+i.uid];return a.map.addSource(o,{type:"geojson",data:c.geojson}),s._addLayers(c,p),l[0].trace._glTrace=s,s}}}),AK=Re({"src/traces/choroplethmap/index.js"(ae,K){K.exports={attributes:f7(),supplyDefaults:wK(),colorbar:Ly(),calc:IP(),plot:TK(),hoverPoints:RP(),eventData:DP(),selectPoints:PP(),styleOnSelect:function(v,S){if(S){var M=S[0].trace;M._glTrace.updateOnSelect(S)}},getBelow:function(v,S){for(var M=S.getMapLayers(),L=M.length-2;L>=0;L--){var t=M[L].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var r=L+1;r0?+g[d]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:A},properties:k})}}var T=L.extractOpts(i),E=T.reversescale?L.flipScale(T.colorscale):T.colorscale,_=E[0][1],h=M.opacity(_)<1?_:M.addOpacity(_,0),m=["interpolate",["linear"],["heatmap-density"],0,h];for(d=1;d=0;a--)t.removeLayer(r[a][1])},L.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},K.exports=function(r,a){var l=a[0].trace,i=new M(r,l.uid),s=i.sourceId,o=v(a),c=i.below=r.belowLookup["trace-"+l.uid];return r.map.addSource(s,{type:"geojson",data:o.geojson}),i._addLayers(o,c),i}}}),IK=Re({"src/traces/densitymap/hover.js"(ae,K){var v=js(),S=ZP().hoverPoints,M=ZP().getExtraText;K.exports=function(t,r,a){var l=S(t,r,a);if(l){var i=l[0],s=i.cd,o=s[0].trace,c=s[i.index];if(delete i.color,"z"in c){var p=i.subplot.mockAxis;i.z=c.z,i.zLabel=v.tickText(p,p.c2l(c.z),"hover").text}return i.extraText=M(o,c,s[0].t.labels),[i]}}}}),LK=Re({"src/traces/densitymap/event_data.js"(ae,K){K.exports=function(S,M){return S.lon=M.lon,S.lat=M.lat,S.z=M.z,S}}}),RK=Re({"src/traces/densitymap/index.js"(ae,K){K.exports={attributes:d7(),supplyDefaults:EK(),colorbar:Ly(),formatLabels:u7(),calc:CK(),plot:MK(),hoverPoints:IK(),eventData:LK(),getBelow:function(v,S){for(var M=S.getMapLayers(),L=0;L0;){f=A[A.length-1];var k=S[f];if(a[f]=0&&i[f].push(l[T])}a[f]=I}else{if(t[f]===L[f]){for(var E=[],_=[],h=0,I=x.length-1;I>=0;--I){var m=x[I];if(r[m]=!1,E.push(m),_.push(i[m]),h+=i[m].length,l[m]=c.length,m===f){x.length=I;break}}c.push(E);for(var w=new Array(h),I=0;I<_.length;I++)for(var F=0;F<_[I].length;F++)w[--h]=_[I][F];p.push(w)}A.pop()}}}for(var s=0;sT&&(T=o.source[x]),o.target[x]>T&&(T=o.target[x]);var E=T+1;i.node._count=E;var _,h=i.node.groups,m={};for(x=0;x0&&t(G,E)&&t(j,E)&&!(m.hasOwnProperty(G)&&m.hasOwnProperty(j)&&m[G]===m[j])){m.hasOwnProperty(j)&&(j=m[j]),m.hasOwnProperty(G)&&(G=m[G]),G=+G,j=+j,g[G]=g[j]=!0;var O="";o.label&&o.label[x]&&(O=o.label[x]);var H=null;O&&C.hasOwnProperty(O)&&(H=C[O]),c.push({pointNumber:x,label:O,color:p?o.color[x]:o.color,hovercolor:d?o.hovercolor[x]:o.hovercolor,customdata:y?o.customdata[x]:o.customdata,concentrationscale:H,source:G,target:j,value:+V}),U.source.push(G),U.target.push(j)}}var W=E+h.length,ee=L(s.color),ue=L(s.customdata),xe=[];for(x=0;xE-1,childrenNodes:[],pointNumber:x,label:ge,color:ee?s.color[x]:s.color,customdata:ue?s.customdata[x]:s.customdata})}var _e=!1;return l(W,U.source,U.target)&&(_e=!0),{circular:_e,links:c,nodes:xe,groups:h,groupLookup:m}}function l(i,s,o){for(var c=S.init2dArray(i,0),p=0;p1})}K.exports=function(s,o){var c=a(o);return M({circular:c.circular,_nodes:c.nodes,_links:c.links,_groups:c.groups,_groupLookup:c.groupLookup})}}}),NK=Re({"node_modules/d3-quadtree/dist/d3-quadtree.js"(ae,K){(function(v,S){typeof ae=="object"&&typeof K<"u"?S(ae):(v=v||self,S(v.d3=v.d3||{}))})(ae,function(v){function S(E){var _=+this._x.call(null,E),h=+this._y.call(null,E);return M(this.cover(_,h),_,h,E)}function M(E,_,h,m){if(isNaN(_)||isNaN(h))return E;var w,F=E._root,z={data:m},U=E._x0,V=E._y0,G=E._x1,j=E._y1,O,H,W,ee,ue,xe,ge,_e;if(!F)return E._root=z,E;for(;F.length;)if((ue=_>=(O=(U+G)/2))?U=O:G=O,(xe=h>=(H=(V+j)/2))?V=H:j=H,w=F,!(F=F[ge=xe<<1|ue]))return w[ge]=z,E;if(W=+E._x.call(null,F.data),ee=+E._y.call(null,F.data),_===W&&h===ee)return z.next=F,w?w[ge]=z:E._root=z,E;do w=w?w[ge]=new Array(4):E._root=new Array(4),(ue=_>=(O=(U+G)/2))?U=O:G=O,(xe=h>=(H=(V+j)/2))?V=H:j=H;while((ge=xe<<1|ue)===(_e=(ee>=H)<<1|W>=O));return w[_e]=F,w[ge]=z,E}function L(E){var _,h,m=E.length,w,F,z=new Array(m),U=new Array(m),V=1/0,G=1/0,j=-1/0,O=-1/0;for(h=0;hj&&(j=w),FO&&(O=F));if(V>j||G>O)return this;for(this.cover(V,G).cover(j,O),h=0;hE||E>=w||m>_||_>=F;)switch(G=(_j||(U=ee.y0)>O||(V=ee.x1)=ge)<<1|E>=xe)&&(ee=H[H.length-1],H[H.length-1]=H[H.length-1-ue],H[H.length-1-ue]=ee)}else{var _e=E-+this._x.call(null,W.data),Y=_-+this._y.call(null,W.data),se=_e*_e+Y*Y;if(se=(H=(z+V)/2))?z=H:V=H,(ue=O>=(W=(U+G)/2))?U=W:G=W,_=h,!(h=h[xe=ue<<1|ee]))return this;if(!h.length)break;(_[xe+1&3]||_[xe+2&3]||_[xe+3&3])&&(m=_,ge=xe)}for(;h.data!==E;)if(w=h,!(h=h.next))return this;return(F=h.next)&&delete h.next,w?(F?w.next=F:delete w.next,this):_?(F?_[xe]=F:delete _[xe],(h=_[0]||_[1]||_[2]||_[3])&&h===(_[3]||_[2]||_[1]||_[0])&&!h.length&&(m?m[ge]=h:this._root=h),this):(this._root=F,this)}function o(E){for(var _=0,h=E.length;_=g.length)return f!=null&&T.sort(f),x!=null?x(T):T;for(var m=-1,w=T.length,F=g[E++],z,U,V=L(),G,j=_();++mg.length)return T;var _,h=C[E-1];return x!=null&&E>=g.length?_=T.entries():(_=[],T.each(function(m,w){_.push({key:w,values:I(m,E)})})),h!=null?_.sort(function(m,w){return h(m.key,w.key)}):_}return A={object:function(T){return k(T,0,r,a)},map:function(T){return k(T,0,l,i)},entries:function(T){return I(k(T,0,l,i),0)},key:function(T){return g.push(T),A},sortKeys:function(T){return C[g.length-1]=T,A},sortValues:function(T){return f=T,A},rollup:function(T){return x=T,A}}}function r(){return{}}function a(g,C,f){g[C]=f}function l(){return L()}function i(g,C,f){g.set(C,f)}function s(){}var o=L.prototype;s.prototype=c.prototype={constructor:s,has:o.has,add:function(g){return g+="",this[S+g]=g,this},remove:o.remove,clear:o.clear,values:o.keys,size:o.size,empty:o.empty,each:o.each};function c(g,C){var f=new s;if(g instanceof s)g.each(function(k){f.add(k)});else if(g){var x=-1,A=g.length;if(C==null)for(;++x=0&&(o=s.slice(c+1),s=s.slice(0,c)),s&&!i.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:o}})}L.prototype=M.prototype={constructor:L,on:function(l,i){var s=this._,o=t(l+"",s),c,p=-1,d=o.length;if(arguments.length<2){for(;++p0)for(var s=new Array(c),o=0,c,p;o=0&&E._call.call(null,_),E=E._next;--S}function f(){i=(l=o.now())+s,S=M=0;try{C()}finally{S=0,A(),i=0}}function x(){var E=o.now(),_=E-l;_>t&&(s-=_,l=E)}function A(){for(var E,_=r,h,m=1/0;_;)_._call?(m>_._time&&(m=_._time),E=_,_=_._next):(h=_._next,_._next=null,_=E?E._next=h:r=h);a=E,k(m)}function k(E){if(!S){M&&(M=clearTimeout(M));var _=E-i;_>24?(E<1/0&&(M=setTimeout(f,E-o.now()-s)),L&&(L=clearInterval(L))):(L||(l=o.now(),L=setInterval(x,t)),S=1,c(f))}}function I(E,_,h){var m=new y;return _=_==null?0:+_,m.restart(function(w){m.stop(),E(w+_)},_,h),m}function T(E,_,h){var m=new y,w=_;return _==null?(m.restart(E,_,h),m):(_=+_,h=h==null?p():+h,m.restart(function F(z){z+=w,m.restart(F,w+=_,h),E(z)},_,h),m)}v.interval=T,v.now=p,v.timeout=I,v.timer=g,v.timerFlush=C,Object.defineProperty(v,"__esModule",{value:!0})})}}),BK=Re({"node_modules/d3-force/dist/d3-force.js"(ae,K){(function(v,S){typeof ae=="object"&&typeof K<"u"?S(ae,NK(),JP(),OK(),FK()):S(v.d3=v.d3||{},v.d3,v.d3,v.d3,v.d3)})(ae,function(v,S,M,L,t){function r(E,_){var h;E==null&&(E=0),_==null&&(_=0);function m(){var w,F=h.length,z,U=0,V=0;for(w=0;wO.index){var de=H-ye.x-ye.vx,pe=W-ye.y-ye.vy,Te=de*de+pe*pe;TeH+Z||ceW+Z||neV.r&&(V.r=V[G].r)}function U(){if(_){var V,G=_.length,j;for(h=new Array(G),V=0;V1?(ue==null?U.remove(ee):U.set(ee,W(ue)),_):U.get(ee)},find:function(ee,ue,xe){var ge=0,_e=E.length,Y,se,ce,ne,ye;for(xe==null?xe=1/0:xe*=xe,ge=0;ge<_e;++ge)ne=E[ge],Y=ee-ne.x,se=ue-ne.y,ce=Y*Y+se*se,ce1?(G.on(ee,ue),_):G.on(ee)}}}function A(){var E,_,h,m=a(-30),w,F=1,z=1/0,U=.81;function V(H){var W,ee=E.length,ue=S.quadtree(E,y,g).visitAfter(j);for(h=H,W=0;W=z)return;(H.data!==_||H.next)&&(xe===0&&(xe=l(),Y+=xe*xe),ge===0&&(ge=l(),Y+=ge*ge),YL)if(!(Math.abs(f*y-g*C)>L)||!c)this._+="L"+(this._x1=l)+","+(this._y1=i);else{var A=s-p,k=o-d,I=y*y+g*g,T=A*A+k*k,E=Math.sqrt(I),_=Math.sqrt(x),h=c*Math.tan((S-Math.acos((I+x-T)/(2*E*_)))/2),m=h/_,w=h/E;Math.abs(m-1)>L&&(this._+="L"+(l+m*C)+","+(i+m*f)),this._+="A"+c+","+c+",0,0,"+ +(f*A>C*k)+","+(this._x1=l+w*y)+","+(this._y1=i+w*g)}},arc:function(l,i,s,o,c,p){l=+l,i=+i,s=+s,p=!!p;var d=s*Math.cos(o),y=s*Math.sin(o),g=l+d,C=i+y,f=1^p,x=p?o-c:c-o;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+g+","+C:(Math.abs(this._x1-g)>L||Math.abs(this._y1-C)>L)&&(this._+="L"+g+","+C),s&&(x<0&&(x=x%M+M),x>t?this._+="A"+s+","+s+",0,1,"+f+","+(l-d)+","+(i-y)+"A"+s+","+s+",0,1,"+f+","+(this._x1=g)+","+(this._y1=C):x>L&&(this._+="A"+s+","+s+",0,"+ +(x>=S)+","+f+","+(this._x1=l+s*Math.cos(c))+","+(this._y1=i+s*Math.sin(c))))},rect:function(l,i,s,o){this._+="M"+(this._x0=this._x1=+l)+","+(this._y0=this._y1=+i)+"h"+ +s+"v"+ +o+"h"+-s+"Z"},toString:function(){return this._}},v.path=a,Object.defineProperty(v,"__esModule",{value:!0})})}}),m7=Re({"node_modules/d3-shape/dist/d3-shape.js"(ae,K){(function(v,S){typeof ae=="object"&&typeof K<"u"?S(ae,UK()):(v=v||self,S(v.d3=v.d3||{},v.d3))})(ae,function(v,S){function M(Nt){return function(){return Nt}}var L=Math.abs,t=Math.atan2,r=Math.cos,a=Math.max,l=Math.min,i=Math.sin,s=Math.sqrt,o=1e-12,c=Math.PI,p=c/2,d=2*c;function y(Nt){return Nt>1?0:Nt<-1?c:Math.acos(Nt)}function g(Nt){return Nt>=1?p:Nt<=-1?-p:Math.asin(Nt)}function C(Nt){return Nt.innerRadius}function f(Nt){return Nt.outerRadius}function x(Nt){return Nt.startAngle}function A(Nt){return Nt.endAngle}function k(Nt){return Nt&&Nt.padAngle}function I(Nt,xr,Xr,Tn,Xn,ia,na,An){var Yn=Xr-Nt,qi=Tn-xr,Ga=na-Xn,to=An-ia,_o=to*Yn-Ga*qi;if(!(_o*_oLl*Ll+Kl*Kl&&(ll=Ls,Il=ps),{cx:ll,cy:Il,x01:-Ga,y01:-to,x11:ll*(Xn/ys-1),y11:Il*(Xn/ys-1)}}function E(){var Nt=C,xr=f,Xr=M(0),Tn=null,Xn=x,ia=A,na=k,An=null;function Yn(){var qi,Ga,to=+Nt.apply(this,arguments),_o=+xr.apply(this,arguments),Po=Xn.apply(this,arguments)-p,Ro=ia.apply(this,arguments)-p,Xo=L(Ro-Po),Oi=Ro>Po;if(An||(An=qi=S.path()),_oo))An.moveTo(0,0);else if(Xo>d-o)An.moveTo(_o*r(Po),_o*i(Po)),An.arc(0,0,_o,Po,Ro,!Oi),to>o&&(An.moveTo(to*r(Ro),to*i(Ro)),An.arc(0,0,to,Ro,Po,Oi));else{var bs=Po,cs=Ro,fl=Po,Is=Ro,ys=Xo,ss=Xo,hl=na.apply(this,arguments)/2,ll=hl>o&&(Tn?+Tn.apply(this,arguments):s(to*to+_o*_o)),Il=l(L(_o-to)/2,+Xr.apply(this,arguments)),Ls=Il,ps=Il,Uo,Rs;if(ll>o){var Ll=g(ll/to*i(hl)),Kl=g(ll/_o*i(hl));(ys-=Ll*2)>o?(Ll*=Oi?1:-1,fl+=Ll,Is-=Ll):(ys=0,fl=Is=(Po+Ro)/2),(ss-=Kl*2)>o?(Kl*=Oi?1:-1,bs+=Kl,cs-=Kl):(ss=0,bs=cs=(Po+Ro)/2)}var eu=_o*r(bs),Ws=_o*i(bs),Bi=to*r(Is),Mo=to*i(Is);if(Il>o){var Jl=_o*r(cs),Qs=_o*i(cs),as=to*r(fl),tu=to*i(fl),dl;if(Xoo?ps>o?(Uo=T(as,tu,eu,Ws,_o,ps,Oi),Rs=T(Jl,Qs,Bi,Mo,_o,ps,Oi),An.moveTo(Uo.cx+Uo.x01,Uo.cy+Uo.y01),pso)||!(ys>o)?An.lineTo(Bi,Mo):Ls>o?(Uo=T(Bi,Mo,Jl,Qs,to,-Ls,Oi),Rs=T(eu,Ws,as,tu,to,-Ls,Oi),An.lineTo(Uo.cx+Uo.x01,Uo.cy+Uo.y01),Ls=_o;--Po)An.point(cs[Po],fl[Po]);An.lineEnd(),An.areaEnd()}Oi&&(cs[to]=+Nt(Xo,to,Ga),fl[to]=+Xr(Xo,to,Ga),An.point(xr?+xr(Xo,to,Ga):cs[to],Tn?+Tn(Xo,to,Ga):fl[to]))}if(bs)return An=null,bs+""||null}function qi(){return F().defined(Xn).curve(na).context(ia)}return Yn.x=function(Ga){return arguments.length?(Nt=typeof Ga=="function"?Ga:M(+Ga),xr=null,Yn):Nt},Yn.x0=function(Ga){return arguments.length?(Nt=typeof Ga=="function"?Ga:M(+Ga),Yn):Nt},Yn.x1=function(Ga){return arguments.length?(xr=Ga==null?null:typeof Ga=="function"?Ga:M(+Ga),Yn):xr},Yn.y=function(Ga){return arguments.length?(Xr=typeof Ga=="function"?Ga:M(+Ga),Tn=null,Yn):Xr},Yn.y0=function(Ga){return arguments.length?(Xr=typeof Ga=="function"?Ga:M(+Ga),Yn):Xr},Yn.y1=function(Ga){return arguments.length?(Tn=Ga==null?null:typeof Ga=="function"?Ga:M(+Ga),Yn):Tn},Yn.lineX0=Yn.lineY0=function(){return qi().x(Nt).y(Xr)},Yn.lineY1=function(){return qi().x(Nt).y(Tn)},Yn.lineX1=function(){return qi().x(xr).y(Xr)},Yn.defined=function(Ga){return arguments.length?(Xn=typeof Ga=="function"?Ga:M(!!Ga),Yn):Xn},Yn.curve=function(Ga){return arguments.length?(na=Ga,ia!=null&&(An=na(ia)),Yn):na},Yn.context=function(Ga){return arguments.length?(Ga==null?ia=An=null:An=na(ia=Ga),Yn):ia},Yn}function U(Nt,xr){return xrNt?1:xr>=Nt?0:NaN}function V(Nt){return Nt}function G(){var Nt=V,xr=U,Xr=null,Tn=M(0),Xn=M(d),ia=M(0);function na(An){var Yn,qi=An.length,Ga,to,_o=0,Po=new Array(qi),Ro=new Array(qi),Xo=+Tn.apply(this,arguments),Oi=Math.min(d,Math.max(-d,Xn.apply(this,arguments)-Xo)),bs,cs=Math.min(Math.abs(Oi)/qi,ia.apply(this,arguments)),fl=cs*(Oi<0?-1:1),Is;for(Yn=0;Yn0&&(_o+=Is);for(xr!=null?Po.sort(function(ys,ss){return xr(Ro[ys],Ro[ss])}):Xr!=null&&Po.sort(function(ys,ss){return Xr(An[ys],An[ss])}),Yn=0,to=_o?(Oi-qi*fl)/_o:0;Yn0?Is*to:0)+fl,Ro[Ga]={data:An[Ga],index:Yn,value:Is,startAngle:Xo,endAngle:bs,padAngle:cs};return Ro}return na.value=function(An){return arguments.length?(Nt=typeof An=="function"?An:M(+An),na):Nt},na.sortValues=function(An){return arguments.length?(xr=An,Xr=null,na):xr},na.sort=function(An){return arguments.length?(Xr=An,xr=null,na):Xr},na.startAngle=function(An){return arguments.length?(Tn=typeof An=="function"?An:M(+An),na):Tn},na.endAngle=function(An){return arguments.length?(Xn=typeof An=="function"?An:M(+An),na):Xn},na.padAngle=function(An){return arguments.length?(ia=typeof An=="function"?An:M(+An),na):ia},na}var j=H(h);function O(Nt){this._curve=Nt}O.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(Nt,xr){this._curve.point(xr*Math.sin(Nt),xr*-Math.cos(Nt))}};function H(Nt){function xr(Xr){return new O(Nt(Xr))}return xr._curve=Nt,xr}function W(Nt){var xr=Nt.curve;return Nt.angle=Nt.x,delete Nt.x,Nt.radius=Nt.y,delete Nt.y,Nt.curve=function(Xr){return arguments.length?xr(H(Xr)):xr()._curve},Nt}function ee(){return W(F().curve(j))}function ue(){var Nt=z().curve(j),xr=Nt.curve,Xr=Nt.lineX0,Tn=Nt.lineX1,Xn=Nt.lineY0,ia=Nt.lineY1;return Nt.angle=Nt.x,delete Nt.x,Nt.startAngle=Nt.x0,delete Nt.x0,Nt.endAngle=Nt.x1,delete Nt.x1,Nt.radius=Nt.y,delete Nt.y,Nt.innerRadius=Nt.y0,delete Nt.y0,Nt.outerRadius=Nt.y1,delete Nt.y1,Nt.lineStartAngle=function(){return W(Xr())},delete Nt.lineX0,Nt.lineEndAngle=function(){return W(Tn())},delete Nt.lineX1,Nt.lineInnerRadius=function(){return W(Xn())},delete Nt.lineY0,Nt.lineOuterRadius=function(){return W(ia())},delete Nt.lineY1,Nt.curve=function(na){return arguments.length?xr(H(na)):xr()._curve},Nt}function xe(Nt,xr){return[(xr=+xr)*Math.cos(Nt-=Math.PI/2),xr*Math.sin(Nt)]}var ge=Array.prototype.slice;function _e(Nt){return Nt.source}function Y(Nt){return Nt.target}function se(Nt){var xr=_e,Xr=Y,Tn=m,Xn=w,ia=null;function na(){var An,Yn=ge.call(arguments),qi=xr.apply(this,Yn),Ga=Xr.apply(this,Yn);if(ia||(ia=An=S.path()),Nt(ia,+Tn.apply(this,(Yn[0]=qi,Yn)),+Xn.apply(this,Yn),+Tn.apply(this,(Yn[0]=Ga,Yn)),+Xn.apply(this,Yn)),An)return ia=null,An+""||null}return na.source=function(An){return arguments.length?(xr=An,na):xr},na.target=function(An){return arguments.length?(Xr=An,na):Xr},na.x=function(An){return arguments.length?(Tn=typeof An=="function"?An:M(+An),na):Tn},na.y=function(An){return arguments.length?(Xn=typeof An=="function"?An:M(+An),na):Xn},na.context=function(An){return arguments.length?(ia=An??null,na):ia},na}function ce(Nt,xr,Xr,Tn,Xn){Nt.moveTo(xr,Xr),Nt.bezierCurveTo(xr=(xr+Tn)/2,Xr,xr,Xn,Tn,Xn)}function ne(Nt,xr,Xr,Tn,Xn){Nt.moveTo(xr,Xr),Nt.bezierCurveTo(xr,Xr=(Xr+Xn)/2,Tn,Xr,Tn,Xn)}function ye(Nt,xr,Xr,Tn,Xn){var ia=xe(xr,Xr),na=xe(xr,Xr=(Xr+Xn)/2),An=xe(Tn,Xr),Yn=xe(Tn,Xn);Nt.moveTo(ia[0],ia[1]),Nt.bezierCurveTo(na[0],na[1],An[0],An[1],Yn[0],Yn[1])}function le(){return se(ce)}function Z(){return se(ne)}function de(){var Nt=se(ye);return Nt.angle=Nt.x,delete Nt.x,Nt.radius=Nt.y,delete Nt.y,Nt}var pe={draw:function(Nt,xr){var Xr=Math.sqrt(xr/c);Nt.moveTo(Xr,0),Nt.arc(0,0,Xr,0,d)}},Te={draw:function(Nt,xr){var Xr=Math.sqrt(xr/5)/2;Nt.moveTo(-3*Xr,-Xr),Nt.lineTo(-Xr,-Xr),Nt.lineTo(-Xr,-3*Xr),Nt.lineTo(Xr,-3*Xr),Nt.lineTo(Xr,-Xr),Nt.lineTo(3*Xr,-Xr),Nt.lineTo(3*Xr,Xr),Nt.lineTo(Xr,Xr),Nt.lineTo(Xr,3*Xr),Nt.lineTo(-Xr,3*Xr),Nt.lineTo(-Xr,Xr),Nt.lineTo(-3*Xr,Xr),Nt.closePath()}},Ne=Math.sqrt(1/3),$e=Ne*2,Ze={draw:function(Nt,xr){var Xr=Math.sqrt(xr/$e),Tn=Xr*Ne;Nt.moveTo(0,-Xr),Nt.lineTo(Tn,0),Nt.lineTo(0,Xr),Nt.lineTo(-Tn,0),Nt.closePath()}},Xe=.8908130915292852,it=Math.sin(c/10)/Math.sin(7*c/10),yt=Math.sin(d/10)*it,bt=-Math.cos(d/10)*it,mt={draw:function(Nt,xr){var Xr=Math.sqrt(xr*Xe),Tn=yt*Xr,Xn=bt*Xr;Nt.moveTo(0,-Xr),Nt.lineTo(Tn,Xn);for(var ia=1;ia<5;++ia){var na=d*ia/5,An=Math.cos(na),Yn=Math.sin(na);Nt.lineTo(Yn*Xr,-An*Xr),Nt.lineTo(An*Tn-Yn*Xn,Yn*Tn+An*Xn)}Nt.closePath()}},ht={draw:function(Nt,xr){var Xr=Math.sqrt(xr),Tn=-Xr/2;Nt.rect(Tn,Tn,Xr,Xr)}},Ve=Math.sqrt(3),ze={draw:function(Nt,xr){var Xr=-Math.sqrt(xr/(Ve*3));Nt.moveTo(0,Xr*2),Nt.lineTo(-Ve*Xr,-Xr),Nt.lineTo(Ve*Xr,-Xr),Nt.closePath()}},Se=-.5,Je=Math.sqrt(3)/2,_t=1/Math.sqrt(12),At=(_t/2+1)*3,vt={draw:function(Nt,xr){var Xr=Math.sqrt(xr/At),Tn=Xr/2,Xn=Xr*_t,ia=Tn,na=Xr*_t+Xr,An=-ia,Yn=na;Nt.moveTo(Tn,Xn),Nt.lineTo(ia,na),Nt.lineTo(An,Yn),Nt.lineTo(Se*Tn-Je*Xn,Je*Tn+Se*Xn),Nt.lineTo(Se*ia-Je*na,Je*ia+Se*na),Nt.lineTo(Se*An-Je*Yn,Je*An+Se*Yn),Nt.lineTo(Se*Tn+Je*Xn,Se*Xn-Je*Tn),Nt.lineTo(Se*ia+Je*na,Se*na-Je*ia),Nt.lineTo(Se*An+Je*Yn,Se*Yn-Je*An),Nt.closePath()}},Kt=[pe,Te,Ze,ht,mt,ze,vt];function Qt(){var Nt=M(pe),xr=M(64),Xr=null;function Tn(){var Xn;if(Xr||(Xr=Xn=S.path()),Nt.apply(this,arguments).draw(Xr,+xr.apply(this,arguments)),Xn)return Xr=null,Xn+""||null}return Tn.type=function(Xn){return arguments.length?(Nt=typeof Xn=="function"?Xn:M(Xn),Tn):Nt},Tn.size=function(Xn){return arguments.length?(xr=typeof Xn=="function"?Xn:M(+Xn),Tn):xr},Tn.context=function(Xn){return arguments.length?(Xr=Xn??null,Tn):Xr},Tn}function fr(){}function mr(Nt,xr,Xr){Nt._context.bezierCurveTo((2*Nt._x0+Nt._x1)/3,(2*Nt._y0+Nt._y1)/3,(Nt._x0+2*Nt._x1)/3,(Nt._y0+2*Nt._y1)/3,(Nt._x0+4*Nt._x1+xr)/6,(Nt._y0+4*Nt._y1+Xr)/6)}function Ur(Nt){this._context=Nt}Ur.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:mr(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Nt,xr){switch(Nt=+Nt,xr=+xr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Nt,xr):this._context.moveTo(Nt,xr);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:mr(this,Nt,xr);break}this._x0=this._x1,this._x1=Nt,this._y0=this._y1,this._y1=xr}};function Br(Nt){return new Ur(Nt)}function fn(Nt){this._context=Nt}fn.prototype={areaStart:fr,areaEnd:fr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(Nt,xr){switch(Nt=+Nt,xr=+xr,this._point){case 0:this._point=1,this._x2=Nt,this._y2=xr;break;case 1:this._point=2,this._x3=Nt,this._y3=xr;break;case 2:this._point=3,this._x4=Nt,this._y4=xr,this._context.moveTo((this._x0+4*this._x1+Nt)/6,(this._y0+4*this._y1+xr)/6);break;default:mr(this,Nt,xr);break}this._x0=this._x1,this._x1=Nt,this._y0=this._y1,this._y1=xr}};function Fr(Nt){return new fn(Nt)}function Qr(Nt){this._context=Nt}Qr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(Nt,xr){switch(Nt=+Nt,xr=+xr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var Xr=(this._x0+4*this._x1+Nt)/6,Tn=(this._y0+4*this._y1+xr)/6;this._line?this._context.lineTo(Xr,Tn):this._context.moveTo(Xr,Tn);break;case 3:this._point=4;default:mr(this,Nt,xr);break}this._x0=this._x1,this._x1=Nt,this._y0=this._y1,this._y1=xr}};function Bt(Nt){return new Qr(Nt)}function et(Nt,xr){this._basis=new Ur(Nt),this._beta=xr}et.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var Nt=this._x,xr=this._y,Xr=Nt.length-1;if(Xr>0)for(var Tn=Nt[0],Xn=xr[0],ia=Nt[Xr]-Tn,na=xr[Xr]-Xn,An=-1,Yn;++An<=Xr;)Yn=An/Xr,this._basis.point(this._beta*Nt[An]+(1-this._beta)*(Tn+Yn*ia),this._beta*xr[An]+(1-this._beta)*(Xn+Yn*na));this._x=this._y=null,this._basis.lineEnd()},point:function(Nt,xr){this._x.push(+Nt),this._y.push(+xr)}};var ut=(function Nt(xr){function Xr(Tn){return xr===1?new Ur(Tn):new et(Tn,xr)}return Xr.beta=function(Tn){return Nt(+Tn)},Xr})(.85);function Be(Nt,xr,Xr){Nt._context.bezierCurveTo(Nt._x1+Nt._k*(Nt._x2-Nt._x0),Nt._y1+Nt._k*(Nt._y2-Nt._y0),Nt._x2+Nt._k*(Nt._x1-xr),Nt._y2+Nt._k*(Nt._y1-Xr),Nt._x2,Nt._y2)}function Ie(Nt,xr){this._context=Nt,this._k=(1-xr)/6}Ie.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Be(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Nt,xr){switch(Nt=+Nt,xr=+xr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Nt,xr):this._context.moveTo(Nt,xr);break;case 1:this._point=2,this._x1=Nt,this._y1=xr;break;case 2:this._point=3;default:Be(this,Nt,xr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Nt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var ke=(function Nt(xr){function Xr(Tn){return new Ie(Tn,xr)}return Xr.tension=function(Tn){return Nt(+Tn)},Xr})(0);function Fe(Nt,xr){this._context=Nt,this._k=(1-xr)/6}Fe.prototype={areaStart:fr,areaEnd:fr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(Nt,xr){switch(Nt=+Nt,xr=+xr,this._point){case 0:this._point=1,this._x3=Nt,this._y3=xr;break;case 1:this._point=2,this._context.moveTo(this._x4=Nt,this._y4=xr);break;case 2:this._point=3,this._x5=Nt,this._y5=xr;break;default:Be(this,Nt,xr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Nt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var at=(function Nt(xr){function Xr(Tn){return new Fe(Tn,xr)}return Xr.tension=function(Tn){return Nt(+Tn)},Xr})(0);function ct(Nt,xr){this._context=Nt,this._k=(1-xr)/6}ct.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(Nt,xr){switch(Nt=+Nt,xr=+xr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Be(this,Nt,xr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Nt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var Gt=(function Nt(xr){function Xr(Tn){return new ct(Tn,xr)}return Xr.tension=function(Tn){return Nt(+Tn)},Xr})(0);function Vt(Nt,xr,Xr){var Tn=Nt._x1,Xn=Nt._y1,ia=Nt._x2,na=Nt._y2;if(Nt._l01_a>o){var An=2*Nt._l01_2a+3*Nt._l01_a*Nt._l12_a+Nt._l12_2a,Yn=3*Nt._l01_a*(Nt._l01_a+Nt._l12_a);Tn=(Tn*An-Nt._x0*Nt._l12_2a+Nt._x2*Nt._l01_2a)/Yn,Xn=(Xn*An-Nt._y0*Nt._l12_2a+Nt._y2*Nt._l01_2a)/Yn}if(Nt._l23_a>o){var qi=2*Nt._l23_2a+3*Nt._l23_a*Nt._l12_a+Nt._l12_2a,Ga=3*Nt._l23_a*(Nt._l23_a+Nt._l12_a);ia=(ia*qi+Nt._x1*Nt._l23_2a-xr*Nt._l12_2a)/Ga,na=(na*qi+Nt._y1*Nt._l23_2a-Xr*Nt._l12_2a)/Ga}Nt._context.bezierCurveTo(Tn,Xn,ia,na,Nt._x2,Nt._y2)}function Zt(Nt,xr){this._context=Nt,this._alpha=xr}Zt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Nt,xr){if(Nt=+Nt,xr=+xr,this._point){var Xr=this._x2-Nt,Tn=this._y2-xr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Xr*Xr+Tn*Tn,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(Nt,xr):this._context.moveTo(Nt,xr);break;case 1:this._point=2;break;case 2:this._point=3;default:Vt(this,Nt,xr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=Nt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var ur=(function Nt(xr){function Xr(Tn){return xr?new Zt(Tn,xr):new Ie(Tn,0)}return Xr.alpha=function(Tn){return Nt(+Tn)},Xr})(.5);function Dr(Nt,xr){this._context=Nt,this._alpha=xr}Dr.prototype={areaStart:fr,areaEnd:fr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(Nt,xr){if(Nt=+Nt,xr=+xr,this._point){var Xr=this._x2-Nt,Tn=this._y2-xr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Xr*Xr+Tn*Tn,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=Nt,this._y3=xr;break;case 1:this._point=2,this._context.moveTo(this._x4=Nt,this._y4=xr);break;case 2:this._point=3,this._x5=Nt,this._y5=xr;break;default:Vt(this,Nt,xr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=Nt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var kr=(function Nt(xr){function Xr(Tn){return xr?new Dr(Tn,xr):new Fe(Tn,0)}return Xr.alpha=function(Tn){return Nt(+Tn)},Xr})(.5);function Sr(Nt,xr){this._context=Nt,this._alpha=xr}Sr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(Nt,xr){if(Nt=+Nt,xr=+xr,this._point){var Xr=this._x2-Nt,Tn=this._y2-xr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Xr*Xr+Tn*Tn,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Vt(this,Nt,xr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=Nt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var Jr=(function Nt(xr){function Xr(Tn){return xr?new Sr(Tn,xr):new ct(Tn,0)}return Xr.alpha=function(Tn){return Nt(+Tn)},Xr})(.5);function jn(Nt){this._context=Nt}jn.prototype={areaStart:fr,areaEnd:fr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(Nt,xr){Nt=+Nt,xr=+xr,this._point?this._context.lineTo(Nt,xr):(this._point=1,this._context.moveTo(Nt,xr))}};function ha(Nt){return new jn(Nt)}function oa(Nt){return Nt<0?-1:1}function _a(Nt,xr,Xr){var Tn=Nt._x1-Nt._x0,Xn=xr-Nt._x1,ia=(Nt._y1-Nt._y0)/(Tn||Xn<0&&-0),na=(Xr-Nt._y1)/(Xn||Tn<0&&-0),An=(ia*Xn+na*Tn)/(Tn+Xn);return(oa(ia)+oa(na))*Math.min(Math.abs(ia),Math.abs(na),.5*Math.abs(An))||0}function xa(Nt,xr){var Xr=Nt._x1-Nt._x0;return Xr?(3*(Nt._y1-Nt._y0)/Xr-xr)/2:xr}function ra(Nt,xr,Xr){var Tn=Nt._x0,Xn=Nt._y0,ia=Nt._x1,na=Nt._y1,An=(ia-Tn)/3;Nt._context.bezierCurveTo(Tn+An,Xn+An*xr,ia-An,na-An*Xr,ia,na)}function Ha(Nt){this._context=Nt}Ha.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ra(this,this._t0,xa(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Nt,xr){var Xr=NaN;if(Nt=+Nt,xr=+xr,!(Nt===this._x1&&xr===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(Nt,xr):this._context.moveTo(Nt,xr);break;case 1:this._point=2;break;case 2:this._point=3,ra(this,xa(this,Xr=_a(this,Nt,xr)),Xr);break;default:ra(this,this._t0,Xr=_a(this,Nt,xr));break}this._x0=this._x1,this._x1=Nt,this._y0=this._y1,this._y1=xr,this._t0=Xr}}};function ci(Nt){this._context=new _r(Nt)}(ci.prototype=Object.create(Ha.prototype)).point=function(Nt,xr){Ha.prototype.point.call(this,xr,Nt)};function _r(Nt){this._context=Nt}_r.prototype={moveTo:function(Nt,xr){this._context.moveTo(xr,Nt)},closePath:function(){this._context.closePath()},lineTo:function(Nt,xr){this._context.lineTo(xr,Nt)},bezierCurveTo:function(Nt,xr,Xr,Tn,Xn,ia){this._context.bezierCurveTo(xr,Nt,Tn,Xr,ia,Xn)}};function rr(Nt){return new Ha(Nt)}function yr(Nt){return new ci(Nt)}function br(Nt){this._context=Nt}br.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var Nt=this._x,xr=this._y,Xr=Nt.length;if(Xr)if(this._line?this._context.lineTo(Nt[0],xr[0]):this._context.moveTo(Nt[0],xr[0]),Xr===2)this._context.lineTo(Nt[1],xr[1]);else for(var Tn=an(Nt),Xn=an(xr),ia=0,na=1;na=0;--xr)Xn[xr]=(na[xr]-Xn[xr+1])/ia[xr];for(ia[Xr-1]=(Nt[Xr]+Xn[Xr-1])/2,xr=0;xr=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(Nt,xr){switch(Nt=+Nt,xr=+xr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Nt,xr):this._context.moveTo(Nt,xr);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,xr),this._context.lineTo(Nt,xr);else{var Xr=this._x*(1-this._t)+Nt*this._t;this._context.lineTo(Xr,this._y),this._context.lineTo(Xr,xr)}break}}this._x=Nt,this._y=xr}};function Fn(Nt){return new In(Nt,.5)}function va(Nt){return new In(Nt,0)}function Pa(Nt){return new In(Nt,1)}function La(Nt,xr){if((na=Nt.length)>1)for(var Xr=1,Tn,Xn,ia=Nt[xr[0]],na,An=ia.length;Xr=0;)Xr[xr]=xr;return Xr}function Wa(Nt,xr){return Nt[xr]}function sa(){var Nt=M([]),xr=Oa,Xr=La,Tn=Wa;function Xn(ia){var na=Nt.apply(this,arguments),An,Yn=ia.length,qi=na.length,Ga=new Array(qi),to;for(An=0;An0){for(var Xr,Tn,Xn=0,ia=Nt[0].length,na;Xn0)for(var Xr,Tn=0,Xn,ia,na,An,Yn,qi=Nt[xr[0]].length;Tn0?(Xn[0]=na,Xn[1]=na+=ia):ia<0?(Xn[1]=An,Xn[0]=An+=ia):(Xn[0]=0,Xn[1]=ia)}function Xt(Nt,xr){if((Xn=Nt.length)>0){for(var Xr=0,Tn=Nt[xr[0]],Xn,ia=Tn.length;Xr0)||!((ia=(Xn=Nt[xr[0]]).length)>0))){for(var Xr=0,Tn=1,Xn,ia,na;Tnia&&(ia=Xn,Xr=xr);return Xr}function rn(Nt){var xr=Nt.map(Wr);return Oa(Nt).sort(function(Xr,Tn){return xr[Xr]-xr[Tn]})}function Wr(Nt){for(var xr=0,Xr=-1,Tn=Nt.length,Xn;++Xr0;--ye)de(ne*=.99),pe(),Z(ne),pe();function le(){var Te=S.max(ce,function(Ze){return Ze.length}),Ne=W*(F-m)/(Te-1);U>Ne&&(U=Ne);var $e=S.min(ce,function(Ze){return(F-m-(Ze.length-1)*U)/S.sum(Ze,d)});ce.forEach(function(Ze){Ze.forEach(function(Xe,it){Xe.y1=(Xe.y0=it)+Xe.value*$e})}),se.links.forEach(function(Ze){Ze.width=Ze.value*$e})}function Z(Te){ce.forEach(function(Ne){Ne.forEach(function($e){if($e.targetLinks.length){var Ze=(S.sum($e.targetLinks,g)/S.sum($e.targetLinks,d)-y($e))*Te;$e.y0+=Ze,$e.y1+=Ze}})})}function de(Te){ce.slice().reverse().forEach(function(Ne){Ne.forEach(function($e){if($e.sourceLinks.length){var Ze=(S.sum($e.sourceLinks,C)/S.sum($e.sourceLinks,d)-y($e))*Te;$e.y0+=Ze,$e.y1+=Ze}})})}function pe(){ce.forEach(function(Te){var Ne,$e,Ze=m,Xe=Te.length,it;for(Te.sort(p),it=0;it0&&(Ne.y0+=$e,Ne.y1+=$e),Ze=Ne.y1+U;if($e=Ze-U-F,$e>0)for(Ze=Ne.y0-=$e,Ne.y1-=$e,it=Xe-2;it>=0;--it)Ne=Te[it],$e=Ne.y1+U-Ze,$e>0&&(Ne.y0-=$e,Ne.y1-=$e),Ze=Ne.y0})}}function Y(se){se.nodes.forEach(function(ce){ce.sourceLinks.sort(c),ce.targetLinks.sort(o)}),se.nodes.forEach(function(ce){var ne=ce.y0,ye=ne;ce.sourceLinks.forEach(function(le){le.y0=ne+le.width/2,ne+=le.width}),ce.targetLinks.forEach(function(le){le.y1=ye+le.width/2,ye+=le.width})})}return ee};function T(h){return[h.source.x1,h.y0]}function E(h){return[h.target.x0,h.y1]}var _=function(){return L.linkHorizontal().source(T).target(E)};v.sankey=I,v.sankeyCenter=i,v.sankeyLeft=r,v.sankeyRight=a,v.sankeyJustify=l,v.sankeyLinkHorizontal=_,Object.defineProperty(v,"__esModule",{value:!0})})}}),VK=Re({"node_modules/elementary-circuits-directed-graph/johnson.js"(ae,K){var v=v7();K.exports=function(M,L){var t=[],r=[],a=[],l={},i=[],s;function o(k){a[k]=!1,l.hasOwnProperty(k)&&Object.keys(l[k]).forEach(function(I){delete l[k][I],a[I]&&o(I)})}function c(k){var I=!1;r.push(k),a[k]=!0;var T,E;for(T=0;T=k})}function y(k){d(k);for(var I=M,T=v(I),E=T.components.filter(function(U){return U.length>1}),_=1/0,h,m=0;m"u"?"undefined":c(Ie))!=="object"&&(Ie=ut.source=T(et,Ie)),(typeof ke>"u"?"undefined":c(ke))!=="object"&&(ke=ut.target=T(et,ke)),Ie.sourceLinks.push(ut),ke.targetLinks.push(ut)}),Bt}function mr(Bt){Bt.nodes.forEach(function(et){et.partOfCycle=!1,et.value=Math.max(S.sum(et.sourceLinks,g),S.sum(et.targetLinks,g)),et.sourceLinks.forEach(function(ut){ut.circular&&(et.partOfCycle=!0,et.circularLinkType=ut.circularLinkType)}),et.targetLinks.forEach(function(ut){ut.circular&&(et.partOfCycle=!0,et.circularLinkType=ut.circularLinkType)})})}function Ur(Bt){var et=0,ut=0,Be=0,Ie=0,ke=S.max(Bt.nodes,function(Fe){return Fe.column});return Bt.links.forEach(function(Fe){Fe.circular&&(Fe.circularLinkType=="top"?et=et+Fe.width:ut=ut+Fe.width,Fe.target.column==0&&(Ie=Ie+Fe.width),Fe.source.column==ke&&(Be=Be+Fe.width))}),et=et>0?et+_+h:et,ut=ut>0?ut+_+h:ut,Be=Be>0?Be+_+h:Be,Ie=Ie>0?Ie+_+h:Ie,{top:et,bottom:ut,left:Ie,right:Be}}function Br(Bt,et){var ut=S.max(Bt.nodes,function(Gt){return Gt.column}),Be=yt-Xe,Ie=bt-it,ke=Be+et.right+et.left,Fe=Ie+et.top+et.bottom,at=Be/ke,ct=Ie/Fe;return Xe=Xe*at+et.left,yt=et.right==0?yt:yt*at,it=it*ct+et.top,bt=bt*ct,Bt.nodes.forEach(function(Gt){Gt.x0=Xe+Gt.column*((yt-Xe-mt)/ut),Gt.x1=Gt.x0+mt}),ct}function fn(Bt){var et,ut,Be;for(et=Bt.nodes,ut=[],Be=0;et.length;++Be,et=ut,ut=[])et.forEach(function(Ie){Ie.depth=Be,Ie.sourceLinks.forEach(function(ke){ut.indexOf(ke.target)<0&&!ke.circular&&ut.push(ke.target)})});for(et=Bt.nodes,ut=[],Be=0;et.length;++Be,et=ut,ut=[])et.forEach(function(Ie){Ie.height=Be,Ie.targetLinks.forEach(function(ke){ut.indexOf(ke.source)<0&&!ke.circular&&ut.push(ke.source)})});Bt.nodes.forEach(function(Ie){Ie.column=Math.floor(ze.call(null,Ie,Be))})}function Fr(Bt,et,ut){var Be=M.nest().key(function(Gt){return Gt.column}).sortKeys(S.ascending).entries(Bt.nodes).map(function(Gt){return Gt.values});Fe(ut),ct();for(var Ie=1,ke=et;ke>0;--ke)at(Ie*=.99,ut),ct();function Fe(Gt){if(vt){var Vt=1/0;Be.forEach(function(kr){var Sr=bt*vt/(kr.length+1);Vt=Sr0))if(kr==0&&Dr==1)Jr=Sr.y1-Sr.y0,Sr.y0=bt/2-Jr/2,Sr.y1=bt/2+Jr/2;else if(kr==Zt-1&&Dr==1)Jr=Sr.y1-Sr.y0,Sr.y0=bt/2-Jr/2,Sr.y1=bt/2+Jr/2;else{var jn=0,ha=S.mean(Sr.sourceLinks,x),oa=S.mean(Sr.targetLinks,f);ha&&oa?jn=(ha+oa)/2:jn=ha||oa;var _a=(jn-C(Sr))*Gt;Sr.y0+=_a,Sr.y1+=_a}})})}function ct(){Be.forEach(function(Gt){var Vt,Zt,ur=it,Dr=Gt.length,kr;for(Gt.sort(y),kr=0;kr0&&(Vt.y0+=Zt,Vt.y1+=Zt),ur=Vt.y1+ht;if(Zt=ur-ht-bt,Zt>0)for(ur=Vt.y0-=Zt,Vt.y1-=Zt,kr=Dr-2;kr>=0;--kr)Vt=Gt[kr],Zt=Vt.y1+ht-ur,Zt>0&&(Vt.y0-=Zt,Vt.y1-=Zt),ur=Vt.y0})}}function Qr(Bt){Bt.nodes.forEach(function(et){et.sourceLinks.sort(d),et.targetLinks.sort(p)}),Bt.nodes.forEach(function(et){var ut=et.y0,Be=ut,Ie=et.y1,ke=Ie;et.sourceLinks.forEach(function(Fe){Fe.circular?(Fe.y0=Ie-Fe.width/2,Ie=Ie-Fe.width):(Fe.y0=ut+Fe.width/2,ut+=Fe.width)}),et.targetLinks.forEach(function(Fe){Fe.circular?(Fe.y1=ke-Fe.width/2,ke=ke-Fe.width):(Fe.y1=Be+Fe.width/2,Be+=Fe.width)})})}return Qt}function F(Xe,it,yt){var bt=0;if(yt===null){for(var mt=[],ht=0;htit.source.column)}function G(Xe,it){var yt=0;Xe.sourceLinks.forEach(function(mt){yt=mt.circular&&!$e(mt,it)?yt+1:yt});var bt=0;return Xe.targetLinks.forEach(function(mt){bt=mt.circular&&!$e(mt,it)?bt+1:bt}),yt+bt}function j(Xe){var it=Xe.source.sourceLinks,yt=0;it.forEach(function(ht){yt=ht.circular?yt+1:yt});var bt=Xe.target.targetLinks,mt=0;return bt.forEach(function(ht){mt=ht.circular?mt+1:mt}),!(yt>1||mt>1)}function O(Xe,it,yt){return Xe.sort(ee),Xe.forEach(function(bt,mt){var ht=0;if($e(bt,yt)&&j(bt))bt.circularPathData.verticalBuffer=ht+bt.width/2;else{var Ve=0;for(Ve;Veht?ze:ht}bt.circularPathData.verticalBuffer=ht+bt.width/2}}),Xe}function H(Xe,it,yt,bt){var mt=5,ht=S.min(Xe.links,function(Se){return Se.source.y0});Xe.links.forEach(function(Se){Se.circular&&(Se.circularPathData={})});var Ve=Xe.links.filter(function(Se){return Se.circularLinkType=="top"});O(Ve,it,bt);var ze=Xe.links.filter(function(Se){return Se.circularLinkType=="bottom"});O(ze,it,bt),Xe.links.forEach(function(Se){if(Se.circular){if(Se.circularPathData.arcRadius=Se.width+h,Se.circularPathData.leftNodeBuffer=mt,Se.circularPathData.rightNodeBuffer=mt,Se.circularPathData.sourceWidth=Se.source.x1-Se.source.x0,Se.circularPathData.sourceX=Se.source.x0+Se.circularPathData.sourceWidth,Se.circularPathData.targetX=Se.target.x0,Se.circularPathData.sourceY=Se.y0,Se.circularPathData.targetY=Se.y1,$e(Se,bt)&&j(Se))Se.circularPathData.leftSmallArcRadius=h+Se.width/2,Se.circularPathData.leftLargeArcRadius=h+Se.width/2,Se.circularPathData.rightSmallArcRadius=h+Se.width/2,Se.circularPathData.rightLargeArcRadius=h+Se.width/2,Se.circularLinkType=="bottom"?(Se.circularPathData.verticalFullExtent=Se.source.y1+_+Se.circularPathData.verticalBuffer,Se.circularPathData.verticalLeftInnerExtent=Se.circularPathData.verticalFullExtent-Se.circularPathData.leftLargeArcRadius,Se.circularPathData.verticalRightInnerExtent=Se.circularPathData.verticalFullExtent-Se.circularPathData.rightLargeArcRadius):(Se.circularPathData.verticalFullExtent=Se.source.y0-_-Se.circularPathData.verticalBuffer,Se.circularPathData.verticalLeftInnerExtent=Se.circularPathData.verticalFullExtent+Se.circularPathData.leftLargeArcRadius,Se.circularPathData.verticalRightInnerExtent=Se.circularPathData.verticalFullExtent+Se.circularPathData.rightLargeArcRadius);else{var Je=Se.source.column,_t=Se.circularLinkType,At=Xe.links.filter(function(Qt){return Qt.source.column==Je&&Qt.circularLinkType==_t});Se.circularLinkType=="bottom"?At.sort(xe):At.sort(ue);var vt=0;At.forEach(function(Qt,fr){Qt.circularLinkID==Se.circularLinkID&&(Se.circularPathData.leftSmallArcRadius=h+Se.width/2+vt,Se.circularPathData.leftLargeArcRadius=h+Se.width/2+fr*it+vt),vt=vt+Qt.width}),Je=Se.target.column,At=Xe.links.filter(function(Qt){return Qt.target.column==Je&&Qt.circularLinkType==_t}),Se.circularLinkType=="bottom"?At.sort(_e):At.sort(ge),vt=0,At.forEach(function(Qt,fr){Qt.circularLinkID==Se.circularLinkID&&(Se.circularPathData.rightSmallArcRadius=h+Se.width/2+vt,Se.circularPathData.rightLargeArcRadius=h+Se.width/2+fr*it+vt),vt=vt+Qt.width}),Se.circularLinkType=="bottom"?(Se.circularPathData.verticalFullExtent=Math.max(yt,Se.source.y1,Se.target.y1)+_+Se.circularPathData.verticalBuffer,Se.circularPathData.verticalLeftInnerExtent=Se.circularPathData.verticalFullExtent-Se.circularPathData.leftLargeArcRadius,Se.circularPathData.verticalRightInnerExtent=Se.circularPathData.verticalFullExtent-Se.circularPathData.rightLargeArcRadius):(Se.circularPathData.verticalFullExtent=ht-_-Se.circularPathData.verticalBuffer,Se.circularPathData.verticalLeftInnerExtent=Se.circularPathData.verticalFullExtent+Se.circularPathData.leftLargeArcRadius,Se.circularPathData.verticalRightInnerExtent=Se.circularPathData.verticalFullExtent+Se.circularPathData.rightLargeArcRadius)}Se.circularPathData.leftInnerExtent=Se.circularPathData.sourceX+Se.circularPathData.leftNodeBuffer,Se.circularPathData.rightInnerExtent=Se.circularPathData.targetX-Se.circularPathData.rightNodeBuffer,Se.circularPathData.leftFullExtent=Se.circularPathData.sourceX+Se.circularPathData.leftLargeArcRadius+Se.circularPathData.leftNodeBuffer,Se.circularPathData.rightFullExtent=Se.circularPathData.targetX-Se.circularPathData.rightLargeArcRadius-Se.circularPathData.rightNodeBuffer}if(Se.circular)Se.path=W(Se);else{var Kt=L.linkHorizontal().source(function(Qt){var fr=Qt.source.x0+(Qt.source.x1-Qt.source.x0),mr=Qt.y0;return[fr,mr]}).target(function(Qt){var fr=Qt.target.x0,mr=Qt.y1;return[fr,mr]});Se.path=Kt(Se)}})}function W(Xe){var it="";return Xe.circularLinkType=="top"?it="M"+Xe.circularPathData.sourceX+" "+Xe.circularPathData.sourceY+" L"+Xe.circularPathData.leftInnerExtent+" "+Xe.circularPathData.sourceY+" A"+Xe.circularPathData.leftLargeArcRadius+" "+Xe.circularPathData.leftSmallArcRadius+" 0 0 0 "+Xe.circularPathData.leftFullExtent+" "+(Xe.circularPathData.sourceY-Xe.circularPathData.leftSmallArcRadius)+" L"+Xe.circularPathData.leftFullExtent+" "+Xe.circularPathData.verticalLeftInnerExtent+" A"+Xe.circularPathData.leftLargeArcRadius+" "+Xe.circularPathData.leftLargeArcRadius+" 0 0 0 "+Xe.circularPathData.leftInnerExtent+" "+Xe.circularPathData.verticalFullExtent+" L"+Xe.circularPathData.rightInnerExtent+" "+Xe.circularPathData.verticalFullExtent+" A"+Xe.circularPathData.rightLargeArcRadius+" "+Xe.circularPathData.rightLargeArcRadius+" 0 0 0 "+Xe.circularPathData.rightFullExtent+" "+Xe.circularPathData.verticalRightInnerExtent+" L"+Xe.circularPathData.rightFullExtent+" "+(Xe.circularPathData.targetY-Xe.circularPathData.rightSmallArcRadius)+" A"+Xe.circularPathData.rightLargeArcRadius+" "+Xe.circularPathData.rightSmallArcRadius+" 0 0 0 "+Xe.circularPathData.rightInnerExtent+" "+Xe.circularPathData.targetY+" L"+Xe.circularPathData.targetX+" "+Xe.circularPathData.targetY:it="M"+Xe.circularPathData.sourceX+" "+Xe.circularPathData.sourceY+" L"+Xe.circularPathData.leftInnerExtent+" "+Xe.circularPathData.sourceY+" A"+Xe.circularPathData.leftLargeArcRadius+" "+Xe.circularPathData.leftSmallArcRadius+" 0 0 1 "+Xe.circularPathData.leftFullExtent+" "+(Xe.circularPathData.sourceY+Xe.circularPathData.leftSmallArcRadius)+" L"+Xe.circularPathData.leftFullExtent+" "+Xe.circularPathData.verticalLeftInnerExtent+" A"+Xe.circularPathData.leftLargeArcRadius+" "+Xe.circularPathData.leftLargeArcRadius+" 0 0 1 "+Xe.circularPathData.leftInnerExtent+" "+Xe.circularPathData.verticalFullExtent+" L"+Xe.circularPathData.rightInnerExtent+" "+Xe.circularPathData.verticalFullExtent+" A"+Xe.circularPathData.rightLargeArcRadius+" "+Xe.circularPathData.rightLargeArcRadius+" 0 0 1 "+Xe.circularPathData.rightFullExtent+" "+Xe.circularPathData.verticalRightInnerExtent+" L"+Xe.circularPathData.rightFullExtent+" "+(Xe.circularPathData.targetY+Xe.circularPathData.rightSmallArcRadius)+" A"+Xe.circularPathData.rightLargeArcRadius+" "+Xe.circularPathData.rightSmallArcRadius+" 0 0 1 "+Xe.circularPathData.rightInnerExtent+" "+Xe.circularPathData.targetY+" L"+Xe.circularPathData.targetX+" "+Xe.circularPathData.targetY,it}function ee(Xe,it){return Y(Xe)==Y(it)?Xe.circularLinkType=="bottom"?xe(Xe,it):ue(Xe,it):Y(it)-Y(Xe)}function ue(Xe,it){return Xe.y0-it.y0}function xe(Xe,it){return it.y0-Xe.y0}function ge(Xe,it){return Xe.y1-it.y1}function _e(Xe,it){return it.y1-Xe.y1}function Y(Xe){return Xe.target.column-Xe.source.column}function se(Xe){return Xe.target.x0-Xe.source.x1}function ce(Xe,it){var yt=U(Xe),bt=se(it)/Math.tan(yt),mt=Ne(Xe)=="up"?Xe.y1+bt:Xe.y1-bt;return mt}function ne(Xe,it){var yt=U(Xe),bt=se(it)/Math.tan(yt),mt=Ne(Xe)=="up"?Xe.y1-bt:Xe.y1+bt;return mt}function ye(Xe,it,yt,bt){Xe.links.forEach(function(mt){if(!mt.circular&&mt.target.column-mt.source.column>1){var ht=mt.source.column+1,Ve=mt.target.column-1,ze=1,Se=Ve-ht+1;for(ze=1;ht<=Ve;ht++,ze++)Xe.nodes.forEach(function(Je){if(Je.column==ht){var _t=ze/(Se+1),At=Math.pow(1-_t,3),vt=3*_t*Math.pow(1-_t,2),Kt=3*Math.pow(_t,2)*(1-_t),Qt=Math.pow(_t,3),fr=At*mt.y0+vt*mt.y0+Kt*mt.y1+Qt*mt.y1,mr=fr-mt.width/2,Ur=fr+mt.width/2,Br;mr>Je.y0&&mrJe.y0&&UrJe.y1&&Z(fn,Br,it,yt)})):mrJe.y1&&(Br=Ur-Je.y0+10,Je=Z(Je,Br,it,yt),Xe.nodes.forEach(function(fn){E(fn,bt)==E(Je,bt)||fn.column!=Je.column||fn.y0Je.y1&&Z(fn,Br,it,yt)}))}})}})}function le(Xe,it){return Xe.y0>it.y0&&Xe.y0it.y0&&Xe.y1it.y1}function Z(Xe,it,yt,bt){return Xe.y0+it>=yt&&Xe.y1+it<=bt&&(Xe.y0=Xe.y0+it,Xe.y1=Xe.y1+it,Xe.targetLinks.forEach(function(mt){mt.y1=mt.y1+it}),Xe.sourceLinks.forEach(function(mt){mt.y0=mt.y0+it})),Xe}function de(Xe,it,yt,bt){Xe.nodes.forEach(function(mt){bt&&mt.y+(mt.y1-mt.y0)>it&&(mt.y=mt.y-(mt.y+(mt.y1-mt.y0)-it));var ht=Xe.links.filter(function(Se){return E(Se.source,yt)==E(mt,yt)}),Ve=ht.length;Ve>1&&ht.sort(function(Se,Je){if(!Se.circular&&!Je.circular){if(Se.target.column==Je.target.column)return Se.y1-Je.y1;if(Te(Se,Je)){if(Se.target.column>Je.target.column){var _t=ne(Je,Se);return Se.y1-_t}if(Je.target.column>Se.target.column){var At=ne(Se,Je);return At-Je.y1}}else return Se.y1-Je.y1}if(Se.circular&&!Je.circular)return Se.circularLinkType=="top"?-1:1;if(Je.circular&&!Se.circular)return Je.circularLinkType=="top"?1:-1;if(Se.circular&&Je.circular)return Se.circularLinkType===Je.circularLinkType&&Se.circularLinkType=="top"?Se.target.column===Je.target.column?Se.target.y1-Je.target.y1:Je.target.column-Se.target.column:Se.circularLinkType===Je.circularLinkType&&Se.circularLinkType=="bottom"?Se.target.column===Je.target.column?Je.target.y1-Se.target.y1:Se.target.column-Je.target.column:Se.circularLinkType=="top"?-1:1});var ze=mt.y0;ht.forEach(function(Se){Se.y0=ze+Se.width/2,ze=ze+Se.width}),ht.forEach(function(Se,Je){if(Se.circularLinkType=="bottom"){var _t=Je+1,At=0;for(_t;_t1&&mt.sort(function(ze,Se){if(!ze.circular&&!Se.circular){if(ze.source.column==Se.source.column)return ze.y0-Se.y0;if(Te(ze,Se)){if(Se.source.column0?"up":"down"}function $e(Xe,it){return E(Xe.source,it)==E(Xe.target,it)}function Ze(Xe,it,yt){var bt=Xe.nodes,mt=Xe.links,ht=!1,Ve=!1;if(mt.forEach(function(vt){vt.circularLinkType=="top"?ht=!0:vt.circularLinkType=="bottom"&&(Ve=!0)}),ht==!1||Ve==!1){var ze=S.min(bt,function(vt){return vt.y0}),Se=S.max(bt,function(vt){return vt.y1}),Je=Se-ze,_t=yt-it,At=_t/Je;bt.forEach(function(vt){var Kt=(vt.y1-vt.y0)*At;vt.y0=(vt.y0-ze)*At,vt.y1=vt.y0+Kt}),mt.forEach(function(vt){vt.y0=(vt.y0-ze)*At,vt.y1=(vt.y1-ze)*At,vt.width=vt.width*At})}}v.sankeyCircular=w,v.sankeyCenter=s,v.sankeyLeft=a,v.sankeyRight=l,v.sankeyJustify=i,Object.defineProperty(v,"__esModule",{value:!0})})}}),g7=Re({"src/traces/sankey/constants.js"(ae,K){K.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"}}}}),GK=Re({"src/traces/sankey/render.js"(ae,K){var v=BK(),S=(Lo(),yn(Xi)).interpolateNumber,M=un(),L=$K(),t=jK(),r=g7(),a=oo(),l=ko(),i=qs(),s=Rn(),o=s.strTranslate,c=s.strRotate,p=n_(),d=p.keyFun,y=p.repeat,g=p.unwrap,C=kc(),f=es(),x=qd(),A=x.CAP_SHIFT,k=x.LINE_SPACING,I=3;function T(ce,ne,ye){var le=g(ne),Z=le.trace,de=Z.domain,pe=Z.orientation==="h",Te=Z.node.pad,Ne=Z.node.thickness,$e={justify:L.sankeyJustify,left:L.sankeyLeft,right:L.sankeyRight,center:L.sankeyCenter}[Z.node.align],Ze=ce.width*(de.x[1]-de.x[0]),Xe=ce.height*(de.y[1]-de.y[0]),it=le._nodes,yt=le._links,bt=le.circular,mt;bt?mt=t.sankeyCircular().circularLinkGap(0):mt=L.sankey(),mt.iterations(r.sankeyIterations).size(pe?[Ze,Xe]:[Xe,Ze]).nodeWidth(Ne).nodePadding(Te).nodeId(function(fn){return fn.pointNumber}).nodeAlign($e).nodes(it).links(yt);var ht=mt();mt.nodePadding()=et||(Bt=et-Qr.y0,Bt>1e-6&&(Qr.y0+=Bt,Qr.y1+=Bt)),et=Qr.y1+Te})}function fr(fn){var Fr=fn.map(function(ke,Fe){return{x0:ke.x0,index:Fe}}).sort(function(ke,Fe){return ke.x0-Fe.x0}),Qr=[],Bt=-1,et,ut=-1/0,Be;for(Ve=0;Veut+Ne&&(Bt+=1,et=Ie.x0),ut=Ie.x0,Qr[Bt]||(Qr[Bt]=[]),Qr[Bt].push(Ie),Be=et-Ie.x0,Ie.x0+=Be,Ie.x1+=Be}return Qr}if(Z.node.x.length&&Z.node.y.length){for(Ve=0;Ve0?" L "+Z.targetX+" "+Z.targetY:"")+"Z"):(ye="M "+(Z.targetX-ne)+" "+(Z.targetY-le)+" L "+(Z.rightInnerExtent-ne)+" "+(Z.targetY-le)+" A "+(Z.rightLargeArcRadius+le)+" "+(Z.rightSmallArcRadius+le)+" 0 0 0 "+(Z.rightFullExtent-le-ne)+" "+(Z.targetY+Z.rightSmallArcRadius)+" L "+(Z.rightFullExtent-le-ne)+" "+Z.verticalRightInnerExtent,de&&pe?ye+=" A "+(Z.rightLargeArcRadius+le)+" "+(Z.rightLargeArcRadius+le)+" 0 0 0 "+(Z.rightInnerExtent-le-ne)+" "+(Z.verticalFullExtent+le)+" L "+(Z.rightFullExtent+le-ne-(Z.rightLargeArcRadius-le))+" "+(Z.verticalFullExtent+le)+" A "+(Z.rightLargeArcRadius+le)+" "+(Z.rightLargeArcRadius+le)+" 0 0 0 "+(Z.leftFullExtent+le)+" "+Z.verticalLeftInnerExtent:de?ye+=" A "+(Z.rightLargeArcRadius-le)+" "+(Z.rightSmallArcRadius-le)+" 0 0 1 "+(Z.rightFullExtent-ne-le-(Z.rightLargeArcRadius-le))+" "+(Z.verticalFullExtent-le)+" L "+(Z.leftFullExtent+le+(Z.rightLargeArcRadius-le))+" "+(Z.verticalFullExtent-le)+" A "+(Z.rightLargeArcRadius-le)+" "+(Z.rightSmallArcRadius-le)+" 0 0 1 "+(Z.leftFullExtent+le)+" "+Z.verticalLeftInnerExtent:ye+=" A "+(Z.rightLargeArcRadius+le)+" "+(Z.rightLargeArcRadius+le)+" 0 0 0 "+(Z.rightInnerExtent-ne)+" "+(Z.verticalFullExtent+le)+" L "+Z.leftInnerExtent+" "+(Z.verticalFullExtent+le)+" A "+(Z.leftLargeArcRadius+le)+" "+(Z.leftLargeArcRadius+le)+" 0 0 0 "+(Z.leftFullExtent+le)+" "+Z.verticalLeftInnerExtent,ye+=" L "+(Z.leftFullExtent+le)+" "+(Z.sourceY+Z.leftSmallArcRadius)+" A "+(Z.leftLargeArcRadius+le)+" "+(Z.leftSmallArcRadius+le)+" 0 0 0 "+Z.leftInnerExtent+" "+(Z.sourceY-le)+" L "+Z.sourceX+" "+(Z.sourceY-le)+" L "+Z.sourceX+" "+(Z.sourceY+le)+" L "+Z.leftInnerExtent+" "+(Z.sourceY+le)+" A "+(Z.leftLargeArcRadius-le)+" "+(Z.leftSmallArcRadius-le)+" 0 0 1 "+(Z.leftFullExtent-le)+" "+(Z.sourceY+Z.leftSmallArcRadius)+" L "+(Z.leftFullExtent-le)+" "+Z.verticalLeftInnerExtent,de&&pe?ye+=" A "+(Z.rightLargeArcRadius-le)+" "+(Z.rightSmallArcRadius-le)+" 0 0 1 "+(Z.leftFullExtent-le-(Z.rightLargeArcRadius-le))+" "+(Z.verticalFullExtent-le)+" L "+(Z.rightFullExtent+le-ne+(Z.rightLargeArcRadius-le))+" "+(Z.verticalFullExtent-le)+" A "+(Z.rightLargeArcRadius-le)+" "+(Z.rightSmallArcRadius-le)+" 0 0 1 "+(Z.rightFullExtent+le-ne)+" "+Z.verticalRightInnerExtent:de?ye+=" A "+(Z.rightLargeArcRadius+le)+" "+(Z.rightLargeArcRadius+le)+" 0 0 0 "+(Z.leftFullExtent+le)+" "+(Z.verticalFullExtent+le)+" L "+(Z.rightFullExtent-ne-le)+" "+(Z.verticalFullExtent+le)+" A "+(Z.rightLargeArcRadius+le)+" "+(Z.rightLargeArcRadius+le)+" 0 0 0 "+(Z.rightFullExtent+le-ne)+" "+Z.verticalRightInnerExtent:ye+=" A "+(Z.leftLargeArcRadius-le)+" "+(Z.leftLargeArcRadius-le)+" 0 0 1 "+Z.leftInnerExtent+" "+(Z.verticalFullExtent-le)+" L "+(Z.rightInnerExtent-ne)+" "+(Z.verticalFullExtent-le)+" A "+(Z.rightLargeArcRadius-le)+" "+(Z.rightLargeArcRadius-le)+" 0 0 1 "+(Z.rightFullExtent+le-ne)+" "+Z.verticalRightInnerExtent,ye+=" L "+(Z.rightFullExtent+le-ne)+" "+(Z.targetY+Z.rightSmallArcRadius)+" A "+(Z.rightLargeArcRadius-le)+" "+(Z.rightSmallArcRadius-le)+" 0 0 1 "+(Z.rightInnerExtent-ne)+" "+(Z.targetY+le)+" L "+(Z.targetX-ne)+" "+(Z.targetY+le)+(ne>0?" L "+Z.targetX+" "+Z.targetY:"")+"Z"),ye}function h(){var ce=.5;function ne(ye){var le=ye.linkArrowLength;if(ye.link.circular)return _(ye.link,le);var Z=Math.abs((ye.link.target.x0-ye.link.source.x1)/2);le>Z&&(le=Z);var de=ye.link.source.x1,pe=ye.link.target.x0-le,Te=S(de,pe),Ne=Te(ce),$e=Te(1-ce),Ze=ye.link.y0-ye.link.width/2,Xe=ye.link.y0+ye.link.width/2,it=ye.link.y1-ye.link.width/2,yt=ye.link.y1+ye.link.width/2,bt="M"+de+","+Ze,mt="C"+Ne+","+Ze+" "+$e+","+it+" "+pe+","+it,ht="C"+$e+","+yt+" "+Ne+","+Xe+" "+de+","+Xe,Ve=le>0?"L"+(pe+le)+","+(it+ye.link.width/2):"";return Ve+="L"+pe+","+yt,bt+mt+Ve+ht+"Z"}return ne}function m(ce,ne){var ye=a(ne.color),le=r.nodePadAcross,Z=ce.nodePad/2;ne.dx=ne.x1-ne.x0,ne.dy=ne.y1-ne.y0;var de=ne.dx,pe=Math.max(.5,ne.dy),Te="node_"+ne.pointNumber;return ne.group&&(Te=s.randstr()),ne.trace=ce.trace,ne.curveNumber=ce.trace.index,{index:ne.pointNumber,key:Te,partOfGroup:ne.partOfGroup||!1,group:ne.group,traceId:ce.key,trace:ce.trace,node:ne,nodePad:ce.nodePad,nodeLineColor:ce.nodeLineColor,nodeLineWidth:ce.nodeLineWidth,textFont:ce.textFont,size:ce.horizontal?ce.height:ce.width,visibleWidth:Math.ceil(de),visibleHeight:pe,zoneX:-le,zoneY:-Z,zoneWidth:de+2*le,zoneHeight:pe+2*Z,labelY:ce.horizontal?ne.dy/2+1:ne.dx/2+1,left:ne.originalLayer===1,sizeAcross:ce.width,forceLayouts:ce.forceLayouts,horizontal:ce.horizontal,darkBackground:ye.getBrightness()<=128,tinyColorHue:l.tinyRGB(ye),tinyColorAlpha:ye.getAlpha(),valueFormat:ce.valueFormat,valueSuffix:ce.valueSuffix,sankey:ce.sankey,graph:ce.graph,arrangement:ce.arrangement,uniqueNodeLabelPathId:[ce.guid,ce.key,Te].join("_"),interactionState:ce.interactionState,figure:ce}}function w(ce){ce.attr("transform",function(ne){return o(ne.node.x0.toFixed(3),ne.node.y0.toFixed(3))})}function F(ce){ce.call(w)}function z(ce,ne){ce.call(F),ne.attr("d",h())}function U(ce){ce.attr("width",function(ne){return ne.node.x1-ne.node.x0}).attr("height",function(ne){return ne.visibleHeight})}function V(ce){return ce.link.width>1||ce.linkLineWidth>0}function G(ce){var ne=o(ce.translateX,ce.translateY);return ne+(ce.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function j(ce,ne,ye){ce.on(".basic",null).on("mouseover.basic",function(le){!le.interactionState.dragInProgress&&!le.partOfGroup&&(ye.hover(this,le,ne),le.interactionState.hovered=[this,le])}).on("mousemove.basic",function(le){!le.interactionState.dragInProgress&&!le.partOfGroup&&(ye.follow(this,le),le.interactionState.hovered=[this,le])}).on("mouseout.basic",function(le){!le.interactionState.dragInProgress&&!le.partOfGroup&&(ye.unhover(this,le,ne),le.interactionState.hovered=!1)}).on("click.basic",function(le){le.interactionState.hovered&&(ye.unhover(this,le,ne),le.interactionState.hovered=!1),!le.interactionState.dragInProgress&&!le.partOfGroup&&ye.select(this,le,ne)})}function O(ce,ne,ye,le){var Z=M.behavior.drag().origin(function(de){return{x:de.node.x0+de.visibleWidth/2,y:de.node.y0+de.visibleHeight/2}}).on("dragstart",function(de){if(de.arrangement!=="fixed"&&(s.ensureSingle(le._fullLayout._infolayer,"g","dragcover",function(Te){le._fullLayout._dragCover=Te}),s.raiseToTop(this),de.interactionState.dragInProgress=de.node,ge(de.node),de.interactionState.hovered&&(ye.nodeEvents.unhover.apply(0,de.interactionState.hovered),de.interactionState.hovered=!1),de.arrangement==="snap")){var pe=de.traceId+"|"+de.key;de.forceLayouts[pe]?de.forceLayouts[pe].alpha(1):H(ce,pe,de),W(ce,ne,de,pe,le)}}).on("drag",function(de){if(de.arrangement!=="fixed"){var pe=M.event.x,Te=M.event.y;de.arrangement==="snap"?(de.node.x0=pe-de.visibleWidth/2,de.node.x1=pe+de.visibleWidth/2,de.node.y0=Te-de.visibleHeight/2,de.node.y1=Te+de.visibleHeight/2):(de.arrangement==="freeform"&&(de.node.x0=pe-de.visibleWidth/2,de.node.x1=pe+de.visibleWidth/2),Te=Math.max(0,Math.min(de.size-de.visibleHeight/2,Te)),de.node.y0=Te-de.visibleHeight/2,de.node.y1=Te+de.visibleHeight/2),ge(de.node),de.arrangement!=="snap"&&(de.sankey.update(de.graph),z(ce.filter(_e(de)),ne))}}).on("dragend",function(de){if(de.arrangement!=="fixed"){de.interactionState.dragInProgress=!1;for(var pe=0;pe0)window.requestAnimationFrame(de);else{var Ne=ye.node.originalX;ye.node.x0=Ne-ye.visibleWidth/2,ye.node.x1=Ne+ye.visibleWidth/2,ue(ye,Z)}})}function ee(ce,ne,ye,le){return function(){for(var de=0,pe=0;pe0&&le.forceLayouts[ne].alpha(0)}}function ue(ce,ne){for(var ye=[],le=[],Z=0;Z"),color:x(Y,"bgcolor")||r.addOpacity(le.color,1),borderColor:x(Y,"bordercolor"),fontFamily:x(Y,"font.family"),fontSize:x(Y,"font.size"),fontColor:x(Y,"font.color"),fontWeight:x(Y,"font.weight"),fontStyle:x(Y,"font.style"),fontVariant:x(Y,"font.variant"),fontTextcase:x(Y,"font.textcase"),fontLineposition:x(Y,"font.lineposition"),fontShadow:x(Y,"font.shadow"),nameLength:x(Y,"namelength"),textAlign:x(Y,"align"),idealAlign:v.event.x"),color:x(Y,"bgcolor")||_e.tinyColorHue,borderColor:x(Y,"bordercolor"),fontFamily:x(Y,"font.family"),fontSize:x(Y,"font.size"),fontColor:x(Y,"font.color"),fontWeight:x(Y,"font.weight"),fontStyle:x(Y,"font.style"),fontVariant:x(Y,"font.variant"),fontTextcase:x(Y,"font.textcase"),fontLineposition:x(Y,"font.lineposition"),fontShadow:x(Y,"font.shadow"),nameLength:x(Y,"namelength"),textAlign:x(Y,"align"),idealAlign:"left",hovertemplate:Y.hovertemplate,hovertemplateLabels:de,eventData:[_e.node]},{container:T._hoverlayer.node(),outerContainer:T._paper.node(),gd:k});o(Ne,.85),c(Ne)}}},xe=function(ge,_e,Y){k._fullLayout.hovermode!==!1&&(v.select(ge).call(g,_e,Y),_e.node.trace.node.hoverinfo!=="skip"&&(_e.node.fullData=_e.node.trace,k.emit("plotly_unhover",{event:v.event,points:[_e.node]})),t.loneUnhover(T._hoverlayer.node()))};L(k,E,I,{width:_.w,height:_.h,margin:{t:_.t,r:_.r,b:_.b,l:_.l}},{linkEvents:{hover:F,follow:O,unhover:H,select:w},nodeEvents:{hover:ee,follow:ue,unhover:xe,select:W}})}}}),qK=Re({"src/traces/sankey/base_plot.js"(ae){var K=bf().overrideAll,v=Lp().getModuleCalcData,S=y7(),M=Ps(),L=mg(),t=fv(),r=Dh().prepSelect,a=Rn(),l=es(),i="sankey";ae.name=i,ae.baseLayoutAttrOverrides=K({hoverlabel:M.hoverlabel},"plot","nested"),ae.plot=function(o){var c=v(o.calcdata,i)[0];S(o,c),ae.updateFx(o)},ae.clean=function(o,c,p,d){var y=d._has&&d._has(i),g=c._has&&c._has(i);y&&!g&&(d._paperdiv.selectAll(".sankey").remove(),d._paperdiv.selectAll(".bgsankey").remove())},ae.updateFx=function(o){for(var c=0;c0}K.exports=function(V,G,j,O){var H=V._fullLayout,W;A(j)&&O&&(W=O()),L.makeTraceGroups(H._indicatorlayer,G,"trace").each(function(ee){var ue=ee[0],xe=ue.trace,ge=v.select(this),_e=xe._hasGauge,Y=xe._isAngular,se=xe._isBullet,ce=xe.domain,ne={w:H._size.w*(ce.x[1]-ce.x[0]),h:H._size.h*(ce.y[1]-ce.y[0]),l:H._size.l+H._size.w*ce.x[0],r:H._size.r+H._size.w*(1-ce.x[1]),t:H._size.t+H._size.h*(1-ce.y[1]),b:H._size.b+H._size.h*ce.y[0]},ye=ne.l+ne.w/2,le=ne.t+ne.h/2,Z=Math.min(ne.w/2,ne.h),de=s.innerRadius*Z,pe,Te,Ne,$e=xe.align||"center";if(Te=le,!_e)pe=ne.l+f[$e]*ne.w,Ne=function(Se){return m(Se,ne.w,ne.h)};else if(Y&&(pe=ye,Te=le+Z/2,Ne=function(Se){return w(Se,.9*de)}),se){var Ze=s.bulletPadding,Xe=1-s.bulletNumberDomainSize+Ze;pe=ne.l+(Xe+(1-Xe)*f[$e])*ne.w,Ne=function(Se){return m(Se,(s.bulletNumberDomainSize-Ze)*ne.w,ne.h)}}T(V,ge,ee,{numbersX:pe,numbersY:Te,numbersScaler:Ne,transitionOpts:j,onComplete:W});var it,yt;_e&&(it={range:xe.gauge.axis.range,color:xe.gauge.bgcolor,line:{color:xe.gauge.bordercolor,width:0},thickness:1},yt={range:xe.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:xe.gauge.bordercolor,width:xe.gauge.borderwidth},thickness:1});var bt=ge.selectAll("g.angular").data(Y?ee:[]);bt.exit().remove();var mt=ge.selectAll("g.angularaxis").data(Y?ee:[]);mt.exit().remove(),Y&&I(V,ge,ee,{radius:Z,innerRadius:de,gauge:bt,layer:mt,size:ne,gaugeBg:it,gaugeOutline:yt,transitionOpts:j,onComplete:W});var ht=ge.selectAll("g.bullet").data(se?ee:[]);ht.exit().remove();var Ve=ge.selectAll("g.bulletaxis").data(se?ee:[]);Ve.exit().remove(),se&&k(V,ge,ee,{gauge:ht,layer:Ve,size:ne,gaugeBg:it,gaugeOutline:yt,transitionOpts:j,onComplete:W});var ze=ge.selectAll("text.title").data(ee);ze.exit().remove(),ze.enter().append("text").classed("title",!0),ze.attr("text-anchor",function(){return se?C.right:C[xe.title.align]}).text(xe.title.text).call(i.font,xe.title.font).call(o.convertToTspans,V),ze.attr("transform",function(){var Se=ne.l+ne.w*f[xe.title.align],Je,_t=s.titlePadding,At=i.bBox(ze.node());if(_e){if(Y)if(xe.gauge.axis.visible){var vt=i.bBox(mt.node());Je=vt.top-_t-At.bottom}else Je=ne.t+ne.h/2-Z/2-At.bottom-_t;se&&(Je=Te-(At.top+At.bottom)/2,Se=ne.l-s.bulletPadding*ne.w)}else Je=xe._numbersTop-_t-At.bottom;return r(Se,Je)})})};function k(U,V,G,j){var O=G[0].trace,H=j.gauge,W=j.layer,ee=j.gaugeBg,ue=j.gaugeOutline,xe=j.size,ge=O.domain,_e=j.transitionOpts,Y=j.onComplete,se,ce,ne,ye,le;H.enter().append("g").classed("bullet",!0),H.attr("transform",r(xe.l,xe.t)),W.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),W.selectAll("g.xbulletaxistick,path,text").remove();var Z=xe.h,de=O.gauge.bar.thickness*Z,pe=ge.x[0],Te=ge.x[0]+(ge.x[1]-ge.x[0])*(O._hasNumber||O._hasDelta?1-s.bulletNumberDomainSize:1);se=h(U,O.gauge.axis),se._id="xbulletaxis",se.domain=[pe,Te],se.setScale(),ce=c.calcTicks(se),ne=c.makeTransTickFn(se),ye=c.getTickSigns(se)[2],le=xe.t+xe.h,se.visible&&(c.drawTicks(U,se,{vals:se.ticks==="inside"?c.clipEnds(se,ce):ce,layer:W,path:c.makeTickPath(se,le,ye),transFn:ne}),c.drawLabels(U,se,{vals:ce,layer:W,transFn:ne,labelFns:c.makeLabelFns(se,le)}));function Ne(mt){mt.attr("width",function(ht){return Math.max(0,se.c2p(ht.range[1])-se.c2p(ht.range[0]))}).attr("x",function(ht){return se.c2p(ht.range[0])}).attr("y",function(ht){return .5*(1-ht.thickness)*Z}).attr("height",function(ht){return ht.thickness*Z})}var $e=[ee].concat(O.gauge.steps),Ze=H.selectAll("g.bg-bullet").data($e);Ze.enter().append("g").classed("bg-bullet",!0).append("rect"),Ze.select("rect").call(Ne).call(E),Ze.exit().remove();var Xe=H.selectAll("g.value-bullet").data([O.gauge.bar]);Xe.enter().append("g").classed("value-bullet",!0).append("rect"),Xe.select("rect").attr("height",de).attr("y",(Z-de)/2).call(E),A(_e)?Xe.select("rect").transition().duration(_e.duration).ease(_e.easing).each("end",function(){Y&&Y()}).each("interrupt",function(){Y&&Y()}).attr("width",Math.max(0,se.c2p(Math.min(O.gauge.axis.range[1],G[0].y)))):Xe.select("rect").attr("width",typeof G[0].y=="number"?Math.max(0,se.c2p(Math.min(O.gauge.axis.range[1],G[0].y))):0),Xe.exit().remove();var it=G.filter(function(){return O.gauge.threshold.value||O.gauge.threshold.value===0}),yt=H.selectAll("g.threshold-bullet").data(it);yt.enter().append("g").classed("threshold-bullet",!0).append("line"),yt.select("line").attr("x1",se.c2p(O.gauge.threshold.value)).attr("x2",se.c2p(O.gauge.threshold.value)).attr("y1",(1-O.gauge.threshold.thickness)/2*Z).attr("y2",(1-(1-O.gauge.threshold.thickness)/2)*Z).call(g.stroke,O.gauge.threshold.line.color).style("stroke-width",O.gauge.threshold.line.width),yt.exit().remove();var bt=H.selectAll("g.gauge-outline").data([ue]);bt.enter().append("g").classed("gauge-outline",!0).append("rect"),bt.select("rect").call(Ne).call(E),bt.exit().remove()}function I(U,V,G,j){var O=G[0].trace,H=j.size,W=j.radius,ee=j.innerRadius,ue=j.gaugeBg,xe=j.gaugeOutline,ge=[H.l+H.w/2,H.t+H.h/2+W/2],_e=j.gauge,Y=j.layer,se=j.transitionOpts,ce=j.onComplete,ne=Math.PI/2;function ye(Kt){var Qt=O.gauge.axis.range[0],fr=O.gauge.axis.range[1],mr=(Kt-Qt)/(fr-Qt)*Math.PI-ne;return mr<-ne?-ne:mr>ne?ne:mr}function le(Kt){return v.svg.arc().innerRadius((ee+W)/2-Kt/2*(W-ee)).outerRadius((ee+W)/2+Kt/2*(W-ee)).startAngle(-ne)}function Z(Kt){Kt.attr("d",function(Qt){return le(Qt.thickness).startAngle(ye(Qt.range[0])).endAngle(ye(Qt.range[1]))()})}var de,pe,Te,Ne;_e.enter().append("g").classed("angular",!0),_e.attr("transform",r(ge[0],ge[1])),Y.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),Y.selectAll("g.xangularaxistick,path,text").remove(),de=h(U,O.gauge.axis),de.type="linear",de.range=O.gauge.axis.range,de._id="xangularaxis",de.ticklabeloverflow="allow",de.setScale();var $e=function(Kt){return(de.range[0]-Kt.x)/(de.range[1]-de.range[0])*Math.PI+Math.PI},Ze={},Xe=c.makeLabelFns(de,0),it=Xe.labelStandoff;Ze.xFn=function(Kt){var Qt=$e(Kt);return Math.cos(Qt)*it},Ze.yFn=function(Kt){var Qt=$e(Kt),fr=Math.sin(Qt)>0?.2:1;return-Math.sin(Qt)*(it+Kt.fontSize*fr)+Math.abs(Math.cos(Qt))*(Kt.fontSize*l)},Ze.anchorFn=function(Kt){var Qt=$e(Kt),fr=Math.cos(Qt);return Math.abs(fr)<.1?"middle":fr>0?"start":"end"},Ze.heightFn=function(Kt,Qt,fr){var mr=$e(Kt);return-.5*(1+Math.sin(mr))*fr};var yt=function(Kt){return r(ge[0]+W*Math.cos(Kt),ge[1]-W*Math.sin(Kt))};Te=function(Kt){return yt($e(Kt))};var bt=function(Kt){var Qt=$e(Kt);return yt(Qt)+"rotate("+-a(Qt)+")"};if(pe=c.calcTicks(de),Ne=c.getTickSigns(de)[2],de.visible){Ne=de.ticks==="inside"?-1:1;var mt=(de.linewidth||1)/2;c.drawTicks(U,de,{vals:pe,layer:Y,path:"M"+Ne*mt+",0h"+Ne*de.ticklen,transFn:bt}),c.drawLabels(U,de,{vals:pe,layer:Y,transFn:Te,labelFns:Ze})}var ht=[ue].concat(O.gauge.steps),Ve=_e.selectAll("g.bg-arc").data(ht);Ve.enter().append("g").classed("bg-arc",!0).append("path"),Ve.select("path").call(Z).call(E),Ve.exit().remove();var ze=le(O.gauge.bar.thickness),Se=_e.selectAll("g.value-arc").data([O.gauge.bar]);Se.enter().append("g").classed("value-arc",!0).append("path");var Je=Se.select("path");A(se)?(Je.transition().duration(se.duration).ease(se.easing).each("end",function(){ce&&ce()}).each("interrupt",function(){ce&&ce()}).attrTween("d",_(ze,ye(G[0].lastY),ye(G[0].y))),O._lastValue=G[0].y):Je.attr("d",typeof G[0].y=="number"?ze.endAngle(ye(G[0].y)):"M0,0Z"),Je.call(E),Se.exit().remove(),ht=[];var _t=O.gauge.threshold.value;(_t||_t===0)&&ht.push({range:[_t,_t],color:O.gauge.threshold.color,line:{color:O.gauge.threshold.line.color,width:O.gauge.threshold.line.width},thickness:O.gauge.threshold.thickness});var At=_e.selectAll("g.threshold-arc").data(ht);At.enter().append("g").classed("threshold-arc",!0).append("path"),At.select("path").call(Z).call(E),At.exit().remove();var vt=_e.selectAll("g.gauge-outline").data([xe]);vt.enter().append("g").classed("gauge-outline",!0).append("path"),vt.select("path").call(Z).call(E),vt.exit().remove()}function T(U,V,G,j){var O=G[0].trace,H=j.numbersX,W=j.numbersY,ee=O.align||"center",ue=C[ee],xe=j.transitionOpts,ge=j.onComplete,_e=L.ensureSingle(V,"g","numbers"),Y,se,ce,ne=[];O._hasNumber&&ne.push("number"),O._hasDelta&&(ne.push("delta"),O.delta.position==="left"&&ne.reverse());var ye=_e.selectAll("text").data(ne);ye.enter().append("text"),ye.attr("text-anchor",function(){return ue}).attr("class",function(yt){return yt}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),ye.exit().remove();function le(yt,bt,mt,ht){if(yt.match("s")&&mt>=0!=ht>=0&&!bt(mt).slice(-1).match(x)&&!bt(ht).slice(-1).match(x)){var Ve=yt.slice().replace("s","f").replace(/\d+/,function(Se){return parseInt(Se)-1}),ze=h(U,{tickformat:Ve});return function(Se){return Math.abs(Se)<1?c.tickText(ze,Se).text:bt(Se)}}else return bt}function Z(){var yt=h(U,{tickformat:O.number.valueformat},O._range);yt.setScale(),c.prepTicks(yt);var bt=function(Se){return c.tickText(yt,Se).text},mt=O.number.suffix,ht=O.number.prefix,Ve=_e.select("text.number");function ze(){var Se=typeof G[0].y=="number"?ht+bt(G[0].y)+mt:"-";Ve.text(Se).call(i.font,O.number.font).call(o.convertToTspans,U)}return A(xe)?Ve.transition().duration(xe.duration).ease(xe.easing).each("end",function(){ze(),ge&&ge()}).each("interrupt",function(){ze(),ge&&ge()}).attrTween("text",function(){var Se=v.select(this),Je=M(G[0].lastY,G[0].y);O._lastValue=G[0].y;var _t=le(O.number.valueformat,bt,G[0].lastY,G[0].y);return function(At){Se.text(ht+_t(Je(At))+mt)}}):ze(),Y=F(ht+bt(G[0].y)+mt,O.number.font,ue,U),Ve}function de(){var yt=h(U,{tickformat:O.delta.valueformat},O._range);yt.setScale(),c.prepTicks(yt);var bt=function(At){return c.tickText(yt,At).text},mt=O.delta.suffix,ht=O.delta.prefix,Ve=function(At){var vt=O.delta.relative?At.relativeDelta:At.delta;return vt},ze=function(At,vt){return At===0||typeof At!="number"||isNaN(At)?"-":(At>0?O.delta.increasing.symbol:O.delta.decreasing.symbol)+ht+vt(At)+mt},Se=function(At){return At.delta>=0?O.delta.increasing.color:O.delta.decreasing.color};O._deltaLastValue===void 0&&(O._deltaLastValue=Ve(G[0]));var Je=_e.select("text.delta");Je.call(i.font,O.delta.font).call(g.fill,Se({delta:O._deltaLastValue}));function _t(){Je.text(ze(Ve(G[0]),bt)).call(g.fill,Se(G[0])).call(o.convertToTspans,U)}return A(xe)?Je.transition().duration(xe.duration).ease(xe.easing).tween("text",function(){var At=v.select(this),vt=Ve(G[0]),Kt=O._deltaLastValue,Qt=le(O.delta.valueformat,bt,Kt,vt),fr=M(Kt,vt);return O._deltaLastValue=vt,function(mr){At.text(ze(fr(mr),Qt)),At.call(g.fill,Se({delta:fr(mr)}))}}).each("end",function(){_t(),ge&&ge()}).each("interrupt",function(){_t(),ge&&ge()}):_t(),se=F(ze(Ve(G[0]),bt),O.delta.font,ue,U),Je}var pe=O.mode+O.align,Te;if(O._hasDelta&&(Te=de(),pe+=O.delta.position+O.delta.font.size+O.delta.font.family+O.delta.valueformat,pe+=O.delta.increasing.symbol+O.delta.decreasing.symbol,ce=se),O._hasNumber&&(Z(),pe+=O.number.font.size+O.number.font.family+O.number.valueformat+O.number.suffix+O.number.prefix,ce=Y),O._hasDelta&&O._hasNumber){var Ne=[(Y.left+Y.right)/2,(Y.top+Y.bottom)/2],$e=[(se.left+se.right)/2,(se.top+se.bottom)/2],Ze,Xe,it=.75*O.delta.font.size;O.delta.position==="left"&&(Ze=z(O,"deltaPos",0,-1*(Y.width*f[O.align]+se.width*(1-f[O.align])+it),pe,Math.min),Xe=Ne[1]-$e[1],ce={width:Y.width+se.width+it,height:Math.max(Y.height,se.height),left:se.left+Ze,right:Y.right,top:Math.min(Y.top,se.top+Xe),bottom:Math.max(Y.bottom,se.bottom+Xe)}),O.delta.position==="right"&&(Ze=z(O,"deltaPos",0,Y.width*(1-f[O.align])+se.width*f[O.align]+it,pe,Math.max),Xe=Ne[1]-$e[1],ce={width:Y.width+se.width+it,height:Math.max(Y.height,se.height),left:Y.left,right:se.right+Ze,top:Math.min(Y.top,se.top+Xe),bottom:Math.max(Y.bottom,se.bottom+Xe)}),O.delta.position==="bottom"&&(Ze=null,Xe=se.height,ce={width:Math.max(Y.width,se.width),height:Y.height+se.height,left:Math.min(Y.left,se.left),right:Math.max(Y.right,se.right),top:Y.bottom-Y.height,bottom:Y.bottom+se.height}),O.delta.position==="top"&&(Ze=null,Xe=Y.top,ce={width:Math.max(Y.width,se.width),height:Y.height+se.height,left:Math.min(Y.left,se.left),right:Math.max(Y.right,se.right),top:Y.bottom-Y.height-se.height,bottom:Y.bottom}),Te.attr({dx:Ze,dy:Xe})}(O._hasNumber||O._hasDelta)&&_e.attr("transform",function(){var yt=j.numbersScaler(ce);pe+=yt[2];var bt=z(O,"numbersScale",1,yt[0],pe,Math.min),mt;O._scaleNumbers||(bt=1),O._isAngular?mt=W-bt*ce.bottom:mt=W-bt*(ce.top+ce.bottom)/2,O._numbersTop=bt*ce.top+mt;var ht=ce[ee];ee==="center"&&(ht=(ce.left+ce.right)/2);var Ve=H-bt*ht;return Ve=z(O,"numbersTranslate",0,Ve,pe,Math.max),r(Ve,mt)+t(bt)})}function E(U){U.each(function(V){g.stroke(v.select(this),V.line.color)}).each(function(V){g.fill(v.select(this),V.color)}).style("stroke-width",function(V){return V.line.width})}function _(U,V,G){return function(){var j=S(V,G);return function(O){return U.endAngle(j(O))()}}}function h(U,V,G){var j=U._fullLayout,O=L.extendFlat({type:"linear",ticks:"outside",range:G,showline:!0},V),H={type:"linear",_id:"x"+V._id},W={letter:"x",font:j.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function ee(ue,xe){return L.coerce(O,H,y,ue,xe)}return p(O,H,ee,W,j),d(O,H,ee,W),H}function m(U,V,G){var j=Math.min(V/U.width,G/U.height);return[j,U,V+"x"+G]}function w(U,V){var G=Math.sqrt(U.width/2*(U.width/2)+U.height*U.height),j=V/G;return[j,U,V]}function F(U,V,G,j){var O=document.createElementNS("http://www.w3.org/2000/svg","text"),H=v.select(O);return H.text(U).attr("x",0).attr("y",0).attr("text-anchor",G).attr("data-unformatted",U).call(o.convertToTspans,j).call(i.font,V),i.bBox(H.node())}function z(U,V,G,j,O,H){var W="_cache"+V;U[W]&&U[W].key===O||(U[W]={key:O,value:G});var ee=L.aggNums(H,null,[U[W].value,j],2);return U[W].value=ee,ee}}}),QK=Re({"src/traces/indicator/index.js"(ae,K){K.exports={moduleType:"trace",name:"indicator",basePlotModule:YK(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:_7(),supplyDefaults:ZK().supplyDefaults,calc:KK().calc,plot:JK(),meta:{}}}}),eJ=Re({"lib/indicator.js"(ae,K){K.exports=QK()}}),b7=Re({"src/traces/table/attributes.js"(ae,K){var v=_y(),S=Li().extendFlat,M=bf().overrideAll,L=Do(),t=af().attributes,r=$c().descriptionOnlyNumbers;K.exports=M({domain:t({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:r("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:S({},v.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:S({},L({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:r("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:S({},v.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:S({},L({arrayOk:!0}))}},"calc","from-root")}}),tJ=Re({"src/traces/table/defaults.js"(ae,K){var v=Rn(),S=b7(),M=af().defaults;function L(t,r){for(var a=t.columnorder||[],l=t.header.values.length,i=a.slice(0,l),s=i.slice().sort(function(p,d){return p-d}),o=i.map(function(p){return s.indexOf(p)}),c=o.length;c",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"}}}}),nJ=Re({"src/traces/table/data_preparation_helper.js"(ae,K){var v=w7(),S=Li().extendFlat,M=da(),L=ai().isTypedArray,t=ai().isArrayOrTypedArray;K.exports=function(y,g){var C=l(g.cells.values),f=function(ue){return ue.slice(g.header.values.length,ue.length)},x=l(g.header.values);x.length&&!x[0].length&&(x[0]=[""],x=l(x));var A=x.concat(f(C).map(function(){return i((x[0]||[""]).length)})),k=g.domain,I=Math.floor(y._fullLayout._size.w*(k.x[1]-k.x[0])),T=Math.floor(y._fullLayout._size.h*(k.y[1]-k.y[0])),E=g.header.values.length?A[0].map(function(){return g.header.height}):[v.emptyHeaderHeight],_=C.length?C[0].map(function(){return g.cells.height}):[],h=E.reduce(a,0),m=T-h,w=m+v.uplift,F=c(_,w),z=c(E,h),U=o(z,[]),V=o(F,U),G={},j=g._fullInput.columnorder;t(j)&&(j=Array.from(j)),j=j.concat(f(C.map(function(ue,xe){return xe})));var O=A.map(function(ue,xe){var ge=t(g.columnwidth)?g.columnwidth[Math.min(xe,g.columnwidth.length-1)]:g.columnwidth;return M(ge)?Number(ge):1}),H=O.reduce(a,0);O=O.map(function(ue){return ue/H*I});var W=Math.max(r(g.header.line.width),r(g.cells.line.width)),ee={key:g.uid+y._context.staticPlot,translateX:k.x[0]*y._fullLayout._size.w,translateY:y._fullLayout._size.h*(1-k.y[1]),size:y._fullLayout._size,width:I,maxLineWidth:W,height:T,columnOrder:j,groupHeight:T,rowBlocks:V,headerRowBlocks:U,scrollY:0,cells:S({},g.cells,{values:C}),headerCells:S({},g.header,{values:A}),gdColumns:A.map(function(ue){return ue[0]}),gdColumnsOriginalOrder:A.map(function(ue){return ue[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:A.map(function(ue,xe){var ge=G[ue];G[ue]=(ge||0)+1;var _e=ue+"__"+G[ue];return{key:_e,label:ue,specIndex:xe,xIndex:j[xe],xScale:s,x:void 0,calcdata:void 0,columnWidth:O[xe]}})};return ee.columns.forEach(function(ue){ue.calcdata=ee,ue.x=s(ue)}),ee};function r(d){if(t(d)){for(var y=0,g=0;g=y||T===d.length-1)&&(g[f]=A,A.key=I++,A.firstRowIndex=k,A.lastRowIndex=T,A=p(),f+=x,k=T+1,x=0);return g}function p(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),aJ=Re({"src/traces/table/data_split_helpers.js"(ae){var K=Li().extendFlat;ae.splitToPanels=function(S){var M=[0,0],L=K({},S,{key:"header",type:"header",page:0,prevPages:M,currentRepaint:[null,null],dragHandle:!0,values:S.calcdata.headerCells.values[S.specIndex],rowBlocks:S.calcdata.headerRowBlocks,calcdata:K({},S.calcdata,{cells:S.calcdata.headerCells})}),t=K({},S,{key:"cells1",type:"cells",page:0,prevPages:M,currentRepaint:[null,null],dragHandle:!1,values:S.calcdata.cells.values[S.specIndex],rowBlocks:S.calcdata.rowBlocks}),r=K({},S,{key:"cells2",type:"cells",page:1,prevPages:M,currentRepaint:[null,null],dragHandle:!1,values:S.calcdata.cells.values[S.specIndex],rowBlocks:S.calcdata.rowBlocks});return[t,r,L]},ae.splitToCells=function(S){var M=v(S);return(S.values||[]).slice(M[0],M[1]).map(function(L,t){var r=typeof L=="string"&&L.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:t+r,key:M[0]+t,column:S,calcdata:S.calcdata,page:S.page,rowBlocks:S.rowBlocks,value:L}})};function v(S){var M=S.rowBlocks[S.page],L=M?M.rows[0].rowIndex:0,t=M?L+M.rows.length:0;return[L,t]}}}),T7=Re({"src/traces/table/plot.js"(ae,K){var v=w7(),S=un(),M=Rn(),L=M.numberFormat,t=n_(),r=qs(),a=kc(),l=Rn().raiseToTop,i=Rn().strTranslate,s=Rn().cancelTransition,o=nJ(),c=aJ(),p=ko();K.exports=function(pe,Te){var Ne=!pe._context.staticPlot,$e=pe._fullLayout._paper.selectAll("."+v.cn.table).data(Te.map(function(vt){var Kt=t.unwrap(vt),Qt=Kt.trace;return o(pe,Qt)}),t.keyFun);$e.exit().remove(),$e.enter().append("g").classed(v.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),$e.attr("width",function(vt){return vt.width+vt.size.l+vt.size.r}).attr("height",function(vt){return vt.height+vt.size.t+vt.size.b}).attr("transform",function(vt){return i(vt.translateX,vt.translateY)});var Ze=$e.selectAll("."+v.cn.tableControlView).data(t.repeat,t.keyFun),Xe=Ze.enter().append("g").classed(v.cn.tableControlView,!0).style("box-sizing","content-box");if(Ne){var it="onwheel"in document?"wheel":"mousewheel";Xe.on("mousemove",function(vt){Ze.filter(function(Kt){return vt===Kt}).call(f,pe)}).on(it,function(vt){if(!vt.scrollbarState.wheeling){vt.scrollbarState.wheeling=!0;var Kt=vt.scrollY+S.event.deltaY,Qt=ue(pe,Ze,null,Kt)(vt);Qt||(S.event.stopPropagation(),S.event.preventDefault()),vt.scrollbarState.wheeling=!1}}).call(f,pe,!0)}Ze.attr("transform",function(vt){return i(vt.size.l,vt.size.t)});var yt=Ze.selectAll("."+v.cn.scrollBackground).data(t.repeat,t.keyFun);yt.enter().append("rect").classed(v.cn.scrollBackground,!0).attr("fill","none"),yt.attr("width",function(vt){return vt.width}).attr("height",function(vt){return vt.height}),Ze.each(function(vt){r.setClipUrl(S.select(this),y(pe,vt),pe)});var bt=Ze.selectAll("."+v.cn.yColumn).data(function(vt){return vt.columns},t.keyFun);bt.enter().append("g").classed(v.cn.yColumn,!0),bt.exit().remove(),bt.attr("transform",function(vt){return i(vt.x,0)}),Ne&&bt.call(S.behavior.drag().origin(function(vt){var Kt=S.select(this);return G(Kt,vt,-v.uplift),l(this),vt.calcdata.columnDragInProgress=!0,f(Ze.filter(function(Qt){return vt.calcdata.key===Qt.key}),pe),vt}).on("drag",function(vt){var Kt=S.select(this),Qt=function(Ur){return(vt===Ur?S.event.x:Ur.x)+Ur.columnWidth/2};vt.x=Math.max(-v.overdrag,Math.min(vt.calcdata.width+v.overdrag-vt.columnWidth,S.event.x));var fr=C(bt).filter(function(Ur){return Ur.calcdata.key===vt.calcdata.key}),mr=fr.sort(function(Ur,Br){return Qt(Ur)-Qt(Br)});mr.forEach(function(Ur,Br){Ur.xIndex=Br,Ur.x=vt===Ur?Ur.x:Ur.xScale(Ur)}),bt.filter(function(Ur){return vt!==Ur}).transition().ease(v.transitionEase).duration(v.transitionDuration).attr("transform",function(Ur){return i(Ur.x,0)}),Kt.call(s).attr("transform",i(vt.x,-v.uplift))}).on("dragend",function(vt){var Kt=S.select(this),Qt=vt.calcdata;vt.x=vt.xScale(vt),vt.calcdata.columnDragInProgress=!1,G(Kt,vt,0),U(pe,Qt,Qt.columns.map(function(fr){return fr.xIndex}))})),bt.each(function(vt){r.setClipUrl(S.select(this),g(pe,vt),pe)});var mt=bt.selectAll("."+v.cn.columnBlock).data(c.splitToPanels,t.keyFun);mt.enter().append("g").classed(v.cn.columnBlock,!0).attr("id",function(vt){return vt.key}),mt.style("cursor",function(vt){return vt.dragHandle?"ew-resize":vt.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var ht=mt.filter(O),Ve=mt.filter(j);Ne&&Ve.call(S.behavior.drag().origin(function(vt){return S.event.stopPropagation(),vt}).on("drag",ue(pe,Ze,-1)).on("dragend",function(){})),x(pe,Ze,ht,mt),x(pe,Ze,Ve,mt);var ze=Ze.selectAll("."+v.cn.scrollAreaClip).data(t.repeat,t.keyFun);ze.enter().append("clipPath").classed(v.cn.scrollAreaClip,!0).attr("id",function(vt){return y(pe,vt)});var Se=ze.selectAll("."+v.cn.scrollAreaClipRect).data(t.repeat,t.keyFun);Se.enter().append("rect").classed(v.cn.scrollAreaClipRect,!0).attr("x",-v.overdrag).attr("y",-v.uplift).attr("fill","none"),Se.attr("width",function(vt){return vt.width+2*v.overdrag}).attr("height",function(vt){return vt.height+v.uplift});var Je=bt.selectAll("."+v.cn.columnBoundary).data(t.repeat,t.keyFun);Je.enter().append("g").classed(v.cn.columnBoundary,!0);var _t=bt.selectAll("."+v.cn.columnBoundaryClippath).data(t.repeat,t.keyFun);_t.enter().append("clipPath").classed(v.cn.columnBoundaryClippath,!0),_t.attr("id",function(vt){return g(pe,vt)});var At=_t.selectAll("."+v.cn.columnBoundaryRect).data(t.repeat,t.keyFun);At.enter().append("rect").classed(v.cn.columnBoundaryRect,!0).attr("fill","none"),At.attr("width",function(vt){return vt.columnWidth+2*d(vt)}).attr("height",function(vt){return vt.calcdata.height+2*d(vt)+v.uplift}).attr("x",function(vt){return-d(vt)}).attr("y",function(vt){return-d(vt)}),ee(null,Ve,Ze)};function d(de){return Math.ceil(de.calcdata.maxLineWidth/2)}function y(de,pe){return"clip"+de._fullLayout._uid+"_scrollAreaBottomClip_"+pe.key}function g(de,pe){return"clip"+de._fullLayout._uid+"_columnBoundaryClippath_"+pe.calcdata.key+"_"+pe.specIndex}function C(de){return[].concat.apply([],de.map(function(pe){return pe})).map(function(pe){return pe.__data__})}function f(de,pe,Te){function Ne(bt){var mt=bt.rowBlocks;return ce(mt,mt.length-1)+(mt.length?ne(mt[mt.length-1],1/0):1)}var $e=de.selectAll("."+v.cn.scrollbarKit).data(t.repeat,t.keyFun);$e.enter().append("g").classed(v.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),$e.each(function(bt){var mt=bt.scrollbarState;mt.totalHeight=Ne(bt),mt.scrollableAreaHeight=bt.groupHeight-H(bt),mt.currentlyVisibleHeight=Math.min(mt.totalHeight,mt.scrollableAreaHeight),mt.ratio=mt.currentlyVisibleHeight/mt.totalHeight,mt.barLength=Math.max(mt.ratio*mt.currentlyVisibleHeight,v.goldenRatio*v.scrollbarWidth),mt.barWiggleRoom=mt.currentlyVisibleHeight-mt.barLength,mt.wiggleRoom=Math.max(0,mt.totalHeight-mt.scrollableAreaHeight),mt.topY=mt.barWiggleRoom===0?0:bt.scrollY/mt.wiggleRoom*mt.barWiggleRoom,mt.bottomY=mt.topY+mt.barLength,mt.dragMultiplier=mt.wiggleRoom/mt.barWiggleRoom}).attr("transform",function(bt){var mt=bt.width+v.scrollbarWidth/2+v.scrollbarOffset;return i(mt,H(bt))});var Ze=$e.selectAll("."+v.cn.scrollbar).data(t.repeat,t.keyFun);Ze.enter().append("g").classed(v.cn.scrollbar,!0);var Xe=Ze.selectAll("."+v.cn.scrollbarSlider).data(t.repeat,t.keyFun);Xe.enter().append("g").classed(v.cn.scrollbarSlider,!0),Xe.attr("transform",function(bt){return i(0,bt.scrollbarState.topY||0)});var it=Xe.selectAll("."+v.cn.scrollbarGlyph).data(t.repeat,t.keyFun);it.enter().append("line").classed(v.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",v.scrollbarWidth).attr("stroke-linecap","round").attr("y1",v.scrollbarWidth/2),it.attr("y2",function(bt){return bt.scrollbarState.barLength-v.scrollbarWidth/2}).attr("stroke-opacity",function(bt){return bt.columnDragInProgress||!bt.scrollbarState.barWiggleRoom||Te?0:.4}),it.transition().delay(0).duration(0),it.transition().delay(v.scrollbarHideDelay).duration(v.scrollbarHideDuration).attr("stroke-opacity",0);var yt=Ze.selectAll("."+v.cn.scrollbarCaptureZone).data(t.repeat,t.keyFun);yt.enter().append("line").classed(v.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",v.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(bt){var mt=S.event.y,ht=this.getBoundingClientRect(),Ve=bt.scrollbarState,ze=mt-ht.top,Se=S.scale.linear().domain([0,Ve.scrollableAreaHeight]).range([0,Ve.totalHeight]).clamp(!0);Ve.topY<=ze&&ze<=Ve.bottomY||ue(pe,de,null,Se(ze-Ve.barLength/2))(bt)}).call(S.behavior.drag().origin(function(bt){return S.event.stopPropagation(),bt.scrollbarState.scrollbarScrollInProgress=!0,bt}).on("drag",ue(pe,de)).on("dragend",function(){})),yt.attr("y2",function(bt){return bt.scrollbarState.scrollableAreaHeight}),pe._context.staticPlot&&(it.remove(),yt.remove())}function x(de,pe,Te,Ne){var $e=A(Te),Ze=k($e);_(Ze);var Xe=I(Ze);m(Xe);var it=E(Ze),yt=T(it);h(yt),w(yt,pe,Ne,de),se(Ze)}function A(de){var pe=de.selectAll("."+v.cn.columnCells).data(t.repeat,t.keyFun);return pe.enter().append("g").classed(v.cn.columnCells,!0),pe.exit().remove(),pe}function k(de){var pe=de.selectAll("."+v.cn.columnCell).data(c.splitToCells,function(Te){return Te.keyWithinBlock});return pe.enter().append("g").classed(v.cn.columnCell,!0),pe.exit().remove(),pe}function I(de){var pe=de.selectAll("."+v.cn.cellRect).data(t.repeat,function(Te){return Te.keyWithinBlock});return pe.enter().append("rect").classed(v.cn.cellRect,!0),pe}function T(de){var pe=de.selectAll("."+v.cn.cellText).data(t.repeat,function(Te){return Te.keyWithinBlock});return pe.enter().append("text").classed(v.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){S.event.stopPropagation()}),pe}function E(de){var pe=de.selectAll("."+v.cn.cellTextHolder).data(t.repeat,function(Te){return Te.keyWithinBlock});return pe.enter().append("g").classed(v.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),pe}function _(de){de.each(function(pe,Te){var Ne=pe.calcdata.cells.font,$e=pe.column.specIndex,Ze={size:V(Ne.size,$e,Te),color:V(Ne.color,$e,Te),family:V(Ne.family,$e,Te),weight:V(Ne.weight,$e,Te),style:V(Ne.style,$e,Te),variant:V(Ne.variant,$e,Te),textcase:V(Ne.textcase,$e,Te),lineposition:V(Ne.lineposition,$e,Te),shadow:V(Ne.shadow,$e,Te)};pe.rowNumber=pe.key,pe.align=V(pe.calcdata.cells.align,$e,Te),pe.cellBorderWidth=V(pe.calcdata.cells.line.width,$e,Te),pe.font=Ze})}function h(de){de.each(function(pe){r.font(S.select(this),pe.font)})}function m(de){de.attr("width",function(pe){return pe.column.columnWidth}).attr("stroke-width",function(pe){return pe.cellBorderWidth}).each(function(pe){var Te=S.select(this);p.stroke(Te,V(pe.calcdata.cells.line.color,pe.column.specIndex,pe.rowNumber)),p.fill(Te,V(pe.calcdata.cells.fill.color,pe.column.specIndex,pe.rowNumber))})}function w(de,pe,Te,Ne){de.text(function($e){var Ze=$e.column.specIndex,Xe=$e.rowNumber,it=$e.value,yt=typeof it=="string",bt=yt&&it.match(/
/i),mt=!yt||bt;$e.mayHaveMarkup=yt&&it.match(/[<&>]/);var ht=F(it);$e.latex=ht;var Ve=ht?"":V($e.calcdata.cells.prefix,Ze,Xe)||"",ze=ht?"":V($e.calcdata.cells.suffix,Ze,Xe)||"",Se=ht?null:V($e.calcdata.cells.format,Ze,Xe)||null,Je=Ve+(Se?L(Se)($e.value):$e.value)+ze,_t;$e.wrappingNeeded=!$e.wrapped&&!mt&&!ht&&(_t=z(Je)),$e.cellHeightMayIncrease=bt||ht||$e.mayHaveMarkup||(_t===void 0?z(Je):_t),$e.needsConvertToTspans=$e.mayHaveMarkup||$e.wrappingNeeded||$e.latex;var At;if($e.wrappingNeeded){var vt=v.wrapSplitCharacter===" "?Je.replace(/$e&&Ne.push(Ze),$e+=yt}return Ne}function ee(de,pe,Te){var Ne=C(pe)[0];if(Ne!==void 0){var $e=Ne.rowBlocks,Ze=Ne.calcdata,Xe=ce($e,$e.length),it=Ne.calcdata.groupHeight-H(Ne),yt=Ze.scrollY=Math.max(0,Math.min(Xe-it,Ze.scrollY)),bt=W($e,yt,it);bt.length===1&&(bt[0]===$e.length-1?bt.unshift(bt[0]-1):bt.push(bt[0]+1)),bt[0]%2&&bt.reverse(),pe.each(function(mt,ht){mt.page=bt[ht],mt.scrollY=yt}),pe.attr("transform",function(mt){var ht=ce(mt.rowBlocks,mt.page)-mt.scrollY;return i(0,ht)}),de&&(xe(de,Te,pe,bt,Ne.prevPages,Ne,0),xe(de,Te,pe,bt,Ne.prevPages,Ne,1),f(Te,de))}}function ue(de,pe,Te,Ne){return function(Ze){var Xe=Ze.calcdata?Ze.calcdata:Ze,it=pe.filter(function(ht){return Xe.key===ht.key}),yt=Te||Xe.scrollbarState.dragMultiplier,bt=Xe.scrollY;Xe.scrollY=Ne===void 0?Xe.scrollY+yt*S.event.dy:Ne;var mt=it.selectAll("."+v.cn.yColumn).selectAll("."+v.cn.columnBlock).filter(j);return ee(de,mt,it),Xe.scrollY===bt}}function xe(de,pe,Te,Ne,$e,Ze,Xe){var it=Ne[Xe]!==$e[Xe];it&&(clearTimeout(Ze.currentRepaint[Xe]),Ze.currentRepaint[Xe]=setTimeout(function(){var yt=Te.filter(function(bt,mt){return mt===Xe&&Ne[mt]!==$e[mt]});x(de,pe,yt,Te),$e[Xe]=Ne[Xe]}))}function ge(de,pe,Te,Ne){return function(){var Ze=S.select(pe.parentNode);Ze.each(function(Xe){var it=Xe.fragments;Ze.selectAll("tspan.line").each(function(Je,_t){it[_t].width=this.getComputedTextLength()});var yt=it[it.length-1].width,bt=it.slice(0,-1),mt=[],ht,Ve,ze=0,Se=Xe.column.columnWidth-2*v.cellPad;for(Xe.value="";bt.length;)ht=bt.shift(),Ve=ht.width+yt,ze+Ve>Se&&(Xe.value+=mt.join(v.wrapSpacer)+v.lineBreaker,mt=[],ze=0),mt.push(ht.text),ze+=Ve;ze&&(Xe.value+=mt.join(v.wrapSpacer)),Xe.wrapped=!0}),Ze.selectAll("tspan.line").remove(),w(Ze.select("."+v.cn.cellText),Te,de,Ne),S.select(pe.parentNode.parentNode).call(se)}}function _e(de,pe,Te,Ne,$e){return function(){if(!$e.settledY){var Xe=S.select(pe.parentNode),it=le($e),yt=$e.key-it.firstRowIndex,bt=it.rows[yt].rowHeight,mt=$e.cellHeightMayIncrease?pe.parentNode.getBoundingClientRect().height+2*v.cellPad:bt,ht=Math.max(mt,bt),Ve=ht-it.rows[yt].rowHeight;Ve&&(it.rows[yt].rowHeight=ht,de.selectAll("."+v.cn.columnCell).call(se),ee(null,de.filter(j),0),f(Te,Ne,!0)),Xe.attr("transform",function(){var ze=this,Se=ze.parentNode,Je=Se.getBoundingClientRect(),_t=S.select(ze.parentNode).select("."+v.cn.cellRect).node().getBoundingClientRect(),At=ze.transform.baseVal.consolidate(),vt=_t.top-Je.top+(At?At.matrix.f:v.cellPad);return i(Y($e,S.select(ze.parentNode).select("."+v.cn.cellTextHolder).node().getBoundingClientRect().width),vt)}),$e.settledY=!0}}}function Y(de,pe){switch(de.align){case"left":return v.cellPad;case"right":return de.column.columnWidth-(pe||0)-v.cellPad;case"center":return(de.column.columnWidth-(pe||0))/2;default:return v.cellPad}}function se(de){de.attr("transform",function(pe){var Te=pe.rowBlocks[0].auxiliaryBlocks.reduce(function(Xe,it){return Xe+ne(it,1/0)},0),Ne=le(pe),$e=ne(Ne,pe.key),Ze=$e+Te;return i(0,Ze)}).selectAll("."+v.cn.cellRect).attr("height",function(pe){return Z(le(pe),pe.key).rowHeight})}function ce(de,pe){for(var Te=0,Ne=pe-1;Ne>=0;Ne--)Te+=ye(de[Ne]);return Te}function ne(de,pe){for(var Te=0,Ne=0;NeL.length&&(M=M.slice(0,L.length)):M=[],r=0;r90&&(y-=180,s=-s),{angle:y,flip:s,p:S.c2p(t,M,L),offsetMultplier:o}}}}),pJ=Re({"src/traces/carpet/plot.js"(ae,K){var v=un(),S=qs(),M=A7(),L=S7(),t=dJ(),r=kc(),a=Rn(),l=a.strRotate,i=a.strTranslate,s=qd();K.exports=function(x,A,k,I){var T=x._context.staticPlot,E=A.xaxis,_=A.yaxis,h=x._fullLayout,m=h._clips;a.makeTraceGroups(I,k,"trace").each(function(w){var F=v.select(this),z=w[0],U=z.trace,V=U.aaxis,G=U.baxis,j=a.ensureSingle(F,"g","minorlayer"),O=a.ensureSingle(F,"g","majorlayer"),H=a.ensureSingle(F,"g","boundarylayer"),W=a.ensureSingle(F,"g","labellayer");F.style("opacity",U.opacity),c(E,_,O,V,"a",V._gridlines,!0),c(E,_,O,G,"b",G._gridlines,!0),c(E,_,j,V,"a",V._minorgridlines,!0),c(E,_,j,G,"b",G._minorgridlines,!0),c(E,_,H,V,"a-boundary",V._boundarylines,T),c(E,_,H,G,"b-boundary",G._boundarylines,T);var ee=p(x,E,_,U,z,W,V._labels,"a-label"),ue=p(x,E,_,U,z,W,G._labels,"b-label");d(x,W,U,z,E,_,ee,ue),o(U,z,m,E,_)})};function o(f,x,A,k,I){var T,E,_,h,m=A.select("#"+f._clipPathId);m.size()||(m=A.append("clipPath").classed("carpetclip",!0));var w=a.ensureSingle(m,"path","carpetboundary"),F=x.clipsegments,z=[];for(h=0;h0?"start":"end","data-notex":1}).call(S.font,F.font).text(F.text).call(r.convertToTspans,f),O=S.bBox(this);j.attr("transform",i(U.p[0],U.p[1])+l(U.angle)+i(F.axis.labelpadding*G,O.height*.3)),m=Math.max(m,O.width+F.axis.labelpadding)}),h.exit().remove(),w.maxExtent=m,w}function d(f,x,A,k,I,T,E,_){var h,m,w,F,z=a.aggNums(Math.min,null,A.a),U=a.aggNums(Math.max,null,A.a),V=a.aggNums(Math.min,null,A.b),G=a.aggNums(Math.max,null,A.b);h=.5*(z+U),m=V,w=A.ab2xy(h,m,!0),F=A.dxyda_rough(h,m),E.angle===void 0&&a.extendFlat(E,t(A,I,T,w,A.dxydb_rough(h,m))),C(f,x,A,k,w,F,A.aaxis,I,T,E,"a-title"),h=z,m=.5*(V+G),w=A.ab2xy(h,m,!0),F=A.dxydb_rough(h,m),_.angle===void 0&&a.extendFlat(_,t(A,I,T,w,A.dxyda_rough(h,m))),C(f,x,A,k,w,F,A.baxis,I,T,_,"b-title")}var y=s.LINE_SPACING,g=(1-s.MID_SHIFT)/y+1;function C(f,x,A,k,I,T,E,_,h,m,w){var F=[];E.title.text&&F.push(E.title.text);var z=x.selectAll("text."+w).data(F),U=m.maxExtent;z.enter().append("text").classed(w,!0),z.each(function(){var V=t(A,_,h,I,T);["start","both"].indexOf(E.showticklabels)===-1&&(U=0);var G=E.title.font.size;U+=G+E.title.offset;var j=m.angle+(m.flip<0?180:0),O=(j-V.angle+450)%360,H=O>90&&O<270,W=v.select(this);W.text(E.title.text).call(r.convertToTspans,f),H&&(U=(-r.lineCount(W)+g)*y*G-U),W.attr("transform",i(V.p[0],V.p[1])+l(V.angle)+i(0,U)).attr("text-anchor","middle").call(S.font,E.title.font)}),z.exit().remove()}}}),vJ=Re({"src/traces/carpet/cheater_basis.js"(ae,K){var v=Rn().isArrayOrTypedArray;K.exports=function(S,M,L){var t,r,a,l,i,s,o=[],c=v(S)?S.length:S,p=v(M)?M.length:M,d=v(S)?S:null,y=v(M)?M:null;d&&(a=(d.length-1)/(d[d.length-1]-d[0])/(c-1)),y&&(l=(y.length-1)/(y[y.length-1]-y[0])/(p-1));var g,C=1/0,f=-1/0;for(r=0;r=10)return null;for(var t=1/0,r=-1/0,a=M.length,l=0;l0&&(ne=L.dxydi([],ee-1,xe,0,ge),de.push(_e[0]+ne[0]/3),pe.push(_e[1]+ne[1]/3),ye=L.dxydi([],ee-1,xe,1,ge),de.push(ce[0]-ye[0]/3),pe.push(ce[1]-ye[1]/3)),de.push(ce[0]),pe.push(ce[1]),_e=ce;else for(ee=L.a2i(W),Y=Math.floor(Math.max(0,Math.min(V-2,ee))),se=ee-Y,Te.length=V,Te.crossLength=G,Te.xy=function(Ne){return L.evalxy([],ee,Ne)},Te.dxy=function(Ne,$e){return L.dxydj([],Y,Ne,se,$e)},ue=0;ue0&&(le=L.dxydj([],Y,ue-1,se,0),de.push(_e[0]+le[0]/3),pe.push(_e[1]+le[1]/3),Z=L.dxydj([],Y,ue-1,se,1),de.push(ce[0]-Z[0]/3),pe.push(ce[1]-Z[1]/3)),de.push(ce[0]),pe.push(ce[1]),_e=ce;return Te.axisLetter=t,Te.axis=I,Te.crossAxis=m,Te.value=W,Te.constvar=r,Te.index=d,Te.x=de,Te.y=pe,Te.smoothing=m.smoothing,Te}function H(W){var ee,ue,xe,ge,_e,Y=[],se=[],ce={};if(ce.length=k.length,ce.crossLength=h.length,t==="b")for(xe=Math.max(0,Math.min(G-2,W)),_e=Math.min(1,Math.max(0,W-xe)),ce.xy=function(ne){return L.evalxy([],ne,W)},ce.dxy=function(ne,ye){return L.dxydi([],ne,xe,ye,_e)},ee=0;eek.length-1)&&T.push(S(H(l),{color:I.gridcolor,width:I.gridwidth,dash:I.griddash}));for(d=c;dk.length-1)&&!(C<0||C>k.length-1))for(f=k[i],x=k[C],a=0;ak[k.length-1])&&E.push(S(O(g),{color:I.minorgridcolor,width:I.minorgridwidth,dash:I.minorgriddash})));I.startline&&_.push(S(H(0),{color:I.startlinecolor,width:I.startlinewidth})),I.endline&&_.push(S(H(k.length-1),{color:I.endlinecolor,width:I.endlinewidth}))}else{for(s=5e-15,o=[Math.floor((k[k.length-1]-I.tick0)/I.dtick*(1+s)),Math.ceil((k[0]-I.tick0)/I.dtick/(1+s))].sort(function(W,ee){return W-ee}),c=o[0],p=o[1],d=c;d<=p;d++)y=I.tick0+I.dtick*d,T.push(S(O(y),{color:I.gridcolor,width:I.gridwidth,dash:I.griddash}));for(d=c-1;dk[k.length-1])&&E.push(S(O(g),{color:I.minorgridcolor,width:I.minorgridwidth,dash:I.minorgriddash}));I.startline&&_.push(S(O(k[0]),{color:I.startlinecolor,width:I.startlinewidth})),I.endline&&_.push(S(O(k[k.length-1]),{color:I.endlinecolor,width:I.endlinewidth}))}}}}),yJ=Re({"src/traces/carpet/calc_labels.js"(ae,K){var v=js(),S=Li().extendFlat;K.exports=function(L,t){var r,a,l,i,s,o=t._labels=[],c=t._gridlines;for(r=0;r=0;r--)a[c-r]=S[p][r],l[c-r]=M[p][r];for(i.push({x:a,y:l,bicubic:s}),r=p,a=[],l=[];r>=0;r--)a[p-r]=S[r][0],l[p-r]=M[r][0];return i.push({x:a,y:l,bicubic:o}),i}}}),xJ=Re({"src/traces/carpet/smooth_fill_2d_array.js"(ae,K){var v=Rn();K.exports=function(M,L,t){var r,a,l,i=[],s=[],o=M[0].length,c=M.length;function p(ue,xe){var ge=0,_e,Y=0;return ue>0&&(_e=M[xe][ue-1])!==void 0&&(Y++,ge+=_e),ue0&&(_e=M[xe-1][ue])!==void 0&&(Y++,ge+=_e),xe0&&a0&&rh);return v.log("Smoother converged to",m,"after",F,"iterations"),M}}}),bJ=Re({"src/traces/carpet/constants.js"(ae,K){K.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),wJ=Re({"src/traces/carpet/catmull_rom.js"(ae,K){var v=.5;K.exports=function(M,L,t,r){var a=M[0]-L[0],l=M[1]-L[1],i=t[0]-L[0],s=t[1]-L[1],o=Math.pow(a*a+l*l,v/2),c=Math.pow(i*i+s*s,v/2),p=(c*c*a-o*o*i)*r,d=(c*c*l-o*o*s)*r,y=c*(o+c)*3,g=o*(o+c)*3;return[[L[0]+(y&&p/y),L[1]+(y&&d/y)],[L[0]-(g&&p/g),L[1]-(g&&d/g)]]}}}),TJ=Re({"src/traces/carpet/compute_control_points.js"(ae,K){var v=wJ(),S=Rn().ensureArray;function M(L,t,r){var a=-.5*r[0]+1.5*t[0],l=-.5*r[1]+1.5*t[1];return[(2*a+L[0])/3,(2*l+L[1])/3]}K.exports=function(t,r,a,l,i,s){var o,c,p,d,y,g,C,f,x,A,k=a[0].length,I=a.length,T=i?3*k-2:k,E=s?3*I-2:I;for(t=S(t,E),r=S(r,E),p=0;py&&TC&&Eg||Ef},l.setScale=function(){var T=l._x,E=l._y,_=M(l._xctrl,l._yctrl,T,E,p.smoothing,d.smoothing);l._xctrl=_[0],l._yctrl=_[1],l.evalxy=L([l._xctrl,l._yctrl],o,c,p.smoothing,d.smoothing),l.dxydi=t([l._xctrl,l._yctrl],p.smoothing,d.smoothing),l.dxydj=r([l._xctrl,l._yctrl],p.smoothing,d.smoothing)},l.i2a=function(T){var E=Math.max(0,Math.floor(T[0]),o-2),_=T[0]-E;return(1-_)*i[E]+_*i[E+1]},l.j2b=function(T){var E=Math.max(0,Math.floor(T[1]),o-2),_=T[1]-E;return(1-_)*s[E]+_*s[E+1]},l.ij2ab=function(T){return[l.i2a(T[0]),l.j2b(T[1])]},l.a2i=function(T){var E=Math.max(0,Math.min(S(T,i),o-2)),_=i[E],h=i[E+1];return Math.max(0,Math.min(o-1,E+(T-_)/(h-_)))},l.b2j=function(T){var E=Math.max(0,Math.min(S(T,s),c-2)),_=s[E],h=s[E+1];return Math.max(0,Math.min(c-1,E+(T-_)/(h-_)))},l.ab2ij=function(T){return[l.a2i(T[0]),l.b2j(T[1])]},l.i2c=function(T,E){return l.evalxy([],T,E)},l.ab2xy=function(T,E,_){if(!_&&(Ti[o-1]|Es[c-1]))return[!1,!1];var h=l.a2i(T),m=l.b2j(E),w=l.evalxy([],h,m);if(_){var F=0,z=0,U=[],V,G,j,O;Ti[o-1]?(V=o-2,G=1,F=(T-i[o-1])/(i[o-1]-i[o-2])):(V=Math.max(0,Math.min(o-2,Math.floor(h))),G=h-V),Es[c-1]?(j=c-2,O=1,z=(E-s[c-1])/(s[c-1]-s[c-2])):(j=Math.max(0,Math.min(c-2,Math.floor(m))),O=m-j),F&&(l.dxydi(U,V,j,G,O),w[0]+=U[0]*F,w[1]+=U[1]*F),z&&(l.dxydj(U,V,j,G,O),w[0]+=U[0]*z,w[1]+=U[1]*z)}return w},l.c2p=function(T,E,_){return[E.c2p(T[0]),_.c2p(T[1])]},l.p2x=function(T,E,_){return[E.p2c(T[0]),_.p2c(T[1])]},l.dadi=function(T){var E=Math.max(0,Math.min(i.length-2,T));return i[E+1]-i[E]},l.dbdj=function(T){var E=Math.max(0,Math.min(s.length-2,T));return s[E+1]-s[E]},l.dxyda=function(T,E,_,h){var m=l.dxydi(null,T,E,_,h),w=l.dadi(T,_);return[m[0]/w,m[1]/w]},l.dxydb=function(T,E,_,h){var m=l.dxydj(null,T,E,_,h),w=l.dbdj(E,h);return[m[0]/w,m[1]/w]},l.dxyda_rough=function(T,E,_){var h=x*(_||.1),m=l.ab2xy(T+h,E,!0),w=l.ab2xy(T-h,E,!0);return[(m[0]-w[0])*.5/h,(m[1]-w[1])*.5/h]},l.dxydb_rough=function(T,E,_){var h=A*(_||.1),m=l.ab2xy(T,E+h,!0),w=l.ab2xy(T,E-h,!0);return[(m[0]-w[0])*.5/h,(m[1]-w[1])*.5/h]},l.dpdx=function(T){return T._m},l.dpdy=function(T){return T._m}}}}),kJ=Re({"src/traces/carpet/calc.js"(ae,K){var v=js(),S=Rn().isArray1D,M=vJ(),L=mJ(),t=gJ(),r=yJ(),a=_J(),l=S3(),i=xJ(),s=A3(),o=CJ();K.exports=function(p,d){var y=v.getFromId(p,d.xaxis),g=v.getFromId(p,d.yaxis),C=d.aaxis,f=d.baxis,x=d.x,A=d.y,k=[];x&&S(x)&&k.push("x"),A&&S(A)&&k.push("y"),k.length&&s(d,C,f,"a","b",k);var I=d._a=d._a||d.a,T=d._b=d._b||d.b;x=d._x||d.x,A=d._y||d.y;var E={};if(d._cheater){var _=C.cheatertype==="index"?I.length:I,h=f.cheatertype==="index"?T.length:T;x=M(_,h,d.cheaterslope)}d._x=x=l(x),d._y=A=l(A),i(x,I,T),i(A,I,T),o(d),d.setScale();var m=L(x),w=L(A),F=.5*(m[1]-m[0]),z=.5*(m[1]+m[0]),U=.5*(w[1]-w[0]),V=.5*(w[1]+w[0]),G=1.3;return m=[z-F*G,z+F*G],w=[V-U*G,V+U*G],d._extremes[y._id]=v.findExtremes(y,m,{padded:!0}),d._extremes[g._id]=v.findExtremes(g,w,{padded:!0}),t(d,"a","b"),t(d,"b","a"),r(d,C),r(d,f),E.clipsegments=a(d._xctrl,d._yctrl,C,f),E.x=x,E.y=A,E.a=I,E.b=T,[E]}}}),MJ=Re({"src/traces/carpet/index.js"(ae,K){K.exports={attributes:QP(),supplyDefaults:hJ(),plot:pJ(),calc:kJ(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:td(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),IJ=Re({"lib/carpet.js"(ae,K){K.exports=MJ()}}),E7=Re({"src/traces/scattercarpet/attributes.js"(ae,K){var v=hv(),S=wf(),M=As(),{hovertemplateAttrs:L,texttemplateAttrs:t,templatefallbackAttrs:r}=Wl(),a=ac(),l=Li().extendFlat,i=S.marker,s=S.line,o=i.line;K.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},S.mode,{dflt:"markers"}),text:l({},S.text,{}),texttemplate:t({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:r({editType:"plot"}),hovertext:l({},S.hovertext,{}),line:{color:s.color,width:s.width,dash:s.dash,backoff:s.backoff,shape:l({},s.shape,{values:["linear","spline"]}),smoothing:s.smoothing,editType:"calc"},connectgaps:S.connectgaps,fill:l({},S.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:v(),marker:l({symbol:i.symbol,opacity:i.opacity,maxdisplayed:i.maxdisplayed,angle:i.angle,angleref:i.angleref,standoff:i.standoff,size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,line:l({width:o.width,editType:"calc"},a("marker.line")),gradient:i.gradient,editType:"calc"},a("marker")),textfont:S.textfont,textposition:S.textposition,selected:S.selected,unselected:S.unselected,hoverinfo:l({},M.hoverinfo,{flags:["a","b","text","name"]}),hoveron:S.hoveron,hovertemplate:L(),hovertemplatefallback:r(),zorder:S.zorder}}}),LJ=Re({"src/traces/scattercarpet/defaults.js"(ae,K){var v=Rn(),S=Wg(),M=Mu(),L=Yp(),t=xg(),r=Zp(),a=Sm(),l=Rp(),i=E7();K.exports=function(o,c,p,d){function y(I,T){return v.coerce(o,c,i,I,T)}y("carpet"),c.xaxis="x",c.yaxis="y";var g=y("a"),C=y("b"),f=Math.min(g.length,C.length);if(!f){c.visible=!1;return}c._length=f,y("text"),y("texttemplate"),y("texttemplatefallback"),y("hovertext");var x=f0?E=I.labelprefix.replace(/ = $/,""):E=I._hovertitle,f.push(E+": "+T.toFixed(3)+I.labelsuffix)}if(!y.hovertemplate){var A=d.hi||y.hoverinfo,k=A.split("+");k.indexOf("all")!==-1&&(k=["a","b","text"]),k.indexOf("a")!==-1&&x(g.aaxis,d.a),k.indexOf("b")!==-1&&x(g.baxis,d.b),f.push("y: "+i.yLabel),k.indexOf("text")!==-1&&S(d,y,f),i.extraText=f.join("
")}return l}}}),NJ=Re({"src/traces/scattercarpet/event_data.js"(ae,K){K.exports=function(S,M,L,t,r){var a=t[r];return S.a=a.a,S.b=a.b,S.y=a.y,S}}}),OJ=Re({"src/traces/scattercarpet/index.js"(ae,K){K.exports={attributes:E7(),supplyDefaults:LJ(),colorbar:Eh(),formatLabels:RJ(),calc:DJ(),plot:PJ(),style:md().style,styleOnSelect:md().styleOnSelect,hoverPoints:zJ(),selectPoints:M1(),eventData:NJ(),moduleType:"trace",name:"scattercarpet",basePlotModule:td(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),FJ=Re({"lib/scattercarpet.js"(ae,K){K.exports=OJ()}}),C7=Re({"src/traces/contourcarpet/attributes.js"(ae,K){var v=pp(),S=ew(),M=ac(),L=Li().extendFlat,t=S.contours;K.exports=L({carpet:{valType:"string",editType:"calc"},z:v.z,a:v.x,a0:v.x0,da:v.dx,b:v.y,b0:v.y0,db:v.dy,text:v.text,hovertext:v.hovertext,transpose:v.transpose,atype:v.xtype,btype:v.ytype,fillcolor:S.fillcolor,autocontour:S.autocontour,ncontours:S.ncontours,contours:{type:t.type,start:t.start,end:t.end,size:t.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:t.showlines,showlabels:t.showlabels,labelfont:t.labelfont,labelformat:t.labelformat,operation:t.operation,value:t.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:S.line.color,width:S.line.width,dash:S.line.dash,smoothing:S.line.smoothing,editType:"plot"},zorder:S.zorder},M("",{cLetter:"z",autoColorDflt:!1}))}}),k7=Re({"src/traces/contourcarpet/defaults.js"(ae,K){var v=Rn(),S=nd(),M=C7(),L=QS(),t=B3(),r=tw();K.exports=function(l,i,s,o){function c(g,C){return v.coerce(l,i,M,g,C)}function p(g){return v.coerce2(l,i,M,g)}if(c("carpet"),l.a&&l.b){var d=S(l,i,c,o,"a","b");if(!d){i.visible=!1;return}c("text");var y=c("contours.type")==="constraint";y?L(l,i,c,o,s,{hasHover:!1}):(t(l,i,c,p),r(l,i,c,o,{hasHover:!1}))}else i._defaultColor=s,i._length=null;c("zorder")}}}),BJ=Re({"src/traces/contourcarpet/calc.js"(ae,K){var v=hp(),S=Rn(),M=A3(),L=S3(),t=E3(),r=C3(),a=qS(),l=k7(),i=e4(),s=YS();K.exports=function(p,d){var y=d._carpetTrace=i(p,d);if(!(!y||!y.visible||y.visible==="legendonly")){if(!d.a||!d.b){var g=p.data[y.index],C=p.data[d.index];C.a||(C.a=g.a),C.b||(C.b=g.b),l(C,d,d._defaultColor,p._fullLayout)}var f=o(p,d);return s(d,d._z),f}};function o(c,p){var d=p._carpetTrace,y=d.aaxis,g=d.baxis,C,f,x,A,k,I,T;y._minDtick=0,g._minDtick=0,S.isArray1D(p.z)&&M(p,y,g,"a","b",["z"]),C=p._a=p._a||p.a,A=p._b=p._b||p.b,C=C?y.makeCalcdata(p,"_a"):[],A=A?g.makeCalcdata(p,"_b"):[],f=p.a0||0,x=p.da||1,k=p.b0||0,I=p.db||1,T=p._z=L(p._z||p.z,p.transpose),p._emptypoints=r(T),t(T,p._emptypoints);var E=S.maxRowLength(T),_=p.xtype==="scaled"?"":C,h=a(p,_,f,x,E,y),m=p.ytype==="scaled"?"":A,w=a(p,m,k,I,T.length,g),F={a:h,b:w,z:T};return p.contours.type==="levels"&&p.contours.coloring!=="none"&&v(c,p,{vals:T,containerStr:"",cLetter:"z"}),[F]}}}),UJ=Re({"src/traces/carpet/axis_aligned_line.js"(ae,K){var v=Rn().isArrayOrTypedArray;K.exports=function(S,M,L,t){var r,a,l,i,s,o,c,p,d,y,g,C,f,x=v(L)?"a":"b",A=x==="a"?S.aaxis:S.baxis,k=A.smoothing,I=x==="a"?S.a2i:S.b2j,T=x==="a"?L:t,E=x==="a"?t:L,_=x==="a"?M.a.length:M.b.length,h=x==="a"?M.b.length:M.a.length,m=Math.floor(x==="a"?S.b2j(E):S.a2i(E)),w=x==="a"?function(xe){return S.evalxy([],xe,m)}:function(xe){return S.evalxy([],m,xe)};k&&(l=Math.max(0,Math.min(h-2,m)),i=m-l,a=x==="a"?function(xe,ge){return S.dxydi([],xe,l,ge,i)}:function(xe,ge){return S.dxydj([],l,xe,i,ge)});var F=I(T[0]),z=I(T[1]),U=F0?Math.floor:Math.ceil,j=U>0?Math.ceil:Math.floor,O=U>0?Math.min:Math.max,H=U>0?Math.max:Math.min,W=G(F+V),ee=j(z-V);c=w(F);var ue=[[c]];for(r=W;r*U=0;Te--)Z=H.clipsegments[Te],de=S([],Z.x,F.c2p),pe=S([],Z.y,z.c2p),de.reverse(),pe.reverse(),Ne.push(M(de,pe,Z.bicubic));var $e="M"+Ne.join("L")+"Z";k(V,H.clipsegments,F,z,ge,Y),I(j,V,F,z,le,ce,se,O,H,Y,$e),g(V,xe,_,G,ue,h,O),L.setClipUrl(V,O._clipPathId,_)})};function y(E,_){var h,m,w,F,z,U,V,G,j;for(h=0;hxe&&(m.max=xe),m.len=m.max-m.min}function f(E,_,h){var m=E.getPointAtLength(_),w=E.getPointAtLength(h),F=w.x-m.x,z=w.y-m.y,U=Math.sqrt(F*F+z*z);return[F/U,z/U]}function x(E){var _=Math.sqrt(E[0]*E[0]+E[1]*E[1]);return[E[0]/_,E[1]/_]}function A(E,_){var h=Math.abs(E[0]*_[0]+E[1]*_[1]),m=Math.sqrt(1-h*h);return m/h}function k(E,_,h,m,w,F){var z,U,V,G,j=t.ensureSingle(E,"g","contourbg"),O=j.selectAll("path").data(F==="fill"&&!w?[0]:[]);O.enter().append("path"),O.exit().remove();var H=[];for(G=0;G<_.length;G++)z=_[G],U=S([],z.x,h.c2p),V=S([],z.y,m.c2p),H.push(M(U,V,z.bicubic));O.attr("d","M"+H.join("L")+"Z").style("stroke","none")}function I(E,_,h,m,w,F,z,U,V,G,j){var O=G==="fill";O&&c(w,E.contours);var H=t.ensureSingle(_,"g","contourfill"),W=H.selectAll("path").data(O?w:[]);W.enter().append("path"),W.exit().remove(),W.each(function(ee){var ue=(ee.prefixBoundary?j:"")+T(E,ee,F,z,U,V,h,m);ue?v.select(this).attr("d",ue).style("stroke","none"):v.select(this).remove()})}function T(E,_,h,m,w,F,z,U){var V,G="",j=_.edgepaths.map(function(pe,Te){return Te}),O=!0,H,W,ee,ue,xe,ge,_e=Math.abs(h[0][0]-h[2][0])*1e-4,Y=Math.abs(h[0][1]-h[2][1])*1e-4;function se(pe){return Math.abs(pe[1]-h[0][1])=0&&(W=de,ue=xe):Math.abs(H[1]-W[1])=0&&(W=de,ue=xe):t.log("endpt to newendpt is not vert. or horz.",H,W,de)}if(ue>=0)break;G+=le(H,W),H=W}if(ue===_.edgepaths.length){t.log("unclosed perimeter path");break}V=ue,O=j.indexOf(V)===-1,O&&(V=j[0],G+=le(H,W)+"Z",H=null)}for(V=0;V<_.paths.length;V++)G+=L.smoothclosed(_.paths[V].map(m),_.smoothing);return G}}}),VJ=Re({"src/traces/contourcarpet/index.js"(ae,K){K.exports={attributes:C7(),supplyDefaults:k7(),colorbar:tx(),calc:BJ(),plot:$J(),style:nw(),moduleType:"trace",name:"contourcarpet",basePlotModule:td(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}}),jJ=Re({"lib/contourcarpet.js"(ae,K){K.exports=VJ()}}),t4=Re({"src/traces/ohlc/attributes.js"(ae,K){var v=Rn().extendFlat,S=wf(),M=$c().axisHoverFormat,{hovertemplateAttrs:L,templatefallbackAttrs:t}=Wl(),r=up().dash,a=ou(),l=rx(),i=l.INCREASING.COLOR,s=l.DECREASING.COLOR,o=S.line;function c(p){return{line:{color:v({},o.color,{dflt:p}),width:o.width,dash:r,editType:"style"},editType:"style"}}K.exports={xperiod:S.xperiod,xperiod0:S.xperiod0,xperiodalignment:S.xperiodalignment,xhoverformat:M("x"),yhoverformat:M("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:v({},o.width,{}),dash:v({},r,{}),editType:"style"},increasing:c(i),decreasing:c(s),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:L({},{keys:["open","high","low","close"]}),hovertemplatefallback:t(),tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:v({},a.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:S.zorder}}}),M7=Re({"src/traces/ohlc/ohlc_defaults.js"(ae,K){var v=es(),S=Rn();K.exports=function(L,t,r,a){var l=r("x"),i=r("open"),s=r("high"),o=r("low"),c=r("close");r("hoverlabel.split");var p=v.getComponentMethod("calendars","handleTraceDefaults");if(p(L,t,["x"],a),!!(i&&s&&o&&c)){var d=Math.min(i.length,s.length,o.length,c.length);return l&&(d=Math.min(d,S.minRowLength(l))),t._length=d,d}}}}),GJ=Re({"src/traces/ohlc/defaults.js"(ae,K){var v=Rn(),S=M7(),M=_g(),L=t4();K.exports=function(a,l,i,s){function o(p,d){return v.coerce(a,l,L,p,d)}var c=S(a,l,o,s);if(!c){l.visible=!1;return}M(a,l,s,o,{x:!0}),o("xhoverformat"),o("yhoverformat"),o("line.width"),o("line.dash"),t(a,l,o,"increasing"),t(a,l,o,"decreasing"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),o("tickwidth"),s._requestRangeslider[l.xaxis]=!0,o("zorder")};function t(r,a,l,i){l(i+".line.color"),l(i+".line.width",a.line.width),l(i+".line.dash",a.line.dash)}}}),I7=Re({"src/traces/ohlc/calc.js"(ae,K){var v=Rn(),S=v._,M=js(),L=bg(),t=Ia().BADNUM;function r(s,o){var c=M.getFromId(s,o.xaxis),p=M.getFromId(s,o.yaxis),d=i(s,c,o),y=o._minDiff;o._minDiff=null;var g=o._origX;o._origX=null;var C=o._xcalc;o._xcalc=null;var f=l(s,o,g,C,p,a);return o._extremes[c._id]=M.findExtremes(c,C,{vpad:y/2}),f.length?(v.extendFlat(f[0].t,{wHover:y/2,tickLen:d}),f):[{t:{empty:!0}}]}function a(s,o,c,p){return{o:s,h:o,l:c,c:p}}function l(s,o,c,p,d,y){for(var g=d.makeCalcdata(o,"open"),C=d.makeCalcdata(o,"high"),f=d.makeCalcdata(o,"low"),x=d.makeCalcdata(o,"close"),A=v.isArrayOrTypedArray(o.text),k=v.isArrayOrTypedArray(o.hovertext),I=!0,T=null,E=!!o.xperiodalignment,_=[],h=0;hT):I=U>w,T=U;var V=y(w,F,z,U);V.pos=m,V.yc=(w+U)/2,V.i=h,V.dir=I?"increasing":"decreasing",V.x=V.pos,V.y=[z,F],E&&(V.orig_p=c[h]),A&&(V.tx=o.text[h]),k&&(V.htx=o.hovertext[h]),_.push(V)}else _.push({pos:m,empty:!0})}return o._extremes[d._id]=M.findExtremes(d,v.concat(f,C),{padded:!0}),_.length&&(_[0].t={labels:{open:S(s,"open:")+" ",high:S(s,"high:")+" ",low:S(s,"low:")+" ",close:S(s,"close:")+" "}}),_}function i(s,o,c){var p=c._minDiff;if(!p){var d=s._fullData,y=[];p=1/0;var g;for(g=0;g"+x.labels[m]+v.hoverLabelText(C,w,f.yhoverformat)):(z=S.extendFlat({},k),z.y0=z.y1=F,z.yLabelVal=w,z.yLabel=x.labels[m]+v.hoverLabelText(C,w,f.yhoverformat),z.name="",A.push(z),_[w]=z)}return A}function o(c,p,d,y){var g=c.cd,C=c.ya,f=g[0].trace,x=g[0].t,A=i(c,p,d,y);if(!A)return[];var k=A.index,I=g[k],T=A.index=I.i,E=I.dir;function _(V){return x.labels[V]+v.hoverLabelText(C,f[V][T],f.yhoverformat)}var h=I.hi||f.hoverinfo||"",m=h.split("+"),w=h==="all",F=w||m.indexOf("y")!==-1,z=w||m.indexOf("text")!==-1,U=F?[_("open"),_("high"),_("low"),_("close")+" "+a[E]]:[];return z&&t(I,f,U),A.extraText=U.join("
"),A.y0=A.y1=C.c2p(I.yc,!0),[A]}K.exports={hoverPoints:l,hoverSplit:s,hoverOnPoints:o}}}),R7=Re({"src/traces/ohlc/select.js"(ae,K){K.exports=function(S,M){var L=S.cd,t=S.xaxis,r=S.yaxis,a=[],l,i=L[0].t.bPos||0;if(M===!1)for(l=0;lp?function(f){return f<=0}:function(f){return f>=0};i.c2g=function(f){var x=i.c2l(f)-c;return(C(x)?x:0)+g},i.g2c=function(f){return i.l2c(f+c-g)},i.g2p=function(f){return f*y},i.c2p=function(f){return i.g2p(i.c2g(f))}}}function r(i,s){return s==="degrees"?M(i):i}function a(i,s){return s==="degrees"?L(i):i}function l(i,s){var o=i.type;if(o==="linear"){var c=i.d2c,p=i.c2d;i.d2c=function(d,y){return r(c(d),y)},i.c2d=function(d,y){return p(a(d,y))}}i.makeCalcdata=function(d,y){var g=d[y],C=d._length,f,x,A=function(_){return i.d2c(_,d.thetaunit)};if(g)for(f=new Array(C),x=0;x0?_:1/0},I=M(A,k),T=v.mod(I+1,A.length);return[A[I],A[T]]}function y(x){return Math.abs(x)>1e-10?x:0}function g(x,A,k){A=A||0,k=k||0;for(var I=x.length,T=new Array(I),E=0;E0?1:0}function S(a){var l=a[0],i=a[1];if(!isFinite(l)||!isFinite(i))return[1,0];var s=(l+1)*(l+1)+i*i;return[(l*l+i*i-1)/s,2*i/s]}function M(a,l){var i=l[0],s=l[1];return[i*a.radius+a.cx,-s*a.radius+a.cy]}function L(a,l){return l*a.radius}function t(a,l,i,s){var o=M(a,S([i,l])),c=o[0],p=o[1],d=M(a,S([s,l])),y=d[0],g=d[1];if(l===0)return["M"+c+","+p,"L"+y+","+g].join(" ");var C=L(a,1/Math.abs(l));return["M"+c+","+p,"A"+C+","+C+" 0 0,"+(l<0?1:0)+" "+y+","+g].join(" ")}function r(a,l,i,s){var o=L(a,1/(l+1)),c=M(a,S([l,i])),p=c[0],d=c[1],y=M(a,S([l,s])),g=y[0],C=y[1];if(v(i)!==v(s)){var f=M(a,S([l,0])),x=f[0],A=f[1];return["M"+p+","+d,"A"+o+","+o+" 0 0,"+(0yt?(bt=pe,mt=pe*yt,ze=(Te-mt)/ne.h/2,ht=[Z[0],Z[1]],Ve=[de[0]+ze,de[1]-ze]):(bt=Te/yt,mt=Te,ze=(pe-bt)/ne.w/2,ht=[Z[0]+ze,Z[1]-ze],Ve=[de[0],de[1]]),se.xLength2=bt,se.yLength2=mt,se.xDomain2=ht,se.yDomain2=Ve;var Se=se.xOffset2=ne.l+ne.w*ht[0],Je=se.yOffset2=ne.t+ne.h*(1-Ve[1]),_t=se.radius=bt/Ze,At=se.innerRadius=se.getHole(Y)*_t,vt=se.cx=Se-_t*$e[0],Kt=se.cy=Je+_t*$e[3],Qt=se.cxx=vt-Se,fr=se.cyy=Kt-Je,mr=ye.side,Ur;mr==="counterclockwise"?(Ur=mr,mr="top"):mr==="clockwise"&&(Ur=mr,mr="bottom"),se.radialAxis=se.mockAxis(_e,Y,ye,{_id:"x",side:mr,_trueSide:Ur,domain:[At/ne.w,_t/ne.w]}),se.angularAxis=se.mockAxis(_e,Y,le,{side:"right",domain:[0,Math.PI],autorange:!1}),se.doAutoRange(_e,Y),se.updateAngularAxis(_e,Y),se.updateRadialAxis(_e,Y),se.updateRadialAxisTitle(_e,Y),se.xaxis=se.mockCartesianAxis(_e,Y,{_id:"x",domain:ht}),se.yaxis=se.mockCartesianAxis(_e,Y,{_id:"y",domain:Ve});var Br=se.pathSubplot();se.clipPaths.forTraces.select("path").attr("d",Br).attr("transform",r(Qt,fr)),ce.frontplot.attr("transform",r(Se,Je)).call(l.setClipUrl,se._hasClipOnAxisFalse?null:se.clipIds.forTraces,se.gd),ce.bg.attr("d",Br).attr("transform",r(vt,Kt)).call(a.fill,Y.bgcolor)},W.mockAxis=function(_e,Y,se,ce){var ne=L.extendFlat({},se,ce);return c(ne,Y,_e),ne},W.mockCartesianAxis=function(_e,Y,se){var ce=this,ne=ce.isSmith,ye=se._id,le=L.extendFlat({type:"linear"},se);o(le,_e);var Z={x:[0,2],y:[1,3]};return le.setRange=function(){var de=ce.sectorBBox,pe=Z[ye],Te=ce.radialAxis._rl,Ne=(Te[1]-Te[0])/(1-ce.getHole(Y));le.range=[de[pe[0]]*Ne,de[pe[1]]*Ne]},le.isPtWithinRange=ye==="x"&&!ne?function(de){return ce.isPtInside(de)}:function(){return!0},le.setRange(),le.setScale(),le},W.doAutoRange=function(_e,Y){var se=this,ce=se.gd,ne=se.radialAxis,ye=se.getRadial(Y);p(ce,ne);var le=ne.range;if(ye.range=le.slice(),ye._input.range=le.slice(),ne._rl=[ne.r2l(le[0],null,"gregorian"),ne.r2l(le[1],null,"gregorian")],ne.minallowed!==void 0){var Z=ne.r2l(ne.minallowed);ne._rl[0]>ne._rl[1]?ne._rl[1]=Math.max(ne._rl[1],Z):ne._rl[0]=Math.max(ne._rl[0],Z)}if(ne.maxallowed!==void 0){var de=ne.r2l(ne.maxallowed);ne._rl[0]90&&Te<=270&&(Ne.tickangle=180);var Xe=Ze?function(_t){var At=U(se,w([_t.x,0]));return r(At[0]-Z,At[1]-de)}:function(_t){return r(Ne.l2p(_t.x)+le,0)},it=Ze?function(_t){return z(se,_t.x,-1/0,1/0)}:function(_t){return se.pathArc(Ne.r2p(_t.x)+le)},yt=ee(pe);if(se.radialTickLayout!==yt&&(ne["radial-axis"].selectAll(".xtick").remove(),se.radialTickLayout=yt),$e){Ne.setScale();var bt=0,mt=Ze?(Ne.tickvals||[]).filter(function(_t){return _t>=0}).map(function(_t){return s.tickText(Ne,_t,!0,!1)}):s.calcTicks(Ne),ht=Ze?mt:s.clipEnds(Ne,mt),Ve=s.getTickSigns(Ne)[2];Ze&&((Ne.ticks==="top"&&Ne.side==="bottom"||Ne.ticks==="bottom"&&Ne.side==="top")&&(Ve=-Ve),Ne.ticks==="top"&&Ne.side==="top"&&(bt=-Ne.ticklen),Ne.ticks==="bottom"&&Ne.side==="bottom"&&(bt=Ne.ticklen)),s.drawTicks(ce,Ne,{vals:mt,layer:ne["radial-axis"],path:s.makeTickPath(Ne,0,Ve),transFn:Xe,crisp:!1}),s.drawGrid(ce,Ne,{vals:ht,layer:ne["radial-grid"],path:it,transFn:L.noop,crisp:!1}),s.drawLabels(ce,Ne,{vals:mt,layer:ne["radial-axis"],transFn:Xe,labelFns:s.makeLabelFns(Ne,bt)})}var ze=se.radialAxisAngle=se.vangles?O(xe(j(pe.angle),se.vangles)):pe.angle,Se=r(Z,de),Je=Se+t(-ze);ge(ne["radial-axis"],$e&&(pe.showticklabels||pe.ticks),{transform:Je}),ge(ne["radial-grid"],$e&&pe.showgrid,{transform:Ze?"":Se}),ge(ne["radial-line"].select("line"),$e&&pe.showline,{x1:Ze?-ye:le,y1:0,x2:ye,y2:0,transform:Je}).attr("stroke-width",pe.linewidth).call(a.stroke,pe.linecolor)},W.updateRadialAxisTitle=function(_e,Y,se){if(!this.isSmith){var ce=this,ne=ce.gd,ye=ce.radius,le=ce.cx,Z=ce.cy,de=ce.getRadial(Y),pe=ce.id+"title",Te=0;if(de.title){var Ne=l.bBox(ce.layers["radial-axis"].node()).height,$e=de.title.font.size,Ze=de.side;Te=Ze==="top"?$e:Ze==="counterclockwise"?-(Ne+$e*.4):Ne+$e*.8}var Xe=se!==void 0?se:ce.radialAxisAngle,it=j(Xe),yt=Math.cos(it),bt=Math.sin(it),mt=le+ye/2*yt+Te*bt,ht=Z-ye/2*bt+Te*yt;ce.layers["radial-axis-title"]=C.draw(ne,pe,{propContainer:de,propName:ce.id+".radialaxis.title.text",placeholder:V(ne,"Click to enter radial axis title"),attributes:{x:mt,y:ht,"text-anchor":"middle"},transform:{rotate:-Xe}})}},W.updateAngularAxis=function(_e,Y){var se=this,ce=se.gd,ne=se.layers,ye=se.radius,le=se.innerRadius,Z=se.cx,de=se.cy,pe=se.getAngular(Y),Te=se.angularAxis,Ne=se.isSmith;Ne||(se.fillViewInitialKey("angularaxis.rotation",pe.rotation),Te.setGeometry(),Te.setScale());var $e=Ne?function(At){var vt=U(se,w([0,At.x]));return Math.atan2(vt[0]-Z,vt[1]-de)-Math.PI/2}:function(At){return Te.t2g(At.x)};Te.type==="linear"&&Te.thetaunit==="radians"&&(Te.tick0=O(Te.tick0),Te.dtick=O(Te.dtick));var Ze=function(At){return r(Z+ye*Math.cos(At),de-ye*Math.sin(At))},Xe=Ne?function(At){var vt=U(se,w([0,At.x]));return r(vt[0],vt[1])}:function(At){return Ze($e(At))},it=Ne?function(At){var vt=U(se,w([0,At.x])),Kt=Math.atan2(vt[0]-Z,vt[1]-de)-Math.PI/2;return r(vt[0],vt[1])+t(-O(Kt))}:function(At){var vt=$e(At);return Ze(vt)+t(-O(vt))},yt=Ne?function(At){return F(se,At.x,0,1/0)}:function(At){var vt=$e(At),Kt=Math.cos(vt),Qt=Math.sin(vt);return"M"+[Z+le*Kt,de-le*Qt]+"L"+[Z+ye*Kt,de-ye*Qt]},bt=s.makeLabelFns(Te,0),mt=bt.labelStandoff,ht={};ht.xFn=function(At){var vt=$e(At);return Math.cos(vt)*mt},ht.yFn=function(At){var vt=$e(At),Kt=Math.sin(vt)>0?.2:1;return-Math.sin(vt)*(mt+At.fontSize*Kt)+Math.abs(Math.cos(vt))*(At.fontSize*E)},ht.anchorFn=function(At){var vt=$e(At),Kt=Math.cos(vt);return Math.abs(Kt)<.1?"middle":Kt>0?"start":"end"},ht.heightFn=function(At,vt,Kt){var Qt=$e(At);return-.5*(1+Math.sin(Qt))*Kt};var Ve=ee(pe);se.angularTickLayout!==Ve&&(ne["angular-axis"].selectAll("."+Te._id+"tick").remove(),se.angularTickLayout=Ve);var ze=Ne?[1/0].concat(Te.tickvals||[]).map(function(At){return s.tickText(Te,At,!0,!1)}):s.calcTicks(Te);Ne&&(ze[0].text="∞",ze[0].fontSize*=1.75);var Se;if(Y.gridshape==="linear"?(Se=ze.map($e),L.angleDelta(Se[0],Se[1])<0&&(Se=Se.slice().reverse())):Se=null,se.vangles=Se,Te.type==="category"&&(ze=ze.filter(function(At){return L.isAngleInsideSector($e(At),se.sectorInRad)})),Te.visible){var Je=Te.ticks==="inside"?-1:1,_t=(Te.linewidth||1)/2;s.drawTicks(ce,Te,{vals:ze,layer:ne["angular-axis"],path:"M"+Je*_t+",0h"+Je*Te.ticklen,transFn:it,crisp:!1}),s.drawGrid(ce,Te,{vals:ze,layer:ne["angular-grid"],path:yt,transFn:L.noop,crisp:!1}),s.drawLabels(ce,Te,{vals:ze,layer:ne["angular-axis"],repositionOnUpdate:!0,transFn:Xe,labelFns:ht})}ge(ne["angular-line"].select("path"),pe.showline,{d:se.pathSubplot(),transform:r(Z,de)}).attr("stroke-width",pe.linewidth).call(a.stroke,pe.linecolor)},W.updateFx=function(_e,Y){if(!this.gd._context.staticPlot){var se=!this.isSmith;se&&(this.updateAngularDrag(_e),this.updateRadialDrag(_e,Y,0),this.updateRadialDrag(_e,Y,1)),this.updateHoverAndMainDrag(_e)}},W.updateHoverAndMainDrag=function(_e){var Y=this,se=Y.isSmith,ce=Y.gd,ne=Y.layers,ye=_e._zoomlayer,le=_.MINZOOM,Z=_.OFFEDGE,de=Y.radius,pe=Y.innerRadius,Te=Y.cx,Ne=Y.cy,$e=Y.cxx,Ze=Y.cyy,Xe=Y.sectorInRad,it=Y.vangles,yt=Y.radialAxis,bt=h.clampTiny,mt=h.findXYatLength,ht=h.findEnclosingVertexAngles,Ve=_.cornerHalfWidth,ze=_.cornerLen/2,Se,Je,_t=d.makeDragger(ne,"path","maindrag",_e.dragmode===!1?"none":"crosshair");v.select(_t).attr("d",Y.pathSubplot()).attr("transform",r(Te,Ne)),_t.onmousemove=function(kr){g.hover(ce,kr,Y.id),ce._fullLayout._lasthover=_t,ce._fullLayout._hoversubplot=Y.id},_t.onmouseout=function(kr){ce._dragging||y.unhover(ce,kr)};var At={element:_t,gd:ce,subplot:Y.id,plotinfo:{id:Y.id,xaxis:Y.xaxis,yaxis:Y.yaxis},xaxes:[Y.xaxis],yaxes:[Y.yaxis]},vt,Kt,Qt,fr,mr,Ur,Br,fn,Fr;function Qr(kr,Sr){return Math.sqrt(kr*kr+Sr*Sr)}function Bt(kr,Sr){return Qr(kr-$e,Sr-Ze)}function et(kr,Sr){return Math.atan2(Ze-Sr,kr-$e)}function ut(kr,Sr){return[kr*Math.cos(Sr),kr*Math.sin(-Sr)]}function Be(kr,Sr){if(kr===0)return Y.pathSector(2*Ve);var Jr=ze/kr,jn=Sr-Jr,ha=Sr+Jr,oa=Math.max(0,Math.min(kr,de)),_a=oa-Ve,xa=oa+Ve;return"M"+ut(_a,jn)+"A"+[_a,_a]+" 0,0,0 "+ut(_a,ha)+"L"+ut(xa,ha)+"A"+[xa,xa]+" 0,0,1 "+ut(xa,jn)+"Z"}function Ie(kr,Sr,Jr){if(kr===0)return Y.pathSector(2*Ve);var jn=ut(kr,Sr),ha=ut(kr,Jr),oa=bt((jn[0]+ha[0])/2),_a=bt((jn[1]+ha[1])/2),xa,ra;if(oa&&_a){var Ha=_a/oa,ci=-1/Ha,_r=mt(Ve,Ha,oa,_a);xa=mt(ze,ci,_r[0][0],_r[0][1]),ra=mt(ze,ci,_r[1][0],_r[1][1])}else{var rr,yr;_a?(rr=ze,yr=Ve):(rr=Ve,yr=ze),xa=[[oa-rr,_a-yr],[oa+rr,_a-yr]],ra=[[oa-rr,_a+yr],[oa+rr,_a+yr]]}return"M"+xa.join("L")+"L"+ra.reverse().join("L")+"Z"}function ke(){Qt=null,fr=null,mr=Y.pathSubplot(),Ur=!1;var kr=ce._fullLayout[Y.id];Br=S(kr.bgcolor).getLuminance(),fn=d.makeZoombox(ye,Br,Te,Ne,mr),fn.attr("fill-rule","evenodd"),Fr=d.makeCorners(ye,Te,Ne),A(ce)}function Fe(kr,Sr){return Sr=Math.max(Math.min(Sr,de),pe),krle?(kr-1&&kr===1&&x(Sr,ce,[Y.xaxis],[Y.yaxis],Y.id,At),Jr.indexOf("event")>-1&&g.click(ce,Sr,Y.id)}At.prepFn=function(kr,Sr,Jr){var jn=ce._fullLayout.dragmode,ha=_t.getBoundingClientRect();ce._fullLayout._calcInverseTransform(ce);var oa=ce._fullLayout._invTransform;Se=ce._fullLayout._invScaleX,Je=ce._fullLayout._invScaleY;var _a=L.apply3DTransform(oa)(Sr-ha.left,Jr-ha.top);if(vt=_a[0],Kt=_a[1],it){var xa=h.findPolygonOffset(de,Xe[0],Xe[1],it);vt+=$e+xa[0],Kt+=Ze+xa[1]}switch(jn){case"zoom":At.clickFn=Dr,se||(it?At.moveFn=Vt:At.moveFn=ct,At.doneFn=Zt,ke());break;case"select":case"lasso":f(kr,Sr,Jr,At,jn);break}},y.init(At)},W.updateRadialDrag=function(_e,Y,se){var ce=this,ne=ce.gd,ye=ce.layers,le=ce.radius,Z=ce.innerRadius,de=ce.cx,pe=ce.cy,Te=ce.radialAxis,Ne=_.radialDragBoxSize,$e=Ne/2;if(!Te.visible)return;var Ze=j(ce.radialAxisAngle),Xe=Te._rl,it=Xe[0],yt=Xe[1],bt=Xe[se],mt=.75*(Xe[1]-Xe[0])/(1-ce.getHole(Y))/le,ht,Ve,ze;se?(ht=de+(le+$e)*Math.cos(Ze),Ve=pe-(le+$e)*Math.sin(Ze),ze="radialdrag"):(ht=de+(Z-$e)*Math.cos(Ze),Ve=pe-(Z-$e)*Math.sin(Ze),ze="radialdrag-inner");var Se=d.makeRectDragger(ye,ze,"crosshair",-$e,-$e,Ne,Ne),Je={element:Se,gd:ne};_e.dragmode===!1&&(Je.dragmode=!1),ge(v.select(Se),Te.visible&&Z0!=(se?vt>it:vt=90||ne>90&&ye>=450?Ze=1:Z<=0&&pe<=0?Ze=0:Ze=Math.max(Z,pe),ne<=180&&ye>=180||ne>180&&ye>=540?Te=-1:le>=0&&de>=0?Te=0:Te=Math.min(le,de),ne<=270&&ye>=270||ne>270&&ye>=630?Ne=-1:Z>=0&&pe>=0?Ne=0:Ne=Math.min(Z,pe),ye>=360?$e=1:le<=0&&de<=0?$e=0:$e=Math.max(le,de),[Te,Ne,$e,Ze]}function xe(_e,Y){var se=function(ne){return L.angleDist(_e,ne)},ce=L.findIndexOfMin(Y,se);return Y[ce]}function ge(_e,Y,se){return Y?(_e.attr("display",null),_e.attr(se)):_e&&_e.attr("display","none"),_e}}}),O7=Re({"src/plots/polar/layout_attributes.js"(ae,K){var v=du(),S=Hd(),M=af().attributes,L=Rn().extendFlat,t=bf().overrideAll,r=t({color:S.color,showline:L({},S.showline,{dflt:!0}),linecolor:S.linecolor,linewidth:S.linewidth,showgrid:L({},S.showgrid,{dflt:!0}),gridcolor:S.gridcolor,gridwidth:S.gridwidth,griddash:S.griddash},"plot","from-root"),a=t({tickmode:S.minor.tickmode,nticks:S.nticks,tick0:S.tick0,dtick:S.dtick,tickvals:S.tickvals,ticktext:S.ticktext,ticks:S.ticks,ticklen:S.ticklen,tickwidth:S.tickwidth,tickcolor:S.tickcolor,ticklabelstep:S.ticklabelstep,showticklabels:S.showticklabels,labelalias:S.labelalias,minorloglabels:S.minorloglabels,showtickprefix:S.showtickprefix,tickprefix:S.tickprefix,showticksuffix:S.showticksuffix,ticksuffix:S.ticksuffix,showexponent:S.showexponent,exponentformat:S.exponentformat,minexponent:S.minexponent,separatethousands:S.separatethousands,tickfont:S.tickfont,tickangle:S.tickangle,tickformat:S.tickformat,tickformatstops:S.tickformatstops,layer:S.layer},"plot","from-root"),l={visible:L({},S.visible,{dflt:!0}),type:L({},S.type,{values:["-","linear","log","date","category"]}),autotypenumbers:S.autotypenumbers,autorangeoptions:{minallowed:S.autorangeoptions.minallowed,maxallowed:S.autorangeoptions.maxallowed,clipmin:S.autorangeoptions.clipmin,clipmax:S.autorangeoptions.clipmax,include:S.autorangeoptions.include,editType:"plot"},autorange:L({},S.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:L({},S.minallowed,{editType:"plot"}),maxallowed:L({},S.maxallowed,{editType:"plot"}),range:L({},S.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:S.categoryorder,categoryarray:S.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:S.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:L({},S.title.text,{editType:"plot",dflt:""}),font:L({},S.title.font,{editType:"plot"}),editType:"plot"},hoverformat:S.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};L(l,r,a);var i={visible:L({},S.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:S.autotypenumbers,categoryorder:S.categoryorder,categoryarray:S.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:S.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};L(i,r,a),K.exports={domain:M({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:v.background},radialaxis:l,angularaxis:i,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),QJ=Re({"src/plots/polar/layout_defaults.js"(ae,K){var v=Rn(),S=ko(),M=Bu(),L=F0(),t=Lp().getSubplotData,r=w1(),a=L0(),l=dg(),i=Gv(),s=hh(),o=fc(),c=Fk(),p=my(),d=O7(),y=P7(),g=r4(),C=g.axisNames;function f(A,k,I,T){var E=I("bgcolor");T.bgColor=S.combine(E,T.paper_bgcolor);var _=I("sector");I("hole");var h=t(T.fullData,g.name,T.id),m=T.layoutOut,w;function F(Ne,$e){return I(w+"."+Ne,$e)}for(var z=0;z")}}K.exports={hoverPoints:S,makeHoverPointText:M}}}),rQ=Re({"src/traces/scatterpolar/index.js"(ae,K){K.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:a4(),categories:["polar","symbols","showLegend","scatter-like"],attributes:e6(),supplyDefaults:i4().supplyDefaults,colorbar:Eh(),formatLabels:o4(),calc:eQ(),plot:tQ(),style:md().style,styleOnSelect:md().styleOnSelect,hoverPoints:s4().hoverPoints,selectPoints:M1(),meta:{}}}}),nQ=Re({"lib/scatterpolar.js"(ae,K){K.exports=rQ()}}),F7=Re({"src/traces/scatterpolargl/attributes.js"(ae,K){var v=e6(),{cliponaxis:S,hoveron:M}=v,L=Ft(v,["cliponaxis","hoveron"]),{connectgaps:t,line:{color:r,dash:a,width:l},fill:i,fillcolor:s,marker:o,textfont:c,textposition:p}=qI();K.exports=zt(xt({},L),{connectgaps:t,fill:i,fillcolor:s,line:{color:r,dash:a,editType:"calc",width:l},marker:o,textfont:c,textposition:p})}}),aQ=Re({"src/traces/scatterpolargl/defaults.js"(ae,K){var v=Rn(),S=Mu(),M=i4().handleRThetaDefaults,L=Yp(),t=xg(),r=Sm(),a=Rp(),l=Wg().PTS_LINESONLY,i=F7();K.exports=function(o,c,p,d){function y(C,f){return v.coerce(o,c,i,C,f)}var g=M(o,c,d,y);if(!g){c.visible=!1;return}y("thetaunit"),y("mode",g=a&&(T.marker.cluster=x.tree),T.marker&&(T.markerSel.positions=T.markerUnsel.positions=T.marker.positions=m),T.line&&m.length>1&&r.extendFlat(T.line,t.linePositions(s,f,m)),T.text&&(r.extendFlat(T.text,{positions:m},t.textPosition(s,f,T.text,T.marker)),r.extendFlat(T.textSel,{positions:m},t.textPosition(s,f,T.text,T.markerSel)),r.extendFlat(T.textUnsel,{positions:m},t.textPosition(s,f,T.text,T.markerUnsel))),T.fill&&!y.fill2d&&(y.fill2d=!0),T.marker&&!y.scatter2d&&(y.scatter2d=!0),T.line&&!y.line2d&&(y.line2d=!0),T.text&&!y.glText&&(y.glText=!0),y.lineOptions.push(T.line),y.fillOptions.push(T.fill),y.markerOptions.push(T.marker),y.markerSelectedOptions.push(T.markerSel),y.markerUnselectedOptions.push(T.markerUnsel),y.textOptions.push(T.text),y.textSelectedOptions.push(T.textSel),y.textUnselectedOptions.push(T.textUnsel),y.selectBatch.push([]),y.unselectBatch.push([]),x.x=w,x.y=F,x.rawx=w,x.rawy=F,x.r=k,x.theta=I,x.positions=m,x._scene=y,x.index=y.count,y.count++}}),M(s,o,c)}},K.exports.reglPrecompiled=l}}),cQ=Re({"src/traces/scatterpolargl/index.js"(ae,K){var v=lQ();v.plot=uQ(),K.exports=v}}),fQ=Re({"lib/scatterpolargl.js"(ae,K){K.exports=cQ()}}),B7=Re({"src/traces/barpolar/attributes.js"(ae,K){var{hovertemplateAttrs:v,templatefallbackAttrs:S}=Wl(),M=Li().extendFlat,L=e6(),t=Md();K.exports={r:L.r,theta:L.theta,r0:L.r0,dr:L.dr,theta0:L.theta0,dtheta:L.dtheta,thetaunit:L.thetaunit,base:M({},t.base,{}),offset:M({},t.offset,{}),width:M({},t.width,{}),text:M({},t.text,{}),hovertext:M({},t.hovertext,{}),marker:r(),hoverinfo:L.hoverinfo,hovertemplate:v(),hovertemplatefallback:S(),selected:t.selected,unselected:t.unselected};function r(){var a=M({},t.marker);return delete a.cornerradius,a}}}),U7=Re({"src/traces/barpolar/layout_attributes.js"(ae,K){K.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),hQ=Re({"src/traces/barpolar/defaults.js"(ae,K){var v=Rn(),S=i4().handleRThetaDefaults,M=Zg(),L=B7();K.exports=function(r,a,l,i){function s(c,p){return v.coerce(r,a,L,c,p)}var o=S(r,a,i,s);if(!o){a.visible=!1;return}s("thetaunit"),s("base"),s("offset"),s("width"),s("text"),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),M(r,a,s,l,i),v.coerceSelectionMarkerOpacity(a,s)}}}),dQ=Re({"src/traces/barpolar/layout_defaults.js"(ae,K){var v=Rn(),S=U7();K.exports=function(M,L,t){var r={},a;function l(o,c){return v.coerce(M[a]||{},L[a],S,o,c)}for(var i=0;i0?(d=c,y=p):(d=p,y=c);var g=t.findEnclosingVertexAngles(d,a.vangles)[0],C=t.findEnclosingVertexAngles(y,a.vangles)[1],f=[g,(d+y)/2,C];return t.pathPolygonAnnulus(s,o,d,y,f,l,i)}:function(s,o,c,p){return M.pathAnnulus(s,o,c,p,l,i)}}}}),vQ=Re({"src/traces/barpolar/hover.js"(ae,K){var v=Sh(),S=Rn(),M=of().getTraceColor,L=S.fillText,t=s4().makeHoverPointText,r=n4().isPtInsidePolygon;K.exports=function(l,i,s){var o=l.cd,c=o[0].trace,p=l.subplot,d=p.radialAxis,y=p.angularAxis,g=p.vangles,C=g?r:S.isPtInsideSector,f=l.maxHoverDistance,x=y._period||2*Math.PI,A=Math.abs(d.g2p(Math.sqrt(i*i+s*s))),k=Math.atan2(s,i);d.range[0]>d.range[1]&&(k+=Math.PI);var I=function(h){return C(A,k,[h.rp0,h.rp1],[h.thetag0,h.thetag1],g)?f+Math.min(1,Math.abs(h.thetag1-h.thetag0)/x)-1+(h.rp1-A)/(h.rp1-h.rp0)-1:1/0};if(v.getClosest(o,I,l),l.index!==!1){var T=l.index,E=o[T];l.x0=l.x1=E.ct[0],l.y0=l.y1=E.ct[1];var _=S.extendFlat({},E,{r:E.s,theta:E.p});return L(E,c,l),t(_,c,p,l),l.hovertemplate=c.hovertemplate,l.color=M(c,E),l.xLabelVal=l.yLabelVal=void 0,E.s<0&&(l.idealAlign="left"),[l]}}}}),mQ=Re({"src/traces/barpolar/index.js"(ae,K){K.exports={moduleType:"trace",name:"barpolar",basePlotModule:a4(),categories:["polar","bar","showLegend"],attributes:B7(),layoutAttributes:U7(),supplyDefaults:hQ(),supplyLayoutDefaults:dQ(),calc:$7().calc,crossTraceCalc:$7().crossTraceCalc,plot:pQ(),colorbar:Eh(),formatLabels:o4(),style:dp().style,styleOnSelect:dp().styleOnSelect,hoverPoints:vQ(),selectPoints:My(),meta:{}}}}),gQ=Re({"lib/barpolar.js"(ae,K){K.exports=mQ()}}),V7=Re({"src/plots/smith/constants.js"(ae,K){K.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),j7=Re({"src/plots/smith/layout_attributes.js"(ae,K){var v=du(),S=Hd(),M=af().attributes,L=Rn().extendFlat,t=bf().overrideAll,r=t({color:S.color,showline:L({},S.showline,{dflt:!0}),linecolor:S.linecolor,linewidth:S.linewidth,showgrid:L({},S.showgrid,{dflt:!0}),gridcolor:S.gridcolor,gridwidth:S.gridwidth,griddash:S.griddash},"plot","from-root"),a=t({ticklen:S.ticklen,tickwidth:L({},S.tickwidth,{dflt:2}),tickcolor:S.tickcolor,showticklabels:S.showticklabels,labelalias:S.labelalias,showtickprefix:S.showtickprefix,tickprefix:S.tickprefix,showticksuffix:S.showticksuffix,ticksuffix:S.ticksuffix,tickfont:S.tickfont,tickformat:S.tickformat,hoverformat:S.hoverformat,layer:S.layer},"plot","from-root"),l=L({visible:L({},S.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:L({},S.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},r,a),i=L({visible:L({},S.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:S.ticks,editType:"calc"},r,a);K.exports={domain:M({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:v.background},realaxis:l,imaginaryaxis:i,editType:"calc"}}}),yQ=Re({"src/plots/smith/layout_defaults.js"(ae,K){var v=Rn(),S=ko(),M=Bu(),L=F0(),t=Lp().getSubplotData,r=Gv(),a=dg(),l=fc(),i=bm(),s=j7(),o=V7(),c=o.axisNames,p=y(function(g){return v.isTypedArray(g)&&(g=Array.from(g)),g.slice().reverse().map(function(C){return-C}).concat([0]).concat(g)},String);function d(g,C,f,x){var A=f("bgcolor");x.bgColor=S.combine(A,x.paper_bgcolor);var k=t(x.fullData,o.name,x.id),I=x.layoutOut,T;function E(W,ee){return f(T+"."+W,ee)}for(var _=0;_")}}K.exports={hoverPoints:S,makeHoverPointText:M}}}),SQ=Re({"src/traces/scattersmith/index.js"(ae,K){K.exports={moduleType:"trace",name:"scattersmith",basePlotModule:_Q(),categories:["smith","symbols","showLegend","scatter-like"],attributes:G7(),supplyDefaults:xQ(),colorbar:Eh(),formatLabels:bQ(),calc:wQ(),plot:TQ(),style:md().style,styleOnSelect:md().styleOnSelect,hoverPoints:AQ().hoverPoints,selectPoints:M1(),meta:{}}}}),EQ=Re({"lib/scattersmith.js"(ae,K){K.exports=SQ()}}),rm=Re({"node_modules/world-calendars/dist/main.js"(ae,K){var v=gp();function S(){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={}}v(S.prototype,{instance:function(l,i){l=(l||"gregorian").toLowerCase(),i=i||"";var s=this._localCals[l+"-"+i];if(!s&&this.calendars[l]&&(s=new this.calendars[l](i),this._localCals[l+"-"+i]=s),!s)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,l);return s},newDate:function(l,i,s,o,c){return o=(l!=null&&l.year?l.calendar():typeof o=="string"?this.instance(o,c):o)||this.instance(),o.newDate(l,i,s)},substituteDigits:function(l){return function(i){return(i+"").replace(/[0-9]/g,function(s){return l[s]})}},substituteChineseDigits:function(l,i){return function(s){for(var o="",c=0;s>0;){var p=s%10;o=(p===0?"":l[p]+i[c])+o,c++,s=Math.floor(s/10)}return o.indexOf(l[1]+i[1])===0&&(o=o.substr(1)),o||l[0]}}});function M(l,i,s,o){if(this._calendar=l,this._year=i,this._month=s,this._day=o,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(a.local.invalidDate||a.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function L(l,i){return l=""+l,"000000".substring(0,i-l.length)+l}v(M.prototype,{newDate:function(l,i,s){return this._calendar.newDate(l??this,i,s)},year:function(l){return arguments.length===0?this._year:this.set(l,"y")},month:function(l){return arguments.length===0?this._month:this.set(l,"m")},day:function(l){return arguments.length===0?this._day:this.set(l,"d")},date:function(l,i,s){if(!this._calendar.isValid(l,i,s))throw(a.local.invalidDate||a.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=l,this._month=i,this._day=s,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(l,i){return this._calendar.add(this,l,i)},set:function(l,i){return this._calendar.set(this,l,i)},compareTo:function(l){if(this._calendar.name!==l._calendar.name)throw(a.local.differentCalendars||a.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,l._calendar.local.name);var i=this._year!==l._year?this._year-l._year:this._month!==l._month?this.monthOfYear()-l.monthOfYear():this._day-l._day;return i===0?0:i<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(l){return this._calendar.fromJD(l)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(l){return this._calendar.fromJSDate(l)},toString:function(){return(this.year()<0?"-":"")+L(Math.abs(this.year()),4)+"-"+L(this.month(),2)+"-"+L(this.day(),2)}});function t(){this.shortYearCutoff="+10"}v(t.prototype,{_validateLevel:0,newDate:function(l,i,s){return l==null?this.today():(l.year&&(this._validate(l,i,s,a.local.invalidDate||a.regionalOptions[""].invalidDate),s=l.day(),i=l.month(),l=l.year()),new M(this,l,i,s))},today:function(){return this.fromJSDate(new Date)},epoch:function(l){var i=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return i.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(l){var i=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return(i.year()<0?"-":"")+L(Math.abs(i.year()),4)},monthsInYear:function(l){return this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear),12},monthOfYear:function(l,i){var s=this._validate(l,i,this.minDay,a.local.invalidMonth||a.regionalOptions[""].invalidMonth);return(s.month()+this.monthsInYear(s)-this.firstMonth)%this.monthsInYear(s)+this.minMonth},fromMonthOfYear:function(l,i){var s=(i+this.firstMonth-2*this.minMonth)%this.monthsInYear(l)+this.minMonth;return this._validate(l,s,this.minDay,a.local.invalidMonth||a.regionalOptions[""].invalidMonth),s},daysInYear:function(l){var i=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return this.leapYear(i)?366:365},dayOfYear:function(l,i,s){var o=this._validate(l,i,s,a.local.invalidDate||a.regionalOptions[""].invalidDate);return o.toJD()-this.newDate(o.year(),this.fromMonthOfYear(o.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(l,i,s){var o=this._validate(l,i,s,a.local.invalidDate||a.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(o))+2)%this.daysInWeek()},extraInfo:function(l,i,s){return this._validate(l,i,s,a.local.invalidDate||a.regionalOptions[""].invalidDate),{}},add:function(l,i,s){return this._validate(l,this.minMonth,this.minDay,a.local.invalidDate||a.regionalOptions[""].invalidDate),this._correctAdd(l,this._add(l,i,s),i,s)},_add:function(l,i,s){if(this._validateLevel++,s==="d"||s==="w"){var o=l.toJD()+i*(s==="w"?this.daysInWeek():1),c=l.calendar().fromJD(o);return this._validateLevel--,[c.year(),c.month(),c.day()]}try{var p=l.year()+(s==="y"?i:0),d=l.monthOfYear()+(s==="m"?i:0),c=l.day(),y=function(f){for(;dx-1+f.minMonth;)p++,d-=x,x=f.monthsInYear(p)};s==="y"?(l.month()!==this.fromMonthOfYear(p,d)&&(d=this.newDate(p,l.month(),this.minDay).monthOfYear()),d=Math.min(d,this.monthsInYear(p)),c=Math.min(c,this.daysInMonth(p,this.fromMonthOfYear(p,d)))):s==="m"&&(y(this),c=Math.min(c,this.daysInMonth(p,this.fromMonthOfYear(p,d))));var g=[p,this.fromMonthOfYear(p,d),c];return this._validateLevel--,g}catch(C){throw this._validateLevel--,C}},_correctAdd:function(l,i,s,o){if(!this.hasYearZero&&(o==="y"||o==="m")&&(i[0]===0||l.year()>0!=i[0]>0)){var c={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[o],p=s<0?-1:1;i=this._add(l,s*c[0]+p*c[1],c[2])}return l.date(i[0],i[1],i[2])},set:function(l,i,s){this._validate(l,this.minMonth,this.minDay,a.local.invalidDate||a.regionalOptions[""].invalidDate);var o=s==="y"?i:l.year(),c=s==="m"?i:l.month(),p=s==="d"?i:l.day();return(s==="y"||s==="m")&&(p=Math.min(p,this.daysInMonth(o,c))),l.date(o,c,p)},isValid:function(l,i,s){this._validateLevel++;var o=this.hasYearZero||l!==0;if(o){var c=this.newDate(l,i,this.minDay);o=i>=this.minMonth&&i-this.minMonth=this.minDay&&s-this.minDay13.5?13:1),C=c-(g>2.5?4716:4715);return C<=0&&C--,this.newDate(C,g,y)},toJSDate:function(l,i,s){var o=this._validate(l,i,s,a.local.invalidDate||a.regionalOptions[""].invalidDate),c=new Date(o.year(),o.month()-1,o.day());return c.setHours(0),c.setMinutes(0),c.setSeconds(0),c.setMilliseconds(0),c.setHours(c.getHours()>12?c.getHours()+2:0),c},fromJSDate:function(l){return this.newDate(l.getFullYear(),l.getMonth()+1,l.getDate())}});var a=K.exports=new S;a.cdate=M,a.baseCalendar=t,a.calendars.gregorian=r}}),CQ=Re({"node_modules/world-calendars/dist/plus.js"(){var ae=gp(),K=rm();ae(K.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"}),K.local=K.regionalOptions[""],ae(K.cdate.prototype,{formatDate:function(v,S){return typeof v!="string"&&(S=v,v=""),this._calendar.formatDate(v||"",this,S)}}),ae(K.baseCalendar.prototype,{UNIX_EPOCH:K.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:K.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,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(v,S,M){if(typeof v!="string"&&(M=S,S=v,v=""),!S)return"";if(S.calendar()!==this)throw K.local.invalidFormat||K.regionalOptions[""].invalidFormat;v=v||this.local.dateFormat,M=M||{};var L=M.dayNamesShort||this.local.dayNamesShort,t=M.dayNames||this.local.dayNames,r=M.monthNumbers||this.local.monthNumbers,a=M.monthNamesShort||this.local.monthNamesShort,l=M.monthNames||this.local.monthNames;M.calculateWeek||this.local.calculateWeek;for(var i=function(A,k){for(var I=1;x+I1},s=function(A,k,I,T){var E=""+k;if(i(A,T))for(;E.length1},x=function(F,z){var U=f(F,z),V=[2,3,U?4:2,U?4:2,10,11,20]["oyYJ@!".indexOf(F)+1],G=new RegExp("^-?\\d{1,"+V+"}"),j=S.substring(_).match(G);if(!j)throw(K.local.missingNumberAt||K.regionalOptions[""].missingNumberAt).replace(/\{0\}/,_);return _+=j[0].length,parseInt(j[0],10)},A=this,k=function(){if(typeof l=="function"){f("m");var F=l.call(A,S.substring(_));return _+=F.length,F}return x("m")},I=function(F,z,U,V){for(var G=f(F,V)?U:z,j=0;j-1){p=1,d=y;for(var w=this.daysInMonth(c,p);d>w;w=this.daysInMonth(c,p))p++,d-=w}return o>-1?this.fromJD(o):this.newDate(c,p,d)},determineDate:function(v,S,M,L,t){M&&typeof M!="object"&&(t=L,L=M,M=null),typeof L!="string"&&(t=L,L="");var r=this,a=function(l){try{return r.parseDate(L,l,t)}catch{}l=l.toLowerCase();for(var i=(l.match(/^c/)&&M?M.newDate():null)||r.today(),s=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,o=s.exec(l);o;)i.add(parseInt(o[1],10),o[2]||"d"),o=s.exec(l);return i};return S=S?S.newDate():null,v=v==null?S:typeof v=="string"?a(v):typeof v=="number"?isNaN(v)||v===1/0||v===-1/0?S:r.today().add(v,"d"):r.newDate(v),v}})}}),kQ=Re({"node_modules/world-calendars/dist/calendars/chinese.js"(){var ae=rm(),K=gp(),v=ae.instance();function S(o){this.local=this.regionalOptions[o||""]||this.regionalOptions[""]}S.prototype=new ae.baseCalendar,K(S.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(o,c){if(typeof o=="string"){var p=o.match(L);return p?p[0]:""}var d=this._validateYear(o),y=o.month(),g=""+this.toChineseMonth(d,y);return c&&g.length<2&&(g="0"+g),this.isIntercalaryMonth(d,y)&&(g+="i"),g},monthNames:function(o){if(typeof o=="string"){var c=o.match(t);return c?c[0]:""}var p=this._validateYear(o),d=o.month(),y=this.toChineseMonth(p,d),g=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][y-1];return this.isIntercalaryMonth(p,d)&&(g="闰"+g),g},monthNamesShort:function(o){if(typeof o=="string"){var c=o.match(r);return c?c[0]:""}var p=this._validateYear(o),d=o.month(),y=this.toChineseMonth(p,d),g=["一","二","三","四","五","六","七","八","九","十","十一","十二"][y-1];return this.isIntercalaryMonth(p,d)&&(g="闰"+g),g},parseMonth:function(o,c){o=this._validateYear(o);var p=parseInt(c),d;if(isNaN(p))c[0]==="闰"&&(d=!0,c=c.substring(1)),c[c.length-1]==="月"&&(c=c.substring(0,c.length-1)),p=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(c);else{var y=c[c.length-1];d=y==="i"||y==="I"}var g=this.toMonthIndex(o,p,d);return g},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}},_validateYear:function(o,c){if(o.year&&(o=o.year()),typeof o!="number"||o<1888||o>2111)throw c.replace(/\{0\}/,this.local.name);return o},toMonthIndex:function(o,c,p){var d=this.intercalaryMonth(o),y=p&&c!==d;if(y||c<1||c>12)throw ae.local.invalidMonth.replace(/\{0\}/,this.local.name);var g;return d?!p&&c<=d?g=c-1:g=c:g=c-1,g},toChineseMonth:function(o,c){o.year&&(o=o.year(),c=o.month());var p=this.intercalaryMonth(o),d=p?12:11;if(c<0||c>d)throw ae.local.invalidMonth.replace(/\{0\}/,this.local.name);var y;return p?c>13;return p},isIntercalaryMonth:function(o,c){o.year&&(o=o.year(),c=o.month());var p=this.intercalaryMonth(o);return!!p&&p===c},leapYear:function(o){return this.intercalaryMonth(o)!==0},weekOfYear:function(o,c,p){var d=this._validateYear(o,ae.local.invalidyear),y=l[d-l[0]],g=y>>9&4095,C=y>>5&15,f=y&31,x;x=v.newDate(g,C,f),x.add(4-(x.dayOfWeek()||7),"d");var A=this.toJD(o,c,p)-x.toJD();return 1+Math.floor(A/7)},monthsInYear:function(o){return this.leapYear(o)?13:12},daysInMonth:function(o,c){o.year&&(c=o.month(),o=o.year()),o=this._validateYear(o);var p=a[o-a[0]],d=p>>13,y=d?12:11;if(c>y)throw ae.local.invalidMonth.replace(/\{0\}/,this.local.name);var g=p&1<<12-c?30:29;return g},weekDay:function(o,c,p){return(this.dayOfWeek(o,c,p)||7)<6},toJD:function(o,c,p){var d=this._validate(o,g,p,ae.local.invalidDate);o=this._validateYear(d.year()),c=d.month(),p=d.day();var y=this.isIntercalaryMonth(o,c),g=this.toChineseMonth(o,c),C=s(o,g,p,y);return v.toJD(C.year,C.month,C.day)},fromJD:function(o){var c=v.fromJD(o),p=i(c.year(),c.month(),c.day()),d=this.toMonthIndex(p.year,p.month,p.isIntercalary);return this.newDate(p.year,d,p.day)},fromString:function(o){var c=o.match(M),p=this._validateYear(+c[1]),d=+c[2],y=!!c[3],g=this.toMonthIndex(p,d,y),C=+c[4];return this.newDate(p,g,C)},add:function(o,c,p){var d=o.year(),y=o.month(),g=this.isIntercalaryMonth(d,y),C=this.toChineseMonth(d,y),f=Object.getPrototypeOf(S.prototype).add.call(this,o,c,p);if(p==="y"){var x=f.year(),A=f.month(),k=this.isIntercalaryMonth(x,C),I=g&&k?this.toMonthIndex(x,C,!0):this.toMonthIndex(x,C,!1);I!==A&&f.month(I)}return f}});var M=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,L=/^\d?\d[iI]?/m,t=/^闰?十?[一二三四五六七八九]?月/m,r=/^闰?十?[一二三四五六七八九]?/m;ae.calendars.chinese=S;var a=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],l=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function i(o,c,p,d){var y,g;if(typeof o=="object")y=o,g=c||{};else{var C=typeof o=="number"&&o>=1888&&o<=2111;if(!C)throw new Error("Solar year outside range 1888-2111");var f=typeof c=="number"&&c>=1&&c<=12;if(!f)throw new Error("Solar month outside range 1 - 12");var x=typeof p=="number"&&p>=1&&p<=31;if(!x)throw new Error("Solar day outside range 1 - 31");y={year:o,month:c,day:p},g={}}var A=l[y.year-l[0]],k=y.year<<9|y.month<<5|y.day;g.year=k>=A?y.year:y.year-1,A=l[g.year-l[0]];var I=A>>9&4095,T=A>>5&15,E=A&31,_,h=new Date(I,T-1,E),m=new Date(y.year,y.month-1,y.day);_=Math.round((m-h)/(24*3600*1e3));var w=a[g.year-a[0]],F;for(F=0;F<13;F++){var z=w&1<<12-F?30:29;if(_>13;return!U||F=1888&&o<=2111;if(!f)throw new Error("Lunar year outside range 1888-2111");var x=typeof c=="number"&&c>=1&&c<=12;if(!x)throw new Error("Lunar month outside range 1 - 12");var A=typeof p=="number"&&p>=1&&p<=30;if(!A)throw new Error("Lunar day outside range 1 - 30");var k;typeof d=="object"?(k=!1,g=d):(k=!!d,g={}),C={year:o,month:c,day:p,isIntercalary:k}}var I;I=C.day-1;var T=a[C.year-a[0]],E=T>>13,_;E&&(C.month>E||C.isIntercalary)?_=C.month:_=C.month-1;for(var h=0;h<_;h++){var m=T&1<<12-h?30:29;I+=m}var w=l[C.year-l[0]],F=w>>9&4095,z=w>>5&15,U=w&31,V=new Date(F,z-1,U+I);return g.year=V.getFullYear(),g.month=1+V.getMonth(),g.day=V.getDate(),g}}}),MQ=Re({"node_modules/world-calendars/dist/calendars/coptic.js"(){var ae=rm(),K=gp();function v(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}v.prototype=new ae.baseCalendar,K(v.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(L){var M=this._validate(L,this.minMonth,this.minDay,ae.local.invalidYear),L=M.year()+(M.year()<0?1:0);return L%4===3||L%4===-1},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,ae.local.invalidYear||ae.regionalOptions[""].invalidYear),13},weekOfYear:function(S,M,L){var t=this.newDate(S,M,L);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,M){var L=this._validate(S,M,this.minDay,ae.local.invalidMonth);return this.daysPerMonth[L.month()-1]+(L.month()===13&&this.leapYear(L.year())?1:0)},weekDay:function(S,M,L){return(this.dayOfWeek(S,M,L)||7)<6},toJD:function(S,M,L){var t=this._validate(S,M,L,ae.local.invalidDate);return S=t.year(),S<0&&S++,t.day()+(t.month()-1)*30+(S-1)*365+Math.floor(S/4)+this.jdEpoch-1},fromJD:function(S){var M=Math.floor(S)+.5-this.jdEpoch,L=Math.floor((M-Math.floor((M+366)/1461))/365)+1;L<=0&&L--,M=Math.floor(S)+.5-this.newDate(L,1,1).toJD();var t=Math.floor(M/30)+1,r=M-(t-1)*30+1;return this.newDate(L,t,r)}}),ae.calendars.coptic=v}}),IQ=Re({"node_modules/world-calendars/dist/calendars/discworld.js"(){var ae=rm(),K=gp();function v(M){this.local=this.regionalOptions[M||""]||this.regionalOptions[""]}v.prototype=new ae.baseCalendar,K(v.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(M){return this._validate(M,this.minMonth,this.minDay,ae.local.invalidYear),!1},monthsInYear:function(M){return this._validate(M,this.minMonth,this.minDay,ae.local.invalidYear),13},daysInYear:function(M){return this._validate(M,this.minMonth,this.minDay,ae.local.invalidYear),400},weekOfYear:function(M,L,t){var r=this.newDate(M,L,t);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/8)+1},daysInMonth:function(M,L){var t=this._validate(M,L,this.minDay,ae.local.invalidMonth);return this.daysPerMonth[t.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(M,L,t){var r=this._validate(M,L,t,ae.local.invalidDate);return(r.day()+1)%8},weekDay:function(M,L,t){var r=this.dayOfWeek(M,L,t);return r>=2&&r<=6},extraInfo:function(M,L,t){var r=this._validate(M,L,t,ae.local.invalidDate);return{century:S[Math.floor((r.year()-1)/100)+1]||""}},toJD:function(M,L,t){var r=this._validate(M,L,t,ae.local.invalidDate);return M=r.year()+(r.year()<0?1:0),L=r.month(),t=r.day(),t+(L>1?16:0)+(L>2?(L-2)*32:0)+(M-1)*400+this.jdEpoch-1},fromJD:function(M){M=Math.floor(M+.5)-Math.floor(this.jdEpoch)-1;var L=Math.floor(M/400)+1;M-=(L-1)*400,M+=M>15?16:0;var t=Math.floor(M/32)+1,r=M-(t-1)*32+1;return this.newDate(L<=0?L-1:L,t,r)}});var S={20:"Fruitbat",21:"Anchovy"};ae.calendars.discworld=v}}),LQ=Re({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var ae=rm(),K=gp();function v(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}v.prototype=new ae.baseCalendar,K(v.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,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(L){var M=this._validate(L,this.minMonth,this.minDay,ae.local.invalidYear),L=M.year()+(M.year()<0?1:0);return L%4===3||L%4===-1},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,ae.local.invalidYear||ae.regionalOptions[""].invalidYear),13},weekOfYear:function(S,M,L){var t=this.newDate(S,M,L);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,M){var L=this._validate(S,M,this.minDay,ae.local.invalidMonth);return this.daysPerMonth[L.month()-1]+(L.month()===13&&this.leapYear(L.year())?1:0)},weekDay:function(S,M,L){return(this.dayOfWeek(S,M,L)||7)<6},toJD:function(S,M,L){var t=this._validate(S,M,L,ae.local.invalidDate);return S=t.year(),S<0&&S++,t.day()+(t.month()-1)*30+(S-1)*365+Math.floor(S/4)+this.jdEpoch-1},fromJD:function(S){var M=Math.floor(S)+.5-this.jdEpoch,L=Math.floor((M-Math.floor((M+366)/1461))/365)+1;L<=0&&L--,M=Math.floor(S)+.5-this.newDate(L,1,1).toJD();var t=Math.floor(M/30)+1,r=M-(t-1)*30+1;return this.newDate(L,t,r)}}),ae.calendars.ethiopian=v}}),RQ=Re({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var ae=rm(),K=gp();function v(M){this.local=this.regionalOptions[M||""]||this.regionalOptions[""]}v.prototype=new ae.baseCalendar,K(v.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(M){var L=this._validate(M,this.minMonth,this.minDay,ae.local.invalidYear);return this._leapYear(L.year())},_leapYear:function(M){return M=M<0?M+1:M,S(M*7+1,19)<7},monthsInYear:function(M){return this._validate(M,this.minMonth,this.minDay,ae.local.invalidYear),this._leapYear(M.year?M.year():M)?13:12},weekOfYear:function(M,L,t){var r=this.newDate(M,L,t);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(M){var L=this._validate(M,this.minMonth,this.minDay,ae.local.invalidYear);return M=L.year(),this.toJD(M===-1?1:M+1,7,1)-this.toJD(M,7,1)},daysInMonth:function(M,L){return M.year&&(L=M.month(),M=M.year()),this._validate(M,L,this.minDay,ae.local.invalidMonth),L===12&&this.leapYear(M)||L===8&&S(this.daysInYear(M),10)===5?30:L===9&&S(this.daysInYear(M),10)===3?29:this.daysPerMonth[L-1]},weekDay:function(M,L,t){return this.dayOfWeek(M,L,t)!==6},extraInfo:function(M,L,t){var r=this._validate(M,L,t,ae.local.invalidDate);return{yearType:(this.leapYear(r)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(r)%10-3]}},toJD:function(M,L,t){var r=this._validate(M,L,t,ae.local.invalidDate);M=r.year(),L=r.month(),t=r.day();var a=M<=0?M+1:M,l=this.jdEpoch+this._delay1(a)+this._delay2(a)+t+1;if(L<7){for(var i=7;i<=this.monthsInYear(M);i++)l+=this.daysInMonth(M,i);for(var i=1;i=this.toJD(L===-1?1:L+1,7,1);)L++;for(var t=Mthis.toJD(L,t,this.daysInMonth(L,t));)t++;var r=M-this.toJD(L,t,1)+1;return this.newDate(L,t,r)}});function S(M,L){return M-L*Math.floor(M/L)}ae.calendars.hebrew=v}}),DQ=Re({"node_modules/world-calendars/dist/calendars/islamic.js"(){var ae=rm(),K=gp();function v(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}v.prototype=new ae.baseCalendar,K(v.prototype,{name:"Islamic",jdEpoch:19484395e-1,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īs","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(S){var M=this._validate(S,this.minMonth,this.minDay,ae.local.invalidYear);return(M.year()*11+14)%30<11},weekOfYear:function(S,M,L){var t=this.newDate(S,M,L);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){return this.leapYear(S)?355:354},daysInMonth:function(S,M){var L=this._validate(S,M,this.minDay,ae.local.invalidMonth);return this.daysPerMonth[L.month()-1]+(L.month()===12&&this.leapYear(L.year())?1:0)},weekDay:function(S,M,L){return this.dayOfWeek(S,M,L)!==5},toJD:function(S,M,L){var t=this._validate(S,M,L,ae.local.invalidDate);return S=t.year(),M=t.month(),L=t.day(),S=S<=0?S+1:S,L+Math.ceil(29.5*(M-1))+(S-1)*354+Math.floor((3+11*S)/30)+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S)+.5;var M=Math.floor((30*(S-this.jdEpoch)+10646)/10631);M=M<=0?M-1:M;var L=Math.min(12,Math.ceil((S-29-this.toJD(M,1,1))/29.5)+1),t=S-this.toJD(M,L,1)+1;return this.newDate(M,L,t)}}),ae.calendars.islamic=v}}),PQ=Re({"node_modules/world-calendars/dist/calendars/julian.js"(){var ae=rm(),K=gp();function v(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}v.prototype=new ae.baseCalendar,K(v.prototype,{name:"Julian",jdEpoch:17214235e-1,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(L){var M=this._validate(L,this.minMonth,this.minDay,ae.local.invalidYear),L=M.year()<0?M.year()+1:M.year();return L%4===0},weekOfYear:function(S,M,L){var t=this.newDate(S,M,L);return t.add(4-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,M){var L=this._validate(S,M,this.minDay,ae.local.invalidMonth);return this.daysPerMonth[L.month()-1]+(L.month()===2&&this.leapYear(L.year())?1:0)},weekDay:function(S,M,L){return(this.dayOfWeek(S,M,L)||7)<6},toJD:function(S,M,L){var t=this._validate(S,M,L,ae.local.invalidDate);return S=t.year(),M=t.month(),L=t.day(),S<0&&S++,M<=2&&(S--,M+=12),Math.floor(365.25*(S+4716))+Math.floor(30.6001*(M+1))+L-1524.5},fromJD:function(S){var M=Math.floor(S+.5),L=M+1524,t=Math.floor((L-122.1)/365.25),r=Math.floor(365.25*t),a=Math.floor((L-r)/30.6001),l=a-Math.floor(a<14?1:13),i=t-Math.floor(l>2?4716:4715),s=L-r-Math.floor(30.6001*a);return i<=0&&i--,this.newDate(i,l,s)}}),ae.calendars.julian=v}}),zQ=Re({"node_modules/world-calendars/dist/calendars/mayan.js"(){var ae=rm(),K=gp();function v(L){this.local=this.regionalOptions[L||""]||this.regionalOptions[""]}v.prototype=new ae.baseCalendar,K(v.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(L){return this._validate(L,this.minMonth,this.minDay,ae.local.invalidYear),!1},formatYear:function(L){var t=this._validate(L,this.minMonth,this.minDay,ae.local.invalidYear);L=t.year();var r=Math.floor(L/400);L=L%400,L+=L<0?400:0;var a=Math.floor(L/20);return r+"."+a+"."+L%20},forYear:function(L){if(L=L.split("."),L.length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&a<0)throw"Invalid Mayan year";t=t*20+a}return t},monthsInYear:function(L){return this._validate(L,this.minMonth,this.minDay,ae.local.invalidYear),18},weekOfYear:function(L,t,r){return this._validate(L,t,r,ae.local.invalidDate),0},daysInYear:function(L){return this._validate(L,this.minMonth,this.minDay,ae.local.invalidYear),360},daysInMonth:function(L,t){return this._validate(L,t,this.minDay,ae.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(L,t,r){var a=this._validate(L,t,r,ae.local.invalidDate);return a.day()},weekDay:function(L,t,r){return this._validate(L,t,r,ae.local.invalidDate),!0},extraInfo:function(L,t,r){var a=this._validate(L,t,r,ae.local.invalidDate),l=a.toJD(),i=this._toHaab(l),s=this._toTzolkin(l);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[s[0]-1],tzolkinDay:s[0],tzolkinTrecena:s[1]}},_toHaab:function(L){L-=this.jdEpoch;var t=S(L+8+340,365);return[Math.floor(t/20)+1,S(t,20)]},_toTzolkin:function(L){return L-=this.jdEpoch,[M(L+20,20),M(L+4,13)]},toJD:function(L,t,r){var a=this._validate(L,t,r,ae.local.invalidDate);return a.day()+a.month()*20+a.year()*360+this.jdEpoch},fromJD:function(L){L=Math.floor(L)+.5-this.jdEpoch;var t=Math.floor(L/360);L=L%360,L+=L<0?360:0;var r=Math.floor(L/20),a=L%20;return this.newDate(t,r,a)}});function S(L,t){return L-t*Math.floor(L/t)}function M(L,t){return S(L-1,t)+1}ae.calendars.mayan=v}}),NQ=Re({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var ae=rm(),K=gp();function v(M){this.local=this.regionalOptions[M||""]||this.regionalOptions[""]}v.prototype=new ae.baseCalendar;var S=ae.instance("gregorian");K(v.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,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(M){var L=this._validate(M,this.minMonth,this.minDay,ae.local.invalidYear||ae.regionalOptions[""].invalidYear);return S.leapYear(L.year()+(L.year()<1?1:0)+1469)},weekOfYear:function(M,L,t){var r=this.newDate(M,L,t);return r.add(1-(r.dayOfWeek()||7),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(M,L){var t=this._validate(M,L,this.minDay,ae.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===12&&this.leapYear(t.year())?1:0)},weekDay:function(M,L,t){return(this.dayOfWeek(M,L,t)||7)<6},toJD:function(a,L,t){var r=this._validate(a,L,t,ae.local.invalidMonth),a=r.year();a<0&&a++;for(var l=r.day(),i=1;i=this.toJD(L+1,1,1);)L++;for(var t=M-Math.floor(this.toJD(L,1,1)+.5)+1,r=1;t>this.daysInMonth(L,r);)t-=this.daysInMonth(L,r),r++;return this.newDate(L,r,t)}}),ae.calendars.nanakshahi=v}}),OQ=Re({"node_modules/world-calendars/dist/calendars/nepali.js"(){var ae=rm(),K=gp();function v(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}v.prototype=new ae.baseCalendar,K(v.prototype,{name:"Nepali",jdEpoch:17007095e-1,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(S){return this.daysInYear(S)!==this.daysPerYear},weekOfYear:function(S,M,L){var t=this.newDate(S,M,L);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){var M=this._validate(S,this.minMonth,this.minDay,ae.local.invalidYear);if(S=M.year(),typeof this.NEPALI_CALENDAR_DATA[S]>"u")return this.daysPerYear;for(var L=0,t=this.minMonth;t<=12;t++)L+=this.NEPALI_CALENDAR_DATA[S][t];return L},daysInMonth:function(S,M){return S.year&&(M=S.month(),S=S.year()),this._validate(S,M,this.minDay,ae.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[S]>"u"?this.daysPerMonth[M-1]:this.NEPALI_CALENDAR_DATA[S][M]},weekDay:function(S,M,L){return this.dayOfWeek(S,M,L)!==6},toJD:function(S,M,L){var t=this._validate(S,M,L,ae.local.invalidDate);S=t.year(),M=t.month(),L=t.day();var r=ae.instance(),a=0,l=M,i=S;this._createMissingCalendarData(S);var s=S-(l>9||l===9&&L>=this.NEPALI_CALENDAR_DATA[i][0]?56:57);for(M!==9&&(a=L,l--);l!==9;)l<=0&&(l=12,i--),a+=this.NEPALI_CALENDAR_DATA[i][l],l--;return M===9?(a+=L-this.NEPALI_CALENDAR_DATA[i][0],a<0&&(a+=r.daysInYear(s))):a+=this.NEPALI_CALENDAR_DATA[i][9]-this.NEPALI_CALENDAR_DATA[i][0],r.newDate(s,1,1).add(a,"d").toJD()},fromJD:function(S){var M=ae.instance(),L=M.fromJD(S),t=L.year(),r=L.dayOfYear(),a=t+56;this._createMissingCalendarData(a);for(var l=9,i=this.NEPALI_CALENDAR_DATA[a][0],s=this.NEPALI_CALENDAR_DATA[a][l]-i+1;r>s;)l++,l>12&&(l=1,a++),s+=this.NEPALI_CALENDAR_DATA[a][l];var o=this.NEPALI_CALENDAR_DATA[a][l]-(s-r);return this.newDate(a,l,o)},_createMissingCalendarData:function(S){var M=this.daysPerMonth.slice(0);M.unshift(17);for(var L=S-1;L"u"&&(this.NEPALI_CALENDAR_DATA[L]=M)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),ae.calendars.nepali=v}}),FQ=Re({"node_modules/world-calendars/dist/calendars/persian.js"(){var ae=rm(),K=gp();function v(M){this.local=this.regionalOptions[M||""]||this.regionalOptions[""]}function S(M){var L=M-475;M<0&&L++;var t=.242197,r=t*L,a=t*(L+1),l=r-Math.floor(r),i=a-Math.floor(a);return l>i}v.prototype=new ae.baseCalendar,K(v.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(M){var L=this._validate(M,this.minMonth,this.minDay,ae.local.invalidYear);return S(L.year())},weekOfYear:function(M,L,t){var r=this.newDate(M,L,t);return r.add(-((r.dayOfWeek()+1)%7),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(M,L){var t=this._validate(M,L,this.minDay,ae.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===12&&this.leapYear(t.year())?1:0)},weekDay:function(M,L,t){return this.dayOfWeek(M,L,t)!==5},toJD:function(M,L,t){var r=this._validate(M,L,t,ae.local.invalidDate);M=r.year(),L=r.month(),t=r.day();var a=0;if(M>0)for(var l=1;l0?M-1:M)*365+a+this.jdEpoch-1},fromJD:function(M){M=Math.floor(M)+.5;var L=475+(M-this.toJD(475,1,1))/365.242197,t=Math.floor(L);t<=0&&t--,M>this.toJD(t,12,S(t)?30:29)&&(t++,t===0&&t++);var r=M-this.toJD(t,1,1)+1,a=r<=186?Math.ceil(r/31):Math.ceil((r-6)/30),l=M-this.toJD(t,a,1)+1;return this.newDate(t,a,l)}}),ae.calendars.persian=v,ae.calendars.jalali=v}}),BQ=Re({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var ae=rm(),K=gp(),v=ae.instance();function S(M){this.local=this.regionalOptions[M||""]||this.regionalOptions[""]}S.prototype=new ae.baseCalendar,K(S.prototype,{name:"Taiwan",jdEpoch:24194025e-1,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(t){var L=this._validate(t,this.minMonth,this.minDay,ae.local.invalidYear),t=this._t2gYear(L.year());return v.leapYear(t)},weekOfYear:function(a,L,t){var r=this._validate(a,this.minMonth,this.minDay,ae.local.invalidYear),a=this._t2gYear(r.year());return v.weekOfYear(a,r.month(),r.day())},daysInMonth:function(M,L){var t=this._validate(M,L,this.minDay,ae.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===2&&this.leapYear(t.year())?1:0)},weekDay:function(M,L,t){return(this.dayOfWeek(M,L,t)||7)<6},toJD:function(a,L,t){var r=this._validate(a,L,t,ae.local.invalidDate),a=this._t2gYear(r.year());return v.toJD(a,r.month(),r.day())},fromJD:function(M){var L=v.fromJD(M),t=this._g2tYear(L.year());return this.newDate(t,L.month(),L.day())},_t2gYear:function(M){return M+this.yearsOffset+(M>=-this.yearsOffset&&M<=-1?1:0)},_g2tYear:function(M){return M-this.yearsOffset-(M>=1&&M<=this.yearsOffset?1:0)}}),ae.calendars.taiwan=S}}),UQ=Re({"node_modules/world-calendars/dist/calendars/thai.js"(){var ae=rm(),K=gp(),v=ae.instance();function S(M){this.local=this.regionalOptions[M||""]||this.regionalOptions[""]}S.prototype=new ae.baseCalendar,K(S.prototype,{name:"Thai",jdEpoch:15230985e-1,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(t){var L=this._validate(t,this.minMonth,this.minDay,ae.local.invalidYear),t=this._t2gYear(L.year());return v.leapYear(t)},weekOfYear:function(a,L,t){var r=this._validate(a,this.minMonth,this.minDay,ae.local.invalidYear),a=this._t2gYear(r.year());return v.weekOfYear(a,r.month(),r.day())},daysInMonth:function(M,L){var t=this._validate(M,L,this.minDay,ae.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===2&&this.leapYear(t.year())?1:0)},weekDay:function(M,L,t){return(this.dayOfWeek(M,L,t)||7)<6},toJD:function(a,L,t){var r=this._validate(a,L,t,ae.local.invalidDate),a=this._t2gYear(r.year());return v.toJD(a,r.month(),r.day())},fromJD:function(M){var L=v.fromJD(M),t=this._g2tYear(L.year());return this.newDate(t,L.month(),L.day())},_t2gYear:function(M){return M-this.yearsOffset-(M>=1&&M<=this.yearsOffset?1:0)},_g2tYear:function(M){return M+this.yearsOffset+(M>=-this.yearsOffset&&M<=-1?1:0)}}),ae.calendars.thai=S}}),$Q=Re({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var ae=rm(),K=gp();function v(M){this.local=this.regionalOptions[M||""]||this.regionalOptions[""]}v.prototype=new ae.baseCalendar,K(v.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āthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(M){var L=this._validate(M,this.minMonth,this.minDay,ae.local.invalidYear);return this.daysInYear(L.year())===355},weekOfYear:function(M,L,t){var r=this.newDate(M,L,t);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(M){for(var L=0,t=1;t<=12;t++)L+=this.daysInMonth(M,t);return L},daysInMonth:function(M,L){for(var t=this._validate(M,L,this.minDay,ae.local.invalidMonth),r=t.toJD()-24e5+.5,a=0,l=0;lr)return S[a]-S[a-1];a++}return 30},weekDay:function(M,L,t){return this.dayOfWeek(M,L,t)!==5},toJD:function(M,L,t){var r=this._validate(M,L,t,ae.local.invalidDate),a=12*(r.year()-1)+r.month()-15292,l=r.day()+S[a-1]-1;return l+24e5-.5},fromJD:function(M){for(var L=M-24e5+.5,t=0,r=0;rL);r++)t++;var a=t+15292,l=Math.floor((a-1)/12),i=l+1,s=a-12*l,o=L-S[t-1]+1;return this.newDate(i,s,o)},isValid:function(M,L,t){var r=ae.baseCalendar.prototype.isValid.apply(this,arguments);return r&&(M=M.year!=null?M.year:M,r=M>=1276&&M<=1500),r},_validate:function(M,L,t,r){var a=ae.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw r.replace(/\{0\}/,this.local.name);return a}}),ae.calendars.ummalqura=v;var S=[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]}}),VQ=Re({"src/components/calendars/calendars.js"(ae,K){K.exports=rm(),CQ(),kQ(),MQ(),IQ(),LQ(),RQ(),DQ(),PQ(),zQ(),NQ(),OQ(),FQ(),BQ(),UQ(),$Q()}}),jQ=Re({"src/components/calendars/index.js"(ae,K){var v=VQ(),S=Rn(),M=Ia(),L=M.EPOCHJD,t=M.ONEDAY,r={valType:"enumerated",values:S.sortObjectKeys(v.calendars),editType:"calc",dflt:"gregorian"},a=function(T,E,_,h){var m={};return m[_]=r,S.coerce(T,E,m,_,h)},l=function(T,E,_,h){for(var m=0;m<_.length;m++)a(T,E,_[m]+"calendar",h.calendar)},i={chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},s={chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},o={chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},c="##",p={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:c,w:c,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}};function d(T,E,_){for(var h=Math.floor((E+.05)/t)+L,m=g(_).fromJD(h),w=0,F,z,U,V,G;(w=T.indexOf("%",w))!==-1;)F=T.charAt(w+1),F==="0"||F==="-"||F==="_"?(U=3,z=T.charAt(w+2),F==="_"&&(F="-")):(z=F,F="0",U=2),V=p[z],V?(V===c?G=c:G=m.formatDate(V[F]),T=T.slice(0,w)+G+T.slice(w+U),w+=G.length):w+=U;return T}var y={};function g(T){var E=y[T];return E||(E=y[T]=v.instance(T),E)}function C(T){return S.extendFlat({},r,{description:T})}function f(T){return"Sets the calendar system to use with `"+T+"` date data."}var x={xcalendar:C(f("x"))},A=S.extendFlat({},x,{ycalendar:C(f("y"))}),k=S.extendFlat({},A,{zcalendar:C(f("z"))}),I=C(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));K.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:A,bar:A,box:A,heatmap:A,contour:A,histogram:A,histogram2d:A,histogram2dcontour:A,scatter3d:k,surface:k,mesh3d:k,scattergl:A,ohlc:x,candlestick:x},layout:{calendar:C(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:I},yaxis:{calendar:I},scene:{xaxis:{calendar:I},yaxis:{calendar:I},zaxis:{calendar:I}},polar:{radialaxis:{calendar:I}}}},layoutAttributes:r,handleDefaults:a,handleTraceDefaults:l,CANONICAL_SUNDAY:s,CANONICAL_TICK:i,DFLTRANGE:o,getCal:g,worldCalFmt:d}}}),GQ=Re({"lib/calendars.js"(ae,K){K.exports=jQ()}}),qQ=Re({"lib/index.js"(ae,K){var v=BS();v.register([N1(),GS(),xM(),P3(),AM(),aw(),t5(),n5(),X3(),qM(),sw(),AI(),vw(),qy(),nW(),fW(),yW(),zW(),BW(),$W(),qW(),ZW(),tX(),iX(),xX(),TX(),oZ(),bZ(),PZ(),UZ(),ZZ(),eK(),lK(),bK(),SK(),DK(),XK(),eJ(),sJ(),IJ(),FJ(),jJ(),XJ(),JJ(),nQ(),fQ(),gQ(),EQ(),GQ()]),K.exports=v}});return qQ()})();return window.Plotly=n,n})})(vL)),vL.exports}var gU;function P5e(){return gU||(gU=1,(function(u){Object.defineProperty(u,"__esModule",{value:!0}),u.default=void 0;var e=b(L5e()),n=b(D5e());function b(re){return re&&re.__esModule?re:{default:re}}var R=(0,e.default)(n.default),q=R;u.default=q})(mz)),mz}var z5e=P5e();const N5e=yU(z5e);function O5e(u){return Ei.jsxs("div",{children:[Ei.jsxs("p",{children:["Training status: ",u.isTraining?"Running":"Not running"]}),Ei.jsx(N5e,{data:[{x:u.losses.map((e,n)=>n),y:u.losses.map(e=>e.loss),mode:"lines",type:"scatter"}],layout:{xaxis:{title:{text:"Training steps"}},yaxis:{title:{text:"Train loss"}}}}),Ei.jsx(C5e,{info:u.info,onSampleIndexChange:u.onSampleIndexChange,tick:u.tick})]})}function F5e(u){const[e,n]=$u.useState(u.architecture);return Ei.jsxs("div",{className:"card",children:[Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{children:"Architecture Editor"}),Ei.jsx("textarea",{value:e,onChange:b=>n(b.target.value),rows:20,style:{height:"auto"}})]}),Ei.jsx(tb,{onClick:()=>u.onChange(e),children:"Apply Changes"})]})}const B5e={sgd:{learningRate:"0.01",momentum:"0.0",batchSize:"32",epochs:"5"},adam:{learningRate:"0.001",beta1:"0.9",beta2:"0.999",epsilon:"1e-8",batchSize:"32",epochs:"5"}};function U5e(u,e){const n=u.target.value;e(n,B5e[n])}function n1(u,e,n,b,R){const q={...n,[u]:e};R(b,q)}function $5e(u){return Ei.jsxs("div",{className:"card",children:[Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{htmlFor:"optimizer-select",children:"Optimizer"}),Ei.jsxs("select",{id:"optimizer-select",value:u.optimizer,onChange:e=>U5e(e,u.onOptimizerChange),children:[Ei.jsx("option",{value:"sgd",children:"Stochastic Gradient Descent"}),Ei.jsx("option",{value:"adam",children:"Adam"})]})]}),u.optimizer==="sgd"&&Ei.jsxs(Ei.Fragment,{children:[Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{htmlFor:"sgd-learning-rate-input",children:"Learning Rate"}),Ei.jsx("input",{id:"sgd-learning-rate-input",type:"text",value:u.params.learningRate,onChange:e=>n1("learningRate",e.target.value,u.params,u.optimizer,u.onOptimizerChange)})]}),Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{htmlFor:"sgd-momentum-input",children:"Momentum"}),Ei.jsx("input",{id:"sgd-momentum-input",type:"text",value:u.params.momentum,onChange:e=>n1("momentum",e.target.value,u.params,u.optimizer,u.onOptimizerChange)})]}),Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{htmlFor:"sgd-batch-size-input",children:"Batch Size"}),Ei.jsx("input",{id:"sgd-batch-size-input",type:"text",value:u.params.batchSize,onChange:e=>n1("batchSize",e.target.value,u.params,u.optimizer,u.onOptimizerChange)})]}),Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{htmlFor:"sgd-epochs-input",children:"Epochs"}),Ei.jsx("input",{id:"sgd-epochs-input",type:"text",value:u.params.epochs,onChange:e=>n1("epochs",e.target.value,u.params,u.optimizer,u.onOptimizerChange)})]})]}),u.optimizer==="adam"&&Ei.jsxs(Ei.Fragment,{children:[Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{htmlFor:"adam-learning-rate-input",children:"Learning Rate"}),Ei.jsx("input",{id:"adam-learning-rate-input",type:"text",value:u.params.learningRate,onChange:e=>n1("learningRate",e.target.value,u.params,u.optimizer,u.onOptimizerChange)})]}),Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{htmlFor:"adam-beta1-input",children:"Beta 1"}),Ei.jsx("input",{id:"adam-beta1-input",type:"text",value:u.params.beta1,onChange:e=>n1("beta1",e.target.value,u.params,u.optimizer,u.onOptimizerChange)})]}),Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{htmlFor:"adam-beta2-input",children:"Beta 2"}),Ei.jsx("input",{id:"adam-beta2-input",type:"text",value:u.params.beta2,onChange:e=>n1("beta2",e.target.value,u.params,u.optimizer,u.onOptimizerChange)})]}),Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{htmlFor:"adam-epsilon-input",children:"Epsilon"}),Ei.jsx("input",{id:"adam-epsilon-input",type:"text",value:u.params.epsilon,onChange:e=>n1("epsilon",e.target.value,u.params,u.optimizer,u.onOptimizerChange)})]}),Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{htmlFor:"adam-batch-size-input",children:"Batch Size"}),Ei.jsx("input",{id:"adam-batch-size-input",type:"text",value:u.params.batchSize,onChange:e=>n1("batchSize",e.target.value,u.params,u.optimizer,u.onOptimizerChange)})]}),Ei.jsxs("div",{className:"field",children:[Ei.jsx("label",{htmlFor:"adam-epochs-input",children:"Epochs"}),Ei.jsx("input",{id:"adam-epochs-input",type:"text",value:u.params.epochs,onChange:e=>n1("epochs",e.target.value,u.params,u.optimizer,u.onOptimizerChange)})]})]}),!u.isTraining&&Ei.jsxs(Ei.Fragment,{children:[Ei.jsx("button",{onClick:u.onStartTraining,children:"Start Training"}),Ei.jsx("button",{onClick:u.onResetTraining,children:"Reset Training"})]}),u.isTraining&&Ei.jsxs(Ei.Fragment,{children:[Ei.jsx("button",{onClick:u.onPauseTraining,children:"Pause Training"}),Ei.jsx("button",{onClick:u.onContinueTraining,children:"Continue Training"}),Ei.jsx("button",{onClick:u.onStopTraining,children:"Stop Training"})]})]})}function V5e(u){const e=[{label:"Dataset",content:Ei.jsxs("div",{children:["Dataset:",Ei.jsxs("select",{value:"mnist",children:[Ei.jsx("option",{value:"mnist",children:"MNIST"}),Ei.jsx("option",{value:"cifar-10",children:"CIFAR-10"})]})]})},{label:"Architecture",content:Ei.jsx(F5e,{architecture:u.architecture,onChange:u.onArchitectureChange})},{label:"Optimize",content:Ei.jsx(Ei.Fragment,{children:Ei.jsx($5e,{optimizer:u.optimizerType,params:u.optimizerParams,onOptimizerChange:u.onOptimizerChange,onStartTraining:u.onStartTraining,onResetTraining:u.onResetTraining,onPauseTraining:u.onPauseTraining,onContinueTraining:u.onContinueTraining,onStopTraining:u.onStopTraining,isTraining:u.isTraining})})}];return Ei.jsx("div",{className:"sidebar",children:Ei.jsx(i8,{defaultTab:"Dataset",tabs:e})})}const ag=784,d0=10,GL=65e3,j5e=5/6,u2=Math.floor(j5e*GL),bz=GL-u2,G5e="https://storage.googleapis.com/learnjs-data/model-builder/mnist_images.png",q5e="https://storage.googleapis.com/learnjs-data/model-builder/mnist_labels_uint8";class H5e{constructor(){this.shuffledTrainIndex=0,this.shuffledTestIndex=0,this.numClasses=d0,this.numInputChannels=1,this.trainSize=u2,this.testSize=bz,this.imageSize=28}async load(){const e=new Image,n=document.createElement("canvas"),b=n.getContext("2d"),R=new Promise((he,be)=>{e.crossOrigin="",e.onload=()=>{e.width=e.naturalWidth,e.height=e.naturalHeight;const Pe=new ArrayBuffer(GL*ag*4),je=5e3;n.width=e.width,n.height=je;for(let We=0;We(this.shuffledTrainIndex=(this.shuffledTrainIndex+1)%this.trainIndices.length,this.trainIndices[this.shuffledTrainIndex]))}nextTestBatch(e){return this.nextBatch(e,[this.testImages,this.testLabels],()=>(this.shuffledTestIndex=(this.shuffledTestIndex+1)%this.testIndices.length,this.testIndices[this.shuffledTestIndex]))}nextBatch(e,n,b){const R=new Float32Array(e*ag),q=new Uint8Array(e*d0);for(let he=0;he{const jt=u.nextTrainBatch(b),Re=jt.xs.reshape([b,u.imageSize,u.imageSize,u.numInputChannels]),Lr=e.forward(Re);return Use.softmaxCrossEntropy(jt.labels,Lr).mean()},!0).data())[0],We=u.getTestSample(q.sampleIndex),{output:ft,info:xt}=e.forwardWithInfo(We.xs.reshape([1,u.imageSize,u.imageSize,u.numInputChannels])),zt=Zi(()=>tD(ft)),Ft=zt.shape;if(xt.push({type:"output",output:zt.dataSync(),shape:Ft}),q.stopRequested){console.log("Training stopped");return}re&&re(he,be,je,xt),await SL()}console.log("Training complete")}const Z5e=`[conv2d filters=8 kernel=11 +stride=1 padding=1 activation=relu] + +[maxpool size=2 stride=2] + +[flatten] + +[dense units=10 activation=softmax]`;function K5e(u){if(u.trim()==="")return u;const e=Number(u);return Number.isNaN(e)?u:e}function J5e(u){const e=[],n=u.match(/\[(.*?)\]/gs);if(!n)return e;for(const b of n){const R=b.slice(1,-1).trim();if(R.length===0)continue;const q=R.split(/\s+/);if(q.length===0)continue;const fe={type:q[0]};for(let he=1;he{async function $i(){const Hn=await W5e(n);be(Hn)}$i()},[n]),$u.useEffect(()=>{ui(),da()},[xt,he,Pe,We]);function Pn(){console.log("Starting training..."),Ia()}function Vn(){console.log("Pausing training..."),Lr.current.isPaused=!0}function un(){console.log("Continuing training..."),Lr.current.isPaused=!1}function Nn(){console.log("Stopping training..."),Lr.current.stopRequested=!0,Lr.current.isPaused=!1}async function Kr(){return new Promise($i=>{function Hn(){Ft?requestAnimationFrame(Hn):$i()}Hn()})}async function Ma(){console.log("Resetting training..."),Nn(),await Kr(),console.log("Training stopped. Resetting model."),Re.current=[],yn.current=[],ui(),da()}function ui(){if(!he)return;Cr.current&&Cr.current.dispose();const $i=he.numInputChannels,Hn=new X5e(J5e(xt),$i);Cr.current=Hn,Ui()}function da(){if(Pe==="adam"){const $i=parseFloat(We.learningRate),Hn=parseFloat(We.beta1),qa=parseFloat(We.beta2),ki=parseFloat(We.epsilon);if(Number.isNaN($i)||$i<=0){alert("Invalid learning rate for Adam optimizer.");return}if(Number.isNaN(Hn)||Hn<0){alert("Invalid beta1 for Adam optimizer.");return}if(Number.isNaN(qa)||qa<0){alert("Invalid beta2 for Adam optimizer.");return}if(Number.isNaN(ki)||ki<=0){alert("Invalid epsilon for Adam optimizer.");return}const no=Qx.adam($i,Hn,qa,ki);Gr.current&&Gr.current.dispose(),Gr.current=no}else if(Pe==="sgd"){const $i=parseFloat(We.learningRate);if(Number.isNaN($i)||$i<=0){alert("Invalid learning rate for SGD optimizer.");return}const Hn=Qx.sgd($i);Gr.current&&Gr.current.dispose(),Gr.current=Hn}else alert(`Unsupported optimizer type: ${Pe}`)}async function Ia(){if(!Cr||!he||!Gr||Ft)return;jt(!0),Lr.current.isPaused=!1,Lr.current.stopRequested=!1;const $i=parseFloat(We.batchSize);if(Number.isNaN($i)||$i<=0){alert("Invalid batch size."),jt(!1);return}const Hn=parseFloat(We.epochs);if(Number.isNaN(Hn)||Hn<=0){alert("Invalid number of epochs."),jt(!1);return}let qa=0;try{await Y5e(he,Cr.current,Gr.current,$i,Hn,Lr.current,(ki,no,oo,Li)=>{Re.current.push({epoch:ki,batch:no,loss:oo}),yn.current=Li;const Do=performance.now();Do-qa>50&&(qa=Do,Ui())})}finally{jt(!1),Lr.current.isPaused=!1,Lr.current.stopRequested=!1,alert("Training finished.")}}function aa($i){Ft?alert("Cannot change architecture while training is in progress."):zt($i)}function Ka($i,Hn){Ft?alert("Cannot change optimizer settings while training is in progress."):(je($i),ft(Hn))}function ai(){Lr.current.sampleIndex+=1,Ui()}function Ui(){e($i=>$i+1)}return Ei.jsxs("div",{className:"network-visualizer",children:[Ei.jsx(O5e,{losses:Re.current,info:yn.current,isTraining:Ft,onSampleIndexChange:ai,tick:u}),Ei.jsx(V5e,{onStartTraining:Pn,onPauseTraining:Vn,onContinueTraining:un,onStopTraining:Nn,onResetTraining:Ma,isTraining:Ft,isPaused:Lr.current.isPaused,architecture:xt,onArchitectureChange:aa,optimizerType:Pe,optimizerParams:We,onOptimizerChange:Ka,tick:u})]})}function eEe(){const u=[{label:"Convolution",content:Ei.jsx(tte,{})},{label:"Network",content:Ei.jsx(Q5e,{})}];return Ei.jsxs(Ei.Fragment,{children:[Ei.jsx("h1",{children:"CNN Visualizer"}),Ei.jsx(i8,{defaultTab:"Convolution",tabs:u})]})}Bee.createRoot(document.getElementById("root")).render(Ei.jsx($u.StrictMode,{children:Ei.jsx(eEe,{})})); diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000000000000000000000000000000000000..2f47b943cbd4cc4dbceb1db65d3ffbdc41412ddb --- /dev/null +++ b/dist/index.html @@ -0,0 +1,14 @@ + + + + + + + moz-todo-react + + + + +

+ + diff --git a/frontends/react/public/vite.svg b/dist/vite.svg similarity index 100% rename from frontends/react/public/vite.svg rename to dist/vite.svg diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000000000000000000000000000000000000..4fa125da29e01fa85529cfa06a83a7c0ce240d55 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,29 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{js,jsx}'], + extends: [ + js.configs.recommended, + reactHooks.configs.flat.recommended, + reactRefresh.configs.vite, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + parserOptions: { + ecmaVersion: 'latest', + ecmaFeatures: { jsx: true }, + sourceType: 'module', + }, + }, + rules: { + 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], + }, + }, +]) diff --git a/index.html b/index.html new file mode 100644 index 0000000000000000000000000000000000000000..7b63d7981fb79cdab11f3498fab1f88639bd5762 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + moz-todo-react + + +
+ + + diff --git a/backend/src/manager.py b/new/backend/src/manager.py similarity index 100% rename from backend/src/manager.py rename to new/backend/src/manager.py diff --git a/frontends/react/.gitignore b/new/frontends/react/.gitignore similarity index 100% rename from frontends/react/.gitignore rename to new/frontends/react/.gitignore diff --git a/frontends/react/README.md b/new/frontends/react/README.md similarity index 100% rename from frontends/react/README.md rename to new/frontends/react/README.md diff --git a/frontends/react/eslint.config.js b/new/frontends/react/eslint.config.js similarity index 100% rename from frontends/react/eslint.config.js rename to new/frontends/react/eslint.config.js diff --git a/frontends/react/index.html b/new/frontends/react/index.html similarity index 100% rename from frontends/react/index.html rename to new/frontends/react/index.html diff --git a/frontends/react/package-lock.json b/new/frontends/react/package-lock.json similarity index 100% rename from frontends/react/package-lock.json rename to new/frontends/react/package-lock.json diff --git a/frontends/react/package.json b/new/frontends/react/package.json similarity index 100% rename from frontends/react/package.json rename to new/frontends/react/package.json diff --git a/new/frontends/react/public/vite.svg b/new/frontends/react/public/vite.svg new file mode 100644 index 0000000000000000000000000000000000000000..e7b8dfb1b2a60bd50538bec9f876511b9cac21e3 --- /dev/null +++ b/new/frontends/react/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontends/react/src/App.tsx b/new/frontends/react/src/App.tsx similarity index 100% rename from frontends/react/src/App.tsx rename to new/frontends/react/src/App.tsx diff --git a/frontends/react/src/DataViewer.tsx b/new/frontends/react/src/DataViewer.tsx similarity index 100% rename from frontends/react/src/DataViewer.tsx rename to new/frontends/react/src/DataViewer.tsx diff --git a/frontends/react/src/NetworkViewer.tsx b/new/frontends/react/src/NetworkViewer.tsx similarity index 100% rename from frontends/react/src/NetworkViewer.tsx rename to new/frontends/react/src/NetworkViewer.tsx diff --git a/frontends/react/src/PyodideBackend.ts b/new/frontends/react/src/PyodideBackend.ts similarity index 100% rename from frontends/react/src/PyodideBackend.ts rename to new/frontends/react/src/PyodideBackend.ts diff --git a/frontends/react/src/Sidebar.tsx b/new/frontends/react/src/Sidebar.tsx similarity index 100% rename from frontends/react/src/Sidebar.tsx rename to new/frontends/react/src/Sidebar.tsx diff --git a/frontends/react/src/assets/react.svg b/new/frontends/react/src/assets/react.svg similarity index 100% rename from frontends/react/src/assets/react.svg rename to new/frontends/react/src/assets/react.svg diff --git a/frontends/react/src/index.css b/new/frontends/react/src/index.css similarity index 100% rename from frontends/react/src/index.css rename to new/frontends/react/src/index.css diff --git a/frontends/react/src/main.tsx b/new/frontends/react/src/main.tsx similarity index 100% rename from frontends/react/src/main.tsx rename to new/frontends/react/src/main.tsx diff --git a/frontends/react/src/pyodide.worker.ts b/new/frontends/react/src/pyodide.worker.ts similarity index 100% rename from frontends/react/src/pyodide.worker.ts rename to new/frontends/react/src/pyodide.worker.ts diff --git a/frontends/react/src/ui/Button.tsx b/new/frontends/react/src/ui/Button.tsx similarity index 100% rename from frontends/react/src/ui/Button.tsx rename to new/frontends/react/src/ui/Button.tsx diff --git a/frontends/react/src/ui/Dropdown.tsx b/new/frontends/react/src/ui/Dropdown.tsx similarity index 100% rename from frontends/react/src/ui/Dropdown.tsx rename to new/frontends/react/src/ui/Dropdown.tsx diff --git a/frontends/react/src/ui/FileUploader.tsx b/new/frontends/react/src/ui/FileUploader.tsx similarity index 100% rename from frontends/react/src/ui/FileUploader.tsx rename to new/frontends/react/src/ui/FileUploader.tsx diff --git a/frontends/react/src/ui/FilesUploader.tsx b/new/frontends/react/src/ui/FilesUploader.tsx similarity index 100% rename from frontends/react/src/ui/FilesUploader.tsx rename to new/frontends/react/src/ui/FilesUploader.tsx diff --git a/frontends/react/src/ui/InputField.tsx b/new/frontends/react/src/ui/InputField.tsx similarity index 100% rename from frontends/react/src/ui/InputField.tsx rename to new/frontends/react/src/ui/InputField.tsx diff --git a/frontends/react/src/ui/LoadingScreen.tsx b/new/frontends/react/src/ui/LoadingScreen.tsx similarity index 100% rename from frontends/react/src/ui/LoadingScreen.tsx rename to new/frontends/react/src/ui/LoadingScreen.tsx diff --git a/frontends/react/src/ui/Radio.tsx b/new/frontends/react/src/ui/Radio.tsx similarity index 100% rename from frontends/react/src/ui/Radio.tsx rename to new/frontends/react/src/ui/Radio.tsx diff --git a/frontends/react/src/ui/Tabs.tsx b/new/frontends/react/src/ui/Tabs.tsx similarity index 100% rename from frontends/react/src/ui/Tabs.tsx rename to new/frontends/react/src/ui/Tabs.tsx diff --git a/frontends/react/src/useAppLogic.ts b/new/frontends/react/src/useAppLogic.ts similarity index 100% rename from frontends/react/src/useAppLogic.ts rename to new/frontends/react/src/useAppLogic.ts diff --git a/frontends/react/src/usePyodideBackend.ts b/new/frontends/react/src/usePyodideBackend.ts similarity index 100% rename from frontends/react/src/usePyodideBackend.ts rename to new/frontends/react/src/usePyodideBackend.ts diff --git a/frontends/react/tsconfig.app.json b/new/frontends/react/tsconfig.app.json similarity index 100% rename from frontends/react/tsconfig.app.json rename to new/frontends/react/tsconfig.app.json diff --git a/frontends/react/tsconfig.json b/new/frontends/react/tsconfig.json similarity index 100% rename from frontends/react/tsconfig.json rename to new/frontends/react/tsconfig.json diff --git a/frontends/react/tsconfig.node.json b/new/frontends/react/tsconfig.node.json similarity index 100% rename from frontends/react/tsconfig.node.json rename to new/frontends/react/tsconfig.node.json diff --git a/frontends/react/vite.config.ts b/new/frontends/react/vite.config.ts similarity index 100% rename from frontends/react/vite.config.ts rename to new/frontends/react/vite.config.ts diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..9c35f5e1ce5319c4514804a17b703312589491c9 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6331 @@ +{ + "name": "moz-todo-react", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "moz-todo-react", + "version": "0.0.0", + "dependencies": { + "@tensorflow/tfjs": "^4.22.0", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "react-plotly.js": "^2.6.0" + }, + "devDependencies": { + "@eslint/js": "^9.39.1", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "vite": "^7.3.1" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", + "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.28.5", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", + "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", + "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-module-transforms": "^7.28.6", + "@babel/helpers": "^7.28.6", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", + "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", + "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", + "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.28.6", + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", + "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz", + "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz", + "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", + "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", + "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", + "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.28.6", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", + "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@choojs/findup": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@choojs/findup/-/findup-0.2.1.tgz", + "integrity": "sha512-YstAqNb0MCN8PjdLCDfRsBcGVRN41f3vgLvaI0IrIcBp4AqILRSS0DeWNGkicC+f/zRIPJLc+9RURVSepwvfBw==", + "license": "MIT", + "peer": true, + "dependencies": { + "commander": "^2.15.1" + }, + "bin": { + "findup": "bin/findup.js" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", + "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", + "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", + "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", + "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", + "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", + "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", + "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", + "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", + "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", + "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", + "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", + "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", + "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", + "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", + "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", + "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", + "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", + "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", + "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", + "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", + "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", + "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", + "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", + "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", + "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", + "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", + "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.2.tgz", + "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@mapbox/geojson-rewind": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", + "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==", + "license": "ISC", + "peer": true, + "dependencies": { + "get-stream": "^6.0.1", + "minimist": "^1.2.6" + }, + "bin": { + "geojson-rewind": "geojson-rewind" + } + }, + "node_modules/@mapbox/geojson-types": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz", + "integrity": "sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw==", + "license": "ISC", + "peer": true + }, + "node_modules/@mapbox/jsonlint-lines-primitives": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", + "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@mapbox/mapbox-gl-supported": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.5.0.tgz", + "integrity": "sha512-/PT1P6DNf7vjEEiPkVIRJkvibbqWtqnyGaBz3nfRdcxclNSnSdaLU5tfAgcD7I8Yt5i+L19s406YLl1koLnLbg==", + "license": "BSD-3-Clause", + "peer": true, + "peerDependencies": { + "mapbox-gl": ">=0.32.1 <2.0.0" + } + }, + "node_modules/@mapbox/point-geometry": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", + "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==", + "license": "ISC", + "peer": true + }, + "node_modules/@mapbox/tiny-sdf": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-1.2.5.tgz", + "integrity": "sha512-cD8A/zJlm6fdJOk6DqPUV8mcpyJkRz2x2R+/fYcWDYG3oWbG7/L7Yl/WqQ1VZCjnL9OTIMAn6c+BC5Eru4sQEw==", + "license": "BSD-2-Clause", + "peer": true + }, + "node_modules/@mapbox/unitbezier": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz", + "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA==", + "license": "BSD-2-Clause", + "peer": true + }, + "node_modules/@mapbox/vector-tile": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz", + "integrity": "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@mapbox/point-geometry": "~0.1.0" + } + }, + "node_modules/@mapbox/whoots-js": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz", + "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@maplibre/maplibre-gl-style-spec": { + "version": "20.4.0", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.4.0.tgz", + "integrity": "sha512-AzBy3095fTFPjDjmWpR2w6HVRAZJ6hQZUCwk5Plz6EyfnfuQW1odeW5i2Ai47Y6TBA2hQnC+azscjBSALpaWgw==", + "license": "ISC", + "peer": true, + "dependencies": { + "@mapbox/jsonlint-lines-primitives": "~2.0.2", + "@mapbox/unitbezier": "^0.0.1", + "json-stringify-pretty-compact": "^4.0.0", + "minimist": "^1.2.8", + "quickselect": "^2.0.0", + "rw": "^1.3.3", + "tinyqueue": "^3.0.0" + }, + "bin": { + "gl-style-format": "dist/gl-style-format.mjs", + "gl-style-migrate": "dist/gl-style-migrate.mjs", + "gl-style-validate": "dist/gl-style-validate.mjs" + } + }, + "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/@mapbox/unitbezier": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==", + "license": "BSD-2-Clause", + "peer": true + }, + "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/tinyqueue": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", + "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==", + "license": "ISC", + "peer": true + }, + "node_modules/@plotly/d3": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/@plotly/d3/-/d3-3.8.2.tgz", + "integrity": "sha512-wvsNmh1GYjyJfyEBPKJLTMzgf2c2bEbSIL50lmqVUi+o1NHaLPi1Lb4v7VxXXJn043BhNyrxUrWI85Q+zmjOVA==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@plotly/d3-sankey": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@plotly/d3-sankey/-/d3-sankey-0.7.2.tgz", + "integrity": "sha512-2jdVos1N3mMp3QW0k2q1ph7Gd6j5PY1YihBrwpkFnKqO+cqtZq3AdEYUeSGXMeLsBDQYiqTVcihYfk8vr5tqhw==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "d3-array": "1", + "d3-collection": "1", + "d3-shape": "^1.2.0" + } + }, + "node_modules/@plotly/d3-sankey-circular": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@plotly/d3-sankey-circular/-/d3-sankey-circular-0.33.1.tgz", + "integrity": "sha512-FgBV1HEvCr3DV7RHhDsPXyryknucxtfnLwPtCKKxdolKyTFYoLX/ibEfX39iFYIL7DYbVeRtP43dbFcrHNE+KQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "d3-array": "^1.2.1", + "d3-collection": "^1.0.4", + "d3-shape": "^1.2.0", + "elementary-circuits-directed-graph": "^1.0.4" + } + }, + "node_modules/@plotly/mapbox-gl": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/@plotly/mapbox-gl/-/mapbox-gl-1.13.4.tgz", + "integrity": "sha512-sR3/Pe5LqT/fhYgp4rT4aSFf1rTsxMbGiH6Hojc7PH36ny5Bn17iVFUjpzycafETURuFbLZUfjODO8LvSI+5zQ==", + "license": "SEE LICENSE IN LICENSE.txt", + "peer": true, + "dependencies": { + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/geojson-types": "^1.0.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/mapbox-gl-supported": "^1.5.0", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^1.1.1", + "@mapbox/unitbezier": "^0.0.0", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "csscolorparser": "~1.0.3", + "earcut": "^2.2.2", + "geojson-vt": "^3.2.1", + "gl-matrix": "^3.2.1", + "grid-index": "^1.1.0", + "murmurhash-js": "^1.0.0", + "pbf": "^3.2.1", + "potpack": "^1.0.1", + "quickselect": "^2.0.0", + "rw": "^1.3.3", + "supercluster": "^7.1.0", + "tinyqueue": "^2.0.3", + "vt-pbf": "^3.1.1" + }, + "engines": { + "node": ">=6.4.0" + } + }, + "node_modules/@plotly/point-cluster": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@plotly/point-cluster/-/point-cluster-3.1.9.tgz", + "integrity": "sha512-MwaI6g9scKf68Orpr1pHZ597pYx9uP8UEFXLPbsCmuw3a84obwz6pnMXGc90VhgDNeNiLEdlmuK7CPo+5PIxXw==", + "license": "MIT", + "peer": true, + "dependencies": { + "array-bounds": "^1.0.1", + "binary-search-bounds": "^2.0.4", + "clamp": "^1.0.1", + "defined": "^1.0.0", + "dtype": "^2.0.0", + "flatten-vertex-data": "^1.0.2", + "is-obj": "^1.0.1", + "math-log2": "^1.0.1", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0" + } + }, + "node_modules/@plotly/regl": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@plotly/regl/-/regl-2.1.2.tgz", + "integrity": "sha512-Mdk+vUACbQvjd0m/1JJjOOafmkp/EpmHjISsopEz5Av44CBq7rPC05HHNbYGKVyNUF2zmEoBS/TT0pd0SPFFyw==", + "license": "MIT", + "peer": true + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.3", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz", + "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.57.1.tgz", + "integrity": "sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.57.1.tgz", + "integrity": "sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.57.1.tgz", + "integrity": "sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.57.1.tgz", + "integrity": "sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.57.1.tgz", + "integrity": "sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.57.1.tgz", + "integrity": "sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.57.1.tgz", + "integrity": "sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.57.1.tgz", + "integrity": "sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.57.1.tgz", + "integrity": "sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.57.1.tgz", + "integrity": "sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.57.1.tgz", + "integrity": "sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.57.1.tgz", + "integrity": "sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.57.1.tgz", + "integrity": "sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.57.1.tgz", + "integrity": "sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.57.1.tgz", + "integrity": "sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.57.1.tgz", + "integrity": "sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.57.1.tgz", + "integrity": "sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.57.1.tgz", + "integrity": "sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.57.1.tgz", + "integrity": "sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.57.1.tgz", + "integrity": "sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.57.1.tgz", + "integrity": "sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.57.1.tgz", + "integrity": "sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.57.1.tgz", + "integrity": "sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.57.1.tgz", + "integrity": "sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.57.1.tgz", + "integrity": "sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@tensorflow/tfjs": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@tensorflow/tfjs/-/tfjs-4.22.0.tgz", + "integrity": "sha512-0TrIrXs6/b7FLhLVNmfh8Sah6JgjBPH4mZ8JGb7NU6WW+cx00qK5BcAZxw7NCzxj6N8MRAIfHq+oNbPUNG5VAg==", + "license": "Apache-2.0", + "dependencies": { + "@tensorflow/tfjs-backend-cpu": "4.22.0", + "@tensorflow/tfjs-backend-webgl": "4.22.0", + "@tensorflow/tfjs-converter": "4.22.0", + "@tensorflow/tfjs-core": "4.22.0", + "@tensorflow/tfjs-data": "4.22.0", + "@tensorflow/tfjs-layers": "4.22.0", + "argparse": "^1.0.10", + "chalk": "^4.1.0", + "core-js": "3.29.1", + "regenerator-runtime": "^0.13.5", + "yargs": "^16.0.3" + }, + "bin": { + "tfjs-custom-module": "dist/tools/custom_module/cli.js" + } + }, + "node_modules/@tensorflow/tfjs-backend-cpu": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-cpu/-/tfjs-backend-cpu-4.22.0.tgz", + "integrity": "sha512-1u0FmuLGuRAi8D2c3cocHTASGXOmHc/4OvoVDENJayjYkS119fcTcQf4iHrtLthWyDIPy3JiPhRrZQC9EwnhLw==", + "license": "Apache-2.0", + "dependencies": { + "@types/seedrandom": "^2.4.28", + "seedrandom": "^3.0.5" + }, + "engines": { + "yarn": ">= 1.3.2" + }, + "peerDependencies": { + "@tensorflow/tfjs-core": "4.22.0" + } + }, + "node_modules/@tensorflow/tfjs-backend-webgl": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-backend-webgl/-/tfjs-backend-webgl-4.22.0.tgz", + "integrity": "sha512-H535XtZWnWgNwSzv538czjVlbJebDl5QTMOth4RXr2p/kJ1qSIXE0vZvEtO+5EC9b00SvhplECny2yDewQb/Yg==", + "license": "Apache-2.0", + "dependencies": { + "@tensorflow/tfjs-backend-cpu": "4.22.0", + "@types/offscreencanvas": "~2019.3.0", + "@types/seedrandom": "^2.4.28", + "seedrandom": "^3.0.5" + }, + "engines": { + "yarn": ">= 1.3.2" + }, + "peerDependencies": { + "@tensorflow/tfjs-core": "4.22.0" + } + }, + "node_modules/@tensorflow/tfjs-converter": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-4.22.0.tgz", + "integrity": "sha512-PT43MGlnzIo+YfbsjM79Lxk9lOq6uUwZuCc8rrp0hfpLjF6Jv8jS84u2jFb+WpUeuF4K33ZDNx8CjiYrGQ2trQ==", + "license": "Apache-2.0", + "peerDependencies": { + "@tensorflow/tfjs-core": "4.22.0" + } + }, + "node_modules/@tensorflow/tfjs-core": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-core/-/tfjs-core-4.22.0.tgz", + "integrity": "sha512-LEkOyzbknKFoWUwfkr59vSB68DMJ4cjwwHgicXN0DUi3a0Vh1Er3JQqCI1Hl86GGZQvY8ezVrtDIvqR1ZFW55A==", + "license": "Apache-2.0", + "dependencies": { + "@types/long": "^4.0.1", + "@types/offscreencanvas": "~2019.7.0", + "@types/seedrandom": "^2.4.28", + "@webgpu/types": "0.1.38", + "long": "4.0.0", + "node-fetch": "~2.6.1", + "seedrandom": "^3.0.5" + }, + "engines": { + "yarn": ">= 1.3.2" + } + }, + "node_modules/@tensorflow/tfjs-core/node_modules/@types/offscreencanvas": { + "version": "2019.7.3", + "resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz", + "integrity": "sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==", + "license": "MIT" + }, + "node_modules/@tensorflow/tfjs-data": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-data/-/tfjs-data-4.22.0.tgz", + "integrity": "sha512-dYmF3LihQIGvtgJrt382hSRH4S0QuAp2w1hXJI2+kOaEqo5HnUPG0k5KA6va+S1yUhx7UBToUKCBHeLHFQRV4w==", + "license": "Apache-2.0", + "dependencies": { + "@types/node-fetch": "^2.1.2", + "node-fetch": "~2.6.1", + "string_decoder": "^1.3.0" + }, + "peerDependencies": { + "@tensorflow/tfjs-core": "4.22.0", + "seedrandom": "^3.0.5" + } + }, + "node_modules/@tensorflow/tfjs-layers": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-layers/-/tfjs-layers-4.22.0.tgz", + "integrity": "sha512-lybPj4ZNj9iIAPUj7a8ZW1hg8KQGfqWLlCZDi9eM/oNKCCAgchiyzx8OrYoWmRrB+AM6VNEeIT+2gZKg5ReihA==", + "license": "Apache-2.0 AND MIT", + "peerDependencies": { + "@tensorflow/tfjs-core": "4.22.0" + } + }, + "node_modules/@tensorflow/tfjs/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@turf/area": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@turf/area/-/area-7.3.4.tgz", + "integrity": "sha512-UEQQFw2XwHpozSBAMEtZI3jDsAad4NnHL/poF7/S6zeDCjEBCkt3MYd6DSGH/cvgcOozxH/ky3/rIVSMZdx4vA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@turf/helpers": "7.3.4", + "@turf/meta": "7.3.4", + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/bbox": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@turf/bbox/-/bbox-7.3.4.tgz", + "integrity": "sha512-D5ErVWtfQbEPh11yzI69uxqrcJmbPU/9Y59f1uTapgwAwQHQztDWgsYpnL3ns8r1GmPWLP8sGJLVTIk2TZSiYA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@turf/helpers": "7.3.4", + "@turf/meta": "7.3.4", + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/centroid": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@turf/centroid/-/centroid-7.3.4.tgz", + "integrity": "sha512-6c3kyTSKBrmiPMe75UkHw6MgedroZ6eR5usEvdlDhXgA3MudFPXIZkMFmMd1h9XeJ9xFfkmq+HPCdF0cOzvztA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@turf/helpers": "7.3.4", + "@turf/meta": "7.3.4", + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/helpers": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-7.3.4.tgz", + "integrity": "sha512-U/S5qyqgx3WTvg4twaH0WxF3EixoTCfDsmk98g1E3/5e2YKp7JKYZdz0vivsS5/UZLJeZDEElOSFH4pUgp+l7g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/meta": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-7.3.4.tgz", + "integrity": "sha512-tlmw9/Hs1p2n0uoHVm1w3ugw1I6L8jv9YZrcdQa4SH5FX5UY0ATrKeIvfA55FlL//PGuYppJp+eyg/0eb4goqw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@turf/helpers": "7.3.4", + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "license": "MIT", + "peer": true + }, + "node_modules/@types/geojson-vt": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz", + "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "license": "MIT" + }, + "node_modules/@types/mapbox__point-geometry": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz", + "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==", + "license": "MIT", + "peer": true + }, + "node_modules/@types/mapbox__vector-tile": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz", + "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/geojson": "*", + "@types/mapbox__point-geometry": "*", + "@types/pbf": "*" + } + }, + "node_modules/@types/node": { + "version": "25.2.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.2.tgz", + "integrity": "sha512-BkmoP5/FhRYek5izySdkOneRyXYN35I860MFAGupTdebyE66uZaR+bXLHq8k4DirE5DwQi3NuhvRU1jqTVwUrQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.6.13", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.13.tgz", + "integrity": "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.4" + } + }, + "node_modules/@types/offscreencanvas": { + "version": "2019.3.0", + "resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.3.0.tgz", + "integrity": "sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==", + "license": "MIT" + }, + "node_modules/@types/pbf": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz", + "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==", + "license": "MIT", + "peer": true + }, + "node_modules/@types/react": { + "version": "19.2.13", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.13.tgz", + "integrity": "sha512-KkiJeU6VbYbUOp5ITMIc7kBfqlYkKA5KhEHVrGMmUUMt7NeaZg65ojdPk+FtNrBAOXNVM5QM72jnADjM+XVRAQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@types/seedrandom": { + "version": "2.4.34", + "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.34.tgz", + "integrity": "sha512-ytDiArvrn/3Xk6/vtylys5tlY6eo7Ane0hvcx++TKo6RxQXuVfW0AF/oeWqAj9dN29SyhtawuXstgmPlwNcv/A==", + "license": "MIT" + }, + "node_modules/@types/supercluster": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz", + "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.4.tgz", + "integrity": "sha512-VIcFLdRi/VYRU8OL/puL7QXMYafHmqOnwTZY50U1JPlCNj30PxCMx65c494b1K9be9hX83KVt0+gTEwTWLqToA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.29.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-rc.3", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.18.0" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/@webgpu/types": { + "version": "0.1.38", + "resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.38.tgz", + "integrity": "sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA==", + "license": "BSD-3-Clause" + }, + "node_modules/abs-svg-path": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/abs-svg-path/-/abs-svg-path-0.1.1.tgz", + "integrity": "sha512-d8XPSGjfyzlXC3Xx891DJRyZfqk5JU0BJrDQcsWomFIV1/BIzPW5HDH5iDdWpqWaav0YVIEzT1RHTwWr0FFshA==", + "license": "MIT", + "peer": true + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-bounds": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-bounds/-/array-bounds-1.0.1.tgz", + "integrity": "sha512-8wdW3ZGk6UjMPJx/glyEt0sLzzwAE1bhToPsO1W2pbpR2gULyxe3BjSiuJFheP50T/GgODVPz2fuMUmIywt8cQ==", + "license": "MIT", + "peer": true + }, + "node_modules/array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-normalize": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array-normalize/-/array-normalize-1.1.4.tgz", + "integrity": "sha512-fCp0wKFLjvSPmCn4F5Tiw4M3lpMZoHlCjfcs7nNzuj3vqQQ1/a8cgB9DXcpDSn18c+coLnaW7rqfcYCvKbyJXg==", + "license": "MIT", + "peer": true, + "dependencies": { + "array-bounds": "^1.0.0" + } + }, + "node_modules/array-range": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-range/-/array-range-1.0.1.tgz", + "integrity": "sha512-shdaI1zT3CVNL2hnx9c0JMc0ZogGaxDs5e85akgHWKYa0yVbIyp06Ind3dVkTj/uuFrzaHBOyqFzo+VV6aXgtA==", + "license": "MIT", + "peer": true + }, + "node_modules/array-rearrange": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/array-rearrange/-/array-rearrange-2.2.2.tgz", + "integrity": "sha512-UfobP5N12Qm4Qu4fwLDIi2v6+wZsSf6snYSxAMeKhrh37YGnNWZPRmVEKc/2wfms53TLQnzfpG8wCx2Y/6NG1w==", + "license": "MIT", + "peer": true + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.9.19", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.19.tgz", + "integrity": "sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/binary-search-bounds": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/binary-search-bounds/-/binary-search-bounds-2.0.5.tgz", + "integrity": "sha512-H0ea4Fd3lS1+sTEB2TgcLoK21lLhwEJzlQv3IN47pJS976Gx4zoWe0ak3q+uYh60ppQxg9F16Ri4tS1sfD4+jA==", + "license": "MIT", + "peer": true + }, + "node_modules/bit-twiddle": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bit-twiddle/-/bit-twiddle-1.0.2.tgz", + "integrity": "sha512-B9UhK0DKFZhoTFcfvAzhqsjStvGJp9vYWf3+6SNTtdSQnvIgfkHbgHrg/e4+TH71N2GDu8tpmCVoyfrL1d7ntA==", + "license": "MIT", + "peer": true + }, + "node_modules/bitmap-sdf": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/bitmap-sdf/-/bitmap-sdf-1.0.4.tgz", + "integrity": "sha512-1G3U4n5JE6RAiALMxu0p1XmeZkTeCwGKykzsLTCqVzfSDaN6S7fKnkIkfejogz+iwqBWc0UYAIKnKHNN7pSfDg==", + "license": "MIT", + "peer": true + }, + "node_modules/bl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", + "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==", + "license": "MIT", + "peer": true, + "dependencies": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT", + "peer": true + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001769", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001769.tgz", + "integrity": "sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/canvas-fit": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/canvas-fit/-/canvas-fit-1.5.0.tgz", + "integrity": "sha512-onIcjRpz69/Hx5bB5HGbYKUF2uC6QT6Gp+pfpGm3A7mPfcluSLV5v4Zu+oflDUwLdUw0rLIBhUbi0v8hM4FJQQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "element-size": "^1.1.1" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/clamp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/clamp/-/clamp-1.0.1.tgz", + "integrity": "sha512-kgMuFyE78OC6Dyu3Dy7vcx4uy97EIbVxJB/B0eJ3bUNAkwdNcxYzgKltnyADiYwsR7SEqkkUPsEUT//OVS6XMA==", + "license": "MIT", + "peer": true + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-alpha": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/color-alpha/-/color-alpha-1.0.4.tgz", + "integrity": "sha512-lr8/t5NPozTSqli+duAN+x+no/2WaKTeWvxhHGN+aXT6AJ8vPlzLa7UriyjWak0pSC2jHol9JgjBYnnHsGha9A==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-parse": "^1.3.8" + } + }, + "node_modules/color-alpha/node_modules/color-parse": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.3.tgz", + "integrity": "sha512-BADfVl/FHkQkyo8sRBwMYBqemqsgnu7JZAwUgvBvuwwuNUZAhSvLTbsEErS5bQXzOjDR0dWzJ4vXN2Q+QoPx0A==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-id": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/color-id/-/color-id-1.1.0.tgz", + "integrity": "sha512-2iRtAn6dC/6/G7bBIo0uupVrIne1NsQJvJxZOBCzQOfk7jRq97feaDZ3RdzuHakRXXnHGNwglto3pqtRx1sX0g==", + "license": "MIT", + "peer": true, + "dependencies": { + "clamp": "^1.0.1" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/color-normalize": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/color-normalize/-/color-normalize-1.5.0.tgz", + "integrity": "sha512-rUT/HDXMr6RFffrR53oX3HGWkDOP9goSAQGBkUaAYKjOE2JxozccdGyufageWDlInRAjm/jYPrf/Y38oa+7obw==", + "license": "MIT", + "peer": true, + "dependencies": { + "clamp": "^1.0.1", + "color-rgba": "^2.1.1", + "dtype": "^2.0.0" + } + }, + "node_modules/color-normalize/node_modules/color-parse": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.3.tgz", + "integrity": "sha512-BADfVl/FHkQkyo8sRBwMYBqemqsgnu7JZAwUgvBvuwwuNUZAhSvLTbsEErS5bQXzOjDR0dWzJ4vXN2Q+QoPx0A==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/color-normalize/node_modules/color-rgba": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-2.4.0.tgz", + "integrity": "sha512-Nti4qbzr/z2LbUWySr7H9dk3Rl7gZt7ihHAxlgT4Ho90EXWkjtkL1avTleu9yeGuqrt/chxTB6GKK8nZZ6V0+Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-parse": "^1.4.2", + "color-space": "^2.0.0" + } + }, + "node_modules/color-parse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.0.tgz", + "integrity": "sha512-g2Z+QnWsdHLppAbrpcFWo629kLOnOPtpxYV69GCqm92gqSgyXbzlfyN3MXs0412fPBkFmiuS+rXposgBgBa6Kg==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/color-rgba": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-3.0.0.tgz", + "integrity": "sha512-PPwZYkEY3M2THEHHV6Y95sGUie77S7X8v+h1r6LSAPF3/LL2xJ8duUXSrkic31Nzc4odPwHgUbiX/XuTYzQHQg==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-parse": "^2.0.0", + "color-space": "^2.0.0" + } + }, + "node_modules/color-space": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/color-space/-/color-space-2.3.2.tgz", + "integrity": "sha512-BcKnbOEsOarCwyoLstcoEztwT0IJxqqQkNwDuA3a65sICvvHL2yoeV13psoDFh5IuiOMnIOKdQDwB4Mk3BypiA==", + "license": "Unlicense", + "peer": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT", + "peer": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], + "license": "MIT", + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/core-js": { + "version": "3.29.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.29.1.tgz", + "integrity": "sha512-+jwgnhg6cQxKYIIjGtAHq2nwUOolo9eoFZ4sHfUH09BLXBgxnH4gA0zEd+t+BO2cNB8idaBtZFcFTRjQJRJmAw==", + "hasInstallScript": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT", + "peer": true + }, + "node_modules/country-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/country-regex/-/country-regex-1.1.0.tgz", + "integrity": "sha512-iSPlClZP8vX7MC3/u6s3lrDuoQyhQukh5LyABJ3hvfzbQ3Yyayd4fp04zjLnfi267B/B2FkumcWWgrbban7sSA==", + "license": "MIT", + "peer": true + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-font": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-font/-/css-font-1.2.0.tgz", + "integrity": "sha512-V4U4Wps4dPDACJ4WpgofJ2RT5Yqwe1lEH6wlOOaIxMi0gTjdIijsc5FmxQlZ7ZZyKQkkutqqvULOp07l9c7ssA==", + "license": "MIT", + "peer": true, + "dependencies": { + "css-font-size-keywords": "^1.0.0", + "css-font-stretch-keywords": "^1.0.1", + "css-font-style-keywords": "^1.0.1", + "css-font-weight-keywords": "^1.0.0", + "css-global-keywords": "^1.0.1", + "css-system-font-keywords": "^1.0.0", + "pick-by-alias": "^1.2.0", + "string-split-by": "^1.0.0", + "unquote": "^1.1.0" + } + }, + "node_modules/css-font-size-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-font-size-keywords/-/css-font-size-keywords-1.0.0.tgz", + "integrity": "sha512-Q+svMDbMlelgCfH/RVDKtTDaf5021O486ZThQPIpahnIjUkMUslC+WuOQSWTgGSrNCH08Y7tYNEmmy0hkfMI8Q==", + "license": "MIT", + "peer": true + }, + "node_modules/css-font-stretch-keywords": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-font-stretch-keywords/-/css-font-stretch-keywords-1.0.1.tgz", + "integrity": "sha512-KmugPO2BNqoyp9zmBIUGwt58UQSfyk1X5DbOlkb2pckDXFSAfjsD5wenb88fNrD6fvS+vu90a/tsPpb9vb0SLg==", + "license": "MIT", + "peer": true + }, + "node_modules/css-font-style-keywords": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-font-style-keywords/-/css-font-style-keywords-1.0.1.tgz", + "integrity": "sha512-0Fn0aTpcDktnR1RzaBYorIxQily85M2KXRpzmxQPgh8pxUN9Fcn00I8u9I3grNr1QXVgCl9T5Imx0ZwKU973Vg==", + "license": "MIT", + "peer": true + }, + "node_modules/css-font-weight-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-font-weight-keywords/-/css-font-weight-keywords-1.0.0.tgz", + "integrity": "sha512-5So8/NH+oDD+EzsnF4iaG4ZFHQ3vaViePkL1ZbZ5iC/KrsCY+WHq/lvOgrtmuOQ9pBBZ1ADGpaf+A4lj1Z9eYA==", + "license": "MIT", + "peer": true + }, + "node_modules/css-global-keywords": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-global-keywords/-/css-global-keywords-1.0.1.tgz", + "integrity": "sha512-X1xgQhkZ9n94WDwntqst5D/FKkmiU0GlJSFZSV3kLvyJ1WC5VeyoXDOuleUD+SIuH9C7W05is++0Woh0CGfKjQ==", + "license": "MIT", + "peer": true + }, + "node_modules/css-system-font-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-system-font-keywords/-/css-system-font-keywords-1.0.0.tgz", + "integrity": "sha512-1umTtVd/fXS25ftfjB71eASCrYhilmEsvDEI6wG/QplnmlfmVM5HkZ/ZX46DT5K3eblFPgLUHt5BRCb0YXkSFA==", + "license": "MIT", + "peer": true + }, + "node_modules/csscolorparser": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz", + "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w==", + "license": "MIT", + "peer": true + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/d": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz", + "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==", + "license": "ISC", + "peer": true, + "dependencies": { + "es5-ext": "^0.10.64", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/d3-array": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", + "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/d3-collection": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-collection/-/d3-collection-1.0.7.tgz", + "integrity": "sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", + "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/d3-force": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-1.2.1.tgz", + "integrity": "sha512-HHvehyaiUlVo5CxBJ0yF/xny4xoaxFxDnBXNvNcfW9adORGZfyNF1dj6DGLKyk4Yh3brP/1h3rnDzdIAwL08zg==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "d3-collection": "1", + "d3-dispatch": "1", + "d3-quadtree": "1", + "d3-timer": "1" + } + }, + "node_modules/d3-format": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.5.tgz", + "integrity": "sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/d3-geo": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz", + "integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "d3-array": "1" + } + }, + "node_modules/d3-geo-projection": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/d3-geo-projection/-/d3-geo-projection-2.9.0.tgz", + "integrity": "sha512-ZULvK/zBn87of5rWAfFMc9mJOipeSo57O+BBitsKIXmU4rTVAnX1kSsJkE0R+TxY8pGNoM1nbyRRE7GYHhdOEQ==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "commander": "2", + "d3-array": "1", + "d3-geo": "^1.12.0", + "resolve": "^1.1.10" + }, + "bin": { + "geo2svg": "bin/geo2svg", + "geograticule": "bin/geograticule", + "geoproject": "bin/geoproject", + "geoquantize": "bin/geoquantize", + "geostitch": "bin/geostitch" + } + }, + "node_modules/d3-hierarchy": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz", + "integrity": "sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "peer": true, + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/d3-quadtree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-1.0.7.tgz", + "integrity": "sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/d3-shape": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", + "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "d3-path": "1" + } + }, + "node_modules/d3-time": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", + "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/d3-time-format": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz", + "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "d3-time": "1" + } + }, + "node_modules/d3-timer": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", + "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/defined": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-kerning": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-kerning/-/detect-kerning-2.1.2.tgz", + "integrity": "sha512-I3JIbrnKPAntNLl1I6TpSQQdQ4AutYzv/sKMFKbepawV/hlH0GmYKhUoOEMd4xqaUHT+Bm0f4127lh5qs1m1tw==", + "license": "MIT", + "peer": true + }, + "node_modules/draw-svg-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/draw-svg-path/-/draw-svg-path-1.0.0.tgz", + "integrity": "sha512-P8j3IHxcgRMcY6sDzr0QvJDLzBnJJqpTG33UZ2Pvp8rw0apCHhJCWqYprqrXjrgHnJ6tuhP1iTJSAodPDHxwkg==", + "license": "MIT", + "peer": true, + "dependencies": { + "abs-svg-path": "~0.1.1", + "normalize-svg-path": "~0.1.0" + } + }, + "node_modules/dtype": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dtype/-/dtype-2.0.0.tgz", + "integrity": "sha512-s2YVcLKdFGS0hpFqJaTwscsyt0E8nNFdmo73Ocd81xNPj4URI4rj6D60A+vFMIw7BXWlb4yRkEwfBqcZzPGiZg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/dup": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dup/-/dup-1.0.0.tgz", + "integrity": "sha512-Bz5jxMMC0wgp23Zm15ip1x8IhYRqJvF3nFC0UInJUDkN1z4uNPk9jTnfCUJXbOGiQ1JbXLQsiV41Fb+HXcj5BA==", + "license": "MIT", + "peer": true + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "license": "MIT", + "peer": true, + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==", + "license": "ISC", + "peer": true + }, + "node_modules/electron-to-chromium": { + "version": "1.5.286", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.286.tgz", + "integrity": "sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==", + "dev": true, + "license": "ISC" + }, + "node_modules/element-size": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/element-size/-/element-size-1.1.1.tgz", + "integrity": "sha512-eaN+GMOq/Q+BIWy0ybsgpcYImjGIdNLyjLFJU4XsLHXYQao5jCNb36GyN6C2qwmDDYSfIBmKpPpr4VnBdLCsPQ==", + "license": "MIT", + "peer": true + }, + "node_modules/elementary-circuits-directed-graph": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/elementary-circuits-directed-graph/-/elementary-circuits-directed-graph-1.3.1.tgz", + "integrity": "sha512-ZEiB5qkn2adYmpXGnJKkxT8uJHlW/mxmBpmeqawEHzPxh9HkLD4/1mFYX5l0On+f6rcPIt8/EWlRU2Vo3fX6dQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "strongly-connected-components": "^1.0.1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "peer": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es5-ext": { + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", + "hasInstallScript": true, + "license": "ISC", + "peer": true, + "dependencies": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", + "next-tick": "^1.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "license": "MIT", + "peer": true, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/es6-symbol": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz", + "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==", + "license": "ISC", + "peer": true, + "dependencies": { + "d": "^1.0.2", + "ext": "^1.7.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "license": "ISC", + "peer": true, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/esbuild": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", + "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.3", + "@esbuild/android-arm": "0.27.3", + "@esbuild/android-arm64": "0.27.3", + "@esbuild/android-x64": "0.27.3", + "@esbuild/darwin-arm64": "0.27.3", + "@esbuild/darwin-x64": "0.27.3", + "@esbuild/freebsd-arm64": "0.27.3", + "@esbuild/freebsd-x64": "0.27.3", + "@esbuild/linux-arm": "0.27.3", + "@esbuild/linux-arm64": "0.27.3", + "@esbuild/linux-ia32": "0.27.3", + "@esbuild/linux-loong64": "0.27.3", + "@esbuild/linux-mips64el": "0.27.3", + "@esbuild/linux-ppc64": "0.27.3", + "@esbuild/linux-riscv64": "0.27.3", + "@esbuild/linux-s390x": "0.27.3", + "@esbuild/linux-x64": "0.27.3", + "@esbuild/netbsd-arm64": "0.27.3", + "@esbuild/netbsd-x64": "0.27.3", + "@esbuild/openbsd-arm64": "0.27.3", + "@esbuild/openbsd-x64": "0.27.3", + "@esbuild/openharmony-arm64": "0.27.3", + "@esbuild/sunos-x64": "0.27.3", + "@esbuild/win32-arm64": "0.27.3", + "@esbuild/win32-ia32": "0.27.3", + "@esbuild/win32-x64": "0.27.3" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/eslint": { + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.2.tgz", + "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.39.2", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz", + "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-react-refresh": { + "version": "0.4.26", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.26.tgz", + "integrity": "sha512-1RETEylht2O6FM/MvgnyvT+8K21wLqDNg4qD51Zj3guhjt433XbnnkVttHMyaVyAFD03QSV4LPS5iE3VQmO7XQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": ">=8.40" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "license": "ISC", + "peer": true, + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "license": "MIT", + "peer": true, + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/ext": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", + "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", + "license": "ISC", + "peer": true, + "dependencies": { + "type": "^2.7.2" + } + }, + "node_modules/falafel": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.2.5.tgz", + "integrity": "sha512-HuC1qF9iTnHDnML9YZAdCDQwT0yKl/U55K4XSUXqGAA2GLoafFgWRqdAbhWJxXaYD4pyoVxAJ8wH670jMpI9DQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "acorn": "^7.1.1", + "isarray": "^2.0.1" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/falafel/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-isnumeric": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/fast-isnumeric/-/fast-isnumeric-1.1.4.tgz", + "integrity": "sha512-1mM8qOr2LYz8zGaUdmiqRDiuue00Dxjgcb1NQR7TnhLVh6sQyngP9xvLo7Sl7LZpP/sk5eb+bcyWXw530NTBZw==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-string-blank": "^1.0.1" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/flatten-vertex-data": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/flatten-vertex-data/-/flatten-vertex-data-1.0.2.tgz", + "integrity": "sha512-BvCBFK2NZqerFTdMDgqfHBwxYWnxeCkwONsw6PvBMcUXqo8U/KDWwmXhqx1x2kLIg7DqIsJfOaJFOmlua3Lxuw==", + "license": "MIT", + "peer": true, + "dependencies": { + "dtype": "^2.0.0" + } + }, + "node_modules/font-atlas": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/font-atlas/-/font-atlas-2.1.0.tgz", + "integrity": "sha512-kP3AmvX+HJpW4w3d+PiPR2X6E1yvsBXt2yhuCw+yReO9F1WYhvZwx3c95DGZGwg9xYzDGrgJYa885xmVA+28Cg==", + "license": "MIT", + "peer": true, + "dependencies": { + "css-font": "^1.0.0" + } + }, + "node_modules/font-measure": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/font-measure/-/font-measure-1.2.2.tgz", + "integrity": "sha512-mRLEpdrWzKe9hbfaF3Qpr06TAjquuBVP5cHy4b3hyeNdjc9i0PO6HniGsX5vjL5OWv7+Bd++NiooNpT/s8BvIA==", + "license": "MIT", + "peer": true, + "dependencies": { + "css-font": "^1.2.0" + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", + "license": "MIT", + "peer": true, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/geojson-vt": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz", + "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg==", + "license": "ISC", + "peer": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-canvas-context": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-canvas-context/-/get-canvas-context-1.0.2.tgz", + "integrity": "sha512-LnpfLf/TNzr9zVOGiIY6aKCz8EKuXmlYNV7CM2pUjBa/B+c2I15tS7KLySep75+FuerJdmArvJLcsAXWEy2H0A==", + "license": "MIT", + "peer": true + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gl-mat4": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gl-mat4/-/gl-mat4-1.2.0.tgz", + "integrity": "sha512-sT5C0pwB1/e9G9AvAoLsoaJtbMGjfd/jfxo8jMCKqYYEnjZuFvqV5rehqar0538EmssjdDeiEWnKyBSTw7quoA==", + "license": "Zlib", + "peer": true + }, + "node_modules/gl-matrix": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.4.tgz", + "integrity": "sha512-latSnyDNt/8zYUB6VIJ6PCh2jBjJX6gnDsoCZ7LyW7GkqrD51EWwa9qCoGixj8YqBtETQK/xY7OmpTF8xz1DdQ==", + "license": "MIT", + "peer": true + }, + "node_modules/gl-text": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/gl-text/-/gl-text-1.4.0.tgz", + "integrity": "sha512-o47+XBqLCj1efmuNyCHt7/UEJmB9l66ql7pnobD6p+sgmBUdzfMZXIF0zD2+KRfpd99DJN+QXdvTFAGCKCVSmQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "bit-twiddle": "^1.0.2", + "color-normalize": "^1.5.0", + "css-font": "^1.2.0", + "detect-kerning": "^2.1.2", + "es6-weak-map": "^2.0.3", + "flatten-vertex-data": "^1.0.2", + "font-atlas": "^2.1.0", + "font-measure": "^1.2.2", + "gl-util": "^3.1.2", + "is-plain-obj": "^1.1.0", + "object-assign": "^4.1.1", + "parse-rect": "^1.2.0", + "parse-unit": "^1.0.1", + "pick-by-alias": "^1.2.0", + "regl": "^2.0.0", + "to-px": "^1.0.1", + "typedarray-pool": "^1.1.0" + } + }, + "node_modules/gl-util": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/gl-util/-/gl-util-3.1.3.tgz", + "integrity": "sha512-dvRTggw5MSkJnCbh74jZzSoTOGnVYK+Bt+Ckqm39CVcl6+zSsxqWk4lr5NKhkqXHL6qvZAU9h17ZF8mIskY9mA==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-browser": "^2.0.1", + "is-firefox": "^1.0.3", + "is-plain-obj": "^1.1.0", + "number-is-integer": "^1.0.1", + "object-assign": "^4.1.0", + "pick-by-alias": "^1.2.0", + "weak-map": "^1.0.5" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/global-prefix": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-4.0.0.tgz", + "integrity": "sha512-w0Uf9Y9/nyHinEk5vMJKRie+wa4kR5hmDbEhGGds/kG1PwGLLHKRoNMeJOyCQjjBkANlnScqgzcFwGHgmgLkVA==", + "license": "MIT", + "peer": true, + "dependencies": { + "ini": "^4.1.3", + "kind-of": "^6.0.3", + "which": "^4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/global-prefix/node_modules/isexe": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.5.tgz", + "integrity": "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w==", + "license": "BlueOak-1.0.0", + "peer": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/global-prefix/node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "license": "ISC", + "peer": true, + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/globals": { + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", + "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glsl-inject-defines": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/glsl-inject-defines/-/glsl-inject-defines-1.0.3.tgz", + "integrity": "sha512-W49jIhuDtF6w+7wCMcClk27a2hq8znvHtlGnrYkSWEr8tHe9eA2dcnohlcAmxLYBSpSSdzOkRdyPTrx9fw49+A==", + "license": "MIT", + "peer": true, + "dependencies": { + "glsl-token-inject-block": "^1.0.0", + "glsl-token-string": "^1.0.1", + "glsl-tokenizer": "^2.0.2" + } + }, + "node_modules/glsl-resolve": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/glsl-resolve/-/glsl-resolve-0.0.1.tgz", + "integrity": "sha512-xxFNsfnhZTK9NBhzJjSBGX6IOqYpvBHxxmo+4vapiljyGNCY0Bekzn0firQkQrazK59c1hYxMDxYS8MDlhw4gA==", + "license": "MIT", + "peer": true, + "dependencies": { + "resolve": "^0.6.1", + "xtend": "^2.1.2" + } + }, + "node_modules/glsl-resolve/node_modules/resolve": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.6.3.tgz", + "integrity": "sha512-UHBY3viPlJKf85YijDUcikKX6tmF4SokIDp518ZDVT92JNDcG5uKIthaT/owt3Sar0lwtOafsQuwrg22/v2Dwg==", + "license": "MIT", + "peer": true + }, + "node_modules/glsl-resolve/node_modules/xtend": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.2.0.tgz", + "integrity": "sha512-SLt5uylT+4aoXxXuwtQp5ZnMMzhDb1Xkg4pEqc00WUJCQifPfV9Ub1VrNhp9kXkrjZD2I2Hl8WnjP37jzZLPZw==", + "peer": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/glsl-token-assignments": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/glsl-token-assignments/-/glsl-token-assignments-2.0.2.tgz", + "integrity": "sha512-OwXrxixCyHzzA0U2g4btSNAyB2Dx8XrztY5aVUCjRSh4/D0WoJn8Qdps7Xub3sz6zE73W3szLrmWtQ7QMpeHEQ==", + "license": "MIT", + "peer": true + }, + "node_modules/glsl-token-defines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/glsl-token-defines/-/glsl-token-defines-1.0.0.tgz", + "integrity": "sha512-Vb5QMVeLjmOwvvOJuPNg3vnRlffscq2/qvIuTpMzuO/7s5kT+63iL6Dfo2FYLWbzuiycWpbC0/KV0biqFwHxaQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "glsl-tokenizer": "^2.0.0" + } + }, + "node_modules/glsl-token-depth": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/glsl-token-depth/-/glsl-token-depth-1.1.2.tgz", + "integrity": "sha512-eQnIBLc7vFf8axF9aoi/xW37LSWd2hCQr/3sZui8aBJnksq9C7zMeUYHVJWMhFzXrBU7fgIqni4EhXVW4/krpg==", + "license": "MIT", + "peer": true + }, + "node_modules/glsl-token-descope": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/glsl-token-descope/-/glsl-token-descope-1.0.2.tgz", + "integrity": "sha512-kS2PTWkvi/YOeicVjXGgX5j7+8N7e56srNDEHDTVZ1dcESmbmpmgrnpjPcjxJjMxh56mSXYoFdZqb90gXkGjQw==", + "license": "MIT", + "peer": true, + "dependencies": { + "glsl-token-assignments": "^2.0.0", + "glsl-token-depth": "^1.1.0", + "glsl-token-properties": "^1.0.0", + "glsl-token-scope": "^1.1.0" + } + }, + "node_modules/glsl-token-inject-block": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/glsl-token-inject-block/-/glsl-token-inject-block-1.1.0.tgz", + "integrity": "sha512-q/m+ukdUBuHCOtLhSr0uFb/qYQr4/oKrPSdIK2C4TD+qLaJvqM9wfXIF/OOBjuSA3pUoYHurVRNao6LTVVUPWA==", + "license": "MIT", + "peer": true + }, + "node_modules/glsl-token-properties": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/glsl-token-properties/-/glsl-token-properties-1.0.1.tgz", + "integrity": "sha512-dSeW1cOIzbuUoYH0y+nxzwK9S9O3wsjttkq5ij9ZGw0OS41BirKJzzH48VLm8qLg+au6b0sINxGC0IrGwtQUcA==", + "license": "MIT", + "peer": true + }, + "node_modules/glsl-token-scope": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/glsl-token-scope/-/glsl-token-scope-1.1.2.tgz", + "integrity": "sha512-YKyOMk1B/tz9BwYUdfDoHvMIYTGtVv2vbDSLh94PT4+f87z21FVdou1KNKgF+nECBTo0fJ20dpm0B1vZB1Q03A==", + "license": "MIT", + "peer": true + }, + "node_modules/glsl-token-string": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/glsl-token-string/-/glsl-token-string-1.0.1.tgz", + "integrity": "sha512-1mtQ47Uxd47wrovl+T6RshKGkRRCYWhnELmkEcUAPALWGTFe2XZpH3r45XAwL2B6v+l0KNsCnoaZCSnhzKEksg==", + "license": "MIT", + "peer": true + }, + "node_modules/glsl-token-whitespace-trim": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/glsl-token-whitespace-trim/-/glsl-token-whitespace-trim-1.0.0.tgz", + "integrity": "sha512-ZJtsPut/aDaUdLUNtmBYhaCmhIjpKNg7IgZSfX5wFReMc2vnj8zok+gB/3Quqs0TsBSX/fGnqUUYZDqyuc2xLQ==", + "license": "MIT", + "peer": true + }, + "node_modules/glsl-tokenizer": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/glsl-tokenizer/-/glsl-tokenizer-2.1.5.tgz", + "integrity": "sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==", + "license": "MIT", + "peer": true, + "dependencies": { + "through2": "^0.6.3" + } + }, + "node_modules/glsl-tokenizer/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "license": "MIT", + "peer": true + }, + "node_modules/glsl-tokenizer/node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "license": "MIT", + "peer": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/glsl-tokenizer/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "license": "MIT", + "peer": true + }, + "node_modules/glsl-tokenizer/node_modules/through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==", + "license": "MIT", + "peer": true, + "dependencies": { + "readable-stream": ">=1.0.33-1 <1.1.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + } + }, + "node_modules/glslify": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glslify/-/glslify-7.1.1.tgz", + "integrity": "sha512-bud98CJ6kGZcP9Yxcsi7Iz647wuDz3oN+IZsjCRi5X1PI7t/xPKeL0mOwXJjo+CRZMqvq0CkSJiywCcY7kVYog==", + "license": "MIT", + "peer": true, + "dependencies": { + "bl": "^2.2.1", + "concat-stream": "^1.5.2", + "duplexify": "^3.4.5", + "falafel": "^2.1.0", + "from2": "^2.3.0", + "glsl-resolve": "0.0.1", + "glsl-token-whitespace-trim": "^1.0.0", + "glslify-bundle": "^5.0.0", + "glslify-deps": "^1.2.5", + "minimist": "^1.2.5", + "resolve": "^1.1.5", + "stack-trace": "0.0.9", + "static-eval": "^2.0.5", + "through2": "^2.0.1", + "xtend": "^4.0.0" + }, + "bin": { + "glslify": "bin.js" + } + }, + "node_modules/glslify-bundle": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glslify-bundle/-/glslify-bundle-5.1.1.tgz", + "integrity": "sha512-plaAOQPv62M1r3OsWf2UbjN0hUYAB7Aph5bfH58VxJZJhloRNbxOL9tl/7H71K7OLJoSJ2ZqWOKk3ttQ6wy24A==", + "license": "MIT", + "peer": true, + "dependencies": { + "glsl-inject-defines": "^1.0.1", + "glsl-token-defines": "^1.0.0", + "glsl-token-depth": "^1.1.1", + "glsl-token-descope": "^1.0.2", + "glsl-token-scope": "^1.1.1", + "glsl-token-string": "^1.0.1", + "glsl-token-whitespace-trim": "^1.0.0", + "glsl-tokenizer": "^2.0.2", + "murmurhash-js": "^1.0.0", + "shallow-copy": "0.0.1" + } + }, + "node_modules/glslify-deps": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/glslify-deps/-/glslify-deps-1.3.2.tgz", + "integrity": "sha512-7S7IkHWygJRjcawveXQjRXLO2FTjijPDYC7QfZyAQanY+yGLCFHYnPtsGT9bdyHiwPTw/5a1m1M9hamT2aBpag==", + "license": "ISC", + "peer": true, + "dependencies": { + "@choojs/findup": "^0.2.0", + "events": "^3.2.0", + "glsl-resolve": "0.0.1", + "glsl-tokenizer": "^2.0.0", + "graceful-fs": "^4.1.2", + "inherits": "^2.0.1", + "map-limit": "0.0.1", + "resolve": "^1.0.0" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC", + "peer": true + }, + "node_modules/grid-index": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grid-index/-/grid-index-1.1.0.tgz", + "integrity": "sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA==", + "license": "ISC", + "peer": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-hover": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-hover/-/has-hover-1.0.1.tgz", + "integrity": "sha512-0G6w7LnlcpyDzpeGUTuT0CEw05+QlMuGVk1IHNAlHrGJITGodjZu3x8BNDUMfKJSZXNB2ZAclqc1bvrd+uUpfg==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-browser": "^2.0.1" + } + }, + "node_modules/has-passive-events": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-passive-events/-/has-passive-events-1.0.0.tgz", + "integrity": "sha512-2vSj6IeIsgvsRMyeQ0JaCX5Q3lX4zMn5HpoVc7MEhQ6pv8Iq9rsXjsp+E5ZwaT7T0xhMT0KmU8gtt1EFVdbJiw==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-browser": "^2.0.1" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "peer": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC", + "peer": true + }, + "node_modules/ini": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", + "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", + "license": "ISC", + "peer": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/is-browser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-browser/-/is-browser-2.1.0.tgz", + "integrity": "sha512-F5rTJxDQ2sW81fcfOR1GnCXT6sVJC104fCyfj+mjpwNEwaPYSn5fte5jiHmBg3DHsIoL/l8Kvw5VN5SsTRcRFQ==", + "license": "MIT", + "peer": true + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "license": "MIT", + "peer": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-firefox": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-firefox/-/is-firefox-1.0.3.tgz", + "integrity": "sha512-6Q9ITjvWIm0Xdqv+5U12wgOKEM2KoBw4Y926m0OFkvlCxnbG94HKAsVz8w3fWcfAS5YA2fJORXX1dLrkprCCxA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-iexplorer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-iexplorer/-/is-iexplorer-1.0.0.tgz", + "integrity": "sha512-YeLzceuwg3K6O0MLM3UyUUjKAlyULetwryFp1mHy1I5PfArK0AEqlfa+MR4gkJjcbuJXoDJCvXbyqZVf5CR2Sg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-mobile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-mobile/-/is-mobile-4.0.0.tgz", + "integrity": "sha512-mlcHZA84t1qLSuWkt2v0I2l61PYdyQDt4aG1mLIXF5FDMm4+haBCxCPYSr/uwqQNRk1MiTizn0ypEuRAOLRAew==", + "license": "MIT", + "peer": true + }, + "node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-string-blank": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-string-blank/-/is-string-blank-1.0.1.tgz", + "integrity": "sha512-9H+ZBCVs3L9OYqv8nuUAzpcT9OTgMD1yAWrG7ihlnibdkbtB850heAmYWxHuXc4CHy4lKeK69tN+ny1K7gBIrw==", + "license": "MIT", + "peer": true + }, + "node_modules/is-svg-path": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-svg-path/-/is-svg-path-1.0.2.tgz", + "integrity": "sha512-Lj4vePmqpPR1ZnRctHv8ltSh1OrSxHkhUkd7wi+VQdcdP15/KvQFyk7LhNuM7ZW0EVbJz8kZLVmL9quLrfq4Kg==", + "license": "MIT", + "peer": true + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT", + "peer": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stringify-pretty-compact": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz", + "integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==", + "license": "MIT", + "peer": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/kdbush": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", + "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==", + "license": "ISC", + "peer": true + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "license": "MIT" + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "license": "Apache-2.0" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/map-limit": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/map-limit/-/map-limit-0.0.1.tgz", + "integrity": "sha512-pJpcfLPnIF/Sk3taPW21G/RQsEEirGaFpCW3oXRwH9dnFHPHNGjNyvh++rdmC2fNqEaTw2MhYJraoJWAHx8kEg==", + "license": "MIT", + "peer": true, + "dependencies": { + "once": "~1.3.0" + } + }, + "node_modules/map-limit/node_modules/once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha512-6vaNInhu+CHxtONf3zw3vq4SP2DOQhjBvIa3rNcG0+P7eKWlYH6Peu7rHizSloRU2EwMz6GraLieis9Ac9+p1w==", + "license": "ISC", + "peer": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/mapbox-gl": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-1.13.3.tgz", + "integrity": "sha512-p8lJFEiqmEQlyv+DQxFAOG/XPWN0Wp7j/Psq93Zywz7qt9CcUKFYDBOoOEKzqe6gudHVJY8/Bhqw6VDpX2lSBg==", + "license": "SEE LICENSE IN LICENSE.txt", + "peer": true, + "dependencies": { + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/geojson-types": "^1.0.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/mapbox-gl-supported": "^1.5.0", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^1.1.1", + "@mapbox/unitbezier": "^0.0.0", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "csscolorparser": "~1.0.3", + "earcut": "^2.2.2", + "geojson-vt": "^3.2.1", + "gl-matrix": "^3.2.1", + "grid-index": "^1.1.0", + "murmurhash-js": "^1.0.0", + "pbf": "^3.2.1", + "potpack": "^1.0.1", + "quickselect": "^2.0.0", + "rw": "^1.3.3", + "supercluster": "^7.1.0", + "tinyqueue": "^2.0.3", + "vt-pbf": "^3.1.1" + }, + "engines": { + "node": ">=6.4.0" + } + }, + "node_modules/maplibre-gl": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.7.1.tgz", + "integrity": "sha512-lgL7XpIwsgICiL82ITplfS7IGwrB1OJIw/pCvprDp2dhmSSEBgmPzYRvwYYYvJGJD7fxUv1Tvpih4nZ6VrLuaA==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^2.0.6", + "@mapbox/unitbezier": "^0.0.1", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "@maplibre/maplibre-gl-style-spec": "^20.3.1", + "@types/geojson": "^7946.0.14", + "@types/geojson-vt": "3.2.5", + "@types/mapbox__point-geometry": "^0.1.4", + "@types/mapbox__vector-tile": "^1.3.4", + "@types/pbf": "^3.0.5", + "@types/supercluster": "^7.1.3", + "earcut": "^3.0.0", + "geojson-vt": "^4.0.2", + "gl-matrix": "^3.4.3", + "global-prefix": "^4.0.0", + "kdbush": "^4.0.2", + "murmurhash-js": "^1.0.0", + "pbf": "^3.3.0", + "potpack": "^2.0.0", + "quickselect": "^3.0.0", + "supercluster": "^8.0.1", + "tinyqueue": "^3.0.0", + "vt-pbf": "^3.1.3" + }, + "engines": { + "node": ">=16.14.0", + "npm": ">=8.1.0" + }, + "funding": { + "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" + } + }, + "node_modules/maplibre-gl/node_modules/@mapbox/tiny-sdf": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.7.tgz", + "integrity": "sha512-25gQLQMcpivjOSA40g3gO6qgiFPDpWRoMfd+G/GoppPIeP6JDaMMkMrEJnMZhKyyS6iKwVt5YKu02vCUyJM3Ug==", + "license": "BSD-2-Clause", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/@mapbox/unitbezier": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==", + "license": "BSD-2-Clause", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/earcut": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.2.tgz", + "integrity": "sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==", + "license": "ISC", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/geojson-vt": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz", + "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==", + "license": "ISC", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/potpack": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.1.0.tgz", + "integrity": "sha512-pcaShQc1Shq0y+E7GqJqvZj8DTthWV1KeHGdi0Z6IAin2Oi3JnLCOfwnCo84qc+HAp52wT9nK9H7FAJp5a44GQ==", + "license": "ISC", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/quickselect": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz", + "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==", + "license": "ISC", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/supercluster": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", + "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", + "license": "ISC", + "peer": true, + "dependencies": { + "kdbush": "^4.0.2" + } + }, + "node_modules/maplibre-gl/node_modules/tinyqueue": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", + "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==", + "license": "ISC", + "peer": true + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/math-log2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-log2/-/math-log2-1.0.1.tgz", + "integrity": "sha512-9W0yGtkaMAkf74XGYVy4Dqw3YUMnTNB2eeiw9aQbUl4A3KmuCEHTt2DgAB07ENzOYAjsYSAYufkAq0Zd+jU7zA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mouse-change": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/mouse-change/-/mouse-change-1.4.0.tgz", + "integrity": "sha512-vpN0s+zLL2ykyyUDh+fayu9Xkor5v/zRD9jhSqjRS1cJTGS0+oakVZzNm5n19JvvEj0you+MXlYTpNxUDQUjkQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "mouse-event": "^1.0.0" + } + }, + "node_modules/mouse-event": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/mouse-event/-/mouse-event-1.0.5.tgz", + "integrity": "sha512-ItUxtL2IkeSKSp9cyaX2JLUuKk2uMoxBg4bbOWVd29+CskYJR9BGsUqtXenNzKbnDshvupjUewDIYVrOB6NmGw==", + "license": "MIT", + "peer": true + }, + "node_modules/mouse-event-offset": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mouse-event-offset/-/mouse-event-offset-3.0.2.tgz", + "integrity": "sha512-s9sqOs5B1Ykox3Xo8b3Ss2IQju4UwlW6LSR+Q5FXWpprJ5fzMLefIIItr3PH8RwzfGy6gxs/4GAmiNuZScE25w==", + "license": "MIT", + "peer": true + }, + "node_modules/mouse-wheel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mouse-wheel/-/mouse-wheel-1.2.0.tgz", + "integrity": "sha512-+OfYBiUOCTWcTECES49neZwL5AoGkXE+lFjIvzwNCnYRlso+EnfvovcBxGoyQ0yQt806eSPjS675K0EwWknXmw==", + "license": "MIT", + "peer": true, + "dependencies": { + "right-now": "^1.0.0", + "signum": "^1.0.0", + "to-px": "^1.0.1" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/murmurhash-js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz", + "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==", + "license": "MIT", + "peer": true + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/native-promise-only": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", + "integrity": "sha512-zkVhZUA3y8mbz652WrL5x0fB0ehrBkulWT3TomAQ9iDtyXZvzKeEA6GPxAItBYeNYl5yngKRX612qHOhvMkDeg==", + "license": "MIT", + "peer": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/needle": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", + "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, + "node_modules/needle/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "license": "ISC", + "peer": true + }, + "node_modules/node-fetch": { + "version": "2.6.13", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.13.tgz", + "integrity": "sha512-StxNAxh15zr77QvvkmveSQ8uCQ4+v5FkvNTj0OESmiHu+VRi/gXArXtkWMElOsOUNLtUEvI4yS+rdtOHZTwlQA==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-svg-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/normalize-svg-path/-/normalize-svg-path-0.1.0.tgz", + "integrity": "sha512-1/kmYej2iedi5+ROxkRESL/pI02pkg0OBnaR4hJkSIX6+ORzepwbuUXfrdZaPjysTsJInj0Rj5NuX027+dMBvA==", + "license": "MIT", + "peer": true + }, + "node_modules/number-is-integer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-integer/-/number-is-integer-1.0.1.tgz", + "integrity": "sha512-Dq3iuiFBkrbmuQjGFFF3zckXNCQoSD37/SdSbgcBailUx6knDvDwb5CympBgcoWHy36sfS12u74MHYkXyHq6bg==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-finite": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "peer": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parenthesis": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/parenthesis/-/parenthesis-3.1.8.tgz", + "integrity": "sha512-KF/U8tk54BgQewkJPvB4s/US3VQY68BRDpH638+7O/n58TpnwiwnOtGIOsT2/i+M78s61BBpeC83STB88d8sqw==", + "license": "MIT", + "peer": true + }, + "node_modules/parse-rect": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parse-rect/-/parse-rect-1.2.0.tgz", + "integrity": "sha512-4QZ6KYbnE6RTwg9E0HpLchUM9EZt6DnDxajFZZDSV4p/12ZJEvPO702DZpGvRYEPo00yKDys7jASi+/w7aO8LA==", + "license": "MIT", + "peer": true, + "dependencies": { + "pick-by-alias": "^1.2.0" + } + }, + "node_modules/parse-svg-path": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/parse-svg-path/-/parse-svg-path-0.1.2.tgz", + "integrity": "sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ==", + "license": "MIT", + "peer": true + }, + "node_modules/parse-unit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-unit/-/parse-unit-1.0.1.tgz", + "integrity": "sha512-hrqldJHokR3Qj88EIlV/kAyAi/G5R2+R56TBANxNMy0uPlYcttx0jnMW6Yx5KsKPSbC3KddM/7qQm3+0wEXKxg==", + "license": "MIT", + "peer": true + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT", + "peer": true + }, + "node_modules/pbf": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.3.0.tgz", + "integrity": "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "license": "MIT", + "peer": true + }, + "node_modules/pick-by-alias": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pick-by-alias/-/pick-by-alias-1.2.0.tgz", + "integrity": "sha512-ESj2+eBxhGrcA1azgHs7lARG5+5iLakc/6nlfbpjcLl00HuuUOIuORhYXN4D1HfvMSKuVtFQjAlnwi1JHEeDIw==", + "license": "MIT", + "peer": true + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/plotly.js": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/plotly.js/-/plotly.js-3.3.1.tgz", + "integrity": "sha512-SrGSZ02HvCWQIYsbQX4sgjgGo7k4T+Oz8a+RQwE5Caz+yu1vputBM1UThmiOPY51B5HzO9ajym8Rl4pmLj+i9Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "@plotly/d3": "3.8.2", + "@plotly/d3-sankey": "0.7.2", + "@plotly/d3-sankey-circular": "0.33.1", + "@plotly/mapbox-gl": "1.13.4", + "@plotly/regl": "^2.1.2", + "@turf/area": "^7.1.0", + "@turf/bbox": "^7.1.0", + "@turf/centroid": "^7.1.0", + "base64-arraybuffer": "^1.0.2", + "canvas-fit": "^1.5.0", + "color-alpha": "1.0.4", + "color-normalize": "1.5.0", + "color-parse": "2.0.0", + "color-rgba": "3.0.0", + "country-regex": "^1.1.0", + "d3-force": "^1.2.1", + "d3-format": "^1.4.5", + "d3-geo": "^1.12.1", + "d3-geo-projection": "^2.9.0", + "d3-hierarchy": "^1.1.9", + "d3-interpolate": "^3.0.1", + "d3-time": "^1.1.0", + "d3-time-format": "^2.2.3", + "fast-isnumeric": "^1.1.4", + "gl-mat4": "^1.2.0", + "gl-text": "^1.4.0", + "has-hover": "^1.0.1", + "has-passive-events": "^1.0.0", + "is-mobile": "^4.0.0", + "maplibre-gl": "^4.7.1", + "mouse-change": "^1.4.0", + "mouse-event-offset": "^3.0.2", + "mouse-wheel": "^1.2.0", + "native-promise-only": "^0.8.1", + "parse-svg-path": "^0.1.2", + "point-in-polygon": "^1.1.0", + "polybooljs": "^1.2.2", + "probe-image-size": "^7.2.3", + "regl-error2d": "^2.0.12", + "regl-line2d": "^3.1.3", + "regl-scatter2d": "^3.3.1", + "regl-splom": "^1.0.14", + "strongly-connected-components": "^1.0.1", + "superscript-text": "^1.0.0", + "svg-path-sdf": "^1.1.3", + "tinycolor2": "^1.4.2", + "to-px": "1.0.1", + "topojson-client": "^3.1.0", + "webgl-context": "^2.2.0", + "world-calendars": "^1.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/point-in-polygon": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/point-in-polygon/-/point-in-polygon-1.1.0.tgz", + "integrity": "sha512-3ojrFwjnnw8Q9242TzgXuTD+eKiutbzyslcq1ydfu82Db2y+Ogbmyrkpv0Hgj31qwT3lbS9+QAAO/pIQM35XRw==", + "license": "MIT", + "peer": true + }, + "node_modules/polybooljs": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/polybooljs/-/polybooljs-1.2.2.tgz", + "integrity": "sha512-ziHW/02J0XuNuUtmidBc6GXE8YohYydp3DWPWXYsd7O721TjcmN+k6ezjdwkDqep+gnWnFY+yqZHvzElra2oCg==", + "license": "MIT", + "peer": true + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/potpack": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz", + "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==", + "license": "ISC", + "peer": true + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/probe-image-size": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-7.2.3.tgz", + "integrity": "sha512-HubhG4Rb2UH8YtV4ba0Vp5bQ7L78RTONYu/ujmCu5nBI8wGv24s4E9xSKBi0N1MowRpxk76pFCpJtW0KPzOK0w==", + "license": "MIT", + "peer": true, + "dependencies": { + "lodash.merge": "^4.6.2", + "needle": "^2.5.2", + "stream-parser": "~0.3.1" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT", + "peer": true + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/protocol-buffers-schema": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", + "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==", + "license": "MIT", + "peer": true + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/quickselect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==", + "license": "ISC", + "peer": true + }, + "node_modules/raf": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "license": "MIT", + "peer": true, + "dependencies": { + "performance-now": "^2.1.0" + } + }, + "node_modules/react": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", + "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz", + "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.4" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, + "node_modules/react-plotly.js": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/react-plotly.js/-/react-plotly.js-2.6.0.tgz", + "integrity": "sha512-g93xcyhAVCSt9kV1svqG1clAEdL6k3U+jjuSzfTV7owaSU9Go6Ph8bl25J+jKfKvIGAEYpe4qj++WHJuc9IaeA==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.8.1" + }, + "peerDependencies": { + "plotly.js": ">1.34.0", + "react": ">0.13.0" + } + }, + "node_modules/react-refresh": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz", + "integrity": "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "peer": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT", + "peer": true + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT", + "peer": true + }, + "node_modules/readable-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "peer": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "license": "MIT" + }, + "node_modules/regl": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/regl/-/regl-2.1.1.tgz", + "integrity": "sha512-+IOGrxl3FZ8ZM9ixCWQZzFRiRn7Rzn9bu3iFHwg/yz4tlOUQgbO4PHLgG+1ZT60zcIV8tief6Qrmyl8qcoJP0g==", + "license": "MIT", + "peer": true + }, + "node_modules/regl-error2d": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/regl-error2d/-/regl-error2d-2.0.12.tgz", + "integrity": "sha512-r7BUprZoPO9AbyqM5qlJesrSRkl+hZnVKWKsVp7YhOl/3RIpi4UDGASGJY0puQ96u5fBYw/OlqV24IGcgJ0McA==", + "license": "MIT", + "peer": true, + "dependencies": { + "array-bounds": "^1.0.1", + "color-normalize": "^1.5.0", + "flatten-vertex-data": "^1.0.2", + "object-assign": "^4.1.1", + "pick-by-alias": "^1.2.0", + "to-float32": "^1.1.0", + "update-diff": "^1.1.0" + } + }, + "node_modules/regl-line2d": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/regl-line2d/-/regl-line2d-3.1.3.tgz", + "integrity": "sha512-fkgzW+tTn4QUQLpFKsUIE0sgWdCmXAM3ctXcCgoGBZTSX5FE2A0M7aynz7nrZT5baaftLrk9te54B+MEq4QcSA==", + "license": "MIT", + "peer": true, + "dependencies": { + "array-bounds": "^1.0.1", + "array-find-index": "^1.0.2", + "array-normalize": "^1.1.4", + "color-normalize": "^1.5.0", + "earcut": "^2.1.5", + "es6-weak-map": "^2.0.3", + "flatten-vertex-data": "^1.0.2", + "object-assign": "^4.1.1", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0", + "to-float32": "^1.1.0" + } + }, + "node_modules/regl-scatter2d": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/regl-scatter2d/-/regl-scatter2d-3.3.1.tgz", + "integrity": "sha512-seOmMIVwaCwemSYz/y4WE0dbSO9svNFSqtTh5RE57I7PjGo3tcUYKtH0MTSoshcAsreoqN8HoCtnn8wfHXXfKQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@plotly/point-cluster": "^3.1.9", + "array-range": "^1.0.1", + "array-rearrange": "^2.2.2", + "clamp": "^1.0.1", + "color-id": "^1.1.0", + "color-normalize": "^1.5.0", + "color-rgba": "^2.1.1", + "flatten-vertex-data": "^1.0.2", + "glslify": "^7.0.0", + "is-iexplorer": "^1.0.0", + "object-assign": "^4.1.1", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0", + "to-float32": "^1.1.0", + "update-diff": "^1.1.0" + } + }, + "node_modules/regl-scatter2d/node_modules/color-parse": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.3.tgz", + "integrity": "sha512-BADfVl/FHkQkyo8sRBwMYBqemqsgnu7JZAwUgvBvuwwuNUZAhSvLTbsEErS5bQXzOjDR0dWzJ4vXN2Q+QoPx0A==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/regl-scatter2d/node_modules/color-rgba": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-2.4.0.tgz", + "integrity": "sha512-Nti4qbzr/z2LbUWySr7H9dk3Rl7gZt7ihHAxlgT4Ho90EXWkjtkL1avTleu9yeGuqrt/chxTB6GKK8nZZ6V0+Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-parse": "^1.4.2", + "color-space": "^2.0.0" + } + }, + "node_modules/regl-splom": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/regl-splom/-/regl-splom-1.0.14.tgz", + "integrity": "sha512-OiLqjmPRYbd7kDlHC6/zDf6L8lxgDC65BhC8JirhP4ykrK4x22ZyS+BnY8EUinXKDeMgmpRwCvUmk7BK4Nweuw==", + "license": "MIT", + "peer": true, + "dependencies": { + "array-bounds": "^1.0.1", + "array-range": "^1.0.1", + "color-alpha": "^1.0.4", + "flatten-vertex-data": "^1.0.2", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0", + "raf": "^3.4.1", + "regl-scatter2d": "^3.2.3" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-protobuf-schema": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", + "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "protocol-buffers-schema": "^3.3.1" + } + }, + "node_modules/right-now": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/right-now/-/right-now-1.0.0.tgz", + "integrity": "sha512-DA8+YS+sMIVpbsuKgy+Z67L9Lxb1p05mNxRpDPNksPDEFir4vmBlUtuN9jkTGn9YMMdlBuK7XQgFiz6ws+yhSg==", + "license": "MIT", + "peer": true + }, + "node_modules/rollup": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz", + "integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.57.1", + "@rollup/rollup-android-arm64": "4.57.1", + "@rollup/rollup-darwin-arm64": "4.57.1", + "@rollup/rollup-darwin-x64": "4.57.1", + "@rollup/rollup-freebsd-arm64": "4.57.1", + "@rollup/rollup-freebsd-x64": "4.57.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.57.1", + "@rollup/rollup-linux-arm-musleabihf": "4.57.1", + "@rollup/rollup-linux-arm64-gnu": "4.57.1", + "@rollup/rollup-linux-arm64-musl": "4.57.1", + "@rollup/rollup-linux-loong64-gnu": "4.57.1", + "@rollup/rollup-linux-loong64-musl": "4.57.1", + "@rollup/rollup-linux-ppc64-gnu": "4.57.1", + "@rollup/rollup-linux-ppc64-musl": "4.57.1", + "@rollup/rollup-linux-riscv64-gnu": "4.57.1", + "@rollup/rollup-linux-riscv64-musl": "4.57.1", + "@rollup/rollup-linux-s390x-gnu": "4.57.1", + "@rollup/rollup-linux-x64-gnu": "4.57.1", + "@rollup/rollup-linux-x64-musl": "4.57.1", + "@rollup/rollup-openbsd-x64": "4.57.1", + "@rollup/rollup-openharmony-arm64": "4.57.1", + "@rollup/rollup-win32-arm64-msvc": "4.57.1", + "@rollup/rollup-win32-ia32-msvc": "4.57.1", + "@rollup/rollup-win32-x64-gnu": "4.57.1", + "@rollup/rollup-win32-x64-msvc": "4.57.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT", + "peer": true + }, + "node_modules/sax": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.4.tgz", + "integrity": "sha512-1n3r/tGXO6b6VXMdFT54SHzT9ytu9yr7TaELowdYpMqY/Ao7EnlQGmAQ1+RatX7Tkkdm6hONI2owqNx2aZj5Sw==", + "license": "BlueOak-1.0.0", + "peer": true, + "engines": { + "node": ">=11.0.0" + } + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/shallow-copy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", + "integrity": "sha512-b6i4ZpVuUxB9h5gfCxPiusKYkqTMOjEbBs4wMaFbkfia4yFv92UKZ6Df8WXcKbn08JNL/abvg3FnMAOfakDvUw==", + "license": "MIT", + "peer": true + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signum": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/signum/-/signum-1.0.0.tgz", + "integrity": "sha512-yodFGwcyt59XRh7w5W3jPcIQb3Bwi21suEfT7MAWnBX3iCdklJpgDgvGT9o04UonglZN5SNMfJFkHIR/jO8GHw==", + "license": "MIT", + "peer": true + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "optional": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" + }, + "node_modules/stack-trace": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", + "integrity": "sha512-vjUc6sfgtgY0dxCdnc40mK6Oftjo9+2K8H/NG81TMhgL392FtiPA9tn9RLyTxXmTLPJPjF3VyzFp6bsWFLisMQ==", + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/static-eval": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.1.1.tgz", + "integrity": "sha512-MgWpQ/ZjGieSVB3eOJVs4OA2LT/q1vx98KPCTTQPzq/aLr0YUXTsgryTXr4SLfR0ZfUUCiedM9n/ABeDIyy4mA==", + "license": "MIT", + "peer": true, + "dependencies": { + "escodegen": "^2.1.0" + } + }, + "node_modules/stream-parser": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz", + "integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "2" + } + }, + "node_modules/stream-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "peer": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/stream-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT", + "peer": true + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "license": "MIT", + "peer": true + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-split-by": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string-split-by/-/string-split-by-1.0.0.tgz", + "integrity": "sha512-KaJKY+hfpzNyet/emP81PJA9hTVSfxNLS9SFTWxdCnnW1/zOOwiV248+EfoX7IQFcBaOp4G5YE6xTJMF+pLg6A==", + "license": "MIT", + "peer": true, + "dependencies": { + "parenthesis": "^3.1.5" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strongly-connected-components": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strongly-connected-components/-/strongly-connected-components-1.0.1.tgz", + "integrity": "sha512-i0TFx4wPcO0FwX+4RkLJi1MxmcTv90jNZgxMu9XRnMXMeFUY1VJlIoXpZunPUvUUqbCT1pg5PEkFqqpcaElNaA==", + "license": "MIT", + "peer": true + }, + "node_modules/supercluster": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz", + "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==", + "license": "ISC", + "peer": true, + "dependencies": { + "kdbush": "^3.0.0" + } + }, + "node_modules/supercluster/node_modules/kdbush": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz", + "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew==", + "license": "ISC", + "peer": true + }, + "node_modules/superscript-text": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/superscript-text/-/superscript-text-1.0.0.tgz", + "integrity": "sha512-gwu8l5MtRZ6koO0icVTlmN5pm7Dhh1+Xpe9O4x6ObMAsW+3jPbW14d1DsBq1F4wiI+WOFjXF35pslgec/G8yCQ==", + "license": "MIT", + "peer": true + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/svg-arc-to-cubic-bezier": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/svg-arc-to-cubic-bezier/-/svg-arc-to-cubic-bezier-3.2.0.tgz", + "integrity": "sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g==", + "license": "ISC", + "peer": true + }, + "node_modules/svg-path-bounds": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/svg-path-bounds/-/svg-path-bounds-1.0.2.tgz", + "integrity": "sha512-H4/uAgLWrppIC0kHsb2/dWUYSmb4GE5UqH06uqWBcg6LBjX2fu0A8+JrO2/FJPZiSsNOKZAhyFFgsLTdYUvSqQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "abs-svg-path": "^0.1.1", + "is-svg-path": "^1.0.1", + "normalize-svg-path": "^1.0.0", + "parse-svg-path": "^0.1.2" + } + }, + "node_modules/svg-path-bounds/node_modules/normalize-svg-path": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/normalize-svg-path/-/normalize-svg-path-1.1.0.tgz", + "integrity": "sha512-r9KHKG2UUeB5LoTouwDzBy2VxXlHsiM6fyLQvnJa0S5hrhzqElH/CH7TUGhT1fVvIYBIKf3OpY4YJ4CK+iaqHg==", + "license": "MIT", + "peer": true, + "dependencies": { + "svg-arc-to-cubic-bezier": "^3.0.0" + } + }, + "node_modules/svg-path-sdf": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/svg-path-sdf/-/svg-path-sdf-1.1.3.tgz", + "integrity": "sha512-vJJjVq/R5lSr2KLfVXVAStktfcfa1pNFjFOgyJnzZFXlO/fDZ5DmM8FpnSKKzLPfEYTVeXuVBTHF296TpxuJVg==", + "license": "MIT", + "peer": true, + "dependencies": { + "bitmap-sdf": "^1.0.0", + "draw-svg-path": "^1.0.0", + "is-svg-path": "^1.0.1", + "parse-svg-path": "^0.1.2", + "svg-path-bounds": "^1.0.1" + } + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/tinycolor2": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", + "license": "MIT", + "peer": true + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyqueue": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz", + "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==", + "license": "ISC", + "peer": true + }, + "node_modules/to-float32": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/to-float32/-/to-float32-1.1.0.tgz", + "integrity": "sha512-keDnAusn/vc+R3iEiSDw8TOF7gPiTLdK1ArvWtYbJQiVfmRg6i/CAvbKq3uIS0vWroAC7ZecN3DjQKw3aSklUg==", + "license": "MIT", + "peer": true + }, + "node_modules/to-px": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-px/-/to-px-1.0.1.tgz", + "integrity": "sha512-2y3LjBeIZYL19e5gczp14/uRWFDtDUErJPVN3VU9a7SJO+RjGRtYR47aMN2bZgGlxvW4ZcEz2ddUPVHXcMfuXw==", + "license": "MIT", + "peer": true, + "dependencies": { + "parse-unit": "^1.0.1" + } + }, + "node_modules/topojson-client": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/topojson-client/-/topojson-client-3.1.0.tgz", + "integrity": "sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==", + "license": "ISC", + "peer": true, + "dependencies": { + "commander": "2" + }, + "bin": { + "topo2geo": "bin/topo2geo", + "topomerge": "bin/topomerge", + "topoquantize": "bin/topoquantize" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD", + "peer": true + }, + "node_modules/type": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", + "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", + "license": "ISC", + "peer": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT", + "peer": true + }, + "node_modules/typedarray-pool": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typedarray-pool/-/typedarray-pool-1.2.0.tgz", + "integrity": "sha512-YTSQbzX43yvtpfRtIDAYygoYtgT+Rpjuxy9iOpczrjpXLgGoyG7aS5USJXV2d3nn8uHTeb9rXDvzS27zUg5KYQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "bit-twiddle": "^1.0.0", + "dup": "^1.0.0" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "license": "MIT" + }, + "node_modules/unquote": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha512-vRCqFv6UhXpWxZPyGDh/F3ZpNv8/qo7w6iufLpQg9aKnQ71qM4B5KiI7Mia9COcjEhrO9LueHpMYjYzsWH3OIg==", + "license": "MIT", + "peer": true + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/update-diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-diff/-/update-diff-1.1.0.tgz", + "integrity": "sha512-rCiBPiHxZwT4+sBhEbChzpO5hYHjm91kScWgdHf4Qeafs6Ba7MBl+d9GlGv72bcTZQO0sLmtQS1pHSWoCLtN/A==", + "license": "MIT", + "peer": true + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT", + "peer": true + }, + "node_modules/vite": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", + "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vt-pbf": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", + "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@mapbox/point-geometry": "0.1.0", + "@mapbox/vector-tile": "^1.3.1", + "pbf": "^3.2.1" + } + }, + "node_modules/weak-map": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/weak-map/-/weak-map-1.0.8.tgz", + "integrity": "sha512-lNR9aAefbGPpHO7AEnY0hCFjz1eTkWCXYvkTRrTHs9qv8zJp+SkVYpzfLIFXQQiG3tVvbNFQgVg2bQS8YGgxyw==", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/webgl-context": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webgl-context/-/webgl-context-2.2.0.tgz", + "integrity": "sha512-q/fGIivtqTT7PEoF07axFIlHNk/XCPaYpq64btnepopSWvKNFkoORlQYgqDigBIuGA1ExnFd/GnSUnBNEPQY7Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "get-canvas-context": "^1.0.1" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/world-calendars": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/world-calendars/-/world-calendars-1.0.4.tgz", + "integrity": "sha512-VGRnLJS+xJmGDPodgJRnGIDwGu0s+Cr9V2HB3EzlDZ5n0qb8h5SJtGUEkjrphZYAglEiXZ6kiXdmk0H/h/uu/w==", + "license": "MIT", + "peer": true, + "dependencies": { + "object-assign": "^4.1.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC", + "peer": true + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a5cbfbc9c14b8b2425aaddb55db62277cfb9e87f --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "moz-todo-react", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@tensorflow/tfjs": "^4.22.0", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "react-plotly.js": "^2.6.0" + }, + "devDependencies": { + "@eslint/js": "^9.39.1", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "vite": "^7.3.1" + } +} diff --git a/public/vite.svg b/public/vite.svg new file mode 100644 index 0000000000000000000000000000000000000000..e7b8dfb1b2a60bd50538bec9f876511b9cac21e3 --- /dev/null +++ b/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/App.css b/src/App.css new file mode 100644 index 0000000000000000000000000000000000000000..1b23f42c42c68f129e6d6a3df7b9d0ce4575af38 --- /dev/null +++ b/src/App.css @@ -0,0 +1,12 @@ +h1 { + font-size: 40px; + font-weight: bold; + text-align: left; +} + +.main-container { + flex: 1; + display: grid; + grid-template-columns: 2fr 1fr; + gap: 2rem; +} diff --git a/src/App.jsx b/src/App.jsx new file mode 100644 index 0000000000000000000000000000000000000000..76aeaf4b716bcbc8fbcea810681e6ed602ac3f2c --- /dev/null +++ b/src/App.jsx @@ -0,0 +1,30 @@ +import './App.css' +import ConvolutionVisualizer from "./components/convolution/ConvolutionVisualizer.jsx" +import NetworkVisualizer from "./components/network/NetworkVisualizer.jsx" +import Tabs from "./components/Tabs/Tabs.jsx" + + +function App() { + const tabData = [ + { + label: "Convolution", + content: , + }, + { + label: "Network", + content: , + }, + ]; + + return ( + <> +

CNN Visualizer

+ + + ) +} + +export default App; diff --git a/src/assets/cnn.png b/src/assets/cnn.png new file mode 100755 index 0000000000000000000000000000000000000000..1ac0a3ea57c554009ef3e4ace780a174cdb216d3 Binary files /dev/null and b/src/assets/cnn.png differ diff --git a/src/assets/decision_boundary.svg b/src/assets/decision_boundary.svg new file mode 100755 index 0000000000000000000000000000000000000000..922839742e6f093588467d8b64e14ba8d1ee66cc --- /dev/null +++ b/src/assets/decision_boundary.svg @@ -0,0 +1,30938 @@ + + + + + + + + 2025-11-10T05:15:00.163093 + image/svg+xml + + + Matplotlib v3.10.6, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/gaussian_processes.png b/src/assets/gaussian_processes.png new file mode 100755 index 0000000000000000000000000000000000000000..a8f6acae2d9ac60210070344b7a79c2e6294e9ea Binary files /dev/null and b/src/assets/gaussian_processes.png differ diff --git a/src/assets/mario.png b/src/assets/mario.png new file mode 100644 index 0000000000000000000000000000000000000000..7cf9536616d12d3f660cdb24ad5f4f285d425e8c Binary files /dev/null and b/src/assets/mario.png differ diff --git a/src/assets/mlp.png b/src/assets/mlp.png new file mode 100755 index 0000000000000000000000000000000000000000..f64ebd5cbd75a9c914b8819df2c6296a99ab8643 Binary files /dev/null and b/src/assets/mlp.png differ diff --git a/src/assets/optimization.png b/src/assets/optimization.png new file mode 100755 index 0000000000000000000000000000000000000000..0197a61887dbc9187947648529fb062949569d8d Binary files /dev/null and b/src/assets/optimization.png differ diff --git a/src/assets/react.svg b/src/assets/react.svg new file mode 100644 index 0000000000000000000000000000000000000000..6c87de9bb3358469122cc991d5cf578927246184 --- /dev/null +++ b/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/regularization.png b/src/assets/regularization.png new file mode 100755 index 0000000000000000000000000000000000000000..16e9b3de2831500e282fe921fbb4dd648c6b82c8 Binary files /dev/null and b/src/assets/regularization.png differ diff --git a/src/components/Button/Button.css b/src/components/Button/Button.css new file mode 100644 index 0000000000000000000000000000000000000000..66f1e2cd832fb47f68de9c07de27fffd0b648e6a --- /dev/null +++ b/src/components/Button/Button.css @@ -0,0 +1,21 @@ +.app-button { + padding: 8px 16px; + background-color: #f0f0f0; + border: none; + border-radius: 8px; + cursor: pointer; + font-size: 1rem; +} + +.app-button:focus { + outline: none; +} + +.app-button:hover { + outline: 1px solid orange; +} + +.app-button.selected { + background-color: orange; + color: white; +} diff --git a/src/components/Button/Button.jsx b/src/components/Button/Button.jsx new file mode 100644 index 0000000000000000000000000000000000000000..eda413095a06b50a75768272c4112b666a9894be --- /dev/null +++ b/src/components/Button/Button.jsx @@ -0,0 +1,22 @@ +import "./Button.css"; + +export default function Button(props) { + const { + selected = false, + children, + className = "", + ...rest + } = props; + + const classes = [ + "app-button", + selected ? "selected" : "", + className + ].join(" "); + + return ( + + ); +} diff --git a/src/components/Switch/Switch.css b/src/components/Switch/Switch.css new file mode 100644 index 0000000000000000000000000000000000000000..df62b50c075f906925cf3db97cbffa433d7e5e4e --- /dev/null +++ b/src/components/Switch/Switch.css @@ -0,0 +1,49 @@ +.switch-container { + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + font-size: 16px; + user-select: none; +} + +.switch { + position: relative; + width: 70px; + height: 36px; +} + +.switch input { + opacity: 0; + width: 0; + height: 0; +} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: #777; + border-radius: 36px; + transition: background 0.25s; +} + +.slider::before { + position: absolute; + content: ""; + height: 28px; + width: 28px; + left: 4px; + top: 4px; + background: white; + border-radius: 50%; + transition: transform 0.25s; +} + +.switch input:checked + .slider { + background: orange; +} + diff --git a/src/components/Switch/Switch.jsx b/src/components/Switch/Switch.jsx new file mode 100644 index 0000000000000000000000000000000000000000..fcf3b063085bd9955095367ce339d74389cde9c7 --- /dev/null +++ b/src/components/Switch/Switch.jsx @@ -0,0 +1,22 @@ +import "./Switch.css"; + +function Switch(props) { + return ( +
+ {props.leftLabel} + + + + {props.rightLabel} +
+ ); +} + +export default Switch; diff --git a/src/components/Tabs/Tabs.css b/src/components/Tabs/Tabs.css new file mode 100644 index 0000000000000000000000000000000000000000..8db80b0bc1bd5cfa173118f0c27a9e9b1a7f71bc --- /dev/null +++ b/src/components/Tabs/Tabs.css @@ -0,0 +1,38 @@ +.tabs { + display: flex; + flex-direction: column; + height: 100%; +} + +.tab-buttons { + display: flex; + border-bottom: 1px solid #ccc; + margin-bottom: 20px; +} + +.tab-buttons button { + padding: 10px 20px; + border: none; + background: none; + cursor: pointer; + border-radius: 0; + will-change: border-bottom; +} + +.tab-buttons button.active { + border-bottom: 3px solid orange; +} + +.tab-content { + flex: 1; + padding: 20px; + border: none; +} + +.tab-buttons button:focus { + outline: none; +} +.tab-buttons button:focus-visible { + outline: 2px solid orange; +} + diff --git a/src/components/Tabs/Tabs.jsx b/src/components/Tabs/Tabs.jsx new file mode 100644 index 0000000000000000000000000000000000000000..09ee860fd2461c039bcfc6245cee102fe13c7222 --- /dev/null +++ b/src/components/Tabs/Tabs.jsx @@ -0,0 +1,30 @@ +import { useState } from "react"; +import "./Tabs.css"; + +function Tabs(props) { + const [activeTab, setActiveTab] = useState(props.defaultTab); + + return ( +
+
+ {props.tabs.map((tab) => ( + + ))} + + +
+ +
+ {props.tabs.find((tab) => tab.label === activeTab)?.content} +
+
+ ); +} + +export default Tabs; diff --git a/src/components/convolution/ConvolutionViewer.css b/src/components/convolution/ConvolutionViewer.css new file mode 100644 index 0000000000000000000000000000000000000000..5f7a8aed47dd9cf1385dd9a1646521860b284d11 --- /dev/null +++ b/src/components/convolution/ConvolutionViewer.css @@ -0,0 +1,39 @@ +.convolution-viewer { + display: flex; + flex-direction: row; + justify-content: center; + gap: 2rem; + padding: 2rem; +} + +.convolution-viewer-item { + display: flex; + flex-direction: column; + align-items: center; + width: 300px; + height: 340px; + border-radius: 10px; + background: #fafafa; + padding: 1rem; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); + transition: transform 0.2s ease, box-shadow 0.2s ease; + border: 1px solid black; +} + +.convolution-viewer-item h3 { + margin: 0.5rem 0 1rem; + font-size: 1.1rem; + font-weight: 600; + color: #333; + text-align: center; + border-bottom: 2px solid orange; + padding-bottom: 0.3rem; +} + +.convolution-viewer-item img { + flex-grow: 1; + width: 100%; + height: 100%; + max-height: none; + object-fit: contain; +}` diff --git a/src/components/convolution/ConvolutionViewer.jsx b/src/components/convolution/ConvolutionViewer.jsx new file mode 100644 index 0000000000000000000000000000000000000000..454618dd30081a6bcbbf9c7f9d7f7178745fbf13 --- /dev/null +++ b/src/components/convolution/ConvolutionViewer.jsx @@ -0,0 +1,107 @@ +import { useState, useEffect, useRef } from "react"; +import { getImageData, convertToGrayscale } from "../../utils/image"; +import { convolveGray, convolveColor } from "../../utils/convolution"; +import "./ConvolutionViewer.css"; + +function ConvolutionViewer(props) { + const canvasRef = useRef(null); + const [inputUrl, setInputUrl] = useState(null); + const [outputUrl, setOutputUrl] = useState(null); + + // load input image and prepare gray and color image arrays + useEffect(() => { + async function process() { + const canvas = canvasRef.current; + const ctx = canvas.getContext("2d", { willReadFrequently: true }); + const imageData = await getImageData(props.inputImageUrl, canvas, ctx); + + const grayImageData = convertToGrayscale(imageData); + props.setColorImage(imageData); + props.setGrayImage(grayImageData); + } + + process(); + + }, [props.inputImageUrl]); + + // set input image URL for display + useEffect(() => { + if (!props.useColor && !props.grayImage) { + return; + } + if (props.useColor && !props.colorImage) { + return; + } + + const canvas = canvasRef.current; + const ctx = canvas.getContext("2d", { willReadFrequently: true }); + + if (props.useColor) { + ctx.putImageData(props.colorImage, 0, 0); + setInputUrl(canvas.toDataURL()); + } else { + ctx.putImageData(props.grayImage, 0, 0); + setInputUrl(canvas.toDataURL()); + } + }, [props.useColor, props.colorImage, props.grayImage]); + + // perform convolution and set output image URL for display + useEffect( () => { + if (!props.kernel) { + return; + } + const hasInvalid = props.kernel.flat().flat().some( + (v) => + v === "" || + v === null || + v === undefined || + !Number.isFinite(v) + ); + if (hasInvalid) { + return; + } + + if (props.useColor && !props.colorImage) { + return; + } + if (!props.useColor && !props.grayImage) { + return; + } + + const outputImageData = props.useColor + ? convolveColor(props.colorImage, props.kernel) + : convolveGray(props.grayImage, props.kernel[0]); + + // draw output on canvas to get data URL + const canvas = canvasRef.current; + const ctx = canvas.getContext("2d", { willReadFrequently: true }); + canvas.width = outputImageData.width; + canvas.height = outputImageData.height; + ctx.putImageData(outputImageData, 0, 0); + const url = canvas.toDataURL(); + setOutputUrl(url); + + }, [props.useColor, props.grayImage, props.colorImage, props.kernel]); + + return ( +
+
+

Input

+ { inputUrl ? ( + Input + ) : (

Loading...

+ )} +
+
+

Output

+ { outputUrl ? ( + Output + ) : (

Processing...

+ )} +
+ +
+ ); +} + +export default ConvolutionViewer; diff --git a/src/components/convolution/ConvolutionVisualizer.css b/src/components/convolution/ConvolutionVisualizer.css new file mode 100644 index 0000000000000000000000000000000000000000..ee17def710a3fc7d3e7d8d64c276430004b8ffcb --- /dev/null +++ b/src/components/convolution/ConvolutionVisualizer.css @@ -0,0 +1,21 @@ +#root { + max-width: 1280px; + padding: 2rem; + text-align: left; + height: 100%; + display: flex; + flex-direction: column; +} + +h1 { + font-size: 40px; + font-weight: bold; + text-align: left; +} + +.main-container { + flex: 1; + display: grid; + grid-template-columns: 2fr 1fr; + gap: 2rem; +} diff --git a/src/components/convolution/ConvolutionVisualizer.jsx b/src/components/convolution/ConvolutionVisualizer.jsx new file mode 100644 index 0000000000000000000000000000000000000000..29ee8b3f2a16050621070d0330d26736440b7471 --- /dev/null +++ b/src/components/convolution/ConvolutionVisualizer.jsx @@ -0,0 +1,71 @@ +import { useRef, useState } from 'react' +import './ConvolutionViewer.css' +import ConvolutionViewer from "./ConvolutionViewer.jsx" +import Sidebar from "./Sidebar.jsx" + +import marioImage from "../../assets/mario.png"; + + +const DEFAULT_IMAGE = marioImage; + +const DEFAULT_KERNEL = [ + [ + [-1, -1, -1], + [-1, 8, -1], + [-1, -1, -1], + ], + [ + [-1, -1, -1], + [-1, 8, -1], + [-1, -1, -1], + ], + [ + [-1, -1, -1], + [-1, 8, -1], + [-1, -1, -1], + ] +]; + + +function ConvolutionVisualizer() { + const canvasRef = useRef(null); + + const [kernel, setKernel] = useState(DEFAULT_KERNEL); + const [image, setImage] = useState(DEFAULT_IMAGE); + + const [grayImage, setGrayImage] = useState(null); + const [colorImage, setColorImage] = useState(null); + + const [useColor, setUseColor] = useState(true); + + function handleUpload(file) { + const url = URL.createObjectURL(file); + setImage(url); + } + + return ( + <> +
+ + +
+ + + ) +} + +export default ConvolutionVisualizer; diff --git a/src/components/convolution/InputSelector.css b/src/components/convolution/InputSelector.css new file mode 100644 index 0000000000000000000000000000000000000000..04b1095baef50eb03768c72dfa5c353942e0ed4a --- /dev/null +++ b/src/components/convolution/InputSelector.css @@ -0,0 +1,5 @@ +.input-selector { + display: flex; + flex-direction: column; + gap: 30px; +} diff --git a/src/components/convolution/InputSelector.jsx b/src/components/convolution/InputSelector.jsx new file mode 100644 index 0000000000000000000000000000000000000000..c47b9ec86e41a36df8b0b3424c31d84f99965836 --- /dev/null +++ b/src/components/convolution/InputSelector.jsx @@ -0,0 +1,31 @@ +import { useRef } from "react"; +import Switch from "../Switch/Switch.jsx"; +import Button from "../Button/Button.jsx"; +import "./InputSelector.css"; + +function InputSelector(props) { + const fileInputRef = useRef(null); + + return ( +
+ + + props.onUseColor(e)} + leftLabel="Grayscale" + rightLabel="Color" + /> +
+ ); +} + +export default InputSelector; diff --git a/src/components/convolution/KernelEditor.css b/src/components/convolution/KernelEditor.css new file mode 100644 index 0000000000000000000000000000000000000000..f6d83f56ec14403e2ed5560c800adacc0183740c --- /dev/null +++ b/src/components/convolution/KernelEditor.css @@ -0,0 +1,91 @@ +.kernel-editor { + display: flex; + flex-direction: column; + gap: 30px; + padding: 12px; + max-width: fit-content; + align-items: center; +} + +.kernel-matrix { + display: flex; + flex-direction: column; + gap: 8px; +} + +.kernel-row { + display: flex; + gap: 8px; +} + +.kernel-size-options { + border: 1px solid #d0d0d0; + border-radius: 6px; + padding: 8px 12px; + background: #f9f9f9; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); +} + +.kernel-size-options form { + display: flex; + justify-content: space-between; + align-items: center; +} + +.kernel-size-options input[type="number"] { + width: auto; + max-width: 4ch; + margin: 0 8px; +} + +.kernel-cell { + width: 4.5em; + height: 2.4em; + text-align: center; + font-size: 15px; + border: 1px solid #d0d0d0; + border-radius: 6px; + background: white; + transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); +} + +.kernel-cell:hover { + border-color: #888; +} + +.kernel-cell:focus { + outline: none; + border-color: orange; + box-shadow: 0 0 0 3px rgba(0, 120, 255, 0.2); + transform: scale(1.02); +} + +.channel-buttons { + display: flex; + gap: 12px; +} + +.channel-buttons .selected { + background-color: orange; + color: white; +} + +.channel-buttons button:focus { + outline: none; +} + +.channel-buttons button:focus-visible { + outline: 2px solid orange; +} + +/* Remove default spinner arrows */ +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +input[type="number"] { + -moz-appearance: textfield; +} diff --git a/src/components/convolution/KernelEditor.jsx b/src/components/convolution/KernelEditor.jsx new file mode 100644 index 0000000000000000000000000000000000000000..108e7443fe72bddd2971340e8d352237b003fac9 --- /dev/null +++ b/src/components/convolution/KernelEditor.jsx @@ -0,0 +1,121 @@ +import { useState, useEffect } from 'react'; +import PresetSelector from './PresetSelector.jsx'; +import Button from "../Button/Button.jsx"; +import './KernelEditor.css'; + +function KernelEditor(props) { + const [width, setWidth] = useState(props.kernel[0].length); + const [height, setHeight] = useState(props.kernel.length); + + const [selectedChannel, setSelectedChannel] = useState(0); // 0=R, 1=G, 2=B + + function handleChange(channel, row, col, value) { + const newKernel = props.kernel.map((r) => [...r]); + newKernel[channel][row][col] = value === "" ? "" : parseFloat(value); + props.onKernelChange?.(newKernel); + } + + function handleSizeSubmit(event) { + event.preventDefault(); + handleSizeChange(width, height); + } + + function handleSizeChange(newWidth, newHeight) { + const currentWidth = props.kernel[0][0].length; + const currentHeight = props.kernel[0].length; + const newKernel = []; + + for (let c = 0; c < 3; ++c) { + const matrix = []; + for (let i = 0; i < newHeight; ++i) { + const row = []; + for (let j = 0; j < newWidth; ++j) { + if (i < currentHeight && j < currentWidth) { + row.push(props.kernel[c][i][j]); + } else { + row.push(0); + } + } + matrix.push(row); + } + newKernel.push(matrix); + } + + props.onKernelChange?.(newKernel); + } + + useEffect(() => { + if (!props.useColor) { + setSelectedChannel(0); + } + }, [props.useColor]); + + return ( +
+
+
+ Width: {" "} + setWidth(parseInt(e.target.value))} + /> + Height: {" "} + setHeight(parseInt(e.target.value))} + /> + +
+
+ {props.useColor && ( +
+
+ + + +
+
+ )} +
+ {props.kernel[selectedChannel].map((row, i) => ( +
+ {row.map((value, j) => ( + handleChange(selectedChannel, i, j, e.target.value)} + className="kernel-cell" + /> + ))} +
+ ))} +
+ +
+ ); +} + +export default KernelEditor; diff --git a/src/components/convolution/PresetSelector.css b/src/components/convolution/PresetSelector.css new file mode 100644 index 0000000000000000000000000000000000000000..7ddc4530b318c2991fe36ae523b909521984ffba --- /dev/null +++ b/src/components/convolution/PresetSelector.css @@ -0,0 +1,52 @@ +.preset-selector { + display: flex; + align-items: center; + gap: 12px; + + background: #f7f7f7; + padding: 12px 16px; + border-radius: 8px; + border: 1px solid #ddd; + + margin-bottom: 12px; + width: fit-content; +} + +.preset-label { + font-weight: 600; + font-size: 14px; +} + +.preset-dropdown { + padding: 6px 10px; + font-size: 14px; + border-radius: 6px; + border: 1px solid #ccc; + background: white; +} + +.preset-dropdown:focus { + outline: none; +} + +.preset-dropdown:focus-visible { + outline: 2px solid #4e9fff; +} + +.preset-apply { + padding: 6px 14px; + font-size: 14px; + + background: #4e9fff; + color: white; + border: none; + border-radius: 6px; + cursor: pointer; + + transition: background 0.2s; +} + +.preset-apply:hover { + background: #1e7be6; +} + diff --git a/src/components/convolution/PresetSelector.jsx b/src/components/convolution/PresetSelector.jsx new file mode 100644 index 0000000000000000000000000000000000000000..e022702701a238db34f85d09faf91450222b9219 --- /dev/null +++ b/src/components/convolution/PresetSelector.jsx @@ -0,0 +1,55 @@ +import { useState, useEffect } from "react"; +import Button from "../Button/Button.jsx"; +import { PRESETS_COLOR, PRESETS_GRAY } from "../../data/convolution_presets.js"; +import "./PresetSelector.css"; + +function PresetSelector(props) { + const [presetNames, setPresetNames] = useState( + props.useColor + ? Object.keys(PRESETS_COLOR) + : Object.keys(PRESETS_GRAY) + ); + const [selectedPreset, setSelectedPreset] = useState(presetNames[0]); + + function applyPreset() { + if (props.useColor) { + props.onKernelChange(PRESETS_COLOR[selectedPreset]); + } else { + props.onKernelChange(PRESETS_GRAY[selectedPreset]); + } + } + + useEffect(() => { + console.log("PresetSelector: useEffect triggered"); + console.log("useColor:", props.useColor); + const names = props.useColor + ? Object.keys(PRESETS_COLOR) + : Object.keys(PRESETS_GRAY); + setPresetNames(names); + setSelectedPreset(names[0]); + }, [props.useColor]); + + return ( +
+ + + + + +
+ ); +} + +export default PresetSelector; diff --git a/src/components/convolution/Sidebar.css b/src/components/convolution/Sidebar.css new file mode 100644 index 0000000000000000000000000000000000000000..5f4aff5aa012db1f0e43b35fab352ce2e33153dd --- /dev/null +++ b/src/components/convolution/Sidebar.css @@ -0,0 +1,45 @@ +.switch { + position: relative; + display: inline-block; + width: 50px; + height: 24px; +} + +.switch input { + opacity: 0; + width: 0; + height: 0; +} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + transition: .4s; + border-radius: 24px; +} + +.slider:before { + position: absolute; + content: ""; + height: 18px; + width: 18px; + left: 3px; + bottom: 3px; + background-color: white; + transition: .4s; + border-radius: 50%; +} + +input:checked + .slider { + background-color: #4CAF50; +} + +input:checked + .slider:before { + transform: translateX(26px); +} + diff --git a/src/components/convolution/Sidebar.jsx b/src/components/convolution/Sidebar.jsx new file mode 100644 index 0000000000000000000000000000000000000000..d950687cd7718b4072105a42bd2059eb05290f0d --- /dev/null +++ b/src/components/convolution/Sidebar.jsx @@ -0,0 +1,51 @@ +import KernelEditor from "./KernelEditor.jsx"; +import Tabs from "../Tabs/Tabs.jsx"; +import InputSelector from "./InputSelector.jsx"; +import "./Sidebar.css"; + + +const DEFAULT_TAB = "Input"; + +function Sidebar(props) { + const tabData = [ + { + label: "Input", + content: ( + + ), + }, + { + label: "Kernel", + content: ( + + ), + }, + ]; + + function handleFileChange(event) { + const file = event.target.files[0]; + if (file) { + props.onUpload(file); + } + } + + return ( +
+ +
+ ); +} + +export default Sidebar; diff --git a/src/components/network/ArchitectureEditor.css b/src/components/network/ArchitectureEditor.css new file mode 100644 index 0000000000000000000000000000000000000000..e74c09a457a99d90b2ec3a6c3f9576a5167f5cee --- /dev/null +++ b/src/components/network/ArchitectureEditor.css @@ -0,0 +1,69 @@ +.cnn-editor { +max-width: 700px; +margin: 20px auto; +font-family: sans-serif; +} + +.layers { +display: flex; +flex-direction: column; +gap: 20px; +} + +.layer-card { +border: 1px solid #ccc; +padding: 15px; +border-radius: 10px; +background: #fafafa; +} + +.layer-header { +display: flex; +justify-content: space-between; +margin-bottom: 12px; +} + +.layer-grid { +display: grid; +grid-template-columns: 1fr 1fr; +gap: 10px 20px; +} + +.field { +display: flex; +flex-direction: column; +} + +.field label { +font-size: 12px; +margin-bottom: 4px; +color: #555; +} + +.field input, +.field select { +padding: 5px; +border-radius: 5px; +border: 1px solid #ccc; +} + +.add-btn { +margin-top: 20px; +padding: 12px; +width: 100%; +background: #4caf50; +border: none; +color: white; +font-size: 16px; +border-radius: 8px; +cursor: pointer; +} + +.remove-btn { +background: #ff4444; +border: none; +padding: 6px 10px; +color: white; +border-radius: 5px; +cursor: pointer; +} diff --git a/src/components/network/ArchitectureEditor.jsx b/src/components/network/ArchitectureEditor.jsx new file mode 100644 index 0000000000000000000000000000000000000000..8b2e4e409b8a93336c982aafc1aa2a039b123910 --- /dev/null +++ b/src/components/network/ArchitectureEditor.jsx @@ -0,0 +1,29 @@ +import { useState } from "react"; +import Button from "../Button/Button.jsx"; +import "../../styles.css"; + + +function ArchitectureEditor(props) { + const [draft, setDraft] = useState(props.architecture); + + return ( +
+
+ +